text stringlengths 1 1.05M |
|---|
<filename>app/src/main/java/edu/byu/cet/founderdirectory/utilities/BitmapWorkerTask.java
package edu.byu.cet.founderdirectory.utilities;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
impor... |
<gh_stars>1-10
# Use this enabled script to enable the metering dashboard.
DASHBOARD = 'metering'
DISABLED = False
ADD_INSTALLED_APPS = [
'openstack_dashboard.dashboards.metering'
]
|
#!/bin/bash
check_vmware=$(ps aux | grep "/usr/lib/vmware/bin/vmware$")
#if [ ! -z "$check_vmware" ];
if [ -z "$check_vmware" ];
then
#echo $check_vmware
/usr/lib/vmware/bin/vmware &
fi
|
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
import { schemaComposer, ObjectTypeComposer } from "graphql-compose";
import addOrderby from "../src/orderby";
const typeDefs = `
type User {
userid: Int
firstName: String
lastName: String
}
`;
describe("Schema Orderby", () => {
test("confirms order by", () => {
const ts = schema... |
#!/usr/bin/env bash
# exit code:
# 01 - illegal arguments
for OPT in "$@"; do
case "$OPT" in
'--rulesdir' )
if [[ -z "$2" ]] || [[ "$2" =~ ^-+ ]]; then
exit 1
fi
RULESDIR=`readlink -f $2`
RULESDIR_WINDOWS=`cygpath -w "$RULESDIR"`
... |
. ../env.sh
mkdir -p mods
mkdir -p patches
mkdir -p mlib
mkdir -p patchlib
echo "javac $JAVAC_OPTIONS -d mods --module-path amlib${PATH_SEPARATOR}mlib --module-source-path src \$(find src -name \"*.java\" | grep -v modtest.whitebox)"
$JAVA_HOME/bin/javac $JAVAC_OPTIONS -d mods --module-path amlib${PATH_SEPARATOR}m... |
#!/bin/bash
# Configuring the environment for more file watchers
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
# Following https://adoptopenjdk.net/installation.html
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-re... |
<filename>backend/src/routes/users.routes.ts<gh_stars>0
import { Router } from 'express';
import CreateUserService from '../services/CreateUserService';
import { getRepository } from 'typeorm';
import User from '../models/User';
import UserDetails from '../models/UserDetails';
import verifyAuth from '../middlewares/... |
package proto
import (
"bytes"
"path/filepath"
"reflect"
"testing"
"github.com/pachisi456/Sia/build"
"github.com/pachisi456/Sia/crypto"
"github.com/pachisi456/Sia/encoding"
"github.com/pachisi456/Sia/modules"
"github.com/pachisi456/Sia/types"
)
// TestContractUncommittedTxn tests that if a contract revision... |
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
(set -o igncr) 2>/dev/null && set -o igncr; # comment is needed
## Make sure McAfee is shutdown
net stop ... |
def formatDate(date):
def formatDateStr(date):
months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
year, month, day = map(int, date.split('-'))
suffix = "th" if 11 <= day <= 13 else {1: "st", 2: "nd", 3: "rd"}.ge... |
/*
* 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 agreed t... |
from RFEM.initModel import *
from RFEM.enums import BracingType
class Bracing():
def __init__(self,
no: int = 1,
member_type = BracingType.TYPE_HORIZONTAL,
start_node_no: int = 1,
end_node_no: int = 2,
rotation_angle: float = 0.0,
... |
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# Release Parameters
BASE_VERSION=0.1.6
IS_RELEASE=false
# Project Parameters
SOURCE_REPO=edv
BASE_PKG_NAME=edv
RELEASE_REPO=ghcr.io/trustbloc
SNAPSHOT_REPO=ghcr.io/trustbloc-cicd
if [ ${IS_RELEASE} = false ]
t... |
from typing import AsyncIterator, Callable, List
import pytest
import csv
import io
from aiocsv._parser import parser as fast_parser
from aiocsv.parser import parser as py_parser
from aiocsv.protocols import WithAsyncRead
Parser = Callable[[WithAsyncRead, csv.Dialect], AsyncIterator[List[str]]]
PARSERS: List[Parser]... |
/**
* Created by User on 21.04.2017.
*/
$('button').on('click', function(event){
event.preventDefault();
var element = $(this);
$.ajax({
url: '/like_treasure',
type: 'GET',
data: {treasure_id: element.attr("data-id")},
success: function(response){
element.html('... |
import Container from "@material-ui/core/Container";
import Divider from "@material-ui/core/Divider";
import Grid from "@material-ui/core/Grid";
import TablePagination from "@material-ui/core/TablePagination";
import Typography from "@material-ui/core/Typography";
import { NavigateFn } from "@reach/router";
import { gr... |
#!/usr/bin/env bash
#
# These are the commands available in an .envrc context
#
# ShellCheck exceptions:
#
# SC1090: Can't follow non-constant source. Use a directive to specify location.
# SC1091: Not following: (file missing)
# SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".
# SC2059: Don't use... |
<reponame>tomvodi/QTail<filename>src/gui/file_views/PlainTextEdit.cpp<gh_stars>1-10
/**
* @author <NAME> <<EMAIL>>
*
* @section LICENSE
* See LICENSE for more informations.
*
*/
#include <QPainter>
#include <QTextBlock>
#include <QScrollBar>
#include <QContextMenuEvent>
#include <QMenu>
#include <QTextDocumentF... |
// create a range from 0 to 9
let arr = Array.from(Array(10).keys());
console.log(arr); // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
PrintChars(){ printf %${2}s | tr ' ' "$1"; }
# 右から左へ1文字ずつ詰めて表示される
# $1 対象テキスト
ToLeft(){
tput cub $(($col - ))
}
Wait(){
local target=/tmp/work/chars.txt
echo "日本語を一文字ずつ表示する。この度はお疲れ様でした。" > $target
while IFS= read -rN1 char;
do
printf "$char";
sleep 0.05;
done < $target
#don... |
<reponame>ivonildo-lopes/PedidoVenda<filename>src/main/java/com/algaworks/pedidovenda/validation/PedidoAlteradoEvent2.java<gh_stars>1-10
package com.algaworks.pedidovenda.validation;
import com.algaworks.pedidovenda.model.Pedido2;
public class PedidoAlteradoEvent2 {
private Pedido2 pedido;
public PedidoAlterado... |
#!/usr/bin/env bash
#
# Generate all protobuf bindings.
# Run from repository root.
#
# Initial script taken from etcd under the Apache 2.0 license
# File: https://github.com/coreos/etcd/blob/78a5eb79b510eb497deddd1a76f5153bc4b202d2/scripts/genproto.sh
set -e
set -u
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
... |
#!/bin/sh
make -C /Users/lbajo/ros2_mod_ws/build/ament_cmake_export_interfaces -f /Users/lbajo/ros2_mod_ws/build/ament_cmake_export_interfaces/CMakeScripts/ZERO_CHECK_cmakeRulesBuildPhase.make$CONFIGURATION all
|
<gh_stars>1-10
package libs.trustconnector.scdp.smartcard.application.telecom.cat.sms;
import libs.trustconnector.scdp.util.*;
import libs.trustconnector.scdp.util.ByteArray;
import libs.trustconnector.scdp.util.Util;
public class CommandPackage
{
protected int defChecksumAlg;
protected int defChecksumKID;
... |
from os import system
def runPhishing(social):
# Remove all files in the directory base/Server/www/
# Create a new file named cat.txt in the directory base/Server/www/
system('sudo rm -Rf base/Server/www/*.* && touch base/Server/www/cat.txt') |
<reponame>TerriaJS/natmap-catalog-v8
"use strict";
const sortItemsByName = require('../helpers/sortItemsByName');
function recursivelySortMembersByName(members) {
for (let i = 0; i < members.length; ++i) {
const m = members[i];
if (m.members != null) {
recursivelySortMembersByName(m.members);
}
}... |
test::md5_file() {
touch "${TMPDIR}/md5_file"
EXPECT_EQ 'd41d8cd98f00b204e9800998ecf8427e' \
"$(sub::md5_file "${TMPDIR}/md5_file")"
echo -n 'foo' >"${TMPDIR}/md5_file"
EXPECT_EQ 'acbd18db4cc2f85cedef654fccc4a4d8' \
"$(sub::md5_file "${TMPDIR}/md5_file")"
local result=''
func::md5_... |
/**
* Quiz Schema Utilities.
*
* Contains various utilities for use with the quiz database schema.
*
* @module quizUtils
* @file This file defines utilites for creating, manipulating, and
* processing quizzes defined by the quiz schema.
* @author syoung908
* @version 1.0.0
* @since 1.0.0
*/
... |
<filename>view/errors.go
package view
type Redirect string
func (self Redirect) Error() string {
return string(self)
}
type PermanentRedirect string
func (self PermanentRedirect) Error() string {
return string(self)
}
type NotFound string
func (self NotFound) Error() string {
return string(self)
}
type Forbid... |
def update_pin(users: dict):
previous_pin_inp = int(input('Please Enter previous PIN: '))
new_pin_inp = int(input('Please Enter new PIN: '))
if previous_pin_inp != new_pin_inp:
if previous_pin_inp in users:
users[int(new_pin_inp)] = users.pop(int(previous_pin_inp))
print(use... |
def longest_consecutive_ones(s: str) -> int:
max_count = 0
current_count = 0
for char in s:
if char == '1':
current_count += 1
max_count = max(max_count, current_count)
else:
current_count = 0
return max_count |
#!/usr/bin/env bash
# Base16 Atelier Lakeside Light - Mate Terminal color scheme install script
# Bram de Haan (http://atelierbramdehaan.nl)
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="Base 16 Atelier Lakeside Light 256"
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="base-16-atelier-lakeside-light-256"
[[ -z "$DCONFTOOL" ]] ... |
<reponame>phvictorino/scheduler-api
import { Body, Controller, Get, Post } from '@nestjs/common';
import { SchedulesService } from './schedules.service';
import { Schedule } from '../../collections/schedule';
import { CreateScheduleDTO } from './dtos/create-schedule.dto';
@Controller('schedules')
export class Schedule... |
package set summary "Network authentication protocol"
package set webpage "https://web.mit.edu/kerberos"
package set src.url "https://kerberos.org/dist/krb5/1.18/krb5-1.18.3.tar.gz"
package set src.sum "e61783c292b5efd9afb45c555a80dd267ac67eebabca42185362bee6c4fbd719"
package set sourced "src"
package set bsystem "conf... |
#!/bin/bash
# Setup postgres 9.3 or 11,
# install wal-e,
# run backup fetch
echo -e "\n$APP_WRAPPER$ENCD_INSTALL_TAG $(basename $0)"
# Check previous failure flag
if [ -f "$encd_failed_flag" ]; then
echo -e "\n\t$APP_WRAPPER$ENCD_INSTALL_TAG $(basename $0) Skipping: encd_failed_flag exits"
exit 1
fi
echo -... |
<gh_stars>0
/**
* @module enum
*/
// 基础类型空间占用
export const enum ByteLength {
INT8 = 1,
UINT8 = 1,
INT16 = 2,
UINT16 = 2,
INT32 = 4,
UINT32 = 4,
INI64 = 8,
UINT64 = 8,
FLOAT32 = 4,
FLOAT64 = 8
}
|
<reponame>AIJoeDev/nuxt-firebase-ssr<gh_stars>1-10
// derived from the js-cookie source files.
export default function(rawCookies, key) {
rawCookies = rfc6265Converter(rawCookies).split(';');
const jar = [];
rawCookies.forEach(c => {
const crumbs = c.split('=').map(x => x.trim());
let content;
try {
... |
#!/bin/bash
# Function to execute command inside Docker container and check for expected output
execute_and_verify() {
local container_name=$1
local command=$2
local expected_output=$3
# Execute command inside the container and capture the output
output=$(docker exec "${container_name}" /bin/su - root -mc "... |
class Container:
def __init__(self, container_id):
self.container_id = container_id
class LabManager:
def __init__(self, instrument, containers):
self.mount = instrument.mount
self.containers = [
Container(container)
for container in containers
]
... |
package leetCode;//给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。
//
// 异位词 指字母相同,但排列不同的字符串。
//
//
//
// 示例 1:
//
//
//输入: s = "cbaebabacd", p = "abc"
//输出: [0,6]
//解释:
//起始索引等于 0 的子串是 "cba", 它是 "abc" 的异位词。
//起始索引等于 6 的子串是 "bac", 它是 "abc" 的异位词。
//
//
// 示例 2:
//
//
//输入: s = "abab", p = "ab"
//输出: [0,1,2]
/... |
<reponame>ultimategdbot/ultimategdbot-core
package com.github.alex1304.ultimategdbot.core;
import static reactor.function.TupleUtils.function;
import java.time.Duration;
import com.github.alex1304.ultimategdbot.api.Translator;
import com.github.alex1304.ultimategdbot.api.command.Context;
import com.github.alex1304.u... |
require "rus_bank_rails/acts_as_bank"
require "rus_bank_rails/acts_as_region"
module RusBankRails
end
|
/*
* Copyright (c) 2006-2014 <NAME> <<EMAIL>>,
* 2006-2009 <NAME> <<EMAIL>>,
* 2015 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all co... |
<filename>test/content.test.js<gh_stars>0
import puppeteer from 'puppeteer';
import path from 'path';
import assert from 'power-assert';
describe('backgroud.js', function () {
let browser;
beforeEach(async function () {
const pathToExtension = path.join(__dirname, '../dist');
browser = await puppeteer.lau... |
<gh_stars>10-100
/* Copyright (c) 2001-2014, The HSQL Development Group
* 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 not... |
#!/bin/bash
#set -x
set -e
ops_man_version=2.2.6
if [ -f ./keysrc ]; then
echo "found rc file, sourcing..."
echo
source ./keysrc
fi
pivnet_token=${PIVNET_TOKEN:-fake}
region=${AWS_REGION:-us-west-2}
az=${AWS_REGION:-us-west-2a}
echo "region : $region"
echo "az : $az"
ip=$(./whats-my-ip.sh)
repl... |
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
local source="${BUILT_PRODUCTS_DIR}/Pods-URLImageCache_Example/$1"
loc... |
#!/bin/bash
cat list.txt | awk -F"(" '{ print $2 }' | awk -F"/" '{ print $1 }' | awk -F")" '{ print $1 }' > good-serials.txt
|
#! /usr/bin/env bash
test -e /etc/os-release && cat /etc/os-release
if [ -n "${BUILD_NATIVE_GEM:-}" ] ; then
# normally part of rake-compiler-dock runas which we can't easily use in concourse
. /etc/rubybashrc
ln -s /usr/local/rake-compiler "$HOME"/.rake-compiler
export RAKE_EXTENSION_TASK_NO_NATIVE=true
fi
... |
#!/usr/bin/env bash
set -e
readonly PROGNAME=$(basename $0)
readonly ARGS="$@"
function usage {
cat <<- EOF
usage: $PROGNAME DEST
Downloads the file at the given url checking it against the given sha256.
If checksum matches return 0 otherwise delete the downloaded file and return non-zero.
Dow... |
def LCS(x , y):
# find the length of the strings
m = len(x)
n = len(y)
# declaring the array for storing
# the dp values
L = [[None]*(n+1) for i in range(m+1)]
"""Following steps build L[m+1][n+1]
in bottom up fashion
Note: L[i][j] contains length of
LCS of X[0... |
import numpy as np
def calculate_scores(state, next_state, action):
front_foot = state[:, 7]
my_range = 0
heading_penalty_factor = 10
scores = np.zeros(len(action))
# Apply penalty based on front foot position
scores[front_foot >= my_range] += heading_penalty_factor
# Adjust scores based ... |
<filename>priest-satellite-api/src/main/java/com/kinstalk/satellite/service/api/LogApiService.java
package com.kinstalk.satellite.service.api;
import com.kinstalk.satellite.domain.LogApi;
import com.kinstalk.satellite.domain.ReportDayApi;
import com.kinstalk.satellite.domain.ReportLastApi;
import com.kinstalk.satelli... |
<filename>src/main/java/net/jamsimulator/jams/mips/simulation/file/event/SimulationFileOpenEvent.java<gh_stars>1-10
/*
* MIT License
*
* Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Softwa... |
<filename>console/src/boost_1_78_0/libs/preprocessor/test/seq.cxx
# /* **************************************************************************
# * *
# * (C) Copyright <NAME> 2002.
# * Distributed under the Boost Software License, Ver... |
#!/bin/bash
rofi_command="rofi -theme powermenu.rasi"
power_off=""
reboot=""
lock=""
suspend="鈴"
log_out=""
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)"
case $chosen in
$power_off)
promptmenu.sh --yes-command "systemct... |
#!/bin/sh
NV=`python3 -c 'import ninfs.__init__ as i; print(i.__version__)'`
DMGDIR=build/dmg/ninfs-$NV
rm -rf $DMGDIR
set -e -u
mkdir -p $DMGDIR
cp -rpc dist/ninfs.app $DMGDIR/ninfs.app
ln -s /Applications $DMGDIR/Applications
cp resources/MacGettingStarted.pdf $DMGDIR/Getting\ Started.pdf
hdiutil create -format U... |
<reponame>kali-linux-sh/4METHOD
import urllib, urllib.request
print("================================")
print("------DobleHtMl-----------------")
print("================================ \n")
url = input("Ingrese algun url: ")
nombre = input("Ruta o nombre: ")
with urllib.request.urlopen(url) as html_handler:
html = st... |
<filename>tests/tests.runtime.js
"use strict";
QUnit.test( "Runtime: API", function test(assert){
assert.expect( 14 );
assert.ok( _isFunction( any ), "any(..)" );
assert.ok( _isFunction( nul ), "nul(..)" );
assert.ok( _isFunction( undef ), "undef(..)" );
assert.ok( _isFunction( string ), "string(..)" );
assert.... |
#include <stdio.h>
#include <cstdint>
#include <iostream>
#include <array>
#include <filesystem>
#include <string>
#include <optional>
#include <glm/glm.hpp>
#include "SOIS/ImGuiSample.hpp"
#include "SOIS/ApplicationContext.hpp"
#include "SOIS/Renderer.hpp"
#include "SDL.h"
#include "imgui_stdlib.h"
#include "imgui_... |
export function cli_arguments () {
var argv = process.argv,
imax = argv.length,
i = 2,
args = {
args: []
},
x;
for (; i < imax; i++){
x = argv[i];
if (x[0] === '-') {
args[x.replace(/^[\-]+/, '')] = true;
continue;
}
var eq = x.indexOf('=');
if (eq !== -1) {
args[x.substring... |
// https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
var WshShell = new ActiveXObject("WScript.Shell");
var OEMCP = WshShell.RegRead("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage\\OEMCP");
var ACP = WshShell.RegRead("HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\C... |
<gh_stars>0
package net.blay09.mods.cookingforblockheads.client.model;
// Designed by Blay09 with Cubik Studio - https://cubik.studio
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
public class ModelCabinet extends ModelBase {
protected boolean isFlipped;
pu... |
<reponame>uconomy/tezos-builder-suite<filename>backend/src/graphql/context.ts<gh_stars>1-10
import { Contract } from "../domain/contract";
import { Endpoint } from "../domain/endpoint";
export type ApolloContext = {
contracts: Contract[];
endpoint: Endpoint;
onDeployCompleted?: (contract: Contract, address: stri... |
#!/bin/zsh
MLFLOW_HOST=192.168.4.94
MLFLOW_PORT=1235
REMOTE_SERVER_URI="http://${MLFLOW_HOST}:${MLFLOW_PORT}"
python scripts/train.py \
--remote-server-uri $REMOTE_SERVER_URI \
--experiment-name so-split-1 \
--run-name sa-sa-cm \
--batch-size 32 \
--data-dir ~/neural-tpps/data \
--load-from-dir ~/neural-t... |
#!/bin/bash
for i in "$@"
do
case $i in
--service=*)
service_name="${i#*=}"
shift
;;
--namespace=*)
namespace="${i#*=}"
shift
;;
--serverIp=*)
serverIp="${i#*=}"
shift
;;
esac
done
hub_user_name="nirmata"
project_name="kyverno"
if [ -z "${service_name}" ]; then
servi... |
#!/bin/bash
for number in {1..5}
do
sbatch scripts/main_signif_needles3.sh ${number}
done |
// Regular expression pattern to validate given email address
let validationPattern = /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/; |
var _deserialize_pooling2d_8cpp =
[
[ "BOOST_FIXTURE_TEST_CASE", "_deserialize_pooling2d_8cpp.xhtml#a871d76879d1522921464a09b07e9f0b4", null ],
[ "BOOST_FIXTURE_TEST_CASE", "_deserialize_pooling2d_8cpp.xhtml#a5053bdb79d4e6b3d9ea00d5aa8f7ff65", null ],
[ "BOOST_FIXTURE_TEST_CASE", "_deserialize_pooling2d_8cp... |
String[] animals = { "cat", "dog", "bird", "horse", "cow" };
List<String> filteredAnimals = Arrays.stream(animals)
.filter(a -> a.length() > 5)
.collect(Collectors.toList());
System.out.println(filteredAnimals); // ["bird", "horse", "cow"] |
/**
* @description Majuscule à la 1ère lettre d'une string.
* @param {String} s
* @returns {String}
* @examples capitalize('hello world!') → 'Hello world!'
*/
function capitalize (s) {
if (typeof s !== 'string') return ''
return s.charAt(0).toUpperCase() + s.slice(1)
}
module.exports = capitalize
|
/*
* 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 ... |
class PrisonerAvailabilityValidation
include MemoryModel
PRISONER_ERRORS = [
Nomis::PrisonerDateAvailability::OUT_OF_VO,
Nomis::PrisonerDateAvailability::EXTERNAL_MOVEMENT,
Nomis::PrisonerDateAvailability::BOOKED_VISIT
].freeze
attribute :prisoner, :nomis_prisoner
attribute :requested_slots, :co... |
public class ProgEx9_4 {
static int nCalls;
public static void main(String args[]) {
nCalls = 0;
for (int i=0; i<10; i++)
System.out.println(count());
}
static int count() {
return nCalls++;
}
}
|
<reponame>smagill/opensphere-desktop
package com.bitsys.common.http.ssl;
import java.security.PublicKey;
import java.security.cert.CertificateException;
import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.X509Certificate;
import ja... |
#!/bin/bash -xe
PSK=$1
PeerVPNSubnets=$2
yum -y install openvpn
#/usr/sbin/openvpn
mkdir -p /data/openvpn/{etc,sbin}
##
echo "daemon
;mode server
cd /data/openvpn/etc/
dev tun
proto tcp-server
;proto udp
port 1200
secret static.key
ifconfig 10.8.0.1 10.8.0.2
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
pers... |
#!/usr/bin/env bash
#
# script to start influxdb and compile influxdb-java with all tests.
#
set -e
DEFAULT_INFLUXDB_VERSION="1.8"
DEFAULT_MAVEN_JAVA_VERSION="3-openjdk-16-slim"
INFLUXDB_VERSION="${INFLUXDB_VERSION:-$DEFAULT_INFLUXDB_VERSION}"
MAVEN_JAVA_VERSION="${MAVEN_JAVA_VERSION:-$DEFAULT_MAVEN_JAVA_VERSION}"
e... |
export const faWarnIfIconSpecMissing = () => {
console.error('FontAwesome: Property `icon` is required for `fa-icon`/`fa-duotone-icon` components. ' +
`This warning will become a hard error in 0.6.0.`);
};
|
#!/bin/bash
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... |
#!/bin/bash
# Copyright 2017-2020 Authors of Cilium
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o pipefail
set -o nounset
MAKER_IMAGE="${MAKER_IMAGE:-docker.io/cilium/image-maker:3e2ea4f151593908c362307a1de22e68610d955c}"
if [ "$#" -ne 1 ] ; then
echo "$0 supports exactly 1 argument"
exit 1
fi
ro... |
<reponame>kancerberus/gestorServicios<gh_stars>1-10
/*
* 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 editor.
*/
package bd;
import java.sql.Connection;
import java.sql.ResultSet;
import... |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/zsh_completion" ] && \. "$NVM_DIR/zsh_completion" # This loads nvm zsh_completion
|
<reponame>amypritc/MemoryGroup
package com.youngki.memory_project;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.ut... |
<reponame>blainehansen/simple-query
import 'mocha'
import { expect } from 'chai'
import '@ts-std/extensions/dist/array'
import * as sql from './sql'
import { boil_string } from '../utils.spec'
import {
Arg, BooleanOperator,
Query, QueryColumn, QueryRawColumn, QueryBlock, SimpleTable, TableChain, ForeignKeyChain, Key... |
<reponame>rafax/sourcegraph<filename>internal/database/query/query.go
// Package query provides an expression tree structure which can be converted
// into WHERE queries. It is used by DB APIs to expose a more powerful query
// interface.
package query
import (
"fmt"
"github.com/keegancsmith/sqlf"
)
// Q is a quer... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-shuffled/model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-shuffled/512+0+512-N-VB-ADJ-ADV-256 --do_eval --per_... |
<gh_stars>0
define([
'webix', './state-router', './upload'
], function(webix, stateRouter, upload) {
return function(initialState, defaultState) {
defaultState = defaultState || initialState;
webix.ready(function() {
stateRouter.addState(upload);
stateRouter.on('routeNotFound', funct... |
#!/usr/bin/env python
""" nav_square.py - Version 1.1 2013-12-20
A basic demo of the using odometry data to move the robot
along a square trajectory.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2012 Patrick Goebel. All rights reserved.
This program is free software; y... |
<gh_stars>0
// file : xsde/cxx/parser/validating/gday.hxx
// author : <NAME> <<EMAIL>>
// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file
#ifndef XSDE_CXX_PARSER_VALIDATING_GDAY_HXX
#define XSDE_CXX_PARSER_VALIDATING_GDAY_HXX
#i... |
#!/usr/bin/env bash
set -eo pipefail
set -o errexit
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker tag opentracing-spring-haystack-example expediadotcom/opentracing-spring-haystack-example:${SHA}
docker push expediadotcom/opentracing-spring-haystack-example:${SHA}
docker tag ope... |
import matplotlib
matplotlib.use('Agg')
import torch
from torch import nn
from model_helper import load_checkpoint_reconstruct, predict_im, calc_val_metrics
from image_helper import process_image
import argparse
from data_helper import load_labels, make_dataloader
import numpy as np
parser = argparse.ArgumentParser... |
<reponame>Th3Shadowbroker/AtMessage
package com.th3shadowbroker.AtMessage.Etc;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class AtMessageSendEvent extends Event {
//Sender as player
private final Player sender;
//Target as P... |
def search_string(database, string):
if string in database:
return True
else:
return False |
package com.linwei.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @Author: WS
* @Time: 2020/4/27
* @Description: 界面跳转变量注解
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIE... |
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
package com.twilio.twiml.voice;
import com.twilio.converter.Promoter;
import com.twilio.twiml.TwiML;
import java.net.URI;
/**
* TwiML wrapper for {@code <Sip>}
*/
public class ReferSip extends TwiML... |
#! /bin/sh
EVE_IP=$(curl -s "http://169.254.169.254/eve/v1/network.json" | jq -r '."external-ipv4"')
echo ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa root@"$EVE_IP" -p "$1" grep Ubuntu /etc/issue
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no -i /root/.ssh/id_rsa root@"$EVE_IP" -p "... |
<filename>func-rxjava2/src/main/java/cyclops/rxjava2/container/higherkinded/Rx2Witness.java<gh_stars>0
package cyclops.rxjava2.container.higherkinded;
import com.oath.cyclops.anym.extensability.MonadAdapter;
import cyclops.monads.AnyM;
import cyclops.monads.WitnessType;
import cyclops.rxjava2.adapter.FlowableAdapter;
... |
<gh_stars>0
package ch15.ex6;
public class ex156
{
// TODO
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.