text stringlengths 1 1.05M |
|---|
import { Operation, Point } from '..'
/**
* `PointRef` objects keep a specific point in a document synced over time as new
* operations are applied to the editor. You can access their `current` property
* at any time for the up-to-date point value.
*/
export interface PointRef {
current: Point | null
affinity... |
from pandas import DataFrame
def double_grouped_data(grouped_df):
# Extract the groups from the grouped data frame
groups = grouped_df.groups
# Initialize an empty list to store the modified x values
modified_x = []
# Iterate over the groups and double the x values
for group_key in groups:
... |
$(document).ready(function() {
var elems = document.getElementsByClassName("hole");
var check = jQuery.makeArray(elems);
var playerWin = 0;
var computerWin = 0;
var tie = 0;
var win = false;
var loss = false;
var madeMove = false;
var elemsOne = document.getElementById("row-one").getElementsByClassN... |
#! /bin/sh
export BEAM4_HOME=$_CIOP_APPLICATION_PATH/shared
if [ -z "$BEAM4_HOME" ]; then
echo
echo Error: BEAM4_HOME not found in your environment.
echo Please set the BEAM4_HOME variable in your environment to match the
echo location of the BEAM 4.x installation
echo
exit 2
fi
. "$BEAM4_HOM... |
#!/bin/bash
#######################################################################
# SEND EMAIL TO A (LIST OF) USER(S) #
#######################################################################
# usage: . send_mail.sh TO[user list] MESSAGE[file] [SUBJECT]
# bash >= 4.3
## Variables
#... |
<filename>src/nikpack/Main.java<gh_stars>0
package nikpack;
import java.io.IOException;
import java.nio.file.*;
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;
public ... |
// AsyncOperation class to be implemented
public class AsyncOperation
{
private Action<int> progressCallback;
public void Progressed(Action<int> callback)
{
progressCallback = callback;
}
public void Complete()
{
// Simulate completion and report progress
progressCallba... |
import React from "react"
const Announcement = () => {
return (
<div className='announcementBar'>
<p><span>COVID-19</span>: Get your business online, the government hates you!</p>
</div>
)
}
export default Announcement |
/*
(c) 2012 <NAME>
*/
/*compute the inverse matrix by using the speciality of the linking number matrix*/
/*
* * * 1 * *
* * * 0 1 *
* * * 0 0 1
1 0 0 0 0 0
* 1 0 0 0 0
* * 1 0 0 0
The submatrix M(n:2n, 1:n) and M(1:n, n:2n) are triangular matrix
*/
#ifndef _INVERSE_LINK_NUMBER_MATRIX_H_
#de... |
#!/bin/bash
vagrant destroy --parallel
rm -rf ./.vagrant
rm -rf ./registry
rm -rf ./registry-mirror |
<gh_stars>1000+
/*
* $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/methods/HttpGet.java $
* $Revision: 664505 $
* $Date: 2008-06-08 06:21:20 -0700 (Sun, 08 Jun 2008) $
*
* ================================================================... |
package org.synaptra.mlib;
public class Perceptron {
}
|
<filename>lib/generator.js
"use strict";
const _ = require('lodash');
const parse5 = require('parse5');
const GeneratorContext = require('./generator-context');
const ConfigurationFactory = require('./configuration-factory');
const NameExtractor = require('./name/name-extractor');
const EmitTraverser = require('./emit... |
def bubble_sort(lst):
# Set swapped to True so the loop looks runs at least once
swapped = True
while swapped:
swapped = False
for i in range(len(lst) - 1):
# If the current element is greater than the next element
if lst[i] > lst[i + 1]:
# Swap the tw... |
VERSION = "0.3.8"
STRIP_WORDS = ("the", "and", "for", "with", "a", "of")
MODEL_ENDINGS = ("le", "pro", "premium", "edition" "standard")
|
package com.pharmacySystem.service.implementations;
import java.util.HashSet;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation... |
def test_create_report():
# Simulate the creation of a comment report
comment_report_content = 'This is a comment report'
comment_report_data = {
'content': comment_report_content,
'parent_comment_id': self.comment_report.parent_comment.id,
'reported_by_id': self.comment_report.repor... |
<reponame>tenebrousedge/ruby-packer
require File.expand_path('../../spec_helper', __FILE__)
describe 'Optional variable assignments' do
describe 'using ||=' do
describe 'using a single variable' do
it 'assigns a new variable' do
a ||= 10
a.should == 10
end
it 're-assigns an ex... |
alias ll="ls -laFh"
alias lls="ll -S"
alias envs="env -0 | sort -z | tr '\0' '\n'"
|
<reponame>waleedmashaqbeh/freequartz
/* Copyright 2010 Smartmobili SARL
*
* 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
*
... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const b2VoronoiDiagram_1 = require("./b2VoronoiDiagram");
describe('B2VoronoiDiagram', () => {
it('should be a function', () => {
expect(typeof b2VoronoiDiagram_1.B2VoronoiDiagram).toEqual('function');
});
});
|
<filename>src/main/java/bi/ihela/client/dto/init/MerchantType.java<gh_stars>1-10
/**
*
*/
package bi.ihela.client.dto.init;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonRootN... |
#python hsc_deploy.py --target localhost:7845 --waiting-time 3 $@
python hsc_deploy.py --target localhost:7845 --exported-key 47CqNF6VHLjr77YPtvjtxrfekDdyhJrWvy1C6qN49JfnthExWL9hcfrWZ5J3ErgSAwyPBhoUu --password pCjjd98Ha8LiEHBCEiot --waiting-time 3 $@
|
<reponame>eloymg/vulcan-checks
/*
Copyright 2019 Adevinta
*/
package main
import (
"fmt"
"log"
"net/http"
"os"
)
var (
changeLogPrefix = "Drupal "
changeLogSuffix = ","
)
func main() {
if len(os.Args) != 2 {
fmt.Fprintf(os.Stderr, "usage: %v <drupal_version>\n", os.Args[0])
os.Exit(1)
}
http.HandleFun... |
<gh_stars>1-10
import {createApp} from 'vue'
import {
ElAside,
ElButton,
ElCard,
ElCascader,
ElCheckbox,
ElContainer,
ElDialog,
ElForm,
ElFormItem,
ElInput,
ElMenu,
ElMenuItem,
ElMenuItemGroup,
ElMessageBox,
ElOption,
ElPagination,
ElPopconfirm,
El... |
/*
Starting point for a vizuly.core.component
*/
vizuly.ui.range_input = function (parent) {
// This is the object that provides pseudo "protected" properties that the vizuly.viz function helps create
var scope={};
var properties = {
"data" : [.25,.75], // Expects a array of two values a... |
# update_version.py
import os
import shutil
from build import replace_text
def update_version():
# Step 1: Read the current version number from version.txt
with open('version.txt', 'r') as file:
new_version = file.read().strip()
# Step 2: Create a backup of the original app.py file
original_f... |
#!/bin/sh
# **********************************************************************
# *
"${PERL_BIN}" "${BUILD_ROOT}/actools/bin/create_build_id" "$@"
|
#!/bin/bash
pac=$(checkupdates | wc -l)
aur=$(cower -u | wc -l)
check=$((pac + aur))
if [[ "$check" != "0" ]]
then
echo "$pac %{F#7a7a7a}%{F-} $aur"
else
echo "%{F#BB6461}%{F-}"
fi
|
#!/bin/env ruby
## encoding: utf-8
require File.join(File.dirname(__FILE__), './icecream/version')
require 'rubygems'
require 'bundler/setup'
#common dependencies
#internal dependences
require File.join(File.dirname(__FILE__), './icecream/icecream')
module IceCream
end
|
#!/bin/bash
cd "$(dirname "$0")"
exec ./niina --type="rendaGS9" "$@" 2> rendaGS9.err
|
#!/bin/bash
set -e
[ "$#" -ge 2 ] || { echo Usage: $0 model_family model_version >&2; exit 1; }
family="$1"
version="$2"
dir="udpipe-$family-$version"
[ -d "$dir" ] && { echo Release $dir already exists >&2; exit 1; }
mkdir "$dir"
cp LICENSE.CC-BY-NC-SA-4 "$dir"/LICENSE
make -C ../doc manual_model_${family}_readm... |
#!/bin/bash
set -euo pipefail
if [ $# != 0 ]; then
echo "Usage: $0"
exit 1;
fi
# TODO(kamo): Consider clang case
# Note: Requires gcc>=4.9.2 to build extensions with pytorch>=1.0
if python3 -c 'import torch as t;assert t.__version__[0] == "1"' &> /dev/null; then \
python3 -c "from distutils.version impor... |
async function setToken(token) {
return new Promise((resolve) => {
resolve(token || '');
});
} |
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !windows
package test
// direct-tcpip functional tests
import (
"io"
"net"
"testing"
)
func TestDial(t *testing.T) {
server :... |
import re
def extract_urls_from_html(html):
pattern = r'<a\s+href="([^"]+)"'
urls = re.findall(pattern, html)
return urls
# Test the function with the provided example
html = '''
</li>
<li>
<a href="https://www.example.com">
<i cl... |
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int n,first=0,second=1,sum;
cin>>n;
cout<<first<<" "<<second<<" ";
while(n>2){
sum=first+second;
first=second;
second=sum;
cout<<sum<<" ";
n--;
}
}
|
<reponame>chicofariasneto/FrogHelper<gh_stars>0
const { pool } = require('../../database/connection')
const {
user,
} = require('../model/userModel')
const {
checkUser,
} = require('./checkLogic')
const join = async(userId, groupId, username) => {
const check = await checkUser(userId, groupId)
if (ch... |
#!/bin/bash
# Copyright 2018 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 agr... |
<reponame>rjarman/Submarine
import {
DateOptions,
DistanceMatrixParam,
EarthRadius,
} from './typings/Typings';
export class Services {
private dateOptions: DateOptions;
constructor() {
this.dateOptions = {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
};
... |
/**
* WatchMeContentProvider.java
*
* The Content Provider for the WatchMe application.
*
* @author lisastenberg
* @copyright (c) 2012 <NAME>, <NAME>, <NAME>, <NAME>
* @license MIT
*/
package se.chalmers.watchme.database;
import android.content.ContentProvider;
import android.content.ContentResolver;
import ... |
var AreasFilter = require('./areas.filter.service');
module.exports = require('angular')
.module('ki.resources', [])
.factory('AreasFilter', AreasFilter)
.name; |
<gh_stars>0
package controller.channel.messages;
/**
* Base class of a message
*
* @author ramilmsh
*/
public abstract class Message {
}
|
def all_same_length(strings):
for i in range(1,len(strings)):
if len(strings[0]) != len(strings[i]):
return False
return True |
package mock.media;
import org.jitsi.service.neomedia.*;
import org.jitsi.service.neomedia.rtp.*;
import java.awt.*;
import java.util.*;
/**
*
*/
public class MockMediaStreamStats
implements MediaStreamStats
{
@Override
public double getDownloadJitterMs()
{
return 0;
}
@Override
... |
#!/bin/bash
#SBATCH -p bosch_gpu-rtx2080 # partition (queue)
#SBATCH --mem 10000 # memory pool for all cores (8GB)
#SBATCH -t 11-00:00 # time (D-HH:MM)
#SBATCH -c 2 # number of cores
#SBATCH -a 1-12 # array size
#SBATCH --gres=gpu:1 # reserves four GPUs
#SBATCH -D /home/siemsj/projects/darts_weight_sharing_analysis # ... |
function digga(domain) {
const { execSync } = require('child_process');
try {
// Execute the dig command to perform a DNS lookup
const result = execSync(`dig +nocmd "${domain}" any +multiline +noall +answer`, { encoding: 'utf8' });
// Extract the IP address from the result using regular expression
... |
#!/bin/bash
cd "$(dirname "$0")"
./Orthanc configOSX.json |
#!/bin/bash
#
# Ensure we're excuting from script directory
cd "$(dirname ${BASH_SOURCE[0]})"
# exit when any command fails
set -e
GEN_PATH="gen"
GIT_TEMP_PATH=$(mktemp -d -t 'kinprotosgittmp')
KIN_API_GIT_PATH="${GIT_TEMP_PATH}/kin-api"
VALIDATE_GIT_PATH="${GIT_TEMP_PATH}/validate"
MODEL_TEMP_PATH=$(mktemp -d -t '... |
#!/usr/bin/env bash
cd $PROJECT_DIR
cd micropython
make -C mypy-cross
|
package org.dimdev.rift.util;
import net.minecraft.nbt.NBTTagCompound;
import javax.annotation.Nonnull;
/**
* Base interface for (de)serializable objects to serialize
* themselves to and from {@link NBTTagCompound} tag compounds
*/
public interface NBTSerializable {
/**
* Writes this object's data to the... |
public class AttributeInformation
{
public string AttributeName { get; set; }
}
public class AttributeInformationDetailed : AttributeInformation
{
public int NumberOfCalls { get; set; }
public IEnumerable<StepDetails> GeneratedStepDefinitions { get; set; }
public static int GetTotalStepDefinitions(IEn... |
# == Schema Information
#
# Table name: favorites
#
# id :bigint not null, primary key
# favoritable_type :string indexed => [favoritable_id], indexed => [favoritable_id]
# favoritable_id :bigint indexed => [favoritable_type], indexed => [favoritable_type]
# user_id ... |
#!/bin/bash
set -e
cd `dirname "$0"`
check="java -jar target/boku-http-auth-tools-1.2-main.jar check"
for file in test-vectors/*; do
echo -n "$file: "
$check -quiet $file
done
|
import { JsonType } from '@useoptic/optic-domain';
import { ChangeType } from './changes';
import { IContribution } from './contributions';
// Types for rendering shapes and fields
export interface IFieldRenderer {
fieldId: string;
name: string;
shapeId: string;
shapeChoices: IShapeRenderer[];
required: bool... |
package com.kevinwilde.sitecrawler.masternodesonline.service.graphql;
import com.kevinwilde.graphqljavaclient.GraphQlClient;
import com.kevinwilde.sitecrawler.masternodesonline.domain.githubInforesponse.Data;
import com.kevinwilde.sitecrawler.masternodesonline.domain.githubInforesponse.GithubInfoResponse;
import com.k... |
<reponame>carpaltunnel/metalus
package com.acxiom.pipeline
import com.acxiom.pipeline.audits.{AuditType, ExecutionAudit}
import com.acxiom.pipeline.drivers.{DefaultPipelineDriver, DriverSetup}
import com.acxiom.pipeline.utils.DriverUtils
import org.apache.commons.io.FileUtils
import org.apache.hadoop.io.LongWritable
i... |
<reponame>SamuelMoffat/finalProject
package datageneration;
import com.opencsv.bean.CsvToBeanBuilder;
import gis.UkLocation;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
public class DataGenerator {
public List<DataPoint> listOfPoints;
p... |
/*-
* ========================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... |
<filename>web/old_js/app.js
(function () {
var root;
root = typeof exports !== "undefined" && exports !== null ? exports : this;
root_domain = document.domain.replace(/^app\./, '') + (location.port ? ':' + location.port : '');
$(document).ready(function () {
$('#form_signin').on('submit', fun... |
<reponame>chipsi007/qemu_esp32
var ui = {
inputType: {
title: "Input",
value: 2,
values: [["Live Input (5 V peak amplitude)",1], ["Sine Wave (amplitude 5 V)",2], ["Square Wave (amplitude 5 V)",3]]
},
freeze: {
title: "Freeze Live Input",
value: false,
},
freq:... |
var skrollr = require('skrollr'),
s = skrollr.init(),
setupResizeEvents = require('./resize-events'),
setupParallaxBackground = require('./background-parallax')
setupResizeEvents()
setupParallaxBackground()
|
<gh_stars>1-10
package org.slos.rating;
import java.util.Comparator;
public class PlacementRankComparator implements Comparator<PlacementRank> {
@Override
public int compare(PlacementRank o1, PlacementRank o2) {
if (o1.getRating().equals(o2.getRating())) {
return 0;
}
if (o... |
import nltk
# Tokenize the text strings
spanish_tokenizer = nltk.tokenize.WordPunctTokenizer()
spanish_tokens = spanish_tokenizer.tokenize(“Gracias por su ayuda”)
english_tokenizer = nltk.tokenize.TreebankWordTokenizer()
english_tokens = english_tokenizer.tokenize(“Thank you for your help”)
# Compute the Levenshtein... |
# Run stress test on the batch system
# All run*.sh scripts in the $ALICE_ROOT test macro invoked
#
# Parameters:
# 1 - output prefix
# 2 - submit command
#
# Run example:
# $ALICE_ROOT/test/stressTest/stressTest.sh /d/alice12/miranov/streeTest/ "bsub -q proof"
#
outdir=$1/$ALICE_LEVEL/
submitcommand... |
package utils;
import play.Logger;
import play.mvc.Action.Simple;
import play.mvc.Http;
import play.mvc.Result;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
public class VerboseAction extends Simple {
@Override
public CompletionStage<Result> call(Http.Context c... |
def process_data(filename):
data = {'susyhit': [], 'prospino': []}
with open(filename, 'r') as file:
current_data = None
for line in file:
line = line.strip()
if line.startswith('# susyhit data'):
current_data = 'susyhit'
elif line.startswith(... |
class InstanceManager:
def __init__(self):
self._state_info = {} # Dictionary to store state information for instances
self._instances_to_purge = set() # Set to store instances marked for purging
self._dirty = False # Flag to track if state information has been modified
def add_insta... |
package main
import (
"fmt"
"os"
"os/signal"
"sync"
"github.com/docopt/docopt-go"
"github.com/mushorg/glutton"
)
var usage = `
Usage:
server -i <interface> [options]
server -h | --help
Options:
-i --interface=<iface> Bind to this interface [default: eth0].
-l --logpath=<path> Log file pa... |
#!/bin/bash
set -e
os_major_version=$(cat /etc/redhat-release | tr -dc '0-9.'|cut -d \. -f1)
if ! rpm -q --quiet epel-release ; then
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-$os_major_version.noarch.rpm
fi
echo "installing for os major version : $os_major_version"
yum install -y wh... |
package com.zyf.algorithm.sort;
import java.util.Arrays;
/**
* 查找无序数组中的第 K 大元素
*/
public class FindKth {
/**
* 求无序数组中的第 K 大元素
*/
private int findKthMaxNum(int[] a, int k) {
if (a.length <= 0 || k > a.length || k <= 0) {
return -1;
}
int low = 0;
int hig... |
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
# Data
(X_train, y_train), (X_test, y_test) = datasets.mnist.load_data()
X_train = X_train.reshape(X_train.shape[0], 28, 28, 1).astype('float32')
X_test = X_test.reshape(X_test.shape[0], 28, 28, 1).astype('float32')
X_train /= 255
X_test /= ... |
SELECT *
FROM Accounts
WHERE last_login_date < DATE_SUB(CURDATE(), INTERVAL 60 DAY) |
python3 -m cluster-middleware.master.main |
<gh_stars>10-100
/**
* 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
... |
<gh_stars>1-10
export default function fromString(value: any): any {
if (typeof value !== 'string') {
return value
}
if (value.match(/^[+-]?(?:\d*\.)?\d+$/)) {
return Number(value)
}
if (value === 'true') {
return true
}
if (value === 'false') {
return false
}
return value
}
|
const init = (name) => {
return `.${name} {
color: red;
}`;
};
module.exports = {
init,
};
|
package api
import "cf/net"
type FakeCurlRepository struct {
Method string
Path string
Header string
Body string
ResponseHeader string
ResponseBody string
ApiResponse net.ApiResponse
}
func (repo *FakeCurlRepository) Request(method, path, header, body string) (resHeade... |
import './utils/disableLogs';
import { dispatch } from '@rematch/core';
import React from 'react';
import { View } from 'react-native';
import Assets from './Assets';
import AudioManager from './AudioManager';
import Settings from './constants/Settings';
import AchievementToastProvider from './ExpoParty/AchievementTo... |
#!/bin/zsh
file=$2
new_tags=$3
for i in {1..${#string}}; do
x=$string[i]
if [[ "$x" == "$sep" ]]; then
echo $value
value=""
else
value+=$x
fi
done
echo $value
if [[ "$1" == "get" ]]; then
read_tags $file
echo $tags
exit 0
elif [[ "$1" == "set" ]]; then
write_tags $file $new_tags
exit 0
e... |
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=D:\flutter"
export "FLUTTER_APPLICATION_PATH=D:\projects\fluttertraining"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_FRAMEWORK_DI... |
<gh_stars>1-10
//******************************************************************************
// MSP430FR6989 Demo - ADC12B, Sample A3, 2.5V Shared Ref, TLV, CRC16
//
// Based in example "tlv_ex3_calibrateTempSensor" of "MSP430 DriverLib - TI"
// This example show how to get and use TLV data to increase accuracy o... |
#!/bin/sh
# Package
PACKAGE="nzbget"
DNAME="NZBGet"
# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:/usr/local/bin:/bin:/usr/bin:/usr/syno/bin"
USER="nzbget"
NZBGET="${INSTALL_DIR}/bin/nzbget"
CFG_FILE="${INSTALL_DIR}/var/nzbget.conf"
PID_FILE="${INSTALL_DIR}/var/n... |
#!/bin/sh
# To use:
# - place this script to /usr/local/etc/rc.d/syz_ci
# - chmod a+x /usr/local/etc/rc.d/syz_ci
# - add the following to /etc/rc.conf (uncommented):
#
# syz_ci_enable="YES"
# syz_ci_chdir="/syzkaller"
# syz_ci_flags="-config config-freebsd.ci"
# syz_ci_log="/syzkaller/syz-ci.log"
# syz_ci_path="/syzka... |
package com.zys.paylib.pay;
import android.app.Activity;
import com.zys.paylib.alipay.AlipayUtil;
public interface IPay {
void pay(Activity activity, String paynumbe, double price, AlipayUtil.AlipayCallBack callback);
}
|
parallel --jobs 6 < ./results/exp_disk_lustre/run-0/lustre_4n_6t_2d_1000f_617m_10i/jobs/jobs_n2.txt
|
CREATE OR REPLACE FUNCTION your_project_id.your_dataset.h3_num_hexagons(res NUMERIC)
RETURNS NUMERIC
LANGUAGE js AS
"""
return h3.numHexagons(res);
"""
OPTIONS (
library=['gs://file_path']
);
|
const express = require('express');
const path = require('path');
const app = express();
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.listen(8080, () => {
console.log('Serving www.example.com on port 8080');
}); |
from diem import LocalAccount
from offchain import CommandResponseObject, jws, CommandResponseStatus
def test_serialize_deserialize():
account = LocalAccount.generate()
response = CommandResponseObject(
status=CommandResponseStatus.success,
cid="3185027f05746f5526683a38fdb5de98",
)
ret... |
<reponame>dingxiaobo/rest-api-dispatcher
package cn.dxbtech.restapidispatcher;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.O... |
#!/usr/bin/env bash
################################################################################
# Compute Engine
################################################################################
# Create Compute Engine virtual machine instance
# In:
# MY_GCP_GCE_NAME
# MY_GCP_ZONE
# MY_GCP_GCE_TYPE
# ... |
def is_same_tree(tree1, tree2):
if tree1 is None and tree2 is None:
return True
elif tree1 is None or tree2 is None:
return False
else:
return tree1.data == tree2.data and\
is_same_tree(tree1.left, tree2.left) and\
is_same_tree(tree1.right, tree2.right) |
The maximum sum of a continuous subarray is 13, with the subarray being [5, 6, -3, -4, 7]. |
#!/usr/bin/env bash
function run_test_suite {
if [ "${TRAVIS_SCALA_VERSION}" == "${TARGET_SCALA_VERSION}" ] && [ "${TRAVIS_JDK_VERSION}" == "oraclejdk8" ];
then
echo "Running tests with coverage and report submission"
sbt ++$TRAVIS_SCALA_VERSION coverage test coverageReport coverageAggregate cov... |
const {
useHttps
} = require('../middleware');
/**
* Enables https redirects and strict transport security.
*
* @param {Router} router
*/
module.exports = function(router) {
if (!process.env.FORCE_HTTPS) {
return;
}
const baseUrl = process.env.BASE_URL;
if (!baseUrl) {
throw new Error('must co... |
SELECT customer_name FROM customers WHERE customer_name LIKE 'John%'; |
<gh_stars>1-10
import json
import os
import requests
from .constants import BASE_DIR
answer_key_ext = ".json"
def online_only(shift_code):
""" Downloads a prepared answer key from a repo"""
#//print("[D] Downloading latest Answer Key")
answer_key = requests.get('https://raw.githubusercontent.com/De... |
import { LOAD_TEMP_USERS, LOAD_USERS, LOAD_USERS_SUCCESS } from './constants';
const defaultState = {
loading: false,
users: [],
};
export default function users(state = defaultState, action) {
switch(action.type) {
case LOAD_USERS:
return { ...state, loading: true };
case LOAD_TEMP_USERS:
... |
/* Copyright (c) 2009, <NAME>, Orbot / The Guardian Project - http://openideals.com/guardian */
/* See LICENSE for licensing information */
package com.msopentech.thali.android.toronionproxy.torinstaller;
public interface TorServiceConstants {
String TAG = "TorBinary";
//name of the tor C binary
String TOR_ASS... |
<gh_stars>0
#ifndef WIN32WINDOW
#define WIN32WINDOW
#ifndef UNICODE
#define UNICODE
#endif
#ifndef _UNICODE
#define _UNICODE
#endif
#include <windows.h>
#include "../contextSettings.hpp"
#include "../iEvent.hpp"
#include <SFML/Window/WindowHandle.hpp>
#include <SFML/System/String.hpp>
#include <SFML/System/Vector2.hp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.