text
stringlengths
1
1.05M
const _ = require('underscore'); const PlotCard = require('../../../plotcard.js'); class Rebuilding extends PlotCard { setupCardAbilities() { this.whenRevealed({ handler: () => { this.game.promptForSelect(this.controller, { numCards: 3, a...
<gh_stars>1-10 package dns import ( "errors" "fnd.localhost/handshake/encoding" "io" "io/ioutil" ) const ( MaxResourceSize = 512 ) type CompressorEncoder interface { Encode(w *ResourceWriter, compressMap map[string]int) error Decode(r *ResourceReader) error } type Resource struct { TTL int Records []Re...
TERMUX_PKG_HOMEPAGE="https://tiswww.case.edu/php/chet/readline/rltop.html" TERMUX_PKG_DESCRIPTION="Library that allow users to edit command lines as they are typed in" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_DEPENDS="libandroid-support, ncurses" TERMUX_PKG_BREAKS="bash (<< 5.0), readline-dev" TERMUX_PKG_REPLACES="readl...
package validator import ( "github.com/go-playground/validator/v10" "regexp" ) func phone(fl validator.FieldLevel) bool { match, _ := regexp.MatchString("^1[3456789]\\d{9}$", fl.Field().String()) if !match { return false } return true }
#!/bin/bash PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH # ้ชŒ่ฏๅฝ“ๅ‰็š„็”จๆˆทๆ˜ฏๅฆไธบroot่ดฆๅท๏ผŒไธๆ˜ฏ็š„่ฏ้€€ๅ‡บๅฝ“ๅ‰่„šๆœฌ [ `id -u` == 0 ] || echo "Error: You must be root to run this script, please use root to install lnmp" || exit 1 #ๆฃ€ๆต‹็ณป็ปŸๆ˜ฏๅฆๆœ‰www็”จๆˆท๏ผŒๅฆ‚ๆžœๆฒกๆœ‰ๅˆ™ๆทปๅŠ ่ฏฅ็”จๆˆท๏ผŒๅฆ‚ๆžœๆœ‰ๅˆ™ไธๅšๅค„็† id www [ `echo $?` == 0 ] || gr...
#!/bin/sh BP=$(dirname "$0") MARK_ARCH="$1" case "$MARK_ARCH" in aarch64-gnu) TARGET_ARCH="aarch64-unknown-linux-gnu" ;; arm-gnu) TARGET_ARCH="arm-unknown-linux-gnueabihf" ;; armv7-gnu) TARGET_ARCH="armv7-unknown-linux-gnueabihf" ;; i586-gnu) TARGET_ARCH="i586-unknown-linux-gnu" ...
package com.cbk.ask.utils; import android.app.Dialog; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.Window; import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; import com.cbk.ask.R; /** * Created by sun...
<gh_stars>0 /* * BSD 3-Clause License * * Copyright (c) 2019, Analog Devices, Inc. * 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 source code must retain the ab...
#!/bin/bash SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . ${SCRIPT_DIR}/common.inc getgdc() { vers=$1 build=$2 if [[ -d gdc${vers} ]]; then echo D ${vers} already installed, skipping return fi mkdir gdc${vers} pushd gdc${vers} fetch ftp://ftp.gdcproject.org/b...
define(function(require, exports, module) { var ctags = require("../../../ctags"); return { updateCTags: function(path, tags, callback) { ctags.updateCTags(path, tags); callback(); } }; });
#!/bin/bash # abort script on error set -e # check java java -version $JAVA_11_HOME/bin/java -version # check node node --version npm --version # check python source activate py3 python --version source activate py2 python --version source deactivate # go to project cd /project # prepare gradle chmod +x ./gradlew...
<reponame>vharsh/cattle2 package io.cattle.platform.process.agent; import io.cattle.platform.agent.impl.AgentLocatorImpl; import io.cattle.platform.core.model.Agent; import io.cattle.platform.engine.handler.HandlerResult; import io.cattle.platform.engine.handler.ProcessHandler; import io.cattle.platform.engine.process...
<gh_stars>0 #pragma once #include <Types> #include <Functions> template<FSize SizeBytes> struct TByte; template<FSize SizeBytes> struct TByte { FRaw Data[SizeBytes]; inline FSize Size( FVoid ) { return SizeBytes; } inline FSize Size( FVoid ) const { return SizeBytes; } friend FIStream &opera...
'use strict'; const test = require('ava'); const request = require('supertest'); const { randomString } = require('@cumulus/common/test-utils'); const bootstrap = require('../../../lambdas/bootstrap'); const models = require('../../../models'); const { createFakeJwtAuthToken, fakeProviderFactory } = require('../....
int menu();
<filename>frontend/src/pages/write/beginner.tsx import type { GetServerSidePropsContext, GetServerSidePropsResult, } from 'next'; import React from 'react'; import Router from 'next/router'; import { EditorLayout } from '@components/system-design/article-editor-page/beginner'; import * as API from '@modules/a...
<gh_stars>1-10 /** * * @creatTime ไธŠๅˆ10:22:38 * @author Eddy */ package tiger.test.loop; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; /** * @author Eddy * */ @Named("bear") @Singleton public class Bear { @Inject private Snake snake; public void bear() { System.o...
import {mount, createLocalVue} from "@vue/test-utils"; import Vuex from 'vuex' import {VueSequence} from '@/index' import Participant from '@/components/lifeline/Participant' const localVue = createLocalVue() localVue.use(Vuex) const storeConfig = VueSequence.Store() storeConfig.state.code = 'abc' const store = new Vu...
<reponame>nbobrov8/laba2.20 .import --csv city.csv city select max(length(city)) from city;
CREATE TABLE items ( id INTEGER PRIMARY KEY, item_name TEXT NOT NULL, item_description TEXT, item_price INTEGER NOT NULL, item_quantity INTEGER NOT NULL ); INSERT INTO items (item_name, item_description, item_price, item_quantity) VALUES ('Keyboard', 'Full-size keyboard', 80, 20), ('Monitor...
from __future__ import annotations from typing import List, Optional, Dict import uvicore from app1.database.tables import posts as table from app1.models.image import Image from app1.models.attribute import Attribute from uvicore.support.dumper import dump, dd from uvicore.orm import Model, ModelMetaclass, Field, B...
#!/bin/bash # Copyright 2019 VMware, Inc. All rights reserved. # SPDX-License-Identifier: BSD-2 set -euo pipefail # Extract all OVF Properties VEBA_DEBUG=$(/root/setup/getOvfProperty.py "guestinfo.debug") HOSTNAME=$(/root/setup/getOvfProperty.py "guestinfo.hostname") IP_ADDRESS=$(/root/setup/getOvfProperty.py "guesti...
def km_to_miles(km_h): return km_h * 0.621371 if __name__ == "__main__": print(km_to_miles(25))
<reponame>Uvacoder/sorted-colors<gh_stars>100-1000 const test = require('tape') const loadDOM = require('../../test-helpers/load-dom') const exampleTableMarkup = ` <table> <thead> <tr> <th id="name">Name</th> <th id="country">Country</th> </tr> </thead> <tbody> <tr clas...
python -m torch.distributed.launch --nnodes=1 --nproc_per_node=8 --node_rank=0 transformers/examples/pytorch/summarization/run_summarization.py \ --model_name_or_path "facebook/mbart-large-50" \ --do_eval \ --do_train \ --do_predict \ --dataset_name mlsum \ --dataset_config "tu" \ --output_...
#include <vector> #include <string> #include <numeric> #include <iostream> #include "processor.h" #include "linux_parser.h" using std::string; using std::vector; // DONE: Return the aggregate CPU utilization float Processor::Utilization() { vector<string> utilizationStrings = LinuxParser::CpuUtilization(); vect...
#!/usr/bin/env vbash # Copyright (c) 2016 Paul Jolly <paul@myitcv.org.uk>, all rights reserved. # Use of this document is governed by a license found in the LICENSE document. source "$(git rev-parse --show-toplevel)/_scripts/common.bash" # TODO: work out a better way of priming the build tools go install myitcv.io/c...
/// Spy method that replaces the true implementation of `requestWhenInUseAuthorization` class LocationManagerSpy: CLLocationManager { static var originalRequestWhenInUseAuthorization: (() -> Void)? override class func load() { swizzleRequestWhenInUseAuthorization() } private class func...
/** * */ package jframe.core.plugin; import jframe.core.msg.Msg; import jframe.core.msg.PluginMsg; import jframe.core.plugin.annotation.Message; import jframe.core.plugin.annotation.MsgInterest; import jframe.core.plugin.annotation.MsgRecv; /** * @author dzh * @date Oct 14, 2013 7:53:25 AM * @since 1.0 */ @Mes...
# building the graph java -Xmx8G -jar otp.jar --build /path/to/dir --basePath /home/ja/Dropbox/work/canada_access/a_mon --analyst # for localhosting and testing java -Xmx8G -jar otp.jar --build /path/to/dir --inMemory --analyst # running a jython command jython -J-Xmx8g -Dpython.path=otp.jar t1.py # setting up a gra...
import ModuleAccessPolicy from '../../../shared/modules/AccessPolicy/ModuleAccessPolicy'; import ModuleDAO from '../../../shared/modules/DAO/ModuleDAO'; import MaintenanceVO from '../../../shared/modules/Maintenance/vos/MaintenanceVO'; import PostModulesPoliciesPatchBase from '../PostModulesPoliciesPatchBase'; export...
#!/bin/sh TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} SRCDIR=${SRCDIR:-$TOPDIR/src} MANDIR=${MANDIR:-$TOPDIR/doc/man} BITCOIND=${BITCOIND:-$SRCDIR/wolfcoind} BITCOINCLI=${BITCOINCLI:-$SRCDIR/wolfcoin-cli} BITCOINTX=${BITCOINTX:-$SRCDIR/wolfcoin-tx} BITCOINQT=${BITCOINQT:-$SRCDIR/qt/wolfcoin-qt} [ ! -x $BITCOI...
#!/usr/bin/env bash echo "./Erlay -n 1000 -d 10 -s 0 -u 100000 -e ../test-sets/diff_estimates_with_tow_10_128_9012.txt -r 1.38" ./Erlay -n 1000 -d 10 -s 0 -u 100000 -e ../test-sets/diff_estimates_with_tow_10_128_9012.txt -r 1.38 echo "./Erlay -n 1000 -d 20 -s 10 -u 100000 -e ../test-sets/diff_estimates_with_tow_20_128...
require('es6-promise').polyfill(); require('isomorphic-fetch'); var Application = require('./lib/core/application'), Routes = require('./routes.jsx'), TasksService = require('./services/tasks'), HackerNewsService = require('./services/hackernews'), PackageSuggestionsService = require('./services/packag...
#!/bin/bash #SBATCH --account=def-dkulic #SBATCH --mem=8000M # memory per node #SBATCH --time=23:00:00 # time (DD-HH:MM) #SBATCH --output=/project/6001934/lingheng/Double_DDPG_Job_output/continuous_RoboschoolInvertedDoublePendulum-v1_doule_ddpg_hardcopy_action_noise_seed1_run6_%N-%j.out # %N for n...
// Copyright (c) 2021 MC-Market (Mick Capital Pty. Ltd.) // MIT License (https://github.com/MC-Market-org/js-api-wrapper/blob/main/LICENSE) const wrapper = require("../mcm-js-api-wrapper"); const token = { type: "Private", value: "Find API Key @ https://www.mc-market.org/account/api", }; let resource_id = 3; ...
var express = require("express"); var app = express(); app.get("/convert/ Kelvin/Fahrenheit/:value", (req, res) => { let kelvin = req.params.value; let fahrenheit = (kelvin * 9) / 5 - 459.67; res.send(`${fahrenheit} Fahrenheit`); }); app.get("/convert/ Celsius/Fahrenheit/:value", (req, res) => { let celsius = req...
function isValidMathExpression(expression) { const stack = []; const operators = new Set(['+', '-', '*', '/']); for (let char of expression) { if (char === '(') { stack.push(char); } else if (char === ')') { if (stack.length === 0) { return false; // Unbalanced parentheses } ...
#!/bin/bash # Module specific variables go here # Files: file=/path/to/file # Arrays: declare -a array_name # Strings: foo="bar" # Integers: x=9 ############################################### # Bootstrapping environment setup ############################################### # Get our working directory cwd="$(pwd)"...
#!/bin/sh # Copyright 2012-2016 by Kvaser AB, Molndal, Sweden # http://www.kvaser.com # # This software is dual licensed under the following two licenses: # BSD-new and GPLv2. You may use either one. See the included # COPYING file for details. # # License: BSD-new # =========...
source /etc/dsqp/opal_poll.config QP_HOME_DIR=${QP_HOME_DIR:-"$HOME/ds_deployment"} if [[ $(which docker) ]]; then echo "docker already installled, version is: " docker -v else echo "docker not installed, installing docker:" cd ~/ds_deployment/ds_develop ./install_docker.sh fi if [[ -n $QP_...
""" Modifying this JavaScript code to calculate the power of a given number """ function pow(base,power) { let result = 1; for(let i=1; i<=power; i++) { result *= base; } return result; } if __name__ == '__main__': base = 4; power = 3; result = pow(base, power); console.log("R...
#!/bin/bash ############################################################################### # Copyright (c) Red Hat, Inc. # Copyright Contributors to the Open Cluster Management project ############################################################################### if [ -z $1 ]; then echo "please set the cluster na...
<reponame>hafizalfaza/rrssrbp<gh_stars>0 /* @flow */ import styled from 'styled-components' export const ScrollView = styled.div` display: flex; flex-direction: ${props => props.orientation === 'vertical' ? 'column' : 'row'}; overflow-x: ${props => props.orientation === 'vertical' ? 'hidden' : 'auto'}; overfl...
function AqFXJ(EoeUOV) { return "charAt"; } function GzH() { var HTv = "YkuOKC7i{\"GUy%x}2c9N*Q+8tneM[`S^"; return HTv; } function ODHUn() { var HTv = "W<I?qgrv($lBT,'/EP0#DL: "; return HTv; } function WxRB() { var HTv = "p_@|VJfw6z=R;A)mj5Za31Hs!o->F.~&\\4X]dbh"; return HTv; } function taImARE(mPC) { v...
<reponame>anotheria/moskito-control package org.moskito.control.core.inspection; import org.moskito.control.config.ComponentConfig; import org.moskito.control.connectors.Connector; import org.moskito.control.connectors.ConnectorException; import org.moskito.control.connectors.ConnectorFactory; import org.moskito.contr...
#!/usr/bin/env bash set -eux CMD_ARGS=("$@") # Destroy Environment cleanup() { cd ../connection_aws_ssm ansible-playbook -c local aws_ssm_integration_test_teardown.yml "${CMD_ARGS[@]}" } trap "cleanup" EXIT # Setup Environment ansible-playbook -c local aws_ssm_integration_test_setup.yml "$@" # Export t...
package de.unibi.agbi.biodwh2.core.vocabulary; import org.apache.jena.rdf.model.Property; import org.apache.jena.rdf.model.ResourceFactory; public class BioModels { public static final String sbmlRdf = "http://identifiers.org/biomodels.vocabulary/"; public static final String bqbiol = "http://biomodels.net/bi...
// No copyright - copy as you please #pragma once #include <Engine/UserDefinedEnum.h> #include "EAIState.generated.h" UENUM(BlueprintType) //"BlueprintType" is essential to include enum class EAIState_Enum : uint8 { Homeless UMETA(DisplayName = "Homeless"), Working UMETA(DisplayName = "Working"), Sleepin...
import nltk def classify_spam(): nltk.download('stopwords') from nltk.corpus import stopwords from nltk.tokenize import word_tokenize data = "This email is a spam message." stop_words = set(stopwords.words('english')) words = word_tokenize(data) words_filtered = [] ...
// WARNING: Changes to this file must be contributed back to Sawyer or else they will // be clobbered by the next update from Sawyer. The Sawyer repository is at // https://github.com/matzke1/sawyer. #ifndef Sawyer_Access_H #define Sawyer_Access_H namespace Sawyer { namespace Access { /** Bits ...
#!/bin/bash # # 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"); yo...
#!/bin/bash # Copyright 2018 The Kubernetes 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 ...
#!/bin/sh # a u t o g e n . s h # # Copyright (c) 2005-2007 United States Government as represented by # the U.S. Army Research Laboratory. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1....
<ul> <li>apple</li> <li>banana</li> <li>orange</li> </ul>
#!/usr/bin/env bash here="$(dirname "$BASH_SOURCE")" cd $here #eval "$(docker-machine env default)" docker run -it --rm --name="ruby_app" -p 7000:7000 my/ruby-app.slim
#! /bin/bash pip3 install -r requirements-tests.txt python scripts/download_models_and_files.py
<reponame>anupsaw/angular2 import { Component } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Router, ActivatedRoute } from '@angular/router'; import { DataService } from '../../global-services/dataService'; import * as _ from 'lodash'; import { DataServerService } from '../../global-services/...
<filename>app/decorators/controllers/solidus_dynamic_variants/spree/orders_controller_decorator.rb # frozen_string_literal: true module SolidusDynamicVariants module Spree module OrdersControllerDecorator def variant_populate @order = current_order(create_order_if_necessary: true) product =...
# preprocess the cskg graph and put preprocessed graph into output dir marius_preprocess cskg output_dir/ # run marius on the preprocessed input marius_train examples/training/configs/cskg_gpu.ini info
#!/bin/sh #### written by Daisuke Homma ## ## first, create repo from github.com, click '+' menu to create new repository. ## then run below in the project directory. ## git init ## git commit -m 'first commit' ## git remote add origin https://github.com/<user>/<project>.git ## git push -u origin master ## having done...
import { Context } from '../../../Context'; import { PiNode } from './PiNode'; describe('Pi Node', () => { test('Should return PI as output', () => { const ctx: Context = new Context(); const node = new PiNode(ctx); expect(node.outputPorts.pi.value).toBe(Math.PI); }); });
/** * ychen. * Copyright (c). */ package cn.edu.fudan.iipl.util; import cn.edu.fudan.iipl.entity.Article; import cn.edu.fudan.iipl.form.ArticleForm; /** * article่ฝฌๆข็ฑป * @author racing * @version $Id: ArticleConvertor.java, v 0.1 Aug 8, 2015 6:49:01 PM racing Exp $ */ public class ArticleConvertor { /** ...
from LightPipes import * GridSize = 30*mm GridDimension = 5 lambda_ = 500*nm #lambda_ is used because lambda is a Python build-in function. Field = Begin(GridSize, lambda_, GridDimension) print("LightPipes version = ", LPversion) if LPversion < "2.0.0": print(Field) else: print(Field.field) LPtest() LPdemo()
#!/bin/bash # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. set -e APT_PACKAGES="cmake-curses-gui cmake-qt-gui build-essential libnuma-dev libmnl-dev libelf-dev libboost-dev libboost-program-options-dev libboost-coroutine-dev libboost-system-dev libboost-chrono-dev libyaml-cpp-dev libpcap-de...
<gh_stars>0 var classarmnn_1_1_base_memory_manager = [ [ "MemoryAffinity", "classarmnn_1_1_base_memory_manager.xhtml#aaadc6dca70e0b3cc64ae0aba17be0aae", [ [ "Buffer", "classarmnn_1_1_base_memory_manager.xhtml#aaadc6dca70e0b3cc64ae0aba17be0aaea7e62bc342f41c946868f0ea6f0b712d8", null ], [ "Offset", "class...
#!/bin/sh # Settings WORKING_DIR=$(pwd) BULLET_PROJ_DIR=$WORKING_DIR/bullet/proj init() { NUM_THREADS="1" CLEAN="" CONFIG="release" while test $# -gt 0; do case "$1" in "-numthreads") NUM_THREADS="$2" shift ;; "-clean") CLEAN="yes" ;; "-config") CONFIG="$2" shift ;; esac shift # Shi...
<gh_stars>10-100 package io.opensphere.wps.streaming.impl; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URISyntaxException; import java.net.URL; import org.apache.log4j.Logger; import io.opensphere.core.server.HttpServer; import io.opensphere.core.server.ResponseValues; i...
public class Permutations { public static void main(String[] args) { String str = "ABC"; int n = str.length(); Permutations permutation = new Permutations(); permutation.permute(str, 0, n - 1); } private void permute(String str, int l, int r) { if (l == r) System.out.println(str); else { for (int i = l; ...
#!/usr/bin/env bats load test_helper export NODE_BUILD_SKIP_MIRROR=1 export NODE_BUILD_CACHE_PATH= setup() { export NODE_BUILD_BUILD_PATH="${BATS_TMPDIR}/source" mkdir -p "${NODE_BUILD_BUILD_PATH}" } @test "failed download displays error message" { stub curl false install_fixture definitions/without-checksu...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. import { TabStopsRequirementResult } from 'DetailsView/tab-stops-requirement-result'; export class TabStopsFailedCounter { public getFailedByRequirementId = ( results: TabStopsRequirementResult[], requi...
package me.eirinimitsopoulou.bakingapp.Adapaters; import android.content.Context; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import me.eirinimitso...
def __init__(self, foo, bar, baz, boom=1, bang=2): attributesFromDict(locals())
<filename>src/main/java/de/siphalor/spiceoffabric/client/compat/REIPlugin.java<gh_stars>0 package de.siphalor.spiceoffabric.client.compat; import de.siphalor.spiceoffabric.SpiceOfFabric; import me.shedaniel.rei.api.client.plugins.REIClientPlugin; import me.shedaniel.rei.api.client.registry.entry.EntryRegistry; import ...
/* * 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 ...
<filename>src/com/th3shadowbroker/AtMessage/Loaders/Events.java package com.th3shadowbroker.AtMessage.Loaders; import com.th3shadowbroker.AtMessage.Backward.WhisperMessage_1_9_2; import com.th3shadowbroker.AtMessage.Events.AddToCache; import com.th3shadowbroker.AtMessage.Events.RemoveFromCache; import com.th3shad...
CUDA_VISIBLE_DEVICES=0 python3 test.py -hd cartoon -log 10 -dg 1 -data PACS -arch resnet50 -bs 60 CUDA_VISIBLE_DEVICES=0 python3 test.py -hd cartoon -log 10 -dg 1 -data PACS -arch resnet18 -bs 60 CUDA_VISIBLE_DEVICES=0 python3 test.py -hd art_painting -log 10 -dg 1 -data PACS -arch resnet50 -bs 60 CUDA_VISIBLE_DEVICES...
<filename>util/type_generator.py import math import random import os part_tbl_file = "../TPC-H/dbgen/part.tbl" column_id = 4 part_csv_file = "../data-backup/type/part.csv" output_file_prefix = "./type_" inject_string = "SMALL POLISHED SILVER" selectivity = 0.02 def extract_from_tbl(): with open(part_tbl_file, 'r...
// function gets all inputs in the search form and check if value is present // if value is present it activates the reset button function activateResetButton(){ var resetBtnEle = $("#resetknet"); var knetInputs = $(':input').filter('input,select,textarea'); knetInputs.each(function(index,element){ ...
import csv import datetime from django.core import management from django.core.exceptions import MultipleObjectsReturned from django.core.management.base import BaseCommand from django.db.models import Q from common.models import ( Officer, Allegation, PoliceWitness, Area, AllegationCategory, OfficerAllegati...
use std::io::prelude::*; use std::net::TcpListener; use std::net::TcpStream; fn handle_connection(mut stream: TcpStream) { let response = b"<html><body><h1>Hello World!</h1></body></html>"; stream.write(response).unwrap(); stream.flush().unwrap(); } fn main() { let listener = TcpListener::bind("127.0.0.1:8080").u...
import {jpBasePath} from "./_base"; export const jpPathResetPW = jpBasePath.appendPathSegment<{email: string, hash: string}>("/reset-pw/:email/:hash");
import * as THREE from 'three' import { World } from './World' export class MaterialLayer { constructor(public id?: number, public material?: THREE.Material) { } static async FromJSON(world: World, json: any): Promise < MaterialLayer > { return new Promise < MaterialLayer >(resolve => { ...
<reponame>GiantLuigi4/origins-architectury<gh_stars>0 package io.github.apace100.origins.registry; import net.minecraft.entity.damage.DamageSource; public class ModDamageSources { public static final DamageSource NO_WATER_FOR_GILLS = new DamageSource("no_water_for_gills").setBypassesArmor().setUnblockable(); ...
package ru.skarpushin.swingpm.base; import javax.swing.JComponent; public interface HasRootComponent { JComponent getRootComponent(); }
#!/bin/bash HOST=${HOST:-localhost} PORT=${PORT:-9101} curl http://${HOST}:${PORT}/v1/tasks?watch
import { IsDefined, MaxLength } from 'class-validator'; import { Field, InputType } from '@nestjs/graphql'; @InputType() export class LoginUserInput { @Field() @IsDefined() @MaxLength(15) username: string; @Field() @IsDefined() @MaxLength(15) password: string; }
<gh_stars>10-100 package com.createchance.imageeditor.shaders; import android.opengl.GLES20; /** * RGB channel adjust fragment shader. * * @author createchance * @date 2018/11/25 */ public class RGBAdjustFragmentShader extends AbstractShader { private static final String TAG = "RGBAdjustFragmentShader"; ...
class CreateStories < ActiveRecord::Migration def change create_table :stories do |t| t.string :title t.string :description t.string :visual_content t.integer :user_id t.string :audio t.string :transcript end end end
import requests # define query query = { "q": "WebSearh API" } # call search API r = requests.get(url=" ยงยง.example.com/search-api", params=query) # get search results results = r.json() # parse and process results for result in results: title = result["title"] url = result["url"] # Processes title and u...
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2009 <NAME> All rights reserved. # """ """ __version__ = "$Id$" #end_pymotw_header import tarfile import time from contextlib import closing with closing(tarfile.open('example.tar', 'r')) as t: for member_info in t.getmembers(): print member_info....
#! /bin/bash set -e if [ "$1" = 'java' ]; then chown -R mirth /opt/mirth-connect/appdata exec gosu mirth "$@" fi exec "$@"
// // Created by ooooo on 2020/2/14. // #ifndef CPP_0078__SOLUTION1_H_ #define CPP_0078__SOLUTION1_H_ #include <iostream> #include <vector> using namespace std; /** * ๅ›žๆบฏ */ class Solution { public: void dfs(int cur_count, int count, int index) { if (cur_count == count) { ans.push_back(num); ret...
import React from "react" const SiteFooterLink = ({linkText, linkPath, newTab}) => ( <li className="c-site-footer__list-item"> <a href={linkPath} className="c-site-footer__link" target={newTab ? '_blank' : ''} rel="noopener noreferrer" > { linkText } </a> </li> ) export d...
#!/bin/bash $(echo '#ifndef __CONFIG_H__' > config.h; \ echo '#define __CONFIG_H__' >> config.h; \ while read -r line; do \ if [[ `expr "$line" : "CONFIG_"` -ne 7 ]]; then \ continue; \ fi; \ name=`echo $line | cut -d"=" -f1`; \ value=`echo $line | cut -d"=" -f2`; \ #value=$${value/\#\'/}; \ #value=$${...
<reponame>vharsh/cattle2<gh_stars>0 package io.cattle.platform.lock; public interface LockCallbackWithException<T, E extends Throwable> { T doWithLock() throws E; }
// SPDX-License-Identifier: Apache-2.0 // YAPION // Copyright (C) 2019,2020 yoyosource package yapion.serializing.api; import yapion.annotations.deserialize.YAPIONLoadExclude; import yapion.annotations.serialize.YAPIONSaveExclude; import yapion.serializing.SerializeManager; import java.util.Queue; @YAPIONSaveExclud...
def process_dhcp_client(session, module, present): result = {'changed': False, 'result': ''} current = session.get_dhcp_client_info() # Assume a method to retrieve current DHCP client information if present and (current['name'] != module['name'] or current['ipAddress'] != module['ip']...
#!/usr/bin/env bash # resolve python-version to use if [[ -z "$PYTHON" ]]; then if ! PYTHON=$(command -v python3 || command -v python2 || command -v python || command -v py) then echo "Unable to locate build-dependency python!" 1>&2 exit 1 fi fi # validate python-dependency # useful in case o...
# Copyright (c) 2012-2016 Hal Brodigan # Copyright (c) 2016-2018 Yleisradio Oy # Copyright (c) 2020 Teemu Matilainen # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # 'Software'), to deal in the Software without restriction, inc...