text stringlengths 1 1.05M |
|---|
<gh_stars>1-10
package io.ray.runtime.context;
import io.ray.api.id.ActorId;
import io.ray.api.id.JobId;
import io.ray.api.id.TaskId;
import io.ray.api.id.UniqueId;
import io.ray.runtime.generated.Common.Address;
import io.ray.runtime.generated.Common.TaskType;
/** The context of worker. */
public interface WorkerCon... |
import {Component} from 'react';
import C1 from './components/C1';
import C2 from './components/C2';
import C3Connected, {C3} from './components/C3';
export default class Container extends Component {
state = {
isEqual: false
};
componentDidMount() {
console.log(this.c2.refs.WrappedComponent);
cons... |
binaryArray.sort();
// binaryArray = [0, 0, 0, 0, 1, 1, 1, 1] |
<reponame>kc1116/http-sniffer
package figlet4go
import (
"errors"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
)
// Default font if no other valid given
const defaultFont string = "standard"
// Extension of a font file
const extension string = "flf"
// Builtin fonts to load
var defaultFonts []string =... |
#!/bin/bash
#
# Copyright (c) 2017-2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# This script will execute the Kata Containers Test Suite.
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
export RUNTIME="containerd-shim-kata-v2"
export CI_JOB="${CI_JOB:-default}"
case "${CI_JOB}" in
"BAR... |
package de.judgeman.H2SpringFx.Services;
import de.judgeman.H2SpringFx.Model.SettingEntry;
import de.judgeman.H2SpringFx.Repositories.SettingEntryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by <NAME> on Mon 30/03/2020
*/
@Se... |
const fs = require("fs");
const path = require("path");
const NodemonPlugin = require("nodemon-webpack-plugin");
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const paths = {
TS_CONFIG: path.resolve(fs.realpathSync(process.cwd()), "t... |
module Ehonda
class Configuration
class RedrivePolicyConfiguration
include Validatable
def initialize owner
@owner = owner
@enabled = false
@max_receive_count = 10
end
attr_accessor :enabled,
:max_receive_count,
:dead_letter... |
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts t... |
#!/bin/sh
pylint --reports=n --include-ids=y --disable=C0301,W0611,C0103,C0111,F0401,E0611,E1101,W0614,E0602,W0602,W0612,R0201,W0231,W0105,W0603,R0903,W0232,W0102,R0915,W0401,W0613,R0914,E0102,C0302,E1103,W0511,W0212,E0202,R0902,E1121,R0913,R0904,E1123,R0912,W0702,W0622,W0201 $1
|
<filename>app/home/db_router.py<gh_stars>0
from .models import (
# BIZ MODELS
TableCharts,
TableForecasts,
#DATA
HolidaysEventsModel,
OilModel,
SampleSubmissionModel,
StoresModel,
TestModel,
TrainModel,
TransactionsModel,
# MUS MODELS
TableSongs,
# VBT MODELS
... |
#-*- coding: utf-8 -*-
#2#::.. Last edit: - Fri Feb 16 13:38:13 EST 2018 - by: - steelalive - ..::## #_# - VERSION=0.0.0.7 - #_# #@#160218#@# #2#
#3#::..#####################_MAIN_#######################..::#3#
# Author: #
die() {
error "$@"
exit 1
}
((EUID == 0)) || die 'This script must be run with root privileges'... |
#!/bin/bash
cd
cd exonum/examples/cryptocurrency-advanced/backend
rm -Rf example
mkdir example
N=$((5*$1))
IP=$2
exonum-cryptocurrency-advanced generate-template example/common.toml --validators-count 25
exonum-cryptocurrency-advanced generate-config example/common.toml example/$(($N-4)) --peer-address $IP:6331 -n
exon... |
import Ember from 'ember';
export default Ember.Route.extend({
model: function() {
var host = this.modelFor('host').get('host');
var store = this.get('store');
return Ember.RSVP.all([
store.findAll('service'),
store.findAll('instance'),
]).then(() => {
return host;
});
}
});
|
import io.vertx.core.http.HttpServerResponse;
import java.util.HashSet;
/**
* Created by leng on 4/8/16.
*/
public class ResponseHeader {
public static void put(HttpServerResponse response, String headerKey, HashSet<String> headerList) {
// Convert the HashSet of header values to an array of strings
... |
import datetime
import operator
import time
from walrus.containers import ConsumerGroup
from walrus.containers import ConsumerGroupStream
from walrus.utils import basestring_type
from walrus.utils import decode
from walrus.utils import decode_dict
from walrus.utils import make_python_attr
def id_to_datetime(ts):
... |
package net.romvoid95.curseforge.command.base.args;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import io.github.romvoid95.command.CommandEvent;
public class ArgumentIndex {
private List<IArgument<?>> idx;
private final Pattern multiWord = Pat... |
#!/usr/bin/env bash
set -e
# Usage create-dash.sh SOURCE_FILE
[[ ! "${1}" ]] && echo "Usage: create-dash.sh SOURCE_FILE " && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
# resolution bitrate audio-rate
# "426x240 400k 64k"
"3840x2160 14000k 192k"
"2560x14... |
#!/bin/bash
set -e
source ./scripts/mod_helpers.sh
if test "$(mod_filename compat)" = "compat.ko.gz" ; then
compr=".gz"
elif test "$(mod_filename compat)" = "compat.ko.xz" ; then
compr=".xz"
else
compr=""
fi
for driver in $(find ${BACKPORT_DIR} -type f -name *.ko); do
mod_name=${driver/${BACKPORT_DIR}/${KLIB}${... |
package HxCKDMS.bows.entity;
import io.netty.buffer.ByteBuf;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraf... |
<reponame>pmcg95/g3-q-programmingchallenges
/*
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS fil... |
#!/bin/bash
for mod in $(ls *.go | sed 's/.go//')
do
go build -ldflags="-s -w" -buildmode=plugin -o ./"$mod".so ./"$mod".go
done
|
<reponame>mootshell/EasyAsPLY
#!/usr/bin/env python
from subprocess import call
import os
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser('Generate platform specific build projects')
parser.add_argument('-q', '--quite', action='store_true', default=False, help='Run without user interacti... |
export const AUTH_USER_LOGGED_IN = '[Auth] user logged in';
|
<reponame>mentix02/bog<filename>bof/src/components/PostList.js
import React from "react";
import PropTypes from "prop-types";
import { Row, Col } from "reactstrap";
import PostListItem from "./PostListItem";
function PostList(props) {
const { posts } = props;
return (
<Row>
<Col sm={12} md={{ size: 6, ... |
#!/bin/bash
exit_code=0
echo "*** Running app component engine specs"
#bundle install --jobs=3 --retry=3
bundle exec rake db:create db:migrate
RAILS_ENV=test bundle exec rake db:create db:migrate
bundle exec rspec spec
exit_code+=$?
exit $exit_code
|
module.exports = {
PORT: process.env.PORT || 8000,
NODE_ENV: process.env.NODE_ENV || 'development',
DATABASE_URL: process.env.DATABASE_URL || 'postgres://mlyuurfwtyedfh:92ff09043eabd0824d9d8bb999<EMAIL>f<EMAIL>@ec<EMAIL>:5432/de8fhncugherm3&ssl=on',
TEST_DATABASE_URL: process.env.TEST_DATABASE_URL || 'postgresq... |
# for ThingsBoard Cloud
# Publish client-side attributes update
cat new-attributes-values.json | coap post coap://coap.thingsboard.cloud/api/v1/$ACCESS_TOKEN/attributes
# for local ThingsBoard
# Publish client-side attributes update
cat new-attributes-values.json | coap post coap://localhost/api/v1/$ACCESS_TOKEN/at... |
<filename>oily/divisibility_streaks.py
'''
https://projecteuler.net/problem=601
'''
import functools
import logging
import math
import pathlib
import textwrap
logger = logging.getLogger(__spec__.name)
def main(argv):
setup_logging(argv)
description = textwrap.dedent(solve.__doc__)
print(description)
logger.info... |
<reponame>esxjs/babel-plugin-esx-browser<gh_stars>1-10
import React from 'react';
const data = {
value: 'hi'
};
const Component = ({
value,
prop,
title
}) => React.createElement('div', null, [React.createElement('p', null, [" some content: ", title]), React.createElement('p', null, [" some ", value]), React.cr... |
# https://stackoverflow.com/questions/42564058/how-to-use-local-docker-images-with-minikube
# 1. sh initdb-docker.sh
# 2. kubectl proxy
yarn serve
|
public bool isPrimeNumber(int number) {
if (number <= 1) return false;
if (number == 2) return true;
for (int i = 2; i < number; i++) {
if (number % i == 0) return false;
}
return true;
} |
#!/bin/sh
#
# Vivado(TM)
# runme.sh: a Vivado-generated Runs Script for UNIX
# Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.
#
echo "This script was generated under a different operating system."
echo "Please update the PATH and LD_LIBRARY_PATH variables below, before executing this script"
exit
if [ -z "$... |
gcloud container clusters create apigee-docker-planet --machine-type n1-standard-2 --num-nodes 6 || echo "create cluster failed"
gcloud container clusters get-credentials apigee-docker-planet || exit 1
echo "deleting kube-apigee-install-scripts.zip if it was downloaded earlier"
rm kube-apigee-install-scripts.zip
wget h... |
#!/bin/bash
# "postcompile": "cd ./app-packages/roothub-codegen && pwd && yarn build",
# "prebuild": "yarn",
# 本机 An unexpected error occurred: "Cannot create property '-npm-taobao-org-mirrors' on string '{\"-npm-taobao-org-mirrors\":true}'".
# 改成shell执行绕过
cd ./app-packages/roothub-codegen
pwd
yarn
yarn build
ec... |
#!/bin/bash
# Script to check cdk templates against updated
# cdk. So deploy and destroy each template
# Usage:
# Call from base dir
npm install cdk -g
mkdir -p log
echo off
echo "Testing all without bootstrap"
for i in alb-update ec2-autostop OpsCenterRole r53 transitgateway vpc-bastion codepipeline iam-user selfE... |
package com.boot.feign.article.fallback.impl;
import com.boot.feign.article.fallback.ArticleFallbackFeign;
import com.boot.pojo.Article;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Slf4j
public class ArticleFallbackFeignI... |
<filename>shareloc/geofunctions/localization.py
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2022 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of Shareloc
# (see https://github.com/CNES/shareloc).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fi... |
SELECT AVG(views)
FROM Articles
ORDER BY createdAt DESC
LIMIT 10; |
tabtitle() {
echo -en "\033]0;${*}\a"
}
|
"""
Write a code to convert a calendar date in the form of a string 'dd/mm/yyyy' or the format 'dd-mm-yyyy' to a ISO 8601 date
"""
def convert_date(date_string):
# Split the date into parts
parts = date_string.split('/')
if parts == 2:
parts = date_string.split('-')
# Get the day, month and yea... |
<filename>src/components/AllDetails/index.js<gh_stars>1-10
import React from 'react';
import {
Container,
Table,
Row,
CellTh,
CellTd,
} from './style';
import useSwr from 'swr';
const fetcher = async (...args) =>
await fetch(...args).then((response) =>
response.json().then((response) => response.data)
);
exp... |
pkg_name=gocd-server
pkg_origin=core
pkg_version="18.12.0"
pkg_buildnumber="8222"
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_license=("Apache-2.0")
pkg_source="https://download.gocd.org/binaries/${pkg_version}-${pkg_buildnumber}/generic/go-server-${pkg_version}-${pkg_buildnumber}.zip"
pkg_shasum="... |
/*
* 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 ... |
<filename>examples/app_info.js
/*
* express-mfs
*
* Copyright(c) 2020 <NAME>
* MIT Licensed
*/
"use strict";
// ==========================================================================================
// service info middleware
//
// mfs.info:
// The middleware provides a "service info" endpoint for your AP... |
#!/usr/bin/env bash
# The root of the build/dist directory
IAM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
[[ -z ${COMMON_SOURCED} ]] && source ${IAM_ROOT}/scripts/install/common.sh
# Print info after install.
function iam::redis::info() {
cat << EOF
Redis Login: redis-cli --no-auth-warning -h ${REDIS_HOST} -p ${REDIS_... |
<reponame>lian01chen/chcj_bk
var CheckObject = function () {
this.checkName = function () {
}
this.checkEmail = function () {
}
this.checkPassword = function () {
}
}
var CheckObject = function () {}
CheckObject.prototype = {
checkName: function () {
console.log('checkName')
return this
},
che... |
def get_prime_list(upper_limit):
prime_list = []
for num in range(2, upper_limit+1):
if all(num % i != 0 for i in range(2, num)):
prime_list.append(num)
return prime_list
upper_limit = 20
prime_list = get_prime_list(upper_limit)
print(f'The prime numbers in the range [2, {upper_limit}] ... |
from typing import List, Tuple
def calculate_average_waiting_time(processes: List[Tuple[int, int]]) -> float:
n = len(processes)
total_waiting_time = 0
current_time = 0
for i in range(n):
arrival_time, burst_time = processes[i]
if arrival_time > current_time:
current_time =... |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @flow
*/... |
import React from 'react';
import Header from './sections/Header';
import Footer from './sections/Footer';
import AboutSection from './sections/AboutSection';
import ContactSection from './sections/ContactSection';
import ReviewSection from './sections/ReviewSection';
import BenefitSection from './sections/BenefitSecti... |
/*
Copyright 2016 The Kubernetes 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, ... |
#! /bin/sh
username="$USER"
if [ "$username" == "aubjro" ]
then
module load gcc/6.1.0
fi
if [ -n "$PBS_JOBNAME" ]
then
source ${PBS_O_HOME}/.bash_profile
cd $PBS_O_WORKDIR
module load gcc/5.3.0
fi
simname="03pairs-dpp-root-0002-100k"
cfgpath="../configs/config-${simname}.yml"
outputdir="../simulatio... |
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" ... |
"""Effect decorator for Noisemaker Composer Presets"""
EFFECTS = {}
def effect(func):
"""Function decorator for declaring composable effects."""
EFFECTS[func.__name__] = func
return func
def compose_effects(signal, *effect_names):
"""Compose and apply effects to the input signal."""
composed_si... |
#!/bin/bash -ex
# Compile wheels
cd /io
mkdir -p wheelhouse.final
rm -rf build
rm -rf dist
for P in ${PYTHONS}; do
PYBIN=/opt/python/${P}/bin
"${PYBIN}"/python -m venv .venv
.venv/bin/pip install -U pip wheel cffi setuptools-rust
REGEX="cp3([0-9])*"
if [[ "${PYBIN}" =~ $REGEX ]]; then
... |
test::EXPECT_NE() {
EXPECT_NE 'abc' 'def' 2>'/dev/null' 105>'/dev/null'
ASSERT_TRUE [ "${IMOSH_TEST_IS_FAILED}" -eq 0 ]
EXPECT_NE 'abc' 'abc' 2>'/dev/null' 105>'/dev/null'
ASSERT_TRUE [ "${IMOSH_TEST_IS_FAILED}" -ne 0 ]
IMOSH_TEST_IS_FAILED=0
}
|
docker build -t cybersec_project_backend ./backend && docker build -t cybersec_project_frontend ./frontend && docker-compose up -d |
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
gpu_low_fg_color=""
gpu_medium_fg_color=""
gpu_high_fg_color=""
gpu_low_default_fg_color="#[fg=green]"
gpu_medium_default_fg_color="#[fg=yellow]"
gpu_high_default_fg_color="#[fg=red]"
get_fg_color_s... |
<filename>baselines/bert-models/transformer_bert.py
import sys
import pandas as pd
import numpy as np
import argparse
from tqdm import tqdm
from pathlib import Path
import torch
# from datasets import load_dataset # this has to be installed first using - !pip install datasets
# transformers package can be installed us... |
#!/bin/bash
go build -o fvt/wormhole_agent main.go
chmod +x fvt/wormhole_agent
export BUILD_ID=dontKillMe
pids=`ps aux|grep "wormhole_agent" | grep "fvt"|awk '{printf $2 " "}'`
if [ "$pids" = "" ] ; then
echo "No wormhole_agent was started"
else
for pid in $pids ; do
echo "kill wormhole_agent " $pid
kil... |
#!/usr/bin/env bash
##
## This script upgrades an production VM.
##
## Required environment variables:
##
## LOKOLE_VM_PASSWORD
## LOKOLE_DNS_NAME
##
scriptdir="$(dirname "$0")"
scriptname="${BASH_SOURCE[0]}"
# shellcheck disable=SC1090
. "${scriptdir}/utils.sh"
#
# verify inputs
#
required_env "${scriptname}" "... |
function findSmallest(arr) {
let smallest = arr[0];
for (let i = 1; i < arr.length; i++) {
if (arr[i] < smallest) {
smallest = arr[i];
}
}
return smallest;
}
let result = findSmallest([99, 25, 78, 64]);
console.log(result); // 25 |
def limit_string(string):
"""Format the specified string to limit the number of characters to 6."""
return string[:6] |
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
sourcePath=${serverPath}/source/php
LIBNAME=re... |
#!/bin/bash -eE
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
# shellcheck source=env.sh
. "${SCRIPT_DIR}/env.sh"
TMP_DIR=/tmp/$(basename "$0" .sh)_$$
rm -rf "${TMP_DIR}"
mkdir -p "${TMP_DIR}"
set +eE
for BUNDLE_COMPONENT in proxy web.root arangodb q-server kafka statsd ton-node; do
if [ "${CLEAN_... |
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
CND_PLATFORM=GNU-Linux
CND_CONF=Debug
CND_DISTDIR=dist
CND_BUILDDIR=build
CND_DLIB_EXT=so
NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/tutorial15
OUTPU... |
#!/bin/bash
set -ex
rm -f core.*
python updateSitemap.js
sudo rm -fr build_to_delete tmp_build
echo "module.exports = { distDir: 'tmp_build' }" > next.config.js
npm run build
echo "module.exports = { distDir: '.next' }" > next.config.js
if [ -d .next ]; then
mv .next build_to_delete
fi
mv tmp_build .next
# Rest... |
//#####################################################################
// Copyright 2009, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Namespace ... |
package com.packt.designpatterns.bp.commandpattern;
public class Customer {
public static void main(String[] args) {
// TODO Auto-generated method stub
Pizza pizza = new Pizza("Veg Supreme Pizza",10);
Order orderPizza = new OrderPizza(pizza);
pizza = new Pizza("Veg Supreme Pizza",5);
O... |
<reponame>Haufe-Lexware/octane-gocd-plugin
package com.haufelexware.gocd.service;
import com.google.gson.Gson;
import com.haufelexware.gocd.dto.GoPipelineGroup;
import com.haufelexware.gocd.dto.GoPipelineGroups;
import com.haufelexware.util.Streams;
import com.thoughtworks.go.plugin.api.logging.Logger;
import org.apac... |
/**
* Created by xschen on 13/8/2017.
*/
package com.github.chen0040.leetcode.day18;
|
#!/usr/bin/env bash
tnpm i -g lerna @ali/tyarn
rm -rf node_modules package-lock.json yarn.lock
lerna clean -y
find ./packages -type f -name "package-lock.json" -exec rm -f {} \;
lerna bootstrap
|
#include <stdlib.h>
#include <string.h>
#include "misc.h"
struct reg
{
char *data;
const char *name;
int bits;
};
struct reg *reg_create(int bits, const char *name);
void reg_free(struct reg *r);
|
<reponame>yunsean/yoga
package com.yoga.content.comment.dto;
import com.yoga.core.base.BaseDto;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class ListDto extends BaseDto {
private String filter;
private Boolean issued;
}
|
package main
import (
"crypto/rand"
"fmt"
"math/big"
)
type reactorCode struct {
one uint16
two uint16
}
func newReactorCode() (code reactorCode) {
limit := big.NewInt(10)
newDigit := func() uint16 {
digit, err := rand.Int(rand.Reader, limit)
if err != nil {
panic(err)
}
return uint16(digit.Int64()... |
#!/usr/bin/env bash
#
# Dgraph Installer Script
#
# Homepage: https://dgraph.io
# Requires: bash, curl, tar or unzip
#
# Hello! This is a script that installs Dgraph
# into your PATH (which may require password authorization).
# Use it like this:
#
# $ curl https://get.dgraph.io | bash
#
# This sho... |
/*
* Copyright 2004-2007 <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 ... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
)
type Hangman struct {
Entries map[string]bool
Placeholder []string
Chances int
maxChances int
Word string
Duration time.Duration
}
var dev = flag.Bool("dev", false, "dev mode")
func (h *Hangm... |
#!/bin/bash
#SBATCH --job-name=gc
#SBATCH --gres gpu:1
hostname
export OMP_NUM_THREADS=4
export OPENBLAS_NUM_THREADS=${OMP_NUM_THREADS}
export MKL_NUM_THREADS=${OMP_NUM_THREADS}
if [[ $# -lt 2 ]]
then
echo "Expect two arguments to specify config file and run id"
elif [[ $# -eq 2 ]]
then
python -u habitat_bas... |
#!/bin/bash
# dnf update -y
sudo dnf groupinstall "Development Tools" -y
sudo dnf install boost-devel -y
sudo dnf install gmp-devel -y
sudo dnf install mpfr-devel -y
sudo dnf install wget -y
echo
echo "######################################################"
echo "Install MKL:"
sudo dnf config-manager --add-repo htt... |
#!/usr/bin/env bash
# Copyright 2019 The OpenShift 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 a... |
from flask import Flask, request
app = Flask(__name__)
@app.route("/sum", methods=['GET'])
def get_sum():
num1 = request.args.get('num1', type=float)
num2 = request.args.get('num2', type=float)
return { 'sum': num1 + num2}
if __name__ == '__main__':
app.run() |
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import React, { useState, useEffect, useRef }from 'react';
export default function PortfolioSidebarList (props) {
const useLoad = useRef(props.loaded.current);
useEffect(()=> {
if (props.loaded.current === true) {
console.... |
class RemoveDatetimesForTrackingMetricsFromVisit < ActiveRecord::Migration[4.2]
def change
remove_column :visits, :accepted_at
remove_column :visits, :rejected_at
remove_column :visits, :withdrawn_at
remove_column :visits, :cancelled_at
end
end
|
<reponame>metrisk/approve-dependabot<filename>src/main.ts
import * as core from '@actions/core'
import * as github from '@actions/github'
import { buildApprovalRequest } from './buildApproveRequest'
import { validateAction } from './validateAction'
export async function run (): Promise<void> {
try {
const event ... |
import React, { Component } from 'react';
import List from './List/List';
import style from './Navigation.module.scss';
import logo from '../../asset/logo/main_logo.png';
import {Link} from 'gatsby';
class Navs extends Component {
constructor(props) {
super(props);
this.state = {
isExpanded: fals... |
<gh_stars>100-1000
// https://www.aceptaelreto.com/problem/statement.php?id=114
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
ll n, x;
cin >> n;
while (n--) {
cin >> x;
if (!x) cout << "1\n";
else if (x == 3) cout << "6\n";
... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# encoding: utf-8
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
###############################################################
import ruamel.yaml as yaml
from ruamel.yaml.reader import Reader
from ruamel.yaml.scanner import RoundTripSc... |
<reponame>Defkil/htwg-scala-durak
package de.htwg.se.durak.aview.gui
import de.htwg.se.durak.aview.gui.scenes.{MainMenu, PlayScene, PlayerSelectScene, WaitScene}
import de.htwg.se.durak.controller.GameDataChanged
import de.htwg.se.durak.controller.controllerComponent.ControllerInterface
import javafx.application.Platf... |
<filename>src/pages/settings/Payments/AddDebitCardPage.js<gh_stars>100-1000
import React, {Component} from 'react';
import {withOnyx} from 'react-native-onyx';
import {
View,
ScrollView,
} from 'react-native';
import HeaderWithCloseButton from '../../../components/HeaderWithCloseButton';
import Navigation from ... |
const express = require('express');
const request = require('request');
const app = express();
app.get('/convert', (req, res) => {
let from = req.query.from;
let to = req.query.to;
let amount = req.query.amount;
let url = `http://data.fixer.io/api/latest?access_key=YOUR_ACCESS_KEY&symbols=${from},${to}`;
reque... |
#!/usr/bin/env bash
# myShellEnv v 1.0 [aeondigital.com.br]
#
# Registre o comando adicionando um novo item no array de comandos
# respeitando os seguintes campos (separados por ponto e virgula).
#
# Veja mais informações sobre como preencher esta informação no
# arquivo /src/config/variables.sh
MSE_NOTES_RAW_CO... |
#!/bin/bash
docker build -t=aceseqimage:${1-latest} .
|
//===--- Lexer.cpp - Modula-2 Language Lexer --------------------*- C++ -*-===//
//
// Part of the M2Lang Project, under the Apache License v2.0 with
// LLVM Exceptions. See LICENSE file for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===-----------------------------------------... |
#!/bin/bash
ibmcloud plugin install src/extra/build/extra-linux-amd64 -f && EXTRA_PORT=8080 ibmcloud extra |
<reponame>pjmolina/event-backend<gh_stars>10-100
var searchToolController = function ($scope, $timeout) {
var lastTimeoutTyping = null;
$scope.searchContext = {
pageSize: 12,
searchText: '',
totalItems: 0,
isLoadingData: false
};
//$scope.search = null;
$scope.class = '';
$scope.innerSear... |
package com.java.study.zuo.vedio.basic.chapter3;
/**
* <Description>
*
* @author hushiye
* @since 2020-08-22 18:20
*/
public class SmallerEqualBigger {
public static Node smallerEqualBigger(Node node, int targetValue) {
if (node == null) {
return null;
}
Node smallNode ... |
/**
* Created by Moiz.Kachwala on 15-06-2016.
*/
"use strict";
var express = require("express");
var ProjectController = require("./../../controllers/ProjectController");
var router = express.Router();
var ProjectRoutes = (function () {
function ProjectRoutes() {
this._projectController = new ProjectContr... |
#!/usr/bin/env bash
SELF=${0##*/} SDIR=${0%/*}
# -------------------------------------------------------------------------------------------------------------------- #
: '
The MIT License (MIT)
Copyright © 2021 by John Celoria.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.