text
stringlengths
1
1.05M
# NameSpaceNetworkRuleSetCreate RESOURCE_GROUP="myresourcegroup" NAMESPACE_NAME="my" NETWORK_RULE_SET_NAME="mynetworkruleset" VIRTUAL_NETWORK_NAME="myvirtualnetwork" SUBNET_NAME="mysubnet" az resource create --id /subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP/providers/Microsoft.ServiceBus/names...
""" Create a program that computes the average distance between two points in a two-dimensional space """ import math def avg_distance(point1, point2): # Compute the average distance between two points in a two-dimensional space x1, y1 = point1 x2, y2 = point2 # Calculate distance dist = math.sqrt...
/*** * Copyright (C) <NAME>. All rights reserved. * Licensed under the MIT license. See LICENSE file in the project root * for full license information. * * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ * * For related information - https://github.com/CodeWith...
import { gql } from 'apollo-server-express'; export default gql` type TUser { id: ID firstname: String lastname: String email: String gender: EGender role: EUserRole isEmailVerified: Boolean accountClosed: Boolean } type TPaginatedUsers { results: [TUser]! page: Int! ...
<reponame>ruritoBlogger/GameAI-FightingAI<gh_stars>0 package RHEA; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.Random; import java.util.Deque; import enumerate.Action; import RHEA.bandits.BanditArray; import RHEA.bandits.BanditGene; import RHEA.utils.Operation...
<gh_stars>100-1000 /*********************************************************************************************************************** * OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved. * * Redistribution and use in source and binary forms...
<gh_stars>1-10 # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTIES OR CON...
package org.spongycastle.tls; /** * RFC 5056 * <p> * Note that the values here are implementation-specific and arbitrary. It is recommended not to * depend on the particular values (e.g. serialization). */ public class ChannelBinding { /* * RFC 5929 */ public static final int tls_server_end_poin...
from typing import List def generate_url_patterns(urls: List[str], views: List[str]) -> str: url_patterns = [] for url, view in zip(urls, views): view_name = view.__name__.lower() url_patterns.append(f"path('{url}', {view.__name__}.as_view(), name='{view_name}')") return "urlpatterns = [\n ...
/* Copyright (c) 2001-2014, The HSQL Development Group * 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 the above copyright notice, this * list...
echo "usage define three env varaiables DESIGN, TEST, MODULE beforehand" [ -z $COND ] && cond="" || cond="_$COND" echo $cond fsdbfile="../sim/${DESIGN}_${TEST}${cond}.fsdb" echo $fsdbfile sh fsdb2saif.sh $fsdbfile pt_shell -f primetime.tcl
TERMUX_PKG_HOMEPAGE=https://www.musicpd.org TERMUX_PKG_DESCRIPTION="Music player daemon" TERMUX_PKG_LICENSE="GPL-2.0" TERMUX_PKG_VERSION=0.22.3 TERMUX_PKG_SRCURL=https://github.com/MusicPlayerDaemon/MPD/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=8ef420742647c4c6b39459545869dd3071b46780b728cf4d63b2b10d85d808e...
import sys import logging import functools import traceback import synapse.exc as s_exc import synapse.common as s_common import synapse.glob as s_glob import synapse.telepath as s_telepath import synapse.lib.cmd as s_cmd import synapse.lib.output as s_output import synapse.lib.version as s_version logger = logging....
<reponame>martamedio/spring-cloud-gateway /* * Copyright 2013-2020 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 License at * * https://www.apache.org/licen...
public class UserPageManager { // Assume the existence of the viewUserPages() method public function finished(){ return $this->viewUserPages('finished'); } public function alltasks(){ return $this->viewUserPages('allTasks'); } public function calendar(){ return $this->...
#!/bin/bash set -e DIR="$( cd "$(dirname "$0")" ; pwd -P )" # onnx inference only on python3, pls pip3 install onnxruntime run_onnx_inference.py \ --input_file $DIR/data/dog.jpg \ --mean 0.485,0.456,0.406 \ --image_resize_dims 256,256 \ --net_input_dims 224,224 \ --raw_scale 1 \ --output_file...
import tensorflow as tf import matplotlib.pyplot as plt # Load the dataset (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() # Reshape the data x_train = x_train.reshape(x_train.shape[0], 28, 28, 1) x_test = x_test.reshape(x_test.shape[0], 28, 28, 1) # Convert into float32 x_train = x_train....
<filename>src/theme/default/index.ts import * as app from "./app.m.css"; import * as systemStatusbar from "./system-statusbar.m.css"; import * as defaultVariant from "./variants/default.m.css"; export default { theme: { "mini-program-component/app": app, "mini-program-component/system-statusbar": systemStatusbar,...
#!/usr/bin/env bash # # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C.UTF-8 cd "build/daipercoins-$HOST" || (echo "could not enter distdir build/daipercoins-$HOST";...
require 'celluloid/current' require 'yaml' require_relative 'utils/pmap' require_relative 'utils/mini_active_support' # Extend all objects with logger Object.send(:include, Eye::Logger::ObjectExt) # needs to preload Eye::Sigar Eye::SystemResources class Eye::Controller include Celluloid autoload :Load, ...
mosquitto_pub -t 'topic' -m 'message' -V mqttv5 -u user
# Write your solution here def most_common_character(my_list): count = my_list.count(my_list[0]) max_count = my_list[0] for i in range(len(my_list)): if my_list.count(my_list[i]) > count: count = my_list.count(my_list[i]) max_count = my_list[i] return max_count i...
import React from 'react'; const OpenApi = () => { return <div>开放接口</div> } export default OpenApi;
#!/bin/sh set -e set -u set -o pipefail if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy # frameworks to, so exit 0 (signalling the script phase was successful). exit 0 fi echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_P...
import { Component } from '@angular/core'; import { Store } from '@ngrx/store'; import { RiskTabHelperService } from '../services/risk-tab-helper.service'; import { selectRiskQueryResult } from '../store/selectors'; import { constants } from 'src/constants'; import { ColumnMode } from '@swimlane/ngx-datatable'; @Compo...
#!/bin/bash set -e -x -u MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized source "$MY_PATH/detect_qmake.sh" # Prints number of cores to stdout GetCPUCores() { case "$OSTYPE" in # it's GitBash under Windows cygwin) echo $NUMBER_OF_PRO...
import Component from 'react-pure-render/component'; export default (typeof window !== 'undefined') ? require('react-ace').default : class AceEditor extends Component { render() { return null } }
#!/bin/bash TESTDIR=$(dirname -- "$0") ZXI=${TESTDIR}/../../target/release/examples/zxi error=0 echo Running zx should-pass tests: for i in ${TESTDIR}/*.zx; do ${ZXI} "$i" &>/dev/null if [ "$?" != "0" ]; then echo "[failure: should-pass] $i" error=1 fi done echo Done. echo echo Running zx...
#!/usr/bin/env sh # abort on errors set -e # remove babel cache rm -r ./node_modules/.cache/babel-loader/ # build npm run build:demo # navigate into the build output directory cd build git init git add -A git commit -m 'update' git push -f git@github.com:XiongAmao/vue-easy-lightbox.git master:gh-pages cd - echo...
CREATE TABLE products ( id INTEGER PRIMARY KEY, product_name VARCHAR(255) NOT NULL, price DECIMAL(10,2) NOT NULL ); CREATE TABLE customers ( id INTEGER PRIMARY KEY, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL ); CREATE TABLE orders ( id INTEGER PRIMARY KEY, customer_id INTEGER NOT NULL, product_i...
import { isDefined, isString, isNumber, isArray, toString } from './type-checkers' export default function get(obj, path) { let list = [] let arr = false const _get = (obj, path) => { if (!path) { // If there's no path left, we've gotten to the object we care about. list.push(obj) ...
package no.item.enonic.builders.mappers; import com.enonic.cms.api.client.model.user.Address; import com.enonic.cms.api.client.model.user.UserInfo; import com.google.common.base.Strings; import no.item.enonic.models.User; import java.time.LocalDate; import java.time.ZoneId; import java.util.Arrays; import java.util.D...
let jsonString = '{"name": "John Smith", "age": 30}'; let jsonObj = JSON.parse(jsonString); let name = jsonObj.name; console.log(name); // Outputs: "John Smith"
<filename>commons/validator/validator_test.go package validator import ( "fmt" "github.com/eddieowens/axon" "github.com/stretchr/testify/suite" "os" "path" "testing" ) type ValidatorTest struct { suite.Suite validator Validator } func (v *ValidatorTest) SetupTest() { inj := axon.NewInjector(axon.NewBinder( ...
<filename>db/migrate/20160428201207_add_tags_to_disease_source_variants.rb<gh_stars>0 class AddTagsToDiseaseSourceVariants < ActiveRecord::Migration def change drop_join_table :tags, :variants create_join_table :tags, :disease_source_variants do |t| t.foreign_key :tags t.foreign_key :disease_sour...
<reponame>x5z5c5/weboasis-repo.github.io /* global VT */ window.VT = window.VT || {}; VT.AppIcon = function (el) { if (el.children.length > 0) return; var id = el.dataset.id; var promise = VT.AppIcon.cache[id]; if (!promise) { var url = VT.AppIcon.baseUrl + id + '.svg'; promise = VT.AppIcon.cache[id]...
<filename>public/92.js<gh_stars>0 (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[92],{ /***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/assets/js/views/JobWorkflow/Tabs.vue?vue&type=script&lang=js&": /*!************************************************...
<filename>src/pages/blog.js import React from "react"; import Link from "gatsby-link"; import { graphql } from "gatsby"; import { Nav } from "../components/nav"; // import '../css/index.css'; // add some style if you want! export default function Index({ data }) { const { edges: posts } = data.allMarkdownRe...
import VRating from './v-rating.vue'; export default VRating;
<reponame>Sid1000/sample-page export declare function getTransformTemplate(): string; export declare function getTransformGpuTemplate(): string; export declare const filterTemplate: { "--chakra-blur": string; "--chakra-brightness": string; "--chakra-contrast": string; "--chakra-grayscale": string; "...
#;**********************************************************************; # # Copyright (c) 2016, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of sour...
CREATE TABLE Fruits ( name TEXT NOT NULL, color TEXT NOT NULL, is_sweet BOOLEAN NOT NULL );
package org.jooby.mongodb; import com.google.inject.Binder; import com.google.inject.Key; import com.google.inject.binder.AnnotatedBindingBuilder; import com.google.inject.name.Names; import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; import com.mongodb.client.MongoDatabase; import com.typesafe.config....
<gh_stars>10-100 /* eslint-env mocha */ import { expect } from 'chai'; import getStyles from '../../src/switch/get-styles'; import styles from '../../src/switch/styles'; describe('Switch.getStyles', () => { describe('knob', () => { it('should get styles', () => { const style = getStyles.knob(); expe...
<filename>test/test_haversine.c<gh_stars>0 // <NAME> // testing of haversine formula // filename: test_haversine.c // attribution: https://en.wikipedia.org/wiki/Haversine_formula#The_haversine_formula // attribution: https://www.vcalc.com/wiki/vCalc/Haversine+-+Distance #include <stdio.h> #include <stdlib.h> #includ...
<gh_stars>0 import {verifyType, TYPES, notNegative} from "../util/verifyType.js"; import {Terminable, TerminableList} from "../util/terminable.js"; // The base values for both stats const OFFENSE = 33.73; const HP = 107.0149; /* The Stat class represents one of a Warrior's 4 stats: (1) Physical attack (2) Elemental...
def reverse_string(string): rev_string = '' for char in string: rev_string = char + rev_string return rev_string # Time Complexity: O(N) # Space Complexity: O(N)
import memoize from 'memoize-one' // create a set of handlers with a stable identity so as not to // thwart SCU checks export default function createEventHandler(getHandler) { let getter = memoize(getHandler) let handlers = {} return events => { const newHandlers = {} if (events) { for (let event ...
<gh_stars>1-10 /* * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> */ package play.libs.ws; import play.Application; /** * Asynchronous API to to query web services, as an http client. * * The value returned is a {@code Promise<Response>}, and you should use Play's asynchronous mechanisms to use...
#!/bin/sh # Create /lib64 symlink if it doesn't exist if [ ! -d "/lib64" ]; then ln -s /lib /lib64 fi # Remove all IOxOS cards and rescan the pci bus # This is a workaround for hot plug rescan=0 # Find all unique IOxOS cards by [vendorid:deviceid] pcie_ioxos=$(dmesg | grep "\[7357\:1002\]" | sort -u) # Remove all...
package com.trackorjargh.javarepository; import java.util.List; import javax.transaction.Transactional; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import com.trackorjargh.javaclass.Book...
export interface storeState { navShow: boolean; artSum: number; name: string; link: string; email: string; avatar: string; mode: number; }
def get_smallest_num(nums): return min(nums) nums = [5, 10, 15, 20] print(get_smallest_num(nums))
#!/bin/bash BUCKET=cloud-training-demos-ml # CHANGE gsutil cp *.ipynb gs://$BUCKET/notebooks/jupyter
package io.opensphere.myplaces.importer; import java.io.File; import java.io.FileNotFoundException; import java.util.Collection; import java.util.List; import org.apache.log4j.Logger; import de.micromata.opengis.kml.v_2_2_0.Document; import de.micromata.opengis.kml.v_2_2_0.Feature; import de.micromata.opengis.kml.v_...
#!/bin/bash # pip install python3 -m pip install -r ./setup/requirements_colab.txt # Visual Studio Code :: Package list pkglist=( ms-python.python tabnine.tabnine-vscode njpwerner.autodocstring kevinrose.vsc-python-indent ms-ceintl.vscode-language-pack-ja sbsnippets.pytorch-snippets mosapride.zenkaku ) for i in ${pkg...
package dev.shirokuro.commandutility; import dev.shirokuro.commandutility.platform.Platform; import dev.shirokuro.commandutility.platform.PlatformCommandHandler; import java.util.Collections; import java.util.Map; public final class TestPlatform implements Platform { @Override public void registerHandler(fin...
function generateCategoryList(categories) { let html = '<ul class="categories_mega_menu">'; categories.forEach(category => { html += `<li class="menu_item_children"><a href="#">${category.name}</a></li>`; }); html += '</ul>'; return html; }
<reponame>steadylearner/code import gzip import shutil def gzip_decompress(file_name: str): with gzip.open(f'{file_name}', 'rb') as f_in: with open(f'{file_name}'.replace(".gz", ''), 'wb') as f_out: shutil.copyfileobj(f_in, f_out)
#!/system/bin/sh #Copyright (c) 2015 Lenovo Co. Ltd #Authors: yexh1@lenovo.com umask 022 #yexh1 LOGFILE="/data/local/log/aplog/dmesglog" if [ -z "$1" ]; then LOGDIR=$(getprop persist.sys.lenovo.log.path) else LOGDIR=$1 fi LOGFILE=$LOGDIR"/events" #yexh1 /system/bin/logcat -r8096 -b events -n 16 -v threadtime...
import { Space, Table } from 'antd'; import React from 'react'; import useTodoService, { TodoDataProps, TodoService } from './useTodoService'; import TableHandler from './TableRowHandler'; import TodoListInput from './TodoListInput'; import { Wrapper } from './StyledComponets/Wrapper'; const TABLE_COLUMN = [ { title...
#!/usr/bin/env bash # # Copyright (C) 2011-2021 Intel Corporation. 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 the above copyright # noti...
import React from "react"; import { Box } from "@material-ui/core"; import { FormattedMessage, useIntl } from "react-intl"; import ManagementSummaryCard from "../ManagementSummaryCard"; import { formatFloat, formatFloat2Dec } from "../../../../utils/format"; /** * @typedef {import('../../../../services/tradeApiClient...
import json import logging import os from typing import List, Dict from spotckup.decorators import timer from spotckup.utils import save_image_from_url, do_request_validate_response, path_or_create @timer def get_list_from_paginated_response(url: str, token: str, verbose: bool = False) -> List[Dict]: res: List =...
package main import "C" import ( "bufio" "encoding/json" "fmt" "os" "storyboard/backend/config" "storyboard/backend/database" "storyboard/backend/interfaces" "storyboard/backend/noterepo" "storyboard/backend/photorepo" "storyboard/backend/server" "storyboard/backend/slog" "storyboard/backend/wrapper" ) v...
<gh_stars>1-10 const url = require('url') const Router = require('koa-router') const ssr = require('../ssr') const { addSlashes, stripBasename } = require('../utils/pathUtils') const router = new Router() // 从服务器渲染获取到的配置,basename 是 next.config.js 文件中配置的值。 const basename = ssr.renderOpts.runtimeConfig.basename || '/'...
const express = require('express'); const mongoose = require('mongoose'); // Database mongoose.connect( 'mongodb://localhost/movielibrary', { useNewUrlParser: true, useUnifiedTopology: true } ); const Movie = mongoose.model('Movie', { title: String, year: Number, synopsis: String }); const app = express(); app...
package org.apache.doris.ldap; import com.google.common.collect.Lists; import mockit.Delegate; import mockit.Expectations; import mockit.Mocked; import org.apache.doris.analysis.UserIdentity; import org.apache.doris.catalog.Catalog; import org.apache.doris.cluster.ClusterNamespace; import org.apache.doris.common.DdlEx...
import sys def parse_command_line_arguments(args): options = { '-h': '--help', '-v': '--version', '-f': '--fail-fast', '-t': '--tap', '--verbose': None, '--output-text': None, '--output-html': None } parsed_options = {} i = 1 # Start from index...
TERMUX_PKG_HOMEPAGE=https://github.com/adrianlopezroche/fdupes TERMUX_PKG_DESCRIPTION="Duplicates file detector" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_VERSION=1.6.1 TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/adrianlopezroche/fdupes/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=9d6b6fdb0b8419815b...
<reponame>gwonsungjun/koa-api-boilerplate<gh_stars>1-10 import { Model, DataTypes } from 'sequelize' export default sequelize => { class Product extends Model { static associate() {} } Product.init( { productId: { type: DataTypes.BIGINT(20), allowNull: false, primaryKey: true, autoIncrement: true ...
from typing import List def take_action(state: int, action: int) -> List[int]: """ Returns the next state and the reward based on the current state and action. Args: state (int): The current state, a number between 1 and 25. action (int): The action to be taken, one of [-1, 1, 5, -5]. Returns...
#!/bin/bash lines=$(cat $1 | aspell -p ./misc/aspell_dict -x -d en_GB list) if [[ -z "$lines" ]]; then exit 0 fi echo "$lines" exit 1
def rock_paper_scissors(player1_choice, player2_choice): valid_choices = ["rock", "paper", "scissors"] if player1_choice not in valid_choices or player2_choice not in valid_choices: return "Invalid input" if player1_choice == player2_choice: return "It's a tie" elif (player1_ch...
#!/bin/bash current_dir=${DOTFILES_CURRENT_SOURCE_DIR} DOTNVIM="$HOME/.config/nvim" # Create .config/nvim folder if needed [ -d "$DOTNVIM" ] && mkdir -p $DOTNVIM # Install nvim dotfiles_install_package nvim # Install config dotfiles_install_component $current_dir $DOTNVIM # Install vim plugins nvim +PlugInstall
#!/bin/bash # Script to run all VSA on all test c-programs. # Please specify the path to llvm and clang in the environment variables # VSA_CLANG_PATH and VSA_LLVM_PATH. # if one argument passed: only analyze the passed program if [ $# == 1 ] ; then ARRAY=($1) else # run all ARRAY=($(ls -d *.c)) fi # if no f...
/* * Copyright 2016 <NAME> * * 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 in wr...
<reponame>Oddert/graphql-example-ref-netninja<gh_stars>0 const mongoose = require('mongoose') const AuthorSchema = new mongoose.Schema ({ name: String, age: Number }) module.exports = mongoose.model('graphql-netninja-author', AuthorSchema)
<gh_stars>0 require 'rails_helper' RSpec.describe AlbumsController, type: :controller do describe "GET #index" do it "responds successfully with an HTTP 200 status code" do get :index expect(response).to be_success expect(response).to have_http_status(200) end end describe "POST #crea...
const express = require('express'); const app = express(); app.get('/books', (req, res) => { res.render('books', { books: [ { title: 'The Catcher in the Rye', author: 'J. D. Salinger' }, { title: 'To Kill a Mockingbird', author: 'Harper Lee' }, { title: '1984', author: 'George Orwell' } ] }); }); app.l...
package com.lai.mtc.mvp.ui.cartoon.fragment; import android.os.Bundle; import com.lai.mtc.mvp.base.impl.BaseFragment; /** * @author Lai * @time 2018/1/14 15:44 * @describe 主页动漫fragment */ public class CartoonMainFragment extends BaseFragment { @Override public int getLayoutResId() { return 0; ...
import Joi from 'joi'; // siren: Configuration for the watcher saved object. const WatchConfiguration = { type: 'sentinl-watcher', title: 'watcher_title', schema: Joi.object().keys({ title: Joi.string(), username: Joi.string(), input: Joi.any(), actions: Joi.any(), transform: Joi.any(), c...
<reponame>tempora-mutantur/cobertura-plugin<gh_stars>10-100 package hudson.plugins.cobertura.targets; import java.io.Serializable; /** * Describes how {@link CoveragePaint} can be aggregated up a {@link CoverageResult} tree. * * @author <NAME> * @since 29-Aug-2007 18:13:22 */ public class CoveragePaintRule imple...
<gh_stars>0 /*! Simple unit testing for c/c++ Copyright 2012, <NAME>. Licence: Apache 2.0 Purpose: facilitate the unit testing for programs written in c/c++ Use: Define your tests as functions that don't take any arguments but return "int". They should return 1 if successful otherwise, 0....
<reponame>gisikw/hashtag require 'test_helper' class InterpreterTest < Minitest::Test def assert_evaluates_to(code, result) assert_equal result, Hashtag::Interpreter.new.eval(Hashtag::Parser.new.parse(Hashtag::Lexer.new(code).tokens)) end def test_basic_identity assert_evaluates_to "3\n", 3 end...
/** Copyright 2013 <NAME> project Ardulink http://www.ardulink.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 at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appli...
<gh_stars>1-10 package diplomat import ( "github.com/tony84727/diplomat/pkg/data" "github.com/tony84727/diplomat/pkg/emit" "github.com/tony84727/diplomat/pkg/log" "github.com/tony84727/diplomat/pkg/selector" "strings" "sync" ) type Synthesizer struct { data.Translation output Output emitterRegistry emit.Regi...
/* * Router configuration * https://nuxtjs.org/api/configuration-router */ export default { middleware: ['auth'], base: '/', linkExactActiveClass: 'active', trailingSlash: false }
<gh_stars>1-10 /* TITLE Animate the Gaussian Elimination Chapter24Exercise8.cpp COMMENT Objective: Animate the Gaussian Elimination. Input: - Output: - Author: <NAME> Date: 07.05.2017 */ #include <iostream> #include <iomanip> #include <sstream> #include <vector> #include <array> #include <nu...
<filename>app/controllers/storageBackends/Backends.scala /* * Copyright 2017 - Swiss Data Science Center (SDSC) * A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and * Eidgenössische Technische Hochschule Zürich (ETHZ). * * Licensed under the Apache License, Version 2.0 (the "License"); * yo...
import { Request, Response, NextFunction } from 'express'; import { validationResult } from 'express-validator/check'; import isEmpty from '../utilities/isEmpty'; import passErrorToNext from '../utilities/passErrorToNext'; import { ErrorREST, Errors } from '../utilities/ErrorREST'; import { createComment, getCommen...
# The IP/Hostname for the Kubernetes cluster CLUSTER_IP="" # The user to use for Egeria EGERIA_USER="" # The name of the Egeria server you're starting EGERIA_SERVER="" # The IP/Hostname to connect to for Catalog CATALOG_IP="" # Catalog Username/pw credentials CATALOG_USER="" CATALOG_PASS="" set -e # Configure Cat...
interface Events { [i: string]: undefined | ((error?: any) => any); } jest.mock('net', () => { let events: Events = {}; let returnPort = 8080; const server = { address: () => ({ port: returnPort, }), once: function once (event: string, callback: (error?: any) => any) { events[event] = ...
/// /// @file index.js /// @brief The entry point for our application. /// // Imports const mongoose = require('mongoose'); const loadenv = require('node-env-file'); // Mongoose Promise mongoose.Promise = global.Promise; // Environment Variables // // Comment this line out when you are ready to deploy this // ...
<gh_stars>0 import os from os.path import dirname, basename from irods.session import iRODSSession from irods.models import Resource, DataObject, Collection from irods.exception import NetworkException from .sync_utils import size, get_redis, call, get_hdlr_mod from .utils import Operation import redis_lock import json...
<gh_stars>0 /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package converters; import java.util.Date; /** * * @author olu */ public class ConverterMain { /** * @param ...
def max_difference(arr): max_diff = -100000 for i in range(len(arr) - 1): diff = abs(arr[i] - arr[i+1]) max_diff = max(max_diff, diff) return max_diff
SELECT name FROM employees WHERE department = 'Product Development'
<reponame>antonjb/apple-news-format<gh_stars>1-10 import { SupportedUnits } from "./supported-units"; /** * Signature/interface for a `Padding` object * @see https://developer.apple.com/documentation/apple_news/padding */ export interface Padding { bottom?: SupportedUnits | number; // Integer left?: Support...
package rest import ( "errors" "net/http" "net/url" "reflect" "github.com/gin-gonic/gin" "github.com/mitchellh/mapstructure" ) // MustBind calls binds and aborts the request if an error is raised func MustBind(c *gin.Context, target interface{}) error { if err := Bind(c, target); err != nil { c.AbortWithErr...