text stringlengths 1 1.05M |
|---|
package com.benmu.framework.event.shorage;
import android.content.Context;
import android.text.TextUtils;
import com.benmu.framework.manager.ManagerFactory;
import com.benmu.framework.manager.StorageManager;
import com.benmu.framework.utils.JsPoster;
import com.taobao.weex.bridge.JSCallback;
import java.util.ArrayLi... |
<filename>app/platform/PlatformBuilder.js
/*
*SPDX-License-Identifier: Apache-2.0
*/
var Platform = require('./fabric/Platform.js');
class PlatformBuilder {
static async build(pltfrm) {
if(pltfrm == 'fabric') {
var platform = new Platform();
await platform.initialize();
... |
package log
import (
"fmt"
"os"
"path/filepath"
"time"
)
//file logger print log message to a specified file, log file will rotate to new
//file daily, and will cleanup old log files, the file logger engine cached one
//month's log data and will remove older log files
type file struct {
level int
path st... |
#!/usr/bin/env bash
cp .boto ~/.boto
pip2 install gsutil
|
<reponame>abanvill/42-Projects
#include "../includes/ping.h"
void alarm_callback(int signbr) {
t_ping *ping;
(void)signbr;
ping = require_data();
if (ping->opts.flag.deadline) {
ping->opts.deadline--;
if (ping->opts.deadline == 0xFFFFFFFF) {
print_outro(ping);
... |
def get_longest_word(str)
str_arr = str.split(" ")
longest_word = ""
longest_word_length = 0
str_arr.each do |word|
if word.length > longest_word_length
longest_word = word
longest_word_length = word.length
end
end
return longest_word
end
puts get_longest_word("This is a long senten... |
#
# To run on the ZCU102 board, copy the packagge/sd_card directory onto the SD card, plug it into the board and power it up.
# When the Linux prompt appears, run this script by entering the following command:
# source /mnt/sd-mmcblk0p1/run_app.sh
#
mount /dev/mmcblk0p1 /mnt
cd /mnt
cp platform_desc.txt /etc/xocl... |
def process_default_source(env_vars):
default_source = env_vars.get('DEFAULT_SOURCE', 'undefined')
if default_source == 'undefined':
return 'No default source specified'
else:
return f'Default source is {default_source}' |
#!/bin/bash
R CMD INSTALL --no-multiarch --with-keep.source interactiontransformer
|
#coding:utf-8
import numpy as np
np.set_printoptions(linewidth=200,suppress=True)
# 4.2 元素去重
# 4.2.1直接使用库函数
a = np.array((1, 2, 3, 4, 5, 5, 7, 3, 2, 2, 8, 8))
print('原始数组:', a)
# 使用库函数unique
b = np.unique(a)
print('去重后:', b)
# 4.2.2 二维数组的去重,结果会是预期的么?
c = np.array(((1, 2), (3, 4), (5, 6), (1, 3), (3, 4), (7, 6)))
pri... |
<gh_stars>0
package dev.vality.sink.common.handle.machineevent.eventpayload.impl;
import dev.vality.damsel.payment_processing.EventPayload;
import dev.vality.damsel.payment_processing.InvoiceChange;
import dev.vality.machinegun.eventsink.MachineEvent;
import dev.vality.sink.common.handle.machineevent.eventpayload.Paym... |
#!/usr/bin/env bash
#### --debug-file
$SH --debug-file $TMP/debug.txt -c 'true'
grep 'Debug file' $TMP/debug.txt >/dev/null && echo yes
## stdout: yes
#### debug-completion option
set -o debug-completion
## status: 0
#### debug-completion from command line
$SH -o debug-completion
## status: 0
#### repr
x=42
repr x
... |
from fastapi import FastAPI
import edgedb
app = FastAPI()
# Connect to EdgeDB
settings = get_settings()
app.state.db = await edgedb.create_async_pool(settings.edgedb_dsn)
# Define the Account entity in EdgeDB schema
async with app.state.db.acquire() as conn:
await conn.execute("""
CREATE SCALAR TYPE bala... |
from rest_framework.serializers import ModelSerializer
from .models import Operation
class OperationSerializer(ModelSerializer):
class Meta:
model = Operation
fields = ('id', 'direction', 'amount', 'fee', 'sender', 'receiver', 'payment', 'account',) |
"""Provides unit tests to verify that the graph merging algorithm is functioning correctly."""
import unittest
import copy
from ..pygraph import UndirectedGraph, merge_graphs, build_triangle_graph
from . import utility_functions
class MergeGraphsTest(unittest.TestCase):
def test_empty_graphs(self):
"""D... |
def is_anagram(str1, str2):
if len(str1) != len(str2):
return False
# get frequency of each character of str1
freq_map = {}
for ch in str1:
if ch not in freq_map:
freq_map[ch] = 1
else:
freq_map[ch] += 1
# check whether frequency of characters in str... |
package search;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
/**
*
* @author minchoba
* 백준 15805번: 트리나라 관광 가이드
*
* @see https://www.acmicpc.net/problem/15805/
*
*/
public class Boj15805 {
private static final String NEW_LINE = ... |
let array = [3,5,6,7,2,1]
let count = array.length
console.log(count) |
#ifndef __CUSTOM_FILE_REQUEST_H__
#define __CUSTOM_FILE_REQUEST_H__
#include "cocos2d.h"
#include "network/HttpRequest.h"
#include <string>
#include <vector>
class FileRequestListener;
class CustomFileRequest
{
private:
cocos2d::network::HttpRequest *request;
std::vector<FileRequestListener*> listeners;
pub... |
#!/bin/bash
# Color theming
if [ -f ~/clouddrive/aspnet-learn/setup/theme.sh ]
then
. <(cat ~/clouddrive/aspnet-learn/setup/theme.sh)
fi
echo
echo "Building images to ACR"
echo "======================"
if [ -f ~/clouddrive/aspnet-learn/create-acr-exports.txt ]
then
eval $(cat ~/clouddrive/aspnet-learn/create-acr... |
import sbClient from "~/lib/supabase";
import type { Page } from "@linkto/core";
import type { GetStaticPaths } from "next";
export const getStaticPaths: GetStaticPaths = async () => {
// get all sites that have subdomains set up
const subdomains = await sbClient.from<Page>("pages").select("subdomain");
// get ... |
from django.contrib.auth.models import User
from django.db import models
class UserProfile(models.Model):
user = models.OneToOneField(User, blank=True, null=True)
email = models.EmailField(blank=False, unique=True)
def __str__(self):
if self.user:
return self.user.get_full_name() +... |
# -*- coding: utf-8 -*-
"""
Azure Resource Manager (ARM) PostgreSQL Server Operations Execution Module
.. versionadded:: 2.0.0
.. versionchanged:: 4.0.0
:maintainer: <<EMAIL>>
:configuration: This module requires Azure Resource Manager credentials to be passed as keyword arguments
to every function or via acct i... |
import React from "react";
import Cesium, { Viewer as CesiumViewer } from "cesium";
import createCesiumComponent, { EventkeyMap } from "./core/CesiumComponent";
import EventManager from "./core/EventManager";
export interface ViewerCesiumProps {
terrainProvider?: Cesium.TerrainProvider;
terrainShadows?: Cesium.Sh... |
#!/bin/bash
#
# Use this file to quickly change the app version.
# It will also tag, commit the change and push it.
#
# Usage: ./version.sh 1.2.0
# Check $1
if [ -z "$1" ]
then
echo "Version is required."
fi
# Replace version in package.json files
sed -i.bak "s/\"version\": \".*\"/\"version\": \"$1\"/g" ./packa... |
<reponame>KonstHardy/docusaurus
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import {Joi} from '@docusaurus/utils-validation';
import type {ThemeConfig, Validate, ValidationRe... |
import { before, after } from 'mocha';
import * as sinon from 'sinon';
import * as cmr from 'util/cmr';
type CmrMethodName = 'cmrSearchBase' | 'fetchPost' | 'cmrPostSearchBase' | 'getCollectionsByIds' | 'getVariablesByIds' | 'getVariablesForCollection' | 'queryGranulesForCollection' | 'belongsToGroup' | 'cmrApiConfig'... |
#!/usr/bin/env bash
set -e
if [ -z $1 ]; then
echo "usage: release.sh 0.0.n"
exit 1
fi
git tag $1
git push --tags
|
<reponame>minwook94/seesoTest
const Bundler = require('parcel-bundler');
const express = require('express');
const http = require('http');
const open = require('open');
const app = express();
const bundlePath = process.argv[2];
const port = process.argv[3];
app.use((req, res, next) => {
res.setHeader('Cross-Orig... |
#!/bin/bash
brownie networks delete ftm-test
brownie networks add "Fantom Opera" ftm-test host='https://rpc.testnet.fantom.network' name='Testnet' chainid=4002 explorer='https://api-testnet.ftmscan.com/api'
|
<reponame>r-pai/logserver<gh_stars>10-100
var path = require('path');
var _ = require('lodash');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var AssetsPlugin = requir... |
PREFIX_EFFECTIVE=$PREFIX
# strip PREFIX to package level
# needed when using environments
# does not break when not using them
while true; do
resp=$(echo $PREFIX_EFFECTIVE | grep -q envs)
if [ $? -eq 0 ]; then
PREFIX_EFFECTIVE=$(dirname $PREFIX_EFFECTIVE)
continue
fi
break
done
# edit the paths in th... |
../../../src/tesseract-tx -create nversion=1 > blanktxv1.hex
../../../src/tesseract-tx -json -create nversion=1 > blanktxv1.json
../../../src/tesseract-tx -json -create > blanktxv2.json
../../../src/tesseract-tx -create in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0 in=bf829c6bcf84579331337659d31... |
/usr/local/mysql/bin/mysql -u root --password='Aszxqw1234' aisland <purge-database.sql
|
<reponame>JetBrains-Research/ReSplit
from contextlib import redirect_stdout
import beniget
import gast as ast
class ChainExtractor:
def __init__(self):
self.pair_list = []
self.parsing_error_log = {
'ValueError': [],
'SyntaxError': [],
'AssertionError': [],
... |
import tkinter as tk
from infi.systray import SysTrayIcon
from traylert.traylert_crypto import encrypt, decrypt
def on_quit_callback(systray):
systray.shutdown()
def on_encrypt_callback(systray):
input_text = input("Enter the text to encrypt: ")
encrypted_text = encrypt(input_text)
systray.update(menu... |
<filename>unique.js
/**
* 从性能考虑,如果浏览器支持 new Set 那么优先考虑new Set
* 因为当数据大的时候,循环遍历是非常耗时的 所以不推荐forEach
*/
// 第一种 传统方式
function unique(arr) {
const res = []
arr.forEach(item => {
if (res.indexOf(item) < 0) {
res.push(item)
}
});
return res
}
// 第二种 new Set (无序 不能重复)
function uniqueTwo(arr) {
const... |
<filename>javatests/dagger/functional/assisted/AssistedFactoryParameterizedTest.java
/*
* Copyright (C) 2020 The Dagger 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
*
* htt... |
<gh_stars>0
/**
* Copyright 2018 hubohua
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by ap... |
#!/bin/bash
args="files/lab1/task5-matrix.txt files/lab1/task5-vector.txt"
kotlin -classpath target/classes at.doml.anc.lab1.MainKt $@ ${args}
|
<filename>spring-petclinic-cdk8s-config/src/main/java/imports/k8s/CsiNode.java<gh_stars>1-10
package imports.k8s;
/**
* CSINode holds information about all CSI drivers installed on a node.
* <p>
* CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar co... |
<reponame>acoshift/session<gh_stars>1-10
package main
import (
"fmt"
"net/http"
"time"
"github.com/moonrhythm/session"
"github.com/moonrhythm/session/store"
)
func main() {
h := session.New(session.Config{
Store: new(store.Memory),
HTTPOnly: true,
Secret: []byte("supersalt"),
Keys: [][]byte{[]... |
#!/bin/bash
#
# Reverse proxy needs to deploy last in order for nginx
# to be able to resolve the DNS domains of all the services
# at startup.
# Unfortunately - the data-portal wants to connect to the reverse-proxy
# at startup time, so there's a chicken-egg thing going on, so
# will probably need to restart the dat... |
#!/bin/bash
# Copyright 2017-2020 Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
set -o xtrace
set -o errexit
set -o pipefail
set -o nounset
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root_dir="$(git rev-parse --show-toplevel)"
cd "${root_dir}"
image="docker.io/cilium/cilium-builder-dev"
... |
<reponame>1Mathias/PublicNLPA
from sklearn.feature_extraction.text import TfidfVectorizer
import pandas as pd
# importing the modules
from IPython.display import display
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
docs = ["የኢትዮጵያ ቤት ኪንግ ፕሪሚዬር ... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-HPMI/model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-HPMI/512+0+512-ST-first-256 --do_eval --per_device_eval_... |
#!/bin/sh
# Authors: Cedric Halbronn <cedric.halbronn@sogeti.com>
# TAGS: Android, Device, HTC One, fastboot
#
# Bus 001 Device 002: ID 0bb4:0ff0 HTC (High Tech Computer Corp.)
# Commands below gives you: /dev/ttyUSB0
modprobe usbserial -r
modprobe usbserial vendor=0xbb4 product=0xff0
|
#!/bin/bash
DIR0=$(dirname $0)
echo "DIR0=$DIR0"
EXTERNAL_HOST=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
$(which python3.9) $DIR0/scripts/set_external_hosts.py $(pwd) $EXTERNAL_HOST
#docker-compose up -d
docker stack deploy -c docker-compos... |
<filename>flyway-core/src/main/java/com/googlecode/flyway/core/migration/Migration.java
/**
* Copyright (C) 2010-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy o... |
'use strict';
CostControlApp.init();
|
#! /bin/bash
#SBATCH -o /home/martin/workspace/sweet/benchmarks/rexi_tests_lrz_freq_waves/2015_12_27_scalability_rexi_fd/run_rexi_fd_par_m0128_t002_n0128_r0224_a1.txt
###SBATCH -e /home/martin/workspace/sweet/benchmarks/rexi_tests_lrz_freq_waves/2015_12_27_scalability_rexi_fd/run_rexi_fd_par_m0128_t002_n0128_r0224_a1.... |
<gh_stars>0
import { User } from './user'
import { Action } from './action'
export interface Message {
from?: User
nickname?: String
message?: String
action?: Action
token: String
}
|
def sum(k, n):
sum = 0
for i in range(k, n+1):
sum += float(i)
return sum |
<reponame>mfunkie/react-native-swiper
'use strict';
jest
.autoMockOff()
.mock('../../lib/declareOpts')
.mock('fs');
var fs = require('fs');
var AssetServer = require('../');
var Promise = require('bluebird');
describe('AssetServer', function() {
pit('should work for the simple case', function() {
var ser... |
#!/usr/bin/env bash
set -eo pipefail
# kogito-runtimes, optaplanner. kogito-examples or optaplanner-quickstarts
REMOTE_POM=$1
REMOTE_POM_VERSION=$2
MODULE=$3
if [ -z "${REMOTE_POM}" ]; then
echo "Please provide a remote pom to compare with (groupId:artifactId)"
echo 1
fi
if [ -z "${REMOTE_POM_VERSION}" ]; then
... |
#!/bin/bash
#
# Thie script runs a full test of our Snowdrift functionality.
#
# AFAIK, testing frameworks for bash don't really exist, so
# I'm gonna have to improvise here.
#
# Errors are fatal
set -e
#
# Define ANSI for our colors (and turning off the color)
#
RED="\033[0;31m"
GREEN="\033[0;32m"
NC="\033[0m"
FIL... |
public class Rectangle
{
// fields
private int width;
private int height;
// constructors
public Rectangle(int width, int height)
{
this.width = width;
this.height = height;
}
public Rectangle()
{
this.width = 0;
this.height = 0;
}
// methods
public int area()
{
return this.width * this.heigh... |
package handler
import (
"errors"
"io"
"io/ioutil"
"log"
"net/http"
"github.com/xeipuuv/gojsonschema"
"github.com/sand8080/d-data-transfer/internal/validator"
)
type Processor func(data []byte) *Response
type JSONHandler struct {
url string
schema *gojsonschema.Schema
processor Processor
}
func... |
source /opt/intel/openvino_2021/bin/setupvars.sh
cd Modules/object_detection_yolov5openvino
python3 yolo_openvino.py -m weights/yolov5s.xml -i cam -at yolov5
|
<reponame>dogballs/battle-city
import { Subject } from '../core';
import {
LevelEnemyDiedEvent,
LevelEnemyExplodedEvent,
LevelEnemyHitEvent,
LevelEnemySpawnCompletedEvent,
LevelEnemySpawnRequestedEvent,
LevelMapTileDestroyedEvent,
LevelPlayerDiedEvent,
LevelPlayerSpawnCompletedEvent,
LevelPlayerSpawn... |
#!/bin/bash
#
# Usage:
# ./run.sh <function name>
set -o nounset
set -o pipefail
set -o errexit
# Naive solution
mult-inherit() {
g++ -o mult-inherit mult-inherit.cc
./mult-inherit
}
# Tried to fix it but I don't understand what went wrong
virtual() {
g++ -o virtual virtual.cc
./virtual
}
# After doing Py... |
import discord #run pip install discord.py command in your terminal
import asyncio
bot = discord.Bot(prefix="!")
bot.command(aliases=["kek", "kek_command"])
async def kekw(ctx):
await ctx.message.reply("<:KEKW:850745103215231036> Are you sure you want to KEK the server?", mention_author = True)
def check(m)... |
<reponame>developit/dom-benchmark<gh_stars>1-10
import "./App.css";
import "./buttons.css";
import React, { Component, Fragment } from "react";
import GitHubForkRibbon from "react-github-fork-ribbon";
import ReactBenchmark from "./benchmarks/ReactBenchmark";
import VanillaBenchmark from "./benchmarks/VanillaBenchmark... |
package com.boot.feign.log.fallback;
import com.boot.feign.log.fallback.impl.LoginLogFallbackFeignImpl;
import com.boot.pojo.LoginLog;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springfr... |
<filename>zod-lib/sensitive-service/sensitive-service-app/src/main/java/com/infamous/framework/sensitive/service/SaltedPasswordEncryptor.java<gh_stars>0
package com.infamous.framework.sensitive.service;
import com.infamous.framework.sensitive.core.MessageDigestAlgorithm;
import java.security.SecureRandom;
public clas... |
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import java.util.List;
public class ItemService {
private SqlSessionFactory factory;
// Constructor to initialize the SqlSessionFactory
public ItemService(SqlSessionFactory factory) {
this.factory = fa... |
#!/usr/bin/env bash
# GDPR
#
# How to install:
# $ sudo cp $THISFILE /etc/cron.daily/mlpvc-rr
# $ sudo chmod +x /etc/cron.daily/mlpvc-rr
# $ sudo editor /etc/cron.daily/mlpvc-rr
# Change path (no trailing slash)
SCRIPTS_DIR="/path/to/scripts"
if [ ! -d "$SCRIPTS_DIR" ]; then
>&2 echo "$SCRIPTS_DIR is not a folder"
... |
#!/usr/bin/env bash
set -euo pipefail
GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
git checkout $GIT_BRANCH
echo "On branch $GIT_BRANCH."
# Only push on human pull request branches. Exclude release, prerelease, and bot branches.
if [ "$GIT_BRANCH" != "stable" ] && [ "$GIT_BRANCH" != "next" ] && [[ "$GIT_BRANCH" != dep... |
<reponame>handsomekuroji/handsomekuroji-gatsby
import React from 'react'
import { useStaticQuery, graphql } from 'gatsby'
import styled from 'styled-components'
import small from '~src/images/main/logo-small.svg'
const Wrapper = styled.div`
amp-img {
height: auto;
vertical-align: bottom;
width: 100%;
}... |
#!/bin/bash
echo "Are you sure to install the discord bot here? " && pwd
echo "Type yes or no"
read userinput
if [ "$userinput" = "yes" ]
then
echo "Starting the ínstaller"
file="discord/tecobot/index.js"
if [ -f "$file" ]
then
clear
echo "$file allready exists."
echo "Do you w... |
const server = require("./server");
const secrets = require("./secrets.js");
const PORT = secrets.PORT;
server.listen(PORT, () => {
console.log(`listening on port ${PORT}`);
});
|
package org.para.file.execute;
import org.para.file.FileParallelExecute;
/**
*
* @author liuyan
* @Email:<EMAIL>
* @version 0.1
* @Date: 2013-8-26
* @Copyright: 2013 story All rights reserved.
*/
public class ByteFileParallelExecute extends FileParallelExecute {
}
|
function generateMenuMarkup(menuItems) {
let markup = '<ul>';
menuItems.forEach(item => {
markup += `<li><a href="#${item.itemKey}"><i class="${item.itemIcon}"></i>${item.linkText}</a></li>`;
});
markup += '</ul>';
return markup;
}
// Example usage
const menuItems = [
{
itemKey: MenuItem.Informatio... |
<gh_stars>1-10
var assert = require('assert');
var artCli = require('..');
var plugins = new artCli.plugins();
describe('Plugins Tests', function () {
beforeEach(function () {
function sleep(delay) {
var start = new Date().getTime();
while (new Date().getTime() < start + delay);
... |
<gh_stars>1000+
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain ... |
/* Routine optimized for shuffling a buffer for a type size of 2 bytes. */
static void
shuffle2_neon(uint8_t* const dest, const uint8_t* const src,
const size_t vectorizable_elements, const size_t total_elements)
{
size_t i, j, k;
static const size_t bytesoftype = 2;
uint8x16x2_t r0;
for(i = 0, k... |
#!/usr/bin/env python
"""
Amazon Fire TV server
RESTful interface for communication over a network via ADB
with Amazon Fire TV devices with ADB Debugging enabled.
From https://developer.amazon.com/public/solutions/devices/fire-tv/docs/connecting-adb-over-network:
Turn on ADB Debugging:
1. From the main (Launche... |
<gh_stars>0
import React, { Component } from 'react';
import './CartDisplay.css'
export default class CartDisplay extends Component {
handleChange(index, event) {
let fieldName = this.props.productDetails.templateFields.fieldlist.field[index].fieldname;
let templateData = [...this.props.templateDa... |
<gh_stars>10-100
package com.justinblank.strings.Search;
import java.util.Collection;
import java.util.List;
public final class SearchMethods {
private SearchMethods() {}
public static SearchMethod makeSearchMethod(Collection<String> strings) {
if (strings.isEmpty()) {
throw new IllegalA... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
package test
import (
"context"
"os"
"sort"
"testing"
"time"
"github.com/ChainSafe/fil-secondary-retrieval-markets/cache"
"github.com/ChainSafe/fil-secondary-retrieval-markets/client"
"github.com/ChainSafe/fil-secondary-retrieval... |
#!/bin/bash
# ----------------------------------------------------------------
# Continue from or start run based on xml files in directory <origin>
# Put new run in <origin>/<dest>
# ----------------------------------------------------------------
echo "--------------------------------------------"
if [ $# -lt ... |
package com.github.starter.grpc.server;
import io.grpc.stub.StreamObserver;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.function.Function;
public class StreamObserverAdapter<I, O> {
public StreamObserverAdapter(Mono<I> input, StreamObserver<O> streamObserver, Functio... |
<gh_stars>0
/** Represents the base object. Most structures in Derun takes from this class. */
export class BaseStructure {
constructor(id: string) {
this.id = id
}
readonly id
get createdAt() {
return Math.floor(Number(this.id) / 4194304) + 1420070400000
}
toString() {
... |
package gov.cms.bfd.pipeline.bridge.util;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.RequiredArgsConstructor;
imp... |
import { configLoader } from './configLoader';
import { run } from './pipeline';
import { pipelineFactory } from './pipelineFactory';
import { initCompilers } from './utils';
const pipeline = pipelineFactory.create('Sample Pipeline');
pipeline.args.pipelineArg0 = 'pipelineArg0';
pipeline.addProcessor({
name:... |
import React from 'react';
import {
StyleSheet,
View,
Text,
TextInput,
Button
} from 'react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
location: '',
temperature: 0,
pressure: 0,
humidity: 0
};
this.getWeatherInfo = this.getWeatherInfo.bin... |
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
debora open "[::]:46661"
debora --group default.upgrade status
printf "\n\nShutting down barak default port...\n\n"
sleep 3
debora --group default.upgrade close "[::]:46660"
debora --group default.upgrade run -- bash -c "cd \$GOPATH/src/github.com/bdc/bdc; git pull origin deve... |
<reponame>hyperpape/needle
package com.justinblank.strings.Search;
import com.justinblank.strings.MatchResult;
import com.justinblank.strings.Matcher;
import java.util.Objects;
public class SearchMethodMatcher implements Matcher {
private final SearchMethod method;
private final String s;
public Search... |
def factorial(n):
if n == 0:
return 1
return n * factorial(n-1)
num = 9
factorial_num = factorial(num)
print(factorial_num) |
#!/bin/bash
STATUS=`su -p oracle -c "echo \"SELECT CASE WHEN count(*) > 0 THEN 'REA'||'DY' ELSE 'STARTING' END as status FROM dba_tablespaces WHERE tablespace_name = 'FIDDLEDATA';\" | sqlplus system/password as sysdba" | grep READY`
if [ "$STATUS" != "READY" ]
then
echo "Not started yet"
exit 1
fi
CAPACITY=`su ... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 15:07:16 2017
@author: <NAME>
"""
from __future__ import division, print_function, unicode_literals, absolute_import
import unittest
import sys
sys.path.append("../../sidpy/")
from sidpy.base.string_utils import *
if sys.version_info.major == 3:
unicode = str
c... |
select yn in "Yes" "No"; do
case $yn in
Yes ) adb shell settings put system show_rounded_corners 1 && exit; break;;
No ) adb shell settings put system show_rounded_corners 0 && exit;;
esac
done |
#!/usr/bin/env bash
VERSION=4.4.0
docker build -t mitct02/weewx:$VERSION .
docker push mitct02/weewx:$VERSION
docker tag mitct02/weewx:$VERSION mitct02/weewx:latest
docker push mitct02/weewx:latest
|
#include"stdafx.h"
#include <iostream>
#include<cstdio>
#include<algorithm>
#include<random>
#include<math.h>
#include<vector>
#include<time.h>
#include<string.h>
#include<set>
#define NUM 5
using namespace std;
//method1: enumeration--O(4^N)
//这个算法不用担心元素重复的问题。
void closest_subset_e(int *dat,int N,int &res,int half_s... |
export interface IStack<T> {
readonly Count: number;
Clear(): void;
Contains(item: T): boolean;
Peek(): T;
Pop(): T;
Push(item: T): void;
}
|
import BN from 'bn.js';
import React from 'react';
import { I18nProps } from '@polkadot/ui-app/types';
import translate from './translate';
import Details from './Details';
type Props = I18nProps & {
match: {
params: {
id: string
}
}
};
type State = {};
export class Component extends React.PureCom... |
#!/bin/bash
set -eu
# VARS EVAL.
TAG_TO_DEPLOY=$(eval echo "$TAG")
JIRA_TOKEN=$(eval echo "$JIRA_AUTH_TOKEN")
# Determine acquia environment, since acsf user/keys are per env.
get-acquia-key() {
local ACQUIA_KEY
if [[ -n ${ACQUIA_KEY_DEV} && -n ${ACQUIA_KEY_TEST} ]]; then
case "$ACSF_ENV" in
dev)
... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getShapeType = void 0;
var util_1 = require("util");
/**
* @ignore
* 从图形数据中获取 shape 类型
* @param shapeCfg
* @param defaultShapeType
* @returns
*/
function getShapeType(shapeCfg, defaultShapeType) {
var shapeType = defaultShape... |
#!/bin/bash
# Configure this part
mydaemon=httpd
# Derived, but also configurable
outfile=/tmp/check.${mydaemon}
pidfile=/var/run/${mydaemon}/${mydaemon}.pid
# Bookkeeping
mypid=$$
myname=$0
mydir=`dirname ${myname}`
# Import node-specific configuration
if [ ! -f ${mydir}/check.config.sh ]
then
echo ${mydir}/ch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.