text stringlengths 1 1.05M |
|---|
<filename>mongoose.js<gh_stars>0
const mongoose = require('mongoose');
mongoose.connect("mongodb://localhost:27017/autos",
{useNewUrlParser: true})
mongoose.connection
.once("open", () => console.log('Database verbonden! (mongoose.js, regel 6)'))
.on("error", (error => {
console.log("Oeps! Er is wat ... |
wrk -t100 -c500 -d20s http://localhost:8080 > wsgi-100-500.log
|
<reponame>addyvm22/vantageProject1
export class Event{
constructor(
public name : string,
public location : string,
public city: string,
public country :string,
public number_of_seats: string,
public start_date: string,
public end_date: string){
}
} |
<gh_stars>0
import { Injectable } from '@angular/core';
import { ToastrService, ToastrConfig, ProgressAnimationType } from 'ngx-toastr';
@Injectable()
export class ToastService {
private animationType: ProgressAnimationType = 'increasing';
private successToastOptions = {
positionClass: 'toast-top-cente... |
#!/usr/bin/env bash
docker-compose -f docker/tidb.yml up -d
docker-compose -f docker/neo4j.yml up -d
docker-compose -f docker/elasticsearch.yml up -d
|
<filename>pirates/piratesgui/GameOptionsMatrix.py<gh_stars>1-10
# File: G (Python 2.4)
GameOptionsMatrix = {
('0x0000', '0x0000', 'nt.2.5.1'): ('r1s0s0t1c0e0c2t2m0', 10.80522, 3.21062, 230),
('0x0000', '0x0000', 'posix.-1.-1.-1'): ('r0s1s0t4c1e1c1t1m0', 7.7054900000000002, 3.68554, 164),
('0x1002', '0x4152... |
#! /usr/bin/env bash
set -e
apt-get update -qq
apt-get upgrade -yqq
apt-get install python{,3}-pip python{,3}-dev build-essential python{,3}-virtualenv -yqq
if [ -f /.dockerenv ]; then
apt-get -yqq autoremove
apt-get -yqq clean
rm -rf /var/lib/apt/lists/* /var/cache/* /tmp/* /usr/share/locale/* /usr/share/... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.iosClose = void 0;
var iosClose = {
"viewBox": "0 0 512 512",
"children": [{
"name": "style",
"attribs": {
"type": "text/css"
},
"children": []
}, {
"name": "g",
"attribs": {},
"children": [{
... |
<filename>cblibrary/src/main/java/cbedoy/cblibrary/services/BlurService.java<gh_stars>1-10
/**
* Created by <NAME> on 15/05/14.
* exchange-android - Pademobile
*/
package cbedoy.cblibrary.services;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.R... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-old/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-old/7-1024+0+512-STWS-1 --do_eval --per_device_eval... |
use std::cmp::PartialEq;
struct Rect {
// Define the Rect struct properties
}
struct ComponentLink<T> {
// Define the ComponentLink struct properties
}
enum ShouldRender {
Yes,
No,
}
trait Component {
type Properties;
fn create(properties: Self::Properties, frame: Rect, _link: ComponentLink<... |
<gh_stars>0
package com.iafinn;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
i... |
<reponame>neonkitchen/disent
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# 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 "Software"), to deal
#... |
/**
* Copyright © 2015, University of Washington
* 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,... |
#!/bin/sh
export usb=/mnt/usb/usbdisk
export usb1=/mnt/usb/usbdisk1
|
#!/usr/bin/env bash
dir="$(dirname "$(realpath "$0")")"
function fail {
echo $1
exit $2
}
if [ $# -ne 0 ] ; then
fail "No argument expected" 2
fi
if ! which xmlstarlet >/dev/null 2>&1 ;then
fail "Need program xmlstarlet" 3
fi
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
fail "Cannot version bump on a P... |
#!/usr/bin/env bash
###############################################################################
# Copyright 2018 The Apollo Authors. 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... |
#! /bin/bash
#SBATCH -o /home/martin/workspace/sweet/benchmarks/rexi_tests_lrz_freq_waves/2015_12_27_scalability_rexi_fd/run_rexi_m000092_t008_n0064_r0001_a1.txt
###SBATCH -e /home/martin/workspace/sweet/benchmarks/rexi_tests_lrz_freq_waves/2015_12_27_scalability_rexi_fd/run_rexi_m000092_t008_n0064_r0001_a1.err
#SBATC... |
#!/bin/sh
#
# This script is used for adding and removing DNS records for VirtualBox vm instances, launched by Terraform
if [[ "${DNS_ACTION}" == "add" ]] && [[ $(grep -c "${IP} ${NODE_ALIAS} ${NODE_FQDN}" /etc/hosts) == 0 ]]; then
if (uname -a | grep -i 'darwin' >/dev/null); then # Host is macOS
echo "${PAS... |
<gh_stars>0
let value = 8000;
let x = 1;
let y = 10;
let z = 5;
let result = 1;
for (let i = value; i > 0; i = i - 1) {
x = x/i;
result = result + 6 * i;
}
console.log(result);
|
var fs = require('fs');
function getRecall(req, res) {
res.writeHead(200, {
'Content-Type': 'text/html;charset=utf-8'
});
function recall(data) {
res.write(data);
res.end('');
}
return recall;
}
module.exports = {
readImg: function(path, res) {
fs.readFile(pat... |
<reponame>smagill/opensphere-desktop<gh_stars>10-100
package io.opensphere.mantle.data.geom.style.impl;
import java.awt.Color;
import io.opensphere.core.geometry.renderproperties.BaseAltitudeRenderProperties;
import io.opensphere.core.geometry.renderproperties.DefaultBaseAltitudeRenderProperties;
import io.open... |
package v1.event;
import akka.actor.ActorSystem;
import play.libs.concurrent.CustomExecutionContext;
import javax.inject.Inject;
/**
* Custom execution context wired to "event.repository" thread pool
*/
public class EventExecutionContext extends CustomExecutionContext {
@Inject
public EventExecutionContex... |
<filename>jhiRoot/plantsMS/src/main/java/fr/syncrase/ecosyst/service/criteria/ClassificationCronquistCriteria.java<gh_stars>1-10
package fr.syncrase.ecosyst.service.criteria;
import java.io.Serializable;
import java.util.Objects;
import tech.jhipster.service.Criteria;
import tech.jhipster.service.filter.BooleanFilter;... |
#!/usr/bin/env bash
configfile=/usr/src/app/config/AnovaMaster.cfg
if [ ! -f $configfile ]; then
cp /usr/src/app/AnovaMaster.cfg.sample $configfile
fi
python run.py
|
package cyclops.container.chain;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import cyclops.container.traversable.IterableX;
import cyclops.container.control.Option;
import cyclops.container.immutable.impl.Chain;
import cyclops.container.immutable.ImmutableList;
i... |
#include <cxxabi.h>
#include <cstdint>
#include <memory>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <functional>
#include "capstone/capstone.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
#include "llvm/Object/ObjectF... |
<reponame>TartuNLP/bertnernazgul
from pathlib import Path
from configparser import ConfigParser
_config = ConfigParser()
_config.read("config/config.ini")
STANZA_PATH = _config['models']['stanza']
BERT_PATH = _config['models']['bert']
Path("logs/").parents[0].mkdir(parents=True, exist_ok=True) |
set -e
mkdir -p build
cd build
cmake ..
make -j20
./pbrt ../scenes/sure_test_scenes/staircase/scene_pt.pbrt
|
#!/bin/sh
# This script will automatically join the mesh network at PPS.
# Assuming you run Babel and AHCP, you can probably adapt it to your own
# network by tweaking the following parameters:
essid="pps"
channel=6
die() {
echo "$@" >&2
exit 1
}
findcmd() {
type "$1" > /dev/null || \
die "Coul... |
require 'rspec'
require_relative '../lib/spotify-playlist'
|
import React from 'react'
import Icon from 'react-native-vector-icons/MaterialIcons'
//import all the components we are going to use
import { StyleSheet, View, Text, ScrollView, Animated } from 'react-native';
export default function Tabs({ translateY }) {
return (
<Animated.View style={[styles.container, ... |
package com.momo.mapper.res.aclmanager;
import com.momo.mapper.dataobject.RoleDO;
import lombok.*;
/**
* @program: momo-cloud-permission
* @description: TODO
* @author: <NAME>
* @create: 2019-08-05 22:00
**/
@Getter
@Setter
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
//@EqualsAndHashCode(callSuper ... |
<filename>app.js<gh_stars>0
'use strict';
//GLOBAL VARIABLES
var salmonStore = [];
var _random = function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
};
//FUNCTIONS
//Constructor Function that builds a Store.
var Store = function (name, min_customers, max_customers, avg_cookies_per_cus... |
<filename>kdl_wagtail/zotero/migrations/0008_add_verbose_name_to_bibliography_fields.py<gh_stars>1-10
# Generated by Django 2.2.1 on 2019-05-16 10:26
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('kdl_wagtail_zotero', '0007_bibliogra... |
class GraphConverter:
def __init__(self, data):
self.data = data
def get_graph(self):
"""
Retrieves the graph data from the class.
"""
def fill_graph(self):
"""
Fills the graph data with the required format for ECharts.
"""
# Your solution co... |
#! /bin/sh
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program ... |
package moze_intel.projecte.api.mapper.generator;
import java.util.Map;
/**
* Defines something that can simply yield a mapping of values.
*
* @param <T> The key type
* @param <V> The value type
*/
public interface IValueGenerator<T, V extends Comparable<V>> {
/**
* Generate values for a mapper.
*/
Map<T,... |
/*
Copyright 2018 The OpenEBS Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
<filename>src/offer/offer.service.ts
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { DeleteResult, Repository } from 'typeorm';
import { Offer } from './../offer/offer.entity';
import { paginate, PaginateOptions } from './../pagination/paginator';
import { offe... |
def print_even(n):
for i in range(0, n+1):
if i%2 == 0:
print(i) |
<gh_stars>1-10
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { CookieSerializer } from '@ultimatebackend/common';
import { CoreModule, RolesRpcClientService, ServiceRegistryModule } from '@ultimatebackend/core';
import { AppController } from './app.controller';
import ... |
class Room:
def __init__(self, name, description, items=None, obstacles=None, exits=None):
self.name = name
self.description = description
self.items = items if items else []
self.obstacles = obstacles if obstacles else {}
self.exits = exits if exits else {}
def add_item... |
<reponame>lgoldstein/communitychest
package net.community.chest.awt.layout.gridbag;
import net.community.chest.lang.StringUtil;
import net.community.chest.reflect.NumberValueStringConstructor;
/**
* <P>Copyright 2007 as per GPLv2</P>
*
* @author <NAME>.
* @since Dec 4, 2007 2:09:48 PM
*/
public class GridBagSizi... |
def increment_list(arr):
for i in range(len(arr)):
arr[i] += 1
return arr |
# Copyright (c) 2017, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
set -o pipefail
#
# Purpose:
# Defines various shared utility functions, including a trace function.
#
# Load this file ... |
#!/bin/bash -e
# Run inside https://hub.docker.com/r/devexpress/devextreme-build/
trap "echo 'Interrupted!' && kill -9 0" TERM INT
export DEVEXTREME_DOCKER_CI=true
export NUGET_PACKAGES=$PWD/dotnet_packages
function run_lint {
npm i eslint eslint-plugin-spellcheck stylelint stylelint-config-standard npm-run-all... |
package me.insidezhou.southernquiet.job.driver;
import me.insidezhou.southernquiet.Constants;
import me.insidezhou.southernquiet.amqp.rabbit.*;
import me.insidezhou.southernquiet.job.AmqpJobAutoConfiguration;
import me.insidezhou.southernquiet.job.JobProcessor;
import me.insidezhou.southernquiet.logging.SouthernQuietL... |
package training.binarysearchtree;
import training.binarytree.TreeNode;
import org.junit.jupiter.api.Test;
import java.util.function.BiFunction;
import static training.binarytree.TreeNode.newTree;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
im... |
package org.museautomation.ui.extend.actions;
import org.slf4j.*;
/**
* @author <NAME> (see LICENSE.txt for license details)
*/
public abstract class UndoableAction extends BaseEditAction
{
// implement the undo here
protected abstract boolean undoImplementation();
public boolean execute(UndoStack ... |
const rule = require("../accessible-emoji");
const makeRuleTester = require("./makeRuleTester");
makeRuleTester("accessible-emoji", rule, {
valid: [
"<div />",
"<span />",
"<span role='img' aria-label='Panda face'>😰</span>",
"<span role='img' aria-label='Snowman'>☃</span>",
"<span aria-hid... |
'use strict';
const assert = require('chai').assert;
const random = require('../../../src/util/random.js');
describe('random.js', function () {
describe('#', () => {
it('default arguments', () => {
let num = random();
assert.isNumber(num);
assert.notStrictEqual(String... |
<gh_stars>10-100
package httptest
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestQueryString(t *testing.T) {
t.Parallel()
s := httptest.NewServer(MockHandler(
Match(Get, Path("/api/v1/query... |
<filename>src/components/lettuce-button/lettuce-button.tsx<gh_stars>1-10
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {Component, h, Prop} from '@stencil/core';
@Component({
tag: 'lettuce-button',
styleUrl: 'lettuce-button.css',
shadow: true,
})
export class LettuceButton {
@Prop() tex... |
<filename>src/view/app/Components/ShowKeysCheckBox.tsx
import * as React from "react";
import "../Css/Toolbar.css";
interface ShowsKeysCheckBoxProps {
currentCheckBoxStatus: boolean;
onCheckBoxStausChange: (newStaus: boolean) => void;
}
// eslint-disable-next-line @typescript-eslint/naming-convention
const ShowKe... |
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author <NAME>
* @version 1.2
* @date Sat May 30 13:51:12 EDT 2015
* @see LICENSE (MIT style license file).
*/
package scalation.linalgebra.bld
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::... |
#!/usr/bin/env bats
#
# Copyright 2019 HAProxy Technologies
#
# 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... |
geneECsFile=$1
if [ ! -z $2 ]; then
outputDir=$2
if [ ! -d $outputDir ]; then
mkdir $outputDir
fi
else
outputDir="./"
fi
nGenes=$(cat $geneECsFile|wc -l)
for ((i=1;i<=nGenes;i++)); do
gene=`head -$i $geneECsFile|tail -1|column -t|cut -f 1 -d " "`
ecs=`head -$i $geneECsFile|tail -1|colum... |
<filename>lib/help/random_bytes.js
const crypto = require('crypto')
const { promisify } = require('util')
const randomFill = promisify(crypto.randomFill)
module.exports = async function randomBytes (bytes) {
const buf = Buffer.allocUnsafe(bytes)
return randomFill(buf)
}
|
<filename>src/main/java/io/github/intellij/dlanguage/jps/model/JpsDLanguageSdkType.java
package io.github.intellij.dlanguage.jps.model;
import com.intellij.openapi.util.SystemInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsDummyElement;
import org.jetbrains.jps.model.JpsElementFactory... |
#!/bin/bash
prepend_lines() {
tail --lines=+2 $1 | perl -p -e "s,^,$2,g;"
}
printf "dist\tsys\tworkload\ttime\ttput\n"
for dist in zipfian uniform ; do
for sys in hbase kudu ; do
prepend_lines $dist-$sys/load-100M.log.tsv "${dist}\t${sys}\tload\t"
prepend_lines $dist-$sys/run-workloada.log.tsv "${dist}\t$... |
<gh_stars>1-10
class AddIndexToDocumentType < ActiveRecord::Migration[5.0]
def change
add_index :content_items, :document_type
end
end
|
(function() {
let arr = [1,2,3];
let res = []
function arrange(arr, temp){
for(let i = 0,length = arr.length; i<length; i++) {
let _temp = temp.slice(0)
console.log('_temp: ', _temp)
// 最后一步
if (_temp.length == length - 1) {
if(!_temp.includes(arr[i])) {... |
<gh_stars>1-10
const fs = require("fs");
const logger = require("./logger.helper");
module.exports = {
saveTokens: globalStorage => {
try {
const fd = fs.openSync(`${__dirname}/../tmpTokens.js`, "w");
fs.writeSync(fd, "module.exports = {");
Object.keys(globalStorage.sock... |
<reponame>stungkit/wertik-js
const Wertik = require("./lib/next/index").default;
Wertik();
|
//
// Ryu
//
// Copyright (C) 2017 <NAME>
// All Rights Reserved.
//
// See the LICENSE file for details about the license covering
// this source code file.
//
#include <common/bytes.h>
#include "ram.h"
RTTR_REGISTRATION {
rttr::registration::class_<ryu::hardware::ram>("ryu::hardware::ram") (
rttr::metad... |
package pl.put.poznan.bootstrap_builder.logic;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InOrder;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
public class DirectorTest {
@Test
public void constructHTML() {
//setting object that mock will return
... |
<reponame>DrYaoHongBin/shop
package com.shop.dao.merchant;
import com.shop.model.merchant.Merchant;
import com.shop.util.BaseMapper;
public interface MerchantMapper extends BaseMapper<Merchant> {
} |
//
// Created by ooooo on 2020/3/11.
//
#ifndef CPP_014_1__SOLUTION2_H_
#define CPP_014_1__SOLUTION2_H_
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
/**
* dp[n] = max( dp[1] * dp[n-1], dp[2] * dp[n-2] )
*
* dp[n] 表示绳子长度为 n
*/
class Solution {
public:
int cuttingRope(int... |
package com.trackorjargh.javacontrollers;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ut... |
#!/bin/bash
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
# This script drives the experimental Ibex synthesis flow. More details can be
# found in README.md
set -e
set -o pipefail
error () {
echo >&2 "$@"
e... |
"""Utils for common operations in GUI tests
"""
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2017 ACK CYFRONET AGH"
__license__ = "This software is released under the MIT license cited in " \
"LICENSE.txt"
|
<gh_stars>1-10
SpacebarsCompiler.parse = function (input) {
var tree = HTMLTools.parseFragment(
input,
{ getTemplateTag: TemplateTag.parseCompleteTag });
return tree;
};
SpacebarsCompiler.compile = function (input, options) {
var tree = SpacebarsCompiler.parse(input);
return SpacebarsCompiler.codeGe... |
#!/bin/bash
if [ ! -d "$HOME"/atshome ]; then mkdir -p "$HOME"/atshome; fi
pushd "$HOME"/atshome
wget --trust-server-name 'http://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-0.3.6/ATS2-Postiats-0.3.6.tgz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fats2-lang%2Ffiles%2Fats2-lang%2Fats2-postiats... |
#!/usr/bin/env python
#
# Copyright (c) 2016 by MemSQL. 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/LICENSE-2.0
#
# Unless requ... |
//父子组件通讯
export default{
store:null,
Instance(Vue){
if(this.store===null){
this.store=new Vue;
}
},
}
|
package db
import (
"context"
"time"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
)
const (
database = "btcPrice"
// CollectionPrice a collection name for CRU pic
CollectionPrice = "prices"
// CollectionUser a collection name for CR user... |
<filename>src/com/samoleary/Mobile_Asn_Two/GameFinish.java
package com.samoleary.Mobile_Asn_Two;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.database... |
var path = require('path');
var fileSystem = require('fs');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var AureliaWebpackPlugin = require('aurelia-webpack-plugin');
var pkg = require('./package.json');
var outputFileTemplateSuffix = '-' + pkg.version;
var vendorPackages ... |
#!/bin/bash
#$ -cwd
#$ -l mem_free=2G,h_vmem=3G,h_fsize=100G
#######################################
# Shell script to run debris simulation
#######################################
# This script runs part of the debris simulation by:
# (i) converting BAM to SAM
# (ii) parsing through the merged SAM file to lyse some... |
<reponame>AJS-development/UnBottable-MultiOgar
// Import
var BinaryWriter = require("./BinaryWriter");
var Logger = require('../modules/Logger');
function UpdateNodes(playerTracker, addNodes, updNodes, eatNodes, delNodes) {
this.playerTracker = playerTracker;
this.addNodes = addNodes;
this.updNode... |
package io.opensphere.kml.common.model;
/**
* An interface for a KML controller.
*/
public interface KMLController
{
/**
* Adds data to the controller.
*
* @param dataEvent The data event
* @param reload Flag indicating if this is a reload
*/
void addData(KMLDataEvent dataEvent, bool... |
#!/usr/bin/env bash
# This script is only relevant if you're rolling nixos.
# Esy (a bisect_ppx dependency/build tool) is borked on nixos without using an FHS shell. https://github.com/esy/esy/issues/858
# We need to patchelf rescript executables. https://github.com/NixOS/nixpkgs/issues/107375
set -x
fhsShellName="sq... |
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo Authors. 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... |
((LIB = {}) => {
loadingControl: {
let is_initializing = true;
// these class names get added to document.body
// css controls what is visible through that mechanism
const StatusMode = {
DONE: "mode-done",
PROGRESS: "mode-progress",
INDETERMINATE: "mode-indeterminate",
NOTICE:... |
#!/bin/bash
DB_NAME="nba" DB_HOST="localhost" DB_USER=nba_sql DB_PASSWORD=nba_sql python stats/nba_sql.py --current_season_mode --database="postgres"
|
<filename>src/main/java/mastermind/views/console/menu/command/OpenSavedGameCommand.java
package mastermind.views.console.menu.command;
import mastermind.controllers.StartController;
import mastermind.views.console.menu.SavedGameSelectMenu;
public class OpenSavedGameCommand extends Command {
public OpenSavedGame... |
"""
Create a deep learning network to predict the price of a stock given a set of features.
"""
import tensorflow as tf
def create_model(input_shape):
model = tf.keras.models.Sequential([
tf.keras.layers.Input(shape=input_shape),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(128, activa... |
def swap_key_value(d):
swapped_dict = {value: key for key, value in d.items()}
return swapped_dict
d = {'a': 1, 'b': 2, 'c': 3}
result = swap_key_value(d)
print(result) |
import requests
from bs4 import BeautifulSoup
def count_tags(url):
r = requests.get(url)
soup = BeautifulSoup(r.text, 'html.parser')
count = len(soup.find_all())
return count |
<filename>spec/chewy/search/parameters/types_spec.rb<gh_stars>1-10
require 'chewy/search/parameters/string_array_storage_examples'
describe Chewy::Search::Parameters::Types do
it_behaves_like :string_array_storage, nil
end
|
import java.util.ArrayList;
import java.util.List;
public class ReverseList {
public static void main(String[] args){
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(3);
list.add(7);
list.add(10);
System.out.println("Original list: " + list);
... |
#!/bin/bash
curl -O https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
|
ALTER TABLE users DROP COLUMN gh_avatar; |
class GameAgent:
def __init__(self, grid_size, target_score):
reset_game_state(grid_size)
self.grid_size = grid_size
self.target_score = target_score
self.game_state = setup()
def reset_game_state(self, grid_size):
self.board = [[0 for _ in range(grid_size)] for _ in ran... |
#include <stdio.h>
#include <math.h>
typedef struct {
float x, y, z;
} vec3;
typedef struct {
float distance;
vec3 intersection_point;
} IntersectionResult;
IntersectionResult calculateIntersection(vec3 orig, vec3 dir) {
IntersectionResult result;
result.distance = INFINITY;
result.intersecti... |
#!/bin/bash
babel -o ../dist/main.gs main.js
cd ..
gapps upload
cd src
|
#!/bin/tcsh
foreach i (`ls *|grep -v *.sh`)
echo $i;
set newname=`echo $i|awk -F '.html' '{print $1}'`
echo $newname
mv $i $newname;
end
|
<reponame>xasopheno/chai-mocha-basics
(function() {
if(!mocha) {
throw new Exception("mocha library does not exist in global namespace!");
}
/*
* Mocha Events:
*
* - `start` execution started
* - `end` execution complete
* - `suite` (suite) test suite execution s... |
#pragma once
namespace UEAA
{
class DeHashTable;
unsigned CStringToHash (const char *cString, DeHashTable *deHashTable = 0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.