text
stringlengths
1
1.05M
<reponame>toastier/srf (function () { 'use strict'; angular .module('users') .controller('NoAccessController', NoAccessController); function NoAccessController(Navigation) { var vm = this; function activate() { Navigation.clear(); Navigation.viewTitle.set('You Do Not Have Access'); ...
/* * Copyright 2016 NIIT Ltd, Wipro Ltd. * * 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 requi...
def is_anagram(word1, word2): # split words into list of characters letters1 = list(word1) letters2 = list(word2) # sort lists letters1.sort() letters2.sort() # check if the sorted lists are equal return letters1 == letters2 # main program words = [ 'army', 'mary', 'cat', 'act', 'rat', 'tar' ] for i in rang...
<gh_stars>0 package infinispan import ( "fmt" "strings" v1 "github.com/infinispan/infinispan-operator/pkg/apis/infinispan/v1" consts "github.com/infinispan/infinispan-operator/pkg/controller/constants" config "github.com/infinispan/infinispan-operator/pkg/infinispan/configuration" kube "github.com/infinispan/in...
<filename>source/ws.c #include <winsock2.h> #include <windows.h> #include <psapi.h> #include <stdio.h> #include "ws.h" #include "misc.h" #include "plugins.h" #include "list.h" #define MAX_PACKET 4096 typedef int (WINAPI *tWS)(SOCKET, const char*, int, int); //For base functions static DWORD WINAPI initialize(LPVOID...
<gh_stars>0 package ddbt.tpcc.itx import java.util.Date import ddbt.tpcc.tx._ /** * NewOrder Transaction for TPC-C Benchmark * * @author <NAME> */ trait IInMemoryTx { self => def setSharedData(db:AnyRef): self.type } trait InMemoryTxImpl extends IInMemoryTx { var SharedData:TpccTable = null override def setS...
#!/usr/bin/env bash PACKAGE_DIST_PATH=$1 RESPONSE_FILE=/tmp/upload.txt STATUS_CODE=$(curl -F package=@${PACKAGE_DIST_PATH} -w '%{http_code}' https://${GEM_FURY_PUSH_TOKEN}@push.fury.io/${GEM_FURY_USERNAME}/ -o ${RESPONSE_FILE}) tail ${RESPONSE_FILE} if [[ ${STATUS_CODE} -ne 200 ]]; then echo "Unexpected HTTP re...
import { Component, Input, Output, EventEmitter } from '@angular/core'; @Component({ selector: 'employee-count', templateUrl: 'app/employee/views/employeeCount.component.html', styleUrls: ['css/employeeCount.component.css'] }) export class EmployeeCountComponent { selectedRadioButtonValue : string = '...
import requests class HumbleBundleAPI: def __init__(self): self.session = requests.Session() def login(self, username, password): login_data = { 'username': username, 'password': password } response = self.session.post(LOGIN_URL, data=login_data) ...
<reponame>getmetamapper/metamapper<gh_stars>10-100 # -*- coding: utf-8 -*- import unittest.mock as mock import app.comments.models as models import app.comments.serializers as serializers import app.audit.models as audit import testutils.cases as cases import testutils.decorators as decorators import testutils.factor...
<reponame>AndreasKl/elefantenstark package net.andreaskluth.elefantenstark.producer; import static java.util.Objects.requireNonNull; import static net.andreaskluth.elefantenstark.work.WorkItemDataMapSerializer.serialize; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; impo...
<filename>api/traits/traits-router.js const express = require('express'); const traits = require("./traits-model"); const router = express.Router() router.get('/', (req, res, next) => { traits.findTraits() .then(resp => { res.status(200).json(resp); }).catch(next); }) router.post('/', (req, res, ...
#!/bin/bash # This script runs on after start in background # as a service and gets restarted on failure # it runs ALMOST every seconds # INFOFILE - state data from bootstrap infoFile="/home/admin/raspiblitz.info" # CONFIGFILE - configuration of RaspiBlitz configFile="/mnt/hdd/raspiblitz.conf" # LOGS see: sudo jour...
<filename>tests/basics/closure_defargs.py # test closure with default args def f(): a = 1 def bar(b = 10, c = 20): print(a + b + c) bar() bar(2) bar(2, 3) print(f())
#!/bin/bash SCRIPT=$(readlink -f "$0") && cd $(dirname "$SCRIPT") # --- Script Init --- set -e set -o pipefail mkdir -p log rm -R -f log/* # --- Setup run dirs --- find output/* ! -name '*summary-info*' -type f -exec rm -f {} + rm -R -f work/* mkdir work/kat/ rm -R -f /tmp/%FIFO_DIR%/ mkdir -p /tmp/%FIFO_DIR%/fif...
#!/bin/bash cd build/web/ python3 -m http.server 8080
import React from "react"; import Draggable from "react-draggable"; import PropertiesPanel from "./PropertiesPanel"; import { LayersPanel } from "./LayersPanel"; export class PanelArea extends React.Component { constructor(props) { super(props); this.onDrag = this.onDrag.bind(this); this.o...
var URL = 'http://publisher.titaniumapp.com/api/release-publish'; var TFS = Titanium.Filesystem; var build_types = { 'osx':['10.5_i386','10.5_i386','10.4_ppc'], 'win32':['win32'], 'linux':['32bit_i386','64bit_i386','32bit_ppc'] }; var guids = { 'distribution':'7F7FA377-E695-4280-9F1F-96126F3D2C2A', 'runtime':'A...
source ../libarchive/plan.sh pkg_name=libarchive-musl pkg_origin=core pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>" pkg_description="Multi-format archive and compression library" pkg_upstream_url="https://www.libarchive.org" pkg_license=('BSD') pkg_deps=( core/musl core/openssl-musl core/zlib-musl...
def sum_of_squares(start, end): """ This function calculates the sum of squared numbers from start to end Input: start: starting number end: ending number Output: total: total sum of squares """ total = 0 for num in range(start, end + 1): total ...
<reponame>jakzaizzat/gallery import { getWhitespacePositionsFromStagedItems, insertWhitespaceBlocks } from './collectionLayout'; function generateTestNft() { return { id: '123', name: 'test', description: 'test', image: { url: 'https://example.com/test.jpg', }, metadata: { type: '...
<reponame>kiraki-dev/express-oven import lightJoin from 'light-join'; let baseUrl = ''; // later we can use this when we'll create a standalone runner export const setBaseUrl = (url: string) => baseUrl = url; export const getBaseUrl = () => baseUrl; export const getAppUrl = (path: string) => lightJoin(getBaseUrl(), ...
<filename>Modules/Search/max_sub_sequence.hxx /*=========================================================================================================== * * HUC - Hurna Core * * Copyright (c) <NAME> * * Licensed under the MIT License, you may not use this file except in compliance with the License. * You ma...
<gh_stars>10-100 //============================================================================ // Copyright 2009-2020 ECMWF. // This software is licensed under the terms of the Apache Licence version 2.0 // which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. // In applying this licence, ECMWF does not...
<filename>src/layer.js<gh_stars>1-10 //TODO: Might need a 'chart' object to pass settings/functionality to layer events //TODO: use es6 class syntax for Layer var Layer = function() { //this._base = base; // base is currently being based Layer.draw call in order to put layers on top of layers, among other convenien...
let car = document.querySelector("#car"); let car2 = document.querySelector("#car2"); let count = 0; let count2 = 0; let space = document.querySelector("#space"); space.addEventListener('keydown', logKey) function logKey(e) { if (e.code == "ArrowLeft") { if (count >= 50) { count -= 50...
#!/bin/bash # # Copyright IBM Corp All Rights Reserved # # SPDX-License-Identifier: Apache-2.0 # # This script will orchestrate a sample end-to-end execution of the Hyperledger # Fabric network. # # The end-to-end verification provisions a sample Fabric network consisting of # two organizations, each maintaining two p...
import * as Hapi from 'hapi'; import * as Joi from 'joi'; import { AuthLoginController, AuthLogoutController, AuthSignUpController } from './controllers/auth'; import { UsersController, UsersMeController } from './controllers/users'; export default class Routes { public static async init(server: Hapi.Server): Pr...
<filename>pkg/generate/enum_def_test.go // Copyright Amazon.com Inc. or its affiliates. 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. A copy of the // License is located at // // http://aws.amazon.com/ap...
#!/bin/bash ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" TOOLS=$( realpath $ROOT/../tools ) DATA=$( realpath $ROOT/../data ) GPUS="0" MODEL=model.fairseq mkdir -p $MODEL test -f $MODEL/train-data/train.en-de.de.bin || python3.6 $TOOLS/fairseq/preprocess.py \ --source-lang en --target-lang de \ ...
package main import ( "github.com/yunfeiyang1916/micro-go-course/go-rpc/service" "log" "net" "net/http" "net/rpc" ) func main() { stringService := &service.StringService{} rpc.Register(stringService) rpc.HandleHTTP() l, err := net.Listen("tcp", "127.0.0.1:1234") if err != nil { log.Fatal("listen error:", ...
#!/bin/sh # # You can set JAVA_HOME to point ot JDK 1.3 # or shell will try to deterine java location using which # #JAVA_HOME=/l/jdk1.3 # # No need to modify anything after this line. # -------------------------------------------------------------------- if [ -z "$JAVA_HOME" ] ; then JAVA=`/usr/bin/which java...
def median(input_array): # sort the array in ascending order input_array.sort() # determine the length of the array array_length = len(input_array) # return the median depending on if the array length is odd or even if array_length % 2 != 0: return input_array[int((array_length...
#!/bin/bash #docker run -d -p 8080:8080 -p 50000:50000 -v /opt/docker/jenkins:/var/jenkins_home -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/run/docker.sock wbrune/jenkins docker run -d -p 8080:8080 -p 50000:50000 -v /opt/docker/test-jenkins:/var/jenkins_home -v /usr/bin/docker:/usr/bin/docker -v /var/ru...
def compute_factorial(num): factorial = 1 for i in range(1, num + 1): factorial *= i return factorial result = compute_factorial(5) print(result)
public void MyMethod() { // Do something } Thread thread = new Thread(MyMethod); thread.Start();
<reponame>zhouzhigang076/everydayfresh<filename>day_fresh/df_goods/admin.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin import models # Register your models here. class GoodsInfoLine(admin.TabularInline): model = models.GoodsInfo class TypeInfoAdmin(admin.Mode...
<reponame>mylesnoton/wake-on-lan<gh_stars>0 package main import ( "errors" "net" "regexp" "strconv" "strings" "github.com/gookit/color" ) // New wake on lan request func New(macAddr string, bCast string) { macAddrArray, err := cleanAndConvertMacAddr(macAddr) handleErr(err) magicPacket, err := buildMagicPac...
<filename>src/templates/book-page.js<gh_stars>0 import React from 'react' import PropTypes from 'prop-types' import styled from 'styled-components' import { graphql } from 'gatsby' import ReactMarkdown from 'react-markdown' import Layout from '../layouts/default' import { HTMLContent } from '../components/Content' impo...
export class Attribute { readonly value: string readonly version: number constructor(value: string, version: number) { this.value = value this.version = version } } export interface FingerprintIntarface { fingerprint(fingerprint: Map<string, Attribute>): Map<string, Attribute> }
def anagram(str1, str2): # get length of string n1 = len(str1) n2 = len(str2) # if str1 and str2 have different length # then they cannot be anagrams if n1 != n2: return 0 # sort the strings str1 = sorted(str1) str2 = sorted(str2) # compare the sorted st...
#!/bin/sh # # Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/licens...
/** * Run the migrations. * * @return void */ public function up() { Schema::create('rs_model_settings', function($table) { $table->increments('id'); $table->integer('model_id')->unsigned(); $table->string('setting_name'); $table->text('setting_value'); // Define...
def alert(data): # Calculate the mean and standard deviation of the data mean = sum(data) / len(data) variance = sum([(x - mean) ** 2 for x in data]) / len(data) std_dev = variance**0.5 # Calculate the Z-score for each data point z_scores = [(x - mean) / std_dev for x in data] # Generate an...
#!/bin/bash # Reproduces data for figure 4 # Interference PMDK=/home/aim/hjn/pmdk clang++ -g0 -O3 -DNDEBUG=1 -march=native -std=c++17 interference.cpp -I${PMDK}/src/include/ ${PMDK}/src/nondebug/libpmem.a ${PMDK}/src/nondebug/libpmemlog.a -lpthread -lndctl -ldaxctl || exit -1 # Seqential ram echo "" > results/inter...
<reponame>CPCoders/CPMath<filename>Examples/leaky_relu.js<gh_stars>0 var mathlib = require('../lib/cpmath.js'); console.log(mathlib.leaky_relu(56));
class SkyboxManager: def __init__(self, blackside_pack_name): self.blackside_pack_name = blackside_pack_name def load_skybox_black_side(self): # Complete the method to load the black side of the skybox return loader.loadModel(self.blackside_pack_name + "cubemap.bam")
TRAIN_FLAGS=" --iterations 300000 --anneal_lr True --batch_size 16 --microbatch 16 --lr 1e-4 --save_interval 10000 --weight_decay 0.05 --data_dir /workspace/mnt/storage/yangdecheng/imagenet_1k/ImageNet-1k/train --val_data_dir /workspace/mnt/storage/yangdecheng/imagenet_1k/ImageNet-1k/val --log_r...
#!/bin/bash function install_ovftool { # Install provided ovftool if [ ! -e "/usr/bin/ovftool" ]; then pushd $ROOT_DIR/ovftool ovftool_bundle=$(ls *) chmod +x $ovftool_bundle size_of_tool=$(ls -al $ovftool_bundle | awk '{print $5}') if [ $size_of_tool -lt 10000000 ]; then echo "ovftool downloaded is l...
import React, { useEffect, useState } from 'react'; import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; import { HttpClient } from '../../shared/http-client'; interface SubscriptionDetails { subscriptionId: string, period: string, expirationDate: Date, status: string } ...
#!/usr/bin/env bash set -xe service ssh start ./sbin/start-all.sh echo "Sleeping..." sleep infinity
#!/bin/bash ver=2.14.0 wget https://www.openvswitch.org/releases/openvswitch-$ver.tar.gz tar -xzf openvswitch-$ver.tar.gz sudo apt install -y build-essential libtool autoconf cd openvswitch-$ver sudo ./configure sudo make sudo make install cd .. sudo rm -rf openvswitch-$ver.tar.gz openvswitch-$ver
package de.frvabe.bpm.camunda.tbt.variableScopeDemo; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.camunda.bpm.engine.delegate.JavaDelegate; /** * This task will set variables into different variable scopes (by using * {@link DelegateExecution#setVariable(String, Object)} and * {@lin...
deploy_to_production() { local APP_DIR=$1 local APP_DOCKER_IMAGE=$2 local DIGITAL_OCEAN_USER=$3 local PRODUCTION_HOST=$4 local RUN_APP=$5 # Change directory to the application directory cd $APP_DIR || { echo "Error: Unable to change directory to $APP_DIR"; return 1; } # Pull the latest Docker image ...
import { assert, Inject, Injectable } from "../../mod.ts"; import { ASYNC_KEY } from "./async.constant.ts"; @Injectable() export class AsyncService { constructor(@Inject(ASYNC_KEY) private readonly connected: boolean) { assert(this.connected === true, "injected CONNECTION_ASYNC maybe true"); } info() { ...
export modules_path='g:/.temp/CATSdesigner/modules' export admin_path=$modules_path'/admin' export tests_path=$modules_path'/tests' export subjects_path=$modules_path'/subjects' export cp_path=$modules_path'/course-projects' export dp_path=$modules_path'/diplom-projects' export confirmation_path=$modules_path'/confirm...
#!/bin/bash -x set -eo pipefail # $PUBLIC_IP $PRIVATE_IP $PUBLIC_HOSTNAME $BOULDER_URL are dynamically set at execution # with curl, instance metadata available from EC2 metadata service: #public_host=$(curl -s http://169.254.169.254/2014-11-05/meta-data/public-hostname) #public_ip=$(curl -s http://169.254.169.254/20...
class CustomTableViewCell: UITableViewCell { // Other properties and methods override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated: animated) if selected { // Update UI for selected state accessoryType = .check...
class ApikeysProjectsLocationsKeysPatchRequest: """ A class representing an API request for updating API keys. """ def __init__(self, name, updateMask): """ Initializes the ApikeysProjectsLocationsKeysPatchRequest object with the given parameters. Args: name (str): The r...
# This script runs a full end-to-end functional test of the dispatcher and the Optimizer transport with the Rotate Strategy, using two netcat instances as the application server and application client. # An alternative way to run this test is to run each command in its own terminal. Each netcat instance can be used to ...
<reponame>nickolyamba/android-chem-app package app.android.chemicals; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.util.Base64; import android.util.Lo...
<filename>Documentation/_transpose_test_impl_8hpp.js var _transpose_test_impl_8hpp = [ [ "SimpleTransposeTest", "_transpose_test_impl_8hpp.xhtml#a6eaaa77532584d5c04fbaec94e630ded", null ], [ "SimpleTransposeTestImpl", "_transpose_test_impl_8hpp.xhtml#a21dbaaf0ccf8eea33ab53f32dbb210c5", null ], [ "TransposeV...
cat << "EOF" . . !\ _ l\/ ( /(_ _ \`--" _/ . \~") (_,/) _)/. ,\,/ _____,-"~ \ / "~"-._____ ,-~" "~-. . " . ,-~" "~-. ,^ ^. `. .' ...
package com.littlejenny.gulimall.coupon.service; import com.baomidou.mybatisplus.extension.service.IService; import com.littlejenny.common.utils.PageUtils; import com.littlejenny.gulimall.coupon.entity.SkuFullReductionEntity; import java.util.Map; /** * 商品满减信息 * * @author littlejenny * @email <EMAIL> * @date 20...
<filename>Source/Bellz/Enemy.h // All rights reserved, <NAME> 2016 http://www.mamoniem.com/ #pragma once #include "GameFramework/Character.h" #include "Enemy.generated.h" UCLASS() class BELLZ_API AEnemy : public ACharacter { GENERATED_BODY() UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Triggers, meta ...
<reponame>minuk8932/Algorithm_BaekJoon<filename>src/implementation/Boj14724.java package implementation; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.BufferedReader; /** * * @author exponential-e * 백준 14724번: 관리자는 누구? * * @see https://www.acmicpc.net/problem/14724/ * */ p...
<reponame>glensand/shared_whiteboard /* Copyright (C) 2020 - 2021 <NAME> - All Rights Reserved * You may use, distribute and modify this code under the * terms of the MIT license. * * You should have received a copy of the MIT license with * this file. If not, please write to: <EMAIL>, or visit : https://github.c...
package oidc.management.controller; import java.io.IOException; import java.util.List; import java.util.Optional; import javax.servlet.http.HttpServletRequest; import com.fasterxml.jackson.databind.ObjectMapper; import com.querydsl.core.types.Predicate; import oidc.management.service.ServiceAccountService; import org....
#!/bin/bash # Copyright 2019 Google 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 law or agreed to ...
import React, { Component } from 'react'; import { Paper, TextField, Grid, Button, Typography } from '@material-ui/core'; import './signup.css' class RegForm extends Component { state = { data:null,mail:false,names:false,surname:false,pass:false,confirm:false } styles={ paper:{ paddingTop:...
def find_median(list_num): # Sort the list list_num.sort() # Check if the list is odd or even if len(list_num) % 2 == 0: # If even, calculate the mean of the two middle numbers median = (list_num[int(len(list_num) / 2)] + list_num[int(len(list_num) / 2) + 1]) / 2 else: # If odd, return the mi...
<gh_stars>1-10 import os # model settings arch = 'resnet' img_size = (224, 224) model = dict( type='TypeAwareRecommender', backbone=dict(type='ResNet', setting='resnet18'), global_pool=dict( type='GlobalPooling', inplanes=(7, 7), pool_plane=(2, 2), inter_channels=[512], ...
<filename>services/publish.webmaker.org/lib/remix.js "use strict"; const Hoek = require(`hoek`); const Url = require(`url`); const REMIX_SCRIPT = process.env.REMIX_SCRIPT; Hoek.assert(REMIX_SCRIPT, `Must define location of the remix script`); const remixUrl = Url.parse(REMIX_SCRIPT); const slashes = remixUrl.slashe...
<filename>test.js const defaults = require('./index'); module.exports = { extends: defaults.extends, rules: Object.assign({}, defaults.rules, { 'arrow-body-style': 'off', 'newline-per-chained-call': 'off', 'max-nested-callbacks': ['error', 5], 'no-undefined': 'off', 'no-magic-numbers': 'off', ...
package com.yin.springboot.mybatis.domain; import java.io.Serializable; import lombok.Data; @Data public class PmsBrand implements Serializable { private Long id; private String name; /** * 首字母 */ private String firstLetter; private Integer sort; /** * 是否为品牌制造商:0->不是;1->是 *...
""" Algorithm to optimize a given dataset """ def optimize_dataset(dataset): optimized_dataset = [] processed_indexes = set() # set to store indices of records already processed while len(processed_indexes) != len(dataset): min_index, min_val = 0, float('inf') # Record with the ...
#!/bin/sh set -ex cabal --version echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" stack --version case $BUILD in hlint) echo "Downloading hlint" curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh > hlint.sh chmod +x hlint.sh ;; stack) ...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.socialSoundcloud = void 0; var socialSoundcloud = { "viewBox": "0 0 512 512", "children": [{ "name": "path", "attribs": { "d": "M256,0C114.609,0,0,114.609,0,256s114.609,256,256,256s256-114.609,256-256S397.391,0,256...
class Circle { private double radius; public Circle(double radius) { this.radius = radius; } public double getArea() { return Math.PI * radius * radius; } }
#!/bin/sh red=$(tput setaf 1) green=$(tput setaf 2) yellow=$(tput setaf 3) end=$(tput sgr0) VERSION="$(git describe --tags)" build_dir="../../../out/target/product/d10f/obj/BOOTLOADER_EMMC_OBJ" print_usage() { echo "Usage: $0 [-h|-?|--help] [-b|--boot] [-f|--flash] [-c|--clean] [-z|--zip]" echo "--help: show t...
#!/usr/bin/env bash echo "Deploying $1..." git pull origin master composer install --no-dev
package io.opensphere.filterbuilder2.manager; import java.util.Arrays; import java.util.Collection; import javax.swing.JOptionPane; import org.apache.log4j.Logger; import io.opensphere.core.util.swing.ButtonPanel; import io.opensphere.core.util.swing.OptionDialog; import io.opensphere.filterbuilder.controller.Filte...
require 'active_support/concern' require 'active_support/core_ext/module/delegation' module SpecHelpers module LoggerHelpers extend ActiveSupport::Concern included do attr_reader :default_logger, :use_logger around :each do |example| @default_logger = Circuit.logger if clean_lo...
#!/usr/bin/env bash # ============================================================================== # Home Assistant Community Add-ons: Bashio # Bashio is an bash function library for use with Home Assistant add-ons. # # It contains a set of commonly used operations and can be used # to be included in add-on scripts t...
SELECT AVG(age) AS avg_age FROM ( SELECT id, name, age, MIN(age) OVER (PARTITION BY name) AS min_age FROM People) AS t WHERE age = min_age;
var gulp = require('gulp'); var exec = require('child_process').exec; gulp.task('start', function () { exec('live-server --open=styleguide'); exec('styleguide start'); });
#!/bin/bash #SBATCH -J Act_sin_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=2000 #SBATCH -t 23:59:00 # Hours, minutes and ...
import numpy as np def get_mm_line_fit(hits, sig_keys): ## extract quantities zs = hits[:, sig_keys.index('z')] xs = hits[:, sig_keys.index('projX_at_middle_x')] unc_xs = 2*np.abs( hits[:, sig_keys.index('projX_at_middle_x')] - hits[:, sig_keys.index('projX_at_rightend_x')] ...
#!/usr/bin/env bash uid=$(id -u) gid=$(id -g) printf "UID=${uid}\nGID=${gid}\nCOMPOSE_PROJECT_NAME=profile" > .env
// Import necessary packages const express = require("express"); const http = require("http"); const socketIO = require("socket.io"); // Create the express app const app = express(); // Create the server const server = http.createServer(app); // Set up the socket const io = socketIO(server); // Listener for connect...
#!/bin/bash # # Copyright (C) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
def count_strings_by_sum_of_ascii(strings): count = 0 for string in strings: ascii_sum = 0 for char in string: ascii_sum += ord(char) if ascii_sum % 3 == 0: count += 1 return count
#!/usr/bin/env bash curl -sSLO https://unpkg.com/webextension-polyfill@0.8.0/dist/browser-polyfill.js
#!/bin/bash tee /etc/pam.d/mariadb << EOF auth required pam_unix.so audit auth required pam_unix.so audit account required pam_unix.so audit EOF useradd testPam chpasswd << EOF testPam:myPwd EOF usermod -a -G shadow mysql echo "pam configuration done"
<reponame>kemitchell/httpcallback.js<filename>test.js var HTTPCallback = require('./') var concat = require('concat-stream') var http = require('http') var series = require('async-series') var tape = require('tape') var url = require('url') tape(function (test) { test.plan(9) // The data to send from an event sour...
import {EMPTY, Observable, Subscription} from 'rxjs' import {AbstractControl, FormGroup, ValidatorFn} from '@angular/forms' import {debounceTime, map, startWith} from 'rxjs/operators' import {FormDataStringType, FormInputData} from './form.input' import {mandatoryOptionsValidator, optionalOptionsValidator} from '../../...
#!/bin/bash if [[ `uname` == "Darwin" ]]; then THIS_SCRIPT=`python -c 'import os,sys;print os.path.realpath(sys.argv[1])' $0` MKTEMP="mktemp -t `basename $0`" else THIS_SCRIPT=`readlink -f $0` MKTEMP="mktemp -t `basename $0`.XXXXXXXX" fi THIS_DIR="${THIS_SCRIPT%/*}" cd $THIS_DIR FORCE=true . ../ingest...
#!/bin/bash srcdir=`dirname $0` . "${srcdir}/lib.sh" parse_args "$0" "owner dataset_owner experiment dataset" "$@" shift $n set -e set -x srcdir=`realpath $srcdir` mkdir workdir cd workdir pwd aws s3 sync s3://almond-research/${owner}/workdir-${experiment}/ . cp /opt/genie-toolkit/languages/multiwoz/ontology.json ...
<reponame>yqian4/optuna import abc import copy from optuna import study from optuna.trial import TrialState from optuna import type_checking if type_checking.TYPE_CHECKING: from typing import Any # NOQA from typing import Dict # NOQA from typing import List # NOQA from typing import Optional # NOQ...
import { ScalafmtError } from '../src/ScalafmtError'; describe('ScalafmtError.parseErrors', () => { test('parses empty string', () => { const errors = ScalafmtError.parseErrors('', 'workdir'); expect(errors).toHaveLength(0); }); test('parses errors', () => { const input = ` --- workdir/Example.scala...