text stringlengths 1 1.05M |
|---|
package main
import (
"errors"
"fmt"
)
func main() {
// 新建error
err := errors.New("test error")
fmt.Println(err)
} |
module ProviderInterface
class SaveProviderUserService
include ImpersonationAuditHelper
attr_accessor :wizard
def initialize(actor:, wizard:)
@actor = actor
self.wizard = wizard
end
def call!
audit(@actor) do
assert_permissions_for_providers!
if email_exists?
... |
#! /bin/bash
#
# bash_common/xml_to_txt.sh
#
# Nov/19/2014
#
file_xsl=/var/www/data_base/common/bash_common/xsl_files/xml_to_txt_cities.xsl
#
#xalan -xsl $file_xsl | awk '{if (2 < NF) print $1,$2,$3,$4}'
Xalan $1 $file_xsl | awk '{if (2 < NF) print $1,$2,$3,$4}'
#
|
<reponame>tamaynard/vtk-js
import { vtkSubscription, vtkDebouncedFunction, vtkProperty, vtkPropertyDomain } from "./interfaces";
/**
* Allow user to redefine vtkXXXMacro method call.
* @param name of the macro type [Log, Info, Debug, Error, Warning]
* @param fn function to use when vtkXXXMacro is called.
*/
export... |
/*
* Copyright 2021 <NAME>
*
* 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 wr... |
#!/bin/bash
#
# provision.sh
#
# This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# or `vagrant reload` are used. It provides all of the default packages and
# configurations included with Varying Vagrant Vagrant... |
#! /bin/bash -e
fn-push() {
local registry=$1
local image_name=$2
local current_tag="$(cat ./current-tag | tr -d '\n')"
docker push $registry/$image_name:$current_tag
docker push $registry/$image_name:latest
sleep 5
exit 0
}
fn-push "$@" |
const workerpool = require('workerpool');
const random = require('./algorithms/random');
const negamax = require('./algorithms/negamax');
const negamaxAB = require('./algorithms/negamax_a_b');
const negamaxABTable = require('./algorithms/negamax_a_b_table');
const negamaxABQuiescent = require('./algorithms/negamax_a_b... |
import { isEqual } from 'lodash'
import { from, Observable, of, throwError } from 'rxjs'
import { catchError, distinctUntilChanged, map, publishReplay, refCount, switchMap } from 'rxjs/operators'
import { gql, graphQLContent } from '../graphql/graphql'
import * as GQL from '../graphql/schema'
import { PlatformContext }... |
<gh_stars>10-100
//Security Service - MongoDB implementation -------
var permissionModel;
function apply(models) {
permissionModel = models.models._permissions.model;
}
//Get permissions for a given <role, resource> or null if not found
function getPermissionsFor(role, resource, cb) {
if (!role || !reso... |
<gh_stars>0
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions
core_api_schema = get_schema_view(
openapi.Info(
title="Chems Todo API",
default_version='v1',
description="Just to do list API",
contact=openapi.Contact(email="<EMAIL>"... |
/**
* Created by lvjianyao on 16/6/27.
*/
module.exports = {
mongo: {
databaseUrl: process.env.MONGODB_URI
},
redis: {
host: process.env.REDIS_HOST,
port: parseInt(process.env.REDIS_PORT),
password: process.env.REDIS_PASSWORD
}
};
|
<reponame>mission-apprentissage/prise-de-rdv
const { Schema } = require("mongoose");
module.exports = new Schema({
username: {
type: String,
default: null,
description: "Le nom de l'utilisateur",
},
date: {
type: Date,
default: () => new Date(),
description: "La date de l'evenement",
},... |
<filename>website/drawquest/management/commands/coin_balance_histogram.py<gh_stars>10-100
import datetime
from django.core.management.base import BaseCommand
from matplotlib import pyplot
from drawquest.apps.drawquest_auth.models import User
from drawquest import knobs, economy
class Command(BaseCommand):
args ... |
<reponame>hellochenms/m4-scroll-half-stop
//
// M4TouchPenetrateScrollView.h
// m4-scroll-half-stop
//
// Created by Chen,Meisong on 2018/10/23.
// Copyright © 2018年 xyz.chenms. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface M4TouchPenetrateScrollView : UITableView
@end
NS_A... |
package com.galfins.gnss_compare.DataViewers;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.location.Location;
impo... |
{
var _Polymer = Polymer,
html = _Polymer.html;
/**
`<cells-pdf-viewer>` Description.
Example:
```html
<cells-pdf-viewer></cells-pdf-viewer>
```
## Styling
The following custom properties and mixins are available for styling:
### Custom Properties
| Custom Property ... |
<gh_stars>1-10
/*
* Copyright (c) <NAME>. All rights reserved.
* License : Apache 2.0
* @author <NAME>
*
*/
package com.dhana.servicebus.saswrapper;
import java.io.IOException;
import java.io.StringWriter;
import java.nio.charset.Charset;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import... |
<reponame>taowu750/LeetCodeJourney
package training.array;
import org.junit.jupiter.api.Test;
import java.util.function.ToIntFunction;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* 给定一个包含 [0, n] 中 n 个数的数组 nums ,找出 [0, n] 这个范围内没有出现在数组中的那个数。
*
* 你能否实现线性时间复杂度、仅使用额外常数空间的算法解决此问题?
*
* 例 1:
* 输入... |
/**
*
* Experiment Table
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { Table, Tag, Icon } from 'antd';
import LoadingIndicator from 'components/LoadingIndicator';
import { Link } from 'react-... |
<gh_stars>0
require 'spec_helper'
class Boat < Record
has_many :sails
attribute :type, index: :string, search: true
attribute :color, index: :string, search: true
attribute :owner, index: :string, search: true
attribute :size
end
class Sail < Record
belongs_to :boat
attribute :type, index: :string, sear... |
#!/usr/bin/env bash
set -e # bail out early if any command fails
set -o pipefail # fail if any component of any pipe fails
# basht macro, shellcheck fix
export T_fail
# shellcheck disable=SC1091
. spec/bash/test_helpers
# shellcheck disable=SC1091
. jobs/rabbitmq-server/templates/setup.bash
T_setup_environment() {... |
SELECT *
FROM Employee
WHERE salary > (SELECT AVG(salary) FROM Employee); |
#import necessary dependencies
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
import numpy as np
#load the dataset
dataset = datasets.load_iris()
#split data into training and test sets
x_train,x_test,y_train,y_test = train_test_split(datase... |
cd web-app
yarn install
yarn build-css
NODE_ENV="production" PUBLIC_URL="https://osoc17.github.io/code9000/" REACT_APP_ROUTER="HASH" REACT_APP_API_URL="https://birds.today/api" yarn build
cd ..
git branch -D gh-pages
git push origin --delete gh-pages
git add web-app/build && git commit -m "Initial dist subtree com... |
import argparse
class PeopleManager:
def __init__(self):
self.people = []
def add_person(self, name):
self.people.append(name)
def remove_person(self, name):
if name in self.people:
self.people.remove(name)
else:
print(f"{name} not found in the list... |
<gh_stars>10-100
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Gen... |
<filename>fs/vfs/fs_rmdir.c
/****************************************************************************
* fs/vfs/fs_rmdir.c
*
* Copyright (C) 2007-2009, 2014, 2017 <NAME>. All rights reserved.
* Author: <NAME> <<EMAIL>>
*
* Redistribution and use in source and binary forms, with or without
* modification, ... |
const { referrers } = require("../../src/common/model/constants/referrers");
const sampleAppointment = {
id_rco_formation: "21_114876|21_114876|106291",
candidat_id: "91a370e6-3eb1-4e09-80f0-b7cc6be84fac",
etablissement_id: "2828558M",
formation_id: "68769673",
motivations: "TEST MOTIVATION",
referrer: ref... |
api_key=<YOUR_API_KEY>
app_key=<YOUR_APP_KEY>
curl "https://api.datadoghq.com/api/v1/dash?api_key=${api_key}&application_key=${app_key}"
|
<gh_stars>1-10
from __future__ import print_function
import os
import base64
import logging
import sys
from six.moves import urllib, http_client
from six.moves.urllib.parse import urlparse, urlunparse
DEFAULT_CHUNK_SIZE = 10 * 1024 * 1024
TUS_VERSION = '1.0.0'
class MethodRequest(urllib.request.Request):
# Se... |
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.5.45 - MySQL Community Server (GPL)
-- ОС Сервера: Win32
-- HeidiSQL Версия: 9.3.0.4984
-- --------------------------------------------------------
/*... |
// Parses a JSON string and returns an array of its values
function parseJSONString(jsonString) {
const jsonObj = JSON.parse(jsonString);
const result = [];
for (let prop in jsonObj) {
result.push(jsonObj[prop]);
}
return result;
}
// Example
const input = "{'name':'John', 'age':20}";
const output = parseJSONSt... |
####################### chroot_mlfs.sh #########################################
#!/bin/bash
#
# Copyright 2018, 2019,2020,2021 J. E. Garrott Sr, Puyallup, WA, USA
# Copyright 2018, 2019,2020,2021 "nobodino", Bordeaux, FRANCE
# All rights reserved.
#
# Redistribution and use of this script, with or without modificat... |
import logging
import os
def create_logger(module_name, log_file_path):
# Create a logger
logger = logging.getLogger(module_name)
logger.setLevel(logging.DEBUG)
# Create a file handler and set the log level
file_handler = logging.FileHandler(log_file_path)
file_handler.setLevel(logging.DEBUG)
... |
<gh_stars>1-10
// don't put in jp.skypencil.brainjack to test call from other package
package jp.skypencil.brainjack.interpreter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import jp.skypencil.brainjack.AbstractTest;
import jp.skypencil.brainjack.Interpreter;
public... |
# 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,... |
class SessionManager: SessionManagerProtocol {
static let shared = SessionManager()
private var onLoadStateChange: ((Bool) -> Void)?
private var sessionManager: SessionManagerProtocol
init(sessionManager: SessionManagerProtocol = SessionManager.shared) {
self.sessionManager = sessionMa... |
import { StepInfo } from "@spikedpunch/forge"
import { RequestEntry } from "./Plugin"
import { toRestVerb } from "./Utils"
export class RestOptions {
url: string | undefined
json: boolean = false
debug: boolean= false
requests: RequestEntry[] = new Array<RequestEntry>()
gotOptions: any = {}
static f... |
# 1. Setup github ssh key
# git clone https://gitee.com/icyzeroice/ssh-save.git .ssh
# 2. Setup Tmux
# https://github.com/gpakosz/.tmux
cd ~
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
# 3. Setup Windows Terminal starting directory
# https://superuser.com/qu... |
"""
A bot to play the game of Battleships
"""
import random
class Bot:
def __init__(self):
self.shots_fired = 0
def make_attack(self, board):
rand_row = random.randint(0, len(board)-1)
rand_col = random.randint(0, len(board[0])-1)
while board[rand_row][rand_col] != 0:
... |
import numpy as np
from sklearn.grid_search import GridSearchCV
def grid_estimation(model, data, target):
# prepare a range of alpha values to test
gammas = np.array([1, 0.1, 0.01, 0.001, 0.0001])
cs = np.array([1, 10, 100, 1000])
# create and fit a ridge regression model, testing each alpha
grid ... |
# install pip
sudo apt-get install python-pip python-dev
# sudo apt-get install python3-pip
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
## 升级后报错 修改如下:
ImportError: cannot import name main when running pip
>nano /usr/bin... |
<gh_stars>0
package mg.finance.conrtoller;
import lombok.AllArgsConstructor;
import mg.finance.dto.CryptoMarketDto;
import mg.finance.service.crypto.CryptoMarketService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web... |
import {MapLayer, Point} from '../../interfaces/cross-code-map';
import * as Phaser from 'phaser-ce';
import {Sortable} from '../../interfaces/sortable';
import {Helper} from '../helper';
import {Globals} from '../../globals';
export class CCMapLayer extends Phaser.Image implements Sortable {
public details: MapLay... |
#!/bin/bash --login
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM
source .rvmrc
bundle install
COVERAGE=on bundle exec rake ci:setup:rspec spec
|
function isDivisibleByThree($number){
return ($number % 3 == 0);
} |
#ifndef __SCENE_HPP__
#define __SCENE_HPP__
#include <vector>
#include <set>
#include <unordered_map>
#include "glm.hpp"
#include "primitives.hpp"
#include "texture.hpp"
struct UncompressedKdNode;
struct CompressedKdNode;
class aiScene;
class aiNode;
class aiMesh;
class aiMaterial;
class Scene{
public:
Scene()... |
<reponame>milancermak/beam
// 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
// (... |
import numpy as np
import sympy
class Muon:
def __init__(self, x, y, theta, phi, time=0):
self.org_x = x
self.org_y = y
self.org_z = 0
self.r = 1.
self.theta = theta
self.phi = phi
self.end_x = self.r*np.cos(self.phi)*np.sin(self.theta) + self.org_x
... |
The dataset consists of 100 sentences, divided equally into 50 positive and 50 negative sentences. The positive sentences include:
"I love spending time with my family."
"I'm excited to start my new project."
"I'm feeling inspired today."
"I achieved so much today."
"I'm feeling optimistic about the future."
The nega... |
<gh_stars>1-10
/* eslint-env jest */
'use strict'
const log = require('../lib/log')
// const logLevels = ['INFO', 'WARN', 'ERROR', 'DEBUG']
test(`Appends log level to the message`, () => {
expect(log.info(`Just an info`)).toEqual(console.log(`INFO just an info`))
expect(log.warn(`Just a warn`)).toEqual(console.l... |
more ../../results/frats_add*.json
|
from machina.apps.forum_conversation.admin import * # noqa
|
package rbd
import (
"errors"
)
// Pool is an rbd pool
type Pool struct {
name string
}
// Name is the pool name
func (pool *Pool) Name() string {
return pool.name
}
// GetPool gets a pool object (does not verify pool exists)
func GetPool(name string) *Pool {
return &Pool{name}
}
// ErrDoesNotExist is returned... |
import java.util.Arrays;
class SortList
{
public static void main(String[] args)
{
int[] list = {1, 4, 5, 6, 7, 8};
Arrays.sort(list);
System.out.print("Sorted list: ");
for (int i=0; i < list.length; i++)
System.out.print(list[i] + " ");
}
} |
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an in... |
#!/bin/bash
#SBATCH --time=2:00:00 # walltime
#SBATCH --ntasks=3 # number of processor cores (i.e. tasks)
#SBATCH --nodes=1 # number of nodes
#SBATCH --mem-per-cpu=8000M # memory per CPU core
#SBATCH --gres=gpu:1
#SBATCH --output="runBWv3.slurm"
#SBATCH --constraint rhel7
echo $USER
if [ $USER=="tarch" ]; the... |
#!/bin/bash
./node_modules/.bin/ncp ./packages/neuron-ui/build ./packages/neuron-wallet/dist/neuron-ui
|
SELECT order_id, customer_name
FROM orders
WHERE country = 'US' |
package graph
import (
"code.google.com/p/plotinum/plot"
"code.google.com/p/plotinum/plotter"
"code.google.com/p/plotinum/vg"
"fmt"
"github.com/THUNDERGROOVE/SDETool2/log"
"github.com/THUNDERGROOVE/SDETool2/market"
"github.com/lucasb-eyer/go-colorful"
"math"
"math/rand"
"sort"
"time"
)
type... |
sandy () {
local DIR=$PWD
local TARGET="cabal.sandbox.config"
local PROG=$1
shift
while [ ! -e $DIR/$TARGET -a $DIR != "/" ]
do
DIR=$(dirname $DIR)
done
if test $DIR != "/"
then
local DB=$(sed -ne '/^package-db: */{... |
// Package errors defines errors that can occur in command/input validation and
// execution and ways to handle those.
package errors
import (
"github.com/giantswarm/gsctl/client/clienterror"
"github.com/giantswarm/microerror"
)
// UnknownError should be thrown if we have no idea what went wrong.
var UnknownError =... |
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
using namespace std;
string convertListToString(vector<string> list) {
stringstream ss;
for (int i=0; i<list.size(); i++) {
ss << list[i];
if (i != list.size() - 1)
ss << ", ";
}
return ss.str();
}
int main()
{
vector<string> list = {... |
function bytelist_js_to_java(bytelist) {
return Java.array('byte', bytelist)
// var base64Str = base64Encode(bytelist)
// var androidBase64 = Java.use('android.util.Base64')
// var bytesInJava = androidBase64.decode(base64Str, 0)
// return bytesInJava;
}
function bytelist_java_to_js(bytelist) {
... |
<gh_stars>0
package etf.dotsandboxes.me170117d;
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
public class GameState implements Cloneable {
enum Turn{
BLUE, RED, GRAY
}
private Turn currentTurn;
private GameScreen gameScreen;
private ArrayList<Move> moveList;
private boolean[][][] l... |
def separate_even_odd(nums):
evens = []
odds = []
for num in nums:
if num % 2 == 0:
evens.append(num)
else:
odds.append(num)
return evens + odds
print(separate_even_odd([1, 2, 3, 4, 5, 6, 7, 8])) |
import * as moment from 'moment-timezone';
import * as path from 'path';
import { BOT_DESCRIPTION, GITHUB_LINK } from '../helpers/consts';
import { embedFactory } from '../services/EmbedFactoryService';
import { redisCollectorService } from '../services/RedisCollectorService';
import { Command } from '../types';
const... |
<filename>src/main/java/org/infinispan/persistence/cloud/logging/Log.java
/*
* JBoss, Home of Professional Open Source.
* Copyright 2000 - 2011, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual c... |
package contract;
import tx.Data;
public class DataMessage implements Message{
private byte[] sender;
private String methodName;
private Class[] parameterTypes;
private Object[] inputs;
public DataMessage(byte[] sender, Data data) {
this.sender = sender;
this.methodName = data.get... |
set -e
# Set file name prefixes
TRANSCRIPTS_PREFIX="1kg_NA12878_gencode100"
GRAPHS_PREFIX="1kg_NA12878_exons_gencode100_allpaths"
READS_PREFIX="ENCSR000AED_rep1"
EXPRESSION_PREFIX="${READS_PREFIX}_uni"
PROFILE_PREFIX="${TRANSCRIPTS_PREFIX}_${EXPRESSION_PREFIX}"
OUT_PREFIX="sim_${PROFILE_PREFIX}_vg_r1_h1"
# Download ... |
#!/bin/bash
./download_wikipedia_sparse.sh
./download_wikipedia_lsi128.sh
./download_cayton.sh
./download_colors.sh
./genunif.py -d 64 -n 500000 -o unif64.txt
|
#!/bin/sh
ghc Tests.hs -package ghc -dynamic && /usr/bin/time -f "%U" ./Tests
|
package io.trillo.example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import io.trillo.example.datasource.MemoryDataSource;
@SpringBootApplication
public class TrilloExampleServer {
... |
/*
* 深圳小旺网络科技有限公司
*/
package com.base.utils;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.Context;
import android.os.Build;
/**
* 剪切板相关工具类
*/
@SuppressLint("NewApi")
public class ClipboardUtil {
public static void setText(Context context, String content) {
i... |
#!/bin/bash
echo "Starting verification of Slack example"
# Prep
failed=0 # Any failure will set this to 1
targetdir=${0%/*} # get script's own directory
cd $targetdir
source ../../scripts/example-test-utils.sh
# Prep
cleanLogs
# Check for the Slack token file. Without it, no point in proceeding.
if [ ! -f .slack.t... |
#!/usr/bin/env bash
#
# Postprocess scaffold
#
# Include ./functions.bash
source .anax/scaffold/functions.bash
# Install using composer
composer install --no-dev
# Get scaffolding scripts from Anax Lite, Anax Flat, Anax design me
rsync -a vendor/anax/anax-lite/.anax/scaffold/postprocess.d .anax/scaffold/
rsync -a ve... |
<filename>src/views/sonar/SonarLogin.js
import React from 'react';
import { connect } from 'react-redux';
import * as Yup from 'yup';
import { Formik } from 'formik';
import {
Box,
Button,
Container,
InputAdornment,
TextField,
Typography,
makeStyles
} from '@material-ui/core';
import FingerprintIcon from ... |
#!/usr/bin/env bash
# Copyright 2020 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 applica... |
<gh_stars>0
//check object had properties
let object1={
x:0,
y:3,
z:2
};
console.log(Object.keys(object1));
//object assign function copies properties of an object to another
Object.assign(object1,{a:7,x:3});
console.log(object1);
//jacques objects
let journal = [
{events: ["work", "touched tree", "... |
<reponame>rovedit/Fort-Candle
#pragma once
#include <clean-core/assert.hh>
#include <clean-core/cursor.hh>
namespace cc
{
template <class RangeFrom, class RangeTo>
constexpr void copy(RangeFrom const& from, RangeTo& to)
{
auto c_from = cc::to_cursor(from);
auto c_to = cc::to_cursor(to);
while (c_from)
... |
///////////////////////////////////////////////////////////////////////////////
/// \file switch.hpp
/// A generalization of the conditional_compiler. Given N different compilers
/// in a MPL-style map and a lambda that generates a key from an expression,
/// find the compiler in the map corresponding to the key and us... |
#!/bin/sh
VER=`grep "__version__ = " perftracker_cp_crawler/__init__.py | cut -d "\"" -f 2`
echo "\n###### run the following commands manually ######\n"
echo "vim perftracker_cp_crawler/__init__.py # update version"
echo "vim python2-perftracker-cp-crawler.spec # update version"
echo "vim python36-perftracker-cp-cra... |
<reponame>dmepilot/denver_zoo_cli
class DenverZooCli::Animal
attr_accessor :url, :name, :klass, :order, :family, :genus, :species, :subspecies, :range, :habitat, :fun_facts
@@all = []
def initialize(name, url)
@name = name
@url = url
@fun_facts = []
self.save
end
def self.all
... |
#!/bin/bash
PUSH=$1
DATE="$(date "+%Y%m%d%H%M")"
REPOSITORY_PREFIX="latonaio"
SERVICE_NAME="sap-api-integrations-bank-master-reads-rmq-kube"
DOCKER_BUILDKIT=1 docker build --progress=plain -t ${SERVICE_NAME}:"${DATE}" . --no-cache
# tagging
docker tag ${SERVICE_NAME}:"${DATE}" ${SERVICE_NAME}:latest
docker tag ${SER... |
#!/bin/bash
# This script clones the current repo to a temp dir
# and then builds and uploads the documentation.
# The cloned repo is left in the build/ dir as I am allergic to
# unguarded "rm -rf" commands in scripts. The documentation
# then lives in the github repo in the "gh-pages" branch.
#
# The documentation ... |
# frozen_string_literal: true
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
import React, { useState } from 'react';
function App() {
const [items, setItems] = useState([]);
const addItem = () => {
const newItems = [
...items
];
newItems.push({
id: Math.random().toString(36).substr(2, 9) ,
text: ''
});
... |
<reponame>tssga-arch/myotc
#!/usr/bin/env python3
#
# Handling Nuking of resources
#
# ~ import openstack
###################################################################
#
# Nuking
#
###################################################################
def cname_match(prefix, rs):
for r in rs:
if r.startswith... |
#include <stdio.h>
#include <openssl/rand.h>
int main() {
int numRandomNumbers;
printf("Enter the number of random numbers to generate: ");
scanf("%d", &numRandomNumbers);
unsigned char randomBuffer[numRandomNumbers * sizeof(int)];
if (RAND_bytes(randomBuffer, sizeof(randomBuffer)) != 1) {
... |
<gh_stars>0
/*
* Copyright 2018 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... |
package file
import (
"errors"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
)
var (
IsDirectoryError = errors.New("IsDirectoryError: must open a file,not a dir")
ParamDimensionsError = errors.New("param `dimensions` is invalid")
)
const (
GrepContain = iota
GrepNotContain
)
// Open 打开... |
export const FORM_UPDATE = '@BILLING_ADDRESS/FORM_UPDATE'
export const FORM_RESET = '@BILLING_ADDRESS/FORM_RESET'
export const FORM_SUBMITTING = '@BILLING_ADDRESS/FORM_SUBMITTING'
export const FORM_ERROR = '@BILLING_ADDRESS/FORM_ERROR'
export const FORM_SUBMITTING_FAILED = '@BILLING_ADDRESS/FORM_SUBMITTING_FAILED'
... |
<reponame>chqu1012/QueryDsl
/**
* generated by Xtext 2.19.0
*/
package de.dc.sql.lang.sqlQueryDsl;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.common.types.JvmFormalParameter;
/**
* <!-- begin-user-doc -->
* A representation of the model ... |
#!/usr/bin/env bash
cd $(dirname $0) && cd ../
APP_NAME="auth-server"
APP_PROD_JAR="deploy/build/$APP_NAME-*.jar"
APP_ARGS=
while (( "$#" )); do
case "$1" in
--ssl)
APP_ARGS="$APP_ARGS --spring.config.additional-location=classpath:server-ssl.properties"
shift
;;
*)
shift
;;... |
package filters;
import db.DBManager;
import db.User;
import db.User.Role;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
... |
/*
Get a byte or bytes for one character based on UTF-8 out of the key board.
Remarks:
Call fn. rl() later.
Call fn. _getch twice to read <Ctrl-@>.
The first call returns (0x00) and the second call returns (0x03)..
Return the number of bytes for one character.
Return (~0x00) if a meta key starting from (0x00) is dete... |
#!/bin/sh
unzip -o PCMark10-*.zip
/cygdrive/c/Windows/system32/cmd.exe /c pcmark10-setup.exe /install
echo "This test profile requires a PCMark 10 Professional license for command-line automation. Before running this test make sure you activate your installation." > ~/install-message
echo "#!/bin/bash
cd \"C:\Program... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ic_format_bold = void 0;
var ic_format_bold = {
"viewBox": "0 0 24 24",
"children": [{
"name": "path",
"attribs": {
"d": "M0 0h24v24H0z",
"fill": "none"
},
"children": []
}, {
"name": "path",
... |
import sys
import os
import subprocess
def apply_formatting_style(style, files):
style_options = {
"Google": "-style=Google",
"LLVM": "-style=LLVM",
"Chromium": "-style=Chromium",
"Mozilla": "-style=Mozilla"
}
if style not in style_options:
print("Invalid style spec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.