text
stringlengths
1
1.05M
module.exports = db => async (req, res, next) => { try { // Must sanitize all input first (see sanitize-get-reports middleware fn) const { verified, fromDate, toDate, locations, fullReport } = req.query // Init where clause const whereText = [] const whereValues = [] // Add verified filter i...
package de.rieckpil.blog.springbootwithopenliberty; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringBootWithOpenLibertyApplication { public static void main(String[] args) { SpringApplication...
<reponame>bosxixi/sortingtables var ComparableRow = (function () { function ComparableRow(key, element) { this.key = key; this.element = element; } return ComparableRow; }()); var OrderBy; (function (OrderBy) { OrderBy[OrderBy["Ascending"] = 0] = "Ascending"; OrderBy[OrderBy["Descend...
<gh_stars>0 const path = require('path'); const merge = require('webpack-merge'); const webpack = require('webpack'); const os = require('os'); const WRMPlugin = require('atlassian-webresource-webpack-plugin'); const providedDependencies = require('./providedDependencies'); const PLUGIN_TARGET_DIR = path.join(__dirnam...
import { Ressurs, RessursStatus } from '@navikt/familie-typer'; import { useState, useRef, useEffect } from 'react'; import ReactDOM from 'react-dom'; import { inputId } from '.'; import { ISøkeresultat } from '..'; import { søkKnappId, tømKnappId } from './Søk'; export interface Props { nullstillSøkeresultater: (...
#!/bin/bash # # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # # if version not passed in, default to latest released version export VERSION=1.3.0 # if ca version not passed in, default to latest released version export CA_VERSION=$VERSION # current version of thirdparty images (cou...
#!/bin/bash # ----------------------------------------------------------------------------- # # Copyright (C) The BioDynaMo Project. # 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. # # See the LICENSE file dist...
# Check it the environment variable is set and points # to a valid directory if [[ "$METASHARE_SW_DIR" == "" ]] ; then echo "The environment variable METASHARE_SW_DIR must be defined" echo "and contain the directory with Metashare software." exit 1 fi # Remove trailing slash if present METASHAR...
// Copyright (C) (See commit logs on github.com/robhz786/strf) // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include "test_utils.hpp" namespace { STRF_TEST_FUNC void utf8_to_utf32_valid_sequences() { ...
#!/usr/bin/env bash set -euo pipefail IFS=$'\n\t' # Check if Docker is installed if ! command -v docker &> /dev/null; then echo "Docker is not installed. Installing Docker..." # Add commands to install Docker # For example: # curl -fsSL https://get.docker.com -o get-docker.sh # sudo sh get-docker.s...
function setup() { export TF_CLI_INIT_FROM_MODULE="git::https://https://github.com/cloudposse/terraform-null-label?ref=master" export TF_CLI_INIT_BACKEND=false export TF_CLI_INIT="module/" export TF_ENV=${TF_ENV:-../release/tfenv} } function teardown() { unset TF_CLI_INIT_FROM_MODULE unset TF_CLI_INIT_BACK...
<gh_stars>0 import { Component, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import {NgForm} from '@angular/forms'; import { SuccessMsgComponent } from '../success-msg/success-msg.component'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import {HttpClient,HttpErrorResponse} from '@...
<reponame>zenitheesc/ZenView<gh_stars>1-10 const Container = require('../../../../../formBuilder/formBuilder').Container; module.exports = class terminalEditMenu { constructor() { this.form = Container.div({}, { id: 'terminalEditMenuConfig', att: 'terminal', ...
/*function display_map(latitude,longitude)// pour afficher un seul marqueur { let mymap = L.map('mapid').setView([48.8534, 2.3488], 13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> co...
<reponame>ViniciusDev26/api-nest<filename>src/users/users.controller.ts import { BadRequestException, Body, Controller, Post } from '@nestjs/common'; import { Public } from 'src/auth/decorators/public.decorator'; import { ICreateAndUpdateUser } from './dtos/ICreateAndUpdateUser'; import { UsersService } from './users.s...
#!/bin/bash # Copyright 2014 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...
<reponame>Miyashin6/Introduction<gh_stars>1-10 package com.galfins.gnss_compare.Corrections; import android.location.Location; import com.galfins.gogpsextracts.Coordinates; import com.galfins.gogpsextracts.IonoGps; import com.galfins.gogpsextracts.NavigationProducer; import com.galfins.gogpsextracts.SatellitePositio...
package com.javatest.framework.commons.utils; public class IPAddressUtil { private static final int INADDR4SZ = 4; private static final int INADDR16SZ = 16; private static final int INT16SZ = 2; public IPAddressUtil() { } public static byte[] textToNumericFormatV4(String var0) { byte[...
<gh_stars>10-100 /** * @module meteoJS/timeline/navigationButtons */ import addEventFunctions from '../Events.js'; /** * Determines how the time is chosen, when a button for time navigation is * clicked. On "exact" the time in the timeline is only changed if the time * exists. In all other cases the time will be ...
/* eslint-disable multiline-ternary */ const path = require('path'); const { execSync } = require('child_process'); const loaderUtils = require('loader-utils'); const validateOptions = require('schema-utils'); const schema = require('./options.json'); const compileXcodeProj = require('./compile-xcodeproj'); const fram...
<gh_stars>0 # frozen_string_literal: true require "open3" module CommandTesting RUBY_RUNNER = if defined?(JRUBY_VERSION) # See https://github.com/jruby/jruby/wiki/Improving-startup-time#bundle-exec "jruby -G" else "bundle exec ruby" end refine MSpecEnv do def run(command, chdir: nil, should_f...
function findAverage(num1, num2) { return (num1 + num2) / 2; } let average = findAverage(10, 15); console.log(average);
package com.android_group10.needy; import com.google.firebase.database.Exclude; import com.google.firebase.database.IgnoreExtraProperties; import java.util.HashMap; import java.util.Map; @IgnoreExtraProperties public class UserRating { private String userUID; private int ratingType; private int ratingValu...
#pragma once #include <stdexcept> namespace frea { struct InvalidAxis : std::invalid_argument { InvalidAxis(): std::invalid_argument("InvalidAxis") {} }; struct NoValidAxis : std::runtime_error { NoValidAxis(): std::runtime_error("NoValidAxis") {} }; struct InvalidFov : std::invalid_argument { InvalidFov():...
<reponame>nihei9/vartan package grammar import ( "encoding/json" "fmt" "os" "strings" mlcompiler "github.com/nihei9/maleeni/compiler" mlspec "github.com/nihei9/maleeni/spec" verr "github.com/nihei9/vartan/error" "github.com/nihei9/vartan/spec" ) type astActionEntry struct { position int expansion bool } ...
#!/bin/zsh # @raycast.schemaVersion 1 # @raycast.title Reload CoreAudio # @raycast.mode silent # @raycast.author Maxim Krouk # @raycast.authorURL https://github.com/maximkrouk # @raycast.description Reloads CoreAudio. # @raycast.icon 🎧 # @raycast.packageName System sudo launchctl stop com.apple.audio.coreaudiod && s...
<reponame>tipputhynhean/shawerma<filename>__tests__/cors.test.js /* eslint-env jest */ 'use strict' const Cors = require('../lib/cors') const event = require('./event') process.env.ORIGIN = 'http://localhost:8080, http://127.0.0.1' test(`Creates an array of allowed origins`, () => { const expected = ['http://local...
<reponame>simonachkar/Personal import Typography from 'typography' import kirkhamTheme from 'typography-theme-kirkham' import { colors, sizes } from './global' kirkhamTheme.googleFonts = [ { name: 'Fira Sans', styles: ['200', '300', '400', '500', '800', '900', 'black'], }, ] kirkhamTheme.headerFontFamily =...
'use strict'; import * as config from "../config"; import Particle from "./particle"; /** * This class acts as Emitter */ class ParticleSystem { constructor(scene){ console.log('ParticleSystem()'); this.scene = scene; this.cfg = config.flowers; this.animations = this.cfg.animations; this.geo = Partic...
<filename>include/RvizOutput.h // // Created by philippe on 08/11/18. // #ifndef PROJECT_RVIZOUTPUT_H #define PROJECT_RVIZOUTPUT_H #include "EntityOutput.h" #include <vector> #include <ros/ros.h> #include "PerceivedEntity.h" class RvizOutput : public EntityOutput { ros::Publisher markerPublisher; public: R...
/* * 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 writing, software * distribut...
#!/bin/sh # This is a generated file; do not edit or check into version control. export "FLUTTER_ROOT=C:\flutter" export "FLUTTER_APPLICATION_PATH=D:\WORK\_2021\Flutter\practical-flutter\ch_05+06\flutter_book" export "FLUTTER_TARGET=lib\main.dart" export "FLUTTER_BUILD_DIR=build" export "SYMROOT=${SOURCE_ROOT}/../build...
<reponame>PrideFuu/Beavis<filename>functions/time.js module.exports = function (bot) { timeSince = function (timestamp, suppressAgo) { ago = typeof suppressAgo !== 'undefined' ? suppressAgo : false; var message = moment.utc(timestamp).fromNow(suppressAgo); if (moment().isAfter(moment.utc(t...
/* * http://suyati.github.io/line-control * LineControl 1.1.0 * Copyright (C) 2014, Suyati Technologies * This program 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 yo...
package com.linwei.buriedpointlibrary.template.intent; import com.linwei.buriedpointlibrary.config.Constant; import com.linwei.buriedpointlibrary.utils.ProcessorUtils; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import java.util.List; import javax.annotation.processing.ProcessingE...
import React, { useState } from 'react'; const App = () => { const [selected, setSelected] = useState([]); const handleClick = (cell) => { // toggle cell const newSelected = [...selected]; const index = newSelected.indexOf(cell); if (index === -1) { newSelected.push(cell); } else { newSelected.splice(index,...
<filename>app/scripts/controllers/children.js<gh_stars>0 'use strict'; /** * @ngdoc function * @name magosApp.controller:ChildrenCtrl * @description * # ChildrenCtrl * Controller of the magosApp */ angular.module('magosApp') .controller('ChildrenCtrl', function ($scope, $location) { $scope.children = [ ...
#!/bin/sh set -e echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" install_framework() { if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then local source="${BUILT_PRO...
#!/bin/bash set -e tag=$(git describe --tags --abbrev=0) platforms=$(echo "darwin-amd64,linux-386,linux-arm,linux-amd64,linux-arm64,windows-386,windows-amd64" | tr "," "\n") include="dist/*" if [ -n "${GH_EXT_BUILD_SCRIPT}" ]; then echo "invoking build script override ${GH_EXT_BUILD_SCRIPT}" ./${GH_EXT_BUILD_SCRI...
#!/bin/bash ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""} set -eu # unset variables are errors & non-zero return values exit the whole script [ "$DEBUG" ] && set -x if [ ! -e /kopano/"$SERVICE_TO_START".py ]; then echo "Invalid service specified: $SERVICE_TO_START" | ts exit 1 fi echo "Configure se...
# training the neural network on the training set and evaluate it on the evaluation set # simly run this script to train the network, no need to change anything # the training parameters, which you may tune, are specified in nn_config.yml # the model structure, which you may optimize, is specified in net_model/ale...
<reponame>scala-steward/http4s-extend package http4s.extend.test.types import http4s.extend.OrBoolean import http4s.extend.test.Fixtures.MinimalSuite final class OrBooleanDiscipline extends MinimalSuite { test("typed AND correct evaluation"){ (OrBoolean(true) =||= OrBoolean(true)) should be(OrBoolean(true)) ...
#!/bin/bash pkgname=hgvs pip install $pkgname
def print_objects(arr, boundary): for obj in arr: for i in range(0, boundary): print(obj, end = '') print("\r") print_objects(objects, 10)
#!/usr/bin/env bash export APPD_NAME=${NAIS_APP_NAME} export APPD_TIER="${NAIS_NAMESPACE}_${NAIS_APP_NAME}"
<reponame>SimonMonecke/go-mines<gh_stars>0 package generate import ( "math/rand" "time" ) const ( noMine = "." mine = "X" ) func EasyStringMap() [][]string { return generateStringMap(8, 8, 10) } func NormalStringMap() [][]string { return generateStringMap(16, 16, 40) } func HardStringMap() [][]string { re...
<filename>src/main/java/com/mamuya/datrastocospringbootapi/dto/StockDTO.java<gh_stars>0 package com.mamuya.datrastocospringbootapi.dto; import com.mamuya.datrastocospringbootapi.entities.Stock; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; @Data @AllArg...
<reponame>Arnold-Huang/QuantitativeTrading<filename>app/binance-api-library/src/main/java/com/quant/binance/beans/ExchangeSymbol.java package com.quant.binance.beans; import java.util.List; public class ExchangeSymbol { String symbol; String status; String baseAsset; int baseAssetPrecision; String...
#include <string> std::string modifyFilePath(const std::string& filePath) { char chSaved = '/'; // Initialize chSaved with a default value const char* pszStart = filePath.c_str(); const char* pszEnd = filePath.c_str(); const char* pszLastSlash = filePath.c_str(); for (pszStart = pszEnd; *pszEnd; ...
Create a model that uses an encoder-decoder architecture with attention to take in a sequence of words as input, encode these words into a fixed-dimensional vector representation, and using this representation to decode a sequence of words that have the same meaning as the input.
<gh_stars>0 package com.rsodha; public class TennisCoach implements Coach { private FortuneService fortuneService; public TennisCoach(FortuneService sadFortuneService) { this.fortuneService = sadFortuneService; } @Override public String getWO() { return "Practice tennis"; } @Override public String getFn...
#!/bin/bash current=$(pwd) ./gradlew clean build shadowJar build cd ./build/distributions/ tar -xvf WordCount-1.0.tar cd $current
#!/bin/bash ./mvnw versions:display-property-updates ./mvnw versions:display-plugin-updates ./mvnw versions:display-dependency-updates
#!/bin/bash # spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall gnulib inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW baddecode ; (vars/env) BUILDDIR SRCDIR set -e if test ! -d ../gnu; then echo "Could not find ../gnu" echo "git clone git@github.com:coreutils/coreutils....
#!/usr/bin/env bash if [[ -z "${NODE_NAME}" ]]; then echo "NODE_NAME environment variable not set" exit 1 fi set -m set -x chroot /host echo "user.max_user_namespaces = 31477" > /etc/sysctl.d/99-usernamespaces.conf sysctl --system cat /proc/sys/user/max_user_namespaces while true; do sleep 60 done
def get_inclusive_range(start, end): return [i for i in range(start, end+1)]
<reponame>glowroot/glowroot-instrumentation package org.glowroot.instrumentation.executor; import org.glowroot.instrumentation.api.Descriptor; @Descriptor( id = "executor", name = "Executor", classes = { ExecutorInstrumentation.class }) public class ...
#!/bin/sh set -e THUNDER_ROOT=$(pwd)/thunder THUNDER_INSTALL_DIR=${THUNDER_ROOT}/install VALGRINDLOG=$(pwd)/valgrind_log checkInstalled() { command -v "$1" case "$?" in 0) true ;; *) false ;; esac } startDummyServerDeviceDiagnostic() { python Scripts/DeviceDiagnosticMock.py & sleep 0.1 } stopDummySer...
echo "Install homebrew: https://brew.sh/" # make it possible to quit the finder defaults write com.apple.finder QuitMenuItem -bool true killall Finder # disable two-finger swipe navigation in Chrome http://apple.stackexchange.com/a/80163/62458 defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -boo...
<filename>copy_test.go<gh_stars>0 // scuffold project main.go package filegenerator import ( "fmt" "os" "path/filepath" "testing" ) func TestCopyAdd(t *testing.T) { d := NewCopyGenerator() err := d.Add("copy.go", "ToDo") if err != nil { t.Errorf("adding copy job failed %v", err) } else { t.Log("adding cop...
import {getLocalStorage, setLocalStorage} from "./storage"; import {getBrowserObject} from "./browser"; import {Options} from "./types"; // // MousePager options page script // let browser = getBrowserObject(); let defaultOptions: {[k: string]: boolean} = { "prim+scroll": true, "prim+middle+scroll": true, "mid...
function check_failure { #TODO: we can't give a script as input to the function (unless the script is returning something...) "$@" local status=$? if (( status != 0 )) then echo "error with $1" >&2 failure_counter=$(($failure_counter+1)) echo "Failure counter: $failure_counter" ...
package org.kettle.beam.core; import org.junit.Test; import java.util.Date; import static org.junit.Assert.*; public class KettleRowTest { @Test public void equalsTest() { Object[] row1 = new Object[] { "AAA", "BBB", Long.valueOf( 100 ), Double.valueOf(1.234), new Date( 876876868 ) }; Object[] row2 = n...
/* * 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 ...
#!/bin/bash binimg=build/dnsd # Today and yesterdays cores cores=$(find ./dumps/ -name '*.core' -mtime -1) for core in $cores do gdblogfile="$core-gdb.log" rm -f "$gdblogfile" bininfo=$(ls -l $binimg) coreinfo=$(ls -l "$core") gdb -batch \ -ex "set logging file $gdblogfile" \ -ex "set logging...
#!/usr/bin/env bash # Copyright 2018 Expedia Group, 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 # # Unless required by applicable ...
<filename>ebl/context.py import attr from falcon_auth.backends import AuthBackend from ebl.bibliography.application.bibliography import Bibliography from ebl.bibliography.application.bibliography_repository import BibliographyRepository from ebl.changelog import Changelog from ebl.corpus.infrastructure.mongo_text_repo...
package com.mybatis.project.mapper; import com.mybatis.project.po.User; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; import org.junit.Before; import org.junit.Test; imp...
#!/bin/bash function set_volume() { amixer -c 1 set Speaker $1 >/dev/null } vol=50 echo "Set volume: $vol" set_volume $vol
#!/bin/sh python scholar_py/scholar.py -ddd -c 1 --author "albert einstein" --phrase "quantum theory" --citation bt
/* * Copyright (C) 2014 The Android Open Source Project * * 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 app...
def snapshot(ui, repo, files, node, tmproot): '''snapshot files as of some revision if not using snapshot, -I/-X does not work and recursive diff in tools like kdiff3 and meld displays too many files.''' # Check if the specified revision node exists in the repository if node not in repo: rai...
#!/bin/bash # Update the docker image docker pull mattrayner/meeting-display:latest # Re-set permissions for backlight sudo chmod 777 /sys/class/backlight/rpi_backlight/brightness sudo chmod 777 /sys/class/backlight/rpi_backlight/bl_power # Launch the backend service docker-compose -f /home/pi/meeting-display/docker-...
<filename>controllers/powerpod_controller_test.go package controllers import ( "context" "fmt" "reflect" "testing" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8...
import { BrowserRouter, Route, Routes } from 'react-router-dom' import Footer from './components/Footer' import NavBar from './components/NavBar' import NewQuotes from './pages/NewQuotes' import QuotesByTopic from './pages/QuotesByTopic' import Topics from './pages/Topics' function AppRoutes() { return ( <Brows...
#!/bin/bash set -e apt-get install -y wget unzip libssl-dev wget https://github.com/AGWA/git-crypt/archive/master.zip && unzip master.zip && cd git-crypt-master && make install
package math; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.Deque; /** * * @author minchoba * 백준 10826번: 피보나치 수 4 * * @see https://www.acmicpc.net/problem/10826/ * */ public class Boj10826 { private static final int INF = 19; public static v...
package databasex import ( "database/sql" "fmt" "github.com/changebooks/database" "github.com/changebooks/log" "time" ) func (x *Database) Exec(idRegister *log.IdRegister, driver *database.Driver, query string, args ...interface{}) (result sql.Result, err error) { tag := "Exec" start := time.Now() result, ...
#!/usr/bin/env bash # Consider running these two commands separately # Do a reboot before continuing. # To set environmental variables add to the end of this file. # nano .zshrc """ apt update apt upgrade -y apt install zsh sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" ...
#!/usr/bin/env bash set -ev coveralls -r . -b build/ -i keyvi \ --gcov /usr/bin/gcov-4.8 --gcov-options '\-lp' \ -E '.*/keyvi/3rdparty/.*' \ -e pykeyvi \ -E '.*/keyvi/tests/.*' \ -E '.*/keyvi/bin/.*' \ --dump keyvi.cov_report > /dev/null # work...
# ----- General --------------------------------------------------------------- # colorize grep and ls alias grep &> /dev/null || alias grep="grep --color=auto" alias ls='ls -p --color=auto -w $(($COLUMNS<120?$COLUMNS:120))' alias l="ls" # 'r' in zsh is set up to repeat the last command (!!) alias r="true" # manipu...
#!/bin/zsh rm -rf test-results killall SpartaConnect set -o pipefail && xcodebuild -workspace SpartaConnect.xcworkspace -scheme SpartaConnect clean build | xcpretty time while { set -o pipefail && xcodebuild -workspace SpartaConnect.xcworkspace -scheme UITests test -resultBundlePath test-results/ui-tests-$(date +%s) | ...
<reponame>moesoha/frc-commandbased-cpp #include "OI.h" OI::OI() { joystickDriver.reset(new Joystick(0)); } std::shared_ptr<Joystick> OI::getJoystickDriver(){ return joystickDriver; } double OI::getDriverRawAxis(int axis){ return joystickDriver->GetRawAxis(axis); }
import UIKit class NewExpenseFormViewController: UIViewController { // MARK: - Properties let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext // MARK: - Views let nameTextField = UITextField() let costTextField = UITextField() let categoryTextField = UITextField() let...
<reponame>marhas/ios-sdk-examples // // ExamplesTableViewController.h // Examples // // Created by <NAME> on 1/26/16. // Copyright © 2016 Mapbox. All rights reserved. // #import <UIKit/UIKit.h> @interface ExamplesTableViewController : UITableViewController @end
total = 0 for i in range(1000): if i % 3 == 0 or i % 5 == 0: total += i print(total)
import math def calculateDistances(points): distances = [] for point in points: x, y = point distance = math.sqrt(x**2 + y**2) distances.append([round(distance, 15), round(distance, 15)]) # Rounding to 15 decimal places return distances # Test the function with the given example i...
for seed in {1..2} do (sleep 0.3 && nohup xvfb-run -a python ppo_ac_positive_reward.py \ --gym-id MicrortsAttackHRL-v1 \ --total-timesteps 10000000 \ --wandb-project-name action-guidance \ --prod-mode \ --cuda True --shift 2000000 --adaptation 2000000 --end-e 0.5 --positive-likelihood 1.0 \ ...
import { Router } from "express"; const app = Router(); // Present Value app.get("/PV", (req, res) => { var numberCF = parseInt(req.query.numberCF); // Number of Cashflows // console.log(numberCF); var A = []; var interest = parseInt(req.query.interest); // interest for (let i = 1; i <= numberCF; i++) { ...
/** * @name: mutations * @author: yiyun <<EMAIL>> * @profile: https://github.com/yiyungent * @date: 7/4/2020 4:37 PM * @description:mutations * @update: 7/4/2020 4:37 PM */ import types from "./types"; export default { // this.$store.commit('方法的名称', '按需传递唯一的参数') // 获取当前登录账号并保存到 user [types.GET_USER](stat...
import React from 'react'; import useGlobalGame from 'hooks/useGlobalGame'; export default ({ children }) => { useGlobalGame(); return <>{children}</>; };
'use strict'; const cp = require('child_process'); const electron = require('electron'); const { promisify } = require('util'); const os = require('os'); module.exports = function buildNative() { const exec = promisify(cp.exec); return Promise.all([ exec(`${electron} --version`, { encoding: 'utf8' }), ex...
import {Customer} from "./customer"; import {Message} from "./message"; export class Complaint { complaintId: number; complaintMessages: Array<Message>; submitDate: string; considerDate: string; status: string; customerResponse: Customer; productDescription: string; invoiceNumber: string; purchaseDa...
import numpy as np import gym from gym import wrappers env = gym.make('Connect4-v0') # Define the reinforcement learning model model = keras.Sequential() model.add(Dense(64, input_dim = 7*6, activation='relu')) model.add(Dense(64, activation='relu')) model.add(Dense(64, activation='relu')) model.add(Dense(1, activat...
package com.saucedemo.appmanager; import org.openqa.selenium.*; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; import org.openqa.selenium.opera.OperaDriver; import org....
#!/usr/bin/env bash set -e set -u set -o pipefail SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" SOURCEPATH="${SCRIPTPATH}/../../.lib/conf.sh" BINARY="${SCRIPTPATH}/../../../bin/pwncat" # shellcheck disable=SC1090 source "${SOURCEPATH}" # ------------------------------------------------------------...
<filename>postcss.config.js const purgecss = require('@fullhuman/postcss-purgecss')({ content: ['./src/**/*.html', './src/**/*.jsx'], // regular expression for css classes: NOTE: Node.js 9.11.2 and above only defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [], }) module.exports = () => ({ plu...
#!/bin/sh ############################################################################## # Script aimed at OCRing a single page of a PDF file or a single image # # Copyright (c) 2013-14: fritz-hh from Github (https://github.com/fritz-hh) # Copyright (c) 2014 Daniel Berthereau (https://github.com/Daniel-KM) ############...
import React, { useContext } from "react"; import FontAwesome from 'react-fontawesome'; import { ToolTipForeignObject, ToolTipButtonGroupDiv, ToolTipInnerButton, } from "./tooltip-styles"; import axios from "axios"; import { D3Context } from "../../contexts/D3Context"; import { teamSearchResults } from "../....
<!DOCTYPE html> <html> <head> <title>Current Time</title> </head> <body> <h1>The current date and time is: <script> document.write(new Date().toLocaleString()); </script> </h1> </body> </html>