text stringlengths 1 1.05M |
|---|
<reponame>MrDemonRush/longest-consecutive-sequence
module.exports = function longestConsecutiveLength(array) {
if(array.length == 0){
return 0;
} else if(array.length == 1){
return 1;
}
let count = 0;
array.sort(function(a,b){return a-b;})
const arr = [];
for(let i = 0 ; i < array.length ; i++){
if(arra... |
#include <vector>
template <typename Type, typename volMesh>
class YourDerivedClass : public transformFvPatchField<Type> {
public:
YourDerivedClass(const fvPatch& p, const DimensionedField<Type, volMesh>& iF)
: transformFvPatchField<Type>(p, iF),
fixedValue_(p.size(), pTraits<Type>::zero) {
... |
<filename>title/arm9/source/bootstrapsettings.cpp
#include "common/inifile.h"
#include "common/bootstrappaths.h"
#include "bootstrapsettings.h"
#include <string.h>
BootstrapSettings::BootstrapSettings()
{
bstrap_debug = false;
bstrap_logging = false;
bstrap_romreadled = BootstrapSettings::ELEDNone;
bstrap_load... |
#include <iostream>
#include <cstdlib>
#include <cstring>
void disp_help(const char* programName) {
// Implementation of help display logic
}
int main(int argc, char* argv[]) {
char rangeChar[10]; // Assuming a maximum length for the range character
int opt;
while ((opt = getopt(argc, argv, "hr:c:"))... |
public static int factorial(int n) {
if (n == 0) {
return 1;
}
return n * factorial(n-1);
}
// testing
public static void main(String[] args) {
System.out.println(factorial(5)); // Output: 120
} |
<reponame>adrienkohlbecker/hypervisor
#!/usr/bin/python
import sys
USAGE = 'USAGE:\n\tsort_ini.py file.ini'
def sort_ini(fname):
"""sort .ini file: sorts sections and in each section sorts keys"""
f = file(fname)
lines = f.readlines()
f.close()
f = file(fname, 'w')
f.truncate(0)
section = ''
subcat = ... |
package com.bitsys.common.http.entity.content;
import com.bitsys.common.http.header.ContentType;
/**
* This class defines a string body part.
*/
public class StringBodyPart extends AbstractContentBodyPart<String>
{
/**
* Constructs a new {@linkplain StringBodyPart} from the given text and
* content ty... |
#!/bin/sh
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]
then
export DEPLOY_DESTINATION=${DEPLOY_DESTINATION:-/var/www/html/releases}
else
export DEPLOY_DESTINATION=${DEPLOY_DESTINATION:-/var/www/html/edge/osx}
fi
export DEPLOY_USER="${DEPLOY_USER:-ubuntu}"
REMOTE_HOST="$1"
if [ "$TRAVIS_EVENT_TYPE" != "cron" ]
then
REMOTE_DIR=... |
#!/usr/bin/env bash
source $DOT_ROOT/constants.sh
source $DOT_ROOT/lib/os.sh
DOT_MODULE="enable-services"
#TODO 4jane
if [ "$DOT_OS" == "linux_arch" ]; then
if pacman -Q sddm &> /dev/null; then
log info "enabling sddm"
sudo systemctl enable sddm
fi
fi
|
package main
import (
"context"
"crypto/sha256"
"fmt"
"log"
"net/http"
"os"
"time"
"github.com/gorilla/mux"
"github.com/tarikeshaq/personal-blog-api/models"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
type key string
const (
hostKey = key("hostKey")
usernameKey... |
#!/bin/sh
#
# Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the F... |
package com.createchance.imageeditor.drawers;
import com.createchance.imageeditor.shaders.WindowBlindsTransShader;
/**
* Window blinds transition drawer.
*
* @author createchance
* @date 2019/1/1
*/
public class WindowBlindsTransDrawer extends AbstractTransDrawer {
@Override
protected void getTransitionS... |
#!/bin/sh
# check to see if the publish directory is a git submodule
verify_publish_submodule() {
write_out "y" "TEST"
write_out -1 "Verify if publish directory '${INPUT_HUGO_PUBLISH_DIRECTORY}' contains a git submodule."
if [ -f ".gitmodules" ]; then
SUBMODULE_PATH=$(git config -f .gitmodules --g... |
/**
* Created by Bob on 29-1-2016.
*/
$(function() {
//var test = document.getElementById('test');
//test.addEventListener('click', ajaxHandler);
$('#test').click(function(){
//$.ajax({
// url: 'assessment/'+$(this).data('block'),
// type: "get",
// success: func... |
package io.cattle.iaas.healthcheck.process;
import io.cattle.iaas.healthcheck.service.HealthcheckService;
import io.cattle.platform.core.model.HealthcheckInstance;
import io.cattle.platform.core.model.HealthcheckInstanceHostMap;
import io.cattle.platform.core.model.Instance;
import io.cattle.platform.engine.handler.Ha... |
<reponame>sbnair/PolkaJS<gh_stars>1-10
import type { CodecHash, Hash } from '../interfaces/runtime';
import type { Codec, Constructor, Registry } from '../types';
import BN from 'bn.js';
declare type SetValues = Record<string, number | BN>;
/**
* @name Set
* @description
* An Set is an array of string values, repres... |
def WordSplit(data):
splitList = []
for item in data:
splitList += item.split(' ')
return splitList |
const path = require('path')
const merge = require('webpack-merge')
const config = require('../config')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpackBaseConfig = require('./webpack.base.conf')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const Ext... |
<gh_stars>1-10
import moduleHome from './home/module_home'
import moduleDetail from './detail/module_detail'
const modules = {
moduleHome,
moduleDetail
}
export default modules |
export APP_PATH=/me/wendysa/helloservlet;
export CATALINA_HOME=/usr/local/tomcat;
export TARGET_DIR=$CATALINA_HOME/webapps/ROOT/WEB-INF/classes;
export TOMCAT_CONTAINER_NAME=tomcatdev;
export WEB_INF=$CATALINA_HOME/webapps/ROOT/WEB-INF;
# Ensure that `classes` folder in $TOMCAT_CONTAINER_NAME:$TARGET_DIR directory has... |
<reponame>MOAMaster/AudioPlugSharp-SamplePlugins<filename>vst3sdk/public.sdk/samples/vst/syncdelay/source/syncdelaycontroller.cpp
//-----------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Examples
// Filename : public.sdk/samples/vst/syncdelay/source... |
package com.nils.engine.state;
import java.awt.Graphics;
import com.nils.engine.main.GameContainer;
public abstract class State {
protected StateHandler sh;
protected GameContainer gc;
protected String tag;
public State(StateHandler sh, GameContainer gc, String tag) {
this.sh = sh;
this.gc ... |
#!/usr/bin/env bash
set -ev
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=$CONF ..
make -j 4
./unit_test_all
cd ../pykeyvi
python setup.py build --mode $CONF
python setup.py install --user
py.test tests
cd ..
|
# Use embedded signing from template with added document
# Check that we're in a bash shell
if [[ $SHELL != *"bash"* ]]; then
echo "PROBLEM: Run these scripts from within the bash shell."
fi
# Check for a valid cc email and prompt the user if
#CC_EMAIL and CC_NAME haven't been set in the config file.
source ./exam... |
#!/bin/bash
#SBATCH --mail-type=END
#SBATCH --mail-user=ma.xu1@northeastern.edu
#SBATCH -N 1
#SBATCH -p ai-jumpstart
#SBATCH --gres=gpu:8
#SBATCH --cpus-per-task=64
#SBATCH --mem=512Gb
#SBATCH --time=1-23:59:00
#SBATCH --output=%j_fcvt_v5_32_TTFF_W_13_13.log
source activate timm
cd /scratch/ma.xu1/ShiftFormer
CUDA_VIS... |
#!/bin/bash
cd `dirname $0`
pkill -f localdriver
mkdir -p ~/voldriver_plugins
rm ~/voldriver_plugins/localdriver.*
mkdir -p ../mountdir
driversPath=$HOME/voldriver_plugins
~/localdriver -listenAddr="127.0.0.1:9876" -transport="tcp-json" -mountDir="../mountdir" -driversPath="${driversPath}" -requireSSL=true -caFile... |
<reponame>derikolsson/trendable<filename>lib/concerns/trendable.rb
module Trendable
module Concern
extend ActiveSupport::Concern
included do
scope :order_by_trending, -> { order( trending_power: :desc ) }
scope :items_to_fade_trending_power, -> { where( "trending_power > 0" ) }
def self.ha... |
#!/bin/bash
# Actifio Copy Data Storage SARGPACK
# Copyright (c) 2018 Actifio Inc. All Rights Reserved
# This script collects health checks
# Version 1.0 Initial Release
# Now check for inputs app name length (l) delim (c) help (h)
while getopts :f opt
do
case "$opt"
in
f) fileonly=y;;
... |
package com.example.memorandum.activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.MenuIt... |
import json
import logging
import requests
import responses
import pebbles.drivers.provisioning.openshift_driver as openshift_driver
from pebbles.tests.base import BaseTestCase
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class PBClientMock(object):
def __init__(sel... |
<reponame>isaacmariga/Akan_Name_Site
$('#submit').on('click', () => {
let year = $('#birthYear').val();
let fname = $('#firstName').val();
let month = $('#birthMonth').val();
let date = $('#birthDate').val();
let gen = $('#gender').val();
let date2 = new Date($('#dateDate').val());
let day2... |
var _;
_ = Uint8ClampedArray.length;
_ = Uint8ClampedArray.name;
_ = Uint8ClampedArray.prototype;
_ = Uint8ClampedArray.BYTES_PER_ELEMENT;
|
import Route from '@ember/routing/route';
import { underscore } from '@ember/string';
import store from 'kursausschreibung/framework/store';
export default Route.extend({
model(params) {
let event = store.getEventById(params.event_id);
// check if event exists in area and category
let areaKey = undersco... |
#!/usr/bin/env python3
# encoding: utf-8
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras import Model as M
from tensorflow.keras import Input as I
from tensorflow.keras import Sequential
from skimage.util.shape import view_as_windows
from tensorflow.ker... |
<filename>certbot/configuration.py
"""Certbot user-supplied configuration."""
import copy
import os
from six.moves.urllib import parse # pylint: disable=import-error
import zope.interface
from certbot import constants
from certbot import errors
from certbot import interfaces
from certbot import util
@zope.interfac... |
<filename>gridgo-bean/src/main/java/io/gridgo/bean/impl/AbstractBContainer.java<gh_stars>1-10
package io.gridgo.bean.impl;
import io.gridgo.bean.BContainer;
import io.gridgo.bean.factory.BFactory;
import lombok.Getter;
import lombok.Setter;
public abstract class AbstractBContainer extends AbstractBElement implements ... |
SELECT department, AVG(salary)
FROM employees
GROUP BY department; |
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
function ReplaceContentInContainer(id, content) {
var container = document.getElementById(id);
container.innerHTML = content;
}
async function Lyrics() {
for (var key in json) {
await sleep(4500);
ReplaceCon... |
gpu=$1
model=$2
bert_dir=$3
output_dir=$4
adapter_dir=$5
adapter_dir_2=$6
add1=$7
add2=$8
add3=$9
## DST
CUDA_VISIBLE_DEVICES=$gpu python main_domain_adapter_fusion.py \
--my_model=BeliefTracker \
--model_type=${model} \
--dataset='["multiwoz"]' \
--task_name="dst" \
--earlystop="joint_acc" \
-... |
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
# script global variables
color_charge_primary_tier8=''
color_charge_primary_tier7=''
color_charge_primary_tier6=''
color_charge_primary_tier5=''
color_charge_primary_tier4=''
color_charge_primary_tie... |
#!/bin/sh -l
set -e # if a command fails it stops the execution
set -u # script fails if trying to access to an undefined variable
echo "[+] Action start"
SOURCE_BEFORE_DIRECTORY="${1}"
SOURCE_DIRECTORY="${2}"
DESTINATION_GITHUB_USERNAME="${3}"
DESTINATION_REPOSITORY_NAME="${4}"
GITHUB_SERVER="${5}"
USER_EMAIL="${6... |
<reponame>my-msblog/msblog-vite<filename>src/api/model/client/article.ts
import { TagVO } from "./home";
export interface CommentItemVO{
id: number;
articleId: number;
parentId: number;
publishTime: Date;
children: CommentItemVO[];
context: string;
like: number;
commenterId: number;
... |
def is_perfect_cube(n):
i = 0
while i*i*i < abs(n):
i = i + 1
if i*i*i == abs(n):
return True
else:
False;
n = 8
print(is_perfect_cube(n)) |
import React, {useState, useEffect} from 'react';
const MyList = (props) => {
const [listItems, setListItems] = useState([]);
const [searchText, setSearchText] = useState('');
const [sortCriteria, setSortCriteria] = useState('');
useEffect(() => {
let items = [...props.data];
if (searchText) {
items = items.fi... |
<gh_stars>1-10
package com.wixpress.dst.greyhound.core.zioutils
import org.apache.kafka.common.KafkaFuture
import zio.blocking.Blocking
import zio.{blocking, RIO, ZIO}
object KafkaFutures {
implicit class KafkaFutureOps[A](val future: KafkaFuture[A]) {
def asZio: RIO[Blocking, A] = {
RIO.effectAsyncInterr... |
<reponame>lujanan/leetcode
package algorithm_0
import "sort"
// 合并区间
// https://leetcode-cn.com/problems/merge-intervals/
func merge(intervals [][]int) [][]int {
if len(intervals) <= 0 {
return nil
}
// 找到区间最大值
var max = 0
for _, v := range intervals {
if v[1] > max {
max = v[1]
}
}
var (
same [... |
<reponame>hongyuanhua/Devflow
import { config } from "../config.js";
const { backend } = config;
const { host, port } = backend;
export const checkSession = (app) => {
const url = host + port + "/auth/check-session";
console.log("in check session");
fetch(url)
.then((json) => {
console.log("check sessi... |
<gh_stars>0
package kbasesearchengine;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com... |
require.context('../', true, /\.(html|json|txt|dat)$/i)
require.context('../images/', true, /\.(gif|jpg|png|svg|eot|ttf|woff|woff2)$/i)
require.context('../stylesheets/', true, /\.(css|scss)$/i)
// TODO
import 'bootstrap'
import React from 'react'
import ReactDOM from 'react-dom'
import TopNav from './components/TopNa... |
<gh_stars>100-1000
import { commit } from '@collectable/core';
import { ListStructure, appendValues, createList } from '../internals';
export function of<T> (value: T): ListStructure<T> {
var state = createList<T>(true);
appendValues(state, [value]);
return commit(state);
} |
#!/bin/bash
ls ../source/. > file_list |
import tensorflow as tf
#define a layer
def layer(inputs, in_size, out_size):
weights = tf.Variable(tf.random_normal([in_size, out_size]))
biases = tf.Variable(tf.zeros([1, out_size]) + 0.1)
Wx_b = tf.matmul(inputs, weights) + biases
outputs = tf.nn.relu(Wx_b)
return outputs
#define inputs
inputs = tf.placehold... |
-- ***************************************************************************
-- File: 9_31.sql
--
-- Developed By TUSC
--
-- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant
-- that this source code is error-free. If any errors are
-- found in this source code, please repo... |
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'AC<KEY>'
auth_token = '<PASSWORD>'
@client = Twilio::REST::Client.new(accou... |
#!/bin/bash
# Generates a 10 character random password
# Generate random alphanumeric characters of length 10
# -n: length of characters
# -c: all characters including special characters
password=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-10})
echo "$password" |
#!/usr/bin/env bash
# This script is executed inside the builder image
set -e
PASS_ARGS="$@"
source ./ci/matrix.sh
if [ "$RUN_INTEGRATIONTESTS" != "true" ]; then
echo "Skipping integration tests"
exit 0
fi
export LD_LIBRARY_PATH=$BUILD_DIR/depends/$HOST/lib
cd build-ci/zenxcore-$BUILD_TARGET
if [ "$SOCKETEV... |
#!/bin/sh -e
set -x
version=${TRAVIS_TAG:-}
pyver=${TRAVIS_PYTHON_VERSION:-${PYENV_VERSION}}
if [ "$BUILD_DIST" = 'true' ]; then
appid=$(grep __app_id__ apluslms_roman/__init__.py|head -n1|cut -d"'" -f2)
appid="$appid.roman_tki"
if [ "$TRAVIS_OS_NAME" = 'osx' ]; then
# pyenv
PYENV_VERSION=${PYENV_VERSION:-$TR... |
#!/usr/bin/env bash
# Terminate already running bar instances
killall -q polybar
# If all your bars have ipc enabled, you can also use
# polybar-msg cmd quit
# Launch bar(s)
#echo "---" | tee -a /tmp/polybar1.log /tmp/polybar2.log
#polybar example 2>&1 | tee -a /tmp/polybar1.log & disown
if type "xrandr"; then
for... |
#!/bin/bash
source script/common/version.sh
header "$0"
#
# download the latest raspian image
# verify the checksum of the image
#
image_chk="$source_image_hash_expected $package"
if [ ! -f "$package" ]; then
msg "downloading $package"
curl $source_image_url/$source_image_archive -L -o $package -silent -ou... |
package io.lindstrom.mpd.data;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import io.lindstrom.mpd.data.descriptor.Descriptor;
import io.lindstrom.mpd.support.Utils;
import java.util.List;
import java.util.Objects;
@JsonProper... |
#!/bin/bash
set -e
if [[ -z "$TRUSTY_URL" ]]; then
export TRUSTY_URL=http://10.77.88.101:7880
fi
echo "TRUSTY_URL: $TRUSTY_URL"
cmd="$*"
echo "*** trusty: waiting for server..."
until curl -k $TRUSTY_URL/v1/status; do
>&2 echo "trusty is unavailable $TRUSTY_URL - sleeping"
sleep 6
done
>&2 echo "trusty is... |
export LIB_DIR=src
export TEST_DIR=test
export IMPLEMENTATIONS="(sagittarius@0.9.2)"
|
<filename>mobile/tests/utils/test_cache_helper.py
from unittest.mock import MagicMock
from django.core.cache import cache
from django.test import override_settings
from common.tests.core import SimpleTestCase
from mobile.utils.cache_helper import CacheHelper, get_or_set
@override_settings(CACHES={
'default': {
... |
package com.playMidi.player;
import android.util.Log;
import com.playMidi.player.Midi.MidiEvent;
import java.util.ArrayList;
/**
* Created by ra on 12/5/2016.
*/
public class SoundEventRecycler {
private ArrayList<SoundEvent> allocated;
private ArrayList<SoundEvent> cached;
public SoundEventRecycler... |
<reponame>flerro/ddb-mapping-plugin
package com.github.flerro.ddbmapping;
import com.intellij.codeInsight.generation.PsiFieldMember;
import com.intellij.ide.util.MemberChooser;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.project.Project;
import com.intellij.ui.NonFocusableCheckBox;
im... |
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache... |
<filename>src/document/document.service.ts
import { Injectable } from '@nestjs/common';
import { CreateDocumentDto } from './dto/create-document.dto';
import { UpdateDocumentDto } from './dto/update-document.dto';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Documents, Docu... |
#!/bin/bash
node_version='0.12.7'
#Check if node version manager is installed.
if [ ! -f ~/.nvm/nvm.sh ] ; then
echo "Installing node version manager - to let you easilly switch between different versions of node"
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash
fi
. $HOME/.n... |
<filename>modules/caas/backend/src/main/java/io/cattle/platform/allocator/port/PortManager.java
package io.cattle.platform.allocator.port;
import io.cattle.platform.core.util.PortSpec;
import java.util.Collection;
public interface PortManager {
boolean portsFree(long clusterId, long hostId, Collection<PortSpec>... |
# ubuntu/libs
init() {
echo "init"
}
run() {
apt-get update
apt-get install -y --no-install-recommends \
autoconf \
automake \
cmake \
curl \
dpkg-dev \
file \
gfortran \
libbluetooth-dev \
libbz2-dev \
libc6-dev \
libe... |
<reponame>benoitc/pypy
""" The rpython-level part of locale module
"""
import sys
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from pypy.rpython.tool import rffi_platform as platform
from pypy.rpython.extfunc import register_external
class Locale... |
<html>
<head>
<title>Sign Up</title>
<script>
function validateForm() {
var email = document.forms["signup"]["email"].value;
var username = document.forms["signup"]["username"].value;
var password = document.forms["signup"]["password"].value;
if (email == "") {
alert("Email address is required");
return false;
}
if ... |
pattern = r"^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$" |
var boots = [
{
name:"<NAME>",
type:"Boots",
weight:0,
hc:false,
season:false,
craft:{
rp:25,ad:12,vc:45,fs:2,db:8
},
smartLoot:[
"<NAME>",
"Monk",
"Barbarian",
"Crusader",
"Wizard",
"Witch Doctor"
],
primary:{
RANDOM:4
},
secondary:{
RANDOM:2
},
set:'Asheara\'s V... |
//go:build darwin
// +build darwin
package fsevents
import (
"github.com/noncgo/x/darwin/corefoundation"
"github.com/noncgo/x/darwin/internal/cabi"
"github.com/noncgo/x/darwin/internal/types"
)
// Stream is an opaque reference to a FSEventStream type.
//
// References
// • https://developer.apple.com/documentati... |
#!/bin/bash
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
BuildStep() {
DefaultPythonModuleBuildStep
}
InstallStep() {
DefaultPythonModuleInstallStep
}
ConfigureStep() {
return
}
|
<reponame>nft-login/nft-marketplace<gh_stars>1-10
import { Token } from "./token";
export interface Blockchain {
init(): Promise<void>;
chainId(): Promise<string>;
contractAddress(): Promise<string>;
loadContract(contractAddress: string): Promise<void>;
account(): Promise<string>;
balance(): Pr... |
// Define the generatePassword function seperately
function generatePassword(){
/* ________ Local Variables ________ */
// Const variable initialized to the value of the user num input
let userNumInput = prompt('Select Desired Password Length, Min: 8, Max: 128', '48');
// const variable for charsets
// const... |
#!/bin/bash
# jprobeit.sh
# Wrapper script to help setup the jprobe(s) on a given file and function.
#
# Kaiwan N Billimoria
# License: MIT
#
name=$(basename $0)
source ./common.sh || {
echo "$name: could not source common.sh , aborting..."
exit 1
}
########### Functions follow #######################
# Function ... |
#!/bin/bash
jekyll serve -D -H lianli > serve.log 2>&1
|
#!/usr/bin/env node
import * as fs from "fs";
import * as util from "util";
import * as path from "path";
import * as FileChanges from "./FileChanges";
const fsExists = util.promisify(fs.exists);
const fsWriteFile = util.promisify(fs.writeFile);
const fsMakeDir = util.promisify(fs.mkdir);
const fsReadFile = util.prom... |
<gh_stars>0
$(document).ready(function(){
$("[name='approved']").bootstrapSwitch();
$('.button-approved').click(function(){
var id = $(this).find(':first-child').attr('alt');
$(this).removeClass('default');
$(this).addClass('green-jungle');
... |
#!/usr/bin/env bash
# The glyph to replace
GLYPH="0u007e"
# Diminished or not
DIM=""
# help function
ricty_discord_pather_help()
{
echo "Usage: ricty_discord_patcher [options]"
echo ""
echo "Options:"
echo " -h Display this information"
echo " -d Patch to RictyDiminishedDiscord"
... |
package org.glowroot.instrumentation.mongodb;
import org.glowroot.instrumentation.api.Descriptor;
import org.glowroot.instrumentation.api.Descriptor.PropertyType;
@Descriptor(
id = "mongodb",
name = "MongoDB",
properties = {
@Descriptor.Property(
... |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.reduxInspector... |
/*
Copyright 2017 IBM Corp.
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, software
distr... |
// Copyright © 2019 <NAME> <<EMAIL>>
// This file is part of GoatCounter and published under the terms of the EUPL
// v1.2, which can be found in the LICENSE file or at http://eupl12.zgo.at
package main
import (
"bytes"
"compress/gzip"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"strconv"
"strings"
"t... |
#!/bin/sh
SCRIPT="$0"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DI... |
from CCSAmongUs import routes
def handle_player_action(player_id, action, action_details):
if action == "move":
target_location = action_details.get("target_location")
routes.move_player(player_id, target_location)
elif action == "interact":
target_player_id = action_details.get("target... |
<reponame>JackBryce/Artificial-Intelligence
#include "Core.h";
//This constructor runs the Core AI.
Core::Core(int count) {
//Variables
KeyGenerator kg = new KeyGenerator();
AIs.push_back(new ArtificialIntelligence());
key = kg.generateKey(binary(count));
updatedKey = key;
//Processes
while (updated... |
<filename>dhis-2/dhis-api/src/test/java/org/hisp/dhis/sms/config/GenericHttpGatewayConfigTest.java
package org.hisp.dhis.sms.config;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.StringRe... |
#!/bin/bash -e
echo "Copy failed. Kill container."
kill -9 `pgrep -f cron`
|
python train/train.py \
test-stl-nw-noprofit-R \
--experiment-name=test-stl-nw-noprofit-R \
--num-env-steps=1600000000 \
--algo=ppo \
--use-gae \
--lr=2.5e-4 \
--clip-param=0.2 \
--value-loss-coef=0.5 \
--num-envs=800 \
--num-actors=8 \
--num-splits=2 \
--eval-num-process... |
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "Usage: $0 <restart|no-restart>"
exit 1
fi
echo "Starting developer docker container"
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
IMG=codabuilder:latest
MYUID=$(id -u)
MYGID=$(id -g)
DOCKERNAME="codabuilder-$MYUID"
if [[ $1 == "restart" ]]; then
if $(docker ps | ... |
<reponame>kariminf/LangPi<gh_stars>1-10
/* NaLanGen: Natural Language Generation tool:
* It contains tools to generate texts in many languages
* --------------------------------------------------------------------
* Copyright (C) 2015 <NAME> (<EMAIL>)
*
* Licensed under the Apache License, Version 2.0 (the "Licen... |
#!/usr/bin/env bash
# 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
# "Lice... |
#! /usr/bin/python -u
def hash_function(text):
out = 0
for c in text:
out += ord(c)
return out % 100
print hash_function("hello") # -> 32
print hash_function("world") # -> 52
print hash_function("!") # -> 33
|
import { Injectable } from '@nestjs/common';
import { CreateTweetDto } from './dto/create-tweet.dto';
@Injectable()
export class TweetsService {
create(createTweetDto: CreateTweetDto) {
console.log(createTweetDto.message);
return 'This action adds a new tweet';
}
}
|
#!/bin/bash
# Define the range of GitHub repositories based on the number of stars
gh_stars="1-10"
# Iterate through the specified range of GitHub repositories
for LQN in $(ls ../*/*mock.go ); do
# Extract the directory name from the file path
DIR=$(echo ${LQN}| awk -F/ '{print $2}')
# Remove the '_mock' suffix... |
SELECT *
FROM products
WHERE category = 'clothing'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.