text stringlengths 1 1.05M |
|---|
struct Node {
int key;
Node *left, *right;
};
Node* searchKey(Node* root, int key)
{
if (root == NULL || root->key == key)
return root;
if (root->key < key)
return searchKey(root->right, key);
return searchKey(root->left, key);
} |
<filename>home/fields.py
from django.db import models
from django.utils.functional import cached_property
from common.utils import ForeignKeyField, get_selected_or_fallback
from wagtail.core.blocks import StructBlock, StreamBlock, CharBlock, RichTextBlock, URLBlock
from wagtail.core.fields import StreamField
from wagta... |
# frozen_string_literal: true
require 'vcr'
VCR.configure do |c|
c.cassette_library_dir = 'vcr_cassettes'
c.hook_into :webmock
c.filter_sensitive_data('TELEGRAM_BOT_API_KEY') { ENV['TELEGRAM_BOT_API_KEY'] }
c.filter_sensitive_data('TELEGRAM_BOT_USERNAME') { ENV['TELEGRAM_BOT_USERNAME'] }
c.filter_sensitive_... |
/*
* Copyright 2020 Google LLC 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 applicab... |
<reponame>stlankes/hermit-playground
/*
* Copyright (c) 2010, <NAME>, RWTH Aachen University
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain... |
/*
Copyright 2020-2021 University of Oxford
and Health and Social Care Information Centre, also known as NHS Digital
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/licens... |
<filename>lib/src/schemas/documentEntity.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Created by aman on 10/7/17.
*/
var DocManagerMultipleUploadsEntity = {
// Entity for Upload DocManagerMultipleUploads component
name: "verify_document",
fields: [
{
... |
#!/bin/sh
echo "Synchronizing pass"
pass git pull
pass-truncate-history
pass git push
|
#!/usr/bin/bash4
source $(dirname ${BASH_SOURCE[0]})/../cmdarg.sh
function shunittest_test_usage_helper
{
function usage_helper
{
echo "LOL I AM A HELPER"
return 0
}
function parser {
cmdarg_purge
cmdarg_helpers['usage']=usage_helper
cmdarg_parse --help
}
[[ "$(parser 2>&1)" == "LOL I AM ... |
<gh_stars>0
import React from 'react';
import AnchorLink from '../../components/atoms/AnchorLink';
export default {
title: 'Atoms/AnchorLink',
component: AnchorLink,
};
const Template = (args) => <AnchorLink {...args}>{args.children}</AnchorLink>;
export const Basic = Template.bind({});
Basic.args = {
childre... |
set -e
if [ -n "$BASH" ]; then
BASH=~/.bash-profile
fi
if [ -d "$BASH" ]; then
echo "\033[0;33mYou already have Bash Profile installed.\033[0m You'll need to remove $BASH if you want to install"
exit
fi
echo "\033[0;34mCloning Bash Profile...\033[0m"
#hash git >/dev/null 2>&1 && env git clone --depth=1 https:/... |
import React, { FC, useState } from 'react';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Toolbar from '@mui/material/Toolbar';
import Button from '@mui/material/Button';
import IconButton from '@mui/material/IconButton';
import MenuIcon from '@mui/icons-material/Menu';
... |
<filename>frontend/test/unit/specs/components/App/ActionButtons.spec.js
import Vue from 'vue'
import * as sinon from 'sinon'
import ActionButtons from '@/components/App/ActionButtons'
describe('ActionButtons.vue', () => {
let vm = null
const sandbox = sinon.sandbox.create()
beforeEach(() => {
const Constru... |
<gh_stars>1-10
package com.ibm.socialcrm.notesintegration.servlet.servlets;
/****************************************************************
* IBM OpenSource
*
* (C) Copyright IBM Corp. 2012
*
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*****************************... |
#!/bin/bash
# Copyright 2019 Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
#!/usr/bin/env zsh
if [[ (! -d $HOME/.phpenv) ]]; then
alias get-phpenv="git clone git://github.com/phpenv/phpenv.git ~/.phpenv; echo You will need to reload your shell now."
else
prepend-path "$HOME/.phpenv/bin"
prepend-path "$HOME/.phpenv/shims"
source "$HOME/.phpenv/completions/phpenv.zsh"
fi
|
#! /usr/bin/env bash
set -e
# Let the DB start
python /app/app/tests_pre_start.py
# Run migrations
alembic upgrade head
# Create initial data in DB
python /app/app/initial_data.py
# Run tests
pytest $* /app/app/tests/
|
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRO... |
int result = Int32.Parse("12345");
Console.WriteLine(result); |
TEMP=`ls ./target/lib/*.jar`
MAVEN_JARS=`echo $TEMP | sed 's/ /:/g'`
time java -server -cp .:target/SPARQL2Gremlin-1.0-SNAPSHOT.jar:$MAVEN_JARS com.liang.translator.SPARQL2Gremlin.SparqlToGremlinTest
|
<filename>akka-http/src/main/scala/com/lightbend/hedgehog/generators/akka/http/MediaTypeGenerators.scala
package com.lightbend.hedgehog.generators.akka.http
import akka.http.scaladsl.model
import akka.http.scaladsl.model.MediaType
import com.lightbend.hedgehog.generators.Fields
import hedgehog.Gen
object MediaTypeGen... |
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright 2020 NXP
WAIT_TIME=1
NUM_NETIFS=4
lib_dir=$(dirname $0)/../../../net/forwarding
source $lib_dir/tc_common.sh
source $lib_dir/lib.sh
require_command tcpdump
#
# +---------------------------------------------+
# | DUT ports Generator ports ... |
<gh_stars>1-10
package gov.usgs.traveltime;
import java.util.Arrays;
/**
* A collection of spline interpolation routines needed for the computation of travel times.
*
* @author <NAME>
*/
public class Spline {
/**
* Construct custom spline interpolation basis functions. These basis functions depend only on t... |
def find_longest_subarray_sum_equals_target(nums, target):
maxLen = 0
sums = {0 : -1}
curSum = 0
for i in range(len(nums)):
curSum += nums[i]
if curSum - target in sums:
maxLen = max(maxLen, i - sums[curSum-target])
if curSum not in sums:
sums[curSum] = i
... |
from django import forms
class CustomForm:
@staticmethod
def generate_multiple_select_field():
choices = ((x, f'choice {x}') for x in range(5))
multiple_select_field = forms.ChoiceField(
widget=forms.CheckboxSelectMultiple,
label='CheckboxSelectMultiple',
cho... |
<reponame>MccCareplan/patientsmartapp<filename>src/app/main/graphs/generic/generic.component.ts
import { Component, Input, OnInit, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/... |
import styled from "styled-components";
export const Wapper = styled.div`
width:1200px;
margin:0 auto;
`
export const Title = styled.h1`
font-size: 20px;
`
export const Container = styled.div`
width:1200px;
margin-top:20px;
` |
<gh_stars>0
def processedby(processor):
""" decorator to wrap the processor around a function. """
def processedfunc(func):
def wrappedfunc(*args, **kwargs):
return processor(func, *args, **kwargs)
return wrappedfunc
return processedfunc
|
import aiohttp
from datetime import datetime
async def get_api_data(base_url, date, days):
endpoint = base_url + "/details"
if date and days:
endpoint = f"{endpoint}/{date.strftime('%Y-%m-%d')}/{days}"
async with aiohttp.ClientSession() as session:
async with session.get(endpoint) as resp... |
<filename>feign-reactor-core/src/main/java/reactivefeign/ReactiveRetryPolicy.java
package reactivefeign;
import reactor.core.publisher.Flux;
import java.util.function.Function;
/**
* @author <NAME>
*/
public interface ReactiveRetryPolicy {
Function<Flux<Throwable>, Flux<Throwable>> toRetryFunction();
}
|
DIR="csvSumTotalDay"
oDIR="csvSumTotalWeek"
for i in $DIR/*.csv; do
o=${i#"$DIR/d"}
o=${o%".csv"}
echo "$i > $o"
awk -F, -v OFS=, '{ \
if (NR > 2) \
{ split($1, d,"-"); \
w = strftime("%W", mktime(d[1]" "d[2]" "d[3]" 00 00 00"));
date=d[1]""w
c[date] += $2; \
p[date] += $3; ... |
/**
* @fileoverview gRPC-Web generated client stub for taska.proto
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
import * as grpcWeb from "grpc-web";
import * as board_pb from "./board_pb";
import * as card_pb from "./card_pb";
import * as list_pb from "./list... |
#!/bin/bash
# Setup simple Docker image with requirements pre-installed to speed up simple dev commands.
# Run this command before running any "non-full" Docker management commands in here and rerun it after changing the requirements.
LOCAL_DIR=".local/docker"
LOG_DIR="$LOCAL_DIR/log"
CONFIG_FILE="studlan/settings/lo... |
domain=$(get_option '.domain')
logger::info "Executing $(logger::highlight "$command"): $domain"
cf::target "$org" "$space"
cf::delete_domain "$domain"
|
python manage.py shell < scripts/parse.py |
<gh_stars>0
// Copyright (c) 2017, taher and contributors
// For license information, please see license.txt
frappe.ui.form.on('Membership', {
validate:function(frm){
this.frm.refresh_fields();
console.log("js function")
}
// refresh: function(frm) {
// }
// on_submit: function(doc, dt, dn){
// this.creat... |
#! /bin/sh
unknown_platform() {
echo "Unknown platform: `uname`"
exit 1
}
missing=0
check_for () {
which $1 > /dev/null 2> /dev/null
if [ $? -ne 0 ]; then
echo "Error: can't find $1 binary"
missing=1
fi
}
check_for ant
check_for cc
check_for g++
check_for bunzip2
check_for git
che... |
// Fill urls and titles for dialogs (`DIALOG_MESSAGE`)
//
// In:
//
// - infractions ([users.Infraction])
// - user_info (Object)
//
// Out:
//
// - info (Object) - key is `src`, value { url, title, text }
//
'use strict';
const _ = require('lodash');
module.exports = function (N, apiPath) {
N.wire.on(apiPath, a... |
<gh_stars>0
console.log("Im Linked MF!!!!!!!"); |
#include <iostream>
using namespace std;
#define LINHAS 2
#define COLUNAS 50
void calculeAreas(double triangulos[LINHAS][COLUNAS], double areas[]) {
for (int i = 0; i < COLUNAS; i++) {
areas[i] = (triangulos[0][i] * triangulos[1][i]) / 2;
cout << "A área do " << i + 1 << "º triângulo é " << areas[i] << endl... |
<reponame>ndesmic/vertex-pad
export function getProjectionMatrix(screenHeight, screenWidth, fieldOfView, zNear, zFar){
const aspectRatio = screenHeight / screenWidth;
const fieldOfViewRadians = fieldOfView * (Math.PI / 180);
const fovRatio = 1 / Math.tan(fieldOfViewRadians / 2);
return [
[aspectRatio * fovRatio,... |
<filename>tests/tests.py
from .context import pymps as ppm
import numpy as np
import unittest
import copy
import os
import json
class BasicTestSuite(unittest.TestCase):
"""Basic test cases."""
@classmethod
def setUpClass(cls):
'''Called only once'''
cls.mps = os.path.abspath('tests/data... |
# Import Dependencies
import requests
from bs4 import BeautifulSoup
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
# Set URL to be scraped
url = 'http://www.amazon.com/product-reviews/B003V0JPNC'
# Request webpage and parse
response = requests.get(url)
data = response.text
sou... |
/**
* Copyright (C) 2013 Mot<EMAIL> (<EMAIL>)
*
* 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... |
readonly DEFAULT_VERSION=0.40.1
export VERSION=${VERSION:-$DEFAULT_VERSION}
readonly MONIKER=metabase
readonly BASE_NAME=backpack-$MONIKER
readonly IMAGE_NAME=alexanderfefelov/$BASE_NAME
readonly CONTAINER_NAME=$BASE_NAME
readonly HOST_NAME=$MONIKER.backpack.test
readonly WAIT_TIMEOUT=600
readonly DB_HOST=mysql-main-... |
/*
* Hex-Rays Decompiler project
* Copyright (c) 2007-2019 by Hex-Rays, <EMAIL>
* ALL RIGHTS RESERVED.
*
* Sample plugin for Hex-Rays Decompiler.
* It shows known value ranges of a register using get_valranges().
*
* Unfortunately this plugin is of limited use because:
* - ... |
<reponame>exKAZUu-Research/SmartMotivator
// @flow
import React from 'react';
import { Button, StyleSheet, Text, View } from 'react-native';
import { GS } from '../../style';
import { ButtonBox } from '../../design/ButtonBox';
import { D, i18n } from '../../../i18n/index';
type Props = {|
gotoTermsEmail: () => void... |
#!/bin/bash
# Set Timezone
ln -sf /usr/share/zoneinfo/US/Central /etc/local
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
hwclock --systohc
# Localization
sed -i s/'#en_US.UTF-8 UTF-8'/'en_US.UTF-8 UTF-8'/ /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
# VConsole Config
echo '' > /etc/vco... |
<filename>client/src/components/templates/Asset/ArtworkDetails.tsx
import React, { useState } from 'react'
import Moment from 'react-moment'
import { DDO, MetaData, File } from '@nevermined-io/nevermined-sdk-js'
import styles from './ArtworkDetails.module.scss'
import Web3 from 'web3'
import ArtworkImage from '../../at... |
g++ -c square.cpp
g++ -c rect.cpp
g++ -c triangle.cpp
g++ -c circle.cpp
g++ -c app.cpp
g++ square.o rect.o triangle.o circle.o app.o -o app |
package com.ceiba.combo.comando.fabrica;
import com.ceiba.combo.comando.ComandoCombo;
import com.ceiba.combo.modelo.entidad.Combo;
import org.springframework.stereotype.Component;
@Component
public class FabricaCombo {
public Combo crear(ComandoCombo comandoCombo){
return new Combo(comandoCombo.getId(),
... |
#!/bin/bash -e
dd if=/dev/urandom bs=115200 count=300 of=test.yuv # 10 seconds video
SvtHevcEncApp -i test.yuv -w 320 -h 240 -b out.ivf .
|
#include <vector>
#include <iostream>
// Function to print elements of vector
void print(std::vector<int> v)
{
for (int i = 0; i < v.size(); i++)
std::cout << v[i] << " ";
std::cout << "\n";
}
int main()
{
std::vector<int> v = {1, 2, 3, 4, 5};
print(v);
return 0;
} |
<filename>packages/amplication-server/src/models/Workspace.ts
import { Field, ObjectType } from '@nestjs/graphql';
import { User } from './User'; // eslint-disable-line import/no-cycle
import { App } from './App'; // eslint-disable-line import/no-cycle
import { GitOrganization } from './GitOrganization';
@ObjectType({... |
def swap_two_numbers(a, b):
a = a + b
b = a - b
a = a - b
return a, b
a = 6
b = 10
print("The value of a is %d and b is %d" %(a, b))
a,b = swap_two_numbers(a,b)
print("The value of a is %d and b is %d" %(a, b)) |
#!/bin/bash
set -e
sphinx-apidoc -H runlmc -A "Vladimir Feinberg" --separate --force --output-dir=doc/_generated runlmc/ $(echo $(find . -iname "test_*.py"))
cp doc/index.rst doc/_generated/
cd doc
PYTHONPATH=.. sphinx-build -j $(nproc) -c . -b html _generated/ _generated/_build/
|
import {useState, useEffect, useContext} from 'react'
import { makeStyles } from '@material-ui/core/styles'
import DoneIcon from '@material-ui/icons/Done';
import { Tooltip } from '@material-ui/core'
import { IconButton } from '@material-ui/core'
import { AuthContext } from '@context/AuthContext'
import {
doFetch,
... |
/*
Copyright 2019-2020 Netfoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
def combination_generator(lst, r):
# Initialize empty list
combinations = []
# Create a loop to pick every element
for i in range(len(lst)):
# Create a loop to create permutations
# of the picked elements
for j in combinations:
s = j[:]
s.ap... |
<filename>glew-1.10.0/auto/src/glew_str_head.c<gh_stars>1000+
#ifdef GLEW_MX
GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name)
#else
GLboolean GLEWAPIENTRY glewIsSupported (const char* name)
#endif
{
GLubyte* pos = (GLubyte*)name;
GLuint len = _glewStrLen(pos);
GLboolean ret... |
<reponame>hmu332233/LetMeKnow.jbnu--ChatBot--
module M_Time
def makeMessage_time_hu
message =
"
@ 후생관 이용시간입니다.
상시판매
오전 10:00 ~ 오후 7:00
석식(백반)
오후 5:30 ~ 오후 7:00
중간 쉬는 시간 있음.
"
return message
end
def makeMessage_time_jinsu
message =
"
@ ... |
package net.fabrictest.util;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabrictest.command.ReturnHomeCommand;
import net.fabrictest.command.SetHomeCommand;
public class ModCommandRegister {
public static void registerCommands() {
CommandRegistrationCallback.EVEN... |
import React from 'react';
import { mount } from 'enzyme';
import renderer from 'react-test-renderer';
import Label from '../../components/Label';
import theme from '../../theme';
import 'jest-styled-components';
describe('<Label />', () => {
it('should match snapshot', () => {
const tree = renderer.create(<Labe... |
<filename>Chapter 03/3.10.py
"""
Code illustration: 3.10.py
1. tkinter versus ttk Themed Widgets
2. new widgets introduced in ttk
Chapter 3 : Programmable Drum Machine
Tkinter GUI Application Development Blueprints
"""
from tkinter import Tk, Button, Label, Checkbutton, Entry, PanedWindow, \
Radi... |
<filename>test/integration/site_layout_test.rb
require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
#Tests for the presence of a particular link-URL combination
#i.e. <a href="/about"> ...</a>
assert... |
# Create a MongoDB Database
import pymongo
# Connect to MongoDB
client = pymongo.MongoClient("mongodb://localhost:27017/")
# Create a database
db = client["blog_posts"]
# Create a collection
posts = db["posts"]
# Index this collection
posts.create_index([('title', pymongo.ASCENDING)]) |
import java.util.ArrayList;
// Uses the Subject interface to update all Observers
public class PricingScheme implements iSubject {
// maintains the list of all subscribers to the pricing scheme
// However, not really aware of what type of subscribers they are (e.g.
// University/Corporate/Individual)
p... |
<gh_stars>0
package cmd
import (
"fmt"
"strings"
"github.com/aelindeman/goname"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
// listCmd represents the list command
var listCmd = &cobra.Command{
Use: "list [domain ...]",
Short: "List DNS records for a domain",
Aliases: []string{"ls"},
Ru... |
<gh_stars>1-10
package disgordbot
import (
"testing"
)
func TestBot_AddCommand(t *testing.T) {
b := new(Bot)
if err := b.AddCommand(
Command{
Name: "One",
Short: "1",
},
Command{
Name: "Two",
Short: "2",
}); err != nil {
t.Error(err)
}
if err := b.AddCommand(
Command{
Name: "One",
... |
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the Swift Tracing open source project
##
## Copyright (c) 2020 Moritz Lang and the Swift Tracing project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license informat... |
package fr.slvn.appops;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.widget.Toast;
import java.util.Arrays;
public class MainActivity extends Activity {
private static final String[] INCOMPATIBLE_LIST =
... |
def longest_common_substring(string1, string2):
m = len(string1)
n = len(string2)
# Create a two-dimensional array (m x n) to track
# the length of longest common sub-string
sub_string_length = [[0 for _ in range(n+1)] for _ in range(m+1)]
longest_length = 0
result = ""
# Build the sub-string length arr... |
#!/bin/sh
# 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... |
from arbitrage.public_markets._cex import CEX
class CEXEUR(CEX):
def __init__(self):
super().__init__("EUR", "EUR")
|
#!/usr/bin/env bash
PID_FILE=server.pid
PID=$(cat "${PID_FILE}");
if [ -z "${PID}" ]; then
echo "Process id for servers is written to location: {$PID_FILE}"
go build ../main/server/
go build ../main/client/
#go build ../cmd/
rm -r logs
mkdir logs/
./server -log_dir=logs -log_level=info -i... |
<reponame>Nazar910/assignment-system
export const PRIORITIES = {
low: 'low',
normal: 'normal',
high: 'high',
urgent: 'urgent'
};
export const Assignment = {
type: 'object',
required: ['title', 'author_id'],
additionalProperties: false,
properties: {
title: {
type: 's... |
<reponame>scurker/scurker.com
var particles;
window.onload = function() {
var canvas = document.getElementById('particle_canvas');
particles = new ParticleCanvas(canvas, {x: 490});
particles.start();
};
var effects = {
smoke: {
shape: 'circle',
velocity: new Vector({y: -0.35}),
... |
<gh_stars>0
import fs from 'fs'
import path from 'path'
import execa from 'execa'
import Listr from 'listr'
import VerboseRenderer from 'listr-verbose-renderer'
import terminalLink from 'terminal-link'
import { getPaths } from '../../lib'
import c from '../../lib/colors'
export const command = 'aws [provider]'
expor... |
<gh_stars>0
/**
* Action is a container, where the name of a method and parameters can be called by a Checker or Countdown object. Actions can be stacked on an ActionList Object.
*
*
* @author <NAME>
* @version 1.0
* 2017
*/
package bontempos.Game.Act;
import java.lang.reflect.Method;
public clas... |
corpus=./data-bin/iwslt14.tokenized.de-en.nobpe.vocabSwitchout.comda-xxx.analysis
arch=transformer_iwslt_de_en
save_dir=checkpoints/iwslt14.de-en/comda-v1.word.DEBUG
mkdir -p $save_dir
CUDA_VISIBLE_DEVICES=0 python analyze.py \
$corpus \
--restore-file checkpoint_best.pt \
--raw-text \
--task perturb_an... |
#
# This file is part of the CernVM File System
# This script takes care of creating, removing, and maintaining repositories
# on a Stratum 0/1 server
#
# Implementation of the "cvmfs_server check" command
# This file depends on fuctions implemented in the following files:
# - cvmfs_server_util.sh
# - cvmfs_server_com... |
for i in range(1, 11):
for j in range(1, 11):
print(i * j, end='\t')
print() |
package com.lmj.vueblog.service;
import com.lmj.vueblog.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 服务类
* */
public interface UserService extends IService<User> {
/**
* 用户注册
* @param user
*/
void register(User user);
}
|
package rsocktapp.demo2;
import io.rsocket.ConnectionSetupPayload;
import io.rsocket.RSocket;
import io.rsocket.SocketAcceptor;
import io.rsocket.core.RSocketServer;
import io.rsocket.frame.decoder.PayloadDecoder;
import io.rsocket.transport.netty.server.TcpServerTransport;
import reactor.core.publisher.Mono;
public ... |
#!/bin/tcsh
#PBS -A NTDD0005
#PBS -N testb
#PBS -q regular
#PBS -l walltime=12:00:00
#PBS -j oe
#PBS -M apinard@ucar.edu
#PBS -l select=1:ncpus=1
module load conda
conda activate ldcpy_env
setenv TMPDIR /glade/scratch/$USER/temp
mkdir -p $TMPDIR
python ./compute_batch.py -o '/glade/scratch/apinard/3D/PRECL_calcs.csv... |
<gh_stars>0
#include <string.h>
#include "mbedtls/sha256.h"
#include "mbedtls/md_internal.h"
#include "aws_sigv4.h"
#define SHA256_DIGEST_LENGTH 32
#define AWS_SIGV4_AUTH_HEADER_NAME "Authorization"
#define AWS_SIGV4_SIGNING_ALGORITHM "AWS4-HMAC-SHA256"
#define AWS_SIGV4_AUTH_HEADER_MAX_LEN ... |
import { Settings as LayoutSettings } from '@ant-design/pro-layout'
const Settings: LayoutSettings & {
pwa?: boolean
logo?: string
} = {
navTheme: 'dark',
// 拂晓蓝 dark light
primaryColor: '#1890ff',
layout: 'mix', // side , top, mix
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: true,
color... |
def sum_list(nums):
total = 0
for num in nums:
total += num
return total
sum_of_list = sum_list([1, 2, 3, 4])
print(sum_of_list) # Output: 10 |
#!/bin/bash
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=1SakR8HL_e--lyN9lpdnvSKHZk-4H0cS_" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=1SakR8HL_e--lyN9lpdnvSKHZk-4H0cS_" -o resources.tar.gz... |
<filename>src/components/neo4jDesktop/Splash.js
import React, { Component } from "react";
import { Image } from 'semantic-ui-react';
export default class Splash extends Component {
render() {
return (
<div className='Splash' style={{display: 'block', width: 320, marginLeft: 'auto', marg... |
/**
* this file will be loaded before server started
* you can define global functions used in controllers, models, templates
*/
/**
* use global.xxx to define global functions
*
* global.fn1 = function(){
*
* }
*/
'use strict';
/*****项目函数库*******/
// livi 日期格式化
global.liFormatDate = function (formatStr... |
package benchmarks.CLEVER.LoopMult15.Neq;
public class newV {
private int foo(int a, int b) {
int c=0;
for (int i=1;i<=a;++i)
c-=b;
return c;
}
public int main(int x) {
if (x>=13 && x<16)
return foo(x,15);
return 0;
}
} |
<reponame>harveyaa/nixtract
"""Integration tests (and some unit tests) for NIFTI extractions
Check to ensure that the data being extracted lines up with the labels defined
in the provided roi files. The approach is fairly straightforward:
1. Take an 3D NIFTI image and duplicate the data (10 times) so that it
... |
<filename>Tracking/Habduino/ax25modem.h
/* From Project Swift - High altitude balloon flight software */
/*=======================================================================*/
/* Copyright 2010-2012 <NAME> <<EMAIL>> */
/* <NAME> <<EMAIL>> */
/* ... |
def find_missing_number(arr):
n = len(arr)
i = 0
while i < n:
if (abs(arr[i] - n) - 1 < n and arr[abs(arr[i]) -1] > 0):
arr[abs(arr[i]) -1] = -arr[abs(arr[i]) - 1]
i += 1
for i in range(n):
if arr[i] > 0:
return i+1
return n+1 |
def smallest_unique_number(num_list):
num_set = set(num_list)
# find the smallest number
smallest = min(num_set)
# check whether the smallest number has multiple occurrences
if num_list.count(smallest) == 1:
return smallest
else:
num_set.remove(smallest)
... |
<gh_stars>10-100
package io.opensphere.kml.mantle.controller;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import de.micromata.opengis.kml.v_2_2_0.Geometry;
import de.micromata.opengis.kml.v_2_2_0.Placemark;
import de.micromata.opengis.kml.v_2_2_0.Style;
import de.micromata.opengis.kml.v_2... |
<reponame>tignear/bot
import * as moment from "moment-timezone";
export type GameEventKind = "periodical" | "fixed";
export type DayOfWeek =
| "Sunday"
| "Monday"
| "Tuesday"
| "Wednesday"
| "Thursday"
| "Friday"
| "Saturday";
export const dayOfWeekArray: readonly [
string,
string,
string,
string... |
#!/usr/bin/env sh
stack run -- $@
|
##-------------------------------------------------------------
## NB: This is unused code.
## Keep it for now in case we decide later that the enterprise
## contract should fetch data from rekor.
##-------------------------------------------------------------
# Use rekor-cli to fetch one log entry
rekor-log-entry() ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.