text stringlengths 1 1.05M |
|---|
<reponame>maximusofsky/spring-boot
/*
* Copyright 2007-2012 the original author or 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/LICE... |
<gh_stars>0
import { createSelector } from 'reselect';
const getRestaurants = state => state._root.entries[0][1].restaurantList;
export const getBestDeal = createSelector([getRestaurants], restaurants => {
if (restaurants) {
return restaurants.sort(
(a, b) => a.averageDishPrice - b.averageDishPrice,
)... |
<gh_stars>1-10
package cn.pasteme.common.utils.exception;
import cn.pasteme.common.utils.result.ResponseCode;
import lombok.Getter;
/**
* @author Lucien, 白振宇
* @version 1.0.0
*/
@Getter
public class GlobalException extends RuntimeException {
private ResponseCode responseCode;
public GlobalException(Resp... |
<filename>vseditors/src/main/java/org/museautomation/ui/valuesource/ValueSourceEditorListener.java<gh_stars>0
package org.museautomation.ui.valuesource;
import org.museautomation.core.values.*;
/**
* Listen for changes to a ValueSourceEditor
*
* @author <NAME> (see LICENSE.txt for license details)
*/
public inter... |
class QuickSort {
static int partition(int arr[], int low, int high) {
int pivot = arr[high];
int i = (low - 1);
for (int j = low; j <= high - 1; j++) {
if (arr[j] <= pivot) {
i++;
int temp = arr[i];
arr[i] = arr[j];
... |
package de.unistuttgart.ims.coref.annotator.document;
import java.util.Map;
import java.util.prefs.Preferences;
import org.apache.commons.collections4.multimap.HashSetValuedHashMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.uima.cas.Feature;
import org.apache.uima.cas.FeatureStructure;
import org... |
public class Invoker<T>
{
public T Invoke(T val)
{
return val;
}
} |
<filename>stack/Stack.js
class Stack {
constructor() {
this.items = []
this.count = 0
}
push(data) {
this.items[this.count] = data
this.count++
console.log(`${data} added to ${this.count}`)
return this.count - 1
}
pop() {
if(this.count == 0) ... |
<gh_stars>1-10
export default class FactuProProductVO {
public static API_TYPE_ID: string = "fp_product";
// L'id est fourni par l'API
public id: number;
public _type: string = FactuProProductVO.API_TYPE_ID;
// Référence interne
public ref: string;
// Libellé
public title: string;
... |
#include "src/fw.h"
void keyCallback(GLFWwindow* window, int key, int scancode, int action, int mods) {
switch (key) {
case GLFW_KEY_ESCAPE:
if (action == GLFW_PRESS)
glfwSetWindowShouldClose(window, GL_TRUE);
break;
default:
break;
}
}
void renderFunction() {
glClearC... |
#!/bin/bash
incfile=$1
MCPU=$2
echo " " >$incfile
echo "# $incfile: Generated from SOURCES file " >>$incfile
echo "# for MCPU = $MCPU " >>$incfile
echo " " >>$incfile
for pair in `cat SOURCES` ; do
i="${pair##*:}"
source_type="${pair%:*}"
typefile="${i##*.}"
filename="${i##*/}"
dirname="${i%/*... |
const mongoose = require('mongoose');
const MONGODB_URI = process.env.MONGODB_URI
const db = mongoose
.connect(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
// These are used to prevent the deprecation warning
// for unique values in tables
useFindAndMod... |
<reponame>mhk-github/Ruby
#! /usr/bin/env ruby
###############################################################################
# FILE : reward_none.rb
# DESCRIPTION : A class to represent no reward for the customer purchase.
# LICENSE : MIT
###############################################################... |
package cyclops.container.immutable.impl;
import cyclops.container.immutable.ImmutableSet;
import cyclops.container.persistent.PersistentBag;
import cyclops.function.higherkinded.DataWitness.bag;
import cyclops.function.higherkinded.Higher;
import cyclops.reactive.ReactiveSeq;
import java.io.Serializable;
import java.... |
import { LifecycleClass } from 'inferno-shared';
import { VNode } from '../core/VNodes';
export declare function mount(vNode: VNode, parentDom: Element | null, lifecycle: LifecycleClass, context: Object, isSVG: boolean): any;
export declare function mountText(vNode: VNode, parentDom: Element | null): any;
export de... |
#!/usr/bin/env bash
code=`/bin/curl --head --silent --show-error --write-out '%{http_code}' --output /tmp/head http://127.0.0.1:8080/handshakes`
[[ $code -eq 200 ]] || { echo "execution failed $code"; echo /tmp/head; exit 1; }
|
<filename>dist/bin/app.js
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
fun... |
import React, { Component } from "react";
class Form extends Component {
state = {
first_name: "",
last_name: ""
};
handleChange = e => {
const { name, value } = e.target;
this.setState({
[name]: value
});
};
render() {
return (
<form>
<input
type="text"
name="first_name"
value={this.sta... |
CREATE DATABASE parsetmpl_db
USE parsetmpl_db
CREATE TABLE template (
service_name varchar(30) not null,
feature_name varchar(30) not null,
feature_id varchar(30) not null,
feature_descr varchar(60) not null,
endpoints_path varchar(60) not null,
endpoints_methods varch... |
#! /bin/ksh
always_pfl(){
route "${cblue}>> always_pfl${cnormal}"
route "${cblue}<< always_pfl${cnormal}"
}
configure_pfl(){
route "${cblue}>> configure_pfl${cnormal}"
export PARFLOW_INS="$pfldir/bin"
export PARFLOW_BLD="$pfldir/build"
# export PFV="oas-gpu"
export RMM_ROOT=$pfldir/rmm
#
C_FLAGS="-... |
#!/bin/bash
host="${HOST:-localhost:8080}"
curl -X POST ${host}/businessservices -d \
'{
"createUser": "tackle",
"name": "Marketing",
"Description": "Marketing Dept.",
"owner": {
"id": 1
}
}' | jq -M .
|
#!/usr/bin/env bash
# Copyright 2016 The Kubernetes Authors.
# Copyright 2020 Authors of Arktos - file modified.
#
# 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... |
<reponame>kaomte/rails_typed_settings
class CreateSettings < ActiveRecord::Migration
def change
create_table :settings do |t|
t.string :var_name, null: false
t.string :var_type, null: false
t.text :description
t.text :transformed_value
t.text :default_transformed_value
t.timest... |
public class GCD {
public static void main(String[] args) {
int num1 = 86;
int num2 = 12;
int gcd = 1;
for(int i = 1; i <= num1 && i <= num2; ++i)
{
// Checks if i is factor of both integers
if(num1 % i == 0 && num2 % i == 0)
gcd = i;
... |
#!/bin/bash
gpu='1,5'
data_dir='/home/bqw/nlp_data/cnndm/graph_bert/cnndm'
model_dir='../models/abs_gate_cnn'
result_dir='../logs/abs_gate_cnn'
ip=5515
log_dir='../logs/abs_gate_cnn'
train_step=140000
test_log='../logs/abs_gate_valid_cnn'
copy=False
lr_dec=0.2
warm_dec=10000
grad_norm=0
gate=True
max_pos=512
max_tgt_l... |
from pyVmomi import vim
from pyVim.connect import SmartConnect, Disconnect
import ssl
class VSphereManager:
def __init__(self, server, username, password, skip_verification=False):
self.server = server
self.username = username
self.password = password
self.skip_verification = skip_v... |
#!/usr/bin/env bash
# sudo loop
sudo -v
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# setup compilers first
sudo port -N install gcc11 mpich-default
# port select --list gcc
sudo port -N select --set gcc mp-gcc11
# port select --list mpi
sudo port -N select --set mpi mpich-mp-fortr... |
<reponame>vfdev-5/polyaxon
import * as _ from 'lodash';
import * as React from 'react';
import * as actions from '../../actions/project';
import { getProjectUrl, getUserUrl } from '../../constants/utils';
import ActivityLogs from '../../containers/activityLogs';
import Builds from '../../containers/builds';
import Exp... |
# Sets reasonable macOS defaults.
#
# Or, in other words, set shit how I like in macOS.
#
# The original idea (and a couple settings) were grabbed from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
#
# Run ./set-defaults.sh and you'll be good to go.
# Disable press-and-hold for keys in favor of key... |
#!/bin/bash
# texttobinary.sh
function usage {
echo "usage: texttobinary.sh [-d] [-w width] [-e endian] < in.txt > out.dat"
echo "converts comma-separated numbers on stdin to binary data on stdout"
echo "-d: debug print string of hex escapes"
echo "-w: width in bytes of binary word, default is 4"
echo "-e: ... |
<reponame>lananh265/social-network
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ecommerce_receipt_rublo = void 0;
var ecommerce_receipt_rublo = {
"viewBox": "0 0 64 64",
"children": [{
"name": "g",
"attribs": {},
"children": [{
"name": "polygon",
"a... |
#!/bin/sh -e
# hello-go-deploy-marathon example-01 build.sh
echo " "
if [ "$1" = "-debug" ]
then
echo "************************************************************************"
echo "* build.sh -debug (START) **********************************************"
echo "*******************************************... |
export const ACTIVE_CHAT = 'ACTIVE_CHAT';
export const ACTIVE_CHAT_USER = 'ACTIVE_CHAT_USER'; |
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {Table, Modal, Button} from 'react-bootstrap';
import {deleteProblem} from '../../actions/problemActions';
import EditProblemModal from './EditProblemModal';
import {push} from 'react-router-redux';
const initialState = {showEditModal:... |
<filename>tests/android/browser.spec.ts
/**
* Copyright 2020 Microsoft Corporation. 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/l... |
package io.quarkus.micrometer.deployment.binder;
import java.util.function.BooleanSupplier;
import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.NativeIm... |
#!/bin/sh
# customfield_12000 = sector
# customfield_11909 = segment type
# customfield_11905 = Part Number
# customfield_11907 = Original Partner Blank Allocation
# customfield_11906 = Item Location (India, Canon, ...)
# customfield_11912 = Risk of Loss
# components = Components (Planned, In-Work Blank, Accepted Blan... |
package blurhash
import "errors"
var (
// ErrIncorrectComponents blurHash must have between 1 and 9 components
ErrIncorrectComponents = errors.New("blurHash must have between 1 and 9 components")
// ErrWrongSize width and height must match the pixels array
ErrWrongSize = errors.New("width and height must match th... |
#ifndef HV_UDP_CLIENT_HPP_
#define HV_UDP_CLIENT_HPP_
#include "hsocket.h"
#include "EventLoopThread.h"
#include "Callback.h"
#include "Channel.h"
namespace hv {
class UdpClient {
public:
UdpClient() {
}
virtual ~UdpClient() {
}
EventLoopPtr loop() {
return loop_thread.loop();
}
... |
<filename>src/routing/ConstrainedDelaunayTriangulation/Cdt.ts
/*
Following "Sweep-line algorithm for constrained Delaunay triangulation", by <NAME> Zalik
*/
//triangulates the space between point, line segment and polygons of the Delaunay fashion
import {from, IEnumerable} from 'linq-to-typescript'
import {GeomConstant... |
SCRIPT_PATH=$(dirname ${BASH_SOURCE[0]})
hl() {
if which python3 &>/dev/null; then
python3 $SCRIPT_PATH/highlite.py "$@"
else
echo "Couldn't locate python3"
fi
}
|
import numpy as np
import torch
class DataPreprocessor:
def __init__(self):
self.input_data = None
self.input_prob = None
def preprocess_data(self, payoff_matrix_split, col_prob_split, col_action_split, selected_indices):
input_data = np.concatenate([payoff_matrix_split[x] for x in sel... |
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes 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 applica... |
#!/usr/bin/env bash
# Copyright 2014 The Kubernetes 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 applica... |
xrandr --output eDP1 --set Backlight $(( $(xrandr --props|grep Backlight:|cut -d' ' -f2) + $1 ))
|
<filename>weather-pi/temperature-monitor.py
#!/usr/bin/env python
from envirophat import weather
import requests
import time
from subprocess import PIPE, Popen
def get_cpu_temperature():
process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE)
output, _error = process.communicate()
return float(outpu... |
<filename>src/main/java/com/supanadit/restsuite/panel/rest/request/tab/param/ParamsPanel.java
package com.supanadit.restsuite.panel.rest.request.tab.param;
import com.supanadit.restsuite.component.input.api.InputTextURL;
import com.supanadit.restsuite.component.table.ParamsTable;
import com.supanadit.restsuite.helper.... |
<gh_stars>1000+
#include <set>
#include <sstream>
#include <iostream>
#include <cassert>
#include "CodeGen.h"
#include "Compile.h"
#include "IR.h"
#include "Type.h"
#include "Parser.h"
using namespace Bish;
class TypeAnnotator : public IRVisitor {
public:
TypeAnnotator(std::ostream &os) : stream(os), indent_level... |
package de.wwu.wmss.core;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.fi... |
product_data = [
('code', 'str'),
('name', 'str'),
('quantity', 'int')
] |
#!/bin/bash
# Set the BUILD_VERSION variable to the current date in the format YYYYMMDD
BUILD_VERSION=$(date +"%Y%m%d")
# Run the Docker container with the specified configurations
docker run -d \
-p 8000:8000 \
--name management \
--restart=always \
--link mongo:mongo \
--link redis:redis \
-... |
#include "pulseout.h"
#include <stdbool.h>
#include <stdlib.h>
#include <pulse/thread-mainloop.h>
#include <pulse/stream.h>
struct pulseout_state {
struct sound_state ss;
bool paused;
bool flush;
unsigned srate;
sound_callback cbfunc;
void *userptr;
pa_threaded_mainloop *pa_tm;
pa_context *pa_c;
pa_... |
int maxDepth(TreeNode* root) {
if (root == nullptr) {
return 0;
}
int left_depth = maxDepth(root->left);
int right_depth = maxDepth(root->right);
return 1 + std::max(left_depth, right_depth);
} |
#!/bin/sh
# T R Y . S H
# BRL-CAD
#
# Copyright (c) 2004-2019 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
... |
<filename>src/components/index.js
import CountDown from './CountDown/index.vue'
import ScanBarcode from './ScanBarcode/index.vue'
export {
CountDown,
ScanBarcode
} |
import hashlib
import secrets
class PasswordHasher:
def shifr_salt(self, passwd):
# Generate a random salt value
salt = secrets.token_hex(16)
# Combine the salt with the password
salted_password = salt + passwd
# Hash the combined salt and password using SHA-256
ha... |
TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/
TERMUX_PKG_DESCRIPTION="A cross platform audio library"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.2.2
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=df8a6d0e... |
#ifndef _COMMON_H
#define _COMMON_H
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
# ifndef EXTERN_C
# define EXTERN_C extern "C"
# endif
# ifndef EXTERN_C_BEGIN
# define EXTERN_C_BEGIN extern "C" {
# endif
# ifndef EXTERN_C_END
# define EXTERN_C_END }
# ... |
#!/usr/bin/env bash
# nbdkit
# Copyright (C) 2014-2020 Red Hat Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condition... |
<filename>backend-project/small_eod/events/tests/test_factories.py
from django.test import TestCase
from ...generic.tests.mixins import FactoryTestCaseMixin
from ..factories import EventFactory
from ..models import Event
class EventFactoryTestCase(FactoryTestCaseMixin, TestCase):
FACTORY = EventFactory
MODEL... |
package org.smartregister.stock.util;
import java.util.HashMap;
import java.util.Map;
/**
* Manages stock information for a retail application.
*/
public class StockManager {
private Map<String, Integer> stock;
/**
* Initializes the stock manager with an empty stock.
*/
public StockManager()... |
class SwipeWindow:
"""Class for managing a queue of window objects.
"""
onIdEntered = None
onCancelled = None
openWindows = []
def add_window(self, window_id):
"""Add a new window to the queue."""
self.openWindows.append({"id": window_id})
def remove_window(self, window_id... |
<reponame>Gesserok/Market
package ua.artcode.market.interfaces;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import ua.artcode.market.controllers.TerminalControllerFactory;
import ua.artcode.market.models.Bill;
import ua.artcode.market.models.BillComparator;
import ua.artcode.market.models.P... |
import useSWR from "swr";
import { ResponsiveContainer, LineChart, Line, CartesianGrid, XAxis, YAxis, Tooltip, Legend } from 'recharts';
import qs from '../../lib/qs';
import type { TLocation } from '../Select/index.d';
import type {
TWeatherProps,
TWeatherElement,
TWeatherElementProps,
TFormattedWeatherElement
} ... |
import xml.etree.ElementTree as ET
# XML document string
xml_data = '''
<languages>
<language>
<name>Python</name>
<popularity>10</popularity>
<age>30</age>
</language>
<language>
<name>Java</name>
<popularity>8</popularity>
<age>25</age>
</language>
<language>
<name>C++</name>
... |
FLAG=1
if ! type python2 2>&1 > /dev/null ; then
echo "Python 2 is not installed, exiting.."
exit 1
fi
if [ -n "$BASH_VERSION" ]; then
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "source $SCRIPT_DIR/command_not_found_bash" >> $HOME/.bashrc
echo "Added source to .bashrc"
FLAG=0
f... |
def Fibonacci(n):
if n<0:
print("Incorrect input")
elif n==1:
return 0
elif n==2:
return 1
else:
return Fibonacci(n-1)+Fibonacci(n-2)
# Driver Program
print(Fibonacci(9)) |
package config
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"text/template"
"github.com/spf13/viper"
)
// ReadConfig read json environment file from directory
func ReadConfig(filename string) (*viper.Viper, error) {
v := viper.New()
v.SetConfigName(filename)
v.AddConfigPath("/opt/scripts/config")
v.A... |
#!/bin/bash
#for ff in *.pptx; do mkdir ${ff%%.*}; pushd ${ff%%.*}; unzip -qc "../${ff}" ppt/slides/slide*.xml | grep -oP '(?<=\<a:t\>).*?(?=\</a:t\>)' > text; popd; done
_SOLUTION=
_getNextLine() {
cat $1/text | head -$2 | tail -1
}
_nextStep() {
IFS=', '; arrIN=($@); unset IFS;
local _nextCHAR=${arrIN... |
<reponame>smagill/opensphere-desktop
package io.opensphere.controlpanels.layers.layerpopout.model.v1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAX... |
$(document).ready(function()
{
select2Ubicacion('#pais', '#estado', '#ciudad');
$('#pais, #estado, #ciudad').select2();
$("#fotos").fileinput({
// showDelete: true,
showUpload: false,
// showCaption: false,
// showPreview: false,
allowedFileExtensions: ... |
<reponame>djfkahn/MemberHubDirectoryTools
import unittest
from unittest.mock import patch
import os
import family
import hub_map_tools
import roster
import person
data_file_path = os.path.abspath("./family_tests/")
hub_file_name = data_file_path + "/hub_map.csv"
common_hub_map = hub_map_tools.ReadHubMapFromFile(hub_f... |
<reponame>multiplex/multiplex.js<gh_stars>10-100
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../../multiplex')) :
typeof define === 'function' && define.amd ? define(['../../multiplex'], factory) :
(global = typeof globalThis !== 'undefined' ... |
<gh_stars>1-10
package com.yl.appleweather.activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.v... |
import {apBasePath} from "./_base";
export default apBasePath.appendPathSegment<{}>("/prereg"); |
<filename>src/main/java/com/google/enterprise/secmgr/common/CookieStoreImpl.java
// Copyright 2011 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache... |
class DatabaseHelper(context: Context) : SQLiteOpenHelper(context,
DATABASE_NAME, null, 1) {
private val SQL_CREATE_ENTRIES =
"CREATE TABLE " + DatabaseContract.TABLE_NAME + " (" +
DatabaseContract._ID + " INTEGER PRIMARY
KEY," +
DatabaseContract.COLUMN_NAME + " TEXT," +
DatabaseContract.COLUMN_AGE + " TEXT)"
... |
/**
* Endless scrolling for search results
* https://stackoverflow.com/a/4842226/3549270
*/
export default class EndlessScrolling {
constructor($button) {
this.loadFurtherHeight = 500;
this.$button = $button;
this.reset();
this.$target = $("#endless-scroll-target");
this.$... |
docker-compose exec broker kafka-console-consumer --topic example-topic --bootstrap-server broker:9092 \
--from-beginning \
--property print.key=true \
--property key.separator="-" \
--max-messages 12 |
<html>
<head>
<title>My Webpage</title>
</head>
<body>
<div id="header">
<h1>Welcome to my Webpage!</h1>
</div>
<div id="body">
<p>Hello! This is the body section of my webpage.</p>
</div>
<div id="footer">
<p>Copyright © 2020</p>
</div>
</body>
</html> |
const admin = require('firebase-admin');
const utils = require('./utils')
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
/**
* Make the backup (read collection & write to json, delete old backup, read json & save in backup collection)
* @param db
* @pa... |
package validate
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestInt_Set(t *testing.T) {
assert.False(t, Int{}.Set())
assert.True(t, Int{MaxSet: true}.Set())
assert.True(t, Int{MinSet: true}.Set())
assert.True(t, Int{MultipleOfSet: true}.Set())
}
func TestInt_Setters(t *testing.T) {
for _,... |
<reponame>olbjan/home-assistant-1
"""Helpers to help coordinate updates."""
import asyncio
from datetime import datetime, timedelta
import logging
from time import monotonic
from typing import Any, Awaitable, Callable, List, Optional
import aiohttp
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback... |
export class SaveForLaterJourneyRequest{
outwardfaregroupid : number;
outwardserviceid : number;
returnfaregroupid : number;
returnserviceid : number;
outwardloyaltypointcost : number;
returnloyaltypointcost : number;
sessionid : string;
} |
require 'portal_adventure/universe'
RSpec.describe PortalAdventure::Universe do
let(:default_player_character) {
instance_double('PortalAdventure::PlayerCharacter', look: nil)
}
subject {
described_class.new(starting_character: default_player_character)
}
it 'sets the active character to a new Play... |
<gh_stars>0
package transaction
//go:generate stringer -type=WitnessScope -output=witness_scope_string.go
import (
"encoding/json"
"fmt"
"strings"
)
// WitnessScope represents set of witness flags for Transaction signer.
type WitnessScope byte
const (
// FeeOnly is only valid for a sender, it can't be used durin... |
<reponame>hunter-heidenreich/pyconversations<filename>tests/feature_extraction/test_extractor.py<gh_stars>0
from datetime import datetime as dt
from itertools import product
import numpy as np
import pytest
from pyconversations.convo import Conversation
from pyconversations.feature_extraction import ConversationVecto... |
import React, { Component } from 'react'
import { connect } from 'react-redux'
import PersonalInformationForm from 'components/forms/PersonalInformation'
import {
updateForm,
updateFormError,
resetForm,
submitFormData
} from 'actions/account/PersonalInformation'
import { personalInformationValidators } from... |
#!/bin/bash
ms="/afs/csail.mit.edu/u/r/rohitsingh/public_html/sketch4jan/sketch-frontend/msketch --fe-cegis-path /afs/csail.mit.edu/u/r/rohitsingh/public_html/sketch4jan/sketch-backend/src/SketchSolver/cegis"
cd /afs/csail.mit.edu/u/r/rohitsingh/public_html/sketch4jan/Dropbox/models
for tr in 1 2 3 4 5 6 7 8 9 10 11 ... |
<gh_stars>0
package services
import (
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/stretchr/testify/assert"
)
func TestSettigns(t *testing.T) {
t.Run("Valid yaml file", func(t *testing.T) {
assert := assert.New(t)
s, err := NewSettigns("testing1.yaml")
assert.NoError(err)
assert.NotNil(s)
asse... |
<gh_stars>1-10
/*
*
*/
package net.community.chest.net.rmi.test;
import java.io.BufferedReader;
import java.io.PrintStream;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.rmi.registry.Registry;
import java.util.List;
import java.util.Map;
import net.community.chest.net.rmi.RMIUtils;
/**
* <P... |
<reponame>edjee/osconfig
// Copyright 2017 Google 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/LICENSE-2.0
//
//... |
#!/usr/bin/env bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
<reponame>JacobTheEvans/code-show
var app = angular.module("main.editor",["ngCookies", "ngRoute","ui.ace","ngClipboard"]);
app.config(["$routeProvider", function($routeProvider) {
$routeProvider.when("/editor/:ind", {
templateUrl: "/views/templates/editor.tpl.html",
controller: "editorController"
})
}]);
... |
def bump_version(current_version, part):
# Split the current version into major, minor, and patch parts
major, minor, patch = map(int, current_version.split('.'))
# Increment the version based on the specified part
if part == 0:
major += 1
minor = 0
patch = 0
elif part =... |
package io.opensphere.core.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EventObject;
import java.util.List;
/**
* Defines an event that encapsulates changes to a list.
*
* @param <E> the type of elements in the list
*/
public class ListDataEvent<E> ... |
package org.jruby.ir.instructions;
import org.jruby.ir.*;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.WrappedIRClosure;
import org.jruby.ir.runtime.IRRuntimeHelpers;
import org.jruby.ir.transformations.inlining.CloneInfo;
import org.jruby.parser.StaticScope;
import org.jruby.runtime.Block;
impor... |
/*
Current Version: 2.5
Last updated: 8.28.2014
Character Sheet and Script Maintained by: <NAME>
Current Verion: https://github.com/Roll20/roll20-character-sheets/tree/master/StarWarsEdgeOfTheEmpire_Dice
Development and Older Verions: https://github.com/dayst/StarWarsEdgeOfTheEmpire_Dice
Credits:
Original cre... |
#!/bin/bash
set -e
usage() {
cat <<EOF
$0
--sdk <SDK file path>
--system <system sdk file path>
--support <support library file path>
EOF
exit 2
}
banner() {
echo "**************************************************"
echo "Updating $1 "
echo "*************... |
List<String> result = new ArrayList<>();
for (int i = 0; i < data.length; i++) {
if (i % 2 != 0) {
result.add(data[i]);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.