text
stringlengths
1
1.05M
<gh_stars>1-10 require 'spec_helper' module Etsource describe AtlasLoader do let(:yml) { Rails.root.join('spec/fixtures/atlas') } let(:dir) { Pathname.new(Dir.mktmpdir) } # Takes any YAML files in the +source+ directory, converts them into # MessagePack format, then saves them into the +destination+...
const parseQueryString = (queryString) => { let params = {}; queryString.substring(1) .split('&') .forEach(pair => { const [key, value] = pair.split('='); params[key] = value; }); return params; }
#!/usr/bin/env bash set -e # version and keys are supplied as arguments version="$1" rc=`echo $version | awk -F - '{print $2}'` if [[ -z $version ]]; then echo "Usage: $0 VERSION" exit 1 fi # setup build-time vars ldflags="-s -w -X 'github.com/uplo-tech/uplo/build.GitRevision=`git rev-parse --short HEAD`' -X 'githu...
ARCH=$(uname -p) sudo yum install -y yum-utils rpmdevtools yumdownloader --source httpd.$ARCH file=$(echo httpd-*.amzn2.src.rpm) rpm -i $file sudo yum-builddep -y $file cp mod_proxy_http_subreq_connection_reuse.patch rpmbuild/SOURCES cp proxypass_nomain_flag.patch rpmbuild/SOURCES patch -p1 -d rpmbuild <httpd_spec.pat...
package io.opensphere.core.pipeline.processor; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import java.util.Collection; import java.util.List; import org.easymock.EasyMock; import org.easymock.EasyMockSupport; import org.junit.Test; import io.opensphere.core....
export const MetricType = { None: "none", String: "string", Binary: "binary", Gauge: "gauge", GaugeFloat: "gauge_float", Counter: "counter", GEO: "geo", } export const MetricTypeOptions = [ { value: MetricType.None, label: "opts.metric_type.label_none" }, { value: MetricType.String, label: "opts.metr...
#!/bin/bash if [[ "$ENABLE_MAINTAINER_ZTS" == 1 ]]; then TS="--enable-maintainer-zts"; else TS=""; fi if [[ "$ENABLE_DEBUG" == 1 ]]; then DEBUG="--enable-debug --without-pcre-valgrind"; else DEBUG=""; fi if [[ -z "$CONFIG_LOG_FILE" ]]; then CONFIG_QUIET="--quiet" CONFIG_LOG_FILE="/dev/stdout" else CONFIG_QUIET=...
def calculate_sum_and_sequence(a_string): total = 0 string_sum = "" for i, c in enumerate(a_string): total += int(c) string_sum += c if i < len(a_string) - 1: string_sum += "+" result = [string_sum, total] return result # Test the function print(calculate_sum_a...
#!/bin/sh # this super hack will sync the explorer within the specified block height range forcesync() { blockcount=$1 echo "╒══════════════════<<" echo "| height : $blockcount" blockhash=`curl -s https://explorer.stpx.io/api/getblockhash?height=$blockcount` echo "| ଓ hash : $blockhash" curl -s https://expl...
$(function () { $("#jqGrid").jqGrid({ url: '../newsmessage/list', datatype: "json", colModel: [ {label: 'id', name: 'id', index: 'id', key: true, hidden: true}, {label: '新闻标题', name: 'title', index: 'title', width: 80,align:'center'}, {label: '新闻内容', name:...
#!/bin/sh # Compress and minify widget set -e OUT_FILE="public/plusfries.js" mkdir -p "$(dirname $OUT_FILE)" BIN="./node_modules/.bin" echo "start minifying..." CSS="$($BIN/uglifycss widget/plusfries.css)" ES5="$($BIN/babel widget/plusfries.js)" COMPACT="$(echo "$ES5" | $BIN/terser -m -c)" echo "$COMPACT" | sed "s/PL...
<gh_stars>1-10 /** * * */ "use strict"; var config = require("./config"), io = require('socket.io').listen(config.PRODUCER_PORT), consumers = []; /** * A data structure to represent a consumer as seen by the producer. * Some attributes overlap with those defined in the Consumer structure on the client...
#!/bin/bash # Set basedir to the absolute path of the directory containing the script basedir="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" # Build the Docker image docker build . -t atone > /dev/null || { echo "Error: Failed to build the Docker image"; exit 1; } # Run the Docker container docker run aton...
# validated: 2018-01-05 EN 46d3d290a0b2 java/src/com/ctre/phoenix/motorcontrol/can/WPI_VictorSPX.java #---------------------------------------------------------------------------- #  Software License Agreement # # Copyright (C) Cross The Road Electronics.  All rights # reserved. #  # Cross The Road Electronics (CTRE) l...
<filename>src/net/abi/abisEngine/components/Camera.java /******************************************************************************* * Copyright 2020 <NAME> | ABI INC. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may...
import { expect } from 'chai'; import React from 'react'; import { shallow, mount } from 'enzyme'; import Label from './Label' describe('[Atom] Label', () => { it('Has correct default markup', () => { const wrapper = shallow(<Label>Placeholder</Label>); expect(wrapper.type()).to.equal('label'); expect(w...
# https://developer.zendesk.com/rest_api/docs/help_center/translations#list-all-enabled-locales-and-default-locale zdesk_help_center_locales_list () { method=GET url=/api/v2/help_center/locales.json }
import pandas as pd def process_dataframe(df, samples_per_group, validate): """ Process the input dataframe to generate two distinct subsets based on the specified conditions. Parameters ---------- df : pandas DataFrame Input dataframe containing the data samples_per_group : int ...
import java.io.OutputStream; public class EXIStreamEncoderImpl { private EXIFactory exiFactory; private EXIHeaderEncoder exiHeader; private EXIBodyEncoder exiBody; public EXIStreamEncoderImpl(EXIFactory exiFactory) throws EXIException { this.exiFactory = exiFactory; exiHeader = new EXI...
#!/bin/bash # Script to deploy a very simple web application. # The web app has a customizable image and some text. cat << EOM > /var/www/html/index.html <html> <head><title>Meow!</title></head> <body> <div style="width:800px;margin: 0 auto"> <!-- BEGIN --> <center><img src="http://${PLACEHOLDER}/${WIDTH}/$...
<filename>Validator/GenICam/library/CPP/include/xsde/cxx/serializer/context.hxx // file : xsde/cxx/serializer/context.hxx // author : <NAME> <<EMAIL>> // copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file #ifndef XSDE_CXX_SERIALIZER...
package malte0811.controlengineering.util.math; import javax.annotation.Nullable; public record RectangleI(int minX, int minY, int maxX, int maxY) { public RectangleI(Vec2i min, Vec2i max) { this(min.x(), min.y(), max.x(), max.y()); } public boolean contains(RectangleI other) { return co...
#!/usr/bin/env bash # Copyright (c) 2019 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C.UTF-8 set -euxo pipefail TOPLEVEL=$(git rev-parse --show-toplevel) CURRENT_DIR=$(dirname $(readlink ...
#!/bin/bash # # Minimal example for deploying latest built 'Ansible Service Broker' # on oc cluster up # # # We deploy oc cluster up with an explicit hostname and routing suffix # so that pods can access routes internally. # # For example, we need to register the ansible service broker route to # the service catalog...
<gh_stars>0 const { calc } = require('./calc') let args = process.argv; console.log(args); let command = args[2]; let num1 = args[3]; let num2 = args[4]; try{ if(isNaN(Number(num1)) || isNaN(Number(num2))) throw "nan"; calc[command](num1,num2); } catch(e) { if(e == "nan") console.lo...
<gh_stars>1-10 var words = require("./words.json").words; var punctuations = ".!?".split(""); var table = words.map(function(word) { return word.word; }).concat(punctuations); function hexify (n) { var result = n.toString(16); if (result.length === 1) { return "0" + result; } else { return result; }...
#!/usr/bin/env bash set -e pip install --upgrade pip pip install --upgrade -r requirements.txt pip install --upgrade -r requirements-dev.txt cd testing ./build-image.sh cd ../building ./build-image.sh
package com.doodl6.demo.pattern; /** * 建造者模式 */ public class Builder { protected Product product = new Product(); public Builder partA(String partA) { product.setPartA(partA); return this; } public Builder partB(String partB) { product.setPartB(partB); return this; ...
module PayPal class Charge include PayPal::Merchant::DoDirectPayment attr_accessor :response, :amount, :card class << self def create(params = {}) new(params) end end def initialize(params = {}) @amount, @card = params[:amount], params[:card] if @amount && @car...
/Applications/google_appengine/appcfg.py upload_data --config_file=bulkloader.yaml --kind=License --filename=license.csv --url=http://summer-sample-gae.appspot.com/remote_api /Applications/google_appengine/appcfg.py upload_data --config_file=bulkloader.yaml --kind=Status --filename=status.csv --url=http://summer-sample...
import joplin from 'api'; import { noteVariables } from './noteVariables'; joplin.plugins.register({ onStart: async function () { noteVariables.init(); }, });
#!bin/bash delimiter=$1 script=$2 file=$3 #awk -F "$delimiter" "{len=split($col,value,\"$separator\");n=\"\";for(i=1;i<=len;++i){n=n \"\\\"\" NR \"\\\",\\\"\" value[i] \"\\\"\";if(i<=len-1){n=n\"\n\";}system(\"echo \"\" n \"\" >> tmp/csv/$newFile\");}$col=NR}" $file #awk -F "$delimiter" "{len=split($col,value,\"$separa...
/* 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 required by applicable law or agreed to in writing, software distributed under the License i...
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy # frameworks to, so exit 0 (signalling the...
const inputString = "Hello World!" let splitString = new Array(inputString.length - 3 + 1); for (let i = 0; i <= inputString.length - 3; i++) { let substring = inputString.substring(i, i + 3); splitString[i] = substring; } console.log(splitString);
<gh_stars>1-10 /** * Created by <EMAIL> on 2019/3/20. */ import "./style.less"; import React,{PureComponent} from 'react'; import QRCode from "qrcode.react"; import extensionizer from 'extensionizer'; import popup from "../../../../popup"; import Utils from "../../../../common/utils"; import Button from "../../../ven...
function shouldReturn403(request) { // Check if the request meets the criteria for returning a 403 status code // For example, you might check if the request contains certain headers or if the request method is not allowed // Implement your logic here and return true if a 403 should be returned, false otherwise ...
<filename>app/src/block/schemas/properties/property-types/title-property.schema.ts import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { RichTextSchema, RichText } from '../../common/rich-text.schema'; @Schema() export class TitleProperty { @Prop({ _id: false, ...
def validate_data(data, schema): if schema["type"] == "integer": return isinstance(data, int) elif schema["type"] == "boolean": return isinstance(data, bool) elif schema["type"] == "number": return isinstance(data, (int, float)) else: return False # Invalid schema type
#include "ClientOperate.h" #include <QFileInfo> ClientOperate::ClientOperate(QObject *parent) : QObject(parent) { initOperate(); } ClientOperate::~ClientOperate() { doDisconnect(); } QString ClientOperate::getFilePath() const { QMutexLocker locker(&dataMutex); return filePath; } void ClientOper...
def gcd(x,y): if x == 0: return y return gcd(y%x, x) # Driver code print(gcd(x,y))
class Calculator { // Calculate the total of an array of numbers static func total(numbers: [Int]) -> Int { return numbers.reduce(0, +) } } let arr = [1, 2, 3, 4, 5] let total = Calculator.total(numbers: arr) print("Total: \(total)")
#include <iostream> // Function to print the possible numbers combination void printCombination(int n, int num) { int nums[n]; // Fill the array with the numbers from 1 to n for (int i = 0; i < n; i++) nums[i] = i + 1; // Print all possible numbers combination for (int i = 0; ...
<gh_stars>0 import React from 'react'; import PropTypes from 'prop-types'; import HtmlToReact, { Parser } from 'html-to-react'; import Barcode from 'react-barcode'; import { buildTemplate, } from '../../../utils'; class ComponentToPrint extends React.Component { static propTypes = { dataSource: PropTypes.objec...
<filename>src/main/java/com/infinities/skyport/proxy/network/SubnetProxy.java package com.infinities.skyport.proxy.network; import java.io.Serializable; import java.util.Map; import javax.annotation.Nonnegative; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.xml.bind.annotation.XmlTra...
<reponame>michaelwoodruff/bs-grrrrid<filename>grid.js (function() { (function() { var initGrrrridlet = function() { return (window.grrrridlet = function() { var el, $body, $style, $grrrrid, $grrrrid_container, $counter, $grrrrid_counter, class_list, opacity, viewport, width, hide_counter...
'use strict'; const express = require('express'); const server = express(); const supergoose = require('@code-fellows/supergoose'); const mockRequest = supergoose(server); const route = require('../routes/v1.js'); server.use(express.urlencoded({ extended: false })); server.use(express.json()); server.use('/ap...
#!/bin/bash # loads the genemania identifier lookup and network databases source $( dirname "${BASH_SOURCE[0]}" )/setenv.sh cd $TOP python -m app.genemania --id
#!/bin/bash echo "# --- !Ups" PGPASSWORD=postgres pg_dump --schema-only --no-owner -U postgres -h localhost -s -f new.sql brief PGPASSWORD=postgres pg_dump --schema-only --no-owner -U postgres -h localhost -s -f original.sql newbrief 2>/dev/null unset JAVA_TOOL_OPTIONS && java -jar apgdiff-2.4.jar --ignore-start-with o...
<reponame>ngCommerce/core<filename>src/services/home/home.service.js import { Injectable, Inject } from "@angular/core"; import { Http } from '@angular/http'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; import { CorService } from "../../core.service"; import { API_URL } from "../../models/core...
/* * Copyright 2015-present Open Networking Foundation * * 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 required by appli...
docker run -d -p 127.0.0.1:5000:5000 covid-microservice-app
/** * Certificate Transparency Utilities * * By <NAME> <<EMAIL>> * @module ctutils */ import CertHelper from './CertHelper'; import CompactMerkleTree from './CompactMerkleTree'; import CTLog from './CTLog'; import CTLogHelper from './CTLogHelper'; import CTMonitor from './CTMonitor'; import { setFetch, getFetch, ...
#!/usr/bin/env bash set -e cd "$( dirname "${BASH_SOURCE[0]}" )" . "common.sh" install_conda init_conda # Install torchaudio environments for torchaudio in "${TORCHAUDIO_VERSIONS[@]}" ; do for python in "${PYTHON_VERSIONS[@]}" ; do create_env "${torchaudio}" "${python}" activate_env "${torchaudi...
def visualize_camera_image(event, subarray): from ctapipe.visualization.bokeh import FastCameraDisplay # Create a FastCameraDisplay object camera_display = FastCameraDisplay(subarray=subarray) # Add the event data to the camera display camera_display.image = event.r0.tel[0].image[0] # Add add...
/* * Copyright 2014-2018 the original author or 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 required by app...
# Copyright 2017 Google Inc. # # 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 required by applicable law or agreed to in writing, ...
#!/usr/bin/env bash function bailout() { echo "${1}: Exiting" exit $2 } # Create application directory /bin/mkdir -p /opt/patchserver || bailout "Unable to create /opt/patchserver" 1 # Move required application files /bin/cp -r ../../{requirements.txt,patchserver} /opt/patchserver /bin/cp ./{config.py,wsgi.p...
#!/bin/bash # Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. # BEGIN environment bootstrap section # Do not edit between here and END as this section should stay identical in all scripts findpath () { myname=${0} mypath=${myname%/*} myna...
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import media_feature_symbol import in_generator import template_expander import name_utilities import sys class MakeMediaFeaturesWri...
#!/usr/bin/env bash set -eu -o pipefail source ./utilities/run-cmd.sh source ./projects/projects.sh echo echo "Get Projects" echo "= = =" echo if [ -z ${ESC_HOME:-} ]; then echo "ESC_HOME is not set; aborting" echo exit 1 fi if [ ! -z ${GIT_AUTHORITY_PATH:-} ]; then echo "The GIT_AUTHORITY_PATH environment...
rawspec -f 1024 -t 2 -d /datax/scratch/bbrzycki/data/raw_files/ /datax/scratch/bbrzycki/data/raw_files/test_snr_0 mv /datax/scratch/bbrzycki/data/raw_files/test_snr_0.rawspec.0000.fil /datax/scratch/bbrzycki/data/raw_files/test_snr_0_1024.rawspec.0000.fil rawspec -f 1024 -t 2 -d /datax/scratch/bbrzycki/data/raw_files/...
import {AbstractSkeletosComponent, ISkeletosProps} from "./AbstractSkeletosComponent"; import {AbstractSkeletosState, ISkeletosDbListener} from "../../core"; /** * The Root component listens to any changes in the Skeletos database and updates accordingly. */ export abstract class AbstractRootComponent<SkeletosStateT...
#include <iostream> #include "XMLParser.h" // Include the header file for XMLParser class XMLParser : public abstract_delegate { public: void onStartElement(const XML_Char *fullname, const XML_Char **atts) override { // Implement the logic to handle the start element event std::cout << "Start Element: " << f...
/* $Id$ */ /*************************************************************************** * (C) Copyright 2003-2010 - Stendhal * *************************************************************************** *************************************************************************** ...
#include <iostream> #include <map> #include <vector> #include <algorithm> int main() { std::map<int, int> myMap = { {4, 40}, {5, 50}, {6, 60} }; for_each(myMap.cbegin(), myMap.cend(), [](const std::pair<int, int>& p) { std::cout << p.first << "->" << p.second << std::endl; }); std::vector<int...
#!/bin/bash set -e set -x # Parse inputs TSAN=false COMPRESS=false while (( $# )); do case "$1" in --compress) COMPRESS=true ;; --tsan) TSAN=true ;; *) break ;; esac shift done SUFFIX=${SUFFIX:=$(date +%Y%m%d)} PREFIX=${MAPD_PATH:="/usr/local/mapd-deps/$SUFFIX"}...
#!/usr/bin/env bash dvc run -f dvc/cad_experiment/evaluate_model.dvc --no-exec \ -d ucsgnet/ucsgnet \ -d ucsgnet/dataset.py \ -d ucsgnet/utils.py \ -d ucsgnet/common.py \ -d data/cad \ -d models/cad_main \ -o paper-stuff/metrics/cad_experiment \ python -m ucsgnet.ucsgnet.cad.eval_cad \...
use App\Http\Controllers\Controller; use App\Mail\OrderShipped; use Illuminate\Http\Request; use Illuminate\Support\Facades\Mail; class OrderController extends Controller { /** * Ship the given order and send email notification to the customer. * * @param Request $request * @param int $orde...
<filename>commands/team.js const Discord = require("discord.js"); exports.run = async (client, message, args) => { let logo = client.user.avatarURL; let members = message.guild.roles .find(r => r.name === "Developer") .members.array(); let mods = message.guild.roles .find(r => r.name === "Moderator") .membe...
<filename>app/scripts/application/components/country-description/index.js 'use strict'; var Vuex = require('vuex'); module.exports = { template: require('./template.html'), data: function() { return { isLoaded: false, description: '' }; }, methods: Vuex.mapActions([ 'getCountryDescript...
#!/bin/bash -e CI_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" source $CI_DIR/controls/common.sh while test $# -gt 0 do case "$1" in --clean) remove_images=true ;; *) echo "bad argument $1" && exit 1 ;; esac shift done $CI_DIR/controls/rel...
<reponame>active9/screencap<gh_stars>10-100 var screencap = require('../index.js'); var screen = screencap({ audioCodec: "aac", videoCodec: "libx264", videoBitrate: "1000k", audioBitrate: "96k", format: "mp4" },'test.mp4'); screen.capture('30');
import pandas as pd # Load data data = pd.read_csv('nyc_rental_data.csv') # Create train and test set X = data.drop(['average_monthly_rent'], axis=1) y = data['average_monthly_rent'] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) # Create and train the model model = Random...
import { Component, OnInit } from '@angular/core'; import { QueryBuilderConfig } from 'angular2-query-builder'; import { Router } from '@angular/router'; import { SharedService } from '../services/shared.service'; import { error } from '@angular/compiler/src/util'; import { StoreService } from '../../store-management/s...
<filename>aura-modules/src/test/components/secureModuleTest/bootstrap/bootstrapController.js ({ /** * Verify that a component, which has a equivalent module that has opted into locker, is not forcefully lockerized * @param cmp */ testCmpLockerStateNotAffectedByEquivalentModule: function(cmp) { ...
function removeStaticOffset(el) { el.style.bottom = ''; // Remove the 'auto' value for the bottom style el.style.right = ''; // Remove the 'auto' value for the right style }
// exports.handler = async (event) => { // // TODO implement // const response = { // statusCode: 200, // body: JSON.stringify('Hello from Lambda!') // }; // return response; // }; 'use strict'; var AWS = require('aws-sdk'), documentClient = new AWS.DynamoDB.DocumentClient(); /** ...
#!/bin/bash trap "echo ERROR && exit 1" ERR echo "DEPLOYMENT BEGIN" echo "stopping tomcat service." service tomcat7 stop maindir=`pwd -P` hostdir='/var/lib/tomcat7' if [ -d /var/lib/tomcat7/webapps/ROOT ]; then #variable setup: echo "CREATING BACKUP OF CURRENT DEPLOYMENT." dstnt_digest="$(cd $hostdir/w...
<reponame>Subodh22/made_test<filename>jube.py import os import json import unicodedata import multiprocessing import concurrent.futures import re from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriv...
<reponame>simplebam/GlideDemo<filename>app/src/main/java/com/yueyue/glidedemo/module/chapter_7/Chapter7_Fragment.java package com.yueyue.glidedemo.module.chapter_7; import android.content.Context; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.support.v4.widget.SwipeRefreshL...
<gh_stars>1-10 /* Speculative Contacts – a continuous collision engine Adapted from a C# tutorial by <NAME> http://www.wildbunny.co.uk/blog/2011/03/25/speculative-contacts-an-continuous-collision-engine-approach-part-1/ */ ! function() { "use strict"; var screen = ge1doot.screen.init("screen", function ()...
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy # resources to, so e...
/** Dictionary interface, representing and old school word-lookup dictionary */ package spelling; /** @author Christine */ public interface Dictionary { /** * Add this word to the dictionary. * * @param word The word to add * @return true if the word was added to the dictionary (it wasn't alread...
#include <stdio.h> #include <stdlib.h> extern void reset(); void __VERIFIER_error(int); void __VERIFIER_error(int i) { fprintf(stderr, "error_%d ", i); reset(); }
<reponame>tx0c/logbook import { utils } from "ethers"; export const logbookABI = [ "constructor(string name_, string symbol_)", "error InsufficientAmount(uint256 available, uint256 required)", "error InsufficientBalance(uint256 available, uint256 required)", "error InsufficientLogs(uint32 maxEndAt)", "error ...
#include <stdio.h> #include <math.h> int main() { int num, dig, temp, sum = 0; printf("Armstrong numbers from 0 to 1000:\n"); for (num = 0; num <= 1000; num++) { temp = num; while (temp != 0) { dig = temp % 10; sum = sum + pow(dig, 3); temp = temp / 10; ...
<reponame>StakedBlockchain/0x-starter-project import Web3 from 'web3'; let web3 = null; if (typeof window.web3 !== 'undefined') { if (window.web3.currentProvider.isMetaMask === true) { web3 = new Web3(window.web3.currentProvider); } } else { alert('MetaMaskをインストールしてください'); } export default web3;
import React, {Component} from 'react' import {createStore} from "redux"; import { createRenderer } from 'react-test-renderer/shallow'; import { createAPI, reducer, trace } from '../src'; const renderer = createRenderer(); const apiSpec = { redactions: { increment: (amount) => ({ count: {set: (s...
import { expect } from "chai"; import { Constants } from "discord.js"; import { SinonSandbox, createSandbox } from "sinon"; import { CustomMocks } from "@lambocreeper/mock-discord.js"; import EventHandler from "../../../src/abstracts/EventHandler"; import LogMessageSingleDeleteHandler from "../../../src/event/handlers...
<filename>src/test/java/org/thymeleaf/engine/ElementProcessorIteratorTest.java /* * ============================================================================= * * Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * ...
#!/bin/sh source ./commons.sh IFS=' ' delete() { cf delete-service -f $1 } file="./PCFServices.list" while read service plan si do if [ ! "${service:0:1}" == "#" ] then delete $si & fi done < "$file" wait IN_PROGRESS=$(cf s | grep progress | wc -l | xargs ) while [ $IN_PROGRESS -gt 0 ] do echo "Pausin...
var MersenneTwister = function (a) { if (a == undefined) { a = new Date().getTime() } this.N = 624; this.M = 397; this.MATRIX_A = 2567483615; this.UPPER_MASK = 2147483648; this.LOWER_MASK = 2147483647; this.mt = new Array(this.N); this.mti = this.N + 1; this.init_genrand...
const router = require("express").Router(); const { Park } = require('../../models'); router.get("/", async (req, res) => { try { const parkData = await Park.findAll(); const parks = parkData.map((park) => park.get({ plain: true })); res.status(200).json(parks); } catch (err) { res.status(400).js...
package io.eventuate.tram.messaging.proxy.consumer; import io.eventuate.tram.commands.common.Command; public class TestCommand implements Command { private String someImportantData; public TestCommand() { } public TestCommand(String someImportantData) { this.someImportantData = someImportantData; } ...
<reponame>Skitionek/alpha-vantage<filename>src/index.js /* DOCUMENT INFORMATION - Author: <NAME> - Email: <EMAIL> - Created: 2019-05-01 */ const { RESTDataSource } = require('apollo-datasource-rest/dist/index'); require('dotenv').config(); const apiKey = 'AV_KEY'; const path = require('path'); /** * The Al...
import typing from datetime import datetime GUILD_IDS = [12345, 67890, 54321] # Example list of enabled guild IDs async def callback(ctx: lightbulb.context.Context) -> None: guild_ids = enabled_guilds() # Retrieve the enabled guilds' IDs current_weekday = datetime.today().weekday() # Get the current day of...
import { HttpException, HttpStatus, Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; import { CreateCommentMangaDto } from './dto/create-comment-manga.dto'; import { UpdateCommentMangaDto } from './dto/update-comment-manga.dto'; import { Comme...
#!/bin/bash rm target/{debug,release}/pay-to-sudoku
<filename>src/models/Stat/Mana.java package models.Stat; public class Mana extends Secondary { // currently based off Intellect and Level public Mana(Stat stat_one, Stat stat_two) { setName("Mana"); setStatOne(stat_one); setStatTwo(stat_two); calculate(); } //TODO Fix ...