text stringlengths 1 1.05M |
|---|
#!/bin/bash
#*******************************************************************************
# Copyright 2017 Talentica Software Pvt. 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
#
# ... |
<!--
Copyright 2020 Kansaneläkelaitos
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... |
<filename>services/issuer/test/backOffice.spec.ts
import { getRandomString, getTestAgent, getTestSdrRequestData } from './utils'
import request from 'supertest'
import express, { Express } from 'express'
import { Agent } from 'daf-core'
import { Connection } from 'typeorm'
import fs from 'fs'
import backOffice from '..... |
use std::cmp;
struct Grid {
row_count: usize,
region_index: usize,
}
struct Cell {
region_index: usize,
row_offset: usize,
column: usize,
}
impl Grid {
fn update_and_create_cell(&mut self, offset: usize, column: usize) -> Result<Cell, Error> {
self.row_count = cmp::max(self.row_count,... |
from ploceidae.utilities.dependency_visibility_enum import DependencyVisibilityEnum
class TestDependencyGrouping:
def test_grouped_dependencies_are_resolved_to_dependent(self, basic_configurator):
container = basic_configurator.get_container()
dependency_decorator = basic_configurator.get_dependen... |
<gh_stars>10-100
/**
* @file Regroup all the functions use for sanitize the informations coming and going in the api
* @author <NAME>
*/
'use strict';
const consts_global = require('./../constants/consts_global');
const consts_sanitizer = require('./../constants/consts_sanitizer');
const utils_global = require('./... |
#!/bin/bash
# A list of service commands
COMMANDS=( reload restart )
for COMMAND in "${COMMANDS[@]}"
do
echo $COMMAND
done
# List all of the configuration files in the _/etc/apache2/sites-available/_ directory
VHOSTS_PATH=/etc/apache2/sites-available/*.conf
for FILENAME in $VHOSTS_PATH
do
echo $FILENAME
done
|
<filename>test/bench/change_connection_scheduler.rb<gh_stars>0
require_relative './bench_init'
context "Changing the client connection scheduler" do
host = Connection::Controls::Host::Localhost.example
port = Connection::Controls::TestServer.port
client_connection = Connection::Client.build host, port
client_... |
/*
A step(x) operation works like this: it changes a number x into x - s(x), where s(x) is the sum of x's digits. You like applying functions to numbers, so given the number n, you decide to build a decreasing sequence of numbers: n, step(n), step(step(n)), etc., with 0 as the last element.
Building a single sequence... |
#!/usr/bin/env bash
set -e
# For symbol tests
echo "--- build libsqlite"
./dev/libsqlite3-pcre/build.sh
# For searcher
echo "--- comby install"
./dev/comby-install-or-upgrade.sh
# For code insights test
./dev/codeinsights-db.sh &
export CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@127.0.0.1:5435/postgres
... |
import os
import numpy as np
import raisimpy as raisim
import math
import time
raisim.World.setLicenseFile(os.path.dirname(os.path.abspath(__file__)) + "/../../rsc/activation.raisim")
world = raisim.World()
ground = world.addGround()
# launch raisim servear
server = raisim.RaisimServer(world)
server.launchServer(8080... |
import fetch from 'node-fetch';
export interface CachedResponse {
ok: boolean;
status: number;
statusText: string;
url: string;
text: string;
}
export class CachedFetch {
private cache = new Map<string, Promise<CachedResponse>>();
async fetch(url: string): Promise<CachedResponse> {
if (this.cache.h... |
package com.github.holyloop.jencode.model;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class Project extends BaseEntity {
private Long id;
private String title;
private String author;
private String description;
... |
<filename>scrapy_frontera/converters.py<gh_stars>10-100
import uuid
import logging
from scrapy.http.request import Request as ScrapyRequest
from scrapy.http.response import Response as ScrapyResponse
from scrapy.utils.request import request_fingerprint
from w3lib.util import to_bytes, to_native_str
from frontera.co... |
/*
* Copyright 2006-2007 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
#!/bin/sh
# author: Thus0
# last modified: 2022-02-05 08:39
#
# Copyright 2022 All rights reserved
# loop
tail -f /dev/null
# vim: set sw=4 ts=4 et:
|
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import ListSpacingContext from './contexts/listSpacing';
import icBEM from './utils/icBEM';
import prefixClass from './utils/prefixClass';
import anchored, {
anchoredPropTypes,
ANCHORED_PLACEMENT,
} from './mixins... |
#!/bin/bash
KERNEL_IMAGETYPE=zImage
if [ -z "${MACHINE}" ]; then
echo "Environment variable MACHINE not set"
echo "Example: export MACHINE=raspberrypi3 or export MACHINE=raspberrypi0-wifi"
exit 1
fi
case "${MACHINE}" in
raspberrypi|raspberrypi0|raspberrypi0-wifi|raspberrypi-cm)
DTBS="bcm2708-... |
import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { AddTodoDto } from 'src/todo/Dto/AddTodotDo';
import { UpdateTodoDto } from 'src/todo/Dto/UpdateToDoDto';
import { TodoEntity } from 'src/todo/entities/todo.entity';
import { Brackets, Like, Repos... |
#!/bin/bash
sed -i 's/autoindex off/autoindex on/g' /etc/nginx/sites-available/site
service nginx reload |
<gh_stars>0
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
func main() {
if len(os.Args) != 2 {
panic(fmt.Sprintf("Wrong args: bosh-io-stemcells-index-dir(eg stemcells-index)"))
}
err := StemcellNotes{StemcellsIndexDir: os.Args[1]}.Import(os.Stdin)
... |
# build the base image
docker build -f dockerfiles/dockerfile-app -t sandbox-editor-app .
|
#!/bin/sh
file=$1
touch $file.melodi
echo "Reading file - $file"
awk -v file="$file.melodi" -F " " 'BEGIN{l="f"}
#find the lines containing fields of interest, set flat 'l' to true and print line
{ if ($1 ~ /^TI/ || $1 ~ /^MH$/ || $1 ~ /^JT/ || $1 ~ /^DCOM/ || $1 ~ /^PMID/) {l="t"; print $0 > file; next};
#find overflo... |
#!/bin/sh
# (c) Copyright 2009 - 2010 Xilinx, Inc. All rights reserved.
#
# This file contains confidential and proprietary information
# of Xilinx, Inc. and is protected under U.S. and
# international copyright and other intellectual property
# laws.
#
# DISCLAIMER
# This disclaimer is not a license and doe... |
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
class SlicingTaskInfo {
private String taskId;
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskId() {
return taskId;
}
}
class SlicingTaskList {
... |
module WOZLLA.utils {
export interface Poolable {
isPoolable:boolean;
release();
}
export class ObjectPool<T extends Poolable> {
_minCount;
_factory;
_pool:Array<T>;
constructor(minCount:number, factory:()=>T) {
this._minCount = minCount;
... |
<gh_stars>0
/************************************************************
Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
Permission to use, copy, modify, and distribute this
software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear ... |
<reponame>Ayvytr/MvpCommons<filename>lib/http/src/main/java/com/http/GsonResponseBodyConverter.java
package com.http;
import android.text.TextUtils;
import com.google.gson.Gson;
import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import okhttp3.ResponseBody;
import... |
#-----------------------------------------------------
# This is a shell script for
# 1. building a graph using GraphFrames package.
# 2. applying Breadth-first search (BFS) algorithm
#-----------------------------------------------------
# @author Mahmoud Parsian
#-------------------------------------------------... |
package com.algorithm.sort;
public class BubbleSort implements BaseSort {
@Override
public int[] sort(int[] input) {
for (int i = input.length - 2; i >= 0; i--) {
for (int j = 0; j <= i; j++) {
if (input[j] > input[j + 1]) {
swap(input, j, j + 1);
... |
<reponame>rafsaf/fastapi-template
from asyncio import AbstractEventLoop as EventLoop
from typing import Dict
from fastapi.testclient import TestClient
from app.core.config import settings
from app.tests.conftest import default_superuser, default_user
def test_get_access_token(
client: TestClient, event_loop: Ev... |
<filename>src/library/queryHelper.js<gh_stars>0
const async = require("async");
const sql = require('mssql')
mode = process.env.NODE_ENV || 'dev';
const config = require('config').get(mode);
//load sql
const { getPool,closePool,closeAll } = require('./sqlServerConnect')
const selectLastId = ";select @@IDENTITY AS \'id... |
#!/bin/bash
export TOKEN="<%= @token %>"
SERVICES_FILE="/etc/consul-template/output/consul-services-generated.ini"
SERVICES_LAST="$SERVICES_FILE.last"
NEW_SHA=$(sha256sum $SERVICES_FILE)
logger -t consul consuldnsbackup: Created new file: $NEW_SHA
if [ -f $SERVICES_FILE ]; then
if [ -f $SERVICES_LAST ]; then
OL... |
<gh_stars>0
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { MovieModule } from './movie/movie.module';
import { APP_FILTER, APP_INTERCEPTOR } from '@nestjs/core';
import { Ht... |
def two_sum(arr, target):
d ={}
for i in range(len(arr)):
if target - arr[i] not in d:
d[arr[i]] = i
else:
return d[target - arr[i]], i
if __name__ == '__main__':
arr = [2,7,11,15]
target = 9
result = two_sum(arr, target)
print(result) |
<filename>lib/fog/ecloud/models/compute/hardware_configuration.rb<gh_stars>1-10
module Fog
module Compute
class Ecloud
class HardwareConfiguration < Fog::Ecloud::Model
identity :href
attribute :processor_count, :aliases => :ProcessorCount, :type => :integer
attribute :mem, :aliases ... |
// Generated by script, don't edit it please.
import createSvgIcon from '../createSvgIcon';
import PinedSvg from '@rsuite/icon-font/lib/status/Pined';
const Pined = createSvgIcon({
as: PinedSvg,
ariaLabel: 'pined',
category: 'status',
displayName: 'Pined'
});
export default Pined;
|
<reponame>BrianNewsom/echonest-react
$( "#hot-tracks" ).on( "click", function( event ) {
var trackurl = 'http://developer.echonest.com/api/v4/song/search?api_key=QQELH8UNTWLVBRQIB&sort=song_hotttnesss-desc&bucket=song_hotttnesss'
React.render(
<TrackList url={trackurl} />,
document.getElementByI... |
<reponame>CN-3211/vt-cesium2.0<gh_stars>0
/*
* @Date: 2021-12-28 20:05:14
* @LastEditors: huangzh873
* @LastEditTime: 2022-03-28 22:05:01
* @FilePath: /cesium-web-vue/src/components/mapInfo/mapInfo.ts
*/
import { throttle } from '@/utils/index';
import { Viewer, ScreenSpaceEventHandler, Cartesian2, ScreenSpaceEven... |
#!/bin/sh
grep 9 $input
|
#! /bin/bash
binaries=(cleon
eosio-abigen
dimension-launcher
eosio-s2wasm
eosio-wast2wasm
eosiocpp
keond
nodeon
eosio-applesdemo)
if [ -d "/usr/local/eosio" ]; then
printf "\tDo you wish to remove this install? (requires sudo)\n"
se... |
import pandas as pd
def combine_tag_encoding(movie: pd.DataFrame, tag_dummy: pd.DataFrame) -> pd.DataFrame:
# Concatenate the tag_dummy one-hot encoding table to the original movie files
movie = pd.concat([movie, pd.DataFrame(tag_dummy)], axis=1)
# Extend the column names of the movie dataset to include t... |
#!/bin/bash
unset COOKIECUTTER_SCALA_PLAY_RUN_PREREQUISITES
unset COOKIECUTTER_SCALA_PLAY_RUN |
<gh_stars>100-1000
/**
* Copyright (c) 2015, <NAME>, Quintelligence d.o.o. and contributors
* All rights reserved.
*
* This source code is licensed under the FreeBSD license found in the
* LICENSE file in the root directory of this source tree.
*/
namespace TSvm {
///////////////////////////////////////////////... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 scmanjarrez. All rights reserved.
# This work is licensed under the terms of the MIT license.
from datetime import datetime
import database as db
import threads as th
import util as ut
import paimon
STATE = {}
HELP = (
"I can help you manage your resin. "
... |
import aiofiles
import asyncstdlib
from pydantic.types import PositiveFloat
from conversion_parameters import ConversionParameters
from conversion_spec import ConversionSpec, Currency
from conversion_spec_provider import ConversionSpecProvider
class ConversionSpecFileReader(ConversionSpecProvider):
async def pro... |
<filename>src/actions/agreementActions.js<gh_stars>0
/**
* Created by skandara on 29/08/2016.
*/
import * as types from '../constants/actionTypes';
export function SaveAgreement(agreement) {
return (dispatch) => {
return dispatch({
type: types.SAVE_AGREEMENT,
payload: agreement
});
... |
#/bin/bash
NS=openmcp
controller_name="openmcp-job-controller"
NAME=$(kubectl get pod -n $NS | grep -E $controller_name | awk '{print $1}')
echo "Exec Into '"$NAME"'"
#kubectl exec -it $NAME -n $NS /bin/sh
for ((;;))
do
kubectl logs --follow -n $NS $NAME
done
|
require 'fileutils'
module Linux
module Lxc
class Directory
attr_reader :entries, :index, :file
def initialize(fname, index)
@file = fname
@index = index
@entries = {}
end
def all_lines(&block)
@entries.values.each do |entry|
entry.all_lines(&blo... |
<filename>apractice/sort/MergeSort.java
import java.util.Arrays;
public class MergeSort {
public static void mergeSort(int[] a, int n) {
mergeSortInternally(a, 0, n-1);
}
private static void mergeSortInternally(int[] a, int p, int r) {
if (p >= r) return;
int q = p + (r - p) / 2;... |
<filename>node_modules/@buffetjs/icons/src/components/Remove/index.js<gh_stars>0
import React from 'react';
import PropTypes from 'prop-types';
const Icon = props => (
<svg
viewBox="0 0 8 8"
width="10"
height="10"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<g fill={props.fill} fillRule... |
from onnx_tf.common import exception
from onnx_tf.handlers.frontend_handler import FrontendHandler
from onnx_tf.handlers.handler import onnx_op
from onnx_tf.handlers.handler import tf_op
@onnx_op("Reshape")
@tf_op("Reshape")
class Reshape(FrontendHandler):
@classmethod
def args_check(cls, node, **kwargs):
if... |
// Copyright 2007 The Apache Software Foundation
//
// 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 l... |
package com.surfwatchlabs.authrocket.service;
import com.authrocket.model.core.Organization;
import com.authrocket.model.response.OrganizationResponse;
import com.google.gson.Gson;
import com.surfwatchlabs.authrocket.client.AuthRocketRESTClient;
import com.surfwatchlabs.authrocket.util.AuthRocketGsonBuilder;
import ja... |
package io.eventuate.tram.messaging.proxy.consumer;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
public class CommandSubscriptionData {
private String channel;
private String resource;
private String baseUrl;
private String commands;
public String getChannel() {
return channel;
}... |
use commitments::{integer::IntegerCommitment, Commitment};
use utils::ConvertibleUnknownOrderGroup;
// Define a struct MyVerifierChannel that will implement the MembershipVerifierChannel trait
struct MyVerifierChannel;
// Implement the MembershipVerifierChannel trait for the MyVerifierChannel type
impl<G: Convertible... |
package es.upm.etsisi.cf4j.qualityMeasure.prediction;
import es.upm.etsisi.cf4j.data.TestUser;
import es.upm.etsisi.cf4j.recommender.Recommender;
/**
* This class calculates the Root Mean Squared Error (RMSE) between the predictions and the test
* ratings.
*
* <p>MSE = √(∑(<test item rating predict... |
<filename>consensus/poa/roundmanager.go
// Copyright (c) 2018-2020. The asimov developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package poa
import (
"github.com/AsimovNetwork/asimov/ainterface"
"github.com/AsimovNetwork/asimov/chaincfg"
"github.com/Asimov... |
#!/usr/bin/env bash
prefix="./"
help()
{
cat << HELP
Usage: $0 [-p]
-----------------------------------
parameter statement:
-p: path prefix of perf data
HELP
}
while [ -n "$1" ]; do
case "$1" in
-h) help;exit;;
-p) prefix=$2;shift 2;;
-*) echo "error: no such option $1. -h for help";... |
# See: https://symbiflow-examples.readthedocs.io/en/latest/getting-symbiflow.html
# Prerequisites: apt install -y git wget xz-utils
# Set ARCH_DEFS_WEB according to https://symbiflow-examples.readthedocs.io/en/latest/getting-symbiflow.html
INSTALL_DIR=$HOME/opt/symbiflow
FPGA_FAM=xc7
ARCH_DEFS_WEB=https://storage.goog... |
/* eslint-env mocha */
var chai = require('chai')
var sinon = require('sinon')
var JsReporters = require('../../dist/js-reporters.js')
var data = require('./data.js')
var expect = chai.expect
chai.use(require('sinon-chai'))
describe('Helpers', function () {
var dummyFunc = function () {}
describe('autoregister'... |
#!/bin/bash
cp vendor/modionut/php-codesniffer-hooks/src/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
|
<div onclick="window.open('http://example.com', '_blank');">Click Here</div> |
#!/bin/sh
cd "$(dirname "$0")"
python2 weather-script.py
rsvg-convert --background-color=white -o weather-script-output.png weather-script-output.svg
pngcrush -c 0 -ow weather-script-output.png
#If you need to copy the file to a webserver location uncomment this line
#cp -f weather-script-output.png /home/pi/pyImag... |
sudo apt-update
# install nginx
sudo apt install nginx
# install php7.4
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt -y install php7.4
sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7... |
${CARGO_TARGET_DIR:-../target}/debug/quill get-proposal-info 22174 --dry-run
|
python webcam_demo_spatiotemporal_det.py \
--config configs/detection/ava/slowonly_omnisource_pretrained_r101_8x8x1_20e_ava_rgb.py \
--checkpoint checkpoints/slowonly_omnisource_pretrained_r101_8x8x1_20e_ava_rgb_20201217-16378594.pth \
--det-config demo/faster_rcnn_r50_fpn_2x_coco.py \
--det-checkpoint ... |
package worker
import "github.com/youngzhu/golab/crawler/fetch"
// Concurrent crawler with channels
func ConcurrentChannel(url string, fetcher fetch.Fetcher) {
ch := make(chan []string)
go func() {
ch <- []string{url}
}()
coordinator(ch, fetcher)
}
func coordinator(ch chan []string, fetcher fetch.Fetcher) {
... |
#!/usr/bin/bash
# this file by itself doesn't tell your system HOW to run it.
# bash is not the only shell (also bash has compatiblity modes)
# in linux, a "shebang" at the top of the file
# tells the system what shell program to run your script with.
echo welcome to my script
# MOST complicated parts of bash are ju... |
import React from 'react';
import AccountCard from './AccountCard';
import BlogCard from './BlogCard';
import ClockCard from './ClockCard';
import DataCard from './DataCard';
import s from './index.scss';
import NoticeCard from './NoticeCard';
import SiteCard from './SiteCard';
import TagCard from './TagCard';
const ... |
#!/bin/bash
#
# Copyright (c) 2017-2018 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# Currently we will use this repository until this issue is solved
# See https://github.com/kata-containers/packaging/issues/1
set -o errexit
set -o nounset
set -o pipefail
[ -z "${DEBUG:-}" ] || set -x
cidir=$(dirna... |
// Interface hanya bisa memakai object type
interface Dinosaur {
name: string;
}
// Type bisa string, number, bahkan object
type Phoenix = {
name: string;
};
// Interface auto tergabung
interface Unicorn {
name: string;
}
interface Unicorn {
// Interface ini akan bergabung dengan interface di atas karena nam... |
#!/bin/bash
dieharder -d 15 -g 13 -S 3054394121
|
#ifndef _CELLSHAPE_H_
#define _CELLSHAPE_H_
#include <vector>
#include <boost/shared_ptr.hpp>
#include <Common.h>
#include <SphereShape.h>
#include <RandomGenerator.h>
class CellShape : public SphereShape
{
public:
CellShape(int _identifier)
: SphereShape()
, m_nutrition(0.f)
... |
# Because we deploy from the server directory
# the shared directory needs to be inside the shared directory
# So we'll make a symlink inside the server/other directory
# that points to the shared directory, and install that.
mkdir -p $PWD/server/other
ln -s $PWD/shared $PWD/server/other/
cd server
npm install -S ./ot... |
<gh_stars>0
import { Type } from "../types";
const loadingReducer = (state = false, { type }) => {
switch (type) {
case Type.ITEM_DATA_FETCH_START:
case Type.ITEM_ADD_START:
case Type.ITEM_DELETE_START:
case Type.ITEM_UPDATE_START:
return true;
case Type.ITEM_DATA_FETCH_SUCCESS:
case Ty... |
<reponame>scottburton11/moviebot
class Local
def initialize(path, mode)
mode = mode
path = path
@file = open(path, mode)
end
def method_missing(meth, *args, &block)
@file.send(meth.to_sym, *args, &block)
end
end
class HTTP
def initialize(path, mode)
mode = mode
path = path
@u... |
module BrNfe
module Product
class Emitente < BrNfe::Person
validate :validar_endereco
# IE do Substituto Tributário da UF de destino da mercadoria,
# quando houver a retenção do ICMS ST para a UF de destino.
#
# <b>Tipo: </b> _Number_
#
attr_accessor :inscricao_estadual_st
# Código CN... |
<reponame>ZacharyWeiner/nomcre-rails
class AddUserToProposal < ActiveRecord::Migration[5.0]
def change
add_reference :proposals, :user, foreign_key: true
end
end
|
#!/bin/bash
fun_gen_in_two_arrs() {
rm -rf ./single_combinations.txt
#touch ./single_combinations.txt
local _firstArr=(`echo $1|cut -d " " --output-delimiter=" " -f 1-`)
local _firstArrLen=${#_firstArr[@]}
local _secondArr=(`echo $2|cut -d " " --output-delimiter=" " -f 1-`)
local _secondArrLen=... |
import { StyleSheet } from 'react-native';
import { DarkTheme } from 'react-native-paper';
export default StyleSheet.create({
title: {
fontSize: 21,
fontWeight: 'bold',
color: DarkTheme.colors.text,
},
pickerContainer: {
display: 'flex',
flexDirection: 'row',
paddingVertical: 25,
jus... |
<gh_stars>0
/*
* Copyright © 2019 <NAME>, 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... |
def find_factors(num):
factors = []
for i in range(2, num):
if (num % i == 0):
factors.append(i)
print(f"Factors of {num}: {factors}")
find_factors(60) |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-STG/13-model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-STG/13-1024+0+512-N-VB-IP-256 --do_eval --per_device... |
<reponame>LwcReber/vue-admin<gh_stars>0
import { asyncRoutes, constantRoutes } from '@/router'
import { findPermissionBtns } from '@/utils/permission'
/**
* Use meta.role to determine if the current user has permission
* @param roles
* @param route
*/
function hasPermission (roles, route) {
if (route.meta && rou... |
import React, { useState, useReducer } from 'react';
const ACTIONS = {
INCREMENT: 'increment',
DECREMENT: 'decrement',
};
function reducer(state, action) {
switch (action.type) {
case ACTIONS.INCREMENT:
return { count: state.count + 1 };
case ACTIONS.DECREMENT:
return { count: state.count - ... |
#!/bin/sh
########################################################################################################################
# Usage
#
# release.sh
# - Uses conventional commits to determine the next version of each package to release
#
# release.sh --custom
# - Allows you to specify the next version of each... |
#!/bin/bash
set -ev
if [ "$LIBEVENT_ENABLED" = "false" ]; then
phpunit tests/CreateStreamSelectLoopTest.php
else
pecl install -f libevent
phpunit tests/CreateLibEventLoopTest.php
fi
|
#!/bin/zsh
# ****************************************************************************
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2001-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of... |
<filename>_site/src/basic-web-validations/src/main/java/com/example/basicwebvalidations/AppConfig.java
package com.example.basicwebvalidations;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.s... |
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(20) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL
); |
#!/usr/bin/env bash
# Colors
NOCOLOR='\033[0m'
RED='\033[0;31m' # Error message
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m' # Success message
LIGHTGREEN='\033[1;32m'
ORANGE='\033[0;33m'
YELLOW='\033[1;33m' # Warning message
BLUE='\033[0;34m' # Info message
LIGHTBLUE='\033[1;34m'
PURPLE='\033[0;35m'
... |
/*
* Copyright 2008 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
#include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter the number of rows: ";
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++) {
cout << i << " ";
}
cout << endl;
}
return 0;
} |
#!/usr/bin/env bash
# Setup file: setup.sh for configuring Ubuntu 14.04 LTS (HVM) EC2 instance
echo
echo "Setup file: setup.sh for configuring Ubuntu 14.04 LTS (HVM) EC2 instance"
echo
# create an alias in bash
echo "Creating an alias in bash for ll = ls -alrth"
alias ll=’ls -alrth’
# Install CURL
echo
echo "Installi... |
#!/bin/bash
# This is the script buildbot.libsdl.org uses to cross-compile SDL2 from
# x86 Linux to Raspberry Pi.
# The final tarball can be unpacked in the root directory of a RPi,
# so the SDL2 install lands in /usr/local. Run ldconfig, and then
# you should be able to build and run SDL2-based software on your
#... |
import cv2 as cv
# Create a window
viz = cv.viz_Viz3d("Widgets Example")
# Create and display 2D text widget
text2d = cv.viz_WText("Hello, World!", (50, 50), 30, cv.viz_Color().red())
viz.showWidget("text2d", text2d)
# Create and display 3D text widget
text3d = cv.viz_WText3D("3D Widget", (0.2, 0.2, 0.2), 0.15, True... |
#!/bin/bash
if [ ! -z ${ENV_DIR+x} ]; then
STAGE=$(cat "$ENV_DIR/STAGE")
fi
echo "BUILDING requirements.txt WITH STAGE=$STAGE"
cat requirements-base.txt > requirements.txt
if [[ $STAGE == "production" ]]; then
cat requirements-production.txt >> requirements.txt
else
cat requirements-development.txt >> requi... |
#!/bin/sh
# $XTermId: acolors.sh,v 1.7 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2002-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of c... |
<filename>src/main/java/tae/packetevent/ChannelHandlerInput.java
package tae.packetevent;
/*
* By TheAlphaEpsilon
* 2JAN2020
*
*/
import io.netty.channel.ChannelPipeline;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.