text stringlengths 1 1.05M |
|---|
<gh_stars>1-10
# ----------------------------------------------------------------------------
# Python Wires Tests
# ----------------------------------------------------------------------------
# Copyright (c) <NAME>.
# See LICENSE for details.
# -------------------------------------------------------------------------... |
def gcd(x, y):
if x == 0:
return y
if y == 0:
return x
if x == y:
return x
if x > y:
small = y
else:
small = x
for i in range(1, small+1):
if((x % i == 0) and (y % i == 0)):
gcd = i
return gcd |
#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#
# Modify default IP... |
<reponame>ooooo-youwillsee/leetcode<filename>lcof_014/cpp_014-1/Solution1.h
//
// Created by ooooo on 2020/3/11.
//
#ifndef CPP_014_1__SOLUTION1_H_
#define CPP_014_1__SOLUTION1_H_
#include <iostream>
#include <unordered_map>
using namespace std;
/**
* dfs + memo
*/
class Solution {
public:
/**
* @param flag... |
<html>
<head>
<title>Clock</title>
<script type="text/javascript">
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s ... |
const mongoose = require('mongoose');
const { Schema } = mongoose;
const foodModel = new Schema({
superMarkerName: { type: String },
producDescription: { type: String },
availablePresentation: { type: String },
price: { type: Number }
});
module.exports = mongoose.model('Food', foodModel);
|
import './bootstrap-vue' |
#!/bin/bash
#
# Moveit script
#
# Place in /etc/cron/hourly
# Be sure to chmod +x
#
CERT=~ben/certs/rtb4free_key.pem
RTB=ubuntu@rtb4free.com
WORKDIR=.
DATE=$(date +%Y%m%d)
TIME=$(date +%T)
mkdir -p $WORKDIR/logs/$RTB
ssh -i $CERT $RTB sudo cp /var/log/rtb4free.log /var/log/rtb4free.log.$DATE.$TIME
ssh -i $CERT $RTB... |
MAX_EXAMPLES = CONFIG["max-examples"]
def to_bin(x):
if x > MAX_EXAMPLES:
return "Exceeds maximum value"
return bin(x)[2:]
def to_oct(x):
if x > MAX_EXAMPLES:
return "Exceeds maximum value"
return oct(x)[2:] |
def binary_search(arr, target):
left = 0
right = len(arr)-1
while left <= right:
mid = left + (right-left)//2
if arr[mid] == target:
return mid
elif arr[mid] > target:
right = mid - 1
else:
left = mid + 1
return -1 |
#!/bin/sh
set -e
# Install extra dependencies for VTK
dnf install -y --setopt=install_weak_deps=False \
bzip2 patch git-core git-lfs
# Documentation tools
dnf install -y --setopt=install_weak_deps=False \
doxygen perl-Digest-MD5
# Development tools
dnf install -y --setopt=install_weak_deps=False \
libas... |
<gh_stars>0
'use strict';
var path = process.cwd();
var shortener = require(path + '/app/api/shortener.js');
module.exports = function (app) {
app.route('/new/*/')
.get(shortener)
.post(shortener)
app.get('/', function(req, res) {
res.sendFile(path + '/public/index.html');
})
};
|
<filename>src/TeamContributionCalendar/TeamContributionCalendar.test.js<gh_stars>1-10
import { expect } from "chai";
import sinon from "sinon";
import jsdom from "mocha-jsdom";
import TeamContributionCalendar from "./TeamContributionCalendar";
import * as getStyledCalendarElement from "../utils/GetStyledCalendarElement... |
#!/usr/bin/env bash
set -e
conda deactivate
conda env remove --name hm-neural-network
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline(cin, s);
s.erase(0, 1);
istringstream iss(s);
int number;
iss >> number;
if (number % 2 == 0)
{
cout << 0;
}
else
{
cout << 1;
}
return 0;
} |
def calculate_bmi(weight, height):
if weight <= 0 or height <= 0:
raise ValueError("Weight and height must be positive numbers")
bmi = weight / (height ** 2)
return round(bmi, 2)
def categorize_bmi(bmi):
if bmi < 18.5:
return "Underweight"
elif 18.5 <= bmi < 25:
return "Norm... |
<reponame>EvgenyMuryshkin/dsp-playground<filename>src/lib/complex.ts
export interface IComplexNumber {
r: number;
i: number;
} |
package mg.blog.mapper;
import mg.blog.entity.Comment;
import mg.blog.dto.CommentDto;
import mg.utils.mapper.DateMapper;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
@Mapper(uses = {DateMapper.class})
public abstract class CommentMapper {
public static final CommentMapper INSTANCE = Mappers... |
<reponame>tallylab/twilio-auth
// Initialize Twilio
const Twilio = require('twilio')
const client = Twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN)
// Initialize NaCl Crypto lib
const initNaCl = async () => {
return new Promise((resolve, reject) => {
require('js-nacl').instantiate(async (na... |
import dash
from dash.dependencies import Input, Output
import dash_daq as daq
from dash_daq import DarkThemeProvider
import dash_html_components as html
import numpy as np
import dash_core_components as dcc
import plotly.graph_objs as go
from scipy import signal
from time import sleep
import os
app = dash.Dash()
a... |
package org.opensextant.lr.test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import org.opensextant.lr.LanguageResourceUtil... |
import React from "react";
import { NavLink, useLocation } from "react-router-dom";
export default function Sidebar() {
let location = useLocation();
return (
<aside className="bg-gray-800 sm:w-1/3 xl:w-1/5 sm:min-h-screen p-5">
<div>
<p className="text-white font-extrabold text-xl">Developers.In... |
echo ________________________________________
echo Wallet generation for MTDRDB ...
echo ________________________________________
if [[ $1 == "" ]]
then
echo DB OCID not provided
echo Usage example : ./generateWallet.sh ocid1.autonomousdatabase.oc1.phx.abyhqljtza4ucpamla4huo5o2iopoxk55hia3rfubnwgpmzolya
exit
f... |
import React, { useContext } from 'react';
import {
SearchResultsDiv,
SeeTeamTitle,
} from "./search-results-styles";
import { D3Context } from "../../contexts/D3Context";
import EmployeeResult from "../EmployeeResult/EmployeeResult";
const SearchResults = () => {
// Get the d3 state and action dispatch... |
#include <iostream>
#include <thread>
#include <vector>
#include <ctime>
#include "Scene.h" // Assume Scene class is defined in Scene.h
void renderThread(Scene& scene, Image& image, int width, int height, int startY, int endY) {
for (int y = startY; y < endY; ++y) {
for (int x = 0; x < width; ++x) {
... |
<reponame>sarmatdev/ptah-api
'use strict';
const {INTERNAL_SERVER_ERROR, NOT_FOUND} = require('../../../../config/errors');
const {TariffsList} = require('../../../../common/classes/tariffs-list.class');
module.exports = async (ctx, next) => {
try {
const id = ctx.params.id || '';
let result;
... |
<filename>components/layout/index.tsx
import Footer from './Footer'
import Content from './Content'
import Sidebar from './Sidebar'
import Header from './Header'
import Main from './Main'
import Basic, { BasicProps } from './Basic'
import React from 'react'
interface LayoutType extends React.FC<BasicProps> {
Heade... |
#numpy is needed for tests:
pip install numpy
WRAPPER="/usr/bin/time -f \"peak_used_memory:%M(Kb)elapsed_user_time:%U(sec)\""
#WRAPPER="/usr/bin/time"
echo "testing cfind_max_subsum 10**9:"
#$WRAPPER python "performance/cfind_max_subsum.py" 1000000000
echo "testing cfind_max_subsum 10**4:"
$WRAPPER python "perfor... |
<gh_stars>0
TEST_3D_LINES = [
"K0100 4",
"K1002 Teil",
"K2002/1 3D-Position",
"K2004/1 0",
"K2008/1 10",
"K2002/2 X-Achse",
"K2004/2 0",
"K2110/2 9,8",
"K2111/2 10,2",
"K2002/3 Y-Achse",
"K2004/3 0",
"K2110/3 15,8",
"K2111/3 16,2",
"K2002/4 Z-Achse",... |
<reponame>NYCMOTI/open-bid<filename>features/step_definitions/admin_auction_status_steps.rb
Then(/^I should see that approval has not been requested for the auction$/) do
I18n.t('statuses.c2_presenter.not_requested.body', link: '')
end
|
import React from 'react';
import { Provider } from 'react-redux';
import { Router, RouterContext } from 'react-router';
export function createForServer(store, renderProps) {
return (
<Provider store={store} key="provider">
<div>
<RouterContext {...renderProps} />
</div>
</Provider>
);
... |
#!/bin/sh
HyperTRIBE_DIR="/home/analysis/editing/HyperTRIBE/CODE"
#the sam file from the previous step
samfile=$1
#tablename for mysql table
tablename=$2
#expt name (identifier for an experiment), choose something short
expt=$3
#unique replicate number or timepoint for an experiment
tp=$4
echo "Load SAM file to MySQL... |
<reponame>k7n4n5t3w4rt/selection-sort-v3<gh_stars>0
// @flow
/* eslint-env browser */
export function selectionSortFactory(
{
CONTAINER_ID = "",
SHOW_WORKING = true,
FPS = 10,
ACCELLERATION = 100,
CLICK = 1,
COLS = 5,
ROWS = 5,
MAX_SECONDS_TRANSITION_INTERVAL = 2,
CONSTANT_TRANSI... |
#!/usr/bin/env bash
# Init option {{{
Color_off='\033[0m' # Text Reset
# terminal color template {{{
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' ... |
DB_DATA=$HOME/data docker-compose up
|
package plugin.album.utils;
import android.annotation.SuppressLint;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.util.Vector;
public class StringUtils {
public static final bo... |
import java.util.Random;
public class GeneratePassword {
public static void main(String[] args) {
int length = 8;
System.out.println(generatePswd(length));
}
static char[] generatePswd(int len) {
System.out.println("Your Password:");
String charsCaps = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
... |
<gh_stars>0
QUnit.testStart(function() {
let markup = `
<div>
<div id="container" class="dx-datagrid"></div>
</div>`;
$("#qunit-fixture").html(markup);
});
import $ from "jquery";
import "./keyboardNavigationParts/keyboardController.tests.js";
import "./keyboardNavigationParts/acce... |
SELECT * FROM users WHERE user_id < 20 AND active = true; |
<reponame>xxyy/sic
tingoApp.factory('PersonDetailService', ['$http', '$location', '$uibModal', 'QuoteListService',
function ($http, $location, $uibModal, QuoteListService) {
var detailService = {};
detailService.person = {name: 'Loading..'};
detailService.new = function () {
Quo... |
#!/bin/sh
#echo ">>>>>>>>>>>>>>>> ENTERING COMMAND TEMPLATE <<<<<<<<<<<<<<<<<<<<<<"
<%if(config?.use) {%>
use ${config.use}
<%}%>
<%if(config?.modules) {%>
module load ${config.modules}
<%}%>
echo \$\$ > ${CMD_PID_FILE}
cat ${CMD_FILENAME} | bash -e
result=\$?
echo -n \$result > $jobDir/${CMD_EXIT_FILENAME}.tmp
... |
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLFloat
} = require('graphql');
const ProductType = new GraphQLObjectType({
name: 'Product',
fields: () => ({
name: { type: GraphQLString },
price: { type: GraphQLFloat }
})
});
const OrderType = new GraphQLObjectType({
... |
<reponame>soheil555/fairOS-js
import {
PodClose,
PodDelete,
PodNew,
PodOpen,
PodPresent,
PodReceiveInfo,
PodReceive,
PodShare,
PodStat,
PodSync,
PodModel,
} from "../../internal";
export class UserPod extends PodModel {
/**
* shows the pod info of the pod that is to be received
*/
podRe... |
<reponame>community-boating/cbidb-public-web
import advWSClinic from "./advanced-ws-clinic";
import envSci from "./env-sci";
import funGames from "./fun-games";
import mainsail from "./mainsail";
import mercClinic from "./merc-clinic";
import mercFastTrack from "./merc-fast-track";
import paddleAdventure from "./paddle... |
// Copyright 2014 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris <EMAIL>
package model
import (
"logger"
"util"
)
// 用户收藏(用户可以收藏文章、话题、资源等)
type Favorite struct {
Uid ... |
import numpy as np
def process_data(adjusted_rewards, env_infos, agent_infos):
assert type(adjusted_rewards) == np.ndarray, 'adjusted_rewards must be a numpy array'
assert type(env_infos) == dict, 'env_infos must be a dictionary'
assert type(agent_infos) == dict, 'agent_infos must be a dictionary'
asse... |
<reponame>Origen-SDK/ruby-iar
module RubyIAR
class Driver
class Workspace
include ProjectManager
# Create a new workspace object, but does not write it to the disk.
# This creates an internal representation only.
# The returned Workspace object will not have a directory path set.
... |
docker run -it -v "$(pwd)"/giantsteps-key-dataset/audio:/usr/src/app/audio/ -v "$(pwd)"/generated:/usr/src/app/generated/ generator
|
#!/bin/bash
set -e
for jekyll_dir in {_assets,_includes,_layouts,_plugins,fonts,images,web.config}; do
rsync -a --delete $jekyll_dir ./Content
done
|
package com.leetcode;
import org.testng.annotations.Test;
import static org.testng.Assert.*;
public class Solution_447Test {
@Test
public void testNumberOfBoomerangs() {
Solution_447 solution_447 = new Solution_447();
int[][] ints = new int[3][2];
ints[0] = new int[]{0,0};
in... |
#!/bin/bash
#
# This script is for running server up in dev environment.
#
CC='\033[01;36m'
WC='\033[01;37m'
NC='\033[0m'
SHELL_PATH="$(cd "$(dirname "$0")"; pwd -P)"
PARENT_PATH="$(dirname $SHELL_PATH)"
source $SHELL_PATH/util.sh
MOUNT_VOLUME=$1
if [ -z $1 ]; then
coloredEcho white "Specify a path for monuti... |
#!/bin/bash
##
## Deprecated: use install.rkt instead
## On the other hand, install.rkt doesn't yet install c3 support.
##
# echo commands as they're executed
set -x
# exit if non-zero exit code
set -e
IPY_LOC=$(ipython locate)
IRACKET_SRC_DIR=$(pwd)
RACKET_KERNEL_DIR=${IPY_LOC}/kernels/racket
mkdir -p ${RACKET... |
class ChangeColumn < ActiveRecord::Migration[6.0]
def change
change_column :bills, :total, :float
end
end
|
package snippets;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.List;
import org.junit.Test;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
public class FlatMapTest {
@Test
public void rx() {
Multi<Integer> multi = Multi.createFrom().range(1, 3);
... |
<reponame>LitenApe/CookedHam
import { Meta, Story } from '@storybook/react';
import { createRef } from 'react';
import { Descendant as Component, useDescendant } from '.';
import { useMount } from '../../utils/hooks/useMount';
export default {
title: 'Atom/Descendant',
component: Component,
} as Meta;
f... |
<reponame>ideacrew/pa_edidb<filename>app/models/canonical_vocabulary/renewals/policy_builder.rb
module CanonicalVocabulary
module Renewals
class PolicyBuilder
def initialize(family)
@family = family
generate_policy_details
end
def current_insurance_plan(coverage)
curren... |
var query = from employee in Employees
where employee.Age > 25
&& employee.Salary > 3000
select employee; |
#!/bin/bash
set -Eeo pipefail
source "$YAK_BUILDTOOLS/all.sh"
dep --arch="$YAK_TARGET_ARCH" --distro=yak glibc
dep --arch="$YAK_TARGET_ARCH" --distro=yak mpfr
|
import ads
import igraph
from configparser import ConfigParser
from sqlalchemy import *
from sqlalchemy.sql import select, and_
from ads.exceptions import *
from difflib import SequenceMatcher
class CitationNetwork(object):
def __init__(self, filename):
self.db = Database(filename)
self.nodelist =... |
<filename>tools/tasks/project/copy2wp.ts
import * as gulp from 'gulp';
import {join} from 'path';
import {APP_DEST, WP_DIR} from '../../config';
export = () => {
return gulp.src(join(APP_DEST, '**/*.*'))
.pipe(gulp.dest(WP_DIR));
};
|
<gh_stars>0
package cn.focus.eco.house.zipkin.brave.mongo;
import brave.Span;
import brave.Tracer;
import brave.Tracing;
import com.mongodb.ServerAddress;
import com.mongodb.connection.ConnectionId;
import com.mongodb.event.CommandFailedEvent;
import com.mongodb.event.CommandListener;
import com.mongodb.event.CommandS... |
<gh_stars>1-10
/* globals $: true */
/**
* The FileSystemSync module connects the Bramble editor's file system change events
* to the PathCache and SyncManager, making sure that all changes to local files
* get recorded and eventually sent to the server.
*/
var $ = require("jquery");
var strings = require("strings"... |
package marks
type Prompter interface {
Select(string, []string) (int, error)
Confirm(string) bool
}
|
const jwt = require("jsonwebtoken");
const secret = process.env.JWT_SECRET;
function auth(req, res, next) {
try {
const token = req.header("x-auth-token");
if (token) {
const decoded = jwt.verify(token, secret);
req.user = decoded;
next();
} else {
res.status(401).json({
message: "No token provided."
});
}
... |
<filename>build/esm/shaders/glsl/move.position.js
export default /* glsl */ `uniform float transitionEnter;
uniform float transitionExit;
uniform vec4 transitionScale;
uniform vec4 transitionBias;
uniform float transitionSkew;
uniform float transitionActive;
uniform vec4 moveFrom;
uniform vec4 moveTo;
float ease(... |
<reponame>freight-trust/tradedocs
package com.freighttrust.schema.universal;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ParticipantRelatedParty compl... |
const fs = require("fs");
const pipeline = require("stream").pipeline;
const promisify = require("util").promisify;
const fetch = require('node-fetch').default;
const pipelinePromise = promisify(pipeline);
const filePath = './file-client';
const strOption = process.argv[2];
console.info(`Operate string: ${strOption}`... |
# Download the gene id mapping from https://www.genenames.org/download/custom/
# by selecting "NCBI Gene ID", "Ensembl gene ID", and also
# "NCBI Gene ID(supplied by NCBI)" and "Ensembl ID(supplied by Ensembl)"
# These
N=$(
curl 'https://www.genenames.org/cgi-bin/download/custom?col=md_eg_id&col=md_ensembl_id&col=... |
#!/bin/sh
VERSION="1.0.63"
LDFLAGS="-X main.version=$VERSION"
KEY=$1 #The key to sign the package with
if [ "$KEY" = "" ]; then
echo "Must provide gpg signing key"
exit 1
fi
set -o xtrace
for ARCH in amd64 arm 386
do
for OS in linux darwin windows freebsd android
do
if [ "$ARCH" = "amd64" ] || [ "$OS" = "linu... |
<gh_stars>0
/*
* 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
... |
def to_uppercase(list):
return [item.upper() for item in list] |
import roomsService from '../service/rooms';
export default {
namespace: 'rooms',
state: {
rooms: [],
keyword: ''
},
subscriptions: {
setup({ dispatch, history }) {
history.listen(({ pathname }) => {
if (pathname == '/rooms') {
disp... |
#!/bin/sh
copy_data_path=$1
if [ -z "$1" ]; then
#echo $script_dir
echo "usage : test_setup <test data directory>"
elif [ $1 = "/" ]; then
echo "usage : test_setup <test data directory>"
elif [ ! -e $1 ]; then
echo "not found : $1"
echo "usage : test_setup <test data directory>"
else
echo "test data ... |
# dnvm.sh
# Source this file from your .bash-profile or script to use
# "Constants"
_DNVM_BUILDNUMBER="rc1-15532"
_DNVM_AUTHORS="Microsoft Open Technologies, Inc."
_DNVM_RUNTIME_PACKAGE_NAME="dnx"
_DNVM_RUNTIME_FRIENDLY_NAME=".NET Execution Environment"
_DNVM_RUNTIME_SHORT_NAME="DNX"
_DNVM_RUNTIME_FOLDER_NAME=".dnx"
_... |
package db;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import ja... |
package com.padcmyanmar.hello_android_padc;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import com.padcmyanmar.hello_android_padc.R;
/**
* Created by User on 10/30/2017.
*/
public cla... |
// Define the Module struct representing a module in the programming language
struct Module {
// Define the fields of the Module struct
// For example:
// name: String,
// code: String,
// ...
}
// Define the Effect enum representing the effects of the compiled code
enum Effect {
// Define the ... |
#!/bin/bash
# CMDVAR="-Djava.security.egd=file:/dev/./urandom","java -agentlib:jdwp=transport=dt_socket,address=0:8000,server=y,suspend=n -jar"
JAR=weather-1.0.0.jar
if [ ! -e $JAR ]; then
JAR=target/$JAR
if [ -e microservice.yaml ]; then
cp microservice.yaml ./target/
fi
fi
java $CMDVAR -jar ./$JA... |
<reponame>trumank/jblocks<filename>src/main/java/jblocks/Point.java
package jblocks;
import org.jsfml.system.Vector2f;
public class Point {
public double x;
public double y;
public Point() {
x = 0;
y = 0;
}
public Point(double x, double y) {
this.x = x;
this.y = y... |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... |
<filename>service/src/main/java/io/mifos/identity/internal/service/UserService.java
/*
* Copyright 2017 The Mifos Initiative.
*
* 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
*
* htt... |
TERMUX_PKG_HOMEPAGE=https://xmake.io/
TERMUX_PKG_DESCRIPTION="A cross-platform build utility based on Lua"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_MAINTAINER="Ruki Wang @waruqi"
TERMUX_PKG_VERSION=2.5.8
TERMUX_PKG_SRCURL=https://github.com/xmake-io/xmake/releases/download/v${TERMUX_PKG_VERSION}/xmake-v${TERMUX_PKG_V... |
#!/bin/bash
set -eu
packer build -var source_ami=ami-0417e362 docker-baked.json
|
<filename>src/components/ToggleButton/ToggleButton.test.js
import React from 'react';
import renderer from 'react-test-renderer';
import ToggleButton from './ToggleButton';
describe('<ToggleButton />', () => {
const event = { test: true };
const props = {
onClick: jest.fn(),
variant: 'check',
title: '... |
#!/bin/bash
#
# Install mrequests to a MicroPython board
MODULES=('defaultdict.py' 'mrequests.py' 'urlencode.py' 'urlparseqs.py' 'urlunquote.py')
for py in ${MODULES[*]}; do
echo "Compiling $py to ${py%.*}.mpy"
${MPY_CROSS:-mpy-cross} "$py"
${RSHELL:-rshell} --quiet \
-b ${BAUD:-9600} \
-p... |
<reponame>stefb965/JRAW<gh_stars>1-10
package net.dean.jraw.fluent;
import net.dean.jraw.RedditClient;
/**
* <p>Provides the basis of the fluent API. Every Reference has four things in common:
*
* <ol>
* <li>A Reference's constructor always has default (package-protected) visibility
* <li>A concrete Refe... |
#!/usr/bin/env bash
##
# Copyright (c) 2018 Samsung Electronics Co., Ltd. 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... |
#!/bin/bash
#Extracts a particular signal from an 'ASCII generated' data from edfbrowser
cat Participant*_signals.txt | cut -f1 -d' ' | tail -n +2
echo -n "Which signal do you want > "
read signal
signVal=$(cat Participant*_signals.txt | cut -f1 -d' ' | tail -n +2 | grep $signal | cut -d, -f2)
dataFile=Partic... |
#!/usr/bin/env bash
# ---------------------------------------------------------------------------
# HELPER FUNCTIONS
# echo an error message and exit the script
oops() {
echo "$0:" "$@" >&2
exit 1
}
# args: $1 = a binary you want to require e.g. tar, gpg, mail
# $2 = a message briefly describing what y... |
package com.ulfy.master.application.cm;
import com.ulfy.android.mvvm.IView;
import com.ulfy.master.application.base.BaseCM;
import com.ulfy.master.ui.cell.List5ChildCell;
public class List5ChildCM extends BaseCM {
public String name;
public List5ChildCM(String name) {
this.name = name;
}
@Ov... |
import { Icon } from "@chakra-ui/react";
import React from "react";
export function Star(props) {
return (
<Icon viewBox="0 0 18 15" width="18px" height="15px" {...props}>
<path
d="M9.07688 12.1735L4.01319 14.8055L5.14396 9.52016L0.882935 5.8615L6.64591 5.22683L9.07688 0.333496L11.5079 5.22683L17.2... |
def serialize(node):
if node is None:
return "#"
return str(node.val) + "," + serialize(node.left) + "," + serialize(node.right);
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
root.left.left = TreeNode(4)
print(serialize(root)) // prints "1,2,4,#,#,#,3,#,#," |
<gh_stars>0
/********************************************
* 文件名称: HistoricalCalVaR.java
* 系统名称: 外汇资金风险管理
* 模块名称: var计算
* 软件版权:
* 功能说明: 历史模拟法var计算处理类
* 系统版本: 2.0.0.1
* 开发人员: daijy
* 开发时间:
* 审核人员:
* 相关文档:
* 修改记录: 修改日期 修改人员 修改说明
* 20190125 daijy 使用历史法的mVaR计算
* 20190314 daijy ... |
#!/bin/bash
# START CONFIGURATION ##############################################
# set to absolute path of main directory of your QATrack+ deployment. Don't forget trailing slash
QATRACK_DIR=
# set to absolute path of where you want to keep your backups. Don't forget
# the trailing slash! Ideally this should be a r... |
#!/bin/bash
source activate tensorflow_p36
echo -e "\n****************\n CPU Info \n****************\n"
lscpu
echo -e "\n****************\n NVIDIA GPU Info \n****************\n"
nvidia-smi
echo -e "\n****************\n Memory Info \n****************\n"
free -h
echo -e "\n****************\n GCC Info \n*************... |
<filename>src/app/services/global.mnemonickeypad.service.ts
import { Injectable } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { Subject } from 'rxjs';
import { MnemonicKeypadComponent } from '../components/mnemonic-keypad/mnemonic-keypad.component';
import { GlobalThemeService } from ... |
<gh_stars>0
package model
trait Executable {
def contents: List[String]
def resolveContent(contentBase: String, characList: List[Characteristic]): String =
characList.foldLeft (contentBase)((acc, charac) => acc.replaceAll(charac.key, charac.value))
}
case class Operation (val contentBase: String, val chara... |
person_data = {
"first_name": "John",
"last_name": "Doe",
"age": 28
} |
#!/bin/bash -f
#
# This script reconciles the elasticsearch indexes against what is loded
# into stardog. The --noconfig flag is for running in the dev environment
# where the setenv.sh file does not exist. The --force flag is used
# to recompute indexes that already exist rather than skipping them.
#
config=1
force=... |
<reponame>victorzottmann/dice-game<gh_stars>0
import { rollDice } from "./utils.js";
describe('rollDice', () => {
it('returns a number from 1-6', () => {
const number = rollDice();
expect(number).toBeGreaterThan(0);
expect(number).toBeLessThan(7);
})
})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.