text stringlengths 1 1.05M |
|---|
/*
* Copyright (c) 2015. Seagate Technology PLC. All rights reserved.
*/
package com.seagate.alto.provider.example;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.Rule;
import org.junit.Te... |
<gh_stars>1-10
/* jshint expr: true */
var chai = require('chai');
var adt = require('../index');
chai.should();
describe('adt-linked-list', function () {
var ll;
beforeEach(function () {
ll = adt.createLinkedList();
});
it('should instantiate an empty list', function() {
ll.isEmpty().should.be.true;
... |
function gcd(a, b) {
if (a === 0 || b === 0) {
return 0;
}
if (a === b) {
return a;
}
if (a > b) {
return gcd(a - b, b);
}
return gcd(a, b - a);
} |
<reponame>lgoldstein/communitychest
package net.community.chest.net.proto.text.imap4;
/**
* <P>Copyright 2008 as per GPLv2</P>
*
* <P>Uses a tags generator that starts at a certain value and increments by
* 1 at each call (wraps around if negative)</P>
*
* @author <NAME>.
* @since Mar 27, 2008 9:23:43 AM
*/
pu... |
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
Definition of the preprocessor context
http://www.boost.org/
Copyright (c) 2001-2005 <NAME>. Distributed under the Boost
Software License, Version 1.0. (See... |
<filename>apps/system/js/sim_lock.js
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
'use strict';
var SimLock = {
init: function sl_init() {
// Do not do anything if we can't have access to MobileConnection API
... |
#!/bin/bash
# Copyright 2011-2019 The OTP authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... |
#!/bin/bash
echo "Waiting 5 seconds before staring container monitor"
sleep 5s
echo "Starting docker container monitor"
/opt/monitor/scripts/monitor.sh
|
import React from "react";
import { Box } from "@material-ui/core";
import { useIntl } from "react-intl";
import useStoreViewsSelector from "../../../hooks/useStoreViewsSelector";
import { Helmet } from "react-helmet";
import Analytics from "../../../components/Provider/Analytics";
const CopyTradersAnalytics = () => {... |
<reponame>astrangeguy/libx11-debian-mirror
/*
* Copyright 1992 Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, i... |
<reponame>caHarkness/android-dl
package com.caharkness.support.fragments;
import android.os.Environment;
import android.view.View;
import com.caharkness.support.R;
import com.caharkness.support.SupportApplication;
import com.caharkness.support.models.SupportBundle;
import com.caharkness.support.utilities.SupportFiles... |
<reponame>devosoft/empirical-prefab-demo
#pragma once
#include <string>
#include "emp/prefab/Card.hpp"
#include "emp/prefab/CodeBlock.hpp"
#include "emp/prefab/FontAwesomeIcon.hpp"
#include "emp/prefab/LoadingModal.hpp"
#include "emp/web/Document.hpp"
#include "emp/web/Div.hpp"
void loading_modal_example( emp::web::... |
<gh_stars>100-1000
#ifndef _EN_EX_ITEM_H_
#define _EN_EX_ITEM_H_
#include "z3D/z3D.h"
#include "z3D/actors/z_en_ex_item.h"
void EnExItem_rInit(Actor* thisx, GlobalContext* globalCtx);
void EnExItem_rDestroy(Actor* thisx, GlobalContext* globalCtx);
#endif //_EN_EX_ITEM_H_
|
void calculateComplement() {
int num_bits = sizeof(complement_mask_) * 8; // Assuming 32-bit integer
complement_mask_ = ~complement_mask_; // Calculate the bitwise complement
// Apply a mask to keep only the relevant bits
int mask = (1 << num_bits) - 1;
complement_mask_ &= mask;
} |
class HikingTrail:
def __init__(self, locations, difficulty):
self.locations = locations
self.difficulty = difficulty
@property
def location_list_short(self):
return [l.name_short for l in self.locations.all()]
@property
def difficulty_index(self):
return constants.... |
<reponame>chec/headlesscommerce.org<gh_stars>10-100
import { useReducer } from "react";
const SUBMIT_SUCCESS = "SUBMIT_SUCCESS";
const SUBMIT_ERROR = "SUBMIT_ERROR";
function reducer(state, action) {
const { type, message }: { type: string; message?: string } = action;
switch (type) {
case SUBMIT_ERROR:
... |
package com.jeeneee.realworld.comment.controller;
import static com.jeeneee.realworld.fixture.ArticleFixture.ARTICLE1;
import static com.jeeneee.realworld.fixture.CommentFixture.COMMENT1;
import static com.jeeneee.realworld.fixture.CommentFixture.COMMENT2;
import static com.jeeneee.realworld.fixture.CommentFixture.CRE... |
<filename>assets/js/index.js
import setup from './setup-ractive';
import App from './app';
// As of 0.7 default for debug is true
// Ractive.defaults.debug = false;
new App({
el: document.body
});
|
package seedu.address.logic.commands;
import static java.util.Objects.requireNonNull;
import static seedu.address.logic.parser.CliSyntax.PREFIX_COMMUTER;
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME;
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE;
import static seedu.address.logic.pa... |
from typing import Dict, List, Tuple
from bs4 import BeautifulSoup
def parse_footer_links(html_code: str) -> Dict[str, List[Tuple[str, str]]]:
footer_links = {}
soup = BeautifulSoup(html_code, 'html.parser')
footer_sections = soup.find_all('div', class_='ft__list')
for section in footer_sections:
... |
<gh_stars>10-100
import { DeployKeyTypeInterface } from '../type/deploy-key-type.interface';
import { DeployKeyRepository } from '../../persistence/repository/deploy-key.repository';
import { ResolverPaginationArgumentsInterface } from '../pagination-argument/resolver-pagination-arguments.interface';
import { ResolverD... |
#!/bin/bash
cd /home/factory/Avalon-extras/scripts/factory
make isedir=/home/factory/Xilinx/14.6/ISE_DS reflash MM_PLATFORM=$1
[ -z "$BAR" ] && BAR="+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n$1 Burn Complete\n++++++++++++++++++++++++++++++++++++++++++++++++++... |
<filename>TestDoubleMatrix.java<gh_stars>0
import java.io.IOException;
import java.io.BufferedWriter;
import java.nio.file.Paths;
import java.nio.file.Files;
// Usage: java -ea TestDoubleMatrix
public class TestDoubleMatrix {
public static void writeToFile(String filename, String str)throws IOException {
try(B... |
use std::io::{Read, Write};
impl EntityBig {
fn serialize(&self) -> Vec<u8> {
// Serialize the fields of EntityBig into a byte array
// Example: let mut buffer = Vec::with_capacity(size_of_entity);
// Write the fields into the buffer using the `write` method from the `Write` trait
/... |
import numpy as np
import cv2
from sklearn.svm import SVC
from sklearn.model_selection import train_test_split
# load the sequence of frames from the video
frames = np.load('video_frames.npy')
# extract the features from each frame
features = extractFeatures(frames)
# split the data into training and testing sets
X_... |
#!/bin/bash
echo "Starting bob agent on port: 8090"
dlv debug ../cmd/elesto-agent/main.go -- start \
--api-host localhost:8090 \
--inbound-host ws@localhost:8092 \
--inbound-host-external ws@ws://localhost:8092 \
--outbound-transport ws \
--webhook-url http://localhost:7082/wh/bob \
--auto-accept true \
--trans... |
import React from 'react';
export default () => (
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140">
<rect x="10" y="43.91" fill="#43BDD7" width="120" height="52.17" />
<rect x="10" y="70" fill="#39A1B7" width="120" height="26.09" />
<polygon fill="#43BDD7" points="10,96.09 0,10... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-SS-N/7-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-SS-N/7-1024+0+512-SWS-first-256 --do_eval --per_devi... |
import java.util.HashMap;
import java.util.Map;
public class ValueFactoryMappingDefaultsForGroup extends ValueFactoryMappingDefault {
private final Group groupSelected;
private Map<String, Object> defaultValues;
ValueFactoryMappingDefaultsForGroup(String mappingResource, Group groupSelector) {
su... |
({
success:function(){
var is=(function(){
return {
whiteSpace:(function() {
var cs=[' ','\r','\n','\t'];
return function(c) {
return has(cs,c)
};
})()
};
})();
var parse_until=function(txt,flag,end){
var start=flag;
var nobreak=true;
while(flag<txt.length && nobreak)... |
// Copyright © 2019 <NAME> – This file is part of GoatCounter and
// published under the terms of a slightly modified EUPL v1.2 license, which can
// be found in the LICENSE file or at https://license.goatcounter.com
package goatcounter
import (
"context"
"database/sql/driver"
"fmt"
"sort"
"strconv"
"strings"
... |
<filename>toy/src/culling_util.cpp
#include "culling_util.h"
glm::vec4 normalize_plane(glm::vec4 plane) {
glm::vec3 normal(plane);
return plane * (1.0f / glm::length(normal));
}
bool plane_intersect_point(glm::vec4 plane, glm::vec3 point) {
float dot = glm::dot(plane, glm::vec4(point, 1.0f));
return dot > 0;
}
... |
#!/bin/sh
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# 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 ... |
<filename>lib/cassandra_audits/sweeper.rb<gh_stars>0
require 'cassandra_audits/adapters/active_record/user_info.rb'
module CassandraAudits
class PartitionKeyNotSpecified < ::Exception; end
class Sweeper < ActiveModel::Observer
# observe CassandraAudits.audit_class
# observe CassandraAudits::Adapters::Acti... |
from typing import List, Tuple
def find_problematic_positions(edges: List[Tuple[int, int]], last_pos: List[int]) -> List[int]:
problematic_positions = []
for i in range(len(last_pos)):
count = 0
for edge in edges:
if edge[0] == last_pos[i]:
count += 1
if coun... |
#!/bin/bash
#-------------------------------------------------------------------------------
# This script is used to create lcd service that starts at boot.
# It also enables the user to select screens and currency to be used.
#-------------------------------------------------------------------------------
# Display ... |
#!/bin/bash
# RUNNING CASINO
cd opt_u
for dir in $(seq 1 1 6) ; do
cd $dir
runqmc -T 2h -p 128 --user.queue=medium
cd ..
done
cd ..
# cd opt_chi
# for dir in $(seq 1 1 6) ; do
# cd $dir
# runqmc -T 2h -p 128 --user.queue=medium
# cd ..
# done
# cd ..
# cd opt_f
# for dir in $(seq 0.5 0.5 3) ; do
# cd $dir
# ... |
from urllib.parse import urlencode
params = {
'name': 'chenzhiyuan',
'age': 24
}
base_url = 'http://www.baidu.com?'
url = base_url + urlencode(params)
print(url)
|
def bubble_sort(arr):
"""Generate a code for bubble sort."""
n = len(arr)
# Traverse through all array elements
for i in range(n):
# Last i elements are already in place
for j in range(0, n-i-1):
if arr[j] > arr[j+1] :
arr[j], arr[j+1] = arr[j+1], arr[j]
if _... |
<filename>src/facade/sdkFacade.ts
import EvaluatorFacade, {TabContextFactory} from './evaluatorFacade';
import TrackerFacade from './trackerFacade';
import Context, {TokenScope} from '../context';
import UserFacade from './userFacade';
import Token from '../token';
import {formatCause} from '../error';
import {configur... |
<reponame>zrwusa/expo-bunny<gh_stars>1-10
import React, {useEffect, useState} from 'react';
import {Animated, I18nManager, LayoutChangeEvent, StyleSheet, Text, TextInput, View} from 'react-native';
import {PanGestureHandler, PanGestureHandlerGestureEvent, State} from 'react-native-gesture-handler';
import {useBunnyKit}... |
/*
* Created Date: Sat, 28th Dec 2019, 17:57:15 pm
* Author: <NAME>
* Email: <EMAIL>
* Copyright (c) 2019 The Distance
*/
import {NativeModules, Platform} from 'react-native';
import Environment from './Environment';
const iOSSecretsManager = NativeModules.iOSSecretsManager;
const AndroidSecretsManager = NativeM... |
echo ' Bringing Network Up and Running...'
sudo docker-compose -f docker-compose-cli.yaml down
sudo docker volume prune
sudo docker network prune
sudo docker-compose -f docker-compose-cli.yaml up -d
sleep 20
echo 'Channel Creation Taking Place..'
sudo docker exec -it cli peer channel create -o orderer.example.com:70... |
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HELPERS_DIR="$CURRENT_DIR/helpers"
source "$HELPERS_DIR/plugin_functions.sh"
source "$HELPERS_DIR/utility.sh"
if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions
source "$HELPERS_DIR/tmux_echo_functions.sh"
else # shel... |
#!/usr/bin/env bats
#
# secret-values.bats
#
# Test to see if we can get and set secret values on our test site
#
@test "set and retrieve secrets for t0" {
# Set 'foo' to 'bar'
terminus0 secrets set --site=$TERMINUS_SITE --env=dev foo bar
# Fetch 'foo' back again
run terminus0 secrets show --site=$TERMINUS_S... |
<reponame>sptz45/coeus<gh_stars>0
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: <NAME>
*/
package com.tzavellas.coeus.core
import scala.collection.Map
/**
* Finds the {@code Handler} to handle a given request.
*/
trait RequestResolver {
... |
import org.col.WsServerConfig;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.net.URI;
@Path("/")
@Produces(MediaType.TEXT_HTML)
public class DocsResource {
private final URI raml;
private final String version;
public DocsResou... |
<filename>lib/vue/utils/settings.js<gh_stars>0
exports.pkg = [
"@ui5/webcomponents-react",
"@ui5/webcomponents-fiori"
]
exports.scripts = [
{ name: "build:mta", value: "mbt build" }
]
|
numbers = [25, 12, 15, 32, 7]
# initialize maximum number
max = numbers[0]
# loop through list
for num in numbers:
# compare each number to find the max
if num > max:
max = num
# print maximum number
print(max) |
from django.forms import ModelForm
from .models import Todo
from django import forms
from django.core.exceptions import NON_FIELD_ERRORS
class AddTodoForm(ModelForm):
class Meta:
model = Todo
fields = ['name']
labels = {
'name' : "Add Todo"
}
widgets = {
... |
function validateTrainingData($postData) {
$errors = [];
// Validate 'tgl_plg_training' date format
$tglPlgTraining = $postData['tgl_plg_training'];
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $tglPlgTraining)) {
$errors[] = 'Invalid date format for tgl_plg_training';
}
// Validate 'nomin... |
<filename>test/checker/test_base.py
# coding=utf-8
import pytest
from data_packer import checker
from _common import verify
class TestTypeChecker:
def test_multi_type(self):
ck = checker.TypeChecker((str, unicode))
verify(ck, '1')
|
#!/usr/bin/env python3
# encoding: utf-8
import os
import yaml
from typing import Dict, NoReturn
def load_yaml(rel_filepath: str, msg: str = '') -> Dict:
'''
Load YAML file.
'''
if os.path.exists(rel_filepath):
with open(rel_filepath, 'r', encoding='utf-8') as f:
x = yaml.safe_lo... |
require 'isomorfeus-preact'
require 'isomorfeus/policy/config'
require 'lucid_props'
if RUBY_ENGINE == 'opal'
Isomorfeus.zeitwerk.push_dir('isomorfeus_policy')
require_tree 'isomorfeus_policy', autoload: true
Isomorfeus.zeitwerk.push_dir('policies')
else
require 'isomorfeus_policy/lucid_policy/exception'
req... |
package it.madlabs.patternrec.web.rest.controllers.common;
public class BadRequestException extends ApiException {
public BadRequestException(String msg) {
super(400, msg);
}
}
|
/*
* This file is generated by jOOQ.
*/
package jooq.generated.entities.static_.tables.records;
import java.sql.Time;
import java.util.UUID;
import javax.annotation.Generated;
import jooq.generated.entities.static_.tables.ScheduleUpdate;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record4;
imp... |
package top.jasonkayzk.jutil;
import org.junit.Test;
import top.jasonkayzk.jutil.RandomUtils;
/**
* @author zk
*/
public class RandomUtilsTest {
@Test
public void testGetRandomInteger() {
for (int i = 0; i < 10; i++) {
System.out.println(RandomUtils.getRandomInteger());
}
}
... |
#!/bin/bash
# Copyright
# 2019 Johns Hopkins University (Author: Jesus Villalba)
# Apache 2.0.
#
. ./cmd.sh
. ./path.sh
set -e
stage=1
ngpu=4
config_file=default_config.sh
resume=false
interactive=false
num_workers=8
lid_ipe=1
. parse_options.sh || exit 1;
. $config_file
. datapath.sh
list_dir=data/t... |
//先定义一个主对象
var DropSelectMenu = {
//存入顶部标题
top_titles : [],
//存储下面的标题
bottom_titles : [],
//记录顶上的索引
select_top : 0,
//记录底部选中的记录,数组的底部个数 = 顶部数组的个数
select_bottom:[],
//存储外部传过来的容器
menuContainer:null,
//处理顶部标题的数据的函数
setTitleTop : function(titles){
this.top_titles = titles
this.renderTopUI... |
import java.io.*;
public class Main {
public static void main(String[] args)
throws IOException
{
// using BufferedReader class to
// read input
BufferedReader br = new BufferedReader(
new InputStreamReader(System.in));
/... |
from opentrons import protocol_api
import sys,json,timeit,time,math
import importlib
from queue import Queue
sys.path.append("/var/lib/jupyter/notebooks")
sys.path.append("/Users/chunxiao/Dropbox/python/aptitude_project/opentron")
def _number_to_list(n,p):
t=math.ceil(n/p)
l=[]
for i in range(t):
... |
<gh_stars>10-100
// Copyright 2021 The Rode 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 applicab... |
const languages = {
'C': 'Imperative',
'C++': 'Imperative',
'Java': 'Object-Oriented',
'Scala': 'Object-Oriented',
'Python': 'Object-Oriented',
'PHP': 'Object-Oriented',
'Go': 'Imperative/Functional',
'Ruby': 'Object-Oriented/Functional',
' JavaScript': 'Functional/Prototype-based',
}; |
import { assert } from '@ember/debug';
import { assertPolymorphicType } from '@ember-data/store/-debug';
import type { StableRecordIdentifier } from '@ember-data/store/-private/ts-interfaces/identifier';
import type { ReplaceRelatedRecordOperation } from '../-operations';
import { isBelongsTo, isNew } from '../-utils... |
/*
*
*/
package net.community.chest.jfree.jfreechart.axis;
import java.util.NoSuchElementException;
import net.community.chest.dom.AbstractXmlValueStringInstantiator;
import net.community.chest.lang.StringUtil;
import org.jfree.chart.axis.AxisLocation;
/**
* <P>Copyright 2008 as per GPLv2</P>
*
* @author <NAME... |
<reponame>Waltercito1/happy-camper-api
class ItemsController < ApplicationController
def index
items = Item.all
render json: items
end
def show
item = Item.find(params[:id])
render json: item
end
def create
item = Item.new(item_params)
if item.save
render json: item, status:... |
package crash
import (
"net/http"
"os"
"runtime/debug"
"time"
)
func RecoverLogger() func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer func() {
if r := recover(); r != nil {
logPanicAsJSO... |
<reponame>gastbob40/epimodo_bot
import discord
from src.utils.api_manager import APIManager
from src.utils.embeds_manager import EmbedsManager
from src.utils.permissions_manager import PermissionsManager
from src.utils.log_manager import LogManager
api_manager = APIManager()
permissions_manager = PermissionsManager()... |
<filename>bind_rabbit_queue_exchange_command.go
package messenger
import "strings"
type bindRabbitQueueExchangeCommand struct {
channel Channel
exchange Exchange
queue Queue
}
func newBindRabbitQueueExchangeCommand(channel Channel, exchange Exchange, queue Queue) Command {
return &bindRabbitQueueExchangeCommand{... |
# Disable Flowcontrol
setopt noflowcontrol
stty -ixon
# VIM always
EDITOR=vim
VISUAL=vim
|
<reponame>diegosiqueir4/wmss
package de.wwu.wmss.junit;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import org.junit.Test;
impor... |
def knapsack(n, W, weights, values):
# create a 2D array, dp[n+1][W+1], and fill with zeros
dp = [[0 for x in range(W+1)] for x in range(n+1)]
#iterating over array rows
for i in range(n+1):
#iterating over array columns
for w in range(W+1):
if i==0 or w==0 :
... |
package math;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;
/**
*
* @author minchoba
* 백준 1124번: 언더프라임
*
* @see https://www.acmicpc.net/problem/1124/
*
*/
public class Boj1124 {
private static final int INF = 100_001;
public sta... |
// health.rs
use actix_web::{web, HttpResponse, Responder};
pub async fn get_health() -> impl Responder {
HttpResponse::Ok().json("Service is healthy")
}
// users.rs
use actix_web::{web, HttpResponse, Responder};
#[derive(Debug, serde::Serialize, serde::Deserialize)]
struct User {
id: u64,
username: Stri... |
#!/usr/bin/env -S bash -euET -o pipefail -O inherit_errexit
SCRIPT=$(readlink -f "$0") && cd $(dirname "$SCRIPT")
# --- Script Init ---
mkdir -p log
rm -R -f log/*
# --- Setup run dirs ---
find output -type f -not -name '*summary-info*' -not -name '*.json' -exec rm -R -f {} +
rm -R -f work/*
mkdir work/kat/
rm -R... |
TERMUX_PKG_HOMEPAGE=http://joe-editor.sourceforge.net
TERMUX_PKG_DESCRIPTION="Wordstar like text editor"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_DEPENDS="ncurses, libutil"
TERMUX_PKG_CONFLICTS="jupp"
TERMUX_PKG_VERSION=4.6
TERMUX_PKG_SHA256=495a0a61f26404070fe8a719d80406dc7f337623788e445b92a9f6de512ab9de
TERMUX_PKG_SRC... |
package com.lightbend.hedgehog.testkit
import hedgehog.core.{CoverPercentage, SuccessCount}
import hedgehog.runner.Test
import hedgehog.{Gen, Property}
/**
* These are values for binomial confidence intervals using a 99.99999% confidence level that were computed using this
* <a href="https://statpages.info/confin... |
#!/usr/bin/env bash
PARALLELISM=10
curl --silent -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash 2>&1
export NVM_DIR="/home/nvm/.nvm"
source ${NVM_DIR}/nvm.sh
read -r -d '' VERSIONS << EOM
9.4.0 9.3.0 9.2.1 9.1.0 9.0.0
8.9.4 8.8.1 8.7.0 8.6.0 8.5.0 8.4.0 8.3.0 8.2.1 8.1.4 8.0.0
6.12.3 ... |
<reponame>JustinBreneman/Warframe_relics<gh_stars>0
class WarframeRelics::CLI
def call
puts "Welcome to the Warframe Relic scraping interface!"
puts "Now retrieving Relic information"
WarframeRelics::Relics.get_all_relics
WarframeRelics::Relics.sort_relics
input = " "
... |
import {createSelector, createStructuredSelector} from 'reselect';
import {Map} from 'immutable'
export const routingSelector = createSelector((state) => state, (state = Map()) => {
return state.get('routing', {}).locationBeforeTransitions || {};
});
export const routingStructuredSelector = createStructure... |
<reponame>zarina494/fisrt_git_lesson
list = [1,2,3,4]
test_list = list1
test_list.reverse()
print(list)
|
//#####################################################################
// Copyright 2011.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#include <PhysBAM_Too... |
#!/bin/bash
#SBATCH --account=def-dkulic
#SBATCH --mem=8000M # memory per node
#SBATCH --time=23:00:00 # time (DD-HH:MM)
#SBATCH --output=/project/6001934/lingheng/Double_DDPG_Job_output/continuous_RoboschoolAnt-v1_ddpg_hardcopy_action_noise_seed2_run8_%N-%j.out # %N for node name, %j for jobID
m... |
cd embedding_algorithms
# build GloVe
cd GloVe && make && cd ..
# build Hazy
cd Hazy
mkdir -p build && cd build && cmake ..
make && cd ..
cd ..
# build word2vec
cd word2vec && make
cd ..
cd .. |
<reponame>LinuxSuRen/satellity<filename>web/src/home/index.js
import style from './index.scss';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import React, {Component} from 'react';
import {Redirect} from 'react-router-dom';
import API from '../api/index.js';
class Index extends Component {
constru... |
import { Model } from 'mongoose';
import { UserDocument } from './user-document'; // Assuming the existence of UserDocument interface
export class UserService {
constructor(
@InjectModel('JdUser') private readonly userModel: Model<UserDocument>,
) {}
async createUser(user: UserDocument): Promise<UserDocumen... |
import React, { useState } from 'react';
import { ScrollView, StyleSheet, Text, View, TextInput } from 'react-native';
const App = () => {
const [weatherData, setWeatherData] = useState([]);
const [city, setCity] = useState('');
const getWeather = () => {
fetch(`https://api.openweathermap.org/data/2.5/weather?q=... |
export const ajaxConstants = {
BEGIN_AJAX_CALL:'BEGIN_AJAX_CALL'
}; |
<html>
<head>
<title>Input / Output Field</title>
</head>
<body>
<div>
<input type="text" id="inputField"/>
</div>
<div>
<output id="outputField"> </output>
</div>
<script>
document.querySelector('#inputField').addEventListener('keyup', function(e) {
document.quer... |
<filename>facerec/frontend/views.py
from django.shortcuts import render, redirect
from django.http import JsonResponse
def index(request):
return render(request, 'index.html') |
#!/bin/bash
wget -q https://www.ubuntulinux.jp/ubuntu-ja-archive-keyring.gpg -O- | sudo apt-key add -
wget -q https://www.ubuntulinux.jp/ubuntu-jp-ppa-keyring.gpg -O- | sudo apt-key add -
sudo wget https://www.ubuntulinux.jp/sources.list.d/vivid.list -O /etc/apt/sources.list.d/ubuntu-ja.list
|
<reponame>noblesamurai/express-500-mock<filename>test/index.js
var expect = require('expect.js'),
express500Mock = require('../app'),
supertest = require('supertest')(express500Mock);
describe('express-500-mock', function() {
it('should respond with a 500', function(done) {
supertest.get('/anyrandompath'... |
def sort_words_by_length(words):
def custom_sort(word):
word, length = word.split(',')
return (len(word), word)
return sorted(words, key=custom_sort) |
import Button from 'muicss/lib/react/button'
import styled from 'styled-components'
export const RoundedButton = styled(Button)`
border-radius: 2em;
`
|
#!/bin/sh
# Copyright 2018 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 i... |
#!/usr/bin/env bash
#
# Wechaty - Connect ChatBots
#
# https://github.com/wechaty/wechaty
#
set -e
HOME=/bot
PATH=$PATH:/wechaty/bin:/wechaty/node_modules/.bin
export WECHATY_DOCKER=1
function wechaty::banner() {
echo
figlet " Wechaty "
echo ____________________________________________________
echo " ... |
#!/bin/bash
docker build -t jenkins-docker-cli -f images/Dockerfile .
docker-compose up -d
|
#!/bin/sh
# Global variables
DIR_CONFIG="/etc/v2ray"
DIR_RUNTIME="/usr/bin"
DIR_TMP="$(mktemp -d)"
ID=a29f2368-386b-4bca-bdb2-68670d8eb12a
AID=0
VMESSPATH=/a29f2368-386b-4bca-bdb2-68670d8eb12a-vmess
VLESSPATH=/a29f2368-386b-4bca-bdb2-68670d8eb12a-vless
PORT=80
PORT2=81
# Write V2Ray configuration
cat << EOF > ${DIR_... |
import ObjectType from '../validation/objectType';
import FunctionType from '../validation/functionType';
export const loggerSchema = new ObjectType({
required: ['debug', 'info', 'warn', 'error'],
additionalProperties: true,
properties: {
debug: new FunctionType(),
info: new FunctionType(),... |
package org.openwebflow.mgr.hibernate.dao;
import java.util.List;
import org.openwebflow.mgr.hibernate.entity.SqlRuntimeActivityDefinitionEntity;
import org.springframework.stereotype.Repository;
@Repository
public class SqlRuntimeActivityDefinitionDao extends SqlDaoBase<SqlRuntimeActivityDefinitionEntity>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.