text
stringlengths
1
1.05M
import { KeyboardEvent } from 'react'; const clickOnEnter = <T extends HTMLElement>(event: KeyboardEvent<T>): void => { if (event.key === 'Enter') { const target = event.target as T; target.click(); } }; export default clickOnEnter;
prime_list = [] # loop through numbers 0-50 for num in range(0,51): # check if number is prime if num > 1: for i in range(2,num): if (num % i) == 0: break else: prime_list.append(num) # print prime list print(prime_list) # prints [2, 3, 5, 7, 11, 13, 17, 19, 23...
<reponame>bradpurchase/grocerytime-backend<filename>internal/pkg/gql/resolvers/recipes.go<gh_stars>1-10 package resolvers import ( "github.com/bradpurchase/grocerytime-backend/internal/pkg/auth" "github.com/bradpurchase/grocerytime-backend/internal/pkg/meals" "github.com/graphql-go/graphql" ) // RecipesResolver re...
package com.mera.callcenter.entities; import java.util.UUID; /** * It represents the call */ public class Call { private UUID id; private long duration; public static long MIN_DURATION = 5; public Call(long duration) { this.duration = duration; this.id = UUID.randomUUID(); } ...
const getItem = (arr, index) => arr[index]; getItem([10, 15, 20], 1); // returns 15;
<gh_stars>0 'use strict'; const structure = require('./stacks-and-queues'); const Queue = structure.Queue; class AnimalShelter { constructor(){ this.number = 0; this.dogs = new Queue(); this.cats = new Queue(); } enqueueAnimal(animal){ if(animal.type === 'cat'){ this.cats.en...
<reponame>flvani/site-hostinger /* * 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. */ if (!window.SITE) window.SITE = {}; window.dataLayer = window.dataLayer || []...
<gh_stars>1-10 package procesamientoOrdenes; import javax.swing.*; public class Main { public static void main(String[] args){ SwingUtilities.invokeLater(new Runnable() { @Override public void run() { JFrame frame = new View(); frame.setSize(1400,6...
class Queue: def __init__(self): self.queue = [] def enqueue(self, data): self.queue.append(data) def dequeue(self): if len(self.queue) == 0: print("Queue empty") else: element = self.queue[0] del self.queue[0] return elem...
<gh_stars>0 # Be sure to restart your server when you modify this file. DeviseExample::Application.config.session_store :cookie_store, key: '_devise_example_session'
# views.py from django.shortcuts import render from .models import Item # Assuming there is a model named Item def home_view(request): items = Item.objects.all() # Retrieve all items from the database return render(request, 'home.html', {'items': items}) # urls.py from django.urls import path from .views im...
# Sample usage of the Game class # Create a game instance game = Game(player_one_position=0, player_two_position=0, max_score=10, player_one_score=0, player_two_score=0) # Move players and update scores game.move_player_one(3) game.move_player_two(2) game.move_player_one(8) game.move_player_two(5) # Get player positi...
/* * Copyright 2013-2016 iNeunet OpenSource and 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 * * http://www.apache.org/licenses/LICENSE-2.0 * ...
<filename>src/com/github/teocci/camera/console/util/Debug.java<gh_stars>0 package com.github.teocci.camera.console.util; /** * Created by teocci. * * @author <EMAIL> on 2017-May-19 */ public class Debug { public static int DEBUG = 1; public static void log(String msg) { if ( DEBUG == 1 ) { ...
import { GetterTree } from "vuex" import { StateInterface } from "../index" import { NoteStateInterface } from "./state" const getters: GetterTree<NoteStateInterface, StateInterface> = {} export default getters
require File.expand_path('../../../../spec_helper', __FILE__) require File.expand_path('../../fixtures/classes', __FILE__) describe "UDPSocket.send" do before :each do @port = nil @server_thread = Thread.new do @server = UDPSocket.open begin @server.bind(nil, 0) @port = @server.ad...
namespace PrestaShop\Module\AutoUpgrade\TaskRunner\Rollback; use PrestaShop\Module\AutoUpgrade\TaskRunner\ChainedTasks; class RollbackTaskQueue { private $tasks; public function __construct() { $this->tasks = new \SplQueue(); } public function addTask($task) { $this->tasks->e...
#!/usr/bin/env bash set -e # Get the version from the environment, or try to figure it out. if [ -z $VERSION ]; then VERSION=$(awk -F\" 'TMCoreSemVer =/ { print $2; exit }' < version/version.go) fi if [ -z "$VERSION" ]; then echo "Please specify a version." exit 1 fi echo "==> Releasing version $VERSION..." ...
import subprocess def setup_and_run_codecov(env_name): try: # Step 1: Activate virtual environment activate_cmd = f'source .tox/{env_name}/bin/activate' subprocess.run(activate_cmd, shell=True, check=True) # Step 2: Install codecov package pip_install_cmd = 'pip install cod...
<reponame>jeffrey-xiao/acm-notebook /* Time: O(N) * Memory: O(N) */ #include <bits/stdc++.h> using namespace std; struct Edge { int dest, index; bool used; }; struct Euler { int N; vector<vector<Edge>> adj; vector<int> used; Euler(int N) : N(N), adj(N), used(N) {} void addEdge(int u, int v) { a...
#!/bin/bash SRC=$(dirname "$(readlink -f "$0")") ROOT=${SRC::-3} source $SRC/utils/global.sh # Create .log if it doesn't exist if [[ ! -f $ROOT.log ]]; then printf "" > $ROOT.log fi # Clear .log if it gets too long (keep only the last 256 lines) # Given no errors, the max file size is 7KB if [[ $(wc -l < $ROOT.l...
import { none, Option, some } from 'fp-ts/lib/Option'; import * as moment from 'moment'; import * as React from "react"; import range from "@util/range"; import { KeyAndDisplay, Select } from "./Select"; export interface DateTriPickerProps<U> { years: number[] monthID: string & keyof U, dayID: string & keyof U, ...
// (C) 2018 ETH Zurich, ITP, <NAME> and <NAME> template <class V, class M> inline void kernel_core(V& psi, std::size_t I, std::size_t d0, std::size_t d1, std::size_t d2, std::size_t d3, std::size_t d4, M const& m) { std::complex<double> v[2]; v[0] = psi[I]; v[1] = psi[I + d0]; std::complex<double> tmp[32] = {0.,...
#! /usr/bin/env sh php -n -c php.ini ./vendor/bin/phpunit -c phpunit.xml
package com.kinstalk.satellite.socket; import com.kinstalk.satellite.common.constant.ConstantSocket; import com.kinstalk.satellite.domain.packet.SocketPacket; import com.kinstalk.satellite.socket.manager.ManagerData; import com.kinstalk.satellite.socket.manager.ManagerHandler; import io.netty.bootstrap.Bootstrap; im...
class Stage { constructor(canvas) { this.canvas = canvas; this.width = this.canvas.width; this.height = this.canvas.height; this.ctx = canvas.getContext("2d"); } clear(color) { if (color) { this.ctx.save(); this.ctx.fillStyle = color; ...
// // CKCalendarCalendarView.h // MBCalendarKit // // Created by <NAME> on 4/10/13. // Copyright (c) 2013 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> #import "CKCalendarViewModes.h" #import "CKCalendarEvent.h" #import "CKCalendarDelegate.h" #import "CKCalendarDataSource.h" @interface CKCalendarVie...
// // Created by claul on 6/7/2020. // #ifndef RAYTRACINGINONEWEEKEND_COLOUR_H #define RAYTRACINGINONEWEEKEND_COLOUR_H #include "Vec3.h" #include "Ray.h" #include "../Assets/Collidables.h" #include <iostream> void write_colour(std::ostream& out, Colour pixel_colour, int samplesPerPixel) { // divide colours by t...
#!/bin/sh #sbatch --job-name=KQH_mlp --gres=gpu:1 --mem=65536 --cpus-per-task=4 --output=./output/output_train_mlp.out launch_train_mlp.sh python3 train.py
package com.md.appuserconnect.core.services.internal.statistics; import java.io.IOException; import java.io.PrintWriter; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequ...
# Ping Google Public DNS IP address. while true; do ping 8.8.8.8; done
#!/usr/bin/env bash set -e; if [ ! -f package.json ]; then echo "there is no package.json file in your PWD." >&2; false; // since there is no package.json file, probably should abort here fi map="$docker_r2g_fs_map" search_root="$docker_r2g_search_root" shared="$docker_r2g_shared_dir"; name="$docker_r2g_package...
import { SignInPayload } from 'app/pages/SignIn/types'; import { AdminSignInParams } from './types'; export const adminSignInAdapter = ( userPayload: SignInPayload, ): AdminSignInParams => { return { admin: { email: userPayload.email, password: <PASSWORD>, }, }; };
#pragma once #include <KAI/Core/Config/Base.h> #include <KAI/Core/Type/Number.h> #include "KAI/Core/Object/PropertyBase.h" #include "KAI/Core/Object/Label.h" KAI_BEGIN class AccessorBase : public PropertyBase { public: AccessorBase(Label const &F, Type::Number C, Type::Number N, bool is_system, typename MemberCr...
#!/bin/bash # Copyright (c) 2019 London Trust Media Incorporated # # This file is part of the Private Internet Access Desktop Client. # # The Private Internet Access Desktop Client is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free ...
export SPARK_HOME="/home/book/spark-3.2.0" export SPARK_PROG="/home/book/code/chap08/rank_product/rank_product_using_groupbykey.py" # export K=3 # export STUDY_1="/home/book/code/chap08/rank_product/sample_input/rp1.txt" export STUDY_2="/home/book/code/chap08/rank_product/sample_input/rp2.txt" export STUDY_3="/home/boo...
package com.nitro.nmesos.util import org.specs2.mutable.Specification import scala.util.Success class VersionUtilSpec extends Specification { "VersionUtil" should { "extract an expected version" in { VersionUtil.tryExtract("0.2.1") must be equalTo Success(List(0, 2, 1)) VersionUtil.tryExtract("1....
#!/bin/bash # This script is used to create releases for this plugin. This is mostly a helper script for the maintainer. echo "Enter the new version number (e.g. 1.2.1):" read version echo "Enter the Windows x64 release ZIP URL:" read windowsZIPURL echo "Enter the Linux x64 release ZIP URL:" read linuxZIPURL echo ...
# does quitting work? echo -en "q\n" | ./mer_fsm # does encoding work? echo -en "1\n2\n3\n4\n5\n6\n7\n" | ./mer_fsm # does reset encoding work? echo -en "1\n2\n3\n4\ns\n.\n5\n6\n7\n5\n6\n7\n8\n" | ./mer_fsm
# ----------------------------------------------------------------------------- # This file is part of the xPack distribution. # (https://xpack.github.io) # Copyright (c) 2019 Liviu Ionescu. # # Permission to use, copy, modify, and/or distribute this software # for any purpose is hereby granted, under the terms of t...
<filename>spring-redis/src/main/java/org/xman/nosql/Consumer.java<gh_stars>0 package org.xman.nosql; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import java.util.concurrent.TimeUnit; public class Consumer extends Thread { // inject the...
const mealItems = { 'Pizza': 5.00, 'Soda': 2.50, 'Salad': 4.50 }; const totalCost = Object.values(mealItems).reduce((total, num) => { return total + num; }, 0); console.log('Total cost of the meal: $' + totalCost); # Output: Total cost of the meal: $12.00
#!/usr/bin/env bash set -euo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" CHANNEL=${CHANNEL:-pytorch-nightly} PACKAGES=${PACKAGES:-pytorch} for pkg in ${PACKAGES}; do echo "+ Attempting to prune: ${CHANNEL}/${pkg}" CHANNEL="${CHANNEL}" PKG="${pkg}" "${DIR}/prune.sh" e...
/** * ychen * Copyright (c). */ package cn.edu.fudan.iipl.exception; import org.springframework.stereotype.Component; import cn.edu.fudan.iipl.enums.BlogExceptionEnum; /** * 全局Exception * @author racing * @version $Id: BlogException.java, v 0.1 Aug 8, 2015 4:18:46 PM racing Exp $ */ @Component public class Bl...
<gh_stars>0 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choos...
// Copyright 2019 Drone.IO Inc. All rights reserved. // Use of this source code is governed by the Drone Non-Commercial License // that can be found in the LICENSE file. package manager import ( "io/ioutil" "github.com/sirupsen/logrus" ) func init() { logrus.SetOutput(ioutil.Discard) }
<gh_stars>1-10 const RuleSet = require('./rule-set') class Symbol { constructor(grammar, key, rawRules) { // Symbols can be made with a single value, and array, or array of objects of (conditions/values) this.key = key this.grammar = grammar this.rawRules = rawRules this.baseRules = new RuleSet(...
#!/bin/bash echo Installing Dependencies... sudo apt install libgconf-2-4 libappindicator1 libc++1 -y wget -O discord.deb "https://discordapp.com/api/download?platform=linux&format=deb" sudo dpkg -i discord.deb rm discord.deb
#!/bin/bash java -jar -DinputMethod="mouse_touch" -DttsUrl="http://localhost/action/" -Djdk.gtk.version=2 -Dexec.mainClass=org.scify.memori.ApplicationLauncher memori-1.0-SNAPSHOT-jar-with-dependencies.jar
package org.quifft.output; import org.quifft.audioread.AudioReader; import org.quifft.fft.FFTComputationWrapper; import org.quifft.params.FFTParameters; import org.quifft.params.WindowFunction; import org.quifft.sampling.SampleWindowExtractor; import java.util.Iterator; /** * FFTStream computes an FFT on an audio f...
#!/bin/bash source /opt/azure/containers/provision_source.sh clusterInfo() { FIRST_MASTER_READY=$(kubectl get nodes | grep k8s-master | grep Ready | sort | head -n 1 | cut -d ' ' -f 1) if [[ "${FIRST_MASTER_READY}" == "${HOSTNAME}" ]]; then retrycmd_no_stats 3 5 120 kubectl cluster-info dump --namespa...
export { default } from "./CertificationAlert";
from typing import List, Dict, Union def filter_patients(patients: List[Dict[str, Union[str, int]]], criteria: str, value: Union[str, int]) -> List[Dict[str, Union[str, int]]]: if not patients: # If the input list of patients is empty, return an empty list return [] filtered_patients = [] for pat...
#!/bin/bash # Copyright 2015 The Kubernetes Authors All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
// Clock interface interface Clock { long time(); long tick(); } // Custom clock implementation class CustomClock implements Clock { @Override public long time() { return System.currentTimeMillis(); } @Override public long tick() { return SystemClock.elapsedRealtime(); ...
<filename>platforms/ios/www/plugins/com.wikitude.phonegap.WikitudePlugin/www/WikitudePlugin.js cordova.define("com.wikitude.phonegap.WikitudePlugin.WikitudePlugin", function(require, exports, module) { /** * Release date: January 25, 2017 */ var WikitudePlugin = function() { /** * This is the SDK Key, pr...
import { Component } from '@angular/core'; import { ComponentStructure } from 'ngx-guildy'; import { MyTextComponent } from './my-addable-component/my-text.component'; import { MyButtonComponent } from './my-button/my-button.component'; import { MyCardComponent } from './my-card/my-card.component'; import { MyFlexConta...
package com.onarandombox.multiverseinventories.share; import java.util.HashMap; import java.util.Map; /** * Indicates how a Sharable should be stored in the profile file. Serves as a lookup for finding a sharable based on * it's file tag. */ public final class ProfileEntry { private static final Ma...
<filename>pybf/visualization.py """ Copyright (C) 2020 ETH Zurich. All rights reserved. Author: <NAME>, ETH Zurich <NAME>, ETH Zurich 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 ...
import styled from 'styled-components' import { animated } from '@react-spring/web' export const Main = styled.div` cursor: pointer; color: #676767; -webkit-user-select: none; user-select: none; ` export const Container = styled.div` position: fixed; z-index: 1000; width: 0 auto; bottom: 30px; margi...
#!/bin/sh #SBATCH -A lu2020-2-7 #SBATCH -p lu # time consumption HH:MM:SS #SBATCH -t 10:00:00 #SBATCH -N 1 #SBATCH --tasks-per-node=1 # #SBATCH --exclusive # name for script #SBATCH -J snpla_sbc # controll job outputs #SBATCH -o lunarc_output/lunarc_output_snpla_sbc_%j.out #SBATCH -e lunarc_output/lunarc_output_sn...
#!/usr/bin/env bash # # Copyright (c) 2020 The Fujicoin 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 export HOST=i686-pc-linux-gnu export CONTAINER_NAME=ci_i686_centos_7 export DOCKER_NAME...
#!/bin/bash # Copyright Johns Hopkins University (Author: Daniel Povey) 2012. Apache 2.0. # Modified by Takafumi Moriya for Japanese speech recognition using CSJ. # This script is for scoring with morpheme. # begin configuration section. cmd=run.pl min_lmwt=5 max_lmwt=17 #end configuration section. [ -f ./path.sh ]...
class MyClass: def __init__(self, my_variable): self.my_variable = my_variable
function numberToWord(number) { let words = { 0: 'zero', 1: 'one', 2: 'two', 3: 'three', 4: 'four', 5: 'five', 6: 'six', 7: 'seven', 8: 'eight', 9: 'nine', 10: 'ten', 11: 'eleven', 12: 'twelve', 13: 'thir...
from django.db import models from yatranepal.models import Places class TravelPackage(models.Model): id = models.AutoField(primary_key=True) packageName = models.CharField(max_length=200) packageDesc = models.TextField() packageImage = models.ImageField(upload_to='packages/') packageSlug = models.C...
import math def calculateCircleArea(radius: float) -> float: return math.pi * radius ** 2
<reponame>oTkPoBeHuE/tindergram-bot import { Profile } from '../getProfile'; import { getMockedProfile } from './profile'; export const profiles = new Map<string, Profile>(); export function initializeMockedDB() { for (let i = 0; i < 100; i++) { const profile = getMockedProfile(String(i)); profile...
/* * Author: <NAME> * DFS Algorithm implementation in JavaScript * DFS Algorithm for traversing or searching graph data structures. */ function traverseDFS (root) { const stack = [root] const res = [] while (stack.length) { const curr = stack.pop() res.push(curr.key) if (curr.right) { stac...
<filename>src/main/java/ru/contextguide/yandexservices/exceptions/YDException.java package ru.contextguide.yandexservices.exceptions; import com.sun.org.slf4j.internal.Logger; import com.sun.org.slf4j.internal.LoggerFactory; class YDException extends Exception { private static final Logger log = LoggerFactory.get...
<filename>routing.js var history = ''; var routes = { '': 'home.html', '/': 'home.html', '#/home': 'home.html', '#/signin': 'signin.html', '#/blog': 'blog.html', '#/pricing': 'pricing.html', }; ...
datastr = "3,2,5,1,7,4,6" lst = datastr.split(',') lst = [int(x) for x in lst]
#include <iostream> using namespace std; int fibo(int n) { if (n <= 1) return n; return fibo(n - 1) + fibo(n - 2); } int main() { int n = 25; cout << "The first "<< n <<" Fibonacci numbers are : "; for (int i = 0; i < n; i++) cout << fibo(i) << " "; return 0; }
<filename>imagenet_results/imagenet_p/test.py<gh_stars>10-100 """ Code modified from here: https://github.com/hendrycks/robustness/blob/master/ImageNet-P/test.py """ from scipy.stats import rankdata import torch.backends.cudnn as cudnn import torch.nn.functional as F import torchvision.datasets as dset import torchvis...
def fibonacci_generator(): a = 0 b = 1 while True: yield a a, b = b, a + b
import { Defined } from "./Defined"; import { Using } from "./Using"; /** */ export interface DefinedUsing<T> extends Defined<T>, Using<T> {} /** */ export namespace DefinedUsing { /** * * @param using * @param defined * @returns */ export function create<T>(using: T[] | undefined = undefined, defi...
<reponame>gertjandemulder/comunica import type { IActorQueryOperationOutputUpdate } from '@comunica/bus-query-operation'; import { KEY_CONTEXT_READONLY } from '@comunica/bus-query-operation'; import { ActionContext, Bus } from '@comunica/core'; import { ArrayIterator } from 'asynciterator'; import { DataFactory } from ...
<reponame>annio-lab/annio-client-ui<filename>src/app/utils/app-util.ts export class AppUtils { static AppName = process.env.APP_NAME ?? '-'; static AppVersion = process.env.APP_VERSION ?? '-'; static AppIcon = process.env.APP_ICON ?? '-'; static AppDescription = process.env.APP_DESCRIPTION ?? ''; }
/*\ module-type: relinkwikitextrule Handles replacement of filtered transclusions in wiki text like, {{{ [tag[docs]] }}} {{{ [tag[docs]] |tooltip}}} {{{ [tag[docs]] ||TemplateTitle}}} {{{ [tag[docs]] |tooltip||TemplateTitle}}} {{{ [tag[docs]] }}width:40;height:50;}.class.class This renames both the list and the temp...
/**Note on screen resolutions - See: http://www.itunesextractor.com/iphone-ipad-resolution.html * Tests will be run on these resolutions: * - iPhone6s - 375x667 * - iPad air - 768x1024 * - Desktop - 1920x1080 * * beforeEach will set the mode to Desktop. Any tests requiring a different resolution will must set ex...
var _neon_mem_copy_tests_8cpp = [ [ "BOOST_AUTO_TEST_CASE", "_neon_mem_copy_tests_8cpp.xhtml#a2abcf0adfa16189f3bfd9bcea4fbe2d8", null ], [ "BOOST_AUTO_TEST_CASE", "_neon_mem_copy_tests_8cpp.xhtml#a718b0bcc2cf75184b0bb5caebc833f4b", null ], [ "BOOST_AUTO_TEST_CASE", "_neon_mem_copy_tests_8cpp.xhtml#aa2efe1a9...
#!/usr/bin/env bash # Copyright 2020 Jian Wu # License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) set -eu stage="1-4" space="<space>" dataset=chime4 track="isolated_1ch_track" chime4_data_dir=/home/jwu/doc/data/CHiME4 wsj1_data_dir=/home/jwu/doc/data/wsj1 gpu=0 am_exp=1a epochs=60 num_workers=4 batch...
<gh_stars>0 import discord, os, json, asyncio from discord.ext import commands from discord_slash import SlashCommand def get_token(): a_file = open("no-move.json", "r") json_object_nm = json.load(a_file) a_file.close() token = str(json_object_nm['token']['bot']) return token bot = commands.Bot(co...
# rubocop:disable Metrics/LineLength # == Schema Information # # Table name: group_member_notes # # id :integer not null, primary key # content :text not null # content_formatted :text not null # created_at :datetime not null # updated_at ...
#!/usr/bin/env python # # Public Domain 2014-2017 MongoDB, Inc. # Public Domain 2008-2014 WiredTiger, Inc. # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compil...
<gh_stars>0 package cyclops.rxjava2.adapter.impl; import cyclops.container.persistent.PersistentCollection; import cyclops.rxjava2.companion.Functions; import cyclops.container.control.LazyEither; import cyclops.container.control.Maybe; import cyclops.container.control.Option; import cyclops.container.immutable.impl.S...
#!/usr/bin/env bash if [ "$#" -ne 4 ] then echo "Usage: deploy.sh CHART_DIR APP_NAME TARGET_ENV TARGET_VER" exit 1 fi CHART_DIR=$1 APP_NAME=$2 TARGET_ENV=$3 TARGET_VER=$4 VALUES=$CHART_DIR/$TARGET_ENV.yaml OFFLINE_COLOUR=$(kubectl get service/$TARGET_ENV-$APP_NAME-offline -o=jsonpath="{.spec.selector.colour}") i...
#!/bin/bash # # https://github.com/l-n-s/wireguard-install # # Copyright (c) 2018 Viktor Villainov. Released under the MIT License. WG_CONFIG="/etc/wireguard/wg0.conf" function get_free_udp_port { local port=$(shuf -i 2000-65000 -n 1) ss -lau | grep $port > /dev/null if [[ $? == 1 ]] ; then echo "...
<reponame>upasanachatterjee/zally-edits<filename>server/src/main/java/de/zalando/zally/dto/SeverityBinder.java package de.zalando.zally.dto; import de.zalando.zally.rule.api.Severity; import org.springframework.util.StringUtils; import java.beans.PropertyEditorSupport; public class SeverityBinder extends PropertyEdi...
import requests # API key api_key = '<API key>' # URL for the API url = "http://api.openweathermap.org/data/2.5/forecast" # Parameters parameters = { 'id': '3117732', # Madrid 'APPID': api_key, 'units': 'metric', 'cnt': 5 } # Make the request response = requests.get(url, params=parameters) # Get the response d...
#!/bin/bash -f #********************************************************************************************************* # Vivado (TM) v2020.1 (64-bit) # # Filename : fifo_generator_0.sh # Simulator : Aldec Active-HDL Simulator # Description : Simulation script for compiling, elaborating and verifying the p...
import Document, { Head, Main, NextScript } from "next/document"; import flush from "styled-jsx/server"; import { ServerStyleSheet } from "styled-components"; import Helmet from "react-helmet"; import configs from "configs"; export default class ReactConf extends Document { static async getInitialProps(...args) { ...
/*! * locale * Copyright(c) 2015 <NAME> * MIT Licensed */ 'use strict'; /** * Module dependences. */ var delegate = require('delegates'); /** * Expose * * @param {Object} app * @param {String} key - locale key name. * * @returns {Object} app */ module.exports = function(app, key) { key = key || 'loc...
from typing import List, Tuple def count_lenses(lens_phenomena: List[int]) -> Tuple[int, int]: positive_count = lens_phenomena.count(1) negative_count = lens_phenomena.count(0) return (positive_count, negative_count)
<filename>app/src/main/java/com/ulfy/master/ui/base/ContentView.java package com.ulfy.master.ui.base; import android.content.Context; import android.util.AttributeSet; import android.widget.FrameLayout; import com.ulfy.android.system.base.UlfyBaseView; import com.ulfy.android.ui_injection.Layout; import com.ulfy.andr...
#!/bin/sh set -e set -u set -o pipefail function on_error { echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" } trap 'on_error $LINENO' ERR 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...
impl iter::Iterator for Fib { type Item = u64; fn next(&mut self) -> Option<u64> { let result = self.one_back + self.current; self.one_back = self.current; self.current = result; Some(result) } }
#!/usr/bin/env bash set -euxo pipefail TARGET="nixos@108.61.117.242" STATIC_DIR="${PWD}/{{cookiecutter.project_slug}}/static_all" NIX_SSHOPTS="-o IdentityFile=~/.ssh/id_rsa_nixos" if [ ! -d "$STATIC_DIR" ]; then nix-shell --pure --run "source .env; ./manage.py collectstatic --no-input" fi PROFILE_PATH="$(nix-bu...
package com.siyuan.enjoyreading.widget; import android.content.Context; import android.text.TextUtils; import android.util.AttributeSet; import android.view.View; import android.widget.ImageView; import android.widget.ImageView.ScaleType; import android.widget.LinearLayout; import com.androidapp.utils.Densi...
const child_process = require('child_process'); const Web3 = require('web3'); const HDWalletProvider = require("truffle-hdwallet-provider"); var web3 = new Web3(); var environment = process.env.CRUCIBLE_ENV || 'development'; var provider; if (environment !== 'development') { var providerUrl; if (environment === ...