text stringlengths 1 1.05M |
|---|
<reponame>cleanlyer/cleanly<filename>src/actions/types.js
export const UPDATE_USER_LOCATION = 'UPDATE_USER_LOCATION'
export const SEND_REPORT = 'SEND_REPORT'
export const SEND_CLEAN = 'SEND_CLEAN'
export const UPDATE_SCORE = 'UPDATE_SCORE'
export const GET_GARBAGE = 'GET_GARBAGE'
export const GET_GARBAGE_OFFLINE = 'GET... |
class ParsingError(Exception):
pass
class FileError(Exception):
pass
def parseFile(file_path):
try:
with open(file_path, 'r') as file:
line_number = 0
for line in file:
line_number += 1
if ':' not in line:
raise ParsingErr... |
<filename>webapp/src/app/shared/phaser/entities/selection-box.ts
import {Point} from '../../interfaces/cross-code-map';
import {Helper} from '../helper';
import {SortableGroup} from '../../interfaces/sortable';
import {CCEntity} from './cc-entity';
export class SelectionBox {
private active = false;
private start:... |
package week1.controller;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import week1.model.IncomeExpenses;
import week1.model.Seller;
import week1.utils.InitUtils;
import static org.junit.Assert.*;
public class ISellerControllerImplTest {
private Seller mainSeller;
private ISellerC... |
<reponame>kostovmichael/react-examples
import React, {Component} from 'react';
class HorizontalScroll extends Component {
componentDidMount() {
const scope = this;
this._container.addEventListener('scroll', (e) => {
console.log('xscroll');
window.clearTimeout(scope.scrollTimer);
//滚动结束触发
scope.scroll... |
package com.wyp.materialqqlite.ui;
import java.io.File;
import com.wyp.materialqqlite.ImageCache;
import com.wyp.materialqqlite.R;
import com.wyp.materialqqlite.AppData;
import com.wyp.materialqqlite.Utils;
import com.wyp.materialqqlite.qqclient.QQClient;
import com.wyp.materialqqlite.qqclient.protocol.protocoldata.G... |
<filename>examples/led.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`led`
==================
Created by hbldh <<EMAIL>>
Created on 2016-04-02
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import time
from pymetawear.discover import sel... |
<gh_stars>0
package software.amazon.jsii.tests.calculator;
/**
* The negation operation ("-value")
*/
@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.Negate")
public class Negate extends software.amazon.jsii.tests.calculator.UnaryOperation implements software.... |
<gh_stars>1-10
package jadx.core.dex.attributes.nodes;
import jadx.core.dex.attributes.*;
public class LoopLabelAttr implements IAttribute {
private final LoopInfo loop;
public LoopLabelAttr(LoopInfo loop) {
this.loop = loop;
}
public LoopInfo getLoop() {
return loop;
}
@Override
public AType<LoopLabel... |
package com.basics.exercises;
public class ComputePI {
public static void main(String[] args) {
calculatePi();
}
private static void calculatePi() {
}
}
|
import NewPostForm from './NewPostForm'
import PostList from './PostList'
export { NewPostForm, PostList }
|
#!/bin/ksh
# *****************************COPYRIGHT****************************
# (c) British Crown Copyright 2009, the Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the
# following conditions are met:
#
# * ... |
adb shell rm /storage/sdcard1/scd.db
adb shell "su -c 'cp /data/data/com.theah64.soundclouddownloader/databases/scd.db /storage/sdcard1/scd.db'"
adb pull /storage/sdcard1/scd.db |
module Travis
module Api
module V0
module Event
class Job
include Formats
attr_reader :job
def initialize(job, options = {})
@job = job
# @options = options
end
def data(extra = {})
{
'job' => job_... |
#!/bin/bash
#
# Sample REST API to de-identify a FHIR JSON. The API takes a configuration file and a FHIR JSON as input and
# returns de-identified data.
#
# The expected response:
# {
# "data": [
# {
# "resourceType": "Patient",
# "id": "example",
# "name": [
# {
# ... |
<filename>statroid/src/main/java/subbiah/veera/statroid/data/DBHelper.java
package subbiah.veera.statroid.data;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import s... |
<filename>Template/FlightSearchResultsCell.h
//
// FlightSearchResultsCell.h
// Template
//
// Created by Stadelman, Stan on 9/19/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface FlightSearchResultsCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *d... |
<filename>intro/part07-07_dice_roller/test/test_dice_roller.py<gh_stars>0
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, load_module, reload_module, get_stdout, check_source
from functools import reduce
import os
import textwrap
from random import randint
exercise =... |
<reponame>CN-3211/vt-cesium2.0
import {
Viewer,
Matrix4,
Cartesian3,
Math,
Rectangle,
Camera,
EasingFunction,
} from 'cesium'
class FlyTo {
private viewer: Viewer
constructor(viewer: Viewer) {
this.viewer = viewer
}
flyTo(options: {
destination: Cartesian3 | Rectangle
orientation?: ... |
public class StatCalculator {
public static Stats getStats(int[] arr) {
int sum = 0;
int min = arr[0];
int max = arr[0];
int mode = 0;
int mostFrequentNumOccurrence = 0;
for (int i=0; i<arr.length; i++) {
sum += arr[i];
if (arr[i] < min) {
min = arr[i];
}
if (arr[i] > max) {
max = arr[i];
}
int... |
import React from "react";
/**
* convert text to html
*/
class DangerHTML extends React.Component {
htmlDecode(input) {
var e = document.createElement("div");
e.innerHTML = input;
return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
}
render() {
return (
<div
classN... |
// https://open.kattis.com/problems/mirror
#include <iostream>
#include <vector>
using namespace std;
typedef vector<char> vc;
typedef vector<vc> vvc;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int r, c;
cin >> r >> c;
vvc v(r);
for (int j = 0; j < r; j++) {
v[j] = vc(c);
for (int k... |
<filename>src/main/java/aufgabe11_7/Bunop.java
package aufgabe11_7;
public enum Bunop {
// utf8: "Köpfchen in das Wasser, Schwänzchen in die Höh." -CIA-Verhörmethode
Not(3);
private int order;
Bunop(int precedence) {
this.order = precedence;
}
public int getPriority() {
return order;
}
}
|
<reponame>Ziezi/Programming-Principles-and-Practice-Using-C-by-Bjarne-Stroustrup-
/*
TITLE String Manipulation Chapter3Drill.cpp
Bjarne Stroustrup "Programming: Principles and Practice Using C++"
COMMENT
Objective: I/O interaction and basic string manipulation.
Input: Reqeusts information... |
cd /root/Desktop/route_commands_m2/ssh_tunnel
# logs into Ubiquiti M2 Bullet in the background and generates a SSH tunnel
echo "DEBUG: Opening SSH Tunneling, enter PASSWORD"
ssh -f -N -D 1080 REDACTED_LOGIN@REDACTED_SUBNET.1
echo "Proxy tunnel opened on 127.0.0.1 PORT 1080"
echo "DEBUG: Sudoing to superuser"
# sudo su... |
from .tmdb import (
TmdbMovieAdapter,
TmdbMovieCastAdapter,
TmdbMovieListAdapter,
TmdbPersonAdapter,
)
class MovieInformation:
def __init__(self, movie_id):
self.movie_id = movie_id
def get_movie_details(self):
movie_adapter = TmdbMovieAdapter()
movie_details = movie_ad... |
public static void fibonacci(int n)
{
int first = 0, second = 1, next;
System.out.println("First " + n + " terms: ");
for (int i = 0; i < n; ++i)
{
if(i <= 1)
next = i;
else
{
next = first + second;
first = second;
seco... |
<filename>src/services/chat/redux/actions/data.ts
import { IAppReduxState, IDependencies } from 'shared/types/app';
import { ActionCreator, Dispatch } from 'redux';
import SocketSubscriber from 'services/sockets/SocketSubscriber';
const subscriber: SocketSubscriber = new SocketSubscriber();
export function updateMeta... |
import { SystemStyleObject } from "@chakra-ui/styled-system";
import { Dict, StringOrNumber } from "@chakra-ui/utils";
import { ThemingProps } from "./system.types";
export declare function useChakra<T extends Dict = Dict>(): {
theme: T;
colorMode: import("@chakra-ui/color-mode").ColorMode;
toggleColorMode:... |
#!/bin/bash
declare -a projects
old_dir=$(pwd);
projects=( $( cat <$(dirname $0)/config/backends.cfg ) )
for dir in "${projects[@]}"; do
echo Setup dev project ${dir};
cd ${dir};
./setup-dev.sh;
done;
cd ${old_dir}
|
#!/bin/bash
set -e
RESOURCE_NAME=${1:-ccmlin008-80}
SRUN_TIMEOUT_MIN=${2:-120}
export MLPROCESSORS_FORCE_RUN=FALSE
export NUM_WORKERS=2
export MKL_NUM_THREADS=$NUM_WORKERS
export NUMEXPR_NUM_THREADS=$NUM_WORKERS
export OMP_NUM_THREADS=$NUM_WORKERS
export DISPLAY=""
COLLECTION=spikeforest
KACHERY_NAME=kbucket
comput... |
package io.opensphere.wfs.envoy;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLEncoder;
import java.security.GeneralSecurityException;
import java.ut... |
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
module('Unit | Route | tutorials/development', function (hooks) {
setupTest(hooks);
test('it exists', function (assert) {
let route = this.owner.lookup('route:tutorials/development');
assert.ok(route);
});
});
//#... |
import torch
list = torch.tensor([1, 9, 6, 3])
mean = list.mean()
print("The mean of the given list is:", mean) |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
<filename>src/args/processes-parser.ts
import { isObject } from "lodash"
import { argsParser } from "@/args/parser"
import { globalVariableSelector } from "@/module/selector/vim-variable"
import type { ArgsOptions, CustomProcessesVimVariable, ProcessesName, UserProcesses } from "@/type"
const parseOptions = (options:... |
// First Function
function fibonacci(num) {
if (num <= 1)
return num;
return fibonacci(num - 1) + fibonacci(num - 2);
}
// Second Function - Using Dynamic Programming
function fibonacciDP(num, memo=[]) {
if (memo[num] !== undefined)
return memo[num];
if (num <= 1)
return num;
memo[num] = fibonacciDP(num... |
<reponame>amazinigmech2418/CanvasLib<filename>webglLib.js
// Get context for WebGL
function WebGLCanvas(query) {
if(document.querySelectorAll(query).length==0) {
document.body.innerHTML += "<canvas>hi</canvas>";
var iidd = query.split("#");
if (iidd.length > 1) {
document.querySelectorAll("canvas")[docum... |
<gh_stars>0
const flexibleConfigurationLists = {
TextArea: {
props: {
autosize: {
label: "自适应内容高度",
defaultValue: true,
value: true,
type: "boolean|object".split("|")
},
defaultValue: {
label: "输入框默认值",
defaultValue: "",
value: "",
... |
<reponame>chlds/util
/* **** Notes
Write.
Remarks:
write di,si
; write contents into a storage
*/
# define CAR
# include <stdio.h>
# include "./../../../incl/config.h"
signed(__cdecl wr_ds_w(signed short(**argp))) {
auto signed short *w;
auto signed i,r;
auto signed short flag;
auto fl_t fl;
auto signed threshold... |
<reponame>Martin-BG/Softuni-Java-MVC-Spring-Feb-2019<gh_stars>1-10
package org.softuni.cardealer.service;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.jun... |
<gh_stars>1-10
package aserg.gtf.task;
public abstract class GitDev {
private static int id = 1;
public static int getNewId(){
return id++;
}
protected int devId;
private String name;
private String email;
private String shaExample;
private int gitHubId=0;
public GitDev(String name, String email, S... |
/*-
* ========================LICENSE_START=================================
* TeamApps
* ---
* Copyright (C) 2014 - 2021 TeamApps.org
* ---
* 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... |
import {expect} from "chai";
import proxyquire = require("proxyquire");
import {execVim} from "../src/exec_vim";
import {VimHelp, RTPProvider} from "../src/vimhelp";
let execVimStub = execVim;
const VimHelpProxied = proxyquire("../src/vimhelp", {
"./exec_vim": {
execVim: (vimBin: string, commands: string[]) => e... |
import matplotlib.pyplot as plt
def plot_maxmass_histogram(maxmass_after):
plt.hist(maxmass_after, bins=50, alpha=0.5, label='after', histtype='step')
plt.legend(loc='best')
plt.show()
maxmass_after = [56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94]
plot_maxmass_histogram(m... |
<reponame>piglovesyou/react-apollo-loader-example
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
impor... |
#! /bin/bash
gcc client.c network.c -o client
|
#include <Windows.h>
#include <wrl.h>
#include <windows.ui.notifications.h>
#include <windows.data.xml.dom.h>
using namespace Windows::UI::Notifications;
using namespace Windows::Data::Xml::Dom;
using namespace Microsoft::WRL;
class NotificationManager {
public:
void showToastNotification(const std::wstring& mess... |
<filename>fw/H263SlaveFirmwareCBR_bin.h
// This file was automatically generated from ../release/H263SlaveFirmwareCBR.dnl using dnl2c.
extern unsigned long aui32H263CBR_SlaveMTXTOPAZFWText[];
extern unsigned long ui32H263CBR_SlaveMTXTOPAZFWTextSize;
extern unsigned long aui32H263CBR_SlaveMTXTOPAZFWData[];
extern un... |
<gh_stars>0
/*-
* ========================LICENSE_START=================================
* O-RAN-SC
* %%
* Copyright (C) 2020 Nordix 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... |
// Define the protocol
protocol CollectionViewProtocol {
var indexTitle: String? { get }
var header: CollectionItemType? { get set }
var footer: CollectionItemType? { get set }
}
// Implement the class conforming to the protocol
class CustomCollectionView: CollectionViewProtocol {
var indexTitle: Strin... |
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
# Debian Packaging Script
# Currently Intended to build on ubuntu14.04
set -e
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURC... |
/*package com.codefinity.microcontinuum.common.serializer;
import java.lang.reflect.Type;
import java.util.Date;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.g... |
import Color from 'color';
function calculateAverageColor(colorLevels: ColorLevelsObject): Color {
const colorValues = Object.values(colorLevels);
const totalRed = colorValues.reduce((acc, color) => acc + color.red(), 0);
const totalGreen = colorValues.reduce((acc, color) => acc + color.green(), 0);
const tota... |
import { DispatchW, State } from "../../shared/context";
import { Dispatch } from "react";
import { useState } from "react";
import CSS from "csstype";
const openStyles: CSS.Properties = {
opacity: 1,
visibility: "visible",
};
const closedStyles: CSS.Properties = {
opacity: 0,
visibility: "hidden",
};
type... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototy... |
<filename>backend/controller/developerController.js
const { pool } = require('../db/cloudDatabase')
exports.getADeveloper = async (req, res) => {
const sql = "SELECT * FROM DEVELOPER WHERE DNAME = $1;"
try {
const { rows } = await pool.query(sql, [req.params.dname]);
res.status(200).json(rows);... |
#!/bin/sh
#
# Run the Coverage test
#
make distclean
if ! make CC=gcc COVERAGE=1 lcov_reset check lcov_capture lcov_html; then
exit 1
fi
|
#!/bin/bash
#SBATCH -J Act_tanh_1
#SBATCH --mail-user=eger@ukp.informatik.tu-darmstadt.de
#SBATCH --mail-type=FAIL
#SBATCH -e /work/scratch/se55gyhe/log/output.err.%j
#SBATCH -o /work/scratch/se55gyhe/log/output.out.%j
#SBATCH -n 1 # Number of cores
#SBATCH --mem-per-cpu=6000
#SBATCH -t 23:59:00 # Hours, minutes and... |
#!/bin/bash
# Copyright 2015 The Kubernetes 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
public static boolean searchMatrix(int[][] matrix, int target) {
if (matrix == null || matrix.length == 0)
return false;
int row = 0;
int col = matrix[0].length - 1;
while (row < matrix.length && col >= 0) {
if (matrix[row][col] == target)
return true;
else if (matrix[row][col] < target)
... |
import { getAPIURI } from "../../common";
import { UserProfile } from "../UserProfile";
class UserProfileClient {
static uploadProfile(userProfile) {
return fetch(getAPIURI() + "myProfile", {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
Authorization:
... |
from typing import Dict, Any
def filter_kwargs(**kwargs: Any) -> Dict[str, Any]:
return {key: value for key, value in kwargs.items() if value is not None} |
import multer from 'multer'
import path from 'path'
import {v4 as uuidV4} from 'uuid'
import express from "express";
import {MConfiguration} from "../../model/configuration";
export class Multer {
static config: MConfiguration
constructor(config: MConfiguration) {
Multer.config = config;... |
<gh_stars>0
#! /usr/bin/env python
import os, shutil, subprocess
from colorama import Fore, Style
class Palladin:
def __init__(self):
self.config = os.path.expanduser("~/.config/")
self.mercy = ["palladin"]
if not os.path.exists(self.config + "palladin"):
os.mkdir(self.confi... |
#!/bin/bash ../.port_include.sh
port=quake
version=0.65
workdir=SerenityQuake-master
useconfigure=false
curlopts="-L"
files="https://github.com/SerenityOS/SerenityQuake/archive/master.tar.gz quake.tar.gz"
makeopts="V=1 SYMBOLS_ON=Y"
depends=SDL2
|
def generate_fibonacci(n):
fib_arr = [0, 1]
while len(fib_arr) < n:
num = fib_arr[-2] + fib_arr[-1]
fib_arr.append(num)
return fib_arr
print(generate_fibonacci(5)) |
class QueueTrack < ActiveRecord::Base
end
|
package com.github.saphyra.authservice.redirection.impl;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Component;
import com.github.saphyra.authservice.common.CommonAuthProperties;
import com.github.saphyra.authservice.common.RequestHelper;
import com.github.saphyra.authservice.... |
#!/bin/bash
##########################
# SMP Script for CANDIDE #
##########################
# Receive email when job finishes or aborts
#PBS -M tobias.liaudat@cea.fr
#PBS -m ea
# Set a name for the job
#PBS -N val_aziz_models
# Join output and errors in one file
#PBS -j oe
# Set maximum computing time (e.g. 5min)
#PB... |
/*
Info: JavaScript for JavaScript Basics Lesson 5, JavaScript DOM and Events, Task 1, Like / Unlike Button
Author: Removed for reasons of anonymity
Successfully checked as valid in JSLint Validator at: http://www.jslint.com/ and JSHint Validator at: http://www.jshint.com/
*/
'use strict';
function changeText() {
var... |
class BidStatusPresenter::Over::Vendor::Winner::PendingAcceptance < BidStatusPresenter::Base
def header
I18n.t('statuses.bid_status_presenter.over.winner.pending_acceptance.header')
end
def body
I18n.t(
'statuses.bid_status_presenter.over.winner.pending_acceptance.body',
delivery_url: auction... |
/*
* 将specs 数组对象转换为字符串
*
*/
import { Joiner } from './joiner'
const parseSpecValue = function (specs) {
if (!specs) {
return
}
const joiner = new Joiner(';', 2)
specs.map((spec) => {
joiner.join(spec.value)
})
return joiner.getStr()
}
export { parseSpecValue }
|
public static void distinctElements(int arr[]) {
int n = arr.length;
// Pick all elements one by one
for (int i = 0; i < n; i++) {
// Check if the picked element
// is already printed
int j;
for (j = 0; j < i; j++)
if (arr[i] == arr[j])
... |
<gh_stars>0
import threading
from hks_pylib.logger.logger import Display
from hks_pylib.logger.standard import StdLevels, StdUsers
from hks_pylib.logger.logger_generator import StandardLoggerGenerator
from _simulator.server import ThesisListener
from simulator.configuration.parser import parse_server, parse_channel
... |
<gh_stars>1-10
# Copyright 2022 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
#
# Unless required by app... |
<gh_stars>0
import React from 'react';
import PropTypes from 'prop-types';
import { compose, graphql } from 'react-apollo';
import gql from 'graphql-tag';
import { AutoAndManualForm } from '../components';
import { queries } from '../graphql';
import withFormMutations from './withFormMutations';
const AutoAndManualFor... |
<reponame>prinsmike/go-start<filename>mongo/query_filternotequal.go
package mongo
import (
"labix.org/v2/mgo/bson"
)
///////////////////////////////////////////////////////////////////////////////
// query_filterNotEqual
type query_filterNotEqual struct {
query_filterBase
selector string
value interface{}
}
... |
package com.symulakr.dinstar.smsserver.message.enums;
public enum SmsResult implements AsByte
{
SUCCEED(0, "Succeed"),
FAIL(1, "Fail"),
TIMEOUT(2, "Timeout"),
BAD_REQUEST(3, "Bad request"),
PORT_UNAVAILABLE(4, "Port unavailable"),
PARTIAL_SUCCEED(5, "Partial succeed"),
OTHER_ERROR(0xFF, "other er... |
import os
import time
def script_runner(script,thereshold,interval):
for _ in range(thereshold):
script_result = openFile(script)
if script_result==0:
return 0
else :
if _==thereshold-2:
break
... |
package unet.uncentralized.jkademlia.KademliaNode;
import unet.uncentralized.jkademlia.Node.KID;
import unet.uncentralized.jkademlia.Node.Node;
import unet.uncentralized.jkademlia.Routing.KBucket;
import unet.uncentralized.jkademlia.Socket.KSocket;
import java.io.DataInputStream;
import java.io.DataOutputStream;
impo... |
#!/bin/bash
source $(dirname $0)/_git-multi-util.sh
__git_init_parent_dirs 1
for project_dir in "${git_parent_dirs[@]}" ; do
cd "$project_dir"
`which echo` -n "Pulling $project_dir... "
git pull
done
|
#!/bin/bash
export DEVCTL_RELEASE_BOT_VERSION=v0.0.44
curl -LO https://github.com/alex-held/devctl-release-bot/releases/download/${DEVCTL_RELEASE_BOT_VERSION}/devctl-release-bot_${DEVCTL_RELEASE_BOT_VERSION}_linux_amd64.tar.gz
tar -xvf devctl-release-bot_${DEVCTL_RELEASE_BOT_VERSION}_linux_amd64.tar.gz
./devctl-relea... |
/***************************************************************************
* (C) Copyright 2003-2020 - Stendhal *
***************************************************************************
***************************************************************************
* ... |
import { v1 } from '@google-cloud/firestore'
export const backup = async (projectId: string, bucketUrl: string, collectionIds: Array<string> = []) => {
try {
const client = new v1.FirestoreAdminClient()
const databaseName = client.databasePath(projectId, '(default)')
const responses = await client.export... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('transport', '0016_auto_20170308_1924'),
]
operations = [
migrations.RemoveField(
... |
import sys
def simulate_sorbet_cli(args):
output = []
for arg in args:
if arg == "--silence-dev-message":
output.append("Developer messages silenced.")
elif arg == "--suggest-typed":
output.append("Suggesting type annotations.")
elif arg == "--autocorrect":
... |
import Vue from 'vue'
const eventHub = new Vue()
export default {
computed: {
eventHub () {
return eventHub
},
token () {
return this.store.getters.sessionData.SPAToken
}
},
methods: {
formatNumber (number) {
const x = 3
const n = 0
const regExp = '\\d(?=(\\d{' ... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var util_1 = require("@antv/util");
var fecha_1 = tslib_1.__importDefault(require("fecha"));
var view_layer_1 = tslib_1.__importDefault(require("../../base/view-layer"));
var constant_1 = require("./constant");
... |
#!/bin/sh
#This sample search script uses the "length" hint returned by
#the librato API in a while loop to page through search results
source ${SBHOME}/shellbrato.sh
#DEBUG=1 #(uncomment to see debug info from shellbrato)
OFFSET=0
#make an initial query to populate the length and offset variables
R=$(listMetrics)
... |
function findPermutations(arr) {
const permutations = [];
// base case
if (arr.length === 1) {
permutations.push(arr);
return permutations;
}
// recursive case
for (let i = 0; i < arr.length; i++) {
const currentNumber = arr[i];
const remaining = [...arr.... |
package riaken_core
import (
"regexp"
"testing"
"github.com/sendgrid/riaken-core/rpb"
)
// Example from http://docs.basho.com/riak/latest/dev/using/mapreduce/
func TestQueryMapReduce(t *testing.T) {
client := dial()
defer client.Close()
session := client.Session()
defer session.Release()
// Test Data
buck... |
#!/bin/sh
set -ex
pushd "$(dirname "$0")"
USER=`whoami`
# Validate the docs code examples. If something broke, please alert @docs-stitch-team.
./docs-examples/validate_all.sh
./generate_docs.sh browser analytics
./generate_docs.sh server analytics
./generate_docs.sh react-native analytics
if ! which aws; then
... |
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.Cursor;
public class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context) {
super(context, "contactDatabase.db", null, 1);
}
@Override
public vo... |
<reponame>nimbus-cloud/cli
package app
import (
"cf/terminal"
"github.com/codegangsta/cli"
"os"
"strings"
"text/tabwriter"
"text/template"
)
var appHelpTemplate = `{{.Title "NAME:"}}
{{.Name}} - {{.Usage}}
{{.Title "USAGE:"}}
[environment variables] {{.Name}} [global options] command [arguments...] [comm... |
import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ColidMatSnackBarComponent } from './colid-mat-snack-bar/colid-mat-snack-bar.component';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { ColidMatSnackBarService } from './coli... |
"use strict";
/**
* @name Throwable
* @author <NAME>
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Throwable = void 0;
class Throwable extends Error {
constructor(message, code) {
super(message);
this.name = this.constructor.name;
this.message = message;
... |
<reponame>WGBH/django-pbsmmapi<filename>pbsmmapi/asset/models.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ..abstract.models import PBSMMGenericAsset
from .helpers import check_asset_availabilit... |
from pony.orm import Database, PrimaryKey, Optional, db_session
class ORMProject(db.Entity):
_table_ = 'mantis_project_table'
id = PrimaryKey(int, column='id')
name = Optional(str, column='name')
class ORMProjectManager:
def __init__(self, host, database, user, password):
self.db = Database()
... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-HPMI/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-HPMI/1024+0+512-shuffled-N-VB-256 --do_eval --per_de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.