text stringlengths 1 1.05M |
|---|
<filename>packages/ds-csv/test/csv.test.ts
import { generate, SkimahConfig } from "@skimah/api";
import { graphql } from "graphql";
import CSVSource from "../src/csv";
const typeDefs = `
type Album @datasource(name: "albums") {
id: ID @named(as: "AlbumId")
title: String @named(as: "Title")
artist: Artis... |
<reponame>matheusvmg/CRUD_nodeJS_mongoDB
const express = require('express')
const atualizarUsuarios = express.Router()
const usuariosSchema = require('../model/schema')
//atualiza um usuário
atualizarUsuarios.put('/atualizar-usuario/:id', async(req, res) => {
try{
const usuarioAtualizado = await usu... |
package sds
import (
"encoding/hex"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/stratosnet/stratos-chain/x/sds/keeper"
"github.com/stratosnet/stratos-chain/x/sds/types"
)
// NewHandler ...
func NewHandler(k keeper.Keeper) sdk.Handler {
return... |
package api
import "github.com/aquasecurity/trivy/pkg/module/serialize"
const (
Version = 1
ActionInsert serialize.PostScanAction = "INSERT"
ActionUpdate serialize.PostScanAction = "UPDATE"
ActionDelete serialize.PostScanAction = "DELETE"
)
type Module interface {
Version() int
Name() string
}
type Analyzer ... |
#!/usr/bin/env bash
# Update client repository
git pull origin master
# Build parent-app-web
yarn install
yarn run build
# Prepare client_build
if [ -e client_build ]
then
cd client_build
git pull origin master
cd ..
else
git clone https://github.com/DanbiEduCorp/client_build.git
fi
# Update builds
... |
<filename>soluciones/Mundo_Animal_Herencia_JARS/src/es/jeremyramos/Main.java<gh_stars>1-10
package es.jeremyramos;
import es.jeremyramos.Clases.Gatos;
import es.jeremyramos.Clases.Perros;
public class Main {
public static void main(String[] args) {
Perros doberman = new Perros();
Gatos faraon = n... |
package depth_first_search;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.InputMismatchException;
/**
*
* @author minchoba
* 백준 16437번: 양 구출 작전
*
* @see https://www.acmicpc.net/problem/16437/
*
*/
public class Boj16437 {
public static void main(String[]... |
public class Program
{
public static void Main(string[] args)
{
int[] arr = {2, 3, 6, 5, 4, 2, 1, 5};
int max = arr[0];
List<int> indexList = new List<int>();
for (int i = 0; i < arr.Length; i++)
{
if (arr[i] > max)
{
max = arr[i];
... |
<gh_stars>0
let dashboard = {
initialize: function() {
dashboard.getIp();
dashboard.getTimestamp();
},
getIp: function() {
dashboard.request('/api/network/ip', '.showIp');
},
getTimestamp: function() {
dashboard.request('/api/system/timestamp', '.showTimestamp');
... |
#-*- coding: utf-8 -*-
#!/usr/bin/env bash
echo "--- STARTING UP SERVER ---"
sudo service elasticsearch start
#PATH=~/home/vagrant/.rvm/gems/ruby-2.3.3@openfarm/bin/:$PATH
source /home/vagrant/.rvm/scripts/rvm
rvm reload
ELASTICSEARCH_URL='http://127.0.0.1:9201'
sleep 10
cd /vagrant
# bundle install
rails s -d -... |
func fibonnaci(numTerms: Int) -> Int {
if numTerms < 2 {
return numTerms
}
return(fibonnaci(numTerms: numTerms-1) + fibonnaci(numTerms: numTerms-2))
}
for i in 0...10 {
print(fibonnaci(numTerms: i))
} |
/*
* Copyright 2013 <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 w... |
def factorial(n):
result = 1
while n > 1:
result *= n
n -= 1
return result |
<reponame>magma/fbc-js-core
/**
* Copyright 2020 The Magma Authors.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distri... |
<gh_stars>0
"""
Graph class, takes number of cities, edges listed as an adjacency matrix, and the colors of each node. We can find a node which returns the color and the edges of a node n returned as a tuple
"""
class Graph(object):
def __init__(self, numCities, edges, colors):
self.numCities = nu... |
<filename>src/main/java/cn/gobyte/apply/utils/poi/convert/ExportConvert.java
package cn.gobyte.apply.utils.poi.convert;
/**
* TODO: 出口转换
*
* @author shanLan <EMAIL>
* @date 2019/4/7 13:18
*/
public interface ExportConvert {
String handler(Object val);
}
|
<reponame>duckie/boson
#include <algorithm>
#include <random>
#include <vector>
#include "boson/event_loop.h"
#include "boson/memory/sparse_vector.h"
#include "catch.hpp"
TEST_CASE("Sparse vector - Allocation algorithm", "[memory][sparse_vector]") {
constexpr size_t const nb_elements = 1e2;
std::random_device seed... |
export {
BotInfoCommands,
ConfigurateCommands,
CoreCommands,
VoiceCommands,
defineConfCommandSchema,
defineConfigurateCommandSchema,
defineCoreCommandSchema,
definedBotInfoCommandSchema,
definedVoiceCommandSchema,
schemaTextSupplier,
} from "./bootstrap";
export {
usageFromSchema,
usageBodyFromS... |
from bs4 import BeautifulSoup
import requests
from urllib.parse import urljoin
def extract_unique_urls(html_content):
soup = BeautifulSoup(html_content, 'html.parser')
anchor_tags = soup.find_all('a')
urls = set()
for tag in anchor_tags:
href = tag.get('href')
if href and href.startswit... |
<filename>server/pm2.ecosystem.config.js
module.exports = {
apps: [
{
name: "nothingbookapi",
script: "./server/index.js",
watch: false,
ignore_watch : [ "../logs/*", "../node_modules","../.git", "../uploads/*","../audio/*", "../private/files/**/*", "../private/imgs/**/*" ],
env_deve... |
/*
* Copyright 2012-2013 <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... |
#!/bin/sh
cd "`dirname $0`"
DIR="/var/www/html/devices"
TS="`date +'%Y%m%d-%H'`"
FILE="${DIR}/data/bidmc-cros-${TS}.json"
curl --noproxy '*' -k https://localhost:3333/crosby/devices -o "${FILE}" &> /dev/null
[ -f "${FILE}" ] || exit 1
[ -s "${DIR}/data/latest.json" ] && rm -f "${DIR}/data/latest.json"
ln -s "${FILE}... |
#!/bin/bash
cd crypto-cpp
mkdir -p build/Release
CMAKE_CXX_COMPILER="g++"
IFS='-' read -r -a TARGET_ARR_WRONG_ORDER <<< "$PLAT"
SYS_V="${TARGET_ARR_WRONG_ORDER[1]}"
TARGET_ARCH="${TARGET_ARR_WRONG_ORDER[2]}"
if [ "$(uname)" == "Darwin" ]; then
TARGET_TRIPLET="${TARGET_ARCH}-apple-macos${SYS_V}"
if [[ "$(una... |
var gdgApp = angular.module('gdgApp', []);
gdgApp.controller('GDGData', ['$scope', '$sce', '$http', function ($scope, $sce, $http) {
$scope.renderHtml = function (htmlCode) {
return $sce.trustAsHtml(htmlCode);
};
$scope.gdgData = {"id": PLUS_ID};
$http.get('gdg-info.json').then(function(res){
... |
package fr.syncrase.ecosyst.web.rest;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import fr... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import math
from torch.utils.data import Dataset
def split_list(list_to_split, target_n, result):
if (len(list_to_split) / target_n) % 1 == 0:
n = int(len(list_to_split) / target_n)
# print(n)
i = 0
while i < len(list_to_split):
... |
<reponame>naq219/Telpoo-framework
package com.telpoo.example.activity;
import java.util.ArrayList;
import java.util.List;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import com.example.testframework.R;
import... |
// *******************************************************************************
// © The Pythian Group Inc., 2017
// All Rights Reserved.
// *******************************************************************************
import {defineProcessEnv} from "./helpers/bootstrap";
defineProcessEnv();
// base package
exp... |
<reponame>SenthilKumarGS/TizenRT
/*
* //******************************************************************
* //
* // Copyright 2016 Samsung Electronics All Rights Reserved.
* //
* //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
* //
* // Licensed under the Apache License, Version 2.0 (the "Lic... |
#export BA="org/armedbear/lisp|org/armedbear/lisp"
export BA="org/armedbear/lisp|org/armedbear/lisp"
find src/ -name "*.java" -printf "%p\n" -exec sed -e "s|$BA|g" -i {} \;
find src/ -name "*.lisp" -printf "%p\n" -exec sed -e "s|$BA|g" -i {} \;
#find ! -name "*.*" -type f -printf "%p\n" -exec sed -e "s|$BA|g" -i {} ... |
<filename>dist/lib/fieldsMap.js
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldsMap = void 0;
const w3cdate_1 = require("./w3cdate");
class FieldsMap extends Map {
/**
* Returns Map as array of objects with key moved inside like a key property
*/
toJSON() {
... |
class HelloWorld:
def __init__(self):
print(“Hello World”) |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-SS/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-SS/1024+0+512-STG-1 --do_eval --per_device_eval_batch_... |
$(document).ready(function() {
//Array type/class of filters
var filters = [
"saturate",
"saturotate",
"rotamatrix",
"tablen",
"dishue",
"matrix",
"matrix-dos",
"huerotate",
"luminance",
"discrete",
"discrete-dos",
... |
# oh-my-zsh custom config
# 初始定义系统常量
# 调用示例:
# 1、 [ -n "$OS_MAC" ] && XXX
# 2、 if [ -n "$OS_MAC" ]; then
# XXX
# fi
OS=$(echo $(uname) | tr '[:upper:]' '[:lower:]')
[ "$OS" = "windowsnt" ] && OS_WIN="yes"
[ "$OS" = "darwin" ] && OS_MAC="yes"
[ "$OS" = "linux" ] && OS_LIN="yes"
# root path
SOMEOK_ZSH=${0:A:... |
#!/bin/bash
set -e
source $(dirname $0)/common.sh
buildName=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.name' )
buildNumber=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.number' )
version=$( cat artifactory-repo/build-info.json | jq -r '.buildInfo.modules[0].id' | sed 's/.*:.*:\(.*\)/\1/... |
package indi.nut.myspring.ioc.aop;
import java.lang.reflect.Method;
/**
* method matcher, 确定一个方法是否匹配一定的规则<br/>
* Created by nut on 2016/12/14.
*/
public interface MethodMatcher {
boolean matches(Method method, Class targetClass);
}
|
<html>
<head>
<title>Login Page</title>
</head>
<body>
<h1>Login Page</h1>
<form action="#" method="post">
Username: <input type="txt" name="username"/><br/>
Password: <input type="password" name="password"/><br/>
<input type="submit" value="Login"/><br/>
</form>
<div>
... |
<filename>test/integration/wallet-test.js
/* eslint-env mocha */
/* eslint prefer-arrow-callback: "off" */
'use strict';
const assert = require('../util/assert');
const bcoin = require('bcoin');
const {Network} = bcoin;
const {hd} = bcoin;
const MultisigClient = require('bmultisig-client');
const {WalletClient} = r... |
#!/usr/bin/env zsh
# Modified from https://github.com/robbyrussell/oh-my-zsh/blob/master/tools/check_for_upgrade.sh
# Original Copyright: (c) 2009-2018 Robby Russell and contributors
# Modified Copyright: (c) 2018 David Todd (c0de)
# License: MIT
zmodload zsh/datetime
function _current_epoch() {
echo $(( $EPOCHSECO... |
define([], function() {
var eventList = [
{
id: 1,
title: "Christmas Eve 2017",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ul... |
#!/bin/bash
set -eux -o pipefail
which go-junit-report || go install github.com/jstemmer/go-junit-report@latest
TEST_RESULTS=${TEST_RESULTS:-test-results}
TEST_FLAGS=
if test "${ARGOCD_TEST_PARALLELISM:-}" != ""; then
TEST_FLAGS="$TEST_FLAGS -p $ARGOCD_TEST_PARALLELISM"
fi
if test "${ARGOCD_TEST_VERBOSE:-}" != ""; ... |
# shellcheck shell=bash
# shellcheck source=../../themes/powerline/powerline.base.bash
. "$BASH_IT/themes/powerline/powerline.base.bash"
PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""}
POWERLINE_LEFT_SEPARATOR_SOFT=${POWERLINE_LEFT_SEPARATOR_SOFT:=""}
POWERLINE_LEF... |
#!/bin/bash
aws cloudformation create-stack --stack-name monitoring-windows-ec2 \
--template-body file://monitoring-windows-ec2.yaml \
--capabilities CAPABILITY_NAMED_IAM \
--parameters file://monitoring-windows-ec2-parameters.json \
--region us-east-1
|
<gh_stars>1-10
package cfg.serialize.exceptions;
import code.math.NumberSystemUtil;
@SuppressWarnings("serial")
public class SheetDataException extends Exception {
// 列
private int col;
// 行
private int row;
/**
* 记录列索引
*
* @param col
* 索引号
*/
public void setCol(int col) {
this.col = c... |
#!/bin/sh
#
# Downloads sequence for the GRCm38 release 81 version of M. Musculus (mouse) from
# Ensembl.
#
# By default, this script builds and index for just the base files,
# since alignments to those sequences are the most useful. To change
# which categories are built by this script, edit the CHRS_TO_INDEX
# var... |
export SODIUM_USE_PKG_CONFIG=1
|
<gh_stars>10-100
from autocnet.io.db import adapters # imported here to get these registered
|
<filename>NetListener/httpcapture/src/main/java/org/littleshoot/proxy/mitm/Authority.java
package org.littleshoot.proxy.mitm;
import android.os.Environment;
import java.io.File;
/**
* Parameter object holding personal informations given to a SSLEngineSource.
*
* XXX consider to inline within the interface SslEng... |
def generate_docker_push_command(image_name: str) -> str:
# Check if the image name is in the correct format
if "/" in image_name:
return f'docker push {image_name}'
else:
raise ValueError("Invalid image name format. Please provide the image name in the format 'repository/image_name'.") |
<reponame>MrPepperoni/Reaping2-1
#ifdef DEFINE_GUID
#ifndef _WINIOCTL_DEFINED_GUID_
#define _WINIOCTL_DEFINED_GUID_
#include_next <winioctl.h>
#endif // _WINIOCTL_DEFINED_GUID_
#else
#include_next <winioctl.h>
#endif // DEFINE_GUID
|
def third_smallest(nums):
nums.sort()
return nums[2] |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const eventemitter3_1 = __importDefault(require("eventemitter3"));
const iterall_1 = __importDefault(req... |
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class LinkedListaInt implements Iterable<Integer> {
private NodoInt first;
static class NodoInt {
public int info;
public NodoInt next;
public NodoInt(int value) ... |
package com.univocity.envlp.wallet.persistence.model;
import java.time.*;
public class AddressAllocation {
private long walletId;
private long accountIndex;
private long derivationIndex;
private String paymentAddress;
private boolean available;
private LocalDateTime createdAt;
private LocalDateTime claimedAt;... |
#!/bin/bash
# The only case where this script would fail is:
# mkfs.vfat /dev/mmcblk1 then repartitioning to create an empty ext2 partition
DEF_UID=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
DEF_GID=$(grep "^GID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
DEVICEUSER=$(getent passwd $DEF_... |
<reponame>Htaung/open_location_code_master
// Copyright 2015 <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 obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
... |
package org.ednovo.gooru.core.api.model;
import java.io.Serializable;
public class AssessmentHint implements Serializable,Comparable<AssessmentHint> {
/**
*
*/
private static final long serialVersionUID = 5773944979028571352L;
private Integer hintId;
private String hintText;
private Integer sequence;
... |
<gh_stars>0
/*
* Copyright 2011 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 of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... |
package main
import (
"fmt"
"os"
"time"
"github.com/stigok/go-io-pi"
)
func main() {
path := "/dev/i2c-1"
file, err := os.OpenFile(path, os.O_RDWR, os.ModeCharDevice)
if err != nil {
panic(err)
}
dev := iopi.NewDevice(file, 0x20) // Bus1: 0x20, Bus2: 0x21
err = dev.Init()
if err != nil {
panic(err)
... |
/*
Copyright 2018 The Knative 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
Unless required by applicable law or agreed to in writing, softw... |
<?php
$arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
$new_arr = array_slice($arr, 2, 5);
print_r($new_arr);
?> |
<gh_stars>100-1000
import { v4 as uuidv4 } from 'uuid';
export class Job {
/**
* Create a new job instance.
*/
constructor(public id: string = uuidv4(), public data: { [key: string]: any; } = {}) {
//
}
}
|
#!/usr/bin/env bash
# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here
# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent
# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also
# benefit from... |
TERMUX_PKG_HOMEPAGE=https://pidgin.im/
TERMUX_PKG_DESCRIPTION="Multi-protocol instant messaging client"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
TERMUX_PKG_VERSION=2.14.4
TERMUX_PKG_SRCURL=https://sourceforge.net/projects/pidgin/files/Pidgin/${TERMUX_PKG_VERSION}/... |
def removeFromList(list_nums, value):
result = []
for num in list_nums:
if num != value:
result.append(num)
return result |
<?php
function convertBase($number, $base1, $base2) {
$base1_digits = "0123456789ABCDE";
$base2_digits = "0123456789ABCDE";
$result = "";
while($number > 0) {
$result = substr($base2_digits, $number % $base2, 1) . $result;
$number = (int) ($number / $base2);
}
return $result;
}
$number = 10;
$base1 = 10... |
#!/usr/bin/env bash
[ -n "$DEBUG" ] && set -x
set -e
set -o pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PROJECT_DIR="$( cd "$SCRIPT_DIR/../../.." && pwd )"
cd "$PROJECT_DIR"
set +e
openssl aes-256-cbc \
-d \
-in ./.circleci/gpg.private.enc -k "${ENCRYPTION_PASSPHRASE}" | gpg --im... |
package cyclops.stream.iterator;
import cyclops.reactive.ReactiveSeq;
import cyclops.stream.type.Streamable;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
public class ReversedIterator<U> implements Streamable<U> {
private final List<U> list;
public ReversedIterator(List<U... |
#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
FLOW=$(pwd -P)/$1
else
FLOW=$(readlink -f $1)
fi
cd "$(dirname "${BASH_SOURCE[0]}")"
passed=0
failed=0
skipped=0
for dir in tests/*/
do
dir=${dir%*/}
cd $dir
name=${dir##*/}
exp_file="${name}.exp"
if [ -e ".flowconfig" ] && [ -e $exp_file ]
t... |
<gh_stars>0
package servlets;
import db.DBManager;
import db.Product;
import db.User;
import java.io.IOException;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpS... |
/*
*
*/
package net.community.chest.jmx;
import javax.management.ObjectName;
import net.community.chest.lang.StringUtil;
/**
* <P>Copyright as per GPLv2</P>
* @author <NAME>.
* @since Feb 15, 2011 9:05:43 AM
*/
public class CanonicalObjectNameComparator extends AbstractObjectNameComparator {
/**
*
... |
import React from 'react';
import { ChildrenItem } from '@/pages/List/components/SideTree';
import { Dropdown, Icon, Menu } from 'antd';
import styles from './style.less';
interface FileItemPropsType {
item: ChildrenItem
}
export default function FileItem({ item }: FileItemPropsType) {
const renderContent = () =... |
#!/bin/bash
# Author: SandersSoft (c) 2020
# HEBitBar-V2
# https://raw.githubusercontent.com/KurtSanders/HEBitBarApp-V2/master/installation/HEBitBarInstall.command
version="4.04"
echo "HEBitBar-V2 Installer/Upgrader (c) SanderSoft"
echo "============================================="
echo "Version ${version}"
# Begin... |
from typing import List, Tuple, Dict
import database # Assume the existence of a database connection and necessary querying functions
def get_active_orders(table: int) -> List[Dict[str, str]]:
active_orders = database.query("SELECT item_name, quantity, additional_details FROM orders WHERE table_number = ? AND sta... |
<gh_stars>100-1000
/**
* Tests child workflow termination from the parent workflow perspective
* @module
*/
import { WorkflowExecution } from '@temporalio/common';
import { startChild, defineQuery, setHandler } from '@temporalio/workflow';
import { unblockOrCancel } from './unblock-or-cancel';
export const childEx... |
#!/usr/bin/env bash
#
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8
if [[ $DOCKER_NAME_TAG == centos* ]]; then
export LC_ALL=en_US.utf8
fi
if [[ $QEM... |
#! /bin/bash
# Target VPN server, username, and password are kept in files.
export VPNHOST=$(cat ~/.config/meraki-vpn/default/hostname)
export USERNAME=$(cat ~/.config/meraki-vpn/default/username)
export PASSWORD=$(cat ~/.config/meraki-vpn/default/password)
mkdir -p /tmp/ipsec
envsubst < ipsec.conf > /tmp/ipsec/ipsec... |
import test from 'tape'
import factory from '../lib/factory'
test('factory creates Element classes with different ownerDocuments', function (t) {
const od1 = factory().Element.prototype.ownerDocument
const od2 = factory().Element.prototype.ownerDocument
t.plan(1)
t.notEqual(od1, od2)
})
test('factory creates ... |
<reponame>ArthurFDLR/LowLevel_NeuralNet<gh_stars>1-10
import numpy as np
import time
def Input(expr, op, args, **kwargs):
if op.name in kwargs:
c = kwargs[op.name]
if isinstance(c, (int, float)):
return float(c)
elif hasattr(c, "shape"):
return c.astype(fl... |
require 'spec_helper'
describe 'nfs::idmapd::client' do
context 'with default parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to create_class('nfs::idmapd::client') }
it { is_expected.to create_class('nfs::idmapd::config') }
it do
is_expected.to create_exec('enable_n... |
/*
* Copyright 2017 HugeGraph Authors
*
* 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, Ve... |
package services
import java.time.{Duration, LocalTime}
import domains.Lap
import org.scalatestplus.play.PlaySpec
import utils.JsonSerializers
class LapServiceSpec extends PlaySpec {
val service = new LapService()
"LapService" must {
"parse a lap log text to Lap" in {
val result = service.parse("01:59:... |
#!/bin/bash
# install mongodb via helm 3
helm --namespace default upgrade --install test-mongodb stable/mongodb -f values.yaml
|
The purpose of a hash algorithm is to map data of any size to a fixed length string of characters. This is often used to validate the integrity of a file or piece of data, as the resulting string is unique and produces the same result if the data is the same. Hash algorithms can also be used to encrypt and decrypt data... |
#!/usr/bin/env bash
# Usage:
# ./hack/release/bump_version.sh 0.8.0 0.8.1
oldv=$1
newv=$2
echo "old version: ${oldv}, new version: ${newv}"
sed -i.bak -e "s/${oldv}+git/${newv}/g" version/version.go
sed -i.bak -e "s/${oldv}/${newv}/g" example/deployment.yaml
sed -i.bak -e "s/${oldv}/${newv}/g" example/etcd-backup... |
<reponame>risq/radio
import transceiver from '../../src/transceiver';
import Channel from '../../src/channel';
const OriginalPromiseConstructor = transceiver.Promise;
const FakePromiseConstructor = () => {};
const channel = transceiver.channel('test');
const data = {
hello: 'world'
};
const cb = sinon.spy(() => {
... |
<reponame>sgkandale/garbage-lb
import React from 'react'
import { Typography } from '@mui/material'
export default function Test() {
return <Typography variant="body1" >
Test
</Typography>
} |
package no.mnemonic.commons.utilities;
import org.junit.Test;
import java.util.concurrent.atomic.LongAdder;
import static org.junit.Assert.*;
public class ObjectUtilsTest {
@Test
public void notNullReturnsValueOnNotNull() throws Exception {
Object value = new Object();
assertEquals(value, ObjectUtils.n... |
import { BaseTranslator, TranslateCtx } from 'ai18n-type';
import * as _fs from 'fs';
import * as _prompts from 'prompts';
export default class ManualTranslator extends BaseTranslator {
// for test mock
protected prompts = _prompts;
protected fs = _fs;
/** 平台翻译 */
protected async translatePlatform(ctx: Tran... |
<gh_stars>0
/**
* 登录检查中间件
* 用于在获取数据时标记登录与否
* 无论登录与否,都会调用下一个中间件!
*/
const jwt = require('jsonwebtoken')
const { webSecret } = require('../config')
const checklogin = async (ctx, next) => {
// 获取并处理请求头中的token
const token = String(ctx.request.headers.authorization || ' ').split(' ')[1]
// 验证token
awa... |
CUDA_VISIBLE_DEVICES=1 python ./tools/train_net_vov.py \
--config-file configs/vovnet/mask_rcnn_V_57_FPN_1x_3dce.yaml \
--num-gpus 1 SOLVER.IMS_PER_BATCH 2 \
DATALOADER.NUM_WORKERS 1
#VIS_PERIOD 10 |
<filename>web-utils/src/main/java/elasta/webutils/impl/JsonArrayRequestHandlerImpl.java
package elasta.webutils.impl;
import elasta.eventbus.SimpleEventBus;
import elasta.webutils.*;
import elasta.webutils.model.UriAndHttpMethodPair;
import io.vertx.core.eventbus.Message;
import io.vertx.core.json.JsonArray;
import io... |
<reponame>noear/solon_demo
package jobapp.controller;
import org.noear.solon.extend.cron4j.Cron4j;
import java.util.Date;
@Cron4j(cron5x = "*/1 * * * *")
public class Cron4jRun2 implements Runnable {
@Override
public void run() {
System.out.println("我是定时任务: Cron4jRun2(*/1 * * * *) -- " + new Date());... |
/*
*
*/
package net.community.chest.swing.component.label;
import javax.swing.Icon;
import javax.swing.JLabel;
import net.community.chest.awt.attributes.Iconable;
import net.community.chest.awt.attributes.Textable;
import net.community.chest.swing.component.scroll.HorizontalPolicy;
import net.community.chest.swing.... |
import React from 'react';
import { mount } from 'enzyme';
import renderer from 'react-test-renderer';
import Column from '.';
const element = <Column mobile={12}><span>Subcomponent</span></Column>;
const component = mount(element);
describe('Column', () => {
it('should render a column div', () => {
const tree ... |
import DataGrid from './DataGrid';
import SimpleDataGrid from './SimpleDataGrid';
import { COLUMN_TYPES } from './constants';
import { ColumnDefinition } from './types';
export { DataGrid, SimpleDataGrid, COLUMN_TYPES };
export type { ColumnDefinition };
|
package cn.zqgx.moniter.center.server.portal.core.annotaion;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Documented
@Target({ElementType.METHOD})
@Retention(Re... |
<reponame>dwimberger/censo
Template.Settings.helpers({
myId: function() {
return Meteor.userId();
},
botName: function() {
return Meteor.settings.public.botName;
},
telegramId: function() {
if(
Meteor.user() &&
Meteor.user().services &&
Meteor.user().services.telegram) {
... |
# -----------------------------------------------------------------------------
#
# Package : hpack.js
# Version : 2.1.6
# Source repo : https://github.com/indutny/hpack.js
# Tested on : RHEL 8.3
# Script License: Apache License, Version 2 or later
# Maintainer : BulkPackageSearch Automation <sethp@us.ibm.com>
#
# Disc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.