text stringlengths 1 1.05M |
|---|
<reponame>mowangblog/SpringCloud-Demo<filename>cloudalibaba-config-nacos-client/src/main/java/top/mowang/cloud/controller/ConfigClientController.java
package top.mowang.cloud.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
... |
#!/bin/bash
cd /etc/munin/plugins/ && ln -s /usr/share/munin/plugins/mongo_btree ./
cd /etc/munin/plugins/ && ln -s /usr/share/munin/plugins/mongo_conn ./
cd /etc/munin/plugins/ && ln -s /usr/share/munin/plugins/mongo_lock ./
cd /etc/munin/plugins/ && ln -s /usr/share/munin/plugins/mongo_mem ./
cd /etc/munin/plugins/ ... |
#!/bin/bash
# Copyright 2019 The Kythe 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 required by a... |
def proc1(proxy, name)
proxy.process(name){ pid_file "#{name}.pid" }
end |
/********************************************************************************************************
* @file usb_ctrl.c
*
* @brief This file provides set of functions to manage the USB interface
*
* @author <EMAIL>
* @date Oct. 8, 2016
*
* @par Copyright (c) 2016, Telink Semiconductor (Sh... |
#!/bin/bash
set -u
#
# Algolia Diag v2
#
DEBUG=0
PINGS=20
TRACE_WAIT=2
TRACE_HOPS=30
CURL_TIMEOUT=5
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
NC='\033[0m'
#
_print_green() {
echo -ne "${GREEN}$1${NC}"
}
_print_red() {
echo -ne "${RED}$1${NC}"
}
_print_orange() {
echo -ne "${ORA... |
<reponame>naga-project/webfx
package javafx.beans.property;
import com.sun.javafx.binding.ExpressionHelper;
import javafx.beans.InvalidationListener;
import javafx.beans.value.ChangeListener;
/**
* Base class for all readonly properties wrapping an {@code int}. This class provides a default
* implementation to atta... |
<gh_stars>0
package com.donler.gym.model;
import com.donler.gym.util.MD5Utils;
import com.donler.gym.util.NullCheckUtils;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.co... |
<reponame>nimbus-cloud/cli
package user_test
import (
. "cf/commands/user"
"cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
testapi "testhelpers/api"
testassert "testhelpers/assert"
testcmd "testhelpers/commands"
testconfig "testhelpers/configuration"
testreq "testhelpers/requirements"
testt... |
#!/bin/bash
set -o verbose
# ------------
cd /tmp/new-repo
# ------------
git checkout $1
# ------------
git rebase $2
|
<filename>examples/ex_k8s/oas_router_gen.go<gh_stars>0
// Code generated by ogen, DO NOT EDIT.
package api
import (
"bytes"
"context"
"fmt"
"io"
"math"
"math/bits"
"net"
"net/http"
"net/url"
"regexp"
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/go-faster/errors"
"github.com/go-faster/jx"
"g... |
<gh_stars>0
/**
* Predicate for a given type T.
*/
export type Predicate<T> = (value: T, ...args: any[]) => boolean;
|
// 组合算法
const combination = function (arr, size) {
var r = [];
function _(t, a, n) {
if (n === 0) {
r[r.length] = t;
return;
}
for (var i = 0, l = a.length - n; i <= l; i++) {
var b = t.slice();
b.push(a[i]);
_(b, a.slice(i + 1), n - 1);
... |
#!/bin/bash
# global variables
NOW=`date +"%Y%m%d_%H%M%S"`
SCRIPT_DIR="$(realpath "$(dirname "$0")")"
SPOT_DIR="$(realpath "$(dirname "$SCRIPT_DIR")")"
NS_PATH="$SPOT_DIR/scripts"
echo "INIT SCRIPT STARTING..."
echo "SCRIPT_DIR: $SCRIPT_DIR"
echo "SPOT_DIR: $SPOT_DIR"
echo "NS_PATH: $NS_PATH"
echo
echo '-------------... |
#!/bin/bash
### Install Robot Operating System (ROS) kinetic and setsup a Catkin workspace on Ubuntu systems
### Information from:
### https://www.tensorflow.org/install/install_linux
###
### usage installTensorFlow.sh [-h|--help] [-p|--python p -g|--use_gpu]
DEFAULTPYTHON="3"
DEFAULTGPUUSE="n"
usage="$(basename "$0"... |
#! bash oh-my-bash.module
source "$OSH/themes/powerline/powerline.base.sh"
function __powerline_last_status_prompt {
[[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}"
}
function __powerline_right_segment {
local OLD_IFS="${IFS}"; IFS="|"
local params=( $1 )
IFS="${OLD... |
#!/bin/bash
set -ueo pipefail
# Source config script
JAMR_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." > /dev/null && pwd )"
. "${JAMR_HOME}/scripts/config_Little_Prince.sh"
mkdir -p "$JAMR_HOME/data/AMR-Bank-v1.4"
pushd "$JAMR_HOME/data/AMR-Bank-v1.4"
for split in training dev test; do
file=amr-bank-struct-... |
require File.expand_path('../../../shared/complex/image', __FILE__)
describe "Complex#imaginary" do
it_behaves_like :complex_image, :imaginary
end
|
# Copyright 2020 The Google Research 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 agree... |
import math
radius = float(input("Please enter the radius of the circle: "))
# calculate the area of the circle
area = math.pi * radius**2
# print the area of the circle
print("The area of the circle is: ", round(area, 2)) |
#: * `update` [<options>]
#:
#: Fetch the newest version of Homebrew and all formulae from GitHub using `git`(1) and perform any necessary migrations.
#:
#: --merge Use `git merge` to apply updates (rather than `git rebase`).
#: --preinstall Run on auto-updates (e.g.... |
go test -tags=chaos -race
|
//
// NrField.hpp
// AxiSEM3D
//
// Created by <NAME> on 3/14/20.
// Copyright © 2020 <NAME>. All rights reserved.
//
// base class of Nr(s,z)
#ifndef NrField_hpp
#define NrField_hpp
#include "eigen_generic.hpp"
#include <memory>
// need distance tolerance for NrFieldPointwise
class ExodusMesh;
namespace eige... |
<filename>cloud-yblog-article/cloud-yblog-article2801/src/main/java/com/boot/dao/DraftMapper.java
package com.boot.dao;
import com.boot.pojo.Draft;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype... |
#!/bin/bash
mkdir -p /var/lib/faasd/secrets/
echo ${basic_auth_user} > /var/lib/faasd/secrets/basic-auth-user
echo ${basic_auth_password} > /var/lib/faasd/secrets/basic-auth-password
export FAASD_DOMAIN=${domain}
export LETSENCRYPT_EMAIL=${email}
curl -sfL https://raw.githubusercontent.com/openfaas/faasd/master/hack... |
<filename>test/models/TestSearchComment.java
package models;
import org.junit.Before;
//import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.junit... |
#!/bin/bash
# ##############################################################################
# <setup.sh>
#
# Created on: December 11th, 2017
# Author: Ricardo Tubío (rtpardavila[at]gmail.com)
#
# This file is part of the toolbox suite of automated scripts.
# <install-packages.sh> script is free software: you can... |
<filename>catalog-rest-service/src/main/java/org/openmetadata/catalog/jdbi3/ChartRepository.java
/*
* 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.
* ... |
yarn download:docs-tidb:zh
yarn download:docs-tidb:zh --ref release-5.0
yarn download:docs-tidb:zh --ref release-4.0
yarn download:docs-tidb:zh --ref release-3.1
yarn download:docs-tidb:zh --ref release-3.0
yarn download:docs-tidb:zh --ref release-2.1
|
#!/bin/sh
#/ Usage: test.sh <pkg_ident>
#/
#/ Example: test.sh core/php/7.2.8/20181108151533
#/
set -euo pipefail
source "$(dirname "${0}")/../../bin/ci/test_helpers.sh"
if [[ -z "${1:-}" ]]; then
grep '^#/' < "${0}" | cut -c4-
exit 1
fi
TEST_PKG_IDENT="${1}"
export TEST_PKG_IDENT
hab pkg install core/bats --bin... |
# Algorithm for 8 Puzzle Problem
# Initialize the start state of the 8 puzzle
start_state = [[4,1,2],
[3,5,6],
[7,0,8]]
# Initialize a stack to store the valid moves
move_stack = []
# Define a function to check a state is valid or not
def isValid(state):
# Check if the state satis... |
#https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
mkdir -p build
cd build
arm-none-eabi-gcc -Wall -Os -Werror -fno-common -mcpu=cortex-m3 -mthumb -msoft-float -DLA104 -MD -I ../ -c ../main.c
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -o output.elf -nostartfiles -T ../app.lds ./main.o
arm-none-eab... |
import type { ButtonProps } from "./Button.types";
import type React from "react";
import classNames from "@sindresorhus/class-names";
import styled from "styled-components";
const ButtonMarkup: React.FC<ButtonProps> = (props) => {
// prettier-ignore
const typeClasses: string = classNames(props.className, {
["fr-b... |
#!/bin/sh
cd
git init .
git remote add -t \* -f origin https://github.com/hugovdm/homedir.git
git remote set-url --push origin git@github.com:hugovdm/homedir.git
git checkout master
echo -n Email address:\
read email_address
git config --add user.name "Hugo van der Merwe"
git config --add user.email $email_address
git... |
from rest_framework import status
from rest_framework.test import APIRequestFactory, force_authenticate
from django.test import TestCase
class YourViewTestCase(TestCase):
def setUp(self):
self.factory = APIRequestFactory()
# Assuming self.users is a list of user objects
def test_valid_request_... |
<filename>src/main/java/evilcraft/api/config/configurable/ConfigurableBlockContainer.java
package evilcraft.api.config.configurable;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import ne... |
<!DOCTYPE html>
<html>
<head>
<title>Search Page</title>
<style>
.search-form {
display: flex;
}
</style>
</head>
<body>
<form class="search-form" action="/search" method="get">
<input type="search" name="query" placeholder="Search..." />
<input type="submit" value=... |
#include <vector>
#include <algorithm>
class StreamManager {
private:
std::vector<bool> streamAvailability;
std::vector<int> pendingItems;
public:
StreamManager(size_t numStreams) : streamAvailability(numStreams, true), pendingItems(numStreams, -1) {}
int acquire(size_t maxStreams) {
auto it ... |
import React from "react";
import Home from "./Home";
import renderer from "react-test-renderer";
it("Home component renders correctly", () => {
const tree = renderer.create(<Home></Home>).toJSON();
expect(tree).toMatchInlineSnapshot(`
<section
className="home"
>
<div
... |
<filename>src/components/desk/cards/feat/users-list.js
import React from 'react'
import { styled } from 'linaria/react'
import { AddUser } from './add-user'
import { UserInfo } from './user-info'
import icon from '@assets/icon.png'
import plus from '@assets/plus.png'
import { Icon } from '@ui'
export const UsersList... |
<reponame>EvanFabry/cython_numpy_to_cpp<filename>test-f.py
#!/usr/bin/env python
# test-f.py
import numpy as np
import func # loads f.so from cc-lib: f.pyx -> f.c + fc.o -> f.so
N = 30
a = np.arange(N, dtype=np.float64)
out = func.fpy_1d(a)
print ("fpy_1d -> fc z:\n", out, "\n")
out = func.fpy_2d(a.reshape((N // 2... |
# frozen_string_literal: true
module Avro
module Builder
# This concern is used to generate the full name for objects that may
# be namespaced.
module Namespaceable
def fullname
[namespace, name].compact.join('.')
end
end
end
end
|
<reponame>TheDarkPhoenix/2DRacing
#include "Box2DCar.h"
#include <iostream>
using namespace std;
///TDTire
TDTire::TDTire(b2World* world)
{
b2BodyDef bodyDef;
bodyDef.type = b2_dynamicBody;
m_body = world->CreateBody(&bodyDef);
b2PolygonShape polygonShape;
polygonShape.SetAsBox( 0.3125f, 0.78125... |
<reponame>mindhivenz/meteor-base
import Api from './Api'
import LocalStorage from './LocalStorage'
import Tracker from './Tracker'
import MongoMirror from './MongoMirror'
export default () => ({
api: new Api(),
Tracker: new Tracker(),
mongoMirror: new MongoMirror(),
storage: new LocalStorage(),
})
|
def find_max_value(lst):
# initialize max as the first number in the list
max = lst[0]
# loop through the list
for num in lst:
# compare current number with the max
if num > max:
# set the max to the current number
max = num
return max
if __name... |
<filename>client/src/app/event/detail/detail.component.ts
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {EventService} from "../event.service";
import {AuthService} from "../../auth/auth.service";
import {MapsAPILoader} from "@agm/core";
declare var $:... |
def copy_file(source_path: str, destination_path: str) -> None:
with open(source_path, 'r') as source_file:
content = source_file.read()
with open(destination_path, 'w') as destination_file:
destination_file.write(content) |
<filename>parameters-application/parameters-standalone-app/src/test/java/be/kwakeroni/parameters/app/ApplicationTest.java<gh_stars>1-10
package be.kwakeroni.parameters.app;
import be.kwakeroni.parameters.backend.api.Configuration;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import ... |
#!/bin/bash
trap 'onCtrlC' INT
function onCtrlC () {
echo 'Ctrl+C is captured'
for pid in $(jobs -p); do
kill -9 $pid
done
kill -HUP $( ps -A -ostat,ppid | grep -e '^[Zz]' | awk '{print $2}')
exit 1
}
threads=$1
gpus=$2
exc=$3
gpus=(${gpus//,/ })
exc=(${exc//,/ })
if [ ! $threads ]; then
threads=1... |
<reponame>noahzemlin/Dice-Parser
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class DiceParser {
private static SecureRandom random = new SecureRandom();
private static DiceToken currentT... |
package com.javaoracledoc.practice;
public interface Icar {
int changeGear();
int increaseSpeed(int newspeed);
int decreaseSpeed();
int changeColur();
}
|
class Node:
def __init__(self, key):
self.left = None
self.right = None
self.val = key
# Function to find the minimum value in a given BST
def minValue(node):
current = node
# loop down to find the leftmost leaf
while(current.left is not None):
current = curr... |
<gh_stars>0
$(document).ready(function(){
function injectJs(link) {
var scr = document.createElement('script');
scr.type="text/javascript";
scr.src=link;
$("body").append(scr)
}
injectJs(chrome.extension.getURL('injected.js'));
});
|
# frozen_string_literal: true
FactoryBot.define do
factory :zone do
sequence :name do |n|
"Test Zone #{n}"
end
sequence :description do |n|
"Test Zone Description #{n}"
end
region
bounding_box do
'0103000020E610000001000000050000002506819543AB3740' \
'3333333333D347... |
#!/bin/bash
FN="MafDb.ExAC.r1.0.nonTCGA.hs37d5_3.10.0.tar.gz"
URLS=(
"https://bioconductor.org/packages/3.14/data/annotation/src/contrib/MafDb.ExAC.r1.0.nonTCGA.hs37d5_3.10.0.tar.gz"
"https://bioarchive.galaxyproject.org/MafDb.ExAC.r1.0.nonTCGA.hs37d5_3.10.0.tar.gz"
"https://depot.galaxyproject.org/software/bioco... |
<filename>frontend/src/components/Button/Button.tsx<gh_stars>0
import React, { ReactNode } from 'react';
interface ButtonProps {
children: ReactNode | ReactNode[];
type: 'button' | 'submit' | 'reset' | undefined;
disabled?: boolean;
btnType?: string | undefined;
onClick?: () => void;
className?: string | u... |
#!/bin/bash
#SBATCH --partition=aaiken
#SBATCH --tasks=1
#SBATCH --nodes=1
#SBATCH --cpus-per-task=10
#SBATCH --gres=gpu:4
#SBATCH --exclusive
#SBATCH --time=00:05:00
source /home/groups/aaiken/eslaught/tutorial/env.sh
srun regent 3.rg -hl:prof_logfile prof3_%.gz -lg:prof 1 -ll:cpu 4
|
import React from "react"
import Talk from "../components/Talk"
import data from "../data/talks"
import Layout from "../components/layout"
const Talks = () => {
return (
<Layout>
{data.map(talk => (
<Talk talk={talk} />
))}
</Layout>
)
}
export default Talks
|
package main
import (
"fmt"
)
func binarySearch(list []int, val int) int {
guess := 0
low := 0
high := len(list) - 1
for low <= high {
guess = (low + high) / 2
if list[guess] == val {
return guess
}
if list[guess] < val {
low = guess + 1
} else if list[guess] > val {
high = guess - 1
... |
masters=$1
workers=$2
loadbalancer=$3
etcds=$4
#Admin cert
{
cat > admin-csr.json <<EOF
{
"CN": "admin",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"L": "Portland",
"O": "system:masters",
"OU": "Kubernetes The Hard Way",
"ST": "Oregon"
}
]
}
E... |
export enum Status{
true = 0,
false = 1,
}
export const getStatusEnum = {
0: true,
1: false,
};
export function getStatus(status: number | string | boolean ): boolean{
switch (typeof status){
case 'number':
return status == 0;
case 'string':
return status == 'true';
case 'boolean':
... |
import * as path from "path";
export const GITHUB_BASE_URL = undefined;
export const OWNERS = ["Himenon"];
export const SAVE_DIR = path.join(__dirname, "../src", "dataSet");
export const PKG_DETAILS = path.join(SAVE_DIR, "details.json");
export const DEPS_DATA = path.join(SAVE_DIR, "deps.json");
export const EXCL... |
<reponame>zmyer/uReplicator<gh_stars>0
/*
* Copyright (C) 2015-2017 Uber Technologies, Inc. (<EMAIL>)
*
* 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/... |
<h3>Create Form</h3>
<form>
<label for="name">Name</label>
<input type="string" id="name" name="name" />
<br />
<label for="age">Age</label>
<input type="number" id="age" name="age" />
<br />
<label for="gender">Gender </label>
<select id="gender" name="gender" >
<option value="Male">Male</option>
<option ... |
<gh_stars>0
module Markita
class Base < Sinatra::Base
set bind: OPTIONS&.bind || '0.0.0.0'
set port: OPTIONS&.port || '8080'
set sessions: true
def Base.run!
puts "#{$0}-#{VERSION}"
super do |server|
if ['.cert.crt', '.pkey.pem'].all?{ File.exist? File.join(ROOT, _1)}
server.ssl = true
... |
#!/bin/bash
#
# This script is run by vagrant on startup. Do not run it.
#
set -e
set -o pipefail
if grep vagrant /home/vagrant/.ssh/authorized_keys > /dev/null; then
echo "Disabling swap"
swapoff -a
echo "Setting noop scheduler"
echo noop > /sys/block/sda/queue/scheduler
echo "Disabling IPv6"
echo "net.... |
#!/bin/bash
#set -x
set -o posix
#set -u
#set -e
#+
#
# ===============
# Fgo_to_tools.sh
# ===============
#
# --------------------------
# Go to the TOOLS directory
# --------------------------
#
# SYNOPSIS
# ========
#
# ::
#
# $ Fgo_to_tools.sh
#
#
# DESCRIPTION
# ===========
#
#
# Go to the TOOLS directory
#
# EX... |
def simulateCircuitVoltage(vs, r0, rl, rc, initialVoltage, timeStep, totalTime):
voltage = initialVoltage
time = 0
result = [(time, voltage)]
while time < totalTime:
dVc_dt = (vs - voltage) / r0 - voltage / rl
voltage += dVc_dt * timeStep
time += timeStep
result.append((... |
zip -r dag.zip *
\cp dag.zip ~/airflow/dags/sagemaker-ml-pipeline/
|
def reverse_2D_array(arr):
rows = len(arr)
cols = len(arr[0])
reverse_arr = []
for i in range(rows-1, -1, -1):
reverse_arr.append([])
for j in range(cols-1, -1, -1):
reverse_arr[rows - 1 - i].append(arr[i][j])
return reverse_arr |
public String parseSearchQuery(String input) {
int start = input.indexOf("\"");
if (start == -1) {
return "";
}
int end = input.indexOf("\"", start + 1);
if (end == -1) {
return "";
}
return input.substring(start + 1, end);
} |
#!/bin/bash
curl -sc /tmp/cookie "https://drive.google.com/uc?export=download&id=11DXWFNBVU39AcGJWDLCzhqsgCg3xzhvQ" > /dev/null
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
curl -Lb /tmp/cookie "https://drive.google.com/uc?export=download&confirm=${CODE}&id=11DXWFNBVU39AcGJWDLCzhqsgCg3xzhvQ" -o libtensorflow.ta... |
<gh_stars>10-100
import includes from 'lodash/includes';
import { appNotificationInstance } from 'Component/Notification/AppNotification';
import {
SERVER_JOINED_STATION_SUCCESS,
SERVER_UPDATE_PLAYLIST,
SERVER_UPDATE_NOW_PLAYING,
CLIENT_ADD_SONG,
SERVER_ADD_SONG_FAILURE,
SERVER_NEW_USER_JOINED,
SERVER_DOW... |
def are_anagrams(str1, str2):
if sorted(str1) == sorted(str2):
return True
else:
return False
anagram = are_anagrams('listen', 'silent')
print(anagram) |
<gh_stars>1-10
import moment from 'moment';
import bbq from '../../assets/bbq.jpg';
import cats from '../../assets/cats.jpg';
import dogs from '../../assets/dogs.jpg';
import kids from '../../assets/kids.jpg';
import picnic from '../../assets/picnic.jpg';
import wineCheese from '../../assets/wine-cheese.jpg';
import fu... |
<gh_stars>1-10
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.unittest.stubs;
import org.joml.Vector3f;
import org.terasology.engine.entitySystem.Component;
/**
*/
public class GetterSetterComponent implements Component {
public transient boolean getterU... |
package com.itms.wikiapp.common.config;
import com.mongodb.MongoClientURI;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework... |
def find_path(start, end, keypad):
stack = [[start]]
while stack:
path = stack.pop(0)
last = path[-1]
if last == end:
return path
else:
for next_key in keypad[last]:
new_path = path + [next_key]
stack.append(new_path)
re... |
export const PermissionsAndroid = {
request: jest.fn(),
PERMISSIONS: {
CAMERA: 1
},
RESULTS: {
GRANTED: 1
}
}; |
# Generate a new rails application
rails new LibraryManagement
# Generate a scaffold for the books
rails generate scaffold books title:string author:string description:text
# Generate a scaffold for the students
rails generate scaffold students name:string email:string phone_number:string
# Generate a scaffold fo... |
SELECT AVG(Quantity)
FROM Sales
WHERE Date BETWEEN DATE(DATE_SUB(NOW(), INTERVAL 7 DAY)) AND DATE(NOW()); |
#! /bin/bash
# This script is used to manually prepare an Ubuntu 16.04 server for DetectionLab building
sed -i 's/archive.ubuntu.com/us.archive.ubuntu.com/g' /etc/apt/sources.list
# Install Virtualbox 5.2
echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" >> /etc/apt/sources.list
wget -q http... |
package proptics.instances
import scala.collection.immutable.ListMap
import cats.data.OneAnd._
import cats.data._
import cats.instances.list._
import cats.{Order, Traverse}
import proptics.indices.FunctorWithIndex
trait FunctorWithIndexInstances extends ScalaVersionSpecificFunctorWithIndexInstances {
implicit fin... |
// Write a function that takes in an array of sorted strings and returns the index of its rotation point if it has one, else return -1
var rotationPoint = function(words) {};
|
#!/usr/bin/env bash
# Calls the push_changes file at whatever path the py-package-manager repo is in
PPM_PATH=../extras/py-package-manager/push_changes.sh
if [[ ! -z "${PPM_PATH}" ]]
then
ADDL="${@}" # Option for passing additional commands onwards
sh ${PPM_PATH} --config ./config.py ${ADDL}
else
echo -e "The py... |
<reponame>chenlichao-cn/wmi4j
/*
* Copyright 2014-2014 <NAME>
*
* 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 un... |
import mongoose from "mongoose";
const UserSchema = mongoose.Schema({
username: { type: String, required: true },
password: { type: String, required: true },
email: { type: String, required: true },
follower: { type: [String], default: [] },
following: { type: [String], default: [] },
});
export default mon... |
<reponame>jfteam/jfteam-spring-boot-demo<filename>jfteam-spring-boot-dynamic-datasource/src/main/java/org/jfteam/framework/datasource/DataSourceContextHolder.java
package org.jfteam.framework.datasource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
/**
* Creat... |
require 'rails_helper'
require 'shared_process_setup_context'
RSpec.feature 'When NOMIS API was disabled' do
include_context 'with a process request setup'
let(:vst) { create(:visit) }
before do
prison_login [vst.prison.estate]
vst.prisoner.update!(number: 'zzzzzzz')
end
scenario "a prisoner is no... |
#!/bin/bash
set -e
cd $(dirname $0)
./build-book.sh
mdbook serve ../book --port 11000 --open
|
#!/bin/sh
# Package
PACKAGE="couchpotatoserver"
DNAME="CouchPotato"
# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
SSS="/var/packages/${PACKAGE}/scripts/start-stop-status"
PYTHON_DIR="/usr/local/python"
PATH="${INSTALL_DIR}/bin:${INSTALL_DIR}/env/bin:${PYTHON_DIR}/bin:${PATH}"
USER="couchpotatoserver"
GROUP="users"
VIR... |
import { getSlideSize } from "./getSlideSize";
export const getScaleFactor = (constraint: {
width: number;
height: number;
}): number => {
const { width } = getSlideSize(constraint);
return width / 1920;
};
|
<reponame>ideacrew/pa_edidb
FactoryGirl.define do
factory :member do
sequence(:hbx_member_id) {|n| "#{n}" }
gender 'female'
sequence(:ssn, 100000000) { |n| "#{n}" }
dob { Date.parse("#{rand(1..28)}-#{rand(1..12)}-#{rand(1910..2000)}") }
end
end
|
#!/bin/sh
# -----------------------------------------------------------------------------
# Start/Stop Script for the CATALINA Server
#
# Environment Variable Prequisites
#
# CATALINA_HOME May point at your Catalina "build" directory.
#
# CATALINA_BASE (Optional) Base directory for resolving dynamic portions
# ... |
import { Client as InnerClient } from '@webserverless/fc-browser-sdk/lib/browser/client';
import { injectable, } from 'inversify';
import { STSServer } from '../common/sts-protocol';
import { HttpProxyCreator } from '@malagu/core/lib/browser';
import { HttpChannel } from '@malagu/core/lib/common/jsonrpc/http-channel';
... |
#!/usr/bin/env bats
load helpers
function setup() {
# initial cleanup in case a prior test exited and did not cleanup
cd "$INTEGRATION_ROOT"
run rm -f -r "$HELLO_BUNDLE"
# setup hello-world for spec generation testing
run mkdir "$HELLO_BUNDLE"
run mkdir "$HELLO_BUNDLE"/rootfs
run tar -C "$HELLO_BUNDLE"... |
#include <iostream>
#include <string>
using namespace std;
int main() {
string sentence;
cout << "Enter a sentence: ";
getline(cin, sentence);
for (int i = sentence.size() - 1; i >= 0; i--) {
cout << sentence[i];
}
cout << endl;
return 0;
} |
<filename>mc-commons/mc-common-core/src/main/java/com/mc/common/lock/AbstractDistributedLock.java
package com.mc.common.lock;
/**
* [AbstractDistributedLock 分布式锁抽象类]
*
* @author likai
* @version 1.0
* @date 2019/12/10 0010 18:39
* @company Gainet
* @copyright copyright (c) 2019
*/
public abstract class Abstrac... |
package com.example.demo.service;
import com.example.demo.common.Page;
import com.example.demo.entity.User;
import java.util.List;
/**
* Created by zyb on 2018/9/11.
*/
public interface UserService {
public User getNameById(User user);
List<User> queryPage(Page user);
void update(User user);
}
|
package nl.martijnvogten.aws;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.security.GeneralSecurityException;
import java.security.Me... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.