text
stringlengths
1
1.05M
<reponame>dishbreak/aoc-common<gh_stars>0 package lib_test import ( "testing" "github.com/dishbreak/aoc-common/lib" "github.com/stretchr/testify/assert" ) func TestNeighbors(t *testing.T) { p := lib.Point3D{} expected := []lib.Point3D{ lib.Point3D{X: -1, Y: -1, Z: -1}, lib.Point3D{X: -1, Y: -1, Z: 0}, lib...
<filename>projects/prosoft-components-demo/src/app/select-demo/demos/select-with-other-load-trigger.component.ts import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/core'; import { FormControl, FormGroup } from '@angular/forms'; import { DefaultPsSelectDataSource, PsSelectDataSource, PsSelec...
rm build -fr rm dist -fr #python3 -m nuitka --standalone --follow-imports --include-plugin-directory=/usr/local/lib/python3.7/dist-packages/telegram --include-plugin-directory=/usr/local/lib/python3.7/dist-packages/urllib3 --show-progress --show-scons main.py #mkdir -p dist/main #mv main.build build #mv main.dist/* di...
#!/bin/bash sudo ln -sf ~/kubot_ros1/tools/kubot_upstart/kubotenv /etc/kubotenv sudo ln -sf ~/kubot_ros1/tools/kubot_upstart/kubot_start.sh /usr/bin/kubot_start sudo ln -sf ~/kubot_ros1/tools/kubot_upstart/kubot_stop.sh /usr/bin/kubot_stop sudo ln -sf ~/kubot_ros1/tools/kubot_upstart/kubot_restart.sh /usr/bin/kubot_re...
(function(){ return { version:1, dependences:{ mve:1, "front-lib":1 } }; })()
<gh_stars>0 myApp.controller('PostCtrl',["$scope","$rootScope",'$location',function($scope,$rootScope,$location){ var accessToken =$rootScope.accessToken; var response =$rootScope.response; if (accessToken == null){ console.log('6'); window.location.href="https://angularfb-rohit.000webhostapp.com"; // redire...
<reponame>Fourdee/mayan-edms<filename>mayan/apps/documents/tasks.py from __future__ import unicode_literals import logging from django.apps import apps from django.contrib.auth import get_user_model from django.db import OperationalError from mayan.celery import app from .literals import ( UPDATE_PAGE_COUNT_RET...
<reponame>Nebulis/blog<filename>src/components/images/asia/malaysia/west-malaysia/langkawi-dream-hotel.tsx import { useStaticQuery, graphql } from "gatsby" import Img from "gatsby-image" import React, { useEffect } from "react" import { ExtraImageProps } from "../../../../../types/shared" const alt = { hotel: "Langk...
<reponame>dvinubius/meta-multisig export * from '../../ant';
<gh_stars>10-100 /** * @author ooooo * @date 2021/4/11 16:46 */ #ifndef CPP_1686__SOLUTION1_H_ #define CPP_1686__SOLUTION1_H_ #include <iostream> #include <vector> using namespace std; class Solution { public: int stoneGameVI(vector<int> &aliceValues, vector<int> &bobValues) { int n = aliceValues.size(); ...
#!/bin/bash # Restart my_service when it crashes while true do # Start the service service my_service start # Check the status of the service if [ "$(service my_service status)" = "running" ] then # sleep for 5 minutes sleep 300 else # Restart the service servic...
import json tweets = [ { 'user': 'John', 'tweet': 'This is a tweet in English', 'language': 'en' }, { 'user': 'Jane', 'tweet': 'Ceci est un tweet en français', 'language': 'fr' }, { 'user': 'Bob', 'tweet': 'Esta es una publicación en español', 'language': 'es' } ] language = 'en' filter...
#!/bin/bash # version: 0.4.14.19 # This script performs a fresh install of the turret's Linux software. # The turret software has only been tested on a Raspberry Pi 3B+ running # Raspbian 9 Stretch, but it should work with other Debian based systems. # See https://github.com/iboatwright/terror-turret/pi/README.md for ...
import { Title } from '@angular/platform-browser'; import { OverlayContainer } from '@angular/cdk/overlay'; import { Component, HostBinding, OnDestroy, OnInit } from '@angular/core'; import { ActivationEnd, Router } from '@angular/router'; import {MatSnackBar} from '@angular/material'; import { NIGHT_MODE_THEME, selec...
<filename>dist/ts/enums/error_type.d.ts export declare enum ERROR_TYPE { InvalidControllerName = "invalid_controller_name", InvalidContentType = "invalid_content_type", PortInUse = "port_in_use", UndefinedViewEngine = "undefined_view_engine" }
<filename>src/main/java/frc/robot/subsystems/DriveSubsystem.java package frc.robot.subsystems; import static frc.robot.RobotConstants.COUNTS_PER_REVOLUTION; import static frc.robot.RobotConstants.WHEEL_DIAMETER_INCH; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.Spark; import edu.wpi.first.wpilib...
#!/bin/bash printf "\nWill run the docker.\n" sudo docker run -d -p 7000:7000 localhost:5000/javalin:1.0.0-SNAPSHOT printf "\nDONE\n"
<gh_stars>0 /** * @license * Copyright 2017 The FOAM 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 ...
echo "launching testrpc with deterministic addresses and preset accounts with balances (for unit tests)" n 8.9.1 testrpc \ --gasLimit 0x47D5DE \ --network-id 999 \ -m "hello build tongue rack parade express shine salute glare rate spice stock" \ --account="0x133be114715e5fe528a1b8adf36792160601a2d63ab59d1fd454275b31328...
export interface Dictionary { [key: string]: Dictionary | any }
import tornado.ioloop class TimerManager: def __init__(self): self.timers = [] def init_timers(self, callback_func, interval_ms): ioloop = tornado.ioloop.IOLoop.instance() ioloop.add_callback(callback_func) # Call the function immediately res = tornado.ioloop.PeriodicCallback(...
def remove_repeated_chars(string): seen = set() result = "" for char in string: if char not in seen: seen.add(char) result += char return result result = remove_repeated_chars("aaabbcc") print(result)
#include <iostream> void towerOfHanoi(int n, char from_rod, char to_rod, char aux_rod) { if (n == 1) { std::cout << "Move disk 1 from rod " << from_rod << " to rod " << to_rod<<std::endl; return; } towerOfHanoi(n-1, from_rod, aux_rod, to_rod); ...
#!/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...
<filename>src/digits.c #include "digits.h" #define POINTS_LIST_MAX_LENGTH 10 #define DIGITS_LENGTH 10 static const float DIGIT_HALF_WIDTH = 0.4f; // determ. by the DIGITS points static const float DIGIT_LINE_SPREAD_FACTOR = 0.3f; struct points { SDL_FPoint list[POINTS_LIST_MAX_LENGTH]; int list_length; }; ...
define(["require", "exports", '../../Observable', '../../operator/mergeMapTo'], function (require, exports, Observable_1, mergeMapTo_1) { "use strict"; Observable_1.Observable.prototype.flatMapTo = mergeMapTo_1.mergeMapTo; Observable_1.Observable.prototype.mergeMapTo = mergeMapTo_1.mergeMapTo; }); //# sourc...
import argparse def main(): parser = argparse.ArgumentParser(description='Exporter Configuration') parser.add_argument('--port', type=int, default=9221, help='Port on which the exporter is listening') parser.add_argument('--address', default='', help='Address to which the exporter will bind') args...
#!/bin/bash set -e display_usage() { echo -e "Usage: geodesicHexPatch.sh <case> <refinement>\n" } if [ $# -le 1 ] then display_usage exit 1 fi case=$1 refinement=$2 cd $case gengrid_hex.$refinement
<reponame>lgarciaaco/cos-fleetshard package org.bf2.cos.fleetshard.operator.support; public class ValidationException extends Exception { private final String type; private final String status; private final String reason; private final String message; public ValidationException(String type, Strin...
<filename>src/auth/index.js<gh_stars>0 const auth = {}; export default auth;
import {jsx} from "@emotion/core"; import {FC} from "react"; import {useTheme} from "../services/useTheme"; import {Card} from "./Cards"; export const AnswerCard: FC<{ revealed: boolean; halfRevealed?: boolean; children: string; title?: string; onClick?: () => void; onRemove?: () => void; }> = ...
# (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved. # # This file contains confidential and proprietary information # of Xilinx, Inc. and is protected under U.S. and # international copyright and other intellectual property # laws. # # DISCLAIMER # This disclaimer is not a license and does not grant any # r...
import React,{ useEffect, useState } from 'react' import Card from "react-bootstrap/Card"; import Input from '../../Input/Input' function InvoiceForm({ submitInvoice }) { const [invoice,setInvoice] = useState({ distributorName:'', billNumber:'', billDate:'', companyName:'', d...
<reponame>grspectre/simple_python_games from tkinter import * from tkinter import ttk from collections import OrderedDict class AppData: __value = 0 @staticmethod def init(): AppData.__value = 0 @staticmethod def get_value(): value = AppData.__value if value == 0: ...
from itertools import product def generate_hyperparameter_combinations(hyperparameters): combinations = [] for model, params in hyperparameters.items(): keys = list(params.keys()) values = [params[key] for key in keys] for combination in product(*values): combination_dict = ...
const router = require('express').Router() const Title = require('../db/models/titles') router.get('/', async function(req, res, next) { try { let titles = await Title.findAll() res.json(titles) } catch (err) { next(err) } }) module.exports = router
#!/bin/bash -e arch=armhf if [ "$1" == "arm64" ]; then arch=arm64 fi rm -rf tmp-bundle-$arch || exit 1 mkdir tmp-bundle-$arch || exit 2 cd tmp-bundle-$arch xargs -n 3 -P 8 bash -c '../unpack-plugin.sh "$0" "$1" "$2"' < ../plugin-list-$arch-buster.txt mkdir bundle || exit 3 for dir in download_dir/*/; do cd "$d...
package pulse.input.listeners; import pulse.input.InterpolationDataset.StandartType; /** * A listener associated with the {@code InterpolationDataset} static repository * of interpolations. * */ public interface ExternalDatasetListener { /** * Triggered when a data {@code type} has been loaded. * ...
#!/bin/bash rqt_plot /self_balancer/single_pid/pitch/input /self_balancer/single_pid/pitch/output /teeterbot/right_wheel_speed
package uk.gov.ons.ctp.integration.contactcentresvc.event; import static uk.gov.ons.ctp.common.log.ScopedStructuredArguments.kv; import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; import lombok.extern.slf4j.Slf4j;...
#ifdef ___LINKER_INFO ; File: "_utils.c", produced by Gambit v4.9.3 ( 409003 (C) "_utils" (("_utils")) ( "_utils" ) ( "test" ) ( "_utils#" "c#append-lists" "c#compiler-abort" "c#compiler-internal-error" "c#every?" "c#gnode-depvars" "c#gnode-find-depvars" "c#gnode-var" "c#gnodes-remove" "c#keep" "c#list->str" "c#list->v...
'use strict'; const blocks = [ ['B', 'O'], ['X', 'K'], ['D', 'Q'], ['C', 'P'], ['N', 'A'], ['G', 'T'], ['R', 'E'], ['T', 'G'], ['Q', 'D'], ['F', 'S'], ['J', 'W'], ['H', 'U'], ['V', 'I'], ['A', 'N'], ['O', 'B'], ['E', 'R'], ['F', 'S'], ['L', 'Y'], ['P', 'C'], ['Z', 'M'] ]; con...
# !/bin/sh # See https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html iconutil -c icns WatchThis.iconset/
<reponame>AndySmile/BachelorThesis /** * @version 1.3.0 12-Jan-15 * @copyright Copyright (c) 2015 by <NAME>. All rights reserved. (http://andysmiles4games.com) */ #include <ImageProcessorHistogramHeightMap.h> #include <OpenCV/cv.h> #include <vector> #include <algorithm> #ifdef _DEBUG #include <SimpleLib/...
PYTHONPATH=./:../../../ python run_tests.py
# Import necessary libraries import pandas as pd import numpy as np from sklearn.ensemble import RandomForestClassifier # Load the data data = pd.read_csv('data.csv') # Define features and target X = data[['page_views', 'clicks', 'time_spent']] y = data['buy'] # Create the model model = RandomForestClassifier(n_esti...
// Generated by script, don't edit it please. import createSvgIcon from '../../createSvgIcon'; import EnviraSvg from '@rsuite/icon-font/lib/legacy/Envira'; const Envira = createSvgIcon({ as: EnviraSvg, ariaLabel: 'envira', category: 'legacy', displayName: 'Envira' }); export default Envira;
from pendulum_eqns.physiology.muscle_params_BIC_TRI import * from pendulum_eqns.physiology.musclutendon_equations import * import numpy as np from scipy import integrate """ ################################ ########## Parameters ########## ################################ c_{1} &= -\frac{3g}{2L} \\ c_{2} &= \frac{3}{...
#!/usr/bin/env python3 from PyQt5 import QtWidgets from dsrlib.ui.mixins import MainWindowMixin from dsrlib.ui.widgets import ButtonListWidget from dsrlib.domain import commands from .base import ActionWidgetMixin class GyroActionButtonListWidget(ButtonListWidget): def __init__(self, *args, action, **kwargs): ...
<reponame>tribock/orbos package kubernetes import ( "fmt" "time" v1 "k8s.io/api/core/v1" "github.com/caos/orbos/mntr" "github.com/caos/orbos/pkg/kubernetes" ) func maintainNodes(allInitializedMachines initializedMachines, monitor mntr.Monitor, k8sClient *kubernetes.Client, pdf func(mntr.Monitor) error) (done b...
<reponame>JesseeMeadows/Fury-Fighter<gh_stars>1-10 import java.awt.image.BufferedImage; import java.awt.Rectangle; import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; import java.awt.*; public class Bullet { private float VELOCITY; protected boolean toBeDeleted; protected in...
#!/bin/bash -eu function main() { local cwd cwd="${1}" local version version="$(cat om-version/version)" export GOPATH="${cwd}/go" pushd "${GOPATH}/src/github.com/pivotal-cf/om" > /dev/null for OS in darwin linux windows; do local name name="om-${OS}" echo "building $OS" if ...
#/usr/bin/env bash #Menu do formulário dados=$(zenity --forms \ --title='Formulario' \ --text='Formulario para criação de usuario' \ --add-entry='Nome' \ --add-entry='Sobre-nome' \ --add-password='Senha' \ --separator=',' \ --ok-label='Enviar' ) if [ "$?" -eq '1' ]; then exit 0 fi nome...
#!/bin/sh set -e UNSIGNED=$1 SIGNATURE=$2 ARCH=x86_64 ROOTDIR=dist BUNDLE=${ROOTDIR}/unity-Qt.app TEMPDIR=signed.temp OUTDIR=signed-app if [ -z "$UNSIGNED" ]; then echo "usage: $0 <unsigned app> <signature>" exit 1 fi if [ -z "$SIGNATURE" ]; then echo "usage: $0 <unsigned app> <signature>" exit 1 fi rm -rf ...
/* * Copyright [2020-2030] [https://www.stylefeng.cn] * * 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...
#!/usr/bin/env bash set -x pFlag=0 rFlag=0 nFlag=0 zFlag=0 CreateZipFile(){ rm -rf package mkdir -p package pip install -r requirements.txt --target package/ cd package zip -r9 ../${ZIP_NAME}.zip . cd ../ zip -g ${ZIP_NAME}.zip appflow_ga.py } UsageMessage(){ echo "usage : packager -p <aws profile> -r <aws_region> ...
import React from "react" import { FaFacebook, FaInstagram, FaEnvelope, FaWhatsapp } from "react-icons/fa" export default [ { icon: <FaFacebook />, url: "https://www.facebook.com/contactodnlomas/", title: "facebook", }, { icon: <FaInstagram />, url: "https://www.instagram.com/dnlomasoficial/...
<reponame>taekbari/WebDevCurriculum class Desktop { /* TODO: Desktop 클래스는 어떤 멤버함수와 멤버변수를 가져야 할까요? */ constructor( iconList, target ) {} // 전달받은 아이콘 목록으로 객체 및 화면 구성. makeIconList() {} }; class Icon { /* TODO: Icon 클래스는 어떤 멤버함수와 멤버변수를 가져야 할까요? */ constructor( templateTarget, name, imgInfo ) {} set name( n...
<reponame>alphagov/locations-api<filename>spec/lib/os_places_api/client_spec.rb require "spec_helper" RSpec.describe OsPlacesApi::Client do describe "#locations_for_postcode" do let(:client) do described_class.new(instance_double("AccessTokenManager", access_token: "some token")) end let(:postcode)...
import java.util.HashSet; import java.util.Set; /** * Created on: Aug 31, 2020 * Questions: https://www.algoexpert.io/questions/Numbers%20In%20Pi */ public class NumbersInPi { public static void main(String[] args) { } public static int numbersInPi(String pi, String[] numbers) { int len = pi....
// // ofxTMPSequence.h // // Created by ISHII 2bit on 2016/04/28. // // #pragma once namespace ofx { namespace TMP { namespace sequences { template <typename type, type ... ns> struct integer_sequence { using value_type = type; static constexpr std...
<filename>src/instructions/conversions/f2x.go package conversions import ( "instructions/base" "rtda" ) type F2D struct{ base.NoOperandsInstruction } type F2I struct{ base.NoOperandsInstruction } type F2L struct{ base.NoOperandsInstruction } // Convert float to double func (self *F2D) Execute(frame *rtda.Frame) { ...
<filename>2015/day_05_part1.py<gh_stars>0 #!/usr/bin/env python3 import re def is_nice_string(s): # contains at three vowels vowel_count = 0 for vowel in 'aeiou': vowel_count += s.count(vowel) if vowel_count < 3: return False m = re.search(r"([a-zA-Z])\1", s) if not m: return...
#include "util.h" #include <sys/time.h> static struct timeval tic_timestart; void tic(void) { gettimeofday(&tic_timestart, NULL); } double tocq(void) { struct timeval tic_timestop; gettimeofday(&tic_timestop, NULL); //coneOS_printf("time: %8.4f seconds.\n", (float)(tic_timestop - tic_timestart)); double time = ...
#/bin/bash clear echo " Change the directory" cd /home echo " You are in `pwd`" echo set -r echo " ====>GOD MODE ENABLED<====" echo read -p " What do you want to find? " w echo read -p " Where? " f echo read -p " How many strings? " n echo # main function func { grep "$w" "$f" | head -n "$n" | sort | cat -n } # check ...
package rbd import ( "encoding/json" "errors" "os/exec" "strings" "time" ) // Dev is an rbd device, a snapshot or an image type Dev interface { FullName() string ImageName() string Name() string Pool() *Pool Info() (*DevInfo, error) IsMountedAt(string) (bool, error) Map(...string) (string, error) Mount(s...
set -xe LATTELIB="lattelib.c" TEST_TEMPLATE="${TMPDIR}latteXXX" TEST_DIR=`mktemp -d "$TEST_TEMPLATE"` input_file="$1" BASENAME=`basename "$input_file" .lat` LLFILE="$TEST_DIR/${BASENAME}.ll" CLANG_OUT="$TEST_DIR/${BASENAME}.out" LLVM_ANS="$TEST_DIR/${BASENAME}.llans" CORRECT_ANS="examples/my_good/${BASENAME}.output...
/** OpenSensorHub feature results classes. */ package io.opensphere.osh.results.features;
<gh_stars>0 /* * Copyright (C) 2018-2019 <NAME> (www.helger.com) * philip[at]helger[dot]com * * 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/...
def bubble_sort(nums): '''Takes in a list of numbers and sorts them in ascending order using bubble sort''' # Iterate through all numbers for i in range(len(nums)): # Last i elements are already in place for j in range(0, len(nums)-i-1): # Swap numbers if the elemen...
#! /bin/sh # /etc/init.d/InSightsXLDeployAgent ### BEGIN INIT INFO # Provides: Runs a Python script on startup # Required-Start: BootPython start # Required-Stop: BootPython stop # Default-Start: 2 3 4 5 # Default-stop: 0 1 6 # Short-Description: Simple script to run python program at boot # Description: Runs a python...
#!/bin/bash set -eux aws s3 sync --exclude '*/dataset/*' --exclude '*/cache/*' --exclude 'iteration_*.pth' --exclude '*_optim.pth' "${S3_MODEL_DIR}" ./model genienlp kfserver --path ./model $@
<reponame>rubenqba/gearman-java<gh_stars>0 package net.johnewart.gearman.server.web; import net.johnewart.gearman.server.storage.JobManager; import net.johnewart.gearman.server.util.JobQueueMonitor; public class SystemStatusView extends StatusView { public SystemStatusView(JobQueueMonitor jobQueueMonitor, JobMan...
#!/usr/bin/env bash java -cp target/translator-0.1.0-standalone.jar translator.main $@
import _ from 'lodash'; import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import CreateHelper from '~/components/CreateHelper'; import { showModal, hideModal } from '~/actions/modal'; import { Button } from 'linode-components/buttons'; import { setError } from '~/actions/erro...
"""This is an example module to test reconstructable pipeline loading.""" from .bar import bar_pipeline # pylint: disable=import-error
#!/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...
#!/bin/sh set -e mkdir -p build mkdir -p images NAME=amd64.ubuntu.focal # create echo "[$NAME] Creating ..." mkdir images/$NAME debootstrap focal images/$NAME http://archive.ubuntu.com/ubuntu/ # test echo "[$NAME] Testing ..." [ "$(chroot images/$NAME uname)" = "Linux" ] || echo "🔴 Something went wrong in $NAM...
#include <stdio.h> #include <iostream> #include <omp.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/ml/ml.hpp> #include <opencv2/photo/photo.hpp> #include <cmath> #include <random> using namespace cv; using namespace cv::m...
#include <iostream> using namespace std; void changeSomething(double &value) { value = 123.4; } int main() { int value1 = 8; int &value2 = value1; value2 = 10; cout << "Value1: " << value1 << endl; cout << "Value2: " << value2 << endl; double value = 4.321; changeSomething(value); cout << value << endl; ...
<reponame>AnantLabs/google-enterprise-connector-ldap // Copyright 2010 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // U...
import { Pool } from 'pg'; import "@babel/polyfill"; require('dotenv').config(); const pool = new Pool({ host: process.env.DB_HOST, port: process.env.DB_PORT, database: process.env.DB_DEFAULT_DATABASE, user: process.env.DB_USERNAME, password: <PASSWORD> }) const databaseConnectionHandler = { t...
package com.yuansfer.paysdk.okhttp; import java.io.IOException; import okhttp3.MediaType; import okhttp3.RequestBody; import okio.Buffer; import okio.BufferedSink; import okio.ForwardingSink; import okio.Okio; import okio.Sink; public class ProgressRequestBody extends RequestBody { private IResponseHandler mResp...
#!/bin/bash mkdir -p logs mkdir -p pids # run_program (nodefile, pidfile, logfile) run_program () { nodefile=$1 pidfile=$2 logfile=$3 if [ -e "$pidfile" ] then echo "$nodefile is already running. Run 'npm stop' if you wish to restart." return 0 fi nohup node $nodefile >> $log...
<filename>index.js 'use strict'; var parse = require('./lib/parse.js'); module.exports = function (str, options = {}) { const ast = parse(str); const minFontSize = options.minFontSize || 10; const peferredFontSize = options.peferredFontSize || 24; const fontLevel = ast.getFontLevel(); const topLevelFontSize...
package com.networknt.eventuate.test.domain; import com.networknt.eventuate.common.Snapshot; import java.math.BigDecimal; public class AccountSnapshot implements Snapshot { private BigDecimal balance; public AccountSnapshot() { } public AccountSnapshot(BigDecimal balance) { this.balance = balance; }...
<reponame>Bradenbertrand/WordleLeaderboards<filename>commands/points.js const User = require('../models/user'); module.exports.run = async (bot, message, args) => { console.log("Points has been run") let userid = message.author.id //Finds a user based on userId User.findOne({ userId: userid}, function ...
<gh_stars>0 const router = require("express").Router(); const db = require('../models') //add more here router.get("/api/workouts", (req , res) => { //console.log("message") db.Workout.aggregate([ { $addFields: { totalDuration: { $sum: "$exercises.durati...
/* * Copyright 2020 Red Hat * * 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 ...
#!/bin/bash # # This file is part of arduino-preprocessor. # # Copyright 2017 ARDUINO AG # # arduino-preprocessor 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 Software Foundation; either version 2 of the License, or # (at your...
package poemstar.beans; import java.util.ArrayList; /** * Verses of poem * @author xinway */ public class Verses { public void addVerse(String s) { contents_.add(s); } public int getCount() { return contents_.size(); } public String getAt(int pos) { if ((pos <...
(page,done) => { let that = this; let lable = "PLZ"; let msg = 'Wohoo, more than 1000 active users! So, so cool! But only <a href="https://chrome.google.com/webstore/detail/full-stack-optimization-l/jbnaibigcohjfefpfocphcjeliohhold?hl=en" target="_blank">6 reviews</a> 😢. <b>Please <span style="background: linear-gr...
<reponame>nikolabebic95/PIAZadaci /* * 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 beans; import java.util.ArrayList; /** * * @author Nikola */ public class ExamsListBean...
package k8s import ( "testing" cond_v1 "github.com/atlassian/ctrl/apis/condition/v1" "github.com/stretchr/testify/require" ) func TestCalculateConditionAny(t *testing.T) { t.Parallel() t.Run("returns false on empty conditions", func(t *testing.T) { require.Equal(t, cond_v1.ConditionFalse, CalculateConditionA...
class Swagger::Schema::Factory attr_reader :name, :fields, :specification def initialize(name, fields, specification) @name = name @fields = fields @specification = specification end def call if fields.key?('$ref') Swagger::Reference.new(name, fields, specification) elsif fields.key?...
<filename>app/components/support_interface/application_api_representation_component.rb module SupportInterface class ApplicationAPIRepresentationComponent < ViewComponent::Base include APIDocsHelper def initialize(application_choice:) @application_choice = application_choice end private def...
<filename>app/src/main/java/com/smartalgorithms/getit/Place/PlaceContract.java package com.smartalgorithms.getit.Place; import android.content.DialogInterface; import com.smartalgorithms.getit.Models.Local.ReverseGeoResponse; import java.util.List; /** * Contact <EMAIL> * Created by <NAME> on 2017/12/06. * Updat...
#!/bin/bash set -ex function install_92 { echo "Installing CUDA 9.2 and CuDNN" # install CUDA 9.2 in the same container wget -q https://developer.nvidia.com/compute/cuda/9.2/Prod2/local_installers/cuda_9.2.148_396.37_linux -O setup chmod +x setup ./setup --silent --no-opengl-libs --toolkit rm ...
#!/bin/bash function docker_tag_exists() { EXISTS=$(curl -s https://hub.docker.com/v2/repositories/$1/tags/?page_size=10000 | jq -r "[.results | .[] | .name == \"$2\"] | any") test $EXISTS = true } if docker_tag_exists svenruppert/maven-3.2.5-adopt 1.8.0-192; then echo skip building, image already existin...
export interface IUserBoxComponentState { /** * Create new circle button is disabled {true} or not {false} * * @type {boolean} * @memberof IUserBoxComponentState */ disabledCreateCircle: boolean /** * The button of add user in a circle is disabled {true} or not {false} * * @type {boolea...