text
stringlengths
1
1.05M
import discord from discord.http import Route async def post_command(client, command, guild_id: int = None): if guild_id: r = Route('POST', f'/applications/{client.application_id}/guilds/{guild_id}/commands') else: r = Route('POST', f'/applications/{client.application_id}/commands') return...
<gh_stars>1-10 var _; _ = Uint16Array.length; _ = Uint16Array.name; _ = Uint16Array.prototype; _ = Uint16Array.BYTES_PER_ELEMENT; new Uint16Array();
def string_separator(str, separator): # Initialise the output list output = [] # Split the string on the set separator words = str.split() # Iterate through all words in the list for word in words: # Append the word along with a separator output.append(word + se...
""" Create a program to replace all instances of a given substring in a string. """ def replace_substring(string, substring, replacement): #Split the string into a list string_list = string.split() #Replace the word if it exists for index, word in enumerate(string_list): if word == substring: ...
<reponame>jcottobboni/inventorymaster class AddlocationToProduct < ActiveRecord::Migration def change add_column :inventorymaster_products, :location_id, :integer end end
class TVShowDatabase: def __init__(self, api_key): self.api = TVShowDatabaseAPI(api_key) def search_by_title(self, title): try: return self.api.search_by_title(title) except Exception as e: return f"Error occurred during title search: {e}" def search_by_year...
import { SCREEN_BREAKPOINTS } from './constants'; export const isMobileScreen = () => screen.width < SCREEN_BREAKPOINTS.XS;
monetdbd create mydbfarm monetdbd start mydbfarm monetdb create voc monetdb release voc
num1 = float(input("Enter your first number: ")) num2 = float(input("Enter your second number: ")) op = input("Enter the operator : ") if op == "+": result = num1 + num2 elif op == "-": result = num1 - num2 elif op == "*": result = num1 * num2 elif op == "/": result = num1 / num2 print("The result is : ", res...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
<reponame>hazardousparticle/logiG510_LEDcontrol #include "hidapi_mod.h" #include "Logi510.h" #include <iostream> using namespace std; //delay in ms between color cycles #define SPEED 100 //button Q to break the loop #define QUIT_KEY 0x51 HANDLE dev_handle = NULL; int main(int argc, char* argv[]) {...
<reponame>savvasth96/fructose package fwcd.fructose.swing; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; /** * Convience class to allow lambda-implementations of {@link DocumentListener}. * * @author Fredrik * */ @FunctionalInterface public interface DocChangeListener extend...
#!/bin/bash # shellcheck disable=SC1091 source functions.sh && init set -o nounset # defaults # shellcheck disable=SC2207 disks=($(lsblk -dno name -e1,7,11 | sed 's|^|/dev/|' | sort)) stimer=$(date +%s) # Look for active MD arrays # shellcheck disable=SC2207 mdarrays=($(awk '/md/ {print $4}' /proc/partitions)) if (...
#!/usr/bin/env bash # i=0; # IFS=$'\n' # for line in `env`; do # VAR=`echo $line | sed 's/\([A-Za-z_1-9]*\)=.*$/\1/'` # if [ "x$VAR" == "x_" ] || [ "x$VAR" == "xSHLVL" ]; then # continue; # fi # ENV_VAR[$i]="$VAR"; # VAR_VAL[$i]=`echo $line | sed 's/\([A-Za-z_1-9...
#!/usr/bin/env bash {{! Template adapted from here: https://github.com/chriskempson/base16-builder/blob/master/templates/gnome-terminal/dark.sh.erb }} # Base16 Rosé Pine - Gnome Terminal color scheme install script # Emilia Dunfelt <sayhi@dunfelt.se> [[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="Base 16 Rosé Pine 256"...
def is_prime(n): for i in range(2, n): if n % i == 0: return False return True number = 22 if is_prime(number): print(f"{number} is a prime number") else: print(f"{number} is not a prime number")
from __future__ import absolute_import # import scipy.io as sio import os import matplotlib.pyplot as plt ########################################### # ML and AI Procedures for FTIR/Raman Spectroscopy # # # ########################################### import numpy as np # python 2.7 from sklearn.cross_validation impo...
<filename>src/components/HeyRecruiter/index.js import React, { useState } from 'react' import { Link } from 'gatsby' const HeyRecruiter = () => { const [folded, setFolded] = useState(false) return ( <div className="p-3 shadow" style={{ position: 'fixed', ...
public class Circle { private double radius; // Constructor public Circle(double radius) { this.radius = radius; } // Getters public double getRadius() { return radius; } public double getCircumference() { return 2 * Math.PI * radius; } public doub...
<filename>src/main/java/cn/chenlichao/wmi4j/SWbemLastError.java /* * Copyright 2014-2014 <NAME> * * 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...
<filename>routes/index.js const router = require("express").Router(); // config express-validator for body const { body } = require("express-validator/check"); // Controllers const projectsController = require('../controllers/projects_controller'); const tasksController = require('../controllers/tasks_controller'); c...
// This file is part of the Orbbec Astra SDK [https://orbbec3d.com] // Copyright (c) 2015 Orbbec 3D // // 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/LI...
<filename>src/main/java/com/alipay/api/response/AlipayAssetPointVoucherprodBenefittemplateSettleResponse.java package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.asset.point.voucherprod.benefittemplate.settle respons...
<filename>ansible/roles/logger-service/files/db/refresh_summary_breakdown_source.sql -- This stored procedure is used to (re)populate the "event_summary_breakdown_source" -- and "event_summary_breakdown_source_entity" tables -- from all existing log information delimiter $$ DROP PROCEDURE IF EXISTS `logger`.`refresh_s...
<filename>front/tingke-manage-system/src/api/admin/diary.js import request from '../../utils/request'; export default { //随笔增删改查 selectDiary(page,limit,condition) { return request({ url: `/admin/acl-diary/selectAllDiary/${page}/${limit}`, method: 'post', data: condit...
#!/bin/bash #set -ex if [ -z "${1}" ]; then echo "Missing argument. Format:" echo " ${0} key1:value1[,keyX:valueX,...] [-f]" exit 1 fi if [ -f /var/lib/dcos/mesos-slave-common ]; then if [ "${2}" != "-f" ]; then echo "mesos-slave-common exists. Use -f to overwrite." exit 1 fi fi # E...
/* * The MIT License * * Copyright 2016 - <NAME>. * http://www.SimonSinding.com * * 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 restriction, including without limitation the...
package br.com.sefaz.dao; import br.com.sefaz.model.Telefone; //Herança do DaoGeneric para Utilizar os Cruds Para telefone public class DaoTelefones<E> extends DaoGeneric<Telefone> { }
#include <iostream> #include <algorithm> // for sorting using namespace std; bool checkAnagram(string s1, string s2) { // If both strings are of different length, they // cannot be anagrams of each other if (s1.length() != s2.length()) return false; // Sort both strings sor...
#!/bin/bash # Stop and Delete all docker images docker stop $(docker ps -aq) docker rm $(docker ps -aq) # Clean all none images docker rmi $(docker images | grep none | awk ' { print $3 }') docker volume prune -f
#! /bin/bash -eu export SVM_DOCKER_IMAGE=alphasentaurii/spacekit:svm # export CAL_BASE_IMAGE="stsci/hst-pipeline:CALDP_drizzlecats_CAL_rc6" export CAL_BASE_IMAGE="stsci/hst-pipeline:latest" docker build -f Dockerfile -t ${SVM_DOCKER_IMAGE} --build-arg CAL_BASE_IMAGE="${CAL_BASE_IMAGE}" .
#!/bin/sh # Author: bougyman <tj@rubyists.com> # License: MIT # This utility adds helper commands for administering runit services set -e commands="sv-list svls sv-find sv-enable sv-disable sv-start sv-stop sv-restart" # Locate the service in the user's $SVDIR or /etc/sv find_service() { service=$1 svdir=$(svdir ...
package chylex.hee.item; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; imp...
#include "ObjectPrueba.h" #ifndef FILE_H #define FILE_H typedef enum fmode { None = 0, Read, Write, Append, ReadUpdate, WriteUpdate, AppendUpdate } FileMode; typedef struct FileStreamPrivate FileStreamPrivate; typedef struct file { Object object; private(Fil...
const jwt = require('jsonwebtoken'); const { config } = require('../config'); class AuthService { static async refreshUserToken(bearer) { try { const refreshToken = bearer.replace('Bearer ', ''); const { authJwtSecret, authJwtRefreshTokenSecret } = config; const payload ...
#!/usr/bin/env bash set -euo pipefail source tools/activate_python.sh PYTHONPATH="${PYTHONPATH:-}:$(pwd)/tools/s3prl" export PYTHONPATH python="coverage run --append" cwd=$(pwd) #### Make sure chainer-independent #### python3 -m pip uninstall -y chainer # [ESPnet2] test asr recipe cd ./egs2/mini_an4/asr1 echo "====...
def quick_sort(arr): if not arr: return [] pivot = arr[0] left = [x for x in arr[1:] if x <= pivot] right = [x for x in arr[1:] if x > pivot] return quick_sort(left) + [pivot] + quick_sort(right) arr = [5, 2, 3, 1, 9] sorted_arr = quick_sort(arr) print(sorted_arr) # output: [1, 2, 3, 5, 9]
<gh_stars>1-10 package io.github.rcarlosdasilva.weixin.model.builder; import java.util.Calendar; import com.google.common.base.Preconditions; import io.github.rcarlosdasilva.weixin.common.dictionary.MessageType; import io.github.rcarlosdasilva.weixin.core.exception.InvalidNotificationResponseTypeException; i...
<filename>lib/commands/listCommand.js<gh_stars>10-100 var Promise = require("bluebird"); var yargs = require('yargs'); var _ = require('lodash'); var Table = require('cli-table2'); var colors = require('colors'); var bittrexPromise = require('../bittrex-promise'); module.exports = listCommand; function listCommand(a...
#!/bin/bash set -ev TAGS=$1 export CGO_CFLAGS_ALLOW=".*" export CGO_LDFLAGS_ALLOW=".*" export CGO_LDFLAGS="-Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2" DIRS="common lcore eal ring mempool memzone port" echo "Testing $TAGS" for subdir in $DIRS; do go test -tags $TAGS github.com/yerden/go-dpdk/$subdir done
<gh_stars>1-10 // // ESPUDPSocketClient.h // EspTouchDemo // // Created by fby on 4/13/15. // Copyright (c) 2015 fby. All rights reserved. // #import <Foundation/Foundation.h> @interface ESPUDPSocketClient : NSObject - (void) close; - (void) interrupt; /** * send the data by UDP * * @param bytesArray2 * ...
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl # sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl
def product(lst): if len(lst) == 1: return lst[0] else: return lst[0] * product(lst[1:]) print(product([1, 5, 8, 10]))
<filename>Starwars/battle.h #ifndef JNP4_BATTLE_H #define JNP4_BATTLE_H #include <iostream> #include <type_traits> #include <cassert> #include <tuple> #include <array> #include <cmath> #include <algorithm> #include "rebelfleet.h" #include "imperialfleet.h" template<typename T, T i, T t1> static constexp...
<filename>scripts/taller3.js const resetButton = document.getElementById("btn-reset"); resetButton.addEventListener("click", reset); function reset() { const inputAmount = document.getElementById("input-amount"); const inputInterest = document.getElementById("input-interest"); const inputTime = document.ge...
<reponame>wuximing/dsshop /** * @fileoverview 判断点是否在多边形内 * @author <EMAIL> */ // 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526 var tolerance = 1e-6; // 三态函数,判断两个double在eps精度下的大小关系 function dcmp(x) { if (Math.abs(x) < tolerance) { return 0; } return x < 0 ? -1 : 1; } //...
class BinarySearchTree: ''' A binary search tree is a Tree Data Structure in which each node has at most two children which are referred to as the left child and the right child. ''' #defining a constructor to initialize the root node of a BST def __init__(self, value): self.valu...
#!/bin/bash ########################################################################################################################################################################################## #- Purpose: Script used to install pre-requisites, deploy/undeploy service, start/stop service, test service #- Parameter...
package slacknotifications.teamcity.settings; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import java.io.IOException; import jetbrains.buildServer.serverSide.SBuildServer; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder...
import run_script from "../run-script"; const { shell } = window.require('electron') const { remote } = window.require('electron') const app = remote.app; const dialog = remote.dialog const WIN = remote.getCurrentWindow() var fs = window.require('fs'); const options = { title: "Save", defaultPath: app.getPat...
package com.publicissapient.camunda.service; import java.util.logging.Logger; import com.publicissapient.camunda.model.Order; import com.publicissapient.camunda.utility.CommonUtility; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.eng...
<filename>dbManager/src/main/java/sword/langbook3/android/models/AgentDetails.java package sword.langbook3.android.models; import sword.collections.ImmutableHashSet; import sword.collections.ImmutableList; import sword.collections.ImmutableSet; import sword.langbook3.android.db.ImmutableCorrelation; import sword.langb...
<reponame>srabraham/MMM-Jast<gh_stars>0 class JastUtils { static getCurrentValue(stock, exchangeData) { let currentValue = "-"; if (stock.current) { currentValue = stock.current; if ( exchangeData && stock.tradeCurrency && stock.displayCurrency && stock.tradeCurrenc...
#!/bin/bash mkdir -p download # Download all PDF pages from the download page wget --directory-prefix=./download --accept=pdf --mirror --level=0 --no-parent --no-directories https://web.archive.org/web/20191123111549/https://www.yourhome.gov.au/downloads # Download the print sample to get nice cover and intro pages ...
#!/usr/bin/env bash if [ -z $1 ]; then echo "Builds a Docker image and publishes it with 'beta' tag" echo "Usage: ./build.sh <directory> [--cache]" echo "" echo "The --cache argument instructs build to use Docker layer cache." echo "Use with caution, cached layers might become outdated." exit f...
#!/usr/bin/env bash set -ex cd tests/unit ../singlerod/short/build/install/bin/unittests
<filename>model/base.go package model import ( "fmt" "sync" "time" "github.com/axiaoxin-com/logging" "go.uber.org/zap" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/schema" c "github.com/skrbox/ioseek/pkg/conf" . "github.com/skrbox/ioseek/pkg/log" ) var ( DB *gorm.DB once sync.Once my...
def validate_isbn_10(isbn): """This function takes an ISBN-10 code and returns True if the code is valid and False otherwise""" # Convert the code to a list of digits isbn_digits = [int(x) for x in isbn if x.isdigit()] # Calculate the verification code verify = 0 for i in range(len(isbn_dig...
# Core Django imports from django.db.models import Count from django.shortcuts import render, get_object_or_404, redirect from django.core.mail import send_mail from django.core.paginator import (Paginator, EmptyPage, PageNotAnInteger) from django.contrib.postgres.search import SearchVector, SearchQuery, SearchRank fro...
package com.univocity.envlp.wallet; import com.univocity.cardano.wallet.addresses.*; import com.univocity.envlp.wallet.persistence.dao.*; import com.univocity.envlp.wallet.persistence.model.*; import org.testng.annotations.*; import java.util.*; import static org.testng.Assert.*; public class WalletServiceTest exte...
<filename>D3dTiles/src/Primitives/Primitive.cpp #include "stdafx.h" #include "D3dTiles/Primitives/Primitive.h" namespace TileEngine { Primitive::~Primitive() {} } // namespace TileEngine
import Audio1 from '../Assets/Audio/bensound-allthat.mp3'; import Audio2 from '../Assets/Audio/bensound-countryboy.mp3'; import Audio3 from '../Assets/Audio/bensound-evolution.mp3'; import Audio4 from '../Assets/Audio/bensound-highoctane.mp3'; import Audio5 from '../Assets/Audio/bensound-hipjazz.mp3'; import SongArt1 ...
/* * Copyright (C) 2017 <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 * * Unless required by applicable law or agreed to in wr...
#!/bin/sh flask db upgrade
import { readOnlyRatingStar } from './readOnlyRatingStar'; export function ratingSummary(rating){ return `<div class="rating-summary"> <div class=""> <div class="pull-left">${readOnlyRatingStar(rating)}</div> <div class="pull-left"> 3.7 </div> ...
#!/bin/bash sudo apt install build-essential git pkg-config libgl1-mesa-dev libpthread-stubs0-dev libjpeg-dev libxml2-dev libpng-dev libtiff5-dev libgdal-dev libpoppler-dev libdcmtk-dev libgstreamer1.0-dev libgtk2.0-dev libcairo2-dev libpoppler-glib-dev libxrandr-dev libxinerama-dev curl cmake git clone https://github...
<filename>KS2.cpp #include<bits/stdc++.h> using namespace std; int main(){ unsigned long long t,n,ans,m,i,j; cin>>t; for(i=0;i<t;i++){ ans=0; cin>>n; m=n; for(j=0;n>0;j++){ ans+=n%10; n/=10; } for(j=0;j<=9;j++){ if((ans+j)%1...
/** * @param {String} type * @param {Object} attributes * @param {...any} children */ export function h (type, attributes, ...children) { const el = document.createElement(type) for (const key in attributes) { if (key === 'style' && Array.isArray(attributes[key])) { el.setAttribute(key, attributes[key...
#!/bin/sh args="$@" echo "OpenCV installation..." #PROJECT_PATH=echo ${args[0]} # Save current working directory cwd=$(pwd) cd "$cwd" || exit #Specify OpenCV version cvVersion="master" # Clean build directories rm -rf opencv/build rm -rf opencv_contrib/build # Create directory for installation mkdir lib-emscripte...
#!/bin/bash dieharder -d 201 -g 16 -S 1486470799
package main import ( "encoding/json" "flag" "github.com/go-openapi/spec" "github.com/jackmanlabs/errors" "go/build" "log" "os" "runtime/pprof" "strings" ) var ( // Command-line parameters pkgPath *string = flag.String("pkg", "", "The main package of your application.") profilePath *string = flag.Stri...
const withTypescript = (config) => { // Implementation for withTypescript return { ...config, // Add TypeScript configuration here } } const withSass = (config) => { // Implementation for withSass return { ...config, // Add Sass configuration here } } const compose = (...functions) => { ...
#!/bin/bash JBROWSE_BUILD_MIN=${JBROWSE_BUILD_MIN:=1} # check the exit status of the command, and print the last bit of the log if it fails done_message () { if [ $? == 0 ]; then log_echo " done." if [ "x$1" != "x" ]; then echo $1; fi else echo " failed. See setup.l...
<filename>modules/api-system/common/models/system-user/user.roles.js 'use strict' module.exports = function(SystemUser) { const Role = SystemUser.app.models.SystemRole const RoleMapping = SystemUser.app.models.SystemRoleMapping const findUserRoleMapping = (userId, roleId) => RoleMapping.findOne({ wher...
docker container run -d -p 3306:3306 --name db -e MYSQL_RANDOM_ROOT_PASSWORD=yes mysql docker container logs db | grep 'MYSQL_RANDOM_ROOT_PASSWORD' docker container run -d --name webserver -p 8080:80 httpd docker container run -d --name proxy -p 80:80 nginx docker container stop proxy db webserver
<gh_stars>1-10 import xml.etree.ElementTree import numpy as np from nexusutils.coordinatetransformer import CoordinateTransformer import logging from nexusutils.utils import normalise, find_rotation_axis_and_angle_between_vectors import itertools import uuid logger = logging.getLogger("NeXus_Utils") class NotFoundIn...
#!/bin/bash # This function takes no arguments # It tries to determine the name of this file in a programatic way. function _get_sourced_filename() { if [ -n "${BASH_SOURCE[0]}" ]; then basename "${BASH_SOURCE[0]}" elif [ -n "${(%):-%x}" ]; then # in zsh use prompt-style expansion to introspect...
#!/bin/bash res=6 while [ $res -eq 6 -o $res -eq 7 ] do sleep 1 curl -s $DATA_DATABASE_HOST:3306 res=$? done python Product/Database/DBConn.py python Product/RecommendationManager/run_recommendation.py
#!/bin/zsh MY_PATH="`dirname \"$0\"`" source=$1 csv=$2 output_dir=$source.annotated ann_type='latest' n=4 mkdir -p $output_dir/plys mkdir -p $output_dir/logs parallel --colsep=',' -j $n --eta "node --max-old-space-size=6000 $MY_PATH/../export-annotated-ply.js --id {1} --source $source --ann_type $ann_type --output_...
#include <iostream> using namespace std; int main() { // Defining array int arr[] = {12, 18, 4, 9, 14, 28}; int n = sizeof(arr)/sizeof(arr[0]); // Count variable int count = 0; for (int i = 0; i < n; i++) { // Check for even numbers if (arr[i] % 2 == 0) c...
require 'test_helper' # Validações para quando não há transporte module ValidationsWhenNotHasCarriage extend ActiveSupport::Concern included do before { subject.stubs(:have_carriage?).returns(false) } it { wont validate_presence_of(:veiculo) } it { wont_validate_have_one :veiculo, BrNfe.veiculo_product_class, ...
#!/usr/bin/env bash SCRIPT=`realpath $0` SCRIPTPATH=`dirname $SCRIPT` export PYTHONPATH=$SCRIPTPATH # OPTIONS="--continue-on-collection-errors --doctest-modules" pytest -vs apps/tests/ pytest -vs snippets/tests/ pytest -vs tests/
TERMUX_PKG_HOMEPAGE=https://nodejs.org/ TERMUX_PKG_DESCRIPTION="Open Source, cross-platform JavaScript runtime environment" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Yaksh Bariya <yakshbari4@gmail.com>" TERMUX_PKG_VERSION=16.14.2 TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_...
package net.community.chest.lang.math; import java.util.Comparator; /** * Copyright 2007 as per GPLv2 * * @param <V> Type of compared value * @author <NAME>. * @since Jun 10, 2007 2:59:29 PM */ public interface NumbersComparator<V extends Number & Comparable<V>> extends Comparator<V> { /** * @return {@...
<gh_stars>1-10 import { __assign } from "tslib"; import { each, isArray, deepMix } from '@antv/util'; import BBox from '../../../util/bbox'; var LABEL_MARGIN = 4; var MatrixLegend = /** @class */ (function () { function MatrixLegend(cfg) { this.destroyed = false; this.dataSlides = {}; this.i...
<gh_stars>10-100 // Package dynamodbquery queries objects from Amazon DynamoDB package dynamodbquery import ( "bytes" "encoding/json" "fmt" "reflect" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/servi...
#!/bin/bash # Copyright 2020 The Go Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # NOTE: The integration scripts deliberately do not check to # make sure that the test protos have been regenerated. # It is intentional that older ver...
<filename>components/form/index.ts export { default } from './form'; export { FormMessageType, Rule, FormValue, Field } from './form';
<filename>dev/app/Services/ads.service.ts<gh_stars>0 "use strict"; import { Injectable } from "@angular/core"; import { Http, Headers, Response, RequestOptions } from "@angular/http"; import { Observable } from "rxjs/Observable"; export class Ad { constructor( public id: string = "", public titl...
<gh_stars>1-10 import { Key } from '../../Any/Key'; import { _Pick as _OPick } from '../Pick'; import { List } from '../../List/List'; import { Tail } from '../../List/Tail'; import { BuiltIn } from '../../Misc/BuiltIn'; import { _ListOf } from '../ListOf'; /** * @hidden */ declare type PickAt<O, Path extends List<Ke...
// Copyright 2020 <NAME> // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include <boost/describe.hpp> #include <boost/mp11.hpp> #include <boost/json.hpp> #include <type_traits> namespace app { template<class T> void extract( boost::json::object const & obj, cha...
const moment = require('moment-timezone'); let date = moment().tz("America/Los_Angeles").format('h:mm:ss a'); let date2 = moment().tz("Asia/Tokyo").format('h:mm:ss a'); let date3 = moment().tz("Europe/London").format('h:mm:ss a'); console.log('Current time in Los Angeles: ', date); console.log('Current time in Tokyo:...
<filename>src/common/math.js /** * 数学计算 */ /** * 获取两点距离 * @method getDistance * @param {{x,y}} A点 * @param {{x,y}} B点 * @return {Float} 距离 */ function getDistance(A, B) { return Math.sqrt(Math.pow(A.x - B.x, 2) + Math.pow(A.y - B.y, 2)); } /** * 二维向量 */ class Vec2 { constructor(x = 0, y =...
/*************************************************************************** * Copyright (c) <NAME>, <NAME>, <NAME> and * * <NAME> * * Copyright (c) QuantStack * * Copyright (c) <NAME> ...
//********************************************************************************* // // Copyright(c) 2016 Carnegie Mellon University. All Rights Reserved. // Copyright(c) 2016-2017 <NAME> All Rights Reserved // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this fil...
#!/bin/bash if [ "$#" -ne 2 ]; then echo "Usage: $0 [input-list] [team-id]" exit 1 fi INPUT=$1 TEAM=$2 if [ ! -f "$INPUT" ]; then echo "$INPUT file not found" exit 99 fi USERNAME="" PASSWORD="" OLDIFS=$IFS IFS=, while read template datastore folder vmprefix; do python2.7 ../scripts/clone_vm.py --host cdr-vcen...
#!/bin/bash # ****************************** # Author: # Lokesh Jindal # April 2015 # lokeshjindal15@cs.wisc.edu # ****************************** # Description: # This script checks how many gem5 sims have finished gracefully ("m5_exit") # and how many NPB benchmarks have complete gracefully ("benchmark completed") #...
function mode(array) { let count = {}; let maxEl = array[0], maxCount = 1; for(let i = 0; i < array.length; i++) { let el = array[i]; if(count[el] == null) count[el] = 1; else count[el]++; if(count[el] > maxCount) { maxEl = el; ...
<reponame>zonesgame/StendhalArcClient<filename>core/src/games/stendhal/client/gui/chattext/ChatCache.java /*************************************************************************** * (C) Copyright 2003-2015 - Stendhal * ***********************************************************...
#ifndef H_LINGO_PAGE_POINT_MAPPER #define H_LINGO_PAGE_POINT_MAPPER #include <lingo/platform/constexpr.hpp> #include <lingo/page/result.hpp> #include <lingo/page/intermediate.hpp> #include <type_traits> #define LINGO_POINT_MAPPER_TYPEDEFS \ using source_page_type = SourcePage; \ using destination_page_type = Dest...