text stringlengths 1 1.05M |
|---|
#!/bin/bash
if [[ $DEBUG == true ]]; then
set -ex
else
set -e
fi
chmod +x om-cli/om-linux
CMD=./om-cli/om-linux
$CMD -t https://$OPS_MGR_HOST -k -u $OPS_MGR_USR -p $OPS_MGR_PWD apply-changes --ignore-warnings true
|
cd segger && sh install.sh
|
<gh_stars>1-10
def solution(S):
rs = ""
for i in S:
if i != " ":
rs += i
else:
rs += "%20"
return rs
S = "Mr <NAME>"
print(solution(S))
|
<reponame>googleapis/googleapis-gen<filename>google/example/library/v1/google-cloud-example-library-v1-ruby/lib/google/example/library/v1/library_pb.rb
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/example/library/v1/library.proto
require 'google/api/annotations_pb'
require 'google/api/cl... |
#!/bin/bash
set -aueo pipefail
if [ ! -f .env ]; then
echo -e "\nThere is no .env file in the root of this repository."
echo -e "Copy the values from .env.example into .env."
echo -e "Modify the values in .env to match your setup.\n"
echo -e " cat .env.example > .env\n\n"
exit 1
fi
# shellchec... |
from flask import Flask, request, jsonify
app = Flask(__name__)
items = []
@app.route('/items', methods=['POST'])
def create_item():
data = request.get_json()
item = {'name': data['name'], 'price': data['price']}
items.append(item)
return jsonify(item)
@app.route('/items/<string:name>')
def get_item(name):
... |
<gh_stars>0
'use strict';
const _ = require('lodash');
const ObjectID = require("bson-objectid");
const {BAD_REQUEST, PRECONDITION_FAILED} = require('../../../config/errors');
const findLandings = require('./helpers/find-landings');
const getLandingMeta = require('./helpers/get-landing-meta');
const updateLandingData... |
=begin rdoc
Base
This handles user interaction, loading the parameters, etc.
=end
require "open-uri"
require "ftools"
module PoolParty
class Base
include Configurable
extend MethodMissingSugar
default_options({
:user => "root", # This should change here
:base_keypair_path => "#{ENV["H... |
<filename>src/data/legendary/slot/quiver.js
var quiver = [
{
name:"<NAME>",
type:"Quiver",
weight:0,
hc:false,
season:false,
craft:{
rp:40,ad:38,vc:30,fs:2
},
smartLoot:[
"Demon Hunter"
],
primary:{
AttackSpeed:null,
CritChance:null,
EliteDamage:{
min:5,
max:8
},
RANDOM... |
#!/bin/sh
#
#-----------------------BEGIN NOTICE -- DO NOT EDIT-----------------------
# NASA Goddard Space Flight Center Land Information System (LIS) v7.1
#
# Copyright (c) 2015 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
... |
#include <iostream>
using namespace std;
int main()
{
int arr[] = {-2, 1, 3, -5, 6};
int n = sizeof(arr) / sizeof(arr[0]);
int maxSum = 0;
for (int i = 0; i < n; i++)
{
int sum = 0;
for (int j = i; j < n; j++)
{
sum += arr[j];
maxSum = max(maxSum, s... |
#!/usr/bin/bash
logdirroot='/home/r2h2/logs/thermos'
lastlogfp='/var/log/sample_temp/lastlog'
sampling_interval=300
function main() {
while true; do
local todaydir=$(date --iso-8601)
mkdir -p $logdirroot/$todaydir
local fn=$(date --iso-8601=minutes)
fp=$logdirroot/$todaydir/$fn
write_temp
r... |
python train/train.py \
test-stl-nw-m-db-l-0 \
--experiment-name=test-stl-nw-m-db-l-0 \
--num-env-steps=100000000 \
--algo=ppo \
--use-gae \
--lr=2.5e-4 \
--clip-param=0.1 \
--value-loss-coef=0.5 \
--num-processes=100 \
--eval-num-processes=50 \
--num-steps=500 \
--num-mi... |
package notes
import (
"context"
"fmt"
"sort"
"time"
)
func Top(ctx context.Context, limit int, notes <-chan Note, less Less) (note <-chan Note, errors <-chan error) {
out := make(chan Note)
errs := make(chan error)
go func() {
defer close(out)
defer close(errs)
slice := collectNotes(ctx, notes)
sortN... |
#!/bin/sh
if [[ ! -f "/certs/cert.pem" ]]; then
mkdir -p /certs
cd /certs/
generate_cert --cert=ca.pem --key=cakey.pem
hostlist="$(ip a | grep "inet " | sed 's/.*inet \(.*\)\/.*/\1/g' | tr "\n" ",")$(hostname)"
generate_cert --host=${hostlist} --ca=ca.pem --ca-key=cakey.pem --cert=servercert.pem --key=serverkey.p... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
<filename>Scripts/js/cmds/view-alias-path/index.js
const { chalk, configPaths, polyfills } = require('../../helpers');
polyfills.load("stringCut");
const parsePath = (path, maxPathSize) => {
if (path.length < maxPathSize) return path;
const max = Math.floor((maxPathSize - 2) / 2);
const head = path.head(max);
con... |
<gh_stars>0
import { call, put, takeLatest, all } from 'redux-saga/effects';
import { getRequest } from 'utils/request';
import { object } from 'prop-types';
import {
FETCH_ALPS_CLASS_LIST_SUCCESS,
FETCH_ALPS_CLASS_LIST_FAIL,
FETCH_ALPS_CLASS_STUDENT_LIST_SUCCESS,
FETCH_ALPS_CLASS_STUDENT_LIST_FAIL,
FETCH_ALP... |
<reponame>drago2308/WaniKani-Classroom<gh_stars>0
$(document).ready(function(){
size();
/* Search Stuff */
$('.submit-search-button').click(function(){
//Get VARIABLES
var suburb_or_town = $('.form-search-suburb').val();
var property_category = $('.form-search-type').val();
var min_price = $('.form-search-m... |
<gh_stars>0
package xyz.brassgoggledcoders.opentransport.api.transporttypes;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import xyz.brassgoggledcoders.opentransport.api.blockwrappers.IBlockWrapper;
import javax.annotation.Nonnull;
import java.util.Map;
public interface ITranspo... |
package store;
import org.apache.commons.lang3.SerializationUtils;
import utils.StringUtil;
public class MerkleTrie implements Trie{
private Node root;
private DataStore db;
public MerkleTrie(DataStore db){
this.db = db;
root = new Node();
db.put(root.getHash(), root.serialize());... |
<reponame>GeneralNZR/maths-and-javascript
/**
* Différentes fonctions pour manipuler des matrices.
* @author <NAME>
* @version 1.0
*/
/** *
* @description Matrice identité.
* @param {number} n - Dimension de la matrice.
* @return {Array} La matrice identité.
*/
const matriceIdentite = (n) => {
let matrice ... |
<reponame>cstoquer/rtc-cars
var express = require('express');
var http = require('http');
var io = require('socket.io');
var app = express();
app.set('port', process.env.PORT || 3000);
app.use(express.favicon());
app.use('/', express.static(process.cwd() + '/www'));
//█████████████████████████... |
package com.acgist.snail.net.application;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.acgist.snail.config.SystemConfig;
import com.acgist.snail.net.TcpClient;
import com.acgist.snail.pojo.message.ApplicationMessage;
import com.acgist.snail.utils.NetUtils;
/**
* <p>系统客户端</p>
*
* @author ac... |
<reponame>schnappischnap/Advent-of-Code-2016<gh_stars>0
def dragon_curve(s):
b = "".join("0" if c == "1" else "1" for c in s[::-1])
return s + "0" + b
def checksum(s):
output = ""
for i in range(0, len(s), 2):
output += "1" if s[i] == s[i+1] else "0"
if len(output) % 2 == 1:
return... |
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
/**
* Defines constants that can be used in the processing of speech interactions.
*/
export declare class SpeechConstants {
/**
* The xml tag structure to indicate an empty speak tag, to be used ... |
#!/bin/sh
cd /home/pi/Documents/escapetools/doublecountdown/
npm start
# | chromium-browser --noerrdialogs --kiosk http://localhost:3000/player/green
|
#############################################################################
# Bash script using Azure CLI to create a document in CosmosDB
# Docs: https://docs.microsoft.com/en-us/rest/api/cosmos-db/create-a-document
#############################################################################
comsosDbInstanceName=$... |
class MovesAppOAuthDisconnect(views.OAuthDisconnectView):
"""
View that handles the disconnect of a Moves app account.
"""
client_class = MovesAppClient # Set the client_class attribute to the MovesAppClient class
setup_url = SETUP_URL_NAME # Define and set the setup_url variable to the value of S... |
using System;
internal interface ILugar
{
string Direccion { get; set; }
}
internal class Lugar : ILugar
{
public string Direccion { get; set; }
public Lugar()
{
Direccion = string.Empty;
}
public void SetAddress(string address)
{
Direccion = address;
}
public vo... |
//! Constructor
template <unsigned Tdim>
mpm::MPMSchemeNewmark<Tdim>::MPMSchemeNewmark(
const std::shared_ptr<mpm::Mesh<Tdim>>& mesh, double dt)
: mpm::MPMScheme<Tdim>(mesh, dt) {}
//! Initialize nodes, cells and shape functions
template <unsigned Tdim>
inline void mpm::MPMSchemeNewmark<Tdim>::initialise() {
#... |
class AirflowNetworkDistributionComponentCoil:
def __init__(self):
# Set validation level to error
pyidf.validation_level = ValidationLevel.error
# Initialize attributes
self.coil_name = "object-list|Coil Name"
self.coil_object_type = "Coil:Cooling:DX:SingleSpeed"
se... |
#!/usr/bin/env bash
python manage.py collectstatic --settings=config.settings.docker |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.db import models
from django.utils.encoding import python_2_unic... |
<reponame>Nelias/smashing-ui<filename>stories/badge.stories.js<gh_stars>0
import React from 'react'
import {storiesOf, addDecorator} from '@storybook/react'
import {Badge} from '@smashing/badge'
import {withA11y} from '@storybook/addon-a11y'
import {SmashingThemeProvider} from '@smashing/theme'
addDecorator(withA11y)
... |
def findMaxElement(arr):
max_element = arr[0]
for i in range(1, len(arr)):
if arr[i] > max_element:
max_element = arr[i]
return max_element
result = findMaxElement([2, 3, 5, 4, 9])
print(result) |
<gh_stars>0
package de.unibi.agbi.biodwh2.dgidb;
import de.unibi.agbi.biodwh2.core.DataSource;
import de.unibi.agbi.biodwh2.core.etl.GraphExporter;
import de.unibi.agbi.biodwh2.core.etl.Parser;
import de.unibi.agbi.biodwh2.core.etl.RDFExporter;
import de.unibi.agbi.biodwh2.core.etl.Updater;
import de.unibi.agbi.biodwh... |
#!/bin/bash
cd "$(dirname "$0")"
cd ..
###################################################################################
### WINDOW SETUP
###################################################################################
i3-msg "workspace 7" &>/dev/null
i3-msg "split h" &>/dev/null
sleep 0.1
i3-msg "kill" &>/de... |
#!/usr/bin/env bash
# 1. Parse command line arguments
# 2. cd to the test directory
# 3. run tests
# 4. Print summary of successes and failures, exit with 0 if
# all tests pass, else exit with 1
# Uncomment the line below if you want more debugging information
# about this script.
#set -x
# The name of this test ... |
package loglevel
import (
"fmt"
"io"
"log"
"strings"
)
// Logger defines our wrapper around the system logger
type Logger struct {
priority int
prefix string
logger *log.Logger
}
// New creates a new Logger.
func New(out io.Writer, prefix string, flag int, priority int) *Logger {
return &Logger{
priori... |
public <T> T processTransaction(Object... input) throws IllegalArgumentException {
if (input.length < 1) {
throw new IllegalArgumentException("Invalid input: At least one parameter is required");
}
if (input[0] instanceof String && "put".equals(input[0])) {
if (input.length == 2 && input[1]... |
<reponame>pageobject-io/pageobject-generator<gh_stars>10-100
'use strict';
const expect = require('chai').expect;
const LinkTextLocatorStrategy = require('../../../lib/protractor/locator/link-text-locator-strategy');
const locator = require('../../locator/locator-strategy-spec-helper');
describe('LinkTextLocatorStrat... |
for (let i = 0; i <= 10; i++) {
console.log(i);
} |
<reponame>ernestyalumni/CompPhys
/**
* PDE.h
* \file PDE.h
* Navier-Stokes equation solver in 2-dimensions, incompressible flow, by Lattice Boltzmann method
* \brief PDE, partial differential equation, dynamics
* Simulation of flow inside a 2D square cavity using the lattice Boltzmann method (LBM)
* \author <NA... |
require 'will_paginate/array'
class CamaleonCms::Admin::CommentsController < CamaleonCms::AdminController
include CamaleonCms::CommentHelper
add_breadcrumb I18n.t("camaleon_cms.admin.sidebar.comments"), :cama_admin_comments_url
before_action :validate_role
before_action :set_post, except: :list
before_action ... |
#!/usr/bin/expect
#*******************************************************************************
# Copyright 2017 Talentica Software Pvt. Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a... |
project_name="cplusplus_acl_execute_gemm"
model_name="0_GEMM_1_2_16_16_1_2_16_16_1_2_16_16_1_2_1_2_1_2_16_16"
version=$1
script_path="$( cd "$(dirname $BASH_SOURCE)" ; pwd -P)"
project_path=${script_path}/..
declare -i success=0
declare -i inferenceError=1
declare -i verifyResError=2
function setAtcEnv() {
# 设置模... |
#!/bin/bash
# -*-mode: Shell-script; indent-tabs-mode: nil; sh-basic-offset: 2 -*-
# Find the base directory while avoiding subtle variations in $0:
dollar0=`which $0`; PACKAGE_DIR=$(cd $(dirname $dollar0); pwd) # NEVER export PACKAGE_DIR
# Set defaults for BUILD_DIR and INSTALL_DIR environment variables and
# define... |
#!/bin/bash
python3 four_in_a_row_online/backend/server.py &
server_pid=$!
sleep 5s
while true
do
four_in_a_row_online/tools/repo_updated.sh
if [ $? == 0 ]
then
echo "Repo has been updated. Service will restart server (pid $server_pid)."
kill $server_pid
python3 four_in_a_row_online/backend/server.py &
ser... |
function baseConverter(num, base) {
let converted = '';
while (num > 0) {
let rem = num % base;
num = Math.floor(num / base);
converted = rem.toString(base) + converted;
}
return converted;
}
// Usage
baseConverter(10, 2); // Output: "1010" |
<filename>sites/docs/decks/demo/theme.js
export default {
colors: { text: "#0D0543" },
styles: { a: { color: "text" } }
};
|
<filename>src/components/prendus-assignment/prendus-unauthorized-modal.ts<gh_stars>0
import {
AuthResult
} from '../../prendus.d';
import {
navigate
} from '../../node_modules/prendus-shared/services/utilities-service';
class PrendusUnauthorizedModal extends Polymer.Element {
open: boolean;
result: AuthResult;... |
public class Solution {
public static int sum(int x, int y) {
return x + y;
}
} |
#!/bin/bash
# Mostly this just copies the below XML, but inserting random MAC address
# and UUID strings, and other options as appropriate.
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
. "${SCRIPT_ROOT}/common.sh" || exit 1
DEFINE_string vm_name "CoreOS" "Name for this VM"
DEFINE_string disk_vmdk "" "Disk image to ... |
<gh_stars>1000+
package cmd
import "github.com/spf13/cobra"
// getCmd represents the send command
var getCmd = &cobra.Command{
Use: "get [event | project | projects | stage | stages | service | services]",
Short: "Displays an event or Keptn entities such as project, stage, or service",
Long: `Displays an event ... |
<reponame>sebastianbrunnert/Advanced-Shuffle
import { Component, OnInit } from '@angular/core';
import { AppComponent } from '../app.component';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
co... |
<reponame>rainmaple/duckdb
#include "catch.hpp"
#include "duckdb/common/file_system.hpp"
#include "dbgen.hpp"
#include "test_helpers.hpp"
using namespace duckdb;
using namespace std;
TEST_CASE("MonetDB Test: update_with_correlated_subselect.SF-1284791.sql", "[monetdb]") {
unique_ptr<QueryResult> result;
DuckDB db(n... |
<gh_stars>0
package com.tactbug.ddd.common.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import java.io.IOException;
import java.net.URI;
import java.net.UnknownServiceException;
import java.net.http.HttpClient;
import java.net.http.HttpRequest... |
<filename>src/tools/deep-clone.ts
const cloneDeep = require('clone-deep')
export function deepClone<T>(src: T) {
return cloneDeep(src) as T
}
|
def binary_search(sorted_arr, target)
low = 0
high = sorted_arr.length - 1
while low <= high
mid = low + (high - low) / 2
if target == sorted_arr[mid]
return mid
elsif target < sorted_arr[mid]
high = mid - 1
else
low = mid + 1
end
end
return -1
end
sorted_arr = [1, 3, 5,... |
// Define the payload structure for EzsigntemplatepackagemembershipCreateObjectV1Response
public struct EzsigntemplatepackagemembershipCreateObjectV1ResponseMPayload: Codable, Hashable {
// Define properties for EzsigntemplatepackagemembershipCreateObjectV1ResponseMPayload
// ...
}
// Define the debug payload ... |
<filename>musiclibrary/src/main/java/com/cyl/musiclake/ui/zone/EditActivity.java
package com.cyl.musiclake.ui.zone;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
import com.cyl.musiclake.R;
import com.cyl.musiclake.R2;
import com.cyl.musiclake.b... |
<filename>src/main/java/org/quark/microapidemo/business/AbstractBusinessService.java
package org.quark.microapidemo.business;
import java.time.*;
public abstract class AbstractBusinessService {
protected class SearchDateStamp {
public SearchDateStamp(ZonedDateTime beginDate, ZonedDateTime endDate) {
... |
def insertionSort(arr):
# Iterate over the entire array
for i in range(1, len(arr)):
key = arr[i]
# Move elements of arr[0..i-1], that are
# greater than key, to one position ahead
# of their current position
j = i-1
while j >=0 and key < arr[j] :
... |
import { VersionedObject } from './versioned-object.js';
/**
* @class
* @name pc.ScopeId
* @classdesc The scope for a variable.
* @param {string} name - The variable name.
* @property {string} name The variable name.
*/
function ScopeId(name) {
// Set the name
this.name = name;
// Set the default va... |
<reponame>akovari/reactive-data-federation-poc
package com.github.akovari.rdfp.api.ql.db
import com.github.akovari.rdfp.api.ql.UQLContext
import com.github.akovari.rdfp.api.ql.UQLContext.IllegalUQLFieldException
import com.github.akovari.typesafeSalesforce.query.SimpleColumn
import com.typesafe.config.ConfigFactory
im... |
#!/usr/bin/env bash
status=$(playerctl status)
artist=$(playerctl metadata artist)
title=$(playerctl metadata title)
if [ "$status" = "Playing" ]; then
echo "$artist" - "$title"
elif [ "$status" = "Paused" ]; then
echo " $artist" - "$title"
fi
|
<filename>24-Redux/src/actions/actionTypes.js
export const CLICK_UPDATE_VALUE = 'CLICK_UPDATE_VALUE' |
#!/bin/bash
# This script ensures that a tansparent Tor proxy is running
# and that requests are routed via the proxy.
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
# Output colors
NORMAL="\\033[0;39m"
RED="\\033[1;31m"
BLUE="\\033[1;34m"
GREEN="\\033[1;32m"
log_info() {
echo ""
echo -e "$BLUE > $1 $NORMAL"
}
lo... |
<reponame>khatchadourian-lab/guava
/*
* Copyright (C) 2008 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless... |
require 'spec_helper'
require 'fileutils'
include Gitignores
describe GitignoreBuilder do
before :each do
@builder = GitignoreBuilder.new
end
# Really simple test because I'm a Ruby newb
describe "#new" do
it "creates a new GitignoreBuilder" do
expect(@builder).to be_an_instance_of GitignoreBui... |
'''
Functions to help validate inputs.
'''
from typing import Iterable
def validate_spacy_pos(pos_list: Iterable[str]):
valid_pos = set(['ADV', 'NOUN', 'PRON', 'PROPN', 'VERB', 'ADJ'])
invalid_pos = set()
for pos in pos_list:
if pos not in valid_pos:
invalid_pos.add(pos)
if ... |
#!/bin/bash
while true; do
read -p "Proceed [Y/n]? " YN
case $YN in
[Yy]* )
# Proceed with the action
echo "Action will be executed."
break
;;
[Nn]* )
# Do not proceed with the action
echo "Action canceled."
bre... |
<reponame>munaweralimy/HRMS
export { default as AES } from "crypto-js/aes";
export { default as encUTF8 } from "crypto-js/enc-utf8";
|
<gh_stars>0
/*
* @(#)Request.java 1.2 04/07/26
*
* Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* -Redistribution of source code must retain... |
package renterutil
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"testing"
"testing/iotest"
"lukechampine.com/frand"
"lukechampine.com/us/ghost"
"lukechampine.com/us/renterhost"
)
func createTestingKV(tb testing.TB, m, n int) (PseudoKV, func()) {
tb.Helper()
hosts :=... |
def bubble_sort(list):
for x in range(len(list)-1, 0, -1):
for y in range(x):
if list[y] > list[y+1]:
list[y], list[y+1] = list[y+1], list[y]
return list
list = [4,7,2,9,1]
print(bubble_sort(list))
##
12. Instruction: Generate a Rust program to calculate the mean of relevant values in a list.
12. Input:
... |
<reponame>4bstr4ct/pirmoji-uzduotis
var searchData=
[
['byte_0',['byte',['../types_8hpp.html#ab8c0ff86630b523dce3ba1724f97f397',1,'vu']]]
];
|
package validator
import (
"regexp"
"github.com/go-playground/validator/v10"
)
func IsValidDynamoDBTable(fl validator.FieldLevel) bool {
table := fl.Field().String()
if len(table) < 3 || len(table) > 255 {
return false
}
if isInList(dynamoDBReservedWords(), table) {
return false
}
match, _ := regexp.M... |
#!/bin/bash
if [ -v EXTRA_REQS ]; then
pip install $EXTRA_REQS
fi
# select test to run with TEST_TYPE, memory pg mysql pylint
# only memory will include coverage for now
function run_test {
if [ "$2" == "coverage" ]; then
TEST_ARGS="--with-coverage --cover-package=tardis $TEST_ARGS"
fi
python test.p... |
<gh_stars>10-100
/**
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... |
package ch15;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.Line2D;
import java.util.Random;
import static java.awt.Color.*;
import static java.awt.BasicStroke.*;
/**
* Project: ch15
* Date: 2/27/2018
*
* @author <NAME>
*/
public class ex152a extends JApplet
{
private final static int CO... |
from flask_praetorian import Praetorian
guard = Praetorian()
|
static int SumArray(int[,] arr)
{
// Variables to store the sum
int sum = 0;
// Iterate over array elements
for (int i = 0; i < arr.GetLength(0); i++)
for (int j = 0; j < arr.GetLength(1); j++)
sum += arr[i, j];
// Return the sum
return sum;
} |
import ZubhubAPI from '../../api';
import { toast } from 'react-toastify';
const API = new ZubhubAPI();
/**
* @function setAuthUser
* @author <NAME> <<EMAIL>>
*
* @todo - describe function's signature
*/
export const setAuthUser = auth_user => {
return dispatch => {
dispatch({
type: 'SET_AUTH_USER',
... |
// Generated from /home/clustfuzz/Documents/LLVM/KLEE-KQueryParser/langRef/kquery.g4 by ANTLR 4.8
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.*;
impor... |
import {
GraphQLBoolean,
GraphQLSchema,
GraphQLID,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
GraphQLObjectType,
GraphQLString,
GraphQLEnumType,
} from 'graphql'
import * as keystoneTypes from './keystoneTypes'
import keystone from 'keystone'
const Carousel = keystone.list('Carousel-... |
package com.semmle.js.ast.json;
import com.semmle.js.ast.SourceLocation;
import java.util.List;
/** A JSON array. */
public class JSONArray extends JSONValue {
private final List<JSONValue> elements;
public JSONArray(SourceLocation loc, List<JSONValue> elements) {
super("Array", loc);
this.elements = ele... |
<filename>src/components/Profile/ViewProfile/index.js<gh_stars>0
import React, { useEffect } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useParams } from "react-router-dom";
import { clearUserProfile, getUserProfileData } from "../../../store/actions";
import { useFirebase, useFirest... |
<reponame>robisacommonusername/SVGBuilder
require_relative '../Base/SVGTextContainer'
class SVG < SVGAbstract::SVGContainer
class Text < SVGAbstract::SVGTextContainer
def initialize(x=0,y=0,txt=nil,do_escape=true)
super do_escape
@name = 'text'
@attributes.merge!({
:x => x,
:y => y,
})
@t... |
<reponame>dima7a14/FamilyBudget-client
const rewireReactHotLoader = require('react-app-rewire-hot-loader');
/* config-overrides.js */
module.exports = function override(config, env) {
config = rewireReactHotLoader(config, env)
// see https://github.com/gaearon/react-hot-loader#react--dom
config.resolve.alias =... |
#!/bin/bash
export VAGRANT_HOME=/home/vagrant
export TERPTUBE_HOME=$VAGRANT_HOME/dev-work/workspace/terptube/trunk
cd $VAGRANT_HOME && \
sudo chown -R vagrant:vagrant ./ && \
cd $TERPTUBE_HOME && \
rm -rf app/cache/* app/logs/* && \
sudo chown -R `whoami`:www-data app/cache app/logs && \
chmod -R 775 app/cache app/lo... |
<reponame>ksmit799/POTCO-PS<filename>pirates/uberdog/AITrade.py
# File: A (Python 2.4)
from AITradeBase import AITradeBase
from pirates.uberdog.UberDogGlobals import *
from pirates.reputation import ReputationGlobals
from direct.directnotify.DirectNotifyGlobal import directNotify
from pirates.piratesbase import Freebo... |
#!/usr/bin/env bash
set -e
source 'approvals.bash'
cd ./fixtures/empty-dir
describe "op --edit"
original_editor=$EDITOR
export EDITOR="echo stubbed editor with: "
approve "op --edit"
export EDITOR=$original_editor
|
#!/bin/bash
if [ "$1" == "-v" ]; then
echo "gcov (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
fi
echo "{bad json" # Pretend gcov crashed or was killed |
<filename>pages/opengraph/user/[username].tsx
import useGalleries from 'hooks/api/galleries/useGalleries';
import useUser from 'hooks/api/users/useUser';
import { useRouter } from 'next/router';
import { OpenGraphPreview } from 'components/opengraph/OpenGraphPreview';
export default function OpenGraphUserPage() {
co... |
<reponame>dailynodejs/ice-scripts<gh_stars>10-100
const c = require('./c.plugin');
module.exports = {
publicPath: '/',
plugins: [
'./a.plugin',
['./b.plugin', { alias: 'b' }],
c,
],
};
|
/**
* KML Plugin mantle controller classes.
*/
package io.opensphere.kml.mantle.controller;
|
<gh_stars>0
# The Book of Ruby - http://www.sapphiresteel.com
# Show string representations of various objects
# using the to_s method
class Treasure
def initialize( aName, aDescription )
@name = aName
@description = aDescription
end
# This time we won't override to_s so t... |
#!/bin/bash
set -e
SOLR_HOST="${SOLR_HOST:-localhost}"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SOLR7_VERSIONS="7.6 7.5"
SOLR8_VERSIONS="latest 8.3 8.2 8.1"
wait_for_solr() {
while [[ "$(curl -s -o /dev/null http://$SOLR_HOST:31337/solr/ocr/select -w '%{http_code}')" != "200" ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.