text stringlengths 1 1.05M |
|---|
def sort_addresses_by_length(addresses):
# Create a dictionary to store addresses grouped by length
addresses_by_length = {}
for address in addresses:
length = len(address)
if length in addresses_by_length:
addresses_by_length[length].append(address)
else:
add... |
/*
* options.h -- compiler configuration options set at compile time
* Copyright (C) Acorn Computers Ltd. 1988
* SPDX-Licence-Identifier: Apache-2.0
*/
/*
* RCS $Revision$
* Checkin $Date$
* Revising $Author$
*/
#ifndef _options_LOADED
#define _options_LOADED
/*
* The following conditional settings allow th... |
#!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2022 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of Shareloc
# (see https://github.com/CNES/shareloc).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... |
<gh_stars>1-10
// Copyright 2016-present Province of British Columbia
//
// 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 req... |
<gh_stars>1-10
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="ht... |
TERMUX_SUBPKG_DESCRIPTION="Texlive's collection-latexrecommended"
TERMUX_SUBPKG_DEPENDS="texlive-fontsrecommended, texlive-latexextra, texlive-pictures, texlive-plaingeneric"
TERMUX_SUBPKG_INCLUDE=$($TERMUX_PKG_BUILDER_DIR/parse_tlpdb.py collection-latexrecommended $TERMUX_PKG_TMPDIR/texlive.tlpdb)
TERMUX_SUBPKG_CONFLI... |
<reponame>pmashchak/config-parser
describe ValueType do
let(:value) { SecureRandom.hex }
subject { described_class.new(value) }
shared_examples :to_value do |input, output|
let(:value) { input }
it "parses #{input} as #{output}" do
expect(subject.to_value).to eq(output)
end
end
it_behave... |
<gh_stars>0
#include <cstdio>
#include <windows.h>
#include <string>
#include <time.h>
#include <fstream>
#include <cstdlib>
#include <mmsystem.h>
#include <assert.h> // debugging
#include <cstdlib>
// define to enable flac (if you're crazy enough)
// #define __USE_FLAC__
#ifdef __USE_FLAC__
#include "FLAC++/enc... |
<filename>src/automated-scripts/exportDBsToCloud.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Grab the list of databases to be exported in the MSG configuration file and
export them to cloud storage.
Files beyond a maximum limit are split according to the number of chunks set
in the config file.
Usage:
... |
import styled from 'styled-components'
import React from "react"
import LargeBtn from '../components/largebtn'
const SmallBtn = styled(LargeBtn)`
height: 30px;
max-width: 100px;
background-color: ${props => props.color ? props.color : 'lightgreen'};
margin-left: auto;
font-size: 16px;
padding-t... |
#perl adjust_checksum.pl mcmthesis.dtx
xetex mcmthesis.dtx
xelatex mcmthesis.dtx
xelatex mcmthesis.dtx
#xelatex -shell-escape mcmthesis.dtx
#xelatex -shell-escape mcmthesis.dtx
xelatex mcmthesis-demo.tex
xelatex mcmthesis-demo.tex
mv LICENSE.tex LICENSE
mv README.tex README
rm *.log *.out *.aux *.glo *.idx
rm -rf _mint... |
#!/bin/bash
find_source_files() {
local TEST_SRCDIR=$1
local TEST_WORKSPACE=$2
local SRCDIR
if [ -n "${TEST_SRCDIR}" ]; then
SRCDIR="${TEST_SRCDIR}/${TEST_WORKSPACE}"
else
SRCDIR="$(dirname $0)/.."
fi
echo "${SRCDIR}"
}
# Example usage
# TEST_SRCDIR="/path/to/source"
# TEST_WORKSPACE="workspac... |
<reponame>Blockception/BC-Minecraft-Molang
/** */
export interface Defined<T> {
/** */
defined: T[];
}
/** */
export namespace Defined {
/**
*
* @param items
* @returns
*/
export function create<T>(items: T[] | undefined = undefined): Defined<T> {
if (!items) {
items = [];
}
retu... |
from ._ESS import essLocalDimEst as ess_py
from ._mada import mada as mada_py
from ._corint import corint as corint_py
# Assuming the dataset is defined as 'data'
# Step 1: Estimate local dimension using ess_py function
local_dimension = ess_py(data)
# Step 2: Perform statistical analysis using mada_py function
stat... |
<gh_stars>1-10
import React from "react";
import style from "styled-components";
import { Link } from "react-router-dom";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import { logout } from "../store/actions";
const StyleHeader = style.header`
width: 100%;
display: flex;
... |
#include <vector>
#include <cmath>
std::vector<double> HPCP(const std::vector<double>& frequencies, const std::vector<double>& magnitudes) {
std::vector<double> hpcp(12, 0.0); // Initialize HPCP vector with zeros
// Iterate over the input frequencies and magnitudes
for (size_t i = 0; i < frequencies.size... |
<reponame>zhangliangInfo/husky
const fs = require('fs');
const path = require('path');
const { resolve } = require('path');
const execa = require('execa');
const cwd = process.cwd();
// 需要包含测试用例的文件
const includesDir = ['src/pages'];
interface CHECKRST {
filename: string;
filedir: string;
path: string;
}
let comm... |
#!/bin/bash
echo "START PREPROCESS --->"
python run_preprocess.py --config_name config.yaml
echo "<--- END PREPROCESS"
echo "START TRAIN --->"
for i in `seq 0 4`
do
echo "START - FOLD: $i"
python run_train.py --config_name config.yaml --fold $i
ret=$?
if [ $ret -ne 0 ]; then
echo "RAISED EXCE... |
/**************************************************************
* DROP FUNCTIONS
**************************************************************/
DROP FUNCTION jsonb_diff_val(JSONB, JSONB);
DROP FUNCTION revert_row_event(INTEGER, INTEGER);
DROP FUNCTION revert_transaction(INTEGER);
DROP FUNCTION revert_transaction_group... |
var pendingStartCompletion: ErrorHandler?
var pendingStopCompletion: CompletionHandler?
var tunnel: Tunnel?
func manageTunnelOperations(startCompletion: ErrorHandler?, stopCompletion: CompletionHandler?) {
if let startCompletion = startCompletion {
startCompletion(tunnel?.lastError)
pendingStartCom... |
# Base constants
SCRIPT_DIR=${0:a:h}
MAGE_ROOT_FILE=${SCRIPT_DIR}/mage_root.txt
MAGE_AUTOCOMPLETE_FILE=${SCRIPT_DIR}/mage_autocomplete.txt
function m2:help() {
HELP_MSG="
Description:
Magento 2 zsh autocomplete plugin
Author:
Dominic Dambrogia <domdambrogia+mage-2-plugin@gmail.com>
Functions:
m2 ... |
<reponame>fjruizruano/TEmin
#!/usr/bin/python
import sys, os
from subprocess import call, Popen
from os import listdir
from os.path import isfile, join
print "Usage: deconseq_run.py ListOfFiles Reference Threads"
try:
files = sys.argv[1]
except:
files = raw_input("Introduce list of files: ")
try:
ref = ... |
<gh_stars>1-10
package main
import "github.com/hyrut/go-tkgtools"
import "fmt"
import "time"
func _visitBytes(b []byte){
for _, v := range b{
fmt.Printf("0x%02x,",v)
}
fmt.Println()
}
func main(){
tkg := tkgtools.NewTKGTOOLS()
key := [16]byte{<KEY>}
op := [16]byte{0xcd,0xc2,0x02,0xd... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
declare -A cpus
cpus[nhm-ex]=GenuineIntel-6-2E
cpus[nhm-ep]=GenuineIntel-6-1E
cpus[nhm-ep]=GenuineIntel-6-1A
cpus[wsm-ex]=GenuineIntel-6-2F
cpus[wsm-sp]=GenuineIntel-6-25
cpus[wsm-dp]=GenuineIntel-6-2C
cpus[snb]=GenuineIntel-6-2A
cpus[jkt]=GenuineIntel-6-2D
cpus[ivt]=GenuineIntel-6-3E
cpus[ivb]=GenuineIntel-6-3A
cpus[h... |
<filename>src/server/actions.js
var _ = require('lodash');
function storeSocket(socket) {
return {
type: 'STORE_SOCKET',
payload: {
socket: socket,
id: _.uniqueId('socket_'),
},
};
}
function removeSocket(socketId) {
return {
type: 'REMOVE_SOCKET',
payload: {
socketId,
... |
package com.huatuo.activity.personal;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import... |
package fastly
import (
"fmt"
"net/url"
"sort"
"time"
)
// DigitalOcean represents a DigitalOcean response from the Fastly API.
type DigitalOcean struct {
ServiceID string `mapstructure:"service_id"`
ServiceVersion int `mapstructure:"version"`
Name string `mapstructure:"name"`
Bucket... |
<reponame>krpharr/verbose-dollop
import axios from "axios";
export default {
search: function(term, start, max) {
return axios.get(`api/googlebooks/${term}/${start}/${max}`);
},
getBooks: function() {
return axios.get("api/books");
},
saveBook: function(bookObj) {
return axios.post("api/books", b... |
import fluidsynth
def play_music(midi_file_path, soundfont_path):
try:
fs = fluidsynth.Synth()
fs.start(driver='alsa')
sfid = fs.sfload(soundfont_path)
fs.program_select(0, sfid, 0, 0)
# Load and play the MIDI file
fs.midifile_load(midi_file_path)
fs.play()
... |
class ChessPosition:
def __init__(self):
self.moves = []
def set_moves(self, moves):
self.moves = moves
def add_move(self, move):
self.moves.append(move)
def get_moves(self):
return self.moves |
#!/usr/bin/env bash
source "../../config.sh"
source "../../jwt.sh"
curl -X PUT https://api.nexmo.com/v1/calls/$UUID/stream \
-H "Authorization: Bearer "$JWT\
-H "Content-Type: application/json"\
-d '{"stream_url": ["https://raw.githubusercontent.com/nexmo-community/ncco-examples/gh-pages/assets/welcome_to_nexmo.... |
#include <iostream>
#include <array>
#include <numeric>
using namespace std;
int main(){
array<int, 10> arr{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
for (auto a: arr) cout << a << " " ; // 1 2 3 4 5 6 7 8 9 10
cout << "\n";
double sum= accumulate(arr.begin(), arr.end(), 0);
cout << sum << std::endl; ... |
package com.qtimes.pavilion.base.rx;
import android.content.Context;
import androidx.annotation.NonNull;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import com.qtimes.pavilion.base.rx.lifecycle.LayoutEvent;
import com.qtimes.pavilion.base.rx.lifecycle.LayoutLifecycleProvider;
import com.trell... |
import json
class STATUS:
OK = "OK"
ERROR = "ERROR"
class Status:
def __init__(self, status, reason):
self.status = status
self.reason = reason
def eq(self, other_status):
return self.status == other_status
def brief(self):
return self.reason
class Result:
de... |
<reponame>lananh265/social-network
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.u1F4BF = void 0;
var u1F4BF = {
"viewBox": "0 0 2600 2760.837",
"children": [{
"name": "path",
"attribs": {
"d": "M2057.5 1870.5Q1938 2075 1735 2191t-435 116-435-116-322.5-320.5T4... |
<reponame>smagill/opensphere-desktop
package io.opensphere.merge.model;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Seria... |
Proof:
Let S be the sum of the first n odd numbers.
Then S = 1 + 3 + 5 + ... + (2n-1).
Now, rewrite the sum as
S = 1 + 3 + 5 + ... + 2(n-1) + 2n
= 2 + 4 + 6 + ... + 2(n-1) + 2n
= 2(1 + 2 + 3 + ... + (n-1) + n)
= 2(n(n+1)/2)
= n^2. |
<reponame>xbabka01/yaramod
/**
* @file src/examples/dump_rules_ast/dumper.h
* @brief Implementation of main for AST dumper.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include <string>
#include <vector>
#include <yaramod/yaramod.h>
#include "dumper.h"
int main(int argc, char* argv[]... |
from pypy.rlib import jit
from pypy.jit.metainterp.test.support import LLJitMixin, OOJitMixin
@jit.dont_look_inside
def escape(x):
return x
class ImmutableFieldsTests:
def test_fields(self):
class X(object):
_immutable_fields_ = ["x"]
def __init__(self, x):
se... |
<reponame>xfys/lovetao<gh_stars>10-100
package com.inner.lovetao.settings.di.module;
import com.inner.lovetao.settings.mvp.contract.ContactServiceContract;
import com.inner.lovetao.settings.mvp.model.ContactServiceModel;
import dagger.Binds;
import dagger.Module;
/**
* desc:
* Created by xcz
*/
@Module
public ab... |
<reponame>leongaban/redux-saga-exchange
import * as NS from '../../namespace';
import { initial } from '../initial';
export function dataReducer(state: NS.IReduxState['data'] = initial.data, action: NS.Action): NS.IReduxState['data'] {
switch (action.type) {
case 'LIQUIDITY-POOL:GET_TIO_LOCKED_BALANCE_SUCCESS': ... |
def Fibonacci(limit):
# Initializing first two Fibonacci numbers
num1 = 0
num2 = 1
# Initialize empty list
fibonacci_numbers = []
# Add the initialized numbers to the list
fibonacci_numbers.append(num1)
fibonacci_numbers.append(num2)
# Calculate remaining Fibonacci numbe... |
package mezz.jei.api.ingredients;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.item.Item;
/**
* Put this interface on your {@link Item} to skip JEI's render optimizations.
*
* This is useful for baked models that use ASM and do not use {@link IBakedModel#isBuiltInRenderer}.
*... |
<filename>algorand-spring-starter-demo/src/main/java/com/algorand/starter/demo/controller/CircleController.java
package com.algorand.starter.demo.controller;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.... |
var ADLbrowserDataTable=(function(){
var self={}
self.showQueryResult= function (data, options) {
var dataSet = [];
var cols = [];
var keys={}
options.selectVars.forEach(function (varName) {
var key = varName.substring(1)
cols.push({title: key})
... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-N-VB/13-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-N-VB/13-512+512+512-NER-1 --do_eval --per_device_... |
package com.example.co4sat;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SwitchCompat;
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageManager;
import android.loca... |
#!/bin/sh
gcc -c ae.c -o ae.o
gcc -c client.c -o client.o -lpthread -std=c11
gcc client.o -o client -lpthread -std=c11
gcc -c server.c -o server.o -lpthread -std=c11
gcc ae.o server.o -o server -lpthread -std=c11
|
#!/bin/bash
echo "Start the mini-cluster with the following arguments : $*"
mvn exec:exec -Dexec.arguments="$*" -Pcluster
|
#!/bin/bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
LocalNuGetRepo=$1
export CurrentOnnxRuntimeVersion=$2
IsMacOS=${3:-false}
PACKAGENAME=${PACKAGENAME:-Microsoft.ML.OnnxRuntime}
RunTestCsharp=${RunTestCsharp:-true}
RunTestNative=${RunTestNative:-true}
set -x -e
... |
const { Product } = require("../models");
const createProduct = async (_, { input }) => {
const newProduct = new Product(input);
await newProduct.save();
return newProduct;
};
module.exports = createProduct;
|
<reponame>mason-fish/brim<filename>zealot/api/archive.ts
import {FetchArgs} from "../fetcher/fetcher"
export type IndexSearchArgs = {
spaceId: string
patterns: string[]
index_name?: string
signal?: AbortSignal
}
export function search({
spaceId,
index_name,
patterns,
signal
}: IndexSearchArgs): FetchA... |
<reponame>FreDP47/WashBuddiez
import { Component, OnInit } from '@angular/core';
import { OrderService } from '../services/order.service';
import { Order } from 'app/models/model.interface';
import {environment} from '../../environments/environment.prod';
@Component({
selector: 'app-checkout',
templateUrl: './chec... |
<filename>src/test/java/net/andreaskluth/elefantenstark/TestData.java<gh_stars>1-10
package net.andreaskluth.elefantenstark;
import java.sql.Connection;
import net.andreaskluth.elefantenstark.producer.Producer;
import net.andreaskluth.elefantenstark.work.WorkItem;
public class TestData {
public static void schedul... |
def fahrenheit_to_celsius(temperature):
'''This function converts a Fahrenheit temperature to Celsius'''
# Convert the temperature to Celsius
celsius_temp = (temperature - 32) / 1.8
# Return the Celsius temperature
return celsius_temp |
package cn.finalteam.rxgalleryfinalprovider.ui.activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import cn.finalteam.rxgalleryfinalprovider.RxGalleryFinal;
import cn.finalteam.rxgallery... |
# Solution for posFloatOrZeroValidator function
def posFloatOrZeroValidator(value: float) -> None:
if not isinstance(value, (float, int)):
raise ValueError("Input must be a float or an integer")
if value < 0:
raise ValueError("Input must be a positive float or zero")
# Test cases using pytest
i... |
# frozen_string_literal: true
require_relative "../../spec_helper"
# "summary": {
# "duration": 0.02296628,
# "example_count": 4,
# "failure_count": 1,
# "pending_count": 2,
# "errors_outside_of_examples_count": 0
# },
# "summary_line": "4 examples, 1 failure, 2 pending"
RSpec.describe RspecConsolidator::S... |
x = [1 2 3 4 5 6];
y = [2 4 6 8 10 12];
X = [ones(size(x,1),1) x'];
b = X\y';
yCalc = X*b;
disp('Slope:')
disp(b(2))
disp('Y intercept:')
disp(b(1)) |
describe("IfDirective", function () {
it("for true literal", function () {
var MyComponent = san.defineComponent({
template: '<div><span san-if="true" title="errorrik">errorrik</span></div>'
});
var myComponent = new MyComponent();
var wrap = document.createElement('div... |
module Boxroom
class Engine < ::Rails::Engine
isolate_namespace Boxroom
initializer 'boxroom.assets.precompile' do |app|
app.config.assets.precompile += %w( boxroom/*.png boxroom/*.jpg boxroom/*.gif )
end
end
end
|
# fd - cd to selected directory
fdr() {
local dir prevcmd
if ! type tree > /dev/null; then
prevcmd='echo "To see perfect preview, install tree" && ls {}'
else
prevcmd='tree -C {} | head -200'
fi
dir=$(fd --hidden --follow --exclude ".git" --exclude "Library" --max-depth 5 | fzf +m --reverse --pre... |
#!/usr/bin/env python
""" Problem 64 daily-coding-problem.com """
def is_valid_move(board, move, n):
r, c = move
return 0 <= r < n and 0 <= c < n and board[r][c] is None
def valid_moves(board, r, c, n):
deltas = [
(2, 1),
(1, 2),
(1, -2),
(-2, 1),
(-1, 2),
(2... |
<gh_stars>0
//fix:
// ctx.contextPath().toString() in login, logout in UserController
// see ctx.fullUrl() in register in AdminController
// try query, bound, rs, data, s -> toString() in DAO layer
// try -> .getQuery()
// uncomment authorization validation in controllers
package edu.mdamle;
import org.apache.log... |
#! /bin/sh
set -x
pip3 install c7n
for policy in policies/*
do
custodian run -s out -c $policy
done
|
package com.darian.spring5testdemo;
import com.darian.spring5testdemo.domain.User;
import com.darian.spring5testdemo.service.UserRemoteService;
import com.darian.spring5testdemo.service.UserServiceJUnit5Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframewo... |
#!/usr/bin/env bash
test_description="Test sharness tests are correctly written"
. lib/test-lib.sh
for file in $(find .. -maxdepth 1 -name 't*.sh' -type f); do
test_expect_success "test in $file finishes" '
grep -q "^test_done\b" "$file"
'
test_expect_success "test in $file has a description" '
... |
import styled from "styled-components";
export const NotificationContainer = styled.div`
position: fixed;
top: 0;
left: 0;
background-color: blue;
color: white;
width: 100vw;
padding: 3px 20px;
z-index: 10;
`;
|
#!/bin/bash
# shellcheck disable=SC2155,SC2153,SC2038,SC1091,SC2116
################################################################################
# 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 Licens... |
import React, { DependencyList, ReactElement, useCallback, useState } from 'react';
import Form from '../components/Form';
import { FieldPack, Fields, FormValues } from '../utils/helperTypes';
import { ValidationMode } from '../utils/validationTypes';
import { Config as RecaptchaConfig } from './useRecaptcha';
export ... |
#!/usr/bin/env bash
wget https://www.apache.org/dist/flink/flink-1.10.0/flink-1.10.0-bin-scala_2.11.tgz
wget -P ./lib/ https://repo1.maven.org/maven2/org/apache/flink/flink-json/1.10.0/flink-json-1.10.0.jar | \
wget -P ./lib/ https://repo1.maven.org/maven2/org/apache/flink/flink-sql-connector-kafka_2.11/1.10.0/fl... |
#!/bin/bash
set -eu
cur=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
source $cur/../_utils/test_prepare
WORK_DIR=$TEST_DIR/$TEST_NAME
db1="downstream_more_column1"
tb1="t1"
db="downstream_more_column"
tb="t"
function run() {
run_sql_file $cur/data/db1.prepare.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1
# creat... |
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;
// Define the HttpRequest class representing an HTTP request
class HttpRequest {
private final String url;
public HttpRequest(String url) {
this.url = url;
}
public String getUrl() {
... |
#!/bin/bash
set -e
if [ ! -f ../tre_output.json ]; then
# Connect to the remote backend of Terraform
export TF_LOG=""
terraform init -input=false -backend=true -reconfigure -upgrade \
-backend-config="resource_group_name=$TF_VAR_mgmt_resource_group_name" \
-backend-config="storage_account_name=$TF_VA... |
class Node {
int value;
Node* left;
Node* right;
Node* parent;
int color;
Node(int val)
{
this->value = val;
left = nullptr;
right = nullptr;
parent = nullptr;
this->color = 'r';
}
};
class RedBlackTree {
Node *root;
public:
RedBlackTr... |
<filename>webauthn4j-core/src/main/java/com/webauthn4j/data/MessageDigestAlgorithm.java
/*
* Copyright 2002-2018 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 Lice... |
"""
PhenoCam Raw Data Processing
This is the code for the the processing of the raw PhenoCam data, downloaded from both the PhenoCam dataset and the images hosted by UNH.
"""
import os
import csv
import json
def delete_tif():
# delete all .tif files in this data directory
directory = "./phenocam_data/"
... |
// Code generated by protoc-gen-go-json. DO NOT EDIT.
// versions:
// - protoc-gen-go-json v1.3.1
// - protoc v3.9.1
// source: lorawan-stack/api/lorawan.proto
package ttnpb
import (
gogo "github.com/TheThingsIndustries/protoc-gen-go-json/gogo"
jsonplugin "github.com/TheThingsIndustries/protoc-gen-go-js... |
#!/bin/bash
## @author Jay Goldberg
## @email jaymgoldberg@gmail.com
## @description appends little text lines using a popup window
## just tie it to a keybinding in your window manager
## @license Apache 2.0
## @usage guinote.sh <filename>
## @requires zenity
#=================================================... |
<filename>Scripts/skracivanje.py<gh_stars>0
with open('SRR1031159_1_full.fasta', 'r') as f:
head = f.readline().strip()
while head:
seq = f.readline().strip()
if seq.find('N') == -1:
print(head)
print(seq)
head = f.readline().strip()
|
<reponame>neoguru/axboot-origin
package com.chequer.axboot.core.model.extract.metadata;
import lombok.Data;
@Data
public class PrimaryKey {
private String columnName;
private Integer keySeq;
}
|
#!/bin/bash
# Simpler entrypoint script for awe client
clientgroup=$1
vmhostname=$2
echo clientgroup is $clientgroup
echo vmhostname is $vmhostname
# it would be nice to clean this up
containername=$(docker inspect $(hostname)|grep aweworker|grep Name|cut -f2 -d '/'|cut -f1 -d '"')
clientname=${clientgroup}_${vmho... |
use serde::{Deserialize, Deserializer};
use serde_json::from_str;
#[derive(Deserialize, Debug)]
pub struct Scml {
pub name: String,
pub strokes: Vec<Stroke>,
}
impl Scml {
fn parse(scml_json: &str) -> Scml {
from_str(scml_json).expect("Scml parse error")
}
}
#[derive(Deserialize, Debug)]
pub ... |
#!/bin/sh
# Usage: ./deploy.sh APP_NAME
APP_NAME=$1
aws cloudformation deploy \
--stack-name "${APP_NAME}" \
--template-file ./ci/s3.yml \
--parameter-overrides AppName="${APP_NAME}" \
--no-fail-on-empty-changeset
BUCKET_NAME=$(aws cloudformation describe-stacks --stack-name "${APP_NAME}" | jq -r '.St... |
#!/usr/bin/env bash
#
# Copyright 2012 HellaSec, LLC
#
# 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 ... |
cd /Applications/Adept/lib
java -classpath "*" com.sri.tasklearning.adept.applications.Imageloader.Imageloader |
#!/bin/sh
# This script will install a new BookStack instance on a fresh Ubuntu 16.04 server.
# This script is experimental and does not ensure any security.
echo ""
echo -n "Enter the domain you want to host BookStack and press [ENTER]: "
read DOMAIN
myip=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}'... |
for(let key in person) {
console.log(person[key]);
} |
#!/usr/bin/env bash
# https://github.com/BeSlower/Udacity_object_dataset
readonly CURRENT_DIR=$(dirname $(realpath $0))
readonly DATA_PATH_BASE=$(realpath ${CURRENT_DIR}/../data)
readonly DATA_PATH=${DATA_PATH_BASE}/udacity
echo "start downloading udacity dataset"
if [ ! -d ${DATA_PATH} ]; then
mkdir -p ${DATA_PA... |
#!/bin/bash
## Adapted from code by Nadia Davidson: https://github.com/Oshlack/JAFFA/blob/master/install_linux64.sh
## This script installs the prerequisite software for the MINTIE pipeline
## It will fetch each tool from the web and place it into the tools/ subdirectory.
## Paths to all installed tools can be found i... |
set -ex
pushd _hub
git pull https://github.com/9bow/PyTorch-hub-kr
popd
cp _hub/images/* assets/images/
python3 -c 'import notedown' || pip3 install notedown
python3 -c 'import yaml' || pip3 install pyyaml
mkdir -p assets/hub/
pushd _hub
find . -maxdepth 1 -name "*.md" | grep -v "README" | cut -f2- -d"/" |
while ... |
import * as fs from "fs";
import * as path from "path";
import * as _ from "lodash";
const pjsonFileName = path.join(__dirname, "..", "..", "package.json");
// @ts-expect-error: fs.readFile is not readonly property
fs.readFile = new Proxy(fs.readFile, {
apply(target, thisArg, args) {
if (
Array.isArray(a... |
/*****************************************************************************
* Copyright (C) NanoContainer Organization. All rights reserved. *
* ------------------------------------------------------------------------- *
* The software in this package is published under the terms of the BSD *
* s... |
# Prefer US English and use UTF-8
export LC_ALL='en_US.UTF-8'
export LANG='en_US.UTF-8'
# Set default programs
export TERMINAL='alacritty'
export BROWSER='brave'
export PAGER='less'
export EDITOR='nvim'
export VISUAL="${EDITOR}"
# Set correct TTY for GPG
# https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GP... |
<reponame>MagnoBelloni/ImpactaAngular4
export interface ICurso{
codigo: number;
descricao: string;
ch: number;
} |
import json
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
class SearchPlugin:
def __init__(self, saved_model):
"""
Initializes search plugin by loading the saved machine learning model.
Parameters
... |
<reponame>1aurabrown/ervell<gh_stars>0
import gql from 'graphql-tag';
export default gql`
mutation createPrivateChannelMutation($title: String!) {
create_channel(input: { title: $title, visibility: PRIVATE }) {
clientMutationId
channel {
id
}
}
}
`;
|
package pluto
import (
"golang.org/x/net/context"
"google.golang.org/grpc"
)
// serviceContextUnaryServerInterceptor Interceptor that adds service instance
// available in handlers context
func serviceContextUnaryServerInterceptor(s *Service) grpc.UnaryServerInterceptor {
return func(ctx context.Context, req inter... |
#!/usr/bin/env bash
cp ../samples/ControlCatalog.NetCore/bin/Debug/netcoreapp3.1/Avalonia**.dll ~/.nuget/packages/avalonia/$1/lib/netcoreapp3.1/
cp ../samples/ControlCatalog.NetCore/bin/Debug/netcoreapp3.1/Avalonia**.dll ~/.nuget/packages/avalonia/$1/lib/netstandard2.0/
cp ../samples/ControlCatalog.NetCore/bin/De... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.