text stringlengths 1 1.05M |
|---|
# routes.py
from flask import jsonify, request
from . import order_api_blueprint
# Sample data for demonstration purposes
orders = [
{"id": 1, "product": "Product A", "quantity": 2},
{"id": 2, "product": "Product B", "quantity": 1}
]
@order_api_blueprint.route('/orders', methods=['GET'])
def get_all_orders()... |
#!/bin/bash
set -eu
version=12
for cmd in clang clang-${version} clang++ clang++-${version} clang-format clang-format-${version} clang-tidy clang-tidy-${version} llvm-ar llvm-ar-${version}
do
result=0
output1=$(${cmd} --version 2>&1) || result=$?
if [ ! "${result}" = "0" ]; then
echo >&2 "ERROR: command '$... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.phone = void 0;
var phone = {
"viewBox": "0 0 20 20",
"children": [{
"name": "path",
"attribs": {
"d": "M17.256,12.253c-0.096-0.667-0.611-1.187-1.274-1.342c-2.577-0.604-3.223-2.088-3.332-3.734C12.193,7.092,11.38,7,... |
package com.abubusoft.kripton.examples.rssreader.service.model;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import com.abubusoft.kripton.TypeAdapter;
public class DateAdapter implements TypeAdapter<Date, String> {
... |
package br.com.alinesolutions.anotaai.model.usuario;
import java.time.ZonedDateTime;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
impor... |
#!/bin/sh
# Copyright 2019 Google LLC
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#################################### Scalar ###################################
### Generic C micro-kernels
tools/xngen src/f32-vmulcaddc/scalar.c.in... |
<reponame>fossabot/v-rating
const Vue = require('vue');
const VRating = require('v-rating');
function getComponent(Component, propsData) {
const Ctor = Vue.extend(Component);
return new Ctor({ propsData }).$mount();
}
var exampleData = {
rateMe: 0
};
describe('VRatingSemanticUIComponent', function() {
... |
<reponame>Priyalc/Gcloud<filename>sdk/src/test/java/com/google/cloud/dataflow/sdk/util/StreamingGroupAlsoByWindowsDoFnTest.java
/*
* Copyright (C) 2015 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 ... |
apt-get update
sudo apt-get install -y apt-utils dirmngr gnupg gnupg-agent software-properties-common python3 autoconf gperf bison flex gcc g++ make swig python-dev cmake subversion iverilog python3-pip python-pip texlive-base texlive-fonts-extra texlive-fonts-recommended texlive-generic-recommended texlive-pictures te... |
const path = require('path');
const axios = require('axios');
const fse = require('fs-extra');
const { findAvailablePort, killPort, portIsOccupied } = require('./port');
const { runBySpawn, runByExec } = require('./run-cmd');
function getAbsolutePath(basePath, curPath) {
// 注意:有可能 rootPath 后面携带了一个反斜杠,需要去掉
if (... |
#!/usr/bin/env bash
{{!
Template adapted from here:
https://github.com/chriskempson/base16-builder/blob/master/templates/gnome-terminal/dark.sh.erb
}}
# Base16 Dracula - Gnome Terminal color scheme install script
# Mike Barkmin (http://github.com/mikebarkmin) based on Dracula Theme (http://github.com/dracula)
[[ -... |
<filename>src/main/java/jp/col/controller/dailyreport/DailyReportListController.java
package jp.col.controller.dailyreport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Locale... |
import React from 'react'
import PropTypes from 'prop-types'
export const ReducerContext = React.createContext({})
export default function ReducerProvider({ children, value }) {
return (
<ReducerContext.Provider value={value}>{children}</ReducerContext.Provider>
)
}
ReducerProvider.propTypes = {
children: ... |
#!/bin/bash
#SBATCH -J Act_maxout-3_1
#SBATCH --mail-user=eger@ukp.informatik.tu-darmstadt.de
#SBATCH --mail-type=FAIL
#SBATCH -e /work/scratch/se55gyhe/log/output.err.%j
#SBATCH -o /work/scratch/se55gyhe/log/output.out.%j
#SBATCH -n 1 # Number of cores
#SBATCH --mem-per-cpu=2000
#SBATCH -t 23:59:00 # Hours, minutes... |
alter session set "_ORACLE_SCRIPT"= true;
create user testing identified by testing account unlock;
grant create session, connect, resource to testing;
grant all privileges to testing;
ALTER USER testing PROFILE DEFAULT;
grant IMP_FULL_DATABASE to testing; |
import AbstractStorage from './AbstractStorage';
import NullMarshaller from './Marshaller/NullMarshaller';
export default
class ProvidedTokenStorage extends AbstractStorage {
private _accessToken?: string;
private _refreshToken?: string;
/**
* Constructor.
*/
constructor(accessToken?: string... |
// #!/usr/bin/env node
var nps = require('path')
var child = require('child_process')
var chalk = require('chalk')
var over = require('../lib/lib/utils/overwrite-require')
var _console = require('../lib/lib/utils/console').default
var info = over.getInfo()
function install(pkg) {
var cmd = 'npm install ' + pkg +... |
package info.novatec.micronaut.camunda.feature;
import io.micronaut.context.annotation.ConfigurationProperties;
import io.micronaut.core.bind.annotation.Bindable;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@ConfigurationProperties("datasources.default")
public interfac... |
<filename>server.js
'use strict';
require('dotenv').config();
const express = require('express');
const cors = require('cors');
const mongoose = require('mongoose');
mongoose.connect(process.env.DB_URL, {useNewUrlParser: true, useUnifiedTopology: true});
const db = mongoose.connection;
const Book = require('./models/b... |
<reponame>AnwarHaque/chefjenkins
#
# Cookbook:: jenkins
# HWRP:: credentials_password
#
# Author:: <NAME> <<EMAIL>>
#
# Copyright:: 2013-2016, Chef Software, 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 cop... |
#!/bin/bash
set -e
export PATH=/usr/local/bin:$PATH
exec "$@"
|
from typing import List
def process_sequence(sequence: str) -> List[str]:
stack = []
for c in sequence:
if c not in stack:
stack.append(c)
else:
stack.remove(c)
return stack |
const http = require('http')
const fs = require('fs')
const SERVER_PORT = 3000;
const server = http.createServer((request, response) => {
// Informações básicas de uma request
console.log('request.url', request.url)
console.log('request.method', request.method)
// console.log('request.headers', reque... |
<filename>node_modules/react-icons-kit/feather/packageIcon.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.packageIcon = void 0;
var packageIcon = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M12.89 1.45l8 4A2 2 0 0 1 22 7.24v9.... |
#!/bin/bash
generate_security_keys=0
read -p "Generated security key-backed keys (Requires key and user interaction)? [yN] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
generate_security_keys=1
fi
ssh-keygen -trsa -N "passw0rd" -f ./encrypted_rsa
ssh-keygen -trsa -N "" -f ./rsa_ca
ssh-keygen -tdsa -N "" -f ./dsa... |
#!/bin/bash
# Copyright (c) 2020-2021 Hiroshi Tanaka, hirtanak@gmail.com @hirtanak
set -exuv
SW=hub
echo "starting 21.ubuntu18.04-${SW}.sh"
# adapt multi user environment
SCRIPTUSER=$(jetpack config SCRIPTUSER)
if [[ -z ${SCRIPTUSER} ]] || [[ ${SCRIPTUSER} = "None" ]]; then
CUSER=$(grep "Added user" /opt/cycle/je... |
bool CQPaletteArea::isFirstWindow(const CQPaletteWindow *window) const {
// Get the index of the specified window within the splitter
int pos = splitter_->indexOf(const_cast<CQPaletteWindow *>(window));
// If the index is 0, the window is the first one in the palette area
return (pos == 0);
} |
<filename>public/gulp/src/scripts/chart/main/dicts.js
/*
* 字典文件
* createDate:2016-11-02 10:03:51
* author: XXXXXX
*/
Ehr.module('Charts', function(Charts, Ehr, Backbone, Marionette, $, _) {
var Dicts = {};
Charts.Dicts = Dicts;
});
|
const { SlashCommandBuilder } = require('@discordjs/builders');
const logSchema = require('../schema/messageLogSchema');
module.exports = {
data: new SlashCommandBuilder()
.setName('clearlog')
.setDescription('Clears amount of logs based on input')
.addIntegerOption(option => option.setName... |
import os
import random
import matplotlib.pyplot as plt
import numpy as np
import extra
import lpd
import synthetic
def main():
# """
# Main function of test python module
# """
# random.seed(os.urandom(345634)) # initialize random generator
# t = np.linspace(0.0, 24.0, 96.0) # define the time axis of a day,... |
<filename>src/main/java/org/olat/modules/qpool/ui/metadata/ExtendedSearchController.java
/**
* <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 ... |
// Update the code so it only uses the let keyword.
// var should not exist in the code.
// catName should be Oliver.
// quote should be "Oliver says Meow!"
// Initial:
// var catName;
// var quote;
// function catTalk() {
// "use strict";
// catName = "Oliver";
// quote = catName + " says Meow!";
// }
... |
#!/usr/bin/env bash
./task_build.sh
hugo serve --disableFastRender
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.arrowUpC = void 0;
var arrowUpC = {
"viewBox": "0 0 512 512",
"children": [{
"name": "path",
"attribs": {
"d": "M128.4,189.3L233.4,89c5.8-6,13.7-9,22.4-9c8.7,0,16.5,3,22.4,9l105.4,100.3c12.5,11.9,12.5,31.3,0,43.2\r... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#=======================================================================
#
# ccm.py
# ------
# Simple, pure Python, CCM implementation using the
# word based model of the AES cipher with support for 128 and
# 256 bit keys. Test vectors used in the tests are from the SP 800... |
package io.opensphere.xyztile.transformer;
import java.io.Closeable;
import java.util.Observable;
import java.util.Observer;
import io.opensphere.core.util.lang.ThreadUtilities;
import io.opensphere.xyztile.model.XYZDataTypeInfo;
import io.opensphere.xyztile.model.XYZTileLayerInfo;
/**
* Class that responds to max ... |
#!/bin/bash
# ========== Experiment Seq. Idx. 386 / 19.1.2 / N. 24/3/0 - _S=19.1.2 D1_N=24 a=-1 b=-1 c=-1 d=1 e=1 f=-1 D3_N=3 g=-1 h=1 i=1 D4_N=0 j=0 ==========
set -u
# Prints header
echo -e '\n\n========== Experiment Seq. Idx. 386 / 19.1.2 / N. 24/3/0 - _S=19.1.2 D1_N=24 a=-1 b=-1 c=-1 d=1 e=1 f=-1 D3_N=3 g=-1 h=1 ... |
/*
* Copyright 2021 HM Revenue & Customs
*
* 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 a... |
/*
* Copyright (c) 2008, 2009, 2010 <NAME>. All rights reserved. Your use of this computer software
* is permitted only in accordance with the GooTool license agreement distributed with this file.
*/
package com.goofans.gootool.util;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilde... |
#!/bin/bash
for file in *.py; do
name=$(basename "$file" .py)
echo mv "$file" "$name.py"
done
|
<reponame>andypyrope/JDA
/*
* Copyright 2015-2018 <NAME> & <NAME> & <NAME>
*
* 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... |
use diesel::prelude::*;
use diesel::result::Error as DieselError;
use crate::schema::users_on_rocketchat_servers::dsl::*;
use crate::models::{UserOnRocketchatServer, UserId};
pub fn find_by_matrix_user_ids(
connection: &SqliteConnection,
matrix_user_ids: Vec<UserId>,
) -> Result<Vec<UserOnRocketchatServer>, Di... |
#!/usr/bin/env bash
# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here
# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent
# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also
# benefit from... |
#!/bin/bash
echo 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
echo 'XXXXXXXXXXXXXXXXX TRAIN REFERENCE CNN XXXXXXXXXXXXXXXX'
echo 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
# current folder:
PARENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TRAINING_ROOT_DIR=$PARENT_DIR
... |
<gh_stars>10-100
var interfacedroid_1_1_runtime_1_1_interfaces_1_1_i_objective =
[
[ "EnvironmentReset", "interfacedroid_1_1_runtime_1_1_interfaces_1_1_i_objective.html#a42c5d2e602366932cbd0be02b10756d2", null ],
[ "Evaluate", "interfacedroid_1_1_runtime_1_1_interfaces_1_1_i_objective.html#a85f39034cef720fef989... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2152-1
#
# Security announcement date: 2014-03-24 00:00:00 UTC
# Script generation date: 2017-01-01 21:03:45 UTC
#
# Operating System: Ubuntu 12.04 LTS
# Architecture: i386
#
# Vulnerable packages fix on version:
# - apache2.2-bin:2.2.22-1ubuntu1.5
#
# La... |
// Function to check if the given tree is a binary search tree or not
boolean isBST(Node node)
{
// Base Case
if (node == null)
return true;
// if left node is type less than current node then check it recursively
// for each left node should be lesser than the current node
if (n... |
<reponame>PolicyStreet/grapher<gh_stars>0
import {handleAddField, handleAddElement, handleAddReducer} from './createReducers';
/**
* Embeds the reducer body with a collection body
* @param reducerBody
* @param collectionNode
*/
export default function embedReducerWithLink(reducerBody, collectionNode) {
_.each(... |
#! /bin/bash
if [ ! $1 ];then
echo "usage: bash deploy.sh 1.0.4"
exit 1;
fi
echo "upload to server."
SERVER=root@101.200.53.74
VERSION=$1
DIR=/var/www/downloadfile/software/native
timestamp=$(date +%s)
ssh -p 65522 ${SERVER} "cp ${DIR}/latest.yml ${DIR}/latest.${timestamp}.yml; cp ${DIR}/latest-mac.yml ${DIR}/latest... |
export DOMAINS="floppybox.baylaunch.com"
export AWS_HOST=3
export HEROKU_APP="floppybox"
source ../recbro/lib/_include.sh || echo "no include"
|
<reponame>f96q/kptboard
class RenameTypToLabels < ActiveRecord::Migration[5.1]
def change
rename_column :labels, :typ, :kind
end
end
|
<filename>src/ext/array/any.ts
export {};
declare global {
interface Array<T> {
/**
* [拡張メソッド]
* 条件にあうデータが1件でもある場合、true
* @description C# LINQのAnyメソッドと同様の動作をします。
* @param callbackfn 条件
* @return データがある場合、true
*/
any(callbackfn?: (value: T, index: number, array: T[]) => boolean):... |
package org.dhallj.core.typechecking;
import org.dhallj.core.DhallException;
import org.dhallj.core.Expr;
import org.dhallj.core.Operator;
public final class TypeCheckFailure extends DhallException {
@Override
public Throwable fillInStackTrace() {
// This is a failure type; stack traces aren't useful.
ret... |
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/binutils/
TERMUX_PKG_DESCRIPTION="Collection of binary tools, the main ones being ld, the GNU linker, and as, the GNU assembler"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.36
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/binutils... |
#!/bin/sh
txtrst=$(tput sgr0) # Text reset
txtred=$(tput setaf 1) # Red
txtgrn=$(tput setaf 2) # Green
check_for() {
found=`which $2`
version=`$3 2>&1 | grep -o -E [-0-9.]\{1,\} | head -n 1`
if [ -z "$found" ]; then
echo "${txtred}$1 not found!${txtrst}" >&2
else
echo "$1 version $vers... |
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
$CLICKHOUSE_CLIENT --multiquery <<EOF
SET allow_experimental_window_view = 1;
DROP TABLE IF EXISTS mt;
DROP TABLE IF EXISTS dst;
DROP TABLE IF EXISTS wv;
CREATE TABLE dst(cou... |
#!/usr/bin/env bash
set -e
set -o pipefail
POSITIONAL=()
readonly help_display="Usage: $0 [ command_options ] [ param ]
command options:
--suite, -s e2e suite to run (b2c, b2b, cds, flaky). Default: b2c
--environment, --env [ 2005 | 2011 | ccv2]. Def... |
#
# Be sure to run `pod lib lint StepperView.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Stepper... |
<reponame>lsieun/learn-AI
#!/usr/bin/python
# -*- encoding: utf-8
import numpy as np
import pandas as pd
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
def enum_row(row):
print(row['state'])
def find_state_code(row):
if row['state'] != 0:
print(process.extractOne(row['state'], states, s... |
<filename>sms-api.js
var SMSAPI = require("smsapi"),
smsapi = new SMSAPI({
normalize: true,
format: 'json'
});
smsapi.authentication
.login("<EMAIL>", "<PASSWORD>")
.then(this.sendMessage)
.then(displayResult)
.catch(displayError);
exports.sendTest = function sendTest(msg) {
console.log(msg);
... |
const isAuthorized = (user, route) => {
if (route.requiresAdmin && user.isAdmin) {
return true
} else if (!route.requiresAdmin && !user.isAdmin) {
return true
} else {
return false
}
} |
mkdir -p ~/.streamlit/
echo "\
[general]\n\
email = \"f.caro@lmu.campus.de\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
\n\
" > ~/.streamlit/config.toml |
#!/bin/bash -e
# Get the configuration variables
source configuration.sh
read -p "Are you sure you want to delete all resources? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
echo "Delete Cognito Stack.."
aws cloudformation --region $region delete-stack --stack-name... |
#
# DataTables build environment variables and common functions
#
CLOSURE="/usr/local/closure_compiler/compiler.jar"
JSHINT="/usr/bin/jshint"
# CSS styling frameworks that DataTables supports
FRAMEWORKS=(
'bootstrap5'
'bootstrap4'
'bootstrap'
'bulma'
'foundation'
'jqueryui'
'semanticui'
'material'
'uikit'
... |
#!/bin/sh
set -e
# Mount if neccessary
if [ ! -d /proc/sys/fs/binfmt_misc ]; then
echo "No binfmt support in the kernel."
echo " Try: '/sbin/modprobe binfmt_misc' from the host"
exit 1
fi
if [ ! -f /proc/sys/fs/binfmt_misc/register ]; then
mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
fi
# Reset all ... |
<reponame>fortify-ps/FortifyImportExportUtility
/*******************************************************************************
* (c) Copyright 2020 Micro Focus or one of its affiliates
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation... |
<reponame>martinezlucas98/LP3TP
package py.edu.uca.lp3.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.ArrayList;
@Entity
public class Torneo implements Serializable ... |
<gh_stars>10-100
from cradmin_legacy.viewhelpers.update import UpdateView
from cradmin_legacy.viewhelpers.crudbase import OnlySaveButtonMixin
from devilry.apps.core import models as coremodels
class AssignmentLongAndShortNameUpdateView(OnlySaveButtonMixin, UpdateView):
model = coremodels.Assignment
fields ... |
#!/bin/bash
# Required files:
# ${SEED_DIR}/${USERNAME}
# ${SEED_DIR}/aspera_id_rsa
# ${SEED_DIR}/aspera_id_rsa.pub
# ${SEED_DIR}/sshd_config
USERNAME=aspera
ASPERA_TYPE=$(cat /aspera-type)
SEED_DIR=/mnt/aspera/seed
SECRETS_DIR=/mnt/aspera/.secrets
SSHD_PID=
RSYSLOG_PID=
if [[ "${ASPERA_TYPE}" == "HSTE" ]]; then
... |
import java.util.Arrays;
public class SortArray {
// Helper function to print array
public void printArray(int arr[])
{
int n = arr.length;
for (int i=0; i<n; ++i)
System.out.print(arr[i] + " ");
System.out.println();
}
public static void main(String args[])
{
SortArray sort... |
<gh_stars>0
package com.vemec.api.services;
import com.vemec.api.models.centro.Centro;
import com.vemec.api.models.usuario.Usuario;
import com.vemec.api.models.usuario.UsuarioRepository;
import com.vemec.api.utils.Mappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.securi... |
package com.telenav.osv.recorder.camera.util;
/**
* The available types for teh aspect ratio:
* <ul>
* <li>{@link #ASPECT_RATIO_16_9}</li>
* <li>{@link #ASPECT_RATIO_4_3}</li>
* </ul>
*/
public @interface AspectRatioTypes {
/**
* The 16:9 aspect ratio.
*/
AspectRatio ASPECT_RATIO_16_9 = Aspect... |
// Variável que determina o pool de threads do libuv (Default: 1)
process.env.UV_THREADPOOL_SIZE = 4;
const crypto = require('crypto');
const http = require('http');
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const taskSimulator = require('./task-simulator')
// O arquivo está e... |
#!/bin/sh
# If you update this from Windows, using Notepad ++, do the following:
# sudo apt-get -y install dos2unix
# dos2unix <FILE>
# chmod u+x <FILE>
#
# Christopher Gray
# version 0.0.6
# 10/13/2018
clear
echo "\r\n \r\n Docker Tests \r\n \r\n"
echo " Link: https://www.digitalocean.co... |
import Foundation
struct Localisation {
let key: String
let value: String
}
func parseAndExtractLocalisations(fromFileAtPath path: String) -> [Localisation] {
guard let data = try? Data(contentsOf: URL(fileURLWithPath: path)), var string = String(data: data, encoding: String.Encoding.utf8) else { return [... |
package io.swagger.model.germ;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.germ.SeedLotNewTransactionRequest;
import org.springframework.validation.annotation.Validated;
/**
* SeedLotTransaction
*/
@Valida... |
#!/usr/bin/env bash
#
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
export LC_ALL=C
set -ueo pipefail
if (( $# < 3 )); then
echo 'Usage: utxo_snapshot.sh <generate-at-height>... |
#!/bin/bash
set -ex
mkdir -p target
DOCKER="$1"
TARGET="$2"
SKIP_TESTS="$3"
bash ci/fetch-rust-docker.sh "$TARGET"
if [ -f "ci/docker/$DOCKER/Dockerfile" ]; then
docker build -t "$DOCKER" "ci/docker/$DOCKER/"
fi
docker run \
--entrypoint bash \
--user "$(id -u)":"$(id -g)" \
--volume "$(rustc --print sysro... |
#!/bin/bash
# This script starts mongodb
service mongod stop
rm /var/lib/mongodb/mongod.lock
service mongod start
|
#!/usr/bin/env bash
#
# 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 "Lice... |
def create_tuple_list(lst):
result = []
for i in range(len(lst)-1):
result.append((lst[i], lst[i+1]))
return result
test_list = [1, 2, 3, 4, 5]
print(create_tuple_list(test_list)) # Output: [(1, 2), (2, 3), (3, 4), (4, 5)] |
echo "starting thriftserver with hhtp endpoint, connecting to $SPARK_MASTER and $HIVE_SITE_CONF_hive_metastore_uris"
/spark/sbin/start-thriftserver.sh --master $SPARK_MASTER
tail -f /dev/null
|
import psycopg2
import json
from flask import Flask, request
# Connect to the database
conn = psycopg2.connect(dbname='user_db',
user='postgres',host='localhost',port='5432')
# Create the API
app = Flask(__name__)
@app.route('/user/<string:username>', methods=['GET'])
def get_user(username):
... |
package com.simple.app.sync.raytracer;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RayTracerApp {
}
|
#!/bin/bash
#SBATCH -J "HeatEqnOne_16384"
#SBATCH --nodes=1024
#SBATCH --ntasks-per-node=16
#SBATCH --cpus-per-task=1
#SBATCH --partition=haswell
#SBATCH --mem-per-cpu=2000M
#SBATCH --time=00:10:00
#SBATCH --exclusive
source ./tests/scaling/ZIH_TAURUS2_GCC_4_9_1/run-HeatEqnOne3D-timesteps_20-ADOLC_NO-MPI_ASYNC_YES.sh... |
import java.util.Hashtable;
public class CharacterCount {
public static void main(String[] args) {
String sentence = "This is a test sentence";
String[] words = sentence.split(" ");
Hashtable<String, Integer> hashtable = new Hashtable<>();
for (String word : words) {
hashtable.put(word, word.length());
}
Sy... |
from typing import Optional
from hoss.error import *
from hoss.namespace import Namespace
from hoss.core import CoreService
from hoss.auth import AuthService
import urllib.parse
def connect(server_url: str, auth_instance: Optional[AuthService] = None) -> CoreService:
"""Connect to a server
Args:
se... |
<reponame>community-boating/cbidb-public-web
import { none, some } from "fp-ts/lib/Option";
import { History } from "history";
import * as React from "react";
import * as t from 'io-ts';
import { RadioGroup } from "@components/InputGroup";
import FactaArticleRegion from "@facta/FactaArticleRegion";
import FactaNotitle... |
<filename>open-sphere-base/core/src/main/java/io/opensphere/core/util/gdal/GDALImageReader.java
package io.opensphere.core.util.gdal;
import java.awt.Transparency;
import java.awt.color.ColorSpace;
import java.awt.image.BandedSampleModel;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
im... |
package io.datahubproject.openapi.dto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import io.datahubproject.openapi.generate... |
class StitcherController {
// Class representing the stitching controller
};
class GlobalControllerImpl {
public:
StitcherController* getController() const {
return controller;
}
void createController(int device) {
// Create a new stitching controller for the specified device
/... |
<reponame>hi-manshu-kumar/Eckovation-task
app.constant("LOGIN", "/login");
app.constant("LOGOUT", "/logout");
app.constant("REGISTER", "/register");
app.constant("ABOUT", "/about");
app.constant("URL", "https://raw.githubusercontent.com/hi-manshu-kumar/mobilejson/master/json");
app.constant("PROFILE", "/profile");
app.... |
<reponame>gastbob40/epimodo_bot<gh_stars>1-10
import discord
import yaml
from src.eventsHandler.on_message.mics.check_mentions import check_mentions
from src.eventsHandler.on_message.mics.get_server import get_server
from src.eventsHandler.on_message.mics.get_user import get_user
from src.eventsHandler.on_message.mics... |
import uuid
class TemplateInstaller:
def __init__(self, templatesuffix, args):
self.templatesuffix = templatesuffix
self.args = args
def generateUniqueIdentifier(self):
return str(uuid.uuid1())
def constructTemplateName(self, uniqueIdentifier):
return uniqueIdentifier + ".... |
module Awsm
class TableBase
def initialize( objects, format=:pretty )
@objects = objects
@format = format
@use_fields = config.use_fields
@fields = defaultFields
@headings = defaultHeadings
end
def print
config.fields.each do |name, field|
@headings[ name ] =... |
#!/usr/bin/env python
"""
This reads in data from montco. This reads it in as
soon as you load it. Why? Because I didn't want to create
the extra step.
d=montco.d
Common commands:
reload(montco)
g = d.groupby(['title'])
g.sum()
# Use loc to locate a specific index
d.loc[(d['tim... |
package io.opensphere.laf.dark.border;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
@SuppressWarnings("serial")
public class OSDarkLAFScrollPaneBorder extends AbstractBorder implements UIResource
{
// Intentionally Blank
}
|
package org.paasta.container.platform.common.api.users;
import org.paasta.container.platform.common.api.common.Constants;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.... |
<reponame>jamesavery/spiralcode-reference<filename>libgraph/planargraph.cc
#include <queue>
#include "spiral.hh"
#include "planargraph.hh"
#include "triangulation.hh"
#include "cubicgraph.hh"
using namespace std;
PlanarGraph::PlanarGraph(const spiral_nomenclature &fsn){
switch(fsn.construction_scheme){
case sp... |
#!/usr/bin/env bash
# This scripts runs as root
setupVars="/etc/pivpn/wireguard/setupVars.conf"
if [ ! -f "${setupVars}" ]; then
echo "::: Missing setup vars file!"
exit 1
fi
source "${setupVars}"
echo -e "::::\t\t\e[4mPiVPN debug\e[0m\t\t ::::"
printf "=============================================\n"
echo ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.