text
stringlengths
7
1.04M
<gh_stars>1-10 /*Program to validate an IP address Write a program to Validate an IPv4 Address. According to Wikipedia, IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., 172.16.254.1 Recommended: Please solv...
import {Component} from '@angular/core'; import {HttpClient, HttpRequest} from "@angular/common/http"; import {StripColorGraphData, StripGraphData, StripSequenceGraphData} from "jigsaw/public_api"; import {AjaxInterceptor} from "../../../../app.interceptor"; @Component({ templateUrl: './demo.component.html' }) exp...
<filename>smellCatalog/InputProcessor.py import re from Smell import Smell from SmellCategory import SmellCategory from Reference import Reference SMELL = "\[smell\]" SMELL_ID = "\[smell-id\]" SMELL_NAME = "\[smell-name\]" SMELL_END = "\[smell-end\]" SMELL_DES = "\[smell-description\]" SMELL_AKA = "\[smell-aka\]" SMEL...
""" @Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.39 工具: python == 3.7.3 """ """ 思路: 滑动窗口 结果: 执行用时 : 1320 ms, 在所有 Python3 提交中击败了38.54%的用户 内存消耗 : 17.4 MB, 在所有 Python3 提交中击败了5.79%的用户 """ class Solution: def findMaxAverage(self, nums, k): res = _sum = su...
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #include "stdafx.h" #include ...
# https://hasura.io/blog/how-to-setup-authentication-with-django-graphene-and-hasura-graphql/ import jwt import api.models from datetime import datetime from graphql_jwt.settings import jwt_settings ## JWT payload for Hasura def jwt_payload(user, context=None): jwt_datetime = datetime.utcnow() + jwt_settings.JW...
<filename>src/reducers/index.ts import { routeReducer as routing } from "react-router-redux" import { combineReducers } from "redux" import { reducer as toastrReducer } from 'redux-toastr' import links from "./Link" export default combineReducers({ links, routing, toastrReducer })
<gh_stars>0 import { NodeInitializer } from 'node-red'; import { getBot } from '../shared/types'; import { DiscordConfigNode, DiscordConfigNodeDef } from './modules/types'; const nodeInit: NodeInitializer = (RED): void => { function DiscordConfigNodeConstructor( this: DiscordConfigNode, config: DiscordConfig...
#include <brotli/encode.h> #include <brotli/decode.h> #include <cstdlib> #include <cstring> #include <string> #include <iostream> int main() { std::string input = "some long text that we would like to compress if possible...."; uint8_t buffer[128]; size_t outputsize = sizeof(buffer); BROTLI_BOOL resul...
# -*- coding: utf-8 -*- """ author: zengbin93 email: <EMAIL> create_dt: 2021/11/17 22:26 describe: 使用掘金数据验证买卖点 """ from czsc.gm_utils import trader_tactic_snapshot from examples import tactics if __name__ == '__main__': ct = trader_tactic_snapshot("SZSE.300669", end_dt="2022-03-18 13:15", tactic=tactics.trader_st...
<reponame>luoyan407/predict_trustworthiness_smallscale<filename>confidnet/models/small_convnet_mnist.py<gh_stars>100-1000 import torch.nn as nn import torch.nn.functional as F from confidnet.models.model import AbstractModel class SmallConvNetMNIST(AbstractModel): def __init__(self, config_args, device): ...
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> int n,x,a[1005],cnt,ans; int main(){ scanf("%d",&n); for (int i=1;i<=n;i++){ scanf("%d",&x); a[x]++; } while (1){ if (n==0) break; int cnt=0; for (int i=1;i<=1000;i++) if (a[i]) cnt++,a[i]--,n--; ...
import { isEmpty, isRegExp } from "lightdash"; /** * Removes trailing sequences from a string. * * @private * @param str String to use. * @param seq Sequence to remove. * @return String without trailing sequence. */ const removeTrailing = (str: string, seq: string | RegExp): string => { if (isRegExp(seq)) {...
import numpy as np import matplotlib.pyplot as plt import cartopy.crs as ccrs from xmitgcm import open_mdsdataset from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER plt.ion() dir1 = '/homedata/bderembl/runmit/test_southatlgyre' ds1 = open_mdsdataset(dir1,iters='all',prefix=['Eta']) nt = 0 ...
<gh_stars>0 import {Routes} from "@angular/router"; import {CategoryListComponent} from '../components/category-list/category.list.component'; import {CategoryViewComponent} from '../components/category-view/category.view.component'; export const CATEGORY_ROUTES: Routes = [ {path: 'categories', component: CategoryLi...
import invariant from 'tiny-invariant'; import { Action, Components, Context, Guard, Immediate, Machine, MachineEvent, Reducer, State, Transition, ObjectProto, Invoke, } from './types'; import { immutable, isType, isTypeP } from './utility'; import { machineIsValid } from './validation'; export...
<reponame>gregorwolf/sap-business-one-odata-cap /* * Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ export enum InvBaseDocTypeEnum { Default = 'Default', Empty = 'Empty', PurchaseDeliveryNotes = 'Purchas...
<filename>src/app/consumption/pages/models/producto.ts export class Producto{ id_producto?: number; id_categoria: number; nom_producto: string; desc_producto: string; fec_cambio: Date; id_usuario_cambio: number; precio_producto: number; unidades_existentes: number; constructor(id_ca...
<reponame>thew3u/useWeb3 import React from 'react' import { Box, Button, Container, Typography } from '@mui/material' import { useModal } from 'mui-modal-provider' import WalletsModal from '../modals/WalletsModal' import { useWeb3 } from '@w3u/useWeb3' import Account from '../Account' const Header = () => { const { ...
<reponame>NicholasCui/agora-wxa<filename>src/services/users.ts<gh_stars>0 import { AnchorList } from "../utils/fancy-list"; import { User } from '../interfaces/user'; import { GlobalDataContext } from './global-data-context'; export class AgoraUserList extends AnchorList<User> { gdt: GlobalDataContext; cons...
/*========================================================================= * * Copyright Insight Software Consortium * * 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 * * h...
<reponame>alpinista06/site_ibriza<gh_stars>0 import matplotlib.pyplot as plt import numpy as np import time import serial #importacao do modulo serial import random leitura =[] fig, ax = plt.subplots() ser = serial.Serial('/dev/ttyACM0', 9600, timeout=1) #abre porta serial ACM0 i=0 contador = 0 eixo_x = 96 while (i<...
#include <stdio.h> #include <stdlib.h> #define DEBUG_TRACE printf int main(int argc, char* argv[]) { DEBUG_TRACE("There are so many pearls in codes\n"); if(argc == 1) getchar(); return 0; }
<reponame>backmeupplz/open-funnels-backend export default () => ({ port: parseInt(process.env.PORT, 10), mongo: { uri: process.env.MONGO_URI, }, admin: { login: '' + process.env.ADMIN_LOGIN, password: '' + process.<PASSWORD>.ADMIN_PASSWORD, }, jwt: { secret: '' + process.env.JWT_SECRET, },...
<reponame>Nesk8er/WebLife1<gh_stars>0 # Import any icons for the current rule so the user can edit them # and when finished run icon-exporter.py. # Author: <NAME> (<EMAIL>), Feb 2013. import golly as g from glife import getminbox, pattern from glife.text import make_text from glife.BuiltinIcons import circles, ...
<gh_stars>100-1000 /* VKGL (c) 2018 <NAME> * * This code is licensed under MIT license (see LICENSE.txt for details) */ #include "OpenGL/entrypoints/GL3.0/gl_gen_vertex_arrays.h" #include "OpenGL/context.h" #include "OpenGL/globals.h" static bool validate(OpenGL::Context* in_context_ptr, const ...
import 'core-js'; import 'zone.js/dist/zone'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' import { BrowserModule } from '@angular/platform-browser' import { CommonModule } from '@angular/common' import { HttpModule } from '@angular/http' import { NgModule } from '@angular/core' import {...
<gh_stars>1-10 /*========================================================================= Program: ParaView Module: $RCSfile$ Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WA...
import sqlite3 conn = sqlite3.connect('northwind_small.sqlite3') cursor = conn.cursor() #What are the most expensive items in the database query1 = ''' SELECT ProductName, UnitPrice FROM Product ORDER BY UnitPrice DESC LIMIT 10; ''' result = cursor.execute(query1).fetchall() print(f'Ten Most Expensive Items {res...
<reponame>ckamtsikis/cmssw<gh_stars>100-1000 // -*- C++ -*- // // Package: L1TMicroGMTInputProducer // Class: L1TMicroGMTInputProducer // /**\class L1TMicroGMTInputProducer L1TMicroGMTInputProducer.cc L1Trigger/L1TGlobalMuon/plugins/L1TMicroGMTInputProducer.cc Description: Takes txt-file input and produces ba...
<reponame>book-soul/bool-soul-server<filename>src/controller/player_statement.controller.ts import { Controller, Get, Body, BadRequestException, Post, UseGuards, Param, NotFoundException, Query } from '@nestjs/common'; import { ExMessage } from '../exception/message'; import { AuthGuard } from '@nestjs/passport'; impor...
<filename>src/app/blocks/services/spotify.service.ts import { ArtistsResponse, Paginated } from './../interface/all'; import { environment } from './../../../environments/environment'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { map } from 'rxjs/op...
/* Copyright [2020] [IBM Corporation] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
<gh_stars>1-10 import { execute, SimulatorResult } from './Simulator'; import Logger from './Logger'; import { readFromCommandLine } from './SimulatorSetupReader'; const logSimulationResult = (simulatorResult: SimulatorResult): void => Logger.info(` zombies\` score: ${simulatorResult.zombieScore} zombies\` p...
<reponame>venkateshpotluri/jacdac-docs import { useState } from "react" // eslint-disable-next-line @typescript-eslint/no-unused-vars export function useSecret(id: string) { const [value, setValue] = useState("") return { value, setValue, } }
# -*- coding: utf-8 -*- """ Created on Sat Oct 27 10:24:02 2018 @author: Martin """ import pickle from tkinter import * from tkinter import filedialog class monApp: def __init__(self): self.fen = Tk() self.positionListe =0 self.ListeDePersonnes = [] self.pr...
<filename>src/core/room.ts import * as Koa from 'koa'; import { getLuminaireIdList, getLuminaire, Luminaire, SerializedLuminaire, getLuminaires, } from './luminaire'; import { addGroup, createGroup } from './group'; export interface Coordinate { x: number; y: number; z?: number; } type Zone = [Coordin...
/* * @Author: <NAME> * @Date: 2020-05-12 14:52:22 * @LastEditTime: 2020-06-08 15:51:33 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \DevUIHelper-LSP V4.0\server\src\GlobalData\GlobalData.ts */ import { ParseOption, TreeError } from '../yq-Parser/type'; import { HTMLAS...
#!/usr/bin/env python3 # Initial stock of the coffee machine water, milk, beans, disposable_cups, money = (400, 540, 120, 9, 550) def initial_stock(): """This function will display the current stock""" print(f"{water} of water") print(f"{milk} of milk") print(f"{beans} of coffee beans") print(f"{d...
<reponame>PegasisForever/jackson-js /** * @packageDocumentation * @module Decorators */ import { JsonFormatDecorator } from '../@types'; /** * Value enumeration used for indicating preferred Shape; translates loosely to JSON types. */ export declare enum JsonFormatShape { /** * Marker enum value that indi...
export class AsyncEmitter { async emitAsync(event: string | symbol, ...args: any[]): Promise<boolean> { // @ts-ignore const events = this._events; let callbacks = events[event]; if (!callbacks) { return false; } // helper function to reuse as much code as possible const run = (cb) =>...
import { RandomListMapper } from 'Config/Mappers/RandomList.mapper.dto'; import { CreateListResponseDto, FindListResponseDto, ListInfoResponseDto, } from 'Core/Dtos/RandomList/RandomList.dtos'; import { IRandomListService } from 'Core/Ports/IRandomLists.service'; import { NextFunction, Request, Response } from 'e...
<filename>contrib/tests/__init__.py from .test_core import BackendsTest
import React, { useContext } from 'react'; import { Route, RouteProps } from 'react-router'; import { AuthorizationContext, AuthorizationProviderProps } from '../AuthorizationProvider'; import RouteRedirect from '../RouteRedirect'; export type RedirectProps = Partial<Pick<AuthorizationProviderProps, 'redirectTo'>>; /...
<reponame>tdegeus/xtensor-python /*************************************************************************** * Copyright (c) <NAME>, <NAME> and <NAME> * * Copyright (c) QuantStack * * * * D...
from django.db import models import os import random from PIL import Image # Create your models here. def get_filename_ext(filepath): base_name = os.path.basename(filepath) name, ext = os.path.splitext(base_name) return name, ext def upload_image_path(instance, filename): # print(instance) #prin...
import mongoose from 'mongoose'; import { ISolutionModel } from './SolutionModel'; import { IUserModel } from './UserModel'; interface ITeam { name: string; users?: IUserModel[]; solutions?: ISolutionModel[]; } export interface ITeamModel extends ITeam, mongoose.Document {} const schema = new mongoose.Schema( ...
from django.apps import AppConfig class UsersAppConfig(AppConfig): name = 'taxinnovation.apps.users' verbose_name = 'Usuarios' def ready(self): import taxinnovation.apps.users.signals # noqa
# -*- coding: utf-8 -*- """ meraki_sdk This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ). """ class UpdateOrganizationBrandingPoliciesPrioritiesModel(object): """Implementation of the 'updateOrganizationBrandingPoliciesPriorities' model. TODO: t...
import React from 'react' import styled from '@emotion/styled' import { themeFunc, ITheme } from '../../../theme' import Paragraph from '../../atoms/Paragraph' interface Props { siteTitle: string siteContact: { email: string phone: string address: string orgnr: string } } const Footer = ({ sit...
<reponame>Kanaderu/spiking-ddpg-mapless-navigation /** * @file /include/ecl/devices/modes.hpp * * @brief Device modes. * * @date October, 2009 **/ /***************************************************************************** ** Ifdefs *****************************************************************************/...
<reponame>benkiel/guidetool from mojo.roboFont import OpenWindow from guideTool.defaults import GuideToolDefaultsWindowController OpenWindow(GuideToolDefaultsWindowController)
<reponame>connect-foundation/2019-08 import React, { useState } from "react"; import styled, { css } from "styled-components"; import { CustomLoginInput } from "presentation/components/atomic-reusable/custom-login-input"; import { CustomButton } from "presentation/components/atomic-reusable/custom-button"; import { App...
<gh_stars>1-10 import pickle from datetime import datetime import pandas as pd from fastapi import FastAPI with open("model.pkl", "rb") as f: model_pipeline = pickle.load(f) app = FastAPI() @app.get("/predict") def predict( pickup_latitude: float, pickup_longitude: float, dropoff_latitude: float, ...
/* * * tree1.hpp * * Created on: Jan 18, 2015 * Author: nachshonc */ #pragma once #include "Tree.hh" #include <string> #include <iostream> #include <vector> using namespace std; class NoLockHelper{ public: struct node{ unsigned key; node *left, *right; void *obj; }; node *head; bool search(unsigne...
<filename>utils/training/learning_rate_controller.py #! /usr/bin/env python # -*- coding: utf-8 -*- """Decay learning rate per epoch.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function class Controller(object): """Controll learning rate per epoch. ...
import { Controller } from '@nestjs/common'; import {Category} from './category.entity'; import {ApiTags} from '@nestjs/swagger'; import {CategoryService} from './category.service'; import {Crud} from '@nestjsx/crud'; @Crud({ model: { type: Category, }, routes: { // only: ['getOneBase', 'ge...
#!/usr/bin/python3 """module containing class for proxy_lists """ import requests class Proxy_List: """proxy list class for use in generating custom lists of proxies currently only works with provided url, using non default produces unknown behavior """ default_url = "https://raw.githubus...
<reponame>rposcro/inthi-console enum ApplianceClass { OnOffAppliance = 'OnOffAppliance', RGBWAppliance = 'RGBWAppliance' } export default ApplianceClass;
<gh_stars>0 import { Test, TestingModule } from '@nestjs/testing'; import { RoutingController } from './routing.controller'; describe('Routing Controller', () => { let controller: RoutingController; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ controllers: [Rou...
import Koa from 'koa'; import bodyParser from 'koa-bodyparser'; import Router from 'koa-router'; import { ApplicationService } from './services/application.service'; export const appService: ApplicationService = new ApplicationService(); export const app = new Koa(); const router = new Router(); router.get(/.*/gmi,...
<gh_stars>100-1000 from .torch_text import NamedField __all__ = [NamedField]
<gh_stars>1-10  #include "CollisionObject.hpp" #include "../../ComponentEngine/GameObject.hpp" #include "../../ComponentEngine/IScene.hpp" namespace ComponentEngine::Collision { void CollisionObject::Start() { auto x = GetGameObject().lock()->GetScene().lock(); auto& y = x->GetCollisionSystem(...
<filename>scrapy stuff/scrapyWithProxy/scrapyWithProxy/spiders/scraper.py # -*- coding: utf-8 -*- from scrapy import Request, Spider class Scraper(Spider): name = u'scraper' def start_requests(self): """This is our first request to grab all the urls of the profiles. """ yield Request(...
<gh_stars>10-100 #include <L/src/container/Array.h> #include <L/src/dev/test.h> #include <L/src/math/Rand.h> #include <L/src/stream/StringStream.h> #include <L/src/text/String.h> #include <L/src/time/Timer.h> using namespace L; constexpr uintptr_t iterations = 1 << 20; constexpr size_t max_block_size = 1 << 18; const...
<reponame>carlesfelix/2mixxx import ControlledFieldProps from "../../../types/ControlledFieldProps"; export type BaseInputTextProps = { disabled?: boolean; placeholder?: string; className?: string; }; export type InputTextProps = ControlledFieldProps<BaseInputTextProps>;
<filename>EntityComponentSystem/Core/Core/Vao.cpp<gh_stars>0 #include "Vao.hpp" renderer::Vao::Vao(GLenum mode, GLsizei vertexCount) : _mode(mode), _vertexCount(vertexCount) { glGenVertexArrays(1, &_vao); } renderer::Vao::Vao(Vao&& other) noexcept : _vao(other._vao), _vbos(std::move(other._vbos)), _mode(other._...
#pragma once #include <bts/blockchain/exceptions.hpp> #include <bts/blockchain/operations.hpp> namespace bts { namespace blockchain { /** * @class operation_factory * * Enables polymorphic creation and serialization of operation objects in * an manner that can be extended by derived chains. ...
export const capitalize = (str: string) => { if(!str) return str; return str.charAt(0).toUpperCase() + str.slice(1); }
<reponame>achilex/MgDev<gh_stars>1-10 // // Copyright (C) 2004-2011 by Autodesk, Inc. // // This library is free software; you can redistribute it and/or // modify it under the terms of version 2.1 of the GNU Lesser // General Public License as published by the Free Software Foundation. // // This library is distr...
# Copyright © 2019 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 required by applicable law or agr...
<gh_stars>1-10 import logging import joblib import numpy as np import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.preprocessing import LabelEncoder logging.basicConfig(format="%(asctime)-15s %(levelname)s %(message)s", level=loggi...
<gh_stars>1-10 import { APP_PLUGIN, IACMessageTransport, LanguageService, ProtocolService, SPLASH_SCREEN_PLUGIN, STATUS_BAR_PLUGIN } from '@airgap/angular-core' import { NetworkType, TezosProtocolNetwork, TezosSaplingExternalMethodProvider } from '@airgap/coinlib-core' import { TezosSaplingProtocolOptions...
<gh_stars>0 /** * Copyright 2022. TIBCO Software Inc. * This file is subject to the license terms contained * in the license file that is distributed with this file. */ import { flags } from '@oclif/command' import { chalk, TCBaseCommand, ux } from '@tibco-software/cic-cli-core'; import { join } from 'path'; import...
import { Button, PageHeader } from 'antd'; import React, { useEffect, useState } from 'react'; import { useHistory, useLocation, matchPath, Link } from 'react-router-dom'; import config from 'shogunApplicationConfig'; // import ImageFileEditForm from '../ImageFileEditForm/ImageFileEditForm'; import ImageFileT...
<gh_stars>0 import { Redirect, Route } from 'react-router-dom'; import { IonApp, IonRouterOutlet } from '@ionic/react'; import { IonReactRouter } from '@ionic/react-router'; import { Helmet } from "react-helmet"; import Home from './pages/Home'; /* Core CSS required for Ionic components to work properly */ import '@i...
def f(x): import math return 10*math.e**(math.log(0.5)/5.27 * x) def radiationExposure(start, stop, step): ''' Computes and returns the amount of radiation exposed to between the start and stop times. Calls the function f (defined for you in the grading script) to obtain the value ...
<reponame>Codesee-io/snyk export function summariseErrorResults(errorResultsLength: number): string { const projects = errorResultsLength > 1 ? 'projects' : 'project'; if (errorResultsLength > 0) { return ( ` Failed to test ${errorResultsLength} ${projects}.\n` + 'Run with `-d` for debug output and ...
<reponame>Brendon3578/Letmeask import { useState, useEffect } from "react" export function useLoading() { const [loading, setLoading] = useState(true) useEffect(() => { const loadingTimer = setTimeout(() => setLoading(false), 2500); return () => (clearTimeout(loadingTimer)) }, []) return { loading }...
<gh_stars>1-10 from urllib import unquote from tornado.web import authenticated from amgut.handlers.base_handlers import BaseHandler from amgut.connections import ag_data from amgut.lib.mail import send_email from amgut import text_locale class ChangePasswordHandler(BaseHandler): @authenticated def get(self)...
import { inject, TestBed } from '@angular/core/testing'; import { MockBackend } from '@angular/http/testing'; import { HttpModule, Http, Response, ResponseOptions, XHRBackend } from '@angular/http'; import { ConfigService } from './config.service'; describe('ConfigService', () => { beforeEach(() => { T...
<reponame>NGXTDN/webvirtcloud # Generated by Django 2.2.12 on 2020-06-04 09:30 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0002_permissionset'), ] operations = [ migrations.AlterField( ...
// Copyright 2017-2020 @polkadot/react-components authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; import { UInt } from '@pol...
<reponame>HPytkiewicz/UkladyRownan<gh_stars>0 #ifndef WEKTOR_HH #define WEKTOR_HH #include "rozmiar.h" #include <iostream> class Wektor { double tab[ROZMIAR]; public: Wektor(); Wektor(double x, double y, double z); Wektor(double *tab); Wektor(const Wektor & Wektor2); const double & operator[] (int ...
<reponame>mgenware/batch-include-guards import * as assert from 'assert'; import copyToTmp from 'copy-dir-to-tmp'; import { execSync } from 'child_process'; import dirToObj from 'dir-contents-object'; import * as nodepath from 'path'; it('Relative to root', async () => { const newDir = await copyToTmp('./tests/data'...
import {Order} from "../src/entities/order"; import {RestarauntFactory} from "../src/entities/restaraunt-factory"; import {Bill} from "../src/entities/equipment/bill"; test('Test that bill contains the same dishes', done => { let restarauntFactory = new RestarauntFactory(); let restaraunt = restarauntFactory.cre...
<reponame>dwjohnston/advancedish-typescript<gh_stars>0 //https://stackoverflow.com/questions/60273099/define-an-array-has-having-a-mandatory-value-plus-optional-others export type Role = "staffroom_access" | "sportsroom_access"; type Teacher = { name: string; privileges: ["staffroom_access", ...Role[]]; } ...
a = int (input(' enter the first number ')) b = int (input('enter the second number ')) z = a + b print(a+b)
/** shader.cpp **/ #include "shader.hpp" #include <iostream> #include <fstream> #include <cstring> enum { PROGRAM, SHADER }; //Function for printing shader and shader program logs //Used to reveal possible bugs in shader code void print_shader_log(const GLuint obj, const unsigned char type) { int log_length; if(t...
<filename>src/containers/Game/styles.ts import { makeStyles } from "@material-ui/core/styles"; const useStyles = makeStyles(theme => ({ root: { display: 'grid', gridTemplateColumns: "auto", gridColumnGap: 24, gridRowGap: 0, padding: '0px 36px', gridAutoFlow: 'column', [theme.breakpoints....
<reponame>uk-gov-mirror/nhsdigital.electronic-prescription-service-api #!/usr/bin/env python3 """ yaml2json.py Takes yaml file input and writes json file of the same name in the specified directory, converting dates correctly. Usage: yaml2json.py YAML_FILE OUT_DIR """ import json import os import os.path import da...
/* tslint:disable */ /* eslint-disable */ /** * Sifchain - gRPC Gateway docs * A REST interface for state queries, legacy transactions * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech ...
// Mo's Algorithm for answering offline queries // Time complexity: O(N*sqrt(N)) // Application in D-query problem (https://www.spoj.com/problems/DQUERY/) // For each query (l, r), count the number of distinct numbers in the range [l, r] #include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; const in...
import { Model, Document } from "mongoose"; import { findByLevelAndIndex, findZeros, findRoot, getTotalNumberOfLeaves, getAllLeaves, findLeafByGroupIdAndHash, findLeafByGroupIdAndIndexInGroup, findLeafByHash } from "./merkle_tree.statics"; export interface IMerkleTreeNodeKey { group...
<reponame>Dog-Egg/smooth-autojs export type LocationName = 'start' | 'end' export type Location = { packageName?: string version?: | string | number | Array<string | number> | ((version: { name: string, code: number }) => {}) view?: (context: { activity: string }) => boolean ...
<reponame>tmayr/-twilio-frame-ui export { CircularProgressThemeProps, CircularProgressProps, CircularProgress } from "./CircularProgress";
from copy import deepcopy from functools import partial from typing import List from codemate import Block, ClassMethod, Function, Method, StaticMethod from tests import utils _API_STRUCTURE = [ {"operation_name": "get_x", "return_value": "List[int]"}, {"operation_name": "get_y", "return_value": "str"}, {...
/** * Resolves once the document ready state is 'complete'. */ export default function pageIsLoaded(): Promise<void> { return new Promise(resolve => { if (document.readyState === 'complete') { resolve(); } else { window.addEventListener('load', () => resolve(), { once: true...
#define _doc_SelectionList_len \ "Returns the number of items on the selection list." #define _doc_SelectionList_add \ "The first version adds to the list any nodes, DAG paths, components\n"\ "or plugs which match the given the pattern string.\n"\ "\n"\ "The second version adds the specific item to...
<reponame>Harshita-Raj/greyatom-python-for-data-science<filename>python/code.py # -------------- # Code starts here class_1 = ['<NAME>','<NAME>','<NAME>','<NAME>'] class_2 = ['<NAME>','<NAME>','<NAME>'] new_class = class_1 + class_2 print(new_class) new_class.append('<NAME>') print(new_class) new_class.remove('<NAME>')...