text
stringlengths
1
1.05M
/* * Software License Agreement (BSD License) * * Copyright (c) 2019, Locus Robotics * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must re...
#!/bin/bash SRC_FRONTEND_ROOT=src-frontend FS_ROOT=fs function compress_css_for_html () { purifycss "$SRC_FRONTEND_ROOT/$1" "$SRC_FRONTEND_ROOT/$2" --min true --out "$FS_ROOT/$1" } function compress_html () { html-minifier --collapse-inline-tag-whitespace --collapse-whitespace --remove-comments \ --r...
#!/bin/bash echo "===== Download Cloud Seeder App =====" URL=$(curl -s https://api.github.com/repos/Arshad-Barves/cloudseeder/releases/latest | grep browser_download_url | cut -d '"' -f 4) wget $URL -O tcloud.tgz echo "===== Unarchive App =====" mkdir tcloud tar zxf tcloud.tgz -C tcloud --strip-components 1 echo "==...
// 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 // HealthyResponse response of /healthy type HealthyResponse struct { Healthy bool `json:"healthy" yaml:"healthy"` } // GcResponse response of /gc // Retu...
def reverse_string(string): rev_string = "" for char in string: rev_string = char + rev_string return rev_string result = reverse_string("Hello World") print(result)
<?xml version="1.0" encoding="UTF-8"?> <bookstore> <book> <title>The Lord of the Rings</title> <author>J.R.R. Tolkien</author> <publisher>George Allen &amp; Unwin</publisher> </book> <book> <title>Harry Potter and the Sorcerer's Stone</title> <author>J.K. Rowling</author> <publisher>Arthur A. Levine Books</p...
function checkParentheses(str) { let stack = []; for (let i = 0; i < str.length; i++) { if (str[i] === '(' || str[i] === '[' || str[i] === '{') { stack.push(str[i]); } else if (str[i] === ')' || str[i] === ']' || str[i] === '}') { let current_char = str[i]; ...
package com.pangzhao.controller.bak; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; //Rest模式 @RestController @RequestMapping("/books") public class BookController extends BaseClass...
package aserg.gtf.util; public class ConfigInfo { private float normalizedDOA = 0.75f; private float absoluteDOA = 3.293f; private float tfCoverage = 0.5f; public ConfigInfo(float normalizedDOA, float absoluteDOA, float tfCoverage) { super(); this.normalizedDOA = 0.75f; this.absoluteDOA = 3.293f; this.tf...
package com.siyuan.enjoyreading.adapter; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.androidapp.utils.ImageLoaderUti...
#!/bin/bash # Set up your host machine for CodeReady Containers crc setup # Start the CodeReady Containers virtual machine crc start --memory 16384 # Add the cached oc executable to your PATH: eval $(crc oc-env) # Log in as a cluster admin user to install the operators needed oc config use-context crc-admin # Subs...
#!/bin/bash # Usage : # bash c14-get-infos.sh [dev or nothing] # Path of the script rootPath="$(dirname "$0")" # Environment : set $dev, $env and $progress if needed if [ -z ${dev+x} ]; then source $rootPath/get-env.sh $1 fi # C14 variables retrieval in the scope, according to the environment # platformIds, pr...
from sense_hat import SenseHat # Initialize the Sense HAT sense = SenseHat() # Define the grid dimensions grid_size = 5 # Define the grid with player, goal, and obstacles grid = [ [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' ', ' ', ' ', ' '], [' ', ' '...
const selectionsort = (list, cmp) => { const maxlen = list.length const compare = cmp || ((a, b) => { return (a - b) }) let minPos let temp for (let index = 0; index < maxlen - 1; index++) { minPos = index for (let current = index + 1; current < maxlen; current++) { if (compare(list[min...
<gh_stars>10-100 from flask_jwt_extended import jwt_required from functools import partial import os import shutil import time import uuid from shakenfist import artifact from shakenfist.artifact import Artifact, Artifacts from shakenfist import blob from shakenfist.config import config from shakenfist.daemons import ...
#!/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...
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LogisticRegression # Import dataset dataset = pd.read_csv('transactions.csv') # Separate features (X) and target (y) X = dataset.iloc[:, :-1].values y = dataset.il...
<reponame>lananh265/social-network "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_event_seat_twotone = void 0; var ic_event_seat_twotone = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" ...
package a4.kovger.phodb.db.search; import a4.kovger.phodb.db.MetaEntity; import java.util.Date; public class DateFilter implements Filter { enum Type { BEFORE{ public boolean apply(DateFilter f) { return f.date1.before(f.theDate); } }, AFTER { ...
def flatten_inventory(data): result = [] for category in data['clothing']: for item in category.values(): for clothing_item in item: result.append((clothing_item['name'], clothing_item['popularity'])) return result
export const environment = { production: true, careerApiEndpointUrl: 'http://api.career.damjanko.com/' };
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import React from 'react'; import { FormattedMessage } from 'react-intl'; import ReactSelect from 'react-select'; import { InputActionMeta } from 'react-select/src/types'; import { getOptionValue } from 're...
<filename>tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/ToDoDatabase.java // Copyright 2007, 2008 The Apache Software Foundation // // 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...
#!/bin/bash #from https://stackoverflow.com/questions/24641948/merging-csv-files-appending-instead-of-merging/24643455 if [ "$#" -ne 1 ]; then echo ">>> Illegal number of parameters running merge_csvs.sh" exit 2 fi dir=$1; base_dir_name=$(basename $dir) OutFileName="$base_dir_name.csv" #output csv has name di...
package carrot import ( "encoding/json" log "github.com/sirupsen/logrus" ) type response interface { AddParam() AddParams() } // for use of controller-level control type ResponseParams map[string]interface{} // NewOffset instantiates a struct to hold coordinate data used later to create JSON objects. func NewOf...
sudo apt-get -y update sudo apt-get -y upgrade # relevant dependencies sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev sudo apt-get install -y libxine2-dev libv4l-dev sudo apt-get install -y libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev sudo apt-get install -y qt5-defaul...
import ReportEsApi from './report_es_api'; export default ReportEsApi;
<reponame>kotik-coder/PULsE<filename>src/main/java/pulse/util/PropertyHolderListener.java package pulse.util; /** * A listener used by {@code PropertyHolder}s to track changes with the * associated {@code Propert}ies. */ public interface PropertyHolderListener { /** * This event is triggered by any {@code...
'use strict'; if (typeof require !== 'undefined') { var ShioriConverter = require('shiori_converter').ShioriConverter; } /** * SHIORI/2.x/3.x transaction class with protocol version converter */ class ShioriTransaction { /** * constructor * @return {ShioriTransaction} this */ constructor() { } /...
<filename>lock/release_test.go package lock import ( "testing" "time" . "github.com/smartystreets/goconvey/convey" ) func TestRelease(t *testing.T) { locker := NewEtcdLocker(client(), true) Convey("After release a key should be lockable immediately", t, func() { lock, err := locker.Acquire("/lock-release", 10...
import { createSelector } from "reselect"; import { initialState } from "./reducer"; /** * Direct selector to the dashboard state domain */ const selectDashboardDomain = state => state.get("dashboard", initialState); /** * Other specific selectors */ /** * Default selector used by Dashboard */ const makeSele...
cd data/wikipedia_sci if [ ! -e text8 ]; then cd ../../ wget http://mattmahoney.net/dc/text8.zip -O text8.gz mv text8.gz data/wikipedia_sci && cd data/wikipedia_sci gzip -d text8.gz -f cd ../../ fi
# Powerline export powerline_branch= export powerline_line_number= export powerline_readonly= export powerline_extra_column_number= export powerline_left_hard_divider= export powerline_left_soft_divider= export powerline_right_hard_divider= export powerline_right_soft_divider= export powerline_extra_right_half_...
#!/bin/sh set -e echo "Got base path at '$1'" echo "Got curent version of '$2'" echo "Got previsous version of '$3'" if [ ! -f /usr/lib/contractor/util/blueprintLoader ] then echo "WARNING: contractor not found, assuming you are installing for the PXE resources only, skiping blueprint loading." exit 0 fi echo "...
#!/usr/bin/env python # # Copyright 2007 <NAME>. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that both ...
import { ApolloCache } from "@apollo/client"; import { TypedDocumentNode } from "@graphql-typed-document-node/core"; import produce from "immer"; export interface ApolloCacheUpdateQueryParams<Query, QueryVariables> { query: TypedDocumentNode<Query, QueryVariables>; variables: QueryVariables; update: (query: Quer...
module.exports = { root: true, "env": { "browser": true, "es6": true }, "extends": [ "eslint-config-prettier", 'airbnb-typescript', "eslint:recommended", "eslint-config-jsdoc", "plugin:promise/recommended", "plugin:import/recommended", ...
#!/usr/bin/env bash # shellcheck disable=SC2091 ############################################################################### function cmd { printf "./avalanche-cli.sh avm get-all-balances" ; } function check { local result="$1" ; local result_u ; result_u=$(printf '%s' "$result" | cut -d' ' -f3) ; ...
<gh_stars>0 // Copyright 2022 DeepL SE (https://www.deepl.com) // Use of this source code is governed by an MIT // license that can be found in the LICENSE file. const uuid = require('uuid'); const util = require('./util'); const glossaries = new Map(); util.scheduleCleanup(glossaries, (glossary, glossaryId) => { c...
docker build --no-cache -t kamir/cdsw-base-4-maven-rosbag-extractor-v4 . docker push kamir/cdsw-base-4-maven-rosbag-extractor-v4:latest export T=$(date +%I_%M_%S) echo "current time is: "$T docker image ls docker run -it -d --name container_$T kamir/cdsw-base-4-maven-rosbag-extractor-v4 docker container ls read -...
<reponame>1024pix/pix-ui import Component from '@glimmer/component'; export default class PixBlockComponent extends Component { text = 'pix-block'; get getShadowWeight() { const shadowParam = this.args.shadow; const correctsWeight = ['light', 'heavy']; return correctsWeight.includes(shadowParam) ? sha...
SELECT customer_id, SUM(amount) AS totalAmount, AVG(amount) AS avgAmount, COUNT(amount) AS countAmount FROM payments WHERE payment_date > '2021-01-01' GROUP BY customer_id ORDER BY averageAmount DESC;
<filename>client.org/app/scripts/app.js<gh_stars>0 // app/scripts/app.js 'use strict'; /** * @ngdoc overview * @name yeoaskar * @description * # yeoaskar * * Main module of the application. */ var app = angular.module('yeoaskar', [ 'ngAnimate', 'ngCookies', 'ngResource', 'ngRoute', 'ngSanit...
#!/bin/bash export FLASK_APP=labelmaker.py flask run --host=0.0.0.0
#!/bin/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...
#!/usr/bin/env bash # 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 writing, software #...
if command -v kubectl > /dev/null ; then source <(kubectl completion zsh) fi
public class SearchIndexAction { // Implementation of SearchIndexAction class is not provided } public class Document { // Implementation of Document class is not provided } public class DocumentManager { private SearchIndexAction searchIndexAction; public void setSearchIndexAction(SearchIndexAction ...
<reponame>oueya1479/OpenOLAT /** * <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 License.<br> * You may obtain a copy of the License at the ...
<gh_stars>100-1000 //===--- SyntaxFactory.h - Swift Syntax Builder Interface -------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See ...
<reponame>adityaanjeet/ud839_Miwok-lesson-one /* * Copyright (C) 2016 The Android Open Source Project * * 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/lic...
/* * 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 "License"); you may ...
#!/bin/bash # Copyright (c) 2013 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. if [ -d "$1" ]; then cd "$1" else echo "Usage: $0 <datadir>" >&2 echo "Removes obsolete LitecoinEco database files"...
<gh_stars>0 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_crop_3_2_outline = void 0; var ic_crop_3_2_outline = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" }, "children": [] }, ...
#!/usr/bin/env bash unzip tests/usnjrnl.zip usncarve.py -h usn.py -h usncarve.py -f usnjrnl.bin -o /tmp/usn-carved.bin echo "[ + ] Carve completed" echo "[ + ] Attempting to parse carved records" xxd /tmp/usn-carved.bin usn.py -f /tmp/usn-carved.bin -o /tmp/usn-parsed.txt cat /tmp/usn-parsed.txt rm /tmp/usn-parsed.txt...
#!/bin/bash function abs_path() { SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" done echo "$( cd -P "$( dirname "$SOURCE" )" && pwd )" } BIN=`abs...
<filename>algorithm/data_structure/jds03-4.js //--- 数组 --- //splice /* let numbers = [1, 3, 54]; numbers.splice(2,0,1,2,3); //第一个参数为操作的索引位置,第二个参数为删除的个数,第三位以后为插入的值 console.log(numbers); */ //concat /* const zero = 0; const positiveNumbers = [1, 2, 3]; const negativeNumbers = [-3, -2, -1]; let numbers = negativeNumbers...
<filename>src/components/Navigation/NavigationItem/NavigationItem.tsx import React from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { useRouter } from 'next/router'; import { Nav } from 'react-bootstrap'; import { MenuItem } from '@types-app/index'; import { asset, getLinkAttributes }...
package csulb.cecs343.lair; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CurrentFolderLevel { public static String level = "1"; public static List<String> levelLog = new ArrayList<>(Arrays.asList("1")); }
#!/bin/sh # Step 1. Remove pre-existing artifacts and set up PACKAGING_DIR="${SRCROOT}/../../../Packaging" RELEASE_DIR="${PACKAGING_DIR}/${PROJECT_NAME}" TEMP_BUILD_DIR="${RELEASE_DIR}/build" if [ -d "${RELEASE_DIR}" ]; then rm -rf "${RELEASE_DIR}" fi mkdir -p "${RELEASE_DIR}" IPHONE="iphone" OS="os" SIMULATOR="simu...
#!/bin/bash ######## # Help # ######## if [[ $1 = "--help" || -z "$1" ]] ; then echo "screensaver --help" echo "usage: screensaver [options] idle-time" echo "" echo "Lightweight screensaver for Ubuntu" echo "" echo "options:" echo " --v, --version print the version" echo " -...
#!/bin/sh xrandr --output DVI-D-0 --off --output HDMI-1 --off --output HDMI-0 --mode 1920x1080 --pos 4480x360 --rotate normal --output DP-3 --off --output DP-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output DP-1 --mode 1920x1080 --pos 0x360 --rotate normal --output DP-0 --off
package br.usp.poli.lta.nlpdep.mwirth2ape.labeling; import br.usp.poli.lta.nlpdep.mwirth2ape.model.Token; import java.util.LinkedList; public class ProductionToken extends Token { private NTerm nterm; private LinkedList<LabelElement> labels; private LinkedList<LabelElement> preLabels; private Linked...
<gh_stars>0 #include <errno.h> #include <string.h> #include "double_private.h" void double_array_fprint( FILE * out, int n, const double * a, const char * format) { int i; for (i = 0; i < DOUBLE_ARRAY_FPRINT_FORMAT_TOTAL; ++i) if (!strcmp(format, double_array_fprint_format[i])) { double_array_fp...
<filename>srclibs/game/src/scriptloader.cpp #include "scriptloader.h" #include <filesystem> #include <iostream> namespace fs = std::filesystem; std::string ScriptLoader::nilscript; ScriptLoader::ScriptLoader() {} ScriptLoader::~ScriptLoader() {} bool ScriptLoader::loadScript(const std::string& path) { std::ifs...
(function(){ "use strict"; angular.module("myApp").value("Config", { getUrl: "http://apprepublicaja.esy.es/apirepublicaja/v1/" }); angular.module("myApp").service("Data",function($http, Config){ //Recupera os anuncios this.getData = function(params){ return $http({ method: "POST", url...
<filename>db/DB_Languages.js require( "dotenv" ).config(); const { CockroachDB, DataTypes, Op } = require( "./CockroachDB" ); const utils = require( "../utils/useful" ); class DB extends CockroachDB { constructor() { super( { "alpha2": DataTypes.STRING, "English": DataTypes.STRING...
import tensorflow as tf from tensorflow.keras import models, layers # Inputs player1_win_loss = layers.Input(shape=(1,)) player1_aces = layers.Input(shape=(1,)) player1_first_serve_percentage = layers.Input(shape=(1,)) player1_second_serve_percentage = layers.Input(shape=(1,)) player1_unforced_errors = layers.Input(sh...
const defines = require('./defines'); const yuri2 = require('yuri2js'); const work = function (opt) { const app = opt.app; //适合子进程的一些函数 global.yuri2web||(global.yuri2web = { _online: 0, _requested: 0, _creatAt:new Date(), log(...data){ app.log(...data); }...
def generate_xctool_command(platform, build_type): if platform == "iPhoneOS": if build_type == "library": return 'xctool -project build-mac/mailcore2.xcodeproj -sdk iphoneos7.1 -scheme "static mailcore2 ios" build ARCHS="armv7 armv7s arm64"' elif build_type == "test": return ...
<?php // Connect to database $db = mysqli_connect('localhost', 'username','password','employee'); // Store employee information $name = $_POST['name']; $age = $_POST['age']; // Create SQL query $sql = "INSERT INTO employee (name, age) VALUES ('$name', '$age')"; // Execute query if (mysqli_query($db, $sql)) { e...
#!/bin/bash python3 alphazero.py --budget=1000000 --stochastic --parallel --game=RaceStrategy --gamma=0.99 --max_ep_len=55 --eval_freq=1 --c=2.2 --n_ep=1 --eval_episodes=10 --n_mcts=50 --mcts_only --n_experiments=1 --unbiased --budget_scheduler --slope=2.9 --max_workers=10 --min_budget=30
package org.moskito.control.connectors.parsers; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import net.anotheria.moskito.core.threshold.ThresholdStatus; import org.moskito.control.connectors.response.*; import org.moskito.control.common.HealthColor; import org.moskito.control.common.AccumulatorDat...
SELECT * FROM items WHERE date_added >= CURDATE();
import React, { useState } from "react"; import CustomButton from "../../../CustomButton"; import tradeApiClient from "services/tradeApiClient"; import useSelectedExchange from "hooks/useSelectedExchange"; import { showErrorAlert, showSuccessAlert } from "store/actions/ui"; import { useDispatch } from "react-redux"; im...
// Based on code originally written by <NAME> in the public domain, // https://web.archive.org/web/20070212102708/http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx package avltree import ( "sync" "github.com/johan-bolmsjo/gods/v2/list" "github.com/johan-bolmsjo/gods/v2/math" ) // Maximum tree h...
#!/usr/bin/env bash echo '=====开始安装夕颜源码环境=====' echo '=====开始运行mysql=====' docker-compose -f ../yaml/mysql.yml up -d echo '=====mysql正在进行初始化=====' ../config/wait-for-it.sh http://localhost:3306 --timeout=60 -- echo "=====mysql已经准备就绪=====" echo '=====开始部署portainer可视化工具=====' docker-compose -f ../yaml/portainer.yml u...
#!/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 "Licen...
def calculate_w(U: Tensor) -> Tensor: # Sum along the second axis to calculate w w = tf.reduce_sum(U, axis=1) return w
<filename>packages/sorted-map/tests/functions/toArray.ts<gh_stars>100-1000 import test from 'ava'; import { empty, toArray } from '../../src'; import { SortedMap, fromStringArray, pairsFrom } from '../test-utils'; const values = ['A', 'B', 'C', 'D', 'E']; let map: SortedMap; test.beforeEach(() => { map = fromStringA...
#!/bin/bash DOCKER_TAG='' case "$TRAVIS_BRANCH" in "master") DOCKER_TAG=latest ;; "develop") DOCKER_TAG=dev ;; esac docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD docker build -t dshop.services.operations:$DOCKER_TAG . docker tag dshop.services.operations:$DOCKER_TAG $DOCKER_USERNAME/dsh...
// @ts-check import React from "react"; import { storiesOf } from "@storybook/react"; import { CodeSurfer } from "@code-surfer/standalone"; import { StoryWithSlider } from "./utils"; storiesOf("Title & Subtitle", module) .add("Title", () => <TitleStory />) .add("Subtitle", () => <SubtitleStory />) .add("Fit Cod...
// // Created by ooooo on 2020/3/12. // #ifndef CPP_016__SOLUTION1_H_ #define CPP_016__SOLUTION1_H_ #include <iostream> using namespace std; /** * o(n) timeout */ class Solution { public: double myPow(double x, int n) { double ans = 1.0; if (n < 0) return 1.0 / myPow(x, -n); while (n) { ans *=...
#!/usr/bin/env bash # shellcheck disable=SC1090,SC2154,SC2155 # Copyright Istio Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
import React from "react"; import { Box, Flex, Text, Icon } from "rimble-ui"; const colors = { positive: "155, 66%, 45%", negative: "8, 86%, 46%" }; const ExampleCard = ({ variant, ...props }) => { let colorPrimary = "0,0%,0%", iconName = "ThumbDown", cardLabel = "{ missing variant }"; if (variant ==...
package BinarySearch import ( "math/rand" "testing" "time" "fmt" ) func SortArray(array []int) { for itemIndex, itemValue := range array { for itemIndex != 0 && array[itemIndex-1] > itemValue { array[itemIndex] = array[itemIndex-1] itemIndex -= 1 } array[itemIndex] = itemValue } } func TestBinarySe...
<reponame>wschat/ws-vue<filename>src/components/upload/http.js /** * XMLHttpRequest 简单封装(主要用于上传组件) * @param {string} url 请求路径(请带上前缀 例:http://) * @param {Object} data 传输的数据 在该函数内会使用FormData进行二次处理(存在则自动使用post请求) * @param {Object} options 一些配置项 * @return {Promise} */ export default function(url,data...
<gh_stars>10-100 // groan. export function range(start: number, end: number, step: number = 1): number[] { return [...Array(Math.ceil((end - start) / step)).keys()].map(i => i * step + start); } export function arrayGrouped<A>(array: A[], groupSize: number): A[][] { return range(0, array.length, groupSize).map(i ...
#!/bin/sh # How to use this test script: # Put all of your tests into a directory like "tests/scanner". # Name the good tests goodXX.bminor and the bad tests badXX.bminor. # Then use run-tests.sh and give the location of the compiler # executable, the command-line option, and the test directory. # This script will ru...
<filename>app/src/main/java/com/kp/twitterclient/activities/BaseActivity.java package com.kp.twitterclient.activities; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget...
<reponame>ShibaPipi/sarair import Avatar from 'antd/es/avatar' import 'antd/es/avatar/style/css' export { Avatar }
#!/bin/bash source /home/admin/_version.info source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf # all system/service info gets detected by blitz.statusscan.sh source <(sudo /home/admin/config.scripts/blitz.statusscan.sh) source <(sudo /home/admin/config.scripts/internet.sh status) # when admin and n...
/** * This class is generated by jOOQ */ package io.cattle.platform.core.model.tables; /** * This class is generated by jOOQ. */ @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.0" }, comments = "This class is generated by jOOQ") @java.lang.SuppressWarnings({ "all", ...
<reponame>Lyrositor/rpbot<gh_stars>0 import binascii import hashlib import os from typing import Tuple, Iterable, Optional, Union from discord import Message, TextChannel from fuzzywuzzy.process import extractOne MAX_MESSAGE_LENGTH = 2000 def hash_password(password: str) -> Tuple[str, str]: salt = os.urandom(8)...
#!/bin/sh set -eu /usr/bin/env python3 "$@" -Dq='2**383 - 31' -Dmodulus_bytes='23 + 15/16' -Da24='121665'
<reponame>Lambda-School-Labs/frontend-vbb-portal export const meetingStatus = { CHECKED_IN: 'CHECKED_IN', EXPIRED: 'EXPIRED', NOT_CHECK_IN: 'NOT_CHECKED_IN', PRE_CHECK_IN: 'PRE_CHECK_IN', }; export default meetingStatus;
#!/bin/bash ppid=$$ maxmem=0 $@ & pid=`pgrep -P ${ppid} -n -f $1` # $! may work here but not later while [[ ${pid} -ne "" ]]; do #mem=`ps v | grep "^[ ]*${pid}" | awk '{print $8}'` #the previous does not work with MPI mem=`cat /proc/${pid}/status | grep VmRSS | awk '{print $2}'` if [[ ${mem} -...
/** * @module botframework-streaming */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { IReceiveResponse } from './IReceiveResponse'; import { StreamingRequest } from '../streamingRequest'; /** * Abstraction to define the characteristics of...
themes=( casper attila london massively bleak the-shell vapor pico # lyra ) for theme in "${themes[@]}" do cp -Rf "node_modules/$theme" content/themes done
def encrypt(string): result = "" for i in range(len(string)): char = string[i] # Encrypt uppercase characters if (char.isupper()): result += chr((ord(char) + 3 - 65) % 26 + 65) # Encrypt lowercase characters else: result += chr((ord(char...