text stringlengths 1 1.05M |
|---|
<filename>core/locale.go
package core
import (
"fmt"
"github.com/nicksnyder/go-i18n/i18n"
)
var (
// Langs holds available languages
Langs []string
)
// P is a sugar type to write core.P{} instead of map[string]interface{} for i18n parameters
type P map[string]interface{}
// TranslateFunc represents a translat... |
<reponame>dongxuny/rk-entry
// Copyright (c) 2021 rookie-ninja
//
// Use of this source code is governed by an Apache-style
// license that can be found in the LICENSE file.
package rkentry
import (
"context"
"encoding/json"
"net/http"
"path"
"runtime"
)
const (
// CommonServiceEntryType type of entry
CommonS... |
<reponame>paullewallencom/grunt-978-1-7852-8161-7
module.exports = function(grunt) {
grunt.initConfig({
browserify: {
options: {
transform: [
['babelify', {
'presets' : ['es2015']
}]
]
}... |
/*
* The AnVIL
* https://www.anvilproject.org
*
* Basic navigation service.
* Filters navigation by document path.
*/
/**
* Given a document path, return either its corresponding section or primary link.
* Param x = 0 corresponds to section, x = 1 to primaryLink and so on.
* @param docPath
* @param x
* @ret... |
package com.globalcollect.gateway.sdk.java.gc.token.definitions;
import com.globalcollect.gateway.sdk.java.gc.fei.definitions.BankAccountIban;
public class TokenNonSepaDirectDebitPaymentProduct707SpecificData {
private String addressLine1 = null;
private String addressLine2 = null;
private String addressLine3 =... |
<filename>client/src/components/PostDetail/Participants/Card.js
import React from 'react';
import styled from 'styled-components/macro';
import { wideFont } from '../../shared/helpers';
const CardWrapper = styled.div`
${wideFont};
border: 1px solid silver;
margin-right: 10px;
padding: 10px;
min-width: 70px;... |
<filename>src/main/java/net/avcompris/tools/diagrammer/AppInfo.java
package net.avcompris.tools.diagrammer;
import static org.apache.commons.lang3.StringUtils.isBlank;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
abstract class AppInfo {
public final String artifactId;
publ... |
import React, { Fragment } from 'react';
import moment from 'moment';
import PropTypes from 'prop-types';
import { Squares } from 'react-activity';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { Table } from 'semantic-ui-react';
impo... |
package util;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Random;
public class FileUtil {
/***
* Returns the list of files, with the given extension, in the given inDir.
*
* @param extension the file... |
package gamesite.servlet;
import java.io.*;
import java.net.*;
import java.sql.SQLException;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import gamesite.utils.*;
import gamesite.utils.LoginHandler;
import gamesite.model.DashBoardCommands;
import gamesite.model.SQLExcep... |
class UsersController {
getAll(req, res) {
res.end('/users GET');
}
get(req, res) {
res.end('/users/:id GET');
}
add(req, res) {
res.end('/users POST');
}
update(req, res) {
res.end('/users/:id PUT');
}
remove(req, res) {
res.end('/users/:id DELETE');
}
}
module.exports = Us... |
#!/bin/bash
WORK_DIR=`dirname $(readlink -f $0)`
VERBOSE=""
database=chouette2
user=chouette
host=localhost
port=5432
datatype="--column-inserts"
schema_name=""
function usage(){
echo "Usage `basename $0` [-p port] [-d database] [-u user] [-t tables separated with space] [-o outputfile] [-n schema-name] [-r... |
<filename>container/src/main/java/no/mnemonic/commons/container/ComponentContainer.java
package no.mnemonic.commons.container;
import no.mnemonic.commons.component.*;
import no.mnemonic.commons.container.plugins.ComponentContainerPlugin;
import no.mnemonic.commons.container.plugins.ComponentDependencyResolver;
import ... |
<reponame>mouchtaris/jleon
package gv.jleon
package config
protected[config] trait ConfigDecorationOps extends Any {
def self: tsConfig
final def apply(path: String): tsConfig = self getConfig path
final def mirrors: tsConfigObject = self getObject s"${config.key.mirrors}"
final def storage: tsConfig = sel... |
rm -f ~/.config/VirtualBox/VirtualBox.xml
rm -rf ~/VirtualBox\ VMs/*
rm -rf ~/.vagrant.d/boxes/*
rm -rf ~/github/test
mkdir ~/github/test
cd ~/github/test
STATUS='OK'
## tests below
sh -x ~/github/clean-each.sh
sh -x ~/github/vagrant-opennebula-ha-tutorial-centos7.sh > ~/github/vagrant-opennebula-ha-tutorial-centos7.tx... |
/**
* MK & MK4due 3D Printer Firmware
*
* Based on Marlin, Sprinter and grbl
* Copyright (C) 2011 <NAME> / <NAME>
* Copyright (C) 2013 - 2016 <NAME> @MagoKimbra
*
* 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 ... |
<reponame>gfrntz/anycable-go
package mruby
import "unsafe"
// #cgo CFLAGS: -Ivendor/mruby/include
// #cgo darwin LDFLAGS: ${SRCDIR}/libmruby_darwin.a -lm
// #cgo linux,386 LDFLAGS: ${SRCDIR}/libmruby_linux386.a -lm
// #cgo linux,amd64 LDFLAGS: ${SRCDIR}/libmruby_linux_amd64.a -lm
// #cgo linux,arm64 LDFLAGS: ${SRCDIR... |
<filename>common-utils/common-api/src/main/java/com/atjl/common/api/req/PageReqV1.java
package com.atjl.common.api.req;
import com.atjl.common.constant.CommonConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* 分页请求 类型2
*
* @author jasondliu
*/
@ApiM... |
#!/bin/bash
TABLE_NAMES_DATA="Assay \
AssayPV \
AssayPVOntology \
AssaySample \
Experiment \
ExperimentAsset \
Sample \
SamplePV \
SamplePVOntology"
TABLE_NAMES_SCHEMA="ArrayDesign \
AnnotationSrc \
... |
<reponame>smarulanda97/nextjs-spa5sentidos-v2
type Menu = {
id: string;
name: string;
items: MenuItem[];
__typename?: string;
machine_name: string;
};
type MenuItem = {
id: string;
link: string;
title: string;
icon?: StrapiImage;
__typename?: string;
};
type StrapiImage = {
url: string;
name: ... |
def merge_sort(arr):
if len(arr) > 1:
mid = len(arr) // 2
left = arr[:mid]
right = arr[mid:]
merge_sort(left)
merge_sort(right)
i = j = k = 0
while i < len(left) and j < len(right):
if left[i] < right[j]:
arr[k] = left[i]
i += 1
else:
arr[k] = right[j]
j += 1
k += 1
while i < len(left):
arr... |
package org.museautomation.ui.editors.suite;
import javafx.application.*;
import javafx.scene.*;
import javafx.scene.input.*;
import net.christophermerrill.testfx.*;
import org.junit.jupiter.api.*;
import org.museautomation.builtins.step.*;
import org.museautomation.core.*;
import org.museautomation.core.project.*;
im... |
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --N=1
#SBATCH --gres=gpu:8
#SBATCH --exclusive
#SBATCH --mem=0
##SBATCH -p debug
#SBATCH --time=06:00:00
##SBATCH --time=06:00:00
srun --gres=gpu:1 -C cuda-mode-exclusive -t 360 -N 1 -n 1 python finbert-bilstm-1.py 4094 sec7 Z_score_c 5 1 2 6e-4 &
srun --gres=gpu:1 -C cuda-mode-ex... |
<reponame>shawntoffel/atto
#ifndef _ATTO_H_
#define _ATTO_H_
typedef struct atto_server {
const char *port;
const int file_descriptor;
} atto_server_t;
atto_server_t atto_init_server(char *port);
int atto_handle_next_connection(atto_server_t *server, char *response);
int atto_close_server(atto_server_t *serve... |
public static int[] getDigits(int num) {
int[] digits = new int[Integer.toString(num).length()];
int i = 0;
while (num > 0) {
digits[i] = num % 10;
num /= 10;
i++;
}
return digits;
}
int[] digits = getDigits(1975);
System.out.println(Arrays.toString(digits)); // outputs "[... |
#include "xr_dsa.h"
#include "crypto.h"
#include <openssl/dsa.h>
namespace crypto
{
xr_dsa::xr_dsa(u8 const p[public_key_length],
u8 const q[private_key_length],
u8 const g[public_key_length])
{
m_dsa = DSA_new();
m_dsa->p = BN_new();
m_dsa->q = BN_new();
m_dsa->g = BN_new();
m_ds... |
<reponame>netluxe/goss
package resource
import "github.com/aelsabbahy/goss/system"
type Package struct {
Name string `json:"-"`
Installed bool `json:"installed"`
Versions []string `json:"versions,omitempty"`
}
func (p *Package) ID() string { return p.Name }
func (p *Package) SetID(id string) { p.... |
<filename>scripts/generate-upload-merkle.js
#!/usr/bin/env node
require("dotenv").config();
const program = require("commander");
const axios = require("axios");
const loadJsonFile = require("load-json-file");
const MerkleTree = require("../scripts/merkle-tree");
async function main() {
program
.descripti... |
<gh_stars>1-10
StartTest(function(t) {
// Running in the 'top' page scope. Get the local variables from the test.
var Ext = t.Ext();
var window = t.global;
var document = window.document;
t.chain(
{ type : "CharlieJohnson", target : '>> #loginPanel textfield[fieldLabel=L... |
#!/usr/bin/env bash
# Exit immediately if a pipeline, which may consist of a single simple command,
# a list, or a compound command returns a non-zero status
set -e
readonly MONIKER=yed
readonly VERSION=3.21.1
readonly STUFF=yEd-$VERSION.zip
readonly TARGET_DIR=$HOME/programs/$MONIKER
readonly START_SCRIPT=$TARGET_DI... |
# frozen_string_literal: true
# Copyright 2021 Google LLC
#
# 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 applicabl... |
#!/bin/bash
set -e
java -jar ${JAVA_MEMORY_OPTIONS} ${JAVA_OPTIONS} /opt/minecraft/minecraft_server.jar
exit 0
|
<reponame>FAU-SWARM/website<filename>src/app/components/data/intelligent/intelligent.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-intelligent',
templateUrl: './intelligent.component.html',
styleUrls: ['./intelligent.component.scss']
})
export class IntelligentCompon... |
<reponame>alex-kar/andhow
package org.yarnandtail.andhow.property;
import org.yarnandtail.andhow.api.*;
import org.yarnandtail.andhow.valid.BigDecValidator;
import org.yarnandtail.andhow.valuetype.BigDecType;
import java.math.BigDecimal;
import java.util.List;
/**
* A Property that refers to a BigDecimal value.
*
... |
package fr.syncrase.ecosyst.service.criteria;
import java.io.Serializable;
import java.util.Objects;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.BooleanFilter;
import tech.jhipster.service.filter.DoubleFilter;
import tech.jhipster.service.filter.Filter;
import tech.jhipster.service.filte... |
package httpinfo_test
import (
"fmt"
"net/http"
"net/http/httptest"
"github.com/krostar/httpinfo"
)
func myMiddleware(next http.Handler) http.HandlerFunc {
return func(rw http.ResponseWriter, r *http.Request) {
next.ServeHTTP(rw, r)
if httpinfo.IsUsed(r) {
fmt.Printf("status = %d\n", httpinfo.Statu... |
export SCALA_VERSION="2.13"
export KAFKA_VERSION="2.7.0"
export KAFKA_HOME=/opt/kafka_$SCALA_VERSION-$KAFKA_VERSION
# Kafka Environment Configuration ########
cd $KAFKA_HOME/config
# set zookeeper.connect ===========
FIND="^zookeeper.connect=.*$"
REPLACE="zookeeper.connect=${KAFKA_ZOOKEEPER_CONNECT}"
sed -i "s/${FIN... |
def primeFactorization(m):
factors = []
# Divide by 2 until m is odd
while m % 2 == 0:
factors.append(2)
m = m // 2
# Now m is odd, start checking from 3
for i in range(3, int(m**0.5) + 1, 2):
while m % i == 0:
factors.append(i)
m = m // i
# If m i... |
package com.hookedroid.chromecastdemo.provider;
import android.content.Context;
import com.google.android.gms.cast.framework.CastOptions;
import com.google.android.gms.cast.framework.OptionsProvider;
import com.google.android.gms.cast.framework.SessionProvider;
import java.util.List;
public class CastOpti... |
#!/bin/bash
shopt -s extglob
home=$(pwd)
# If we're not under a "src" directory we're (probably) on the CI server.
# export GOPATH and cd to the right location
if [[ $home != *"src"* ]]; then
export GOPATH=${home}
dir=$(git config --get remote.origin.url)
dir=${dir#http://} # remove leading http://
dir=${d... |
<gh_stars>0
package epizza.order;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.conte... |
require 'thor'
require 'pathname'
require 'yaml'
# Praxis application generator
#
# Generates all files required to run a simple praxis app.
#
class PraxisAppGenerator < Thor
include Thor::Actions
attr_reader :app_name
namespace 'praxis'
desc "generate 'app-name'", "Generates a new PRAXIS application"
#... |
// Connect to the database
let db = connectToDB();
// define a handler for orders
let handleOrder = (order) => {
// parse user order
let items = parseOrder(order);
// store user order in the database
storeItems(items, db);
};
// Call the handler with a user-defined order
handleOrder('2x Apple, 1x Banana')... |
DROP TABLE IF EXISTS student;
CREATE TABLE student (
student_id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
login VARCHAR(80) NOT NULL,
pass VARCHAR(80) NOT NULL
) ENGINE=INNODB;
INSERT INTO student(login, pass) VALUES('test','test');
|
<reponame>KnisterPeter/smaller-node-builder
package de.matrixweb.smaller.maven.plugin.node;
/**
* @author markusw
*/
public interface Logger {
/**
* @param message
*/
void info(String message);
/**
* @param message
*/
void debug(String message);
}
|
<filename>src/icons/legacy/PinterestSquare.tsx
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import PinterestSquareSvg from '@rsuite/icon-font/lib/legacy/PinterestSquare';
const PinterestSquare = createSvgIcon({
as: PinterestSquareSvg,
ariaLabel: 'pinterest square',... |
<gh_stars>10-100
import {getInitials} from "constants/name";
describe("initials", () => {
test("name without spaces", () => {
expect(getInitials("andiKandi")).toEqual("an");
});
test("name with one space", () => {
expect(getInitials("<NAME>")).toEqual("aK");
});
test("name with multiple spaces", ()... |
result=$( w )
echo ${result:0:80} |
#pragma once
#include <afxwin.h>
#include <afxdialogex.h>
#include <functional>
class CSimulationDialog : public CDialogEx
{
public:
CSimulationDialog(UINT nIDTemplate, CWnd* pParent);
protected:
virtual afx_msg LRESULT OnInvoke(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
public:
CWinThread ... |
<reponame>cugg/BusinessParameters<filename>parameters-backend/parameters-backend-inmemory/src/main/java/be/kwakeroni/evelyn/storage/StorageProvider.java
package be.kwakeroni.evelyn.storage;
public interface StorageProvider {
public Storage create(String name) throws StorageExistsException;
public Storage read... |
<filename>lib/systems/triphenylene.py
import pulsar as psr
def load_ref_system():
""" Returns triphenylene as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
C 1.23839 0.71468 -0.00000
C 1... |
<filename>vi/.vim/bundle/pencil/app/pencil-core/propertyType/color.js
function Color() {
this.r = 0;
this.g = 0;
this.b = 0;
this.a = 1.0;
}
Color.REG_EX = /^#([0-9A-F]{2,2})([0-9A-F]{2,2})([0-9A-F]{2,2})([0-9A-F]{2,2})$/i;
Color.REG_EX_NO_ALPHA = /^#([0-9A-F]{2,2})([0-9A-F]{2,2})([0-9A-F]{2,2})$/i;
Col... |
CUDA_VISIBLE_DEVICES=0 python main.py --optim sgd --lr 0.1 --momentum 0.9 --decay_epoch 150 --model vgg && mv curve/vgg-sgd-lr0.1-momentum0.9-wdecay0.0005-run0-resetFalse curve/localtrain-basic/vgg-sgd-lr0.1-momentum0.9-wdecay0.0005-run0-resetFalse
|
"""
Common resource for testing annotation terms.
"""
# convention: preferred name, preferred id, followed by any other ids and alternative names
brainstem_terms = [ # Landmarks and groups
("brainstem", "UBERON:0002298", "ILX:0101444"),
("central canal of spinal cord", "UBERON:0... |
div {
width: 300px;
height: 200px;
border: 5px solid #3498db;
} |
#!/bin/bash
curl ipinfo.io/ip
|
<filename>src/Boj6444.java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.StringTokenizer;
public class Boj6444 {
private static final int LAST = 18_278;
private static final char EQUAL = '=';
private static final String PLUS = "+";
private static fina... |
#!/bin/bash
#rename in=<infile> out=<outfile>
function usage(){
echo "
Written by Brian Bushnell
Last modified July 31, 2015
Description: Reduces Silva entries down to one entry per taxa.
Usage: reducesilva.sh in=<file> out=<file> column=<1>
Parameters:
column The taxonomic level. 0=species, 1=genu... |
<filename>backend/src/models/index.js
const Sequelize = require('sequelize');
const env = process.env.NODE_ENV || 'development';
const config = require(__dirname + '/../../config/database.js')[env];
let sequelize;
if (config.use_env_variable) {
sequelize = new Sequelize(process.env[config.use_env_variable], config);... |
def process_text(data):
data = [x.split(" . ") for x in data if x.strip() and x.strip()[0] != "="] # Step 1
sentences = []
for para in data:
for sent in para:
sentences.append(sent + ".") # Step 2
data = "\n".join(sentences)
data = data.replace(" @.@ ", ".").replace(" @-@ ", "-... |
<filename>libs/sdk-ui-pivot/src/impl/agGridColumnSizing.ts
// (C) 2007-2020 GoodData Corporation
import invariant, { InvariantError } from "ts-invariant";
import omit from "lodash/omit";
import omitBy from "lodash/omitBy";
import {
getAttributeLocators,
getColumnIdentifier,
getColumnIdentifierFromDef,
g... |
export default function ( obj ) {
const vals = [];
for ( let key in obj ) {
if ( obj.hasOwnProperty(key) ) {
vals.push( obj[key] );
}
}
return vals;
};
|
<gh_stars>0
import pickle
import tensorflow as tf
from sklearn.model_selection import train_test_split
from alexnet import AlexNet
from sklearn.utils import shuffle
# TODO: Load traffic signs data.
# TODO: Split data into training and validation sets.
training_file = 'train.p'
validation_file= 'valid.p'
testing_file =... |
<reponame>mykaelandrade/fiscal4j<filename>src/main/java/br/indie/fiscal4j/nfe400/transformers/NFIdentificadorLocalDestinoOperacaoTransformer.java
package br.indie.fiscal4j.nfe400.transformers;
import br.indie.fiscal4j.nfe400.classes.nota.NFIdentificadorLocalDestinoOperacao;
import org.simpleframework.xml.transform.Tra... |
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import Parameter
from .math import normalize
class AngleMultipleLinear(nn.Module):
"""Based on SoftTriplet loss: https://arxiv.org/pdf/1909.05235.pdf
"""
def __init__(self, in_features, num_c... |
const curry = require('lodash/curry');
const { withProps } = require('bottender');
const _ = require('./_');
const match = (value, mapping) => {
const defaultMapping = mapping.find(([pattern]) => pattern === _);
const otherMapping = mapping.filter(([pattern]) => pattern !== _);
const Fn = async (context, props... |
#!/bin/bash
sudo apt-get upgrade -y
sudo apt-get update -y
sudo apt-get install libsm6 -y
sudo apt-get install libgtk2.0-dev -y
sudo bash scripts/install_python36.sh
python3.6 -m venv env-prod
source env-prod/bin/activate
sudo $(which python) -m pip install --upgrade setuptools
sudo $(which python) -m pip install -r ... |
#!/bin/bash
#SBATCH --job-name=/data/unibas/boittier/test-neighbours2
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --partition=short
#SBATCH --output=/data/unibas/boittier/test-neighbours2_%A-%a.out
hostname
# Path to scripts and executables
cubefit=/home/unibas/boittier/fdcm_project/mdcm_bin/cubefit.x
fdcm=/home/uni... |
const matrix = [];
for (let i = 0; i < 5; i++) {
let row = [];
for (let j = 0; j < 5; j++) {
row.push(Math.floor(Math.random() * 100));
}
matrix.push(row);
}
console.table(matrix); |
import { IVariant } from "./IVariant";
import { Types } from "./Types";
import { SPIRType } from "./SPIRType";
export declare class SPIRConstantConstant {
value: ArrayBuffer;
private _dataView;
get u32(): number;
set u32(value: number);
get i32(): number;
set i32(value: number);
get f32(): n... |
<reponame>leomillon/try-jcv
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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 requir... |
<gh_stars>0
/*
* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Les... |
<gh_stars>0
import { Component, OnInit} from '@angular/core';
import { Router } from '@angular/router';
import { Project } from '../../../core/models/view-models/project.view.model';
import { UserModel } from '../../../core/models/input-models/user.model';
import { ProjectsService } from '../../../core/services/project... |
#!/bin/sh
set -e
CONFIG_LOCAL="$(echo "$0" | sed -e 's/[^\/]*$//')config-local.sh"
perl -e '
for(qw(HOME USER SOURCE CORE CONFIG DATA LOG TMP PORT UPLOAD NO_CLONETRACK))
{
if (exists $ENV{$_})
{
print "export $_=\"$ENV{$_}\"\n";
}
}
' >$CONFIG_LOCAL
|
#!/bin/bash
CYN='\e[96m';
GRN='\e[92m';
NC='\e[0m';
CHK='\xE2\x9C\x94';
printf "\n\n${CYN}Setting up your environment...${NC}\n";
sudo touch /dev/null;
# Stopping Apach and restarting services
printf "\nStopping Apache service in case it's running... ${NC}\n";
sudo systemctl stop apache2 &> /dev/null;
pri... |
<gh_stars>1-10
package golastic
import (
"encoding/json"
"testing"
)
func TestResultItem(t *testing.T) {
resultItem, err := getResultItem()
if err != nil {
Error(t, err)
}
AssertEqualString(t, resultItem.Index, "test")
AssertEqualString(t, resultItem.Type, "products")
AssertEqualString(t, resultItem.Id, "1... |
module.exports = async function (context, req) {
context.log('CreatePlayer triggered.');
if (req.body && req.body.username && req.body.game) {
return {
playerDocument: {
id: req.body.username,
game: req.body.game,
},
res: {
sta... |
<reponame>glowroot/glowroot-instrumentation
/*
* Copyright 2017-2019 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/... |
#include <iostream>
using namespace std;
// Function to sort an array using bubble sort
void BubbleSort(int arr[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
for (j = 0; j < n-i-1; j++)
if (arr[j] > arr[j+1])
swap(arr[j], arr[j+1]);
}
// Function to s... |
#!/bin/bash
#
# Copyright 2016 The Bazel 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 by... |
def sort(arr):
n = len(arr)
# Traverse through all array elements
for i in range(n):
# The last element has already been sorted
for j in range(0, n-i-1):
# traverse the array from 0 to n-i-1
# Swap if the element found is greater
# than... |
# Test
npm test
if [[ $? -ne 0 ]] ; then
echo "Tests failed."
exit $?
fi
echo 'test complete'
# Upgrade patch version
npm version patch
echo 'updated patch version'
# Deploy to NPM
npm publish
echo 'publish complete'
|
#!bin/bash
#take date from lsat logdate
logdate=$(tail -1 Foto.log | awk '{print $1}' Foto.log )
yr=${date:1:5}
mo=${date:6:3}
dy=${date:10:2}
#printf "%s%s%s\n" $dy $mo $yr
logfolder="$dy$mo$yr"
#take all folder name kucing_* and kelinci_*
folderkucing=$(kucing_*)
folderkelinci=$(kelinci_*)
#set password into today... |
from IPython.utils.traitlets import
class CustomMenu(IPython.config.configurable.Configurable):
"""A customizable menu container
"""
def __init__(self):
super(CustomMenu, self).__init__(config=None)
self._buttons = []
def add_button(self, label, action):
"""Add a new button t... |
def reverse_string(string):
return string[::-1] |
# # Lines configured by zsh-newuser-install
# # Not sure If I banjqxed UZ
autoload -Uz compinit
compinit
#
# End of lines added by compinstall
#
# For Adding Tmuxinator Functionality
# source $HOME/.bin/tmuxinator.zsh
source $HOME/.zplug/init.zsh
if [ -f '$HOME/.fzf.zsh' ]; then
. "$HOME/.fzf.zsh"
fi
############... |
#!/bin/bash
#
# Master build script
#
# This will:
# 1. Build OpenSSL libraries for macOS and iOS using the `build.sh`
# 2. Generate the `openssl.h` umbrella header for macOS and iOS based on the contents of
# the `include-macos` and `include-ios` directories.
#
# Levi Brown
# mailto:levigroker@gmail.com
# Sep... |
<gh_stars>100-1000
package dev.webfx.kit.mapper.peers.javafxgraphics.markers;
import javafx.beans.property.Property;
import javafx.scene.layout.Border;
/**
* @author <NAME>
*/
public interface HasBorderProperty {
Property<Border> borderProperty();
default void setBorder(Border border) { borderProperty().se... |
<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 documentation files (hereinafter "the Software")
/... |
#!/bin/bash
# Launch turtlebot_teleop node
xterm -hold -e "roslaunch turtlebot_teleop keyboard_teleop.launch" &
pid1=$!
# Wait for the teleop node to initialize
sleep 5
# Launch amcl node
xterm -hold -e "roslaunch my_robot amcl.launch" &
pid2=$!
# Wait for the amcl node to initialize
sleep 10
# Run pick_objects_no... |
#!/bin/bash
# author: Liang Gong
if [ "$(uname)" == "Darwin" ]; then
# under Mac OS X platform
NODE='node'
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# under GNU/Linux platform
NODE='nodejs'
fi
cd directory-traversal/canvas-designer
RED='\033[0;31m'
BLUE='\033[0;34m'
GREEN='\03... |
package com.bebel.bdd.dao;
import com.bebel.bdd.dto.SamhainDto;
import com.bebel.soclews.util.Logger;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.Map;
@Repository
public class SamhainDao extends AbstractDao {
private final Logger log = new Logger(getClass());
... |
class ProjectMetadata:
def __init__(self, thinker, category, name):
self.thinker = thinker
self.category = category
self.name = name
def write_metadata_to_file(self, file_name):
with open(file_name, "w") as f:
f.write(
f'THINKER = "{self.thinker}"\nCA... |
"""
Generate code to create a random 10x10 matrix of zeroes and ones
"""
import random
matrix_size = 10
matrix = [[random.choice([0, 1]) for i in range(matrix_size)] for j in range(matrix_size)]
print(matrix) |
<filename>UVa/uva 10550.cpp
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int a, b, c, d;
while(cin>>a>>b>>c>>d, a||b||c||d){
int ans=1080;
cout<<1080+9*(a-b<0?a-b+40:a-b)+9*(c-b<0?c-b+40:c-b)+9*(c-d<0?c-d+40:c-d)<<endl;
}
}
|
const { GenericContainer } = require('testcontainers');
const MySqlDriver = require('../driver/MySqlDriver');
const version = process.env.TEST_MYSQL_VERSION || '5.7';
const startContainer = async () => {
const builder = new GenericContainer(`mysql:${version}`)
.withEnv('MYSQL_ROOT_PASSWORD', process.env.TEST_DB... |
#!/bin/sh -l
set -e
echo "Stable: $STABLE"
VERSION=`python -c 'import fsps;print(fsps.__version__)'`
echo "Version: $VERSION"
# Build the docs
cd docs
make dirhtml
# Update the gh-pages branch
git clone --branch=gh-pages https://github.com/$GITHUB_REPOSITORY _output
cd _output
rm -rf latest
mkdir -p latest
cp -r ../... |
| <-- | 9 2 7 4 1 |
|
| 2 | | | | | |
|
| 7 | | | | | |
|
| 4 | 2 | | | |
|
| 1 | 2 4 | | |
|
| | 1 2 4 7 | |
|
| | <-- | 1 2 4 7 9 | |
#!/bin/bash
set -eo pipefail
set +x
set -u
if [ $# -eq 0 ]; then
set -- "help"
fi
export BUILDIFIER_BIN="${BUILDIFIER_BIN:=/usr/local/bin/buildifier}"
export BUILDOZER_BIN="${BUILDOZER_BIN:=/usr/local/bin/buildozer}"
export NUM_CPUS=${NUM_CPUS:=$(grep -c ^processor /proc/cpuinfo)}
export CIRCLECI=${CIRCLECI:=""}... |
#!/bin/sh
export PYTHONPATH=$PWD
python3 svcClient/run.py
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.