text stringlengths 1 1.05M |
|---|
#!/bin/sh
# We do not use crond because it brings problems when using docker user namespace or not running as cron
# https://serverfault.com/questions/836091/crond-cant-set-groups-operation-not-permitted
# I have tried playing with docker capabilities, but it is just cleaner to run the script every 2 minutes like this
... |
import {
REPORT_ERROR,
GET_REPORTS,
ADD_REPORT
} from '../actions/types'
const initialState = {
reports: [],
loading: true,
error: {}
}
function reportReducer (state = initialState, action) {
const { type, payload } = action;
switch (type) {
case GET_REPORTS:
retur... |
<gh_stars>1-10
import sys
num = sys.argv[1]
i = 0 #index
with open("sim{}_chr21.bed".format(num), "w") as out_file:
with open("sim{}_chr21.fastq".format(num)) as in_file:
for line in in_file:
if line[0] == "@": #header lines only
line = line.strip().split()
if i%2 == 1 and line[2] == "HIC":
chrom1,... |
#! /bin/bash
# CK installation script for TensorFlow models
#
# See CK LICENSE.txt for licensing details
# See CK COPYRIGHT.txt for copyright details
#
echo ""
echo "Compiling Protobuf... "
cd ${INSTALL_DIR}/${PACKAGE_SUB_DIR}/research
${CK_ENV_LIB_PROTOBUF_HOST_BIN}/protoc object_detection/protos/*.proto --python_ou... |
export class QuizQuestion {
question: string;
answers: string[];
imgUrl: string;
videoUrl: string;
countdownSeconds: number;
score: number;
constructor(question: string, answers: string[], imgUrl: string, videoUrl: string, countdownSeconds: number, score: number) {
this.question = q... |
<reponame>toba/goweb
package token_test
import (
"testing"
"github.com/toba/coreweb/token"
"github.com/stretchr/testify/assert"
)
func TestAuthorizationEncoding(t *testing.T) {
key := int64(123)
p := token.ForAuth(key, 1, 2, 3, 4)
enc, err := p.Encode()
assert.NoError(t, err)
assert.NotNil(t, enc)
dec, e... |
#!/bin/bash
# set largest number to first argument
largest=$1
# Loop over given arguments
for arg in "$@"
do
# Check if current argument is greater than current largest
if [ "$arg" -gt "$largest" ]; then
# Set current argument as new largest
largest=$arg
fi
done
# Print largest value
echo... |
package com.amaljoyc.patterns.structural.facade;
/**
* Created by amaljoyc on 19.07.18.
*/
public interface Account {
void create();
}
|
# coding=utf-8
import setuptools
def package_data_dirs(source, sub_folders):
import os
dirs = []
for d in sub_folders:
for dirname, _, files in os.walk(os.path.join(source, d)):
dirname = os.path.relpath(dirname, source)
for f in files:
dirs.append(os.path.join(dirname, f))
return dir... |
#!/bin/bash
set -e
echo "Running NPM install to update dependencies"
echo `date`
npm install
echo "Building MS2 bundles"
echo `date`
npm run compile
echo "Cleanup Documentation"
echo `date`
npm run cleandoc
echo "Checking syntax"
echo `date`
npm run lint
echo "Run MapStore2 tests"
echo `date`
npm test
echo "Creat... |
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
git init
git add -A
git commit -m 'deploy'
# if you are deploying to https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:lanyshi/vue-firebase-chat.git master:gh-pages
cd -
|
use netcdf::{File as NcFile, Variable};
// Assume that Array3 is a 3-dimensional array type
struct Array3<T> {
// Implementation details for Array3
}
// Assume that Numeric is a trait representing numeric types
impl<T: Numeric> Array3<T> {
// Other methods and implementation details for Array3
}
impl<T: Num... |
package domaine.bizz.interfaces;
import domaine.dto.UserInfoDto;
public interface UserInfoBizz extends UserInfoDto {
/**
* Vérifie si tous les champs sont valides.
*
*/
public void checkBeforeInsert();
}
|
<filename>m700.py
# coding: utf-8
'''
Communicate with Mitsubishi Electric CNC M700 series using EZSocket.
The object of communication is the machining center Mitsubishi CNC M700 / M700V / M70 / M70V.
'''
from enum import Enum
import threading
import pythoncom
import win32com.client
from win32com.client import VARIANT... |
import {Controller, Get, HttpStatus, Param, Query, Res, UseGuards} from '@nestjs/common';
import {AuthOptGuard} from "../../../auth/auth-opt.gurad";
import {Usr} from "../../../user/user.decorator";
import {User} from "../../../user/user.model";
import {Response} from "express";
import {LinkService} from "../../link/li... |
def ui():
items = []
while True:
print("1. Add item")
print("2. Remove item")
print("3. Display items")
print("4. Exit")
choice = input("Enter your choice: ")
if choice == "1":
item = input("Enter the item to add: ")
items.append(i... |
<reponame>STShenZhaoliang/java-day-by-day<gh_stars>0
package cn.st.test;
import cn.st.domain.User;
import cn.st.mapper.UserMapper;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFa... |
import { Component } from '@angular/core';
@Component({
selector: 'app-select-input',
template: `
<input type="text"
[(ngModel)]="searchText"
(ngModelChange)="onSearchInputChange($event)"
/>
<ul *ngIf="showList" class="list">
<li *ngFor="let item of matchingItems"
(click)="onItemSelected(item)">
{{ item }}
... |
<html>
<head>
<title>Purchase Order Form</title>
</head>
<body>
<form action="" method="post">
<div>
<label>Name: </label>
<input type="text" name="name" />
</div>
<div>
<label>Address: </label>
... |
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0');
var yyyy = today.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
console.log(today); |
<filename>acmicpc/3040/3040.py
numbers = [] # [7, 8, 10, 13, 15, 19, 20, 23, 25]
for _ in range(9):
numbers.append(int(input()))
summation = sum(numbers)
for i in range(len(numbers)):
is_hundred = False
for j in range(1, (len(numbers))):
if i == j:
continue
if summation - (numbe... |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... |
<reponame>Artcs1/RotationDetection
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
from libs.configs._base_.models.retinanet_r50_fpn import *
from libs.configs._base_.datasets.dota_detection import *
from libs.configs._base_.schedules.schedule_1x import *
fr... |
<reponame>PepsRyuu/jscollab<gh_stars>1-10
let ws;
function fetch (url, options = {}) {
// Common metadata
options.headers = options.headers || {};
options.headers['X-Requested-With'] = 'XMLHttpRequest'; // Allows server to check for CSRF.
options.credentials = 'same-origin'; // append cookies
// T... |
func configureCell(result: SearchResult) {
searchImageView.layer.cornerRadius = 5.0
searchImageView.layer.masksToBounds = true
if let url = URL(string: result.urls.thumb) {
self.searchImageView.kf.setImage(with: url)
}
} |
import java.sql.*;
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* addproduct.java
*
* Created on Oct 30, 2017, 12:15:01 PM
*/
/**
*
* @author DRALL
*/
public class addproduct extends javax.swing.JFrame {
Connection con=null;
... |
#!/usr/bin/env bash
# build.sh <action> ...
# ci_action: dependencies|generate|build|install
# ci_platform: windows|linux|macos|android|ios|web
# ci_arch: x86|x64|arm|arm64
# ci_compiler: msvc|gcc|gcc-*|clang|clang-*|mingw
# ci_build_type: dbg|rel
# ci_lib_type: lib|dll
# ci_source_dir: s... |
<gh_stars>0
const asyncWrapper = require('../middleware/asyncWrapper');
const ErrorResponse = require('../utils/ErrorResponse');
const Weather = require('../models/Weather');
const getExternalWeather = require('../utils/getExternalWeather');
// @desc Get latest weather status
// @route GET /api/weather
// @ac... |
#!/bin/bash
# Set the npm registry auth token
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
# Grab the local version and check to see if that version exists on npm
agentAlreadyReleased=$(npm view @percy/agent versions | grep $(node -p "require('./package.json').version"))
# If the package with that v... |
def unique_values(example_list):
"""
Returns a list of unique values from a given list.
Args:
example_list (list): list containing duplicate values
Returns:
list: list containing only unique values
"""
unique = []
for num in example_list:
# Add only if it is not alrea... |
<gh_stars>1-10
package com.touch.air.mall.member.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.touch.air.common.utils.PageUtils;
import com.touch.air.mall.member.entity.MemberReceiveAddressEntity;
import java.util.List;
import java.util.Map;
/**
* 会员收货地址
*
* @author bin.wang
* @... |
def extract_emails(string):
'''This function generates a regular expression to extract emails from a given string'''
# Generate an expression to search for emails
regex = re.compile(r"\b[\w.-]+@[\w.-]+\.\w+\b")
# Search the string for emails
emails = regex.findall(string)
# Return the ... |
#!/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" || exit 1
else
echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Thehashcoin datab... |
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import server.controlleurs.ServeurControlleur;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the edito... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.listUnordered = void 0;
var listUnordered = {
"viewBox": "0 0 12 16",
"children": [{
"name": "path",
"attribs": {
"fill-rule": "evenodd",
"d": "M2 13c0 .59 0 1-.59 1H.59C0 14 0 13.59 0 13c0-.59 0-1 .59-1h.81c... |
<reponame>yzh1234567/vy-element
import vyTree from "./src/tree.vue"
vyTree.install=function(Vue){
Vue.component(vyTree.name,vyTree)
}
export default vyTree |
<gh_stars>0
# Generated by Django 2.2.4 on 2019-08-19 14:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('antiqueProjectApp', '0016_auto_20190816_1200'),
]
operations = [
migrations.AddField(
model_name='antiquesale',
... |
# zshide: the Zsh IDE
#
# Creates a repository on GitHub, clones it and updates .gitignore. It is
# called from the np (new project) command.
#
# Requirements:
# GITHUB_TOKEN (zshiderc)
# PROJECT_NAME
#
# Author: Lorenzo Cabrini <lorenzo.cabrini@gmail.com>
. $ZI_HOME/util.zsh
# Defaults
PROJECT_DESCRIPTION="Cre... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 9 10:34:05 2020
@author: RMS671214
"""
from faspy.basel.credit.credit import calc_prob_default, \
prob_default_interpolation as pdi, expected_loss, \
mean_rr_with_betadist
import pandas as pd
# %%
spreads = []
spreads.append({"te... |
#!/bin/bash
#Usage:
# util-job-executions.sh <URL> <jobid> [status]
DIR=$(cd `dirname $0` && pwd)
source $DIR/include.sh
jobid=$1
shift
state=$1
shift
# now submit req
runurl="${APIURL}/job/${jobid}/executions"
echo "# Listing Executions for job ${jobid}..."
params="status=${state}"
echo "url: ${runurl}?${... |
var crypto = require("crypto");
exports.install = function(self)
{
var tokens = {};
self.token = function(token, callback)
{
if(typeof token == "function")
{
callback = token;
token = false;
}
if(!token)
{
var bytes = new Buffer(self.hashname,"hex");
var rand = new Buf... |
#!/bin/bash
set -e
# read -p "请输入Commit Message:" MESSAGE;
# npm run build:docs
npm run build:example
# echo 'xform.imdo.me' > ./docs/CNAME
# git add .
# git commit -m "docs: $MESSAGE" |
<gh_stars>1-10
/*
* #%L
* none: runtime code modification by annotation idioms.
* %%
* Copyright (C) 2014 <NAME>.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must r... |
The user interface should consist of a form that contains the receipent's email address, the subject and body of the email. When the user submits the form, the application should send the email and display a success message.
The application should include a back-end with a function to validate email addresses and a se... |
<filename>packages/api/src/entities/IUser.ts
interface IUser {
id: string
name: string
email: string
socket: string
createdAt: Date
}
export { IUser }
|
angular.module('cms.shared').factory('shared.vimeoService', [
'$http',
'$q',
'shared.errorService',
function (
$http,
$q,
errorService
) {
var service = {},
serviceUrl = 'https://vimeo.com/api/oembed.json?url=https%3A%2F%2Fvimeo.com%2F';
/* QUERIES */
service.getVideo... |
def create_tempo_dictionary():
dictionary = {}
for i in range(40):
tempo_value = 10 + (i * 5)
dictionary[f"tempo_{i + 1}"] = tempo_value
return {key: dictionary[key] for key in list(dictionary.keys())[:2]} |
<filename>okhelper/src/main/java/com/release/okhelper/builder/PostBuilder.java
package com.release.okhelper.builder;
import com.release.okhelper.callBack.ICallback;
import com.release.okhelper.request.PostRequest;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
... |
#!/bin/bash
./addlicense.sh
rm -f tuda_templates.zip
mkdir -p texmf
rm -rf texmf/*
mkdir -p texmf/doc/latex/tuda-ci
mkdir -p texmf/tex/latex/tuda-ci
cd example
latexmk --lualatex
mv DEMO-*.pdf ../texmf/doc/latex/tuda-ci
cd ..
cp -r tex/. texmf/tex/latex/tuda-ci/.
cp ~/tuda_logo.pdf texmf/tex/latex/tuda-ci/.
mkdir ... |
#!/usr/bin/env bash
echo "Generating UnrealGAMS project files"
echo "----------------------"
"$UE4_ROOT"/GenerateProjectFiles.sh -project="$UE4_GAMS"/UnrealGAMS.uproject -game -engine -Makefile -vscode
|
<reponame>eengineergz/Lambda
const data = [
{
tags: [
"enim",
"dolore",
"irure",
"consectetur"
],
post: "Ea occaecat aute minim esse in. Amet et reprehenderit eiusmod sit aute cupidatat dolor incididunt minim nisi. Quis veniam et amet esse sunt. Laborum et anim occaecat est velit c... |
package org.glamey.training.codes.sort;
import java.util.Arrays;
import java.util.Random;
public class QuickSortDemo {
public static void main(String[] args) {
int[] nums = new int[10];
for (int i = 0; i < 10; i++) {
nums[i] = i;
}
shuffle(nums);
System.out.pri... |
<gh_stars>0
// tslint:disable-next-line:import-blacklist
import * as Rx from 'rxjs/Rx';
export class MarkerCluster extends MarkerClusterer {
constructor(map: google.maps.Map, markers?: google.maps.Marker[], options?: MarkerClustererOptions) {
super(map, markers, options);
}
}
|
<filename>oarepo_s3/ext.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CESNET
#
# oarepo-s3 is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""S3 file storage support for Invenio.
To use this module together with Invenio-Files-Rest ... |
from __future__ import unicode_literals
from django.test import override_settings
from rest_framework import status
from rest_api.tests import BaseAPITestCase
from ..models import Key
from ..permissions import (
permission_key_delete, permission_key_upload, permission_key_view
)
from .literals import TEST_KEY_... |
export PYENV_ROOT=~/.pyenv
# init according to man page
if (( $+commands[pyenv] ))
then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
|
<gh_stars>1-10
# frozen_string_literal: true
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#!/bin/bash
prog=${0##*/}
progdir=${0%/*}
fail () {
echo "$prog:" "$@" >&2
exit 1
}
add_values_to () {
config=$1
shift
printf "%s=%s\n" >> "/etc/condor/config.d/$config" "$@"
}
# Create a config file from the environment.
# The config file needs to be on disk instead of referencing the env
# at ... |
/*global angular*/
import AlarmFactory from './alarm_factory';
export default angular.module('apps/sentinl.alarmFactory', []).factory('alarmFactory',
/* @ngInject */ ($http, $injector) => {
return new AlarmFactory($http, $injector);
});
|
<reponame>chlds/util
/* **** Notes
Commandlet to open a file
Attention:
This code
is for a doubly LL i.e.,
<NOT> for a circular LL..
Remarks:
Implemented along with fn. cv_v() and with fn. rl_v().
And also with a flag to be added for code to run as far as possible to the end.
*/
# define C_CODE_STDS
# define CCR
#... |
def verify_parameter_value(contract, type1, type2, expected_address):
ret1 = contract.getCurrentOnVoteValueProposal(type1)
ret2 = contract.getCurrentOnVoteValueProposal(type2)
expected_address_hex = int(expected_address, 16)
if ret1 == expected_address_hex and ret2 == expected_address_hex:
retu... |
<filename>tests/test_connectors_parquet.py
"""
Created on 4 Mar 2020
@author: si
"""
import os
import sys
import unittest
PANDAS_NOT_INSTALLED = False
try:
import pandas as pd
except ModuleNotFoundError:
pd = None
try:
import pyarrow.parquet as pq
except ModuleNotFoundError:
pq = None
from ayeaye.c... |
<reponame>rsuite/rsuite-icons<gh_stars>1-10
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import Thermometer1Svg from '@rsuite/icon-font/lib/legacy/Thermometer1';
const Thermometer1 = createSvgIcon({
as: Thermometer1Svg,
ariaLabel: 'thermometer 1',
category: 'lega... |
function getPageTypeComposerControlIdentifier(string $handle): string
{
$bt = ConcreteBlockType::getByHandle($handle);
if ($bt !== null) {
return static::getPageTypeComposerControlByIdentifier($bt->getBlockTypeID());
} else {
return "Error: Handle does not correspond to any known block type"... |
"""
This script trains the TrueCase System
"""
import nltk
import os
import sys
import argparse
import cPickle
script_path=os.path.dirname(os.path.realpath(__file__))
truecaser_script_dir = os.path.join(script_path,"dependencies","truecaser")
sys.path.insert(1,truecaser_script_dir)
from TrainFunctions import *
def mai... |
<gh_stars>0
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {TaskModule} from "../task/task.module";
import {ThoughtModule} from "../thought/thought.module";
import { DocumentOverviewComponent } from './document-overview/document-overview.component';
import { AddDocument... |
"use strict";
import { Set, OrderedMap, OrderedSet, Map } from "immutable";
import { Type, ClassProperty, UnionType, ObjectType, combineTypeAttributesOfTypes, assertIsObject } from "./Type";
import {
TypeRef,
UnionBuilder,
TypeBuilder,
TypeLookerUp,
GraphRewriteBuilder,
TypeRefUnionAccumulator... |
<filename>internal/product/models.go
package product
import (
"time"
"gopkg.in/mgo.v2/bson"
)
// Product is something we have for sale.
type Product struct {
ID bson.ObjectId `bson:"_id" json:"id"` // Unique identifier.
Name string `bson:"name" json:"name"` ... |
<reponame>unerh/cosmos<filename>packages/@cdk-cosmos/core/src/cosmos/cosmos-core-stack.ts
import { Construct, Stack, CfnOutput, Tags, IConstruct } from '@aws-cdk/core';
import { IHostedZone, HostedZone } from '@aws-cdk/aws-route53';
import { Role, ServicePrincipal, ManagedPolicy, CompositePrincipal } from '@aws-cdk/aws... |
//在一个 平衡字符串 中,'L' 和 'R' 字符的数量是相同的。
//
// 给你一个平衡字符串 s,请你将它分割成尽可能多的平衡字符串。
//
// 注意:分割得到的每个字符串都必须是平衡字符串。
//
// 返回可以通过分割得到的平衡字符串的 最大数量 。
//
//
//
// 示例 1:
//
//
//输入:s = "RLRRLLRLRL"
//输出:4
//解释:s 可以分割为 "RL"、"RRLL"、"RL"、"RL" ,每个子字符串中都包含相同数量的 'L' 和 'R' 。
//
//
// 示例 2:
//
//
//输入:s = "RLLLLRRRLR"
//输出:3
//解释:s 可以分割为 "RL"、"L... |
package has
import (
"context"
"fmt"
applicationservice "github.com/redhat-appstudio/application-service/api/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"github.com/redhat-appstudio/e2e-tests/pkg/client"
)
type SuiteController struct {
*client.K8sClient
}
func NewSuit... |
import React from "react";
import TimeLogForm from "./TimeLogForm";
import { FIELDS } from "./formConfig";
import moment from "moment";
import { isEmpty } from "lodash";
import {
getHours,
getAmPm,
getSelectedDate,
getSelectedTime,
} from "../Shared/dateTimeFieldHelpers.js";
const NewTimeLogDateTimeFields = (... |
SELECT e1.Name AS employee_name, e1.Salary AS employee_salary, e1.Department AS department_name
FROM Employees AS e1
WHERE e1.Salary =
(SELECT MAX(e2.Salary)
FROM Employees AS e2
WHERE e1.Department = e2.Department); |
<reponame>combra-lab/combra_loihi
"""
MIT License
Copyright (c) 2018 <NAME>
Copyright (c) 2018 <NAME>
Copyright (c) 2018 Computational Brain Lab, Computer Science Department, Rutgers University
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation f... |
#include <iostream>
class PID {
private:
double Kp, Ki, Kd;
double p_error, i_error, d_error;
public:
PID(double Kp, double Ki, double Kd) : Kp(Kp), Ki(Ki), Kd(Kd), p_error(0), i_error(0), d_error(0) {}
void UpdateError(double cte) {
d_error = cte - p_error; // Calculate the derivative error... |
<filename>example/src/App.js
import React, { Component, Fragment } from "react";
import { Spiral } from "react-audible-visuals";
const BW = "B"
const styles = {
wrapper: {
height: "100vh",
width: "100vw",
bottom: 0,
left: 0,
display: "flex",
justifyContent: "center",
alignItems: "cente... |
#!/bin/bash
# exit on error
set -e
CWD=$(pwd)
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
function dofail {
cd $CWD
printf '%s\n' "$1" >&2 ## Send message to stderr. Exclude >&2 if you don't want it that way.
exit "${2-1}" ## Return a code specified by $2 or 1 by default.
}
LIREINDEXE... |
<filename>client/src/components/Roster.tsx
import {useState, useRef, useEffect} from 'react';
import {ListNav} from 'keynav-web';
import './Roster.scss';
export function Roster(props) {
const [listNav, setListNav] = useState<any>(null);
const rosterRef = useRef<HTMLOListElement>(null);
// Add ... |
#!/bin/bash
#########################################
#
# Not really maintained, and there are a few things to do:
# 1. Prompt for the IP address.
# 2. Prompt for the default search domain.
#
#########################################
set -e
if [[ "$EUID" -ne 0 ]]; then
echo "Sorry, this script must be run as ro... |
#!/bin/sh
set -e
# force sudo
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Install Vault Bin
echo "-- Installing vault"
unzip /tmp/files/vault_0.8.3_linux_386.zip
mv ./vault /usr/bin
# Try to help with tampering
echo "-- Setting bin permissions"
chown root:root /usr/bin/vault
chmod 555 /usr/bin/vault
... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-SS/7-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/7-1024+0+512-N-VB-ADJ-ADV-first-256 --do_eval --p... |
<reponame>wenfang6/XSQL<filename>sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala<gh_stars>100-1000
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional info... |
#!/usr/bin/env bash
# Copyright 2014 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -e
function script_location() {
local script_location="${BASH_SOURCE[0]}"
# Resolve symlinks
while [[ -h "$script_location" ]];... |
<gh_stars>100-1000
// Copyright 2019 PingCAP, Inc.
//
// 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... |
#!/usr/bin/env bash
echo "testing 1 2 3..."
curl "etportfolio.duckdns.org/health/"
curl -X POST -d "username=testUsername" "https://etportfolio.duckdns.org/register" -L
curl -X POST -d "username=testPassword" "https://etportfolio.duckdns.org/register" -L
curl -X POST -d "username=testUsername&password=testPassword" "ht... |
import React from 'react'
import { makeStyles } from '@material-ui/core/styles'
import { AppBar, Toolbar, Typography } from '@material-ui/core';
import MainTabs from './MainTabs';
import Logo from './Logo';
const useStyles = makeStyles((theme) => ({
toolbar: {
flexGrow: 1,
backgroundColor: '#000000... |
#!/bin/bash
##
# script to make docker containers' configuration persist between reboots of the firewalla box
# the script must be created at /home/pi/.firewalla/config/post_main.d/start_[service-name].sh
##
# as per our own configuration, the docker root has been moved to the ssd drive
# so, after every reboot, we m... |
package parser
import (
"github.com/jensneuse/graphql-go-tools/pkg/document"
"github.com/jensneuse/graphql-go-tools/pkg/lexing/keyword"
)
func (p *Parser) parsePeekedBoolValue(value *document.Value) {
tok := p.l.Read()
value.Raw = tok.Literal
if tok.Keyword == keyword.FALSE {
value.Reference = 0
} else {
... |
<reponame>zhengtingke/personal_blog
/*
* jQuery Equal Height
* Author: <NAME>
* Github: https://github.com/susonwaiba/jquery-equal-height
* URL: http://susonwaiba.com
*/
$.fn.jQueryEqualHeight = function(innerDiv) {
if (innerDiv == undefined) {
innerDiv = '.card';
}
var currentTallest = 0, currentRo... |
<reponame>Emi691/museum-collections-app
class TreatmentsController < ApplicationController
get '/treatments/:id/mark-as-done' do
@treatment = Treatment.find_by(params)
@piece = @treatment.piece
if logged_in? && @piece.user == current_user
if @piece.condition == @treatment.start_... |
#!/bin/sh
# Package
PACKAGE="vim"
DNAME="Vim"
case $1 in
start)
exit 0
;;
stop)
exit 0
;;
status)
exit 1
;;
log)
exit 1
;;
*)
exit 1
;;
esac
|
def find_difference(arr1, arr2):
return list(set(arr1) - set(arr2))
differences = find_difference(sample_array_1, sample_array_2) |
<gh_stars>1-10
package back_tracking;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
/**
*
* @author minchoba
* 백준 14889번: 스타트와 링크
*
* @see https://www.acmicpc.net/problem/14889/
*
*/
public class Boj14889 {
private static int diff = Integer.MAX_VALUE;
p... |
package io.opensphere.core.security.options;
import java.awt.Component;
import java.awt.EventQueue;
import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collection;
import java.util.Itera... |
<reponame>Developerayo/opensource-design-workshop-futuresync
var kStageSizeDidChangeEvent = "DisplayManager:StageSizeDidChangeEvent";
var kTimeoutValueForCursor = 1000;
var kMobilePortraitModeHorizontalMargin = 8;
var kMobilePortraitModeTopMargin = 47;
var kMobilePortraitModeVerticalCenterLine = 161;
var kMobilePortrai... |
/**
* Copyright (C) 2006-2021 Talend Inc. - www.talend.com
*
* 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... |
<filename>api/helpers/generate-token.js
const crypto = require('crypto');
const moment = require('moment-timezone');
module.exports = {
sync: true, // this is a synchronous helper
friendlyName: 'Generate token',
description: 'Generate generic token for generic use, generically. (64 characters)',
inp... |
#!/bin/bash
# This script lists the contents of the
# current directory and its sub-directories
for entry in $(ls -R .)
do
if [ -d $entry ]
then
echo "dir $entry"
else
echo "file $entry"
fi
done |
#!/bin/bash
# Copyright (c) 2019-2020, NVIDIA CORPORATION. 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 retain the above copyright
# notice, this lis... |
import { AbstractFeature } from '../../model/gml/AbstractFeature';
import { AbstractGML } from '../../model/gml/AbstractGML';
import { CodeType } from '../../model/gml/CodeType';
import { Envelope } from '../../model/gml/Envelope';
import { NAMESPACES } from './Namespaces';
import { Point } from '../../model/gml/Point'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.