text stringlengths 1 1.05M |
|---|
<filename>183 - Steal Diamond Game/script.js
document.querySelector('body').addEventListener('mousemove', eyeBall);
function eyeBall() {
let eye = document.querySelectorAll('.eye');
eye.forEach( eye => {
let x = (eye.getBoundingClientRect().left) + (eye.clientWidth / 2);
let y = (eye.getBoundingClientRect().to... |
def solveSudoku(board):
row, col = findEmptyCell(board)
if row == -1 and col == -1:
return True
for num in range(1, 10):
if validSolution(board, row, col, num):
board[row][col] = num
if solveSudoku(board):
return True
board[row][col] = 0
... |
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include "atl/status.h"
#include "atl/optional.h"
#include "atl/time.h"
#include "atl/file.h"
#include "atl/colors.h"
#include "atl/string.h"
#include "serializer.h"
#include "worklog.h"
#include "utils.h"
std::string Template() {
worklog:... |
<gh_stars>0
declare const checkUpdate: (timeout?: number) => Promise<void>;
export default checkUpdate;
|
'use strict'
var test = require('tap').test
var pino = require('../')
var sink = require('./helper').sink
var os = require('os')
var pid = process.pid
var hostname = os.hostname()
var level = 50
var name = 'error'
test('err is serialized with additional properties set on the Error object', function (t) {
t.plan(2)
... |
<filename>Hackerrank/Java/Java MD5.java
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Solution {
private static Scanner scanner = new Scanner(System.in);
p... |
<filename>Documentation/backends_2reference_2workloads_2_space_to_batch_n_d_8cpp.js
var backends_2reference_2workloads_2_space_to_batch_n_d_8cpp =
[
[ "GetOffset", "backends_2reference_2workloads_2_space_to_batch_n_d_8cpp.xhtml#adafb0fd0a3f6435c2bdf41f971761ecf", null ],
[ "SpaceToBatchNd", "backends_2reference... |
package io.opensphere.core.control.action;
/**
* Manages events related to context menus and subscriptions for menu button
* providers.
*/
public interface ContextActionManager
{
/**
* De-register any single action provider which is not the default provider
* for the context and notify it that it has ... |
<gh_stars>1-10
import commonjs from 'rollup-plugin-commonjs';
import { uglify } from 'rollup-plugin-uglify';
import babel from 'rollup-plugin-babel';
import pkg from './package.json';
const input = 'src/index.js';
const name = 'whatsappChatParser';
const sourcemap = true;
const format = 'umd';
const exports = 'named';... |
#!/usr/bin/env bash
start_dashboard() {
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
kubectl apply -f dashboard.yml
echo "Bearer token for UI user."
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret ... |
<reponame>ReactionMap/main_canost
// assign_cast_code CASTコードをふる関数
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "main_canost.h"
// #define TEST_ASSIGN_CAST_CODE 1
extern int iatm;
extern struct atom *a1st;
extern int *cast_codes;
extern int *relative_parent;
int assign_cast_code( int epsilon... |
<gh_stars>1-10
const Command = require("../../structure/commands.js");
const { MessageEmbed } = require("discord.js");
const EcoleDirecte = require("node-ecole-directe");
class Login extends Command {
constructor(client) {
super(client, {
name: "login",
aliases: [],
e... |
#!/usr/bin/env bash
# One Half - Gnome Terminal color scheme install script
# Based on https://github.com/chriskempson/base16-gnome-terminal
[[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="One Half Dark"
[[ -z "$PROFILE_SLUG" ]] && PROFILE_SLUG="one-half-dark"
[[ -z "$DCONF" ]] && DCONF=dconf
[[ -z "$UUIDGEN" ]] && UUIDGEN=... |
import Head from "next/head";
import "antd/dist/antd.css";
const metaList = ["description", "keywords", "title", "name"];
export default function MyApp({
Component,
pageProps,
}: {
Component: any;
pageProps: any;
}) {
return (
<>
<Head>
<title><NAME> personal demo projects</title>
... |
#!/usr/bin/bash
set -x
FOLDER=${1:-mainnet.min}
while :; do
if command -v rclone; then
break
else
echo waiting for rclone ...
sleep 10
# need to discuss with LC
break
fi
done
# wait for harmony.service to start
sleep 30
# stop harmony service
sudo systemctl stop harmony.servi... |
#!/bin/bash
echo "~~~ MANAGERIAL: Installs management apps. ~~~";
echo "Installing:";
echo " dconf-tools: configuration toolkit";
echo " gconf-editor: configuration toolkit";
echo " unity-tweak-tool: Tweak Unity's appearance";
echo " htop: Processes Terminal Tool";
echo " acpi: Hardware Status Utility";... |
from pyedflib import EdfReader
def average_attribute_value(file_path: str, attribute_name: str) -> float:
# Open the EDF file using EdfReader
edf_file = EdfReader(file_path)
# Get the number of samples in the file
num_samples = edf_file.getNSamples()[0]
# Get the attribute values for the ... |
#!/bin/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
# "License");... |
<reponame>benmizrahi/benthos<filename>internal/old/input/socket.go
package input
import (
"context"
"errors"
"fmt"
"io"
"net"
"sync"
"time"
"github.com/benthosdev/benthos/v4/internal/codec"
"github.com/benthosdev/benthos/v4/internal/component"
"github.com/benthosdev/benthos/v4/internal/component/input"
"gi... |
<reponame>sparber/CComprehensiveDatatypes<filename>src/tree/declarations/TStorageClassSpecifier.java
package tree.declarations;
import tree.DefaultTreeNode;
import tree.symbols.TSAuto;
import tree.symbols.TSExtern;
import tree.symbols.TSRegister;
import tree.symbols.TSStatic;
import tree.symbols.TSThreadLocal;
import ... |
#!/bin/bash
echo "Clearing $(pwd)/website"
rm -rf website
mkdir website
echo "Copying $(pwd)/dist/* to $(pwd)/website/"
cp -R dist/* website/
echo "Copying $(pwd)/docs to $(pwd)/website/demo/docs"
mkdir -p website/demo/docs
cp -R docs/* website/demo/docs/
CURRENT_SHA="$(git rev-parse HEAD)"
git add website/
git com... |
import React from 'react';
import { Container, Row, Col } from 'react-bootstrap';
import { Image, Item } from 'semantic-ui-react';
import Navbar from '../components/Navbar';
import Ipsum from '../components/Ipsum';
import ImageExampleFluid from '../components/ImageExampleFluid';
import PageTitle from '../components/Pag... |
<reponame>danielleolgin/to-fix-backend<gh_stars>10-100
'use strict';
const _ = require('lodash');
const test = require('./lib/test');
const removeDates = require('./lib/remove-dates');
const checkLock = require('./lib/check-lock');
const turfRandom = require('@turf/random');
const listItemsFixture = [
{
id: '000... |
import random
def print_random_element(list):
index = random.randint(0, len(list)-1)
print(list[index]) |
<gh_stars>0
/**
* Main package
*/
package com.netcracker.ncstore; |
<reponame>WlodzimierzKorza/small_eod
from ..generic.serializers import UserLogModelSerializer
from .models import Note
class NoteSerializer(UserLogModelSerializer):
class Meta:
model = Note
fields = ["id", "case", "comment"]
|
mkdir -p ~/.streamlit/
echo "\
[general]\n\
email = \"cnhhoang850@gmail.com\"\n\
" > ~/.streamlit/credentials.toml
echo "\
[server]\n\
headless = true\n\
enableCORS=false\n\
port = $PORT\n\
" > ~/.streamlit/config.toml
|
#!/usr/bin/env bash
nValue=3;
baseFolderPath="../../../TORrent_";
lockFile=""
myPort=""
function getClientNumber {
let "number=$RANDOM % $nValue + 1 | bc";
let "port=$number + 10000";
if lsof -Pi :$port -sTCP:LISTEN -t >/dev/null ; then
echo $(getClientNumber)
else
echo $(checkFolder... |
// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Drone Non-Commercial License
// that can be found in the LICENSE file.
// +build !oss
package logs
import "testing"
func TestKey(t *testing.T) {
tests := []struct {
bucket string
prefix string
result string
}{... |
<gh_stars>0
import React from 'react'
import { Link } from 'gatsby'
import tkm from '../img/tkm.png'
export const Title = class extends React.Component {
render(){
return (
<section className="hero landing is-fullheight is-transparent">
<div className="hero-decoration-left" style... |
<reponame>EmreErinc/itms-wiki-app
package com.itms.wikiapp.userAuth.repository.impl;
import com.itms.wikiapp.userAuth.repository.CustomUserAuthRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class UserAuthRepositoryImpl implements... |
$(document).ready(function () {
var gridLoad = []
gridLoad["picAddForm"] = "index.php/welcome/picgrid";
gridLoad["picEditForm"] = "index.php/welcome/picgrid";
$('#data_grid').DataTable({
"ajax": {
url: '<?php echo base_url(); ?>' + "index.php/books/books_page",
type: 'GET'
},
});
// Activate tooltip... |
<filename>arm/asm.c
/*
* arm/asm.c: ARM assembly language output, Codemist version 21
* Copyright (C) Codemist Ltd., 1987-1993
* Copyright (C) Advanced RISC Machines Limited., 1990-1993
* SPDX-Licence-Identifier: Apache-2.0
*/
/*
* RCS $Revision$
* Checkin $Date$
* Revising $Author$
*/
/* Assembler output i... |
<reponame>Yuhtin/react-covid-tracker
export default class CountrySchema {
static schema = {
name: 'Country',
primaryKey: 'id',
properties: {
id: {type: 'string', indexed: true},
cases: 'int',
todayCases: 'int',
deaths: 'int',
recovered: 'int',
casesPerMillion: 'int',
... |
#include <iostream>
struct Node {
int data;
Node* next;
};
void insertAfter(Node* prevNode, int newData) {
if (prevNode == nullptr) {
std::cout << "Error: Previous node cannot be null for insertion." << std::endl;
return;
}
Node* newNode = new Node;
newNode->data = newData;
... |
#!/bin/bash
monerod=monerod
daemon=127.0.0.1
servdir=$1
serverid=$2
white=$($monerod --rpc-bind-ip $daemon --rpc-bind-port 18081 print_pl | grep white | awk '{print $3}' | cut -f 1 -d ":")
white_a=($white)
echo ${white_a[@]} > $servdir/monero.$serverid.iplist
|
import * as _ from 'lodash';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class WindowService {
window = window;
_resizeDebounced = _.debounce(this._resize.bind(this), 50, {'maxWait': 1000});
resize() {
this._resizeDebounced();
}... |
#!/bin/bash
###################################################
#
# Diff files in ADE with a git repo.
#
###################################################
. /etc/profile # setup ADE
PROG_PATH=${BASH_SOURCE[0]} # this script's name
PROG_NAME=${PROG_PATH##*/} # basename of script (strip path)
PROG_DIR="$... |
#!/bin/bash
lang_suffix=
echo "$0 $@" # Print the command line for logging
. utils/parse_options.sh || exit 1;
. cmd.sh
featdir=mfcc_vtln
num_leaves=2500
num_gauss=15000
# train linear vtln
steps/train_lvtln.sh --cmd "$train_cmd" $num_leaves $num_gauss \
data/train_si84 data/lang${lang_suffix} exp/tri2b exp/tri... |
<filename>tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/mixins/EchoValue3.java
// Copyright 2009 The Apache Software Foundation
//
// 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 Li... |
echo "install_python: start" \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh \
&& cargo install cargo-edit \
&& echo "install_python: end" \
|
package com.neusoft.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.neusoft.entity.vo.AnalContributionVo;
import com.neusoft.mapper.AnalContributionMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
... |
<gh_stars>0
def getans(n):
S=set()
for i in range(n):
k,v=raw_input().split(' ')
if not k in S:
S.add(k)
print k,v
getans(int(raw_input())) |
#!/bin/bash
set -euf -o pipefail
PYTHON2_VERSION=2.7.13
INSTALL_ROOT=.ros-root
if [ -z "$ALDE_CTC_CROSS" ]; then
echo "Please define the ALDE_CTC_CROSS variable with the path to Aldebaran's Crosscompiler toolchain"
exit 1
fi
docker build -t ros1-pepper -f docker/Dockerfile_ros1 docker/
if [ ! -e "Python-${PYT... |
#!/bin/bash
SHELL_FOLDER=$(
cd $(dirname $0)
pwd
)
FOLDER_NAME="${SHELL_FOLDER##*/}"
cd $SHELL_FOLDER
checkJava() {
if [[ $(type -p java) != "" ]]; then
_java=java
startApp
elif [[ -n $JAVA_HOME ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo Found Java executable in JAVA_HOME
_java="$JAVA_HOM... |
#!/bin/bash
__HDP_CURRENT_FOLDER__/hbase-master/bin/hbase-daemon.sh start master
|
# Generate CA
cfssl genkey -initca ca_csr.json | cfssljson -bare ca
# Get generate redoctober cert
cfssl gencert -ca ca.pem -ca-key ca-key.pem -config ca_signing_config.json redoctober_csr.json | cfssljson -bare redoctober
rm *.csr
|
#!/usr/bin/env bash
set -e
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CUR_DIR/../shell_config.sh
${CLICKHOUSE_LOCAL} --query "create table test engine Log as select 1 a"
# Should not see the table created by the previous instance
if ${CLICKHOUSE_LOCAL} --query "select * from test" 2>/dev/null
then
exi... |
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
public class LondonTime extends Application {
public static void main(String[... |
/*
* Small publish / subscribe to events module
* ------------------------------------------
*
* publish
*
* @param name [string]
* @param args [array] pass to callback function
*
* subscribe
*
* @param name [string] ( same as publish name )
* @param callback [function]
*/
let subscriptions = {};
const ... |
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package jenkins
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strconv"
"strings"
"v.io/jiri/collect"
)
func ... |
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
|
#!/usr/bin/env bash
##############################################################
# Usage #
# ./class_generator.sh basePath Class1 Class2 Class3 #
##############################################################
cd $1
for i in ${@:2}; do
echo "#include ... |
<filename>orderer.go
/*
Copyright: Cognition Foundry. All Rights Reserved.
License: Apache License Version 2.0
*/
package gohfc
import (
"google.golang.org/grpc"
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/orderer"
"context"
"fmt"
"google.golang.org/grpc/credentials"
"git... |
#! /bin/bash -e
# start OVS
service openvswitch-switch start
service docker start
# this cannot be done from the Dockerfile since we have the socket not mounted during build
set +e
echo 'Pulling the "ubuntu:trusty" and "ubuntu:xenial" image for later use...'
docker pull 'ubuntu:trusty'
docker pull 'ubuntu:xenial'
set... |
MININIX_PKG_HOMEPAGE=https://www.gpsbabel.org/
MININIX_PKG_DESCRIPTION="GPS file conversion plus transfer to/from GPS units"
MININIX_PKG_VERSION=1.4.4
MININIX_PKG_SHA256=22860e913f093aa9124e295d52d1d4ae1afccaa67ed6bed6f1f8d8b0a45336d1
MININIX_PKG_SRCURL=https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_${MININIX_PK... |
#!/bin/bash
# create a resource group for the clamav container instance
export LOCATION=westeurope
export ENVIRONMENT=${1}
readonly PERMITTED_ENVS=(
dev
prod
)
if [[ "$#" -lt 1 ]]; then
echo "Usage "${BASH_SOURCE[0]}" "${PERMITTED_ENVS[@]}" "
exit 1
fi
az group create \
--location ${LOCATION} \
... |
from astro3words import coords_to_words, words_to_coords
import what3words
import pytest
import numpy as np
def test_coords_to_words():
"""
Tests conversion of (ra, dec) coordinates to 3 words
with some edge coordinate cases.
"""
ra_list = [0, 90, 180, 360, 195.5]
dec_list = [-90, 0, 89.9, 90... |
import { Component, AfterContentInit } from '@angular/core';
import { TypedModelComponent } from '../base/TypedModelComponent';
import { SweDataRecord } from '../../../model/swe/SweDataRecord';
import { SweText } from '../../../model/swe/SweText';
import { SweTime } from '../../../model/swe/SweTime';
import { SweCount ... |
<reponame>Thangiee/digitalocean
package me.jeffshaw.digitalocean
import java.util.concurrent.TimeoutException
import me.jeffshaw.digitalocean.ToFuture._
import org.asynchttpclient.{AsyncHttpClient, Request, RequestBuilder, Response}
import org.json4s._
import org.json4s.native._
import scala.concurrent.{ExecutionConte... |
<reponame>TranBrian10/interactive-rtc
var express = require('express');
var router = express.Router();
/* GET home page */
router.get('/', function(req, res) {
res.render('index', { title: 'threeRTC' });
});
/* GET user agent */
router.get('/user-agent', function(req, res) {
const userAgent = req.header('user-agent... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-FW/7-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-FW/7-1024+0+512-pad-256 --do_eval --per_device_eval_ba... |
#!/bin/bash ../.port_include.sh
port=SDL2
version=serenity-git
workdir=SDL-master-serenity
useconfigure=true
curlopts="-L"
files="https://github.com/SerenityOS/SDL/archive/master-serenity.tar.gz SDL2-git.tar.gz"
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMakeToolchain.txt -DPULSEAUDIO=OFF"
configure(... |
#!/usr/bin/env bash
# Define directories.
SCRIPT_DIR=$PWD
TOOLS_DIR=$SCRIPT_DIR/tools
CAKE_VERSION=0.24.0
CAKE_DLL=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe
DOTNET_VERSION=$(cat "$SCRIPT_DIR/global.json" | grep -o '[0-9]\.[0-9]\.[0-9]')
DOTNET_INSTRALL_URI=https://raw.githubusercontent.com/dotnet/cli/v$DOTNET_VERSION/scr... |
#!/bin/bash
pkg update && pkg upgrade -y;
freebsd-update fetch && freebsd-update install;
portsnap fetch auto;
pkg clean -y;
pkg autoremove -y;
|
<filename>src/components/AboutMeSection.tsx
import React from "react";
import styled from "styled-components";
import { fonts, colors, screens } from "../utils/theme";
import profile from "../images/profile-photo.png";
const AboutMeSection = () => {
return (
<Container id="about-section">
{screen.width <= ... |
<filename>src/builder.ts
import { CxAccessor, CxEntry, CxRequest, CxValues } from '@proc7ts/context-values';
import { lazyValue } from '@proc7ts/primitives';
import { Supply } from '@proc7ts/supply';
import { CxBuilder$BoundPeer, CxBuilder$Cache } from './impl';
import { CxPeer } from './peer';
import { CxPeerBuilder }... |
echo "dummy3" |
# 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.
export EXTRA_LIBS="${NACL_CLI_MAIN_LIB}"
EnableGlibcCompat
NACLPORTS_CPPFLAGS+=" -DGNULIB_defined_struct_sigaction -Dpipe=nacl_spawn_pipe"
PatchS... |
#!/bin/bash
#
# Copyright (c) 2016 Intel Corporation
#
# 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... |
#!/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}"
# This protects against multiple targets copying the same framework dependency at the same time.... |
/*
* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General ... |
package org.moskito.controlagent.data.info;
/**
* Abstraction that allows to replace UptimeProvider for testing.
*
* @author lrosenberg
* @since 24.07.17 22:33
*/
public interface UptimeProvider {
long getUptime();
}
|
class PlayerMissileSystem : ClodoBehaviour {
List<Missile> activeMissiles = new List<Missile>();
public override void OnUpdate() {
UpdateMissiles();
}
public void FireMissile(Vector2 targetPosition, float missileSpeed, float maxRange) {
Missile newMissile = new Missile(transform.positi... |
import ctypes
import XCPConnection
def simulate_data_write(data_struct: dict) -> bool:
writeDataStruct = ctypes.create_string_buffer(ctypes.sizeof(ctypes.c_uint) * len(data_struct))
for i, value in enumerate(data_struct.values()):
ctypes.memmove(ctypes.addressof(writeDataStruct) + i * ctypes.sizeof(cty... |
<filename>blosc/bitshuffle-neon.h
/*********************************************************************
Blosc - Blocked Shuffling and Compression Library
Copyright (C) 2021 The Blosc Developers <<EMAIL>>
https://blosc.org
License: BSD 3-Clause (see LICENSE.txt)
Note: Adapted for NEON by <NAME>.
See LIC... |
if [ -f /etc/redhat-release ]; then
yum install -y git python-pip python-devel gcc
pip install paramiko PyYAML jinja2 httplib2 ansible
git clone https://github.com/rackspace-orchestration-templates/lamp
cd lamp/site-cookbooks/LAMP/files/default/lamp
ansible-playbook -i hosts site.yml
fi
if [ -f /etc/debian_v... |
<filename>src/main/java/pulse/input/package-info.java
/**
* Introduces internal data structures that (a) are created as a result of
* parsing specific types of input files, such as: experimental heating curves,
* metadata, and property curves (e.g. specific heat and density); (b) are used
* by the {@code TaskManage... |
#!/bin/sh -e
set -o errexit
###
# Copyright (c) 2015-2019, Antoine "vv221/vv222" Le Gonidec
# All rights reserved.
#
# 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 retain the a... |
#include <stdio.h>
#include <string.h>
void reverseString(const char *str) {
size_t len = strlen(str);
for (int i = len - 1; i >= 0; i--) {
printf("%c", str[i]);
}
printf("\n");
}
int main(int argc, char *argv[]) {
if (argc < 2) {
printf("Error: No string provided!\n");
return 1;
}
reverseString(argv[1]... |
#!/bin/bash
TASK_DESC=$1
DATE_WITH_TIME=`date "+%Y%m%d-%H%M%S"`
OUT_DIR=/data/Outputs/VISTA
CONFIG=$2
NUSC_CBGS_WORK_DIR=$OUT_DIR/VISTA_$TASK_DESC\_$DATE_WITH_TIME
if [ ! $TASK_DESC ]
then
echo "TASK_DESC must be specified."
echo "Usage: train.sh task_description"
exit $E_ASSERT_FAILED
fi
CUDA_VISIBLE_DE... |
import { ArrayMultiMap } from './structures';
describe('structures', () => {
describe('ArrayMultiMap', () => {
it('stores single item in an array', () => {
const mmap = new ArrayMultiMap<string, string>();
mmap.set('key', 'value');
expect(mmap.get('key')).toEqual(['value']);
});
it('ap... |
#!/usr/bin/env bash
if [ -f ~/.homestead-features/wsl_user_name ]; then
WSL_USER_NAME="$(cat ~/.homestead-features/wsl_user_name)"
WSL_USER_GROUP="$(cat ~/.homestead-features/wsl_user_group)"
else
WSL_USER_NAME=vagrant
WSL_USER_GROUP=vagrant
fi
export DEBIAN_FRONTEND=noninteractive
if [ -f /home/$WSL... |
<filename>examples/example_score.py<gh_stars>0
"""Example for using pytesserae.score"""
import pytesserae.score as score
def _run():
"""Example of how to score a match"""
matching_terms = {'a', 'b'}
source_counts = {'a': 10, 'b': 50, 'c': 25}
target_counts = {'a': 4, 'b': 73, 'c': 15}
source_chunk... |
#!/bin/bash
# This script parses in the command line parameters from runCust,
# maps them to the correct command line parameters for DispNet training script and launches that task
# The last line of runCust should be: bash $CONFIG_FILE --data-dir $DATA_DIR --log-dir $LOG_DIR
# Parse the command line parameters
# tha... |
import os
from django_chuck.commands.base import BaseCommand
class Command(BaseCommand):
help = "Shows all available modules"
def __init__(self):
super(Command, self).__init__()
# Disable default checks because this command isn't project-related
self.no_default_checks = True
def ... |
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
if [ -e "../acbuild-bin-0.4.0.tgz" ]
then
echo "Already built acbuild!"
exit 0
fi
rm -rf go acbuild
tar -xf go-bin-1.8.3.tgz go
tar -xf acbuild-src-0.4.0.tgz acbuild
VERSION=v0.4.0
sed -i "s/^VERSION=.*$/VERSION=${VERSION}/" acbuild/build
GLDFLAGS="-X github.com/a... |
/*
* Copyright 2021 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... |
# Start the tool, not for running the first time
docker start cannr-web
|
#!/bin/sh
#
# Update the misc/Cargo.lock file that we use for reproducible builds.
#
set -e
cd "$(git rev-parse --show-toplevel)"
mv Cargo.lock Cargo.lock.back 2> /dev/null || true
cargo update
mv Cargo.lock misc/
mv Cargo.lock.back Cargo.lock 2> /dev/null || true
|
<reponame>alparslanavci/hazelcast
/*
* Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/... |
package io.opensphere.mantle.data.analysis;
/**
* The Interface DataAnalysisReporter.
*/
public interface DataAnalysisReporter
{
/**
* Clear all column analysis data so that all must be re-determined.
*/
void clearAllColumnAnalysisData();
/**
* Clear column analysis for a dat... |
import {ADD_STRUCTURE_ITEM} from '../constants/actionTypes';
const structureItem = (state = {}, action) => {
switch (action.type) {
case ADD_STRUCTURE_ITEM:
return {
...state,
styles: action.styles,
colsId: action.colsId,
sortableId: action.sortableId
};
default:
... |
<reponame>qbancoffee/winfile
/*************************************************************
File name: save.c
Description:
Code for saving resources
Copyright(c) Microsoft Corporation.All rights reserved.
Licensed under the MIT License.
********************************************************... |
import { fixture, html, expect } from '@open-wc/testing';
import '../../../mock-wizard-editor.js';
import { EditingElement } from '../../../../src/Editing.js';
import { WizardingElement } from '../../../../src/Wizarding.js';
import { VoltageLevelEditor } from '../../../../src/editors/substation/voltage-level-editor.js... |
# titanic_queries.py
import os
from dotenv import load_dotenv
import psycopg2
from psycopg2.extras import execute_values
import json
import pandas as pd
import sqlite3
load_dotenv()
# Set path to titanic data
DATA_PATH = os.path.join(os.path.dirname(__file__), 'titanic.csv')
DB_HOST = os.getenv("DB_HOST2", default... |
const validateForm = () => {
const name = document.forms['myForm']['name'].value;
const email = document.forms['myForm']['email'].value;
if (name === '' || email === '') {
alert('Name and Email are required fields')
return false;
}
if (!email.includes('@') || !email.includes('.com')) {
alert('Invalid email ad... |
#include <iostream>
#include <string>
#include <vector>
// Class to represent an attribute
class Attribute {
public:
std::string name;
std::string type;
// Other properties of an attribute can be added here
};
// Class to represent metadata for a class
class ClassMetadata {
public:
std::string name;
... |
/**
*/
let CanonicalUmlXmiParser = function (opts) {
let NormalizeType = opts.normalizeType || (type => type)
let ViewPattern = opts.viewPattern || null
let NameMap = opts.nameMap || { }
let AGGREGATION_shared = 'AGGREGATION_shared'
let AGGREGATION_composite = 'AGGREGATION_composite'
var UPPER_UNLIMITED ... |
#!/bin/bash
i_device=0
n_devices=5
get_device_num()
{
device_num=$(( $i_device % $n_devices ))
echo $device_num
i=$((i_device + 1))
}
for j in {1..60..1}
do
get_device_num
done
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.