text
stringlengths
1
1.05M
import React from 'react'; import axios from 'axios'; class ProductList extends React.Component { constructor(props) { super(props); this.state = { products: [] }; } componentDidMount() { axios .get('/products.json') // Get product data from url .then((response) => { this.setState({ products: response.dat...
# Imports and Setup import flask from flask import Flask, request, redirect, render_template from flask_login import LoginManager, login_user, login_required import os import sqlite3 # Configure application app = Flask(__name__) app.secret_key = os.urandom(24) # Configure database db_file = './data.db' conn = sqlite3...
/* * CPAchecker is a tool for configurable software verification. * This file is part of CPAchecker. * * Copyright (C) 2007-2014 <NAME> * 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...
#!/usr/bin/env bash # Requirements: aws-cli & jq # # This script will register an IoT thing. Create, download and attach the keys and certificates and attach an all topics/actions policy to the certificates and the IoT Thing. if [ $# -ne 1 ]; then echo "Usage: ./create-aws-iot-thing.sh <Thing>" echo "<Thing> ...
pacat --format=s16be --channels=1 --channel-map=mono --rate=44100 --device=alsa_output.usb-Burr-Brown_from_TI_USB_Audio_CODEC-00.analog-stereo
#!/bin/csh # generated by BIGNASim metatrajectory generator #$ -cwd #$ -N BIGNaSim_curl_call_BIGNASim55ce1f70e3226 #$ -o CURL.BIGNASim55ce1f70e3226.out #$ -e CURL.BIGNASim55ce1f70e3226.err # Launching CURL... # CURL is calling a REST WS that generates the metatrajectory. curl -i -H "Content-Type: application/json" -X...
#!/bin/bash # Clean sysctl config directories rm -rf /usr/lib/sysctl.d/* /run/sysctl.d/* /etc/sysctl.d/* sed -i "/net.ipv6.conf.default.accept_redirects/d" /etc/sysctl.conf echo "net.ipv6.conf.default.accept_redirects = 1" >> /etc/sysctl.conf # Setting correct runtime value sysctl -w net.ipv6.conf.default.accept_redi...
CREATE TABLE IF NOT EXISTS gcdefault.dbversion ( version INTEGER DEFAULT 0 NOT NULL, updateon TIMESTAMP(6) DEFAULT now() NOT NULL, CONSTRAINT PK_dbversion PRIMARY KEY (version) ); CREATE TABLE IF NOT EXISTS gcdefault.mapnotecategory ( mapnotecategoryid INTEGER DEFAULT nextval('gcdefault.mapnotecategory_mapnote...
let facade = require('gamecloud') let {TableField, EntityType, NotifyType, ReturnCode} = facade.const /** * 邮箱管理器 * Updated by liub on 2017-07-26. */ class mail extends facade.Control { /** * 读取邮件列表 * @param {UserEntity} user * @param {*} objData */ async getList(user, objData) { ...
<filename>src/mathcard/game/CardPicking.java package mathcard.game; import java.util.ArrayList; import java.util.List; import mathcard.card.Card; import mathcard.player.Player; public class CardPicking { private List<Card> cards; private Player p1, p2; public CardPicking(Player p1, Player p2) { this.p1 = p1;...
<template> <div> <h1>Movies</h1> <input type="text" v-model="keyword" /> <ul> <li v-for="movie in movies" :key="movie.title">{{ movie.title }}</li> </ul> </div> </template> <script> export default { data() { return { keyword: '', movies: [] }; }, async created() { const response = await axios.get('/ap...
#!/usr/bin/env bash # String manipulation! str=FooBarBazQuux echo "${str,,}" # Lower case echo "${str^^}" # Upper case echo "${str:4:7}" # Slice echo "${str#*B}" # Prefix snip: remove from the left until the first match of *B echo "${str##*B}" # Be greedy: remove from the left until the last match of *B echo "${str%u*...
ARGFILE=./sh/argfiles/resnet_164_slimming RESUME_FILENAME=04_April_2018_Wednesday_20_23_17resnet164_slim08_most_recent python -m examples.lab $(cat $ARGFILE) --save_prefix=$SAVE_PREFIX --resume_mode=standard --res_file=${RESUME_FILENAME} --plot_flop_reduction_by_layer --plot_title="Resnet 164 after 20% reduction...
<gh_stars>1-10 'use strict'; const {wrap} = require('../util/hooks'); const random = require('../util/random'); const arr = require('../util/arr'); const wordSeed = require('./word'); const lastName = { cn: [ '赵', '钱', '孙', '李', '周', '吴', '郑', '王', '冯', '陈', '楮', '卫', '蒋', '沈', '韩', '杨', '朱', '秦'...
#!/usr/bin/env bash # Copyright (c) 2014, Cloudera, Inc. All Rights Reserved. # # Cloudera, Inc. licenses this file 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/li...
#!/bin/bash # # Adopted from https://github.com/rapidsai/cudf/blob/branch-0.13/ci/cpu/upload_anaconda.sh set -e BRANCH_REGEX='^(master|((v|branch\-)[0-9]+\.[0-9]+\.(x|[0-9]+|[0-9]+\-preview[0-9]*)))$' # Restrict uploads to master branch if [[ ! "${GIT_BRANCH}" =~ ${BRANCH_REGEX} ]]; then echo "Skipping upload" ...
#!/usr/bin/bash /usr/bin/java -jar build/lib/redsqaure.jar
#!/bin/bash set -o errexit set -o nounset set -o pipefail set -o xtrace # This script uses a connection to Bitwarden to populate k8s secrets used for # the OKD CI infrastructure. To use this script, first get the BitWarden CLI at: # https://help.bitwarden.com/article/cli/#download--install # Then, log in to create a ...
#!/bin/bash set -eo pipefail SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) PROJECT_DIR=$1 shift "$@" ./src/play/play \ EAKLDYS \ "${SCRIPT_DIR}/tiles.txt" \ "${PROJECT_DIR}/boards/wwf_challenge.txt"
#!/bin/bash # # -------------------------------------------- # Adds default users to the CRC cluster # Docs - https://github.com/code-ready/crc/wiki/Add-another-user-to-cluster # -------------------------------------------- if [[ -z "${CRC_KUBEADMIN_PASSWORD}" ]]; then echo "CRC 'kubeadmin' password is not set" ...
from flask import Flask, request, jsonify from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db' db = SQLAlchemy(app) bcrypt = Bcrypt(app) class User(db.Model): id = db.Column(db.Integer, primary_key=True) user...
DELETE FROM table_name WHERE entry_date < DATE_SUB(CURDATE(), INTERVAL 1 YEAR);
<filename>src/main/java/br/uff/ic/provviewer/Vertex/ColorScheme/DebugAllTrialsScheme.java<gh_stars>10-100 /* * The MIT License * * Copyright 2017 Kohwalter. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to d...
<filename>generator/contact.py # -*- coding: utf-8 -*- from model.contact_properties import Contact_properties import random import string import os.path import jsonpickle import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file"]) except getopt.GetoptError as err...
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-shuffled-N-VB/7-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-shuffled-N-VB/7-512+512+512-shuffled-N-firs...
package uk.gov.ons.br.parsers import akka.stream.scaladsl.Source import akka.util.ByteString import org.scalatest.concurrent.ScalaFutures import org.scalatestplus.play.guice.GuiceOneAppPerTest import play.api.http.Status.{BAD_REQUEST, UNSUPPORTED_MEDIA_TYPE} import play.api.libs.json.{JsNumber, JsString} import play....
def validate_json(json_obj, validation_rules): validation_results = {} for field, rules in validation_rules.items(): if field not in json_obj and "required" in rules: validation_results[field] = False else: validation_results[field] = True if field in json_obj...
package com.atguigu.gulimall.member.service; import com.atguigu.common.utils.PageUtils; import com.atguigu.gulimall.member.entity.MemberEntity; import com.atguigu.gulimall.member.vo.MemberLoginVo; import com.atguigu.gulimall.member.vo.MemberRegisterVo; import com.atguigu.gulimall.member.vo.SocialUser; import com.baomi...
<gh_stars>10-100 /** * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.math.interpolation; import org.apache.commons.lang.Validate; import com.opengamma.analytics.math.interpolation.data.ArrayInterpola...
The solution should depend on the type of data that needs to be visualized. If the dataset consists of categorical data then a suitable visualization should be a bar chart or pie chart. If the dataset consists of numerical data then a suitable visualization should be a scatter plot, line chart or histogram. For example...
def sort_alphabetically(input_string): chars = list(input_string) chars.sort() print("".join(chars)) sort_alphabetically("Hello, World!")
const request = require('request'), testData = require('../testData.json'); describe('Action: getImage', () => { before(() => api.db.models.Variant.truncate() .then(() => api.db.models.Variant.create(testData.variant))); it('Properly processes image requests', done => { let url = [ ...
import random import string from django.core.mail import send_mail def initiate_email_change(user, new_email): # Generate a unique confirmation code for the email change process confirmation_code = ''.join(random.choices(string.ascii_letters + string.digits, k=10)) # Compose the email subject and mess...
<reponame>Kepler-Br/Wolfenstein-clone // // Created by kepler-br on 6/10/20. // #ifndef WOLFENSHETIN_TEXTURE_H #define WOLFENSHETIN_TEXTURE_H #include <string> #include <glm/vec2.hpp> #include "types.h" class Texture_loader; class Texture { private: friend Texture_loader; bool transparent; bool wrap = ...
#!/bin/bash . /kb/deployment/user-env.sh python ./scripts/prepare_deploy_cfg.py ./deploy.cfg ./work/config.properties if [ -f ./work/token ] ; then export KB_AUTH_TOKEN=$(<./work/token) fi if [ $# -eq 0 ] ; then sh ./scripts/start_server.sh elif [ "${1}" = "test" ] ; then echo "Run Tests" make test elif [ "...
#!/usr/bin/env bash python RIMITM.py &> RIData.txt 2>&1 & python RIMITMController.py kill $(pidof python)
def max_min(num_list): max_num = float('-inf') min_num = float('inf') for num in num_list: if num > max_num: max_num = num if num < min_num: min_num = num return min_num, max_num number_list = [10, 4, 20, 8, 5] min_num, max_num = max_min(number_list) print(f"Mini...
export default{}; //# sourceMappingURL=ElementState.prod.js.map
#!/bin/bash # Simple Bash script for code formatting in 1tbs. # See http://astyle.sourceforge.net/astyle.html for syntax and defaults. MINPARAMS=1 ORIG_SUFFIX=orig # Exit error when not enough arguments. if [ $# -lt "$MINPARAMS" ] then echo "This script needs C source files passed as arguments" echo "USAGE: ...
<reponame>smagill/opensphere-desktop package io.opensphere.mantle.plugin.selection; import java.awt.Component; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Itera...
<reponame>feeedback/hexlet_professions_backend // sc: https://ru.hexlet.io/courses/js-testing/lessons/matchers/exercise_unit // tests/gt.test.js // Напишите тесты для функции _.gt(value, other), которая возвращает true в том случае, // если value > other, и false в иных случаях. // gt(3, 1); // true // gt(3, 3); // ...
<filename>src/gopar/invalid_construct_pass.go // Invalid constructs pass // // package main import ( "fmt" "go/ast" "go/token" ) type InvalidConstructPass struct { BasePass } func NewInvalidConstructPass() *InvalidConstructPass { return &InvalidConstructPass{ BasePass: NewBasePass(), } } func (pass *Invali...
#!/bin/bash -x # # Generated - do not edit! # # Macros TOP=`pwd` CND_PLATFORM=GNU-MacOSX CND_CONF=Release CND_DISTDIR=dist CND_BUILDDIR=build CND_DLIB_EXT=dylib NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging TMPDIRNAME=tmp-packaging OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/hw08_-_abs...
<filename>343 integer-break/javascript/solution1.js /** * @param {number} n * @return {number} */ var integerBreak = function(n) { if(n == 2) return 1; if(n == 3) return 2; if(n == 4) return 4; var product = 1; while(n > 4) { product *= 3; n -= 3; } product *= n; return product; };...
const detectBrowser = () => { // Opera 8.0+ let isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; // Firefox 1.0+ let isFirefox = typeof InstallTrigger !== 'undefined'; // Safari 3.0+ "[object HTMLElementConstructor]" let isSafari = /constructor/i.test(w...
<filename>targets/TARGET_Atmel/TARGET_SAM_CortexM0P/utils/cmsis/TARGET_SAML21/include/instance/ins_pac.h<gh_stars>10-100 /** * \file * * \brief Instance description for PAC * * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. * * \asf_license_start * * \page License * * Redistribution and use ...
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ...
<reponame>HeQuanX/study package cn.crabapples.common.config.datasource.pkg; import cn.crabapples.common.config.datasource.aop.DynamicDataSourceContextHolder; import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; import lombok.extern.slf4j.Slf4j; impor...
#!/usr/bin/env bash PY_PACKAGE="peek_agent" PYPI_PUBLISH="1" VER_FILES_TO_COMMIT="" VER_FILES=""
<gh_stars>0 package com.ing.baker.runtime.serialization.protomappings import akka.actor.ActorRef import com.ing.baker.runtime.serialization.ProtoMap.versioned import com.ing.baker.runtime.akka.actor.protobuf import com.ing.baker.runtime.akka.actor.protobuf.ActorRefId import com.ing.baker.runtime.serialization.{ProtoMa...
def isArmstrong(num): sum = 0 temp = num order = len(str(num)) while temp > 0: rem = temp % 10 sum += rem ** order temp //= 10 if num == sum: return True else: return False print (isArmstrong(num))
import time def measure_time(): start = time.time() # Your code here... end = time.time() return end - start execution_time = measure_time() print("Time taken:", execution_time, "seconds")
import React from 'react' const Link = ({href, target, onClick, text}) => { return( <a href={href} target={target} onClick={onClick}> {text ? text : href} </a> ) } export default Link
/* * Copyright 2014-2016 CyberVision, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
<gh_stars>0 export const getStatsFromCommits = (raidRepoWithOwner: string, commits: Commit[] | undefined): UserStats[] => { if (!commits) return [] return Object.values(commits.reduce<{ [key: string]: UserStats }>((stats, commit) => { if ( !commit.author?.user?.login // Exclude null users || commit....
#!/bin/bash APP_NAME=workon # 应用名称 CONFIG_DIR=.config/$APP_NAME WORKON_CONFIG_DIR=$HOME/$CONFIG_DIR # 配置所在目录 BIN_DIR=$WORKON_CONFIG_DIR # 二进制脚本工作目录 FISH_COMPLETE=$HOME/.config/fish CUR_PATH=$(pwd) # 当前目录 TMP_DIR=/tmp/$APP_NAME # 临时目录 SHELL_FILES=($HOME/.zshrc $HOME/.bashrc $HOME/.config/fish/config.fish) # shell的配置文件 F...
<gh_stars>0 package org.rs2server.rs2.content.api; import org.rs2server.rs2.model.Item; import org.rs2server.rs2.model.player.Player; import javax.annotation.concurrent.Immutable; /** * A game event which is created when an item option in the inventory is clicked by the player. * * @author tommo */ @Immutable pu...
<filename>src/worker/RTCIceCandidate.js import * as is from '../utils/is.js'; import assert from '../utils/assert.js'; export default class RTCIceCandidate { constructor(config) { assert(arguments.length, 'Not enough arguments'); assert( is.undefined(config) || is.object(config), `'${config}' is...
def levenshtein_distance(str1, str2): m = len(str1) n = len(str2) # Create a 2d matrix distance_matrix = [[0 for x in range(n+1)] for x in range(m+1)] # Initialize the first row and first column for i in range(m+1): distance_matrix[i][0] = i for j in range(n+1): distance_ma...
<reponame>Sasha7b9Work/S8-53M2 ///////////////////////////////////////////////////////////////////////////// // Name: samples/console/console.cpp // Purpose: A sample console (as opposed to GUI) program using wxWidgets // Author: <NAME> // Modified by: // Created: 04.10.99 // Copyright: (c) 1999 <...
<filename>doc-examples/jdbc-example-java/src/test/java/example/PersonRepositorySpec.java package example; import io.micronaut.data.repository.jpa.criteria.PredicateSpecification; import io.micronaut.test.extensions.junit5.annotation.MicronautTest; import jakarta.inject.Inject; import org.junit.jupiter.api.AfterEach; i...
python main.py \ --architecture 'tcn' \ --comments 'local test reverb cond' \ --loss_functions 'esr,mae,stft' \ --esr_scaling 1 \ --mae_scaling 1 \ --stft_scaling 1 \ --specific_fx_name 'reverb' \ --dilation_depth 6 \ --dilation_factor 7 \ --kernel_size 20 \ --activation 'con...
module.exports = { apiUrl: "https://rawpixel-url-shortner.herokuapp.com/api/", baseUrl: "https://rawpixel-url-shortner.herokuapp.com/" // /apiUrl: "http://shortener.muhzi.com/v1/api/", // baseUrl: "http://muhzi.com" }
import assign from 'lodash/assign'; function isNull(value) { return value === undefined || value === null; } const prefix = 'dragontiger-'; export default function createCache(client) { const { session } = client; const cache = new Map(); const load = (name) => { const id = `${prefix}${name}`; if (...
#!/usr/bin/env sh # # Ping Identity DevOps - Docker Build Hooks # #- Once both the remote (i.e. git) and local server-profiles have been merged #- then we can push that out to the instance. This will override any files found #- in the ${SERVER_ROOT_DIR} directory. # ${VERBOSE} && set -x # shellcheck source=pingcommon...
<reponame>zxqdx/zLyric var Parser = Parser || { parsers: {} }; Parser.parsers.netease = { name: "netease", version: "0.0.1", parse: function (raw) { var rawJson = JSON.parse(raw); var json = { addInfo: [] }; if (rawJson.hasOwnProperty("transUser")) { json.addInfo.push("歌词:" + rawJso...
curl -X DELETE "elasticsearch.localhost.com/test" curl -X PUT "elasticsearch.localhost.com/test" -H 'Content-Type: application/json' -d \ ' { "settings": { "number_of_shards": 2, "number_of_replicas": 1, "analysis": { "analyzer": { "analyzer_ngram": { ...
#!/bin/bash # Adapted from https://github.com/facebookresearch/MIXER/blob/master/prepareData.sh echo 'Cloning Moses github repository (for tokenization scripts)...' git clone https://github.com/moses-smt/mosesdecoder.git echo 'Cloning Subword NMT repository (for BPE pre-processing)...' git clone https://github.com/rs...
#!/bin/bash set -euo pipefail sudo journalctl -f -u homesec-bootstrap
import single_robot_behavior import behavior import robocup import main import constants class Mark(single_robot_behavior.SingleRobotBehavior): def __init__(self): super().__init__(continuous=True) self._ratio = 0.9 self._mark_line_thresh = 0.9 self._mark_robot = None self...
package kr.co.gardener.util; import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.Properties; import java.util.UUID; import javax.imageio.ImageIO; imp...
var file = document.getElementById('file'); var imageMeta = document.getElementById('imageMeta'); var image = document.querySelector('#exif img'); var toDecimal = function(number) { return number[0].numerator + number[1].numerator / (60 * number[1].denominator) + number[2].numerator / (3600 * number[2].den...
<gh_stars>100-1000 // https://open.kattis.com/problems/guessthedatastructure #include <iostream> #include <queue> #include <stack> using namespace std; int main() { int n; while (cin >> n) { stack<int> s; queue<int> q; priority_queue<int> pq; bool is = true, iq = true, ipq = tr...
<filename>controllers/PurchasesController.js const Purchases = require('../models/Purchases'); const Accounts = require('../models/Accounts'); const serialize = require('node-serialize'); const settings = require('electron-settings'); const moment = require('moment'); class PurchasesController { constructor(...
#!/bin/bash # Exit on error set -e ########################## ### ### ### write the namelist ### ### ### ########################## ########### version command -v git 2>&1 >/dev/null if [ $? -eq 0 ]; then ver=`git describe --tags 2>&1` if [ $? -ne 0 ]; then echo...
#!/usr/bin/env sh # generated from catkin/python/catkin/environment_cache.py # based on a snapshot of the environment before and after calling the setup script # it emulates the modifications of the setup script without recurring computations # new environment variables # modified environment variables export CMAKE_...
def encrypt(s): result = "" for c in s: if c.isalpha(): result += chr(ord(c) + 1) else: result += c return result
def substring_2chars(s): maxlen = 0 currlen = 0 prev_char = '' curr_char = '' for c in s: if c != prev_char and curr_char == '': curr_char = c currlen += 1 elif c != prev_char and c != curr_char: maxlen = max(maxlen, currlen) currlen =...
<reponame>kugg/microfun var mongo = require('mongodb'); console.log(mongo); var Server = mongo.Server, Db = mongo.Db; var server = new Server('localhost', 27017, {auto_reconnect: true}); db = new Db('winedb', server); db.open(function(err, db) { if(!err) { console.log("Connected to 'winedb' database"...
import React, { Component } from 'react'; class App extends Component { constructor(props) { super(props); this.state = { data: [], query: '' }; } componentDidMount() { fetch('https://my-api/data') .then(res => res.json()) .then(data => this.setState({ data })); } handle...
<gh_stars>0 package com.mrh0.createaddition.item.hammer; public class DischargedHammer { }
<gh_stars>0 #include <linux/kernel.h> #include <linux/mutex.h> #include <linux/init.h> #include <linux/device.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/mfd/core.h> #include <linux/delay.h> #include <linux/slab.h> #include <linux/i2c.h> #include <linux/a...
def print_multiplication_table(number): for i in range(1, 11): print(number,"X",i,"=",number*i)
<gh_stars>0 /* * Developed by szczypiorofix on 24.08.18 13:31. * Copyright (c) 2018. All rights reserved. * */ package com.szczypiorofix.sweetrolls.game.gui; import com.szczypiorofix.sweetrolls.game.enums.ObjectType; import com.szczypiorofix.sweetrolls.game.main.fonts.BitMapFont; import com.szczypiorofix.sweetrol...
<filename>src/serverApi/wsServer.ts import WebSocket from 'ws'; import path from 'path'; import { ClientMessageTypeMap, ServerMessageDynamic, ServerMessageError, ServerMessageInput, ServerMessageOutput } from '../commonTypes'; let server: WebSocket.Server; export const getServer = () => server; export function start...
#!/usr/bin/env bash export LC_ALL=C TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} BUILDDIR=${BUILDDIR:-$TOPDIR} BINDIR=${BINDIR:-$BUILDDIR/src} MANDIR=${MANDIR:-$TOPDIR/doc/man} BITCOIND=${BITCOIND:-$BINDIR/securecloud2d} BITCOINCLI=${BITCOINCLI:-$BINDIR/securecloud2-cli} BITCOINTX=${BITCOINTX:-$BINDIR/securecl...
import {ExpressAfterController, ExpressBeforeController, ResponseHandler} from "@mo/express"; import {co, IController, Injectable, Plugin} from "@mo/core"; import * as e from "express"; import {IUser} from "../define/user-interface"; import {GROUP} from "../decoractor/symbol"; @Injectable() export class PluginPackage ...
package com.example.lostandfoundoncampus.utils; import android.graphics.Bitmap; /** * Created by XiaoAnDev on 2021/4/11 * 图片裁剪正方形类 */ public class CircleTransform { /** * @param bitmap 原图 * @param edgeLength 希望得到的正方形部分的边长 * @return 缩放裁取正中部分后的位图 */ public static Bitmap centerSquareSca...
#!/usr/bin/env bash # sets up LDC for cross-compilation. Source this script, s.t. the new LDC is in PATH # Make sure this version matches the version of LDC2 used in .travis.yml, # otherwise the compiler and the lib used might mismatch. LDC_VERSION="1.22.0" ARCH=${ARCH:-32} VERSION=$(git describe --abbrev=0 --tags) O...
#!/bin/sh # # Homebrew # # This installs some of the common dependencies needed (or at least desired) # using Homebrew. # Check for Homebrew if test ! $(which brew) then echo ">> Installing Homebrew for you. <<" # Install the correct homebrew for each OS type if test "$(uname)" = "Darwin" then ruby -e "$(...
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import * as ts from 'typescript/lib/tsserverlibrary'; import * as lsp from 'vscode-languageserver'; import {URI} fro...
extension TypeAttribute { func containsAttribute(named attribute: String) -> Bool { switch self { case .optional(let wrapped), .implicitlyUnwrappedOptional(let wrapped): return wrapped.containsAttribute(named: attribute) case .attributed(_, let attributes): return att...
<reponame>champ8644/BanG-Dream-Translated-Tool import { meanLength, meanSmooth } from '../constants/config'; class Meaning { constructor() { this.data = []; this.div = meanSmooth; this.length = meanLength; } avg5(frame) { let sum = 0; for (let i = 1; i <= this.div; i++) { const prevFra...
<reponame>aasiyahf/programs package edu.ncsu.csc316.customer_service.data; /** * Creates a timestamp object to keep track of individual parts of the time * the help ticke twas submitted * @author <NAME> * */ public class Timestamp { private int year; private int month; private int day; private int hour; pri...
#!/bin/sh cd `dirname $0` set -ex if [ -z "$CACHEDIR" ] then CACHEDIR=../../../.cached fi : ${TRACT_RUN:=cargo run -p tract $CARGO_OPTS --} $TRACT_RUN $CACHEDIR/hey_snips_v4_model17.pb -i S,20,f32 --pulse 8 --nnef-tract-pulse dump -q --nnef-graph found diff -u expected found
// Copyright 2018 Sogou Inc. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. package com.sogou.sogocommon.utils; import android.content.Context; import android.util.Base64; import java.io.FileOutputStream; import java.io.IOException; i...
use rand::Rng; pub fn shuffle_deck(deck: &mut [Colors]) { let mut rng = rand::thread_rng(); let mut n = deck.len(); while n > 1 { let k = rng.gen_range(0..n); n -= 1; deck.swap(n, k); } }
#!/bin/bash # Remove printer script rm -f "${MUNKIPATH}preflight.d/printer.py" # Remove printers.txt file rm -f "${MUNKIPATH}preflight.d/cache/printer.txt"
# ----------------------------------------------------------------------------- # # Package : lcid # Version : 1.0.0 # Source repo : https://github.com/sindresorhus/lcid # Tested on : RHEL 8.3 # Script License: Apache License, Version 2 or later # Maintainer : BulkPackageSearch Automation <sethp@us.ibm.com> # # Disclai...
<reponame>astoctas/firmatacpp #include "firmservo.h" #include <iostream> namespace firmata { Servo::Servo(FirmIO* firmIO) : Base(firmIO) { }; Servo::~Servo() {}; void Servo::servoAttach(uint8_t deviceNum) { sysexCommand({ FIRMATA_SERVO_REQUEST, FIRMATA_SERVO_ATTACH, deviceNum }); }; void Servo::servoWrit...