text
stringlengths
1
1.05M
/** * @author ooooo * @date 2021/5/22 11:37 */ #ifndef CPP_1442__SOLUTION2_H_ #define CPP_1442__SOLUTION2_H_ #include <iostream> #include <vector> using namespace std; class Solution { public: int countTriplets(vector<int> &arr) { int n = arr.size(); vector<int> pre(n + 1); for (int i = 0; i < n; i++) {...
def linkedlist_to_array(linked_list): arr = [] node = linked_list while node is not None: arr.append(node.val) node = node.next return arr
#!/bin/bash CODE_PATH=$HOME/git OUT_PATH_BASE="/storage/groups/ml01/workspace/${USER}/ncem" GS_PATH="${OUT_PATH_BASE}/grid_searches/" DATA_PATH="/storage/groups/ml01/workspace/${USER}/ncem/data" SBATCH_P="gpu_p" SBATCH_QOS="gpu" SBATCH_GRES="gpu:1" SBATCH_TIME="2-00:00:00" SBATCH_MEM="50G" SBATCH_C="4" SBATCH_NICE="1...
def delete_element(array, element) array.delete(element) return array end delete_element([3, 5, 12, 6, 9], 5)
<reponame>hchimachi/sites<filename>wordpress/wp-content/plugins/pdf-builder-for-wpforms/js/lib/velocityAsync/velocityAsync.ts<gh_stars>0 (jQuery.fn as any).velocityAsync=function(property:any, duration,easing:'easeInExp'|'easeOutExp'|'linear'){ let $element=this; return new Promise((resolve => { $ele...
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { FormItemRadioComponent } from './form-item-radio.component'; import { MatInputModule } from '@angular/material/input'; import { MatListModule } from '@angular/material/list'; import { NoopAnimationsModule } from '@angular/platfo...
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 // protoc v3.14.0 // source: session.proto // protoc --go_out=. *.proto package proto import ( proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.g...
#!/usr/bin/env bash # @since 2019-04-16 04:01 # @author vivaxy npx tsc
<gh_stars>0 import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent, AppComponentModule } from './app-component'; import { getChunkStrategyCredentialsMap, getConcurrent...
<gh_stars>0 package it.madlabs.patternrec.web.rest.controllers.common; import it.madlabs.patternrec.web.rest.controllers.common.ApiException; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(value = HttpStatus.NOT_FOUND) public class NotFoundEx...
x = 5 y = 8 sum = x + y puts "The sum of x and y is #{sum}"
#!/usr/bin/env bash set -o nounset -o errexit -o pipefail cat - <<EOF <h1>ICFP Contest 2021</h1> <p> ICFP Contest 2021 took place 12:00 PM Friday 9 July - 12:00 PM Monday 12 July UTC. </p> <img style="width: 80%; max-width: 200px" alt="ICFP Contest 2021" src="images/logo.svg"><br> EOF for i in $(ls -r updates); do ...
export { default } from 'ember-medium-editor/components/me-image-dragging';
#!/usr/bin/env bash # Copyright 2017 DigitalOcean # # 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 a...
#!/bin/bash cd /backup # where the backups are located echo -e "\n---------------------------------------------------------------------------------\n" echo -e "What Backup you want to unzip ?\n" files=$(ls *.tar.gz) i=1 for j in $files do echo "$i.$j" file[i]=$j i=$(( i + 1 )) done echo -e "\n----------------------...
const { ApolloClient } = require('apollo-client'); const { createHttpLink } = require('apollo-link-http'); const { InMemoryCache } = require('apollo-cache-inmemory'); // Initialize Apollo Client const client = new ApolloClient({ link: createHttpLink({ uri: 'http://localhost:4000/graphql', }), cache: new InMemoryCa...
#ifndef _INTERPOLATION_CUDA_KERNEL #define _INTERPOLATION_CUDA_KERNEL #include <torch/serialize/tensor.h> #include <vector> #include <ATen/cuda/CUDAContext.h> void nearestneighbor_cuda(int b, int n, int m, at::Tensor unknown_tensor, at::Tensor known_tensor, at::Tensor dist2_tensor, at::Tensor idx_tensor); void interpo...
builddir="/musl-cross-build" outputdir="/musl-cross" decho () { echo $(TZ='America/Toronto' date "+%Y-%m-%d %H:%M:%S") $@ } secho () { if [ $? -eq 0 ]; then decho "--success!" else decho "--failure!" fi } # build cross compiler for given target ($1) and gcc_options ($2) build_cross () { cd $bui...
import React, { useState } from 'react'; import { Platform, StyleSheet, SafeAreaView, View, Text, FlatList, TouchableOpacity, TextInput, KeyboardAvoidingView, Alert, ActivityIndicator } from 'react-native'; import Post from '../components/Post'; import { useRoute } from '@react-navigation/native'; import { RouteProp, u...
package apps; import org.jooby.Jooby; import org.jooby.Results; public class App946 extends Jooby { { /** * Top. */ path("/some/path", () -> { path("/:id", () -> { /** * GET. * @param id Param ID. */ get(req -> { return req.param("id").in...
class User < ActiveRecord::Base validates_presence_of :username, :email, :password has_many :drawings has_secure_password end
#!/bin/bash OUTDIR=$TRAVIS_BUILD_DIR/out/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST mkdir -p $OUTDIR/bin ARCHIVE_CMD="zip" if [[ $HOST = "i686-w64-mingw32" ]]; then ARCHIVE_NAME="windows-x86.zip" elif [[ $HOST = "x86_64-w64-mingw32" ]]; then ARCHIVE_NAME="windows-x64.zip" elif [[ $HOST = "arm-linux-gnueabih...
<reponame>FelixSeptem/itsrisky<gh_stars>0 package itsrisky import ( "crypto/sha1" "reflect" "strconv" "testing" "time" ) func TestSigner(t *testing.T) { s := Signer{ SecretKey: GenerateSecretKey(32), Hash: sha1.New(), } var ( str = "something information quite long" ) signed, err := s.Sign(str) ...
#!/bin/bash # Variables to set, suit to your installation cd /root export PATH=/root/bin:$PATH export OCP_RELEASE="{{ disconnected_operators_version|default(openshift_version|default(4.7)) }}" export OCP_PULLSECRET_AUTHFILE='/root/openshift_pull.json' IP=$(ip -o addr show eth0 |head -1 | awk '{print $4}' | cut -d'/' -f...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _assign = require('babel-runtime/core-js/object/assign'); var _assign2 = _interopRequireDefault(_assign); var _keys = require('babel-runtime/core-js/object/keys'); var _keys2 = _interopRequireDefault(_keys); var _extends2 = require...
#!/bin/bash if [ -z ${BRANCH} ]; then BRANCH="develop" fi PADDLE_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}")/../" && pwd )" API_FILES=("CMakeLists.txt" "paddle/fluid/API.spec" "paddle/fluid/op_use_default_grad_op_maker.spec" "paddle/fluid/framework/operator.h" "paddle/f...
/* Retrieve bytes to the leading address of a word to wrap words. */ # define CAR # include "../../../incl/config.h" signed(__cdecl cue2l(signed char(*sym),signed char(*argp))) { /* **** DATA, BSS and STACK */ auto signed char HT = ('\t'); auto signed char SP = (' '); auto signed char *p; auto signed i,r; auto si...
escape_grep_regex() { sed 's/[][\.|$(){}?+*^]/\\&/g' <<< "$*" } function add_to_gitignore { touch .gitignore escaped_name="$(escape_grep_regex $1)" grep -E -- "$escaped_name$" .gitignore &>/dev/null || echo " # this next line was auto-added, and may be very important (passwords/auth etc) # comment it ...
<gh_stars>10-100 export default { init() { //=====Grid/List View change in Facilities===== if($("#switchViewBtn").length) { $(".listView").hide(); } $("#switchViewBtn").toggle( function(){ $(".gridView").hide(); $(".listView").show(); $("#switchViewBtn").html('<i ...
#!/bin/bash set -e git clone bosh-cli bumped-bosh-cli mkdir -p workspace/src/github.com/cloudfoundry/ ln -s $PWD/bumped-bosh-cli workspace/src/github.com/cloudfoundry/bosh-cli export GOPATH=$PWD/workspace cd workspace/src/github.com/cloudfoundry/bosh-cli dep ensure -v -update if [ "$(git status --porcelain)" != ...
<reponame>malte0811/ControlEngineering package malte0811.controlengineering.controlpanels.cnc; import com.google.common.collect.ImmutableList; import malte0811.controlengineering.bus.BusSignalRef; import malte0811.controlengineering.controlpanels.PanelComponentInstance; import malte0811.controlengineering.controlpanel...
#!/bin/sh # # Because git subtree doesn't provide an easy way to automatically merge changes # from upstream, this shell script will do the job instead. # If you don't have a POSIX-compatible shell on your system, feel free to use # this as a reference for what commands to run, rather than running it directly. # Chang...
fn custom_float_to_f64(input: u128) -> f64 { let sign_bit = (input >> 127) & 1; let exponent = ((input >> 112) & 0x7F) as i32 - 63; let mantissa = (input & 0x7FFFFFFFFFFFFFFF) as f64 / (1u64 << 63) as f64; let sign = if sign_bit == 1 { -1.0 } else { 1.0 }; let value = sign * (1.0 + mantissa) * 2.0_...
<reponame>zmb3/om package generator import ( "fmt" "strings" "gopkg.in/yaml.v2" ) func NewMetadata(fileBytes []byte) (*Metadata, error) { metadata := &Metadata{} err := yaml.Unmarshal(fileBytes, metadata) if err != nil { return nil, err } return metadata, nil } type Metadata struct { Name s...
<gh_stars>1-10 /* $Id$ */ /*************************************************************************** * (C) Copyright 2003-2010 - Stendhal * *************************************************************************** **************************************************************...
# 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 may not use ...
#!/usr/bin/env bash # Will Bash Prompt, inspired by theme " Axim", "Sexy" and "Bobby" # thanks to them if tput setaf 1 &> /dev/null; then if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then MAGENTA=$(tput setaf 9) ORANGE=$(tput setaf 172) GREEN=$(tput setaf 190) PURPLE=$(tput setaf 141) ...
<reponame>wuximing/dsshop<gh_stars>1-10 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.INTERACTION_MAP = void 0; var tslib_1 = require("tslib"); var drillDown_1 = tslib_1.__importDefault(require("./drillDown")); exports.INTERACTION_MAP = { drilldown: drillDown_1.default, }; //#...
<filename>cache.go package disgord type Cacher interface{} func NewCache() *Cache { return &Cache{} } type Cache struct{}
#!/usr/bin/env bash # Copyright 2020-2021 Johan Thorén <johan@thoren.xyz> # Licensed under the ISC license: # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all co...
import collections def third_most_common(words): count = collections.Counter(words).most_common() return count[2][0] third_most_common(words) # returns 'Bird'
#Copyright 2018 The CDI 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 or agreed to in writing, s...
<reponame>lanpinguo/rootfs_build /** * sunxi-eh-test.c - SUNXI Embedded Host Test Support Driver * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 as published by * the Free Software Foundation. * * ALTERNATIVELY, this softwa...
def findMinMax(array): min = array[0] max = array[0] for i in array: if i < min: min = i elif i > max: max = i return (min, max) inputArray = [2, 3, 4, 7, 8, 1, 9] max, min = findMinMax(inputArray) print("Maximum:", max) # 9 print("Minimum:", min) # 1
make nogdb V=0
<reponame>MckenzieSkullKid/GoldSiege<gh_stars>0 package com.pixelyeti.goldsiege.Util; import org.bukkit.Bukkit; import org.bukkit.World; import org.bukkit.WorldCreator; import java.io.*; import java.util.ArrayList; import java.util.Arrays; /** * Created by Callum on 30/10/2016. */ public class FileHandler { p...
<reponame>timeo-app/timeo-api package main import ( "github.com/gofiber/fiber/v2" "go-fiber-todos/router" ) type ToDo struct { Id int `json:"id"` Name string `json:"name"` Completed bool `json:"completed"` } var todos = []ToDo{ {Id: 1, Name: "Walk the Dog", Completed: false}, {Id: 2, Name: "...
"use strict"; global.sinon = require("sinon"); global.chai = require("chai"); global.should = global.chai.should(); var sinonChai = require("sinon-chai"); global.chai.use(sinonChai);
#! /bin/bash SCRIPT_DIR=`dirname $0` cd $SCRIPT_DIR cat ../sql/insert.sql | xargs -I% docker exec clickhouse-master clickhouse-client --query=%
class Warp { // Implementation of Warp class } function createWarp(opts: CreateWarpOpts): Warp { const warp = new Warp(); // Configure the Warp instance using the provided options warp.controllers = opts.controllers; if (opts.middleware) { warp.middleware = opts.middleware; } if (opts.authenticator) ...
#!/bin/bash # # ElasTest backup utility # echo "FILE=/tmp/marika" >&1 echo "VAR1=value1" >&1 echo "This is an error" >&2 exit 2
<filename>mod.ts export { denock } from "./src/index.ts"; export type { HTTPMethods, DenockOptions, Interceptor, RequestData } from "./src/type.ts";
from typing import List class MigrationOperation: def __init__(self, app: str, operation_type: str, field: str, details: str): self.app = app self.operation_type = operation_type self.field = field self.details = details def process_migrations(dependencies: List[tuple], operations:...
import { handleActions } from 'redux-actions' const initialState = { detail: {}, } export default handleActions({ NOTICE_PUSH (state, action) { const {payload} = action return Object.assign({pending: false}, state, { detail: payload }) }, }, initialState) export const showError = (error) =...
export const AUTHOR = "Soitora" as const; export const URL = { stylesheet: "https://soitora.com/SweClockers-Dark/sweclockers-dark.css", info: "/forum/trad/1515628", } as const;
#!/bin/bash #default values for pyspark, spark-nlp, and SPARK_HOME SPARKNLP="3.1.2" PYSPARK="3.0.2" SPARKHOME="spark-3.1.2-bin-hadoop2.7" while getopts s:p: option do case "${option}" in s) SPARKNLP=${OPTARG};; p) PYSPARK=${OPTARG};; esac done echo "setup Kaggle for PySpark $PYSPARK and Spark NLP $SPARKNLP" ap...
public static int[] treeToArray(Node root) { ArrayList<Integer> arr = new ArrayList<>(); treeToArrayRecur(arr, root); int[] array = arr.stream().mapToInt(i->i).toArray(); return array; } public static void treeToArrayRecur(ArrayList<Integer> arr, Node node) { if (node == null) { arr.add(null); return; } arr....
<reponame>ooooo-youwillsee/leetcode // // Created by ooooo on 2020/4/3. // #ifndef CPP_047__SOLUTION1_H_ #define CPP_047__SOLUTION1_H_ #include <iostream> #include <vector> using namespace std; /** * dfs timeout */ class Solution { public: void dfs(int i, int j, int sum) { if (i >= m || j >= n) return; ...
package io.opensphere.core.preferences; import java.text.SimpleDateFormat; /** * A utility method to get list tool preferences. * */ public final class ListToolPreferences { /** The Constant LIST_TOOL_TIME_PRECISION_DIGITS. */ public static final String LIST_TOOL_TIME_PRECISION_DIGITS = "ListToo...
// Render Google Sign-in button function renderButton() { gapi.signin2.render('gSignIn', { 'scope': 'profile email', 'width': 240, 'height': 50, 'longtitle': true, 'theme': 'dark', 'onsuccess': onSuccess, 'onfailure': onFailure }); } // S...
<filename>src/main/java/de/thro/inf/prg3/a11/App.java package de.thro.inf.prg3.a11; import de.thro.inf.prg3.a11.openmensa.OpenMensaAPI; import de.thro.inf.prg3.a11.openmensa.OpenMensaAPIService; import de.thro.inf.prg3.a11.openmensa.model.Canteen; import de.thro.inf.prg3.a11.openmensa.model.Meal; import de.thro.inf.pr...
<gh_stars>0 # Copyright 2016-present CERN – European Organization for Nuclear Research # # 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/licens...
using System; public class VowelCount { public static void Main(string[] args) { string str = "Hello"; int vowels = 0, consonants = 0; str = str.ToLower(); for(int i = 0; i < str.Length; i++) { if(str[i] == 'a' || str[i] == 'e' || str[i] == 'i' || str[i] =...
<gh_stars>0 package server import ( "crypto/rand" "encoding/base64" "fmt" "io/ioutil" "net/http" "strings" "testing" "github.com/fnproject/fn/api/datastore" "github.com/fnproject/fn/api/logs" "github.com/fnproject/fn/api/models" "github.com/fnproject/fn/api/mqs" ) func TestBadRequests(t *testing.T) { buf...
class CarData: def __init__(self): self.cars = {} def add_car(self, name, color, price): car = { "name": name, "color": color, "price": price } self.cars[name] = car def get_car(self, name): if name in self.cars: retur...
#[derive(Debug, PartialEq)] struct NuObject { column: String, } fn convert_to_nu_object(named_column_expression: &str) -> Option<NuObject> { if named_column_expression.is_empty() { return None; } Some(NuObject { column: named_column_expression.to_string(), }) }
#!/bin/bash # Copyright 2016 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/bash echo "This command print \"def_test\" function:" echo "$ silentbob --tags def_test" echo . ./head.sh cd $WORKDIR silentbob -c silentbob --tags def_test
<reponame>hhuchzh/Bus_Project import service from '@/utils/request' // @Tags GpsInfo // @Summary 创建GpsInfo // @Security ApiKeyAuth // @accept application/json // @Produce application/json // @Param data body model.GpsInfo true "创建GpsInfo" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Ro...
<gh_stars>1-10 package oidc.management.repository.mongo; import oidc.management.model.ServiceAccount; import oidc.management.model.mongo.MongoServiceAccount; import oidc.management.repository.ServiceAccountRepository; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework...
#!/usr/bin/env bats load test_helper @test "vm.ip" { id=$(new_ttylinux_vm) run govc vm.power -on $id assert_success run govc vm.ip $id assert_success } @test "vm.ip -esxcli" { id=$(new_ttylinux_vm) run govc vm.power -on $id assert_success run govc vm.ip -esxcli $id assert_success ip_esxcli...
bnc_name="$(basename $(pwd))" ; lnk_name="$bnc_name.rbc" ; prf_name="$bnc_name.ibc" ; obj_name="$bnc_name.o" ; exe_name="$bnc_name.exe" ; source_files=($(ls *.c)) ; CXXFLAGS="-I."
<reponame>hopshadoop/btsync-chef<filename>provider/wait_download.rb action :install_ndbd do tgt = "#{new_resource.recipe_name}" # Chef::Log.info "seeder : #{node[:ndb][:seeder_ip]}" # Tail the log (./sync/sync.log) until we see the event that the file has completed downloading ("Finished syncing file"). # Set a tim...
def is_valid_palindrome(s: str) -> bool: # Convert the string to lowercase and remove non-alphanumeric characters s = ''.join(char.lower() for char in s if char.isalnum()) # Check if the modified string is equal to its reverse return s == s[::-1]
#!/bin/bash # This script will generate a Key-Pair for Owner Attestation. if [[ "$1" == "-h" || "$1" == "--help" ]]; then cat << EndOfMessage Usage: ${0##*/} [<encryption-keyType>] Arguments: <encryption-keyType> The type of encryption to use when generating owner key pair (ecdsa256, ecdsa384, rsa, or all). Will...
TERMUX_PKG_HOMEPAGE=https://www.libsdl.org TERMUX_PKG_DESCRIPTION="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard (version 2)" TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="COPYING.txt" TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>" TERMUX_PKG_...
import * as crypto from 'crypto'; import { Transform, Stream, Writable } from 'stream'; const algorithm = 'aes-256-ctr'; let password: Buffer; function checkPassword() { if (!password) { throw new Error('You should set password first.'); } } export function generatePassword() { return crypto.rand...
<reponame>lgoldstein/communitychest package com.vmware.spring.workshop.model; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Map; import java...
function rotate90(arr) { let n = arr.length; let newMatrix = []; for (let i = 0; i < n; i++) { let newRow = []; for (let j = 0; j < n; j++) { newRow[j] = arr[n - j - 1][i]; } newMatrix[i] = newRow; } return newMatrix; } let matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; let result = rota...
<filename>service/src/test/java/dk/kvalitetsit/hjemmebehandling/controller/QuestionnaireResponseControllerTest.java package dk.kvalitetsit.hjemmebehandling.controller; import dk.kvalitetsit.hjemmebehandling.api.DtoMapper; import dk.kvalitetsit.hjemmebehandling.api.PartialUpdateQuestionnaireResponseRequest; import dk.k...
SELECT MAX(salary) AS second_highest_salary FROM employee WHERE salary < (SELECT MAX(salary) FROM employee)
#!/bin/bash # Install hadoop # Installation relies on finding JAVA_HOME@/usr/java/latest as a prerequisite INSTALL_DIR=${INSTALL_DIR:-/usr} USER=`whoami` HADOOP=hadoop-${HADOOP_VER:-3.2.2} HADOOP_DIR=${INSTALL_DIR}/$HADOOP HADOOP_ENV=$HADOOP_DIR/hadoop.env install_prereqs() { if [[ -f /usr/java/latest ]]; then ...
from typing import List def process_tokens(tokens: List[str]) -> List[str]: # Add 5-bit "don't care" sequence and 6-bit "op-code" sequence to the end of the token list tokens += ['00000', '000000'] return tokens # Test the function with an example input_tokens = ['10101', '11011'] output_tokens = process_...
/* * Copyright (c) 2004-2009, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of ...
def isFibonacci(n): a = 0 b = 1 if (n == a or n == b): return True while (n > b): c = a + b a = b b = c if (n == b): return True return False
def handle_shell_command(cmd): if "unison -version" in cmd: return 0, "unison version 2.51.3" elif "export UNISON=" in cmd: return 0, "[mock] Successfully ran unison command" else: return 1, f"Missing mock implementation for shell command: '{cmd}'" # Test cases print(handle_shell_co...
#!/bin/bash # Script for generating self signed certificate (for local development). KEY_FOLDER=../src/main/resources rm ${KEY_FOLDER}/vf-starter-self-signed.p12 echo ========================================================== echo Generate Self Signed KeyStore echo ==================================================...
#!/bin/bash dieharder -d 208 -g 3 -S 3559857189
xargs --arg-file=/home/ubuntu/feature_scripts/feature_tiles_0.sh \ --max-procs=3 \ --replace \ --verbose \ /bin/sh -c "[ -f /data/local/eecolidar/rclone/tmp/ahn3_feature_10m/{}.ply ] && echo 'File {}.ply already exists' || echo 'Creating file {}.ply'; python /home/ubuntu/feature_scripts/comput...
<reponame>CMU-Light-Curtains/ConstraintGraph #ifndef PY_HPP #define PY_HPP #include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <pybind11/eigen.h> #include <v1.h> #include <v2.h> namespace py = pybind11; using namespace planner; PYBIND11_MODULE(planner_py, m) { py::class_<CameraParameters, std::sha...
# Function to find roots of a quadratic equation quad_roots <- function(a, b, c){ discriminant <- (b^2) - (4*a*c) #Discriminant if(discriminant == 0){ # Real and equal roots root <- (-b/(2*a)) return(c(root, root)) } else if(discriminant > 0){ # Distinct real roots root1 <- ((-b + sqrt(dis...
package shape; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Polygon; /** * Used to draw different shapes */ public class Stamp extends Point { private Shape shape; private int x1; private int y1; private int stroke; ...
import React from 'react'; import './NavBar.css' import HeaderAnchor from './HeaderAnchor' const NavBar = ()=>{ const styleHome = { fontSize: 'large', paddingLeft: 10, paddingRight: 10, paddingTop: 10, paddingBottom: 10 }; const rest ={ paddingTop: 10, ...
<filename>test/js/logger_test.js var expect = require('chai').expect; var requireHelper = require('./util/require_helper'); var log = requireHelper('util/Logger'); describe('Logger Tests', function () { it('should have debug, info and error function', function () { expect(log.debug).to.be.a.function; ...
REM DefaultTest.sql REM Chapter 9, Oracle9i PL/SQL Programming by <NAME> REM This script shows different ways of calling a procedure REM with default parameters. set serveroutput on CREATE OR REPLACE PROCEDURE DefaultTest ( p_ParameterA NUMBER DEFAULT 10, p_ParameterB VARCHAR2 DEFAULT 'abcdef', p_ParameterC DAT...
#!/usr/bin/env bash alias mslack-term='slack-term -config $DOTFILES/slack-term/default.json'
<gh_stars>1000+ # test % operation on big integers delta = 100000000000000000000000000000012345 for i in range(11): for j in range(11): x = delta * (i - 5) y = delta * (j - 5) if y != 0: print(x % y) # these check an edge case on 64-bit machines where two mpz limbs # are used ...
// Define a function to calculate the discount rate and price after discount func updateDiscountFields() { // Assuming discRate and priceAfterDisc are the calculated values let discRate = calculateDiscountRate() // Replace with the actual calculation let priceAfterDisc = calculatePriceAfterDiscount() // Rep...
class MonsterIndex::Monster attr_accessor :name, :size_type, :hit_dice, :initiative, :speed, :ac, :attack, :alignment, :url @@all = [] def initialize(monster_hash = {}) monster_hash.each {|key, value| self.send(("#{key}="), value)} @@all << self end def self.create_from_collection(monster_array) ...
import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; import { doLogin, doSwissLogin } from './login'; import { doProcessMainActionsChange, doProcessDelegationChange, doProcessBvChange, doProcessActionTitleChange } from './database'; admin.initializeApp({ databaseURL: "https://d...