text
stringlengths
1
1.05M
#!/bin/sh # # Smart confirm-before kill-pane command. Only asks for confirmation when # killing a child process. set -o errexit -o nounset tmux_run() ( pane_pid="$(tmux list-panes -F "#{pane_active}:#{pane_pid}" | grep '^1:' | cut -c 3-)" escaped_cmd="$(echo "$*" | sed 's/;/\\\;/g')" if pgrep -P "$pane_p...
/* * Copyright (C) 2015-2019 Lightbend Inc. <https://www.lightbend.com> */ package akka.http.impl.engine.ws import scala.concurrent.{ Await, Promise } import scala.concurrent.duration.DurationInt import akka.http.scaladsl.Http import akka.http.scaladsl.model.HttpRequest import akka.http.scaladsl.model.Uri.apply imp...
import LanguageContext from '../../../contexts/languageContext'; import SessionContext from '../../../contexts/sessionContext'; import {Button, Card, Table} from 'react-bootstrap'; import {refreshPage} from '../../sharedResources'; import {useContext, useState} from 'react'; const Beatmap = props => { const {beatmap,...
import { SuggestionDocument } from './models'; export type Href = string; export function reduceByLocation( suggestions: Array<Partial<SuggestionDocument>> ): Map<Href, Array<Partial<SuggestionDocument>>> { const result = suggestions.reduce< Map<Href, Array<Partial<SuggestionDocument>>> >((mapp, sugg) => { ...
var searchData= [ ['world_2eh',['World.h',['../World_8h.html',1,'']]] ];
package com.klk.mobilefingerprint.dialogs; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import com.klk.mobilefingerprint.R; public class ConfirmFinishEnrollDialog extends AlertDialog.Builder { private int mId; private int mFingerTotal; private C...
<reponame>rovedit/Fort-Candle #pragma once #include <type_traits> namespace tg { using u8 = unsigned char; using u16 = unsigned short; using u32 = unsigned int; using u64 = unsigned long long; using size_t = decltype(sizeof(0)); namespace detail { struct unused; struct true_type { static constexpr bool value =...
<gh_stars>1-10 "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.u2B06 = void 0; var u2B06 = { "viewBox": "0 0 2600 2760.837", "children": [{ "name": "path", "attribs": { "d": "M1943 1461h-406v818h-479v-818H656l643-877z" }, "children": [] }] }; exports.u...
def is_valid_mul_table(matrix): num_list = set() for row in matrix: for item in row: num_list.add(item) length = int(len(matrix) ** 0.5) if len(num_list) != (length ** 2): return False for num in range(1,length ** 2 + 1): if num not in num_list: return False return True
<reponame>XxSEGxX/pro-core package me.atog.procore.api; import org.bukkit.plugin.java.JavaPlugin; public interface ProPlugin extends JavaPlugin { }
(function ($) { var headUploader; headUploader = WebUploader.create({ swf: 'static/webuploader/Uploader.swf', server: '/upload', pick: '#head-upload', fileNumLimit: 1, fileSizeLimit: 10 * 1024 * 1024, // 10 M fileSingleSizeLimit:10* 1024 *1024, auto: ...
/** * @copyright Copyright 2021 <NAME> <<EMAIL>> * @license MIT */ import assert from 'assert'; import deepFreeze from 'deep-freeze'; import RemovePathsWithServersTransformer from '../remove-paths-with-servers.js'; describe('RemovePathsWithServersTransformer', () => { it('removes path items with servers', () =>...
<gh_stars>1-10 package imports.k8s; /** * PodList is a list of Pods. */ @javax.annotation.Generated(value = "jsii-pacmak/1.14.1 (build 828de8a)", date = "2020-11-30T16:28:28.041Z") @software.amazon.jsii.Jsii(module = imports.k8s.$Module.class, fqn = "k8s.PodList") public class PodList extends org.cdk8s.ApiObject { ...
#!/bin/sh -e # # Copyright (c) 2009-2017 Robert Nelson <robertcnelson@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights...
package io.dronefleet.mavlink.uavionix; import io.dronefleet.mavlink.annotations.MavlinkEntryInfo; import io.dronefleet.mavlink.annotations.MavlinkEnum; /** * Emergency status encoding */ @MavlinkEnum public enum UavionixAdsbEmergencyStatus { /** * */ @MavlinkEntryInfo(0) UAVIONIX_ADSB_OUT_...
import { List } from './List'; /** * Transform a [[List]] into an [[Union]] * @param L to transform * @returns [[Any]] * @example * ```ts * ``` */ export declare type UnionOf<L extends List> = L[number];
# Import necessary libraries import pandas as pd from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB # Load the data set df = pd.read_csv('sentiment.csv') # Get the features and target values X = df['text'] y = ...
<filename>node_modules/botframework-connector/lib/auth/appCredentials.d.ts /** * @module botframework-connector */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import * as msrest from '@azure/ms-rest-js'; import * as adal from 'adal-node'; /** * General AppC...
#!/bin/bash # Check Privilege # Make sure only root can run our script echo "正在检查权限 Checking Privilege ..." if [ "$(id -u)" != "0" ]; then echo "失败: 请用Root身份运行此脚本. 是不是忘了sudo?" 1>&2 echo "Fail: This script must be run as root. perhaps forget sudo?" 1>&2 exit 1 fi echo "成功 Success" echo "" echo "正在将自启动脚本复...
<filename>dist/utils/is-object.js 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var isObject = function isObject(x) { return x !== null && x !== undefined && x.constructor && x.constructor.name === 'Object'; }; exports.default = isObject;
<gh_stars>1-10 package trips import ( "errors" "strings" "github.com/bradpurchase/grocerytime-backend/internal/pkg/db" "github.com/bradpurchase/grocerytime-backend/internal/pkg/db/models" "github.com/bradpurchase/grocerytime-backend/internal/pkg/stores" uuid "github.com/satori/go.uuid" "gorm.io/gorm" ) // Add...
import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression # Load the dataset data = pd.read_csv('people.csv') # Split the features and labels X = data[['Name']] y = data['Age'].values # Create and train the model model = LinearRegression().fit(X, y) # Make predictions with the model ...
#!/usr/bin/env bash echo "[+] Compiling" cd src && make && cd - echo "[+] Going to flasher mod" python3 go_flasher.py sleep 3 avrdude -p m8515 -c avrisp2 -P /dev/ttyACM0 -U flash:w:`ls src/build/aes*.hex`:i -U eeprom:w:`ls src/build/eedata*.hex`:i echo "[+] Please restart your LEIA board to go back to nominal mode...
#!/bin/bash if [ -z "$SERVERLESSBENCH_HOME" ]; then echo "$0: ERROR: SERVERLESSBENCH_HOME environment variable not set" exit fi source $SERVERLESSBENCH_HOME/local.env couchdb_url=http://$COUCHDB_USERNAME:$COUCHDB_PASSWORD@$COUCHDB_IP:$COUCHDB_PORT SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/n...
#!/usr/bin/env bash conda activate TextRecognitionDataGenerator source env_setup.sh round() { printf "%.${2}f" "${1}" } INPUT_PATH='./texts/number+symbol_texts.txt' imgH=64 num_imgs=$((240*1)) # Train / Test ratio (8:2) train_ratio=0.8 test_ratio=$(echo "1 - $train_ratio" | bc -l) train_basic_cnt=$(round $(echo "...
import Queue from './queue.js' import defaults from './defaults.js' let queue = new Queue(function () { return defaults.concurrency }) export default function wxRequest(options) { let promise = new Promise(function (resolve, reject) { let request = null, cancel = false if (options.cancelToken) { op...
export const fillAndStrokeText = text => (ctx, offset) => { ctx.font = `${text.fontStyle} ${text.fontWeight} ${text.fontSize}px ${text.fontFamily}`; ctx.textBaseline = text.baseline; ctx.textAlign = text.align; const { textContent } = text.cropAndMeasure() const x = text.x + offset.x; const y = text.y + of...
<reponame>hexbee-net/parquet-go<filename>file-reader.go package parquet import ( "bytes" "encoding/binary" "io" "strings" "github.com/hexbee-net/errors" "github.com/hexbee-net/parquet/compression" "github.com/hexbee-net/parquet/layout" "github.com/hexbee-net/parquet/parquet" "github.com/hexbee-net/parquet/sc...
#!/bin/bash #SBATCH -N 2 #SBATCH -p GPU #SBATCH --ntasks-per-node 28 #SBATCH -t 5:00:00 #SBATCH --gres=gpu:p100:2 SEQ="./seqs/RFAM/RF02543.fasta" CMD="./bin/cuda_sankoff" OPT="" OUT="gpu" module avail cuda module load cuda set -x #run GPU program cd $HOME"/hpc_foldalign" strace -ve wait4 /usr/bin/time -v $CMD $OPT $...
import execa = require("execa"); import { codechecks } from "@codechecks/client"; import { visRegCodecheck } from "@codechecks/vis-reg"; import { dir as tmpDir } from "tmp-promise"; import { UserOptions, parseUserOptions } from "./options"; export async function visRegStorybook(_options: UserOptions = {}): Promise<vo...
/** * Author: <NAME> * Dijkstra's Algorithm implementation in JavaScript * Dijkstra's Algorithm calculates the minimum distance between two nodes. * It is used to find the shortes path. * It uses graph data structure. */ function createGraph( V, E ) { // V - Number of vertices in graph // E - Number of edges...
const http = require('http'); const date = new Date(); const requestHandler = (req, res) => { if (req.url === '/status') { res.writeHead(200, {'Content-Type': 'application/json'}); res.end(JSON.stringify({time: date.toGMTString()})); } else { res.writeHead(404); res.end(); } }; const server = http.createServer...
<gh_stars>1-10 'use strict'; import views from './views'; import sidemenu from './sidemenu'; import modals from './modals'; export { // views: views, // modals: modals, // sidemenu: sidemenu };
package com.qurux.coffeevizbeer.exceptions; /** * Created by <NAME> on 06-12-2016. */ public class NullUserException extends Exception { public NullUserException() { super("Your details are not loaded yet"); } }
colour_base00="28/2c/34" colour_base01="35/3b/45" colour_base02="3e/44/51" colour_base03="54/58/62" colour_base04="56/5c/64" colour_base05="ab/b2/bf" colour_base06="b6/bd/ca" colour_base07="c8/cc/d4" colour_base08="e0/6c/75" colour_base09="d1/9a/66" colour_base0a="e5/c0/7b" colour_base0b="98/c3/79" colour_base0c="56/b6...
#!/usr/bin/env bats load _helpers @test "ingressGateways/ServiceAccount: disabled by default" { cd `chart_dir` assert_empty helm template \ -s templates/ingress-gateways-serviceaccount.yaml \ . } @test "ingressGateways/ServiceAccount: enabled with ingressGateways, connectInject enabled" { cd `char...
/* * Copyright (c) 2015, Freescale Semiconductor, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, this list...
#!/usr/bin/env bash {{! Template adapted from here: https://github.com/chriskempson/base16-builder/blob/master/templates/gnome-terminal/dark.sh.erb }} # Base16 Mexico Light - Gnome Terminal color scheme install script # Sheldon Johnson [[ -z "$PROFILE_NAME" ]] && PROFILE_NAME="Base 16 Mexico Light 256" [[ -z "$PRO...
#!/bin/bash # Function to set the system timezone set_timezone() { timezone=$1 sudo timedatectl set-timezone $timezone echo "System timezone set to $timezone" } # Function to enable unattended upgrades enable_unattended_upgrades() { sudo apt-get install unattended-upgrades sudo dpkg-reconfigure --...
# Copyright 2015 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 # # Unless required by applicable law or agreed to in writing,...
import uuid def generate_unique_id(n): unique_ids = set() for i in range(1, n+1): unique_id = uuid.uuid4() unique_ids.add(unique_id) return unique_ids # Driver Code if __name__ == "__main__": number_of_ids = 2000000 print(generate_unique_id(number_of_ids))
package cyclops.stream.spliterator.push; import cyclops.reactive.ReactiveSeq; import java.util.Spliterator; import java.util.Spliterators.AbstractSpliterator; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.LockSupport; import java.util.function.Consumer; public class ValueEmitti...
REM FILE NAME: st_proc.sql REM LOCATION: Object Management\Functions,Procedures, and Packages\Reports REM FUNCTION: Generate a list of stored code REM TESTED ON: 7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1 REM PLATFORM: non-specific REM REQUIRES: dba_objects REM REM This is a part of the Knowledge Xpert for Oracle ...
import component from './PeopleSelector' export default component
#!/usr/bin/env bash trap 'rm -rf "${WORKDIR}"' EXIT [[ -z "${WORKDIR}" || "${WORKDIR}" != "/tmp/"* || ! -d "${WORKDIR}" ]] && WORKDIR="$(mktemp -d)" [[ -z "${CURRENT_DIR}" || ! -d "${CURRENT_DIR}" ]] && CURRENT_DIR=$(pwd) # Load custom functions if type 'colorEcho' 2>/dev/null | grep -q 'function'; then : else ...
import React from 'react' import MainContent from '../components/MainContent'; const IndexPage = () => ( <MainContent /> ); export default IndexPage;
class SimpleOnnxConverter: def __init__(self, model): self.model = model def convert_to_onnx(self): try: # Simulate the conversion process # Replace the following line with actual conversion logic onnx_model = f"{self.model}_onnx" return f"Convers...
#; #; filep='Do something.' echo '' echo '* Summary: $filep' #; function fct1() { echo '' echo "Hello World from function fct1." } #; $1 #;
<gh_stars>0 export { GmailPlugin } from './Plugin'; export { IGoogleRateLimiter, GoogleRateLimiter } from './RateLimiter';
<reponame>jrfaller/maracas package mainclient.classTypeChanged; import main.classTypeChanged.ClassTypeChangedI2C; public class ClassTypeChangedI2CImp implements ClassTypeChangedI2C { }
use Eraple\Core\App; use Eraple\Core\Task; class SampleTaskHandlesReplaceTaskEvent extends Task { public function handleEvent($event) { if ($event instanceof ReplaceTaskEvent) { // Replace specific task handles within the application // Your implementation logic here } ...
<reponame>hou-2021/hou-2021.github.io import { createRouter, createWebHistory } from "vue-router"; import Home from '../views/home.vue' const routes = [{ path: '', require: Home }, { path: '/home', component: Home, meta: { title: '首页' }, } ]; const router = createRouter({ his...
<filename>index.js 'use strict'; var utils = require('expand-utils'); var define = require('define-property'); var Target = require('expand-target'); var Task = require('expand-task'); var use = require('use'); /** * Expand a declarative configuration with tasks and targets. * Create a new Config with the given `op...
public class SwapExample{ public static void main(String args[]){ int x = 7; int y = 9; System.out.println("Before Swapping - x: "+x+", y: "+y); swap(x, y); System.out.println("After Swapping - x: "+x+", y: "+y); } public static void swap(int x, int y){ // Interchange the values of x and y int temp =...
#!/bin/bash # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); y...
def swap(arr, idx1, idx2): arr[idx1], arr[idx2] = arr[idx2], arr[idx1] arr = [10, 20, 30, 40, 50] swap(arr, 3, 4) print(arr)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const express_1 = require("express"); const login_controller_1 = require("../controller/login.controller"); class LoginRoute { constructor() { this.router = express_1.Router(); this._config(); } _config() { ...
#!/bin/sh # # Copyright (C) 2010, 2012 Internet Systems Consortium, Inc. ("ISC") # # 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 copies. # # THE SOFTWARE IS ...
#!/usr/bin/env bash bash <(curl -Ss https://my-netdata.io/kickstart.sh) --non-interactive all
import os def search_files(directory, extension): filenames = [] for root, dirs, files in os.walk(directory): for file in files: if file.endswith(extension): filenames.append(os.path.join(root, file)) return filenames filenames = search_files('./sample_files', '*.py')...
#!/bin/bash set -uo pipefail # shellcheck disable=SC2155 export DEFAULT_ZITI_HOME_LOCATION="${HOME}/.ziti/quickstart/$(hostname)" export ZITI_QUICKSTART_ENVROOT="${HOME}/.ziti/quickstart" ASCI_WHITE='\033[01;37m' ASCI_RESTORE='\033[0m' ASCI_RED='\033[00;31m' ASCI_GREEN='\033[00;32m' ASCI_YELLOW='\033[00;33m' ASCI_B...
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } // Create a model class for the table public class ...
<gh_stars>10-100 //##################################################################### // Copyright 2005, <NAME>, <NAME>, <NAME>. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //##################################################...
<filename>db/models.py from django.db import models consequence_choices = ["m","k","b"] class User(models.Model): u_id = models.CharField(max_length=255,verbose_name="User id, slack",primary_key=True) categories = models.CharField(max_length=1024,verbose_name="personal categories",default=None,null=True) ...
package demo; import static org.mockito.Mockito.*; import static org.mockito.Mockito.mock; import demo.impl.UserModel; import demo.impl.UserService; import org.junit.Test; import org.junit.runner.RunWith; import org.noear.solon.test.SolonJUnit4ClassRunner; import java.util.List; /** * @author noear 2021/4/14 creat...
/** * Copyright(c) u-next. */ package org.docksidestage.app.web.lido.sea; import org.docksidestage.dbflute.allcommon.CDef; import org.lastaflute.web.validation.Required; /** * @author x-zeng */ public class LidoSeaBody { public Integer productId; public String productName; @Required public CDef.P...
/* * Gets the schedules of the flights */ require('date-utils'); var getValidDateLimits = require('../lib/UtilityFunctions/getValidDateLimits'); var getAirportCities = require('../lib/getAirportCities'); var async = require('async'); function getFlightData(conn, rome2RioData, dateSet,budget, dates, times, ratingRa...
//##################################################################### // Copyright 2009, <NAME>. // This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt. //##################################################################### #include <Phy...
<filename>src/components/Sobre/index.tsx<gh_stars>0 import React from 'react' import * as S from './styled' const Sobre = () => ( <S.SectionWrapper> <S.Title> Fala ai Dev Blz?? </S.Title> <S.Text> Meu nome Filipe e trabalho com Desenvolvimento a um longo,longo tempo.. Am...
#!/bin/sh ./autogen.sh CFLAGS=-DDBL_EPSILON=__DBL_EPSILON__ ./configure --enable-maintainer-mode --prefix=${ZCPREF} --host=${ZCHOST} --build="$(${ZCTOP}/zcbe/config.guess)" --with-libgpg-error-prefix=${ZCPREF} --with-libassuan-prefix=${ZCPREF} make make install make distclean exit 0
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * 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...
# Python program to find the sum of # all prime numbers in a given interval # Fucntion to calculate the sum of all prime numbers in a given range def prime_sum_in_range(start, end): # Initialize sum of primes prime_sum = 0 # loop through each number from start to end for num in range(star...
# Specifying API routes Routes = [ { 'path': '/login', 'method': 'POST', 'handler': 'login_handler' }, { 'path': '/upload', 'method': 'POST', 'handler': 'upload_handler' }, { 'path': '/users/{user_id}', 'method': 'GET', 'handler': 'get_user_handler' }, { 'path': '/users/{user_id}', 'method': 'PUT'...
<reponame>hmrc/claim-tax-refund-frontend<filename>test/base/SpecBase.scala<gh_stars>1-10 /* * Copyright 2021 HM Revenue & Customs * * 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 * * ...
#!/bin/bash set -e source ./lifecycle/common.sh checkRegionProvided "$1" ./lifecycle/prepare/prepare-deploy-backend.sh "$1" ./lifecycle/prepare/prepare-deploy-frontend.sh "$1" APP_NAME=$(getGlobalParam "appName") cdk deploy $APP_NAME-$1
#!/bin/sh go run /setup/load_and_run_files.go
<reponame>seants/integrations-core<filename>vsphere/datadog_checks/vsphere/cache_config.py # (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import threading from collections import defaultdict class CacheConfig: """ Wraps configuration and status for t...
#!/bin/bash for id in $(openstack user list | grep $1 | awk {'print $2'}) do openstack user delete $id done # To use: $ . this_script.sh mark_word # For instance: . this_script.sh create to delete all user contain "create" in name
public static void quickSort(int[] array, int left, int right) { int index = partition(array, left, right); if (left < index - 1) { quickSort(array, left, index -1); } if (index < right) { quickSort(array, index, right); } } public static int partition(int[] array, int left, int rig...
/** * <p>Title: liteflow</p> * <p>Description: 轻量级的组件式流程框架</p> * @author Bryan.Zhang * @email <EMAIL> * @Date 2020/4/1 */ package com.yomahub.liteflow.entity.data; import java.text.MessageFormat; public class CmpStep { private String nodeId; private CmpStepType stepType; public CmpStep(String nodeId, CmpSt...
from findfiles import Window from PySide import QtCore #=================================================================================================== # test_basic_search #=================================================================================================== def test_basic_search(qtbot, tmpdir): ...
import requests # api-endpoint URL = "https://www.example.com/api/v1/data" # location given here # sending get request and saving the response as response object r = requests.get(url = URL) # extracting data in json format data = r.json() # extracting latitude, longitude and formatted address # ...
import handleRequest from '../../src/handler' import makeServiceWorkerEnv from 'service-worker-mock' import docsData from '../../src/apps/alphafold/docs' declare var global: any const setup = () => { Object.assign(global, makeServiceWorkerEnv()) jest.resetModules() } describe('/alphafold', () => { beforeEach(s...
import json def json_compare(json1, json2): # convert both the JSON objects to Python dictionary json1_dict = json.loads(json1) json2_dict = json.loads(json2) # check if the keys are equal if (json1_dict.keys() == json2_dict.keys()): # if keys are equal, check if the values ...
package com.aivinog1.cardpay; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import static org.junit.Assert.*; @RunWith(Spr...
import nltk import numpy as np import random import string # Read in the corpus with open('chatbot.txt') as file: data = file.readlines() # Tokenize the corpus data = [line.lower().replace('\n', '').split(' ') for line in data] # Build the word dictionary word_dict = {} for line in data: for word in line: if wor...
package training.linkedlist; import org.junit.jupiter.api.Test; import java.util.function.BiFunction; import static training.linkedlist.ListNode.*; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; /** * 合并两个排序的链表,并将其作为排序表返回。该列表应通过将前两个列表的节点拼接在一起制成...
/* * 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 ...
set -euo pipefail . "`cd $(dirname ${BASH_SOURCE[0]}) && pwd`/../../helper/helper.bash" env=`cat "${1}/env"` shift key="${1}" if [ -z "${key}" ]; then echo "[:(] arg 'key' is empty, exit" >&2 exit 1 fi pp=`env_val "${env}" "${key}"` echo "${key} = ${pp}"
""" Normalize a given list of strings """ def normalize(lst): output = [] for item in lst: output.append(item.lower()) return output if __name__ == '__main__': input_list = ['Red', 'red', 'WhITE', 'white', 'bLUE', 'blue'] print(normalize(input_list))
<reponame>yakky/microservice-talk<filename>tests/test_api.py<gh_stars>0 from urllib.parse import urlencode import httpx import pytest from book_search.main import app @pytest.mark.asyncio async def test_search_basic(load_books): async with httpx.AsyncClient(app=app, base_url="http://testserver") as client: ...
<reponame>jab142/tasktimer package com.ergdyne.tasktimer; import android.content.ContentProvider; import android.content.ContentValues; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteQueryBuilder; import android....
<gh_stars>0 #include <gtest/gtest.h> #include "cc/motor.h" #include "tests/arduino_simulator.h" namespace markbot { namespace { const unsigned int ENABLE_PIN = 40; const unsigned int DIR_PIN = 41; const unsigned int STEP_PIN = 42; void InitMotor(tensixty::FakeArduino &arduino, Motor *motor) { MotorInitProto init_p...
<?php //get weather data from API $weatherData = file_get_contents('api.com/weather'); $data = json_decode($weatherData); //get current temperature $currentTemperature = $data->current->temperature; //get forecast $forecast = $data->forecast; //display data on web page echo '<h1>' . $currentTemperature . '&deg;...
<gh_stars>0 import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Observable, throwError } from 'rxjs'; import { first, map } from 'rxjs/operators'; import { InjectorInstance } from '../hal-form-client.module'; import { ContentTypeEnum } from './content-type.enum'; import { HTTP_METHODS, HttpMethodEn...
import { useState } from 'react'; import Head from 'next/head'; import { useFormik } from 'formik'; import axios from 'axios'; import Header from '../components/Header'; import { useCart } from '../contexts/CartContext'; import { formatPrice } from '../util/format'; function Cart() { const [orderStatu...
<filename>src/grapher.h #pragma once #ifndef _GRAPHER_h #define _GRAPHER_h #if defined(ARDUINO) && ARDUINO >= 100 #include "arduino.h" #else #include "WProgram.h" #endif #include "global.h" #include "funktionBuffer.h" #include "settings.h" #include "graph.h" #include "funktion.h" #include "ILI934...
(function (factory) { 'use strict'; /* global define:false */ if (typeof define !== 'undefined' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { module.exports = factory(require('jquery')); } else { factory(window.jQuery...
package com.ice.restring; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.support.design.widget.BottomNavigationView; import android.util.AttributeSet; import android.util.Pair; import android.util.Xml; import android.view.View; import org.xmlpull.v1.XmlPullParser; i...
<filename>src/components/ScrollWrapper.js<gh_stars>0 import React from 'react' import styled from 'styled-components' import Menu from './Menu' export const ScrollArea = styled.main` height: 100vh; max-width: 2000px; margin: 0 auto; width: 100vw; overflow-x: hidden; overflow-y: scroll; -webkit-overflow-s...