text stringlengths 1 1.05M |
|---|
package queue
import "testing"
func TestNewArrayQueue(t *testing.T) {
if NewArrayQueue(0) != nil {
t.Error(`TestNewArrayQueue failed`)
}
queue := NewArrayQueue(5)
if queue == nil || queue.length != 0 || cap(queue.data) != 5 {
t.Error(`TestNewArrayQueue failed`)
}
}
func TestArrayQueuePush(t *testing.T) {
q... |
<filename>src/main/scala/pl/project13/scala/words/verbs/RetryVerb.scala
package pl.project13.scala.words.verbs
import scala.collection._
trait RetryVerb {
/**
* Try to execute a block (for a result) {@code times} times, and return the first successful result.
* Otherwise, collect thrown exceptions and retur... |
package main
import (
"log"
"net/http"
"strings"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
)
// Thanks to otraore for the code example
// https://gist.github.com/otraore/4b3120aa70e1c1aa33ba78e886bb54f3
func main() {
r := gin.Default()
store := sessions.NewCookieStore([]byte("secret"... |
package net.microfalx.resource;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
import static net.microfalx.resource.ResourceUtils.getInputStreamAsBytes;
import static net.microfalx.re... |
package com.tdsata.ourapp.activity;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.V... |
#!/usr/bin/python
# rebeebus.py 1.0 - An rDNS lookup utility.
# Compatible with Python 2 and 3
# Copyright 2018 13Cubed. All rights reserved. Written by: <NAME>
import sys
import json
import re
import csv
import argparse
import socket
import operator
# Handle Python 2 and 3 compatibility for urllib
try:
from urllib... |
# Default bindings
bindgen --unstable-rust --opaque-type "std.*" --whitelist-type "gvr.*" --whitelist-function "gvr.*" --rustified-enum "gvr.*" -o src/bindings.rs gvr/wrapper.h -- -std=c99 -I/usr/include/clang/3.9/include
# Android bindings
ANDROID_INCLUDES="$ANDROID_NDK/platforms/android-18/arch-arm/usr/include"
bindg... |
def search_word(word, dictionary):
if word in dictionary.keys():
return dictionary[word]
else:
return None
dictionary = {'hello': 'string', 'goodbye': 'bye'}
word = 'hello'
result = search_word(word, dictionary)
if result:
print('Word found in dictionary: ' + result)
else:
print('Wo... |
export const PSEUDO_RETURN = Symbol('TO_BE_DECORATED')
function decorate(condition, newValue) {
return function (func) {
return function (...args) {
const result = func.apply(this, args)
if (condition(result)) {
return newValue
}
return result
}
}
}
function add(a, b) {
r... |
#include "SentryHook.h"
#include "fishhook.h"
#include <dispatch/dispatch.h>
#include <execinfo.h>
#include <mach/mach.h>
#include <pthread.h>
// NOTE on accessing thread-locals across threads:
// We save the async stacktrace as a thread local when dispatching async calls,
// but the various crash handlers need to acc... |
var searchData=
[
['l',['l',['../unionDFSR__Type.html#a583e3138696be655c46f297e083ece52',1,'DFSR_Type::l()'],['../unionIFSR__Type.html#a8f4e4fe46a9cb9b6c8a6355f9b0938e3',1,'IFSR_Type::l()']]],
['l1pctl',['L1PCTL',['../unionACTLR__Type.html#a5464ac7b26943d2cb868c154b0b1375c',1,'ACTLR_Type']]],
['l1pe',['L1PE',['..... |
<gh_stars>0
#from distutils.core import setup
from setuptools import setup
try:
desc = open('README.md').read()
except (IOError, FileNotFoundError) as e:
desc = ''
setup(name='peri',
url='http://github.com/peri-source/peri/',
license='MIT License',
author='<NAME>, <NAME>',
version='0.1... |
#!/bin/sh
set -e
if [ "$#" -ne 1 ]; then
echo "ERROR: Illegal number of parameters"
echo "Usage: $0 <inventory-path>"
exit 1
fi
INVENTORY_PATH=$1
#Deploy keycloak
echo "@@@@@@@@@ Keycloak "
ansible-playbook -i $INVENTORY_PATH ../ansible/keycloak.yml --tags deploy --extra-vars=@config.yml
|
<gh_stars>0
/*
EXAMPLE TASK:
- Write an Airplane class whose constructor initializes `name` from an argument.
- All airplanes built with Airplane should initialize with an `isFlying` property of false.
- Give airplanes the ability to `.takeOff()` and `.land()`:
+ If a plane takes off, its `isFlyin... |
#!/bin/bash
# Credits: Adapted from https://github.com/choderalab/pymbar/blob/master/devtools/travis-ci/install.sh
# with some modifications
pushd .
cd $HOME
# Install Miniconda
MINICONDA=Miniconda2-latest-Linux-x86_64.sh
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then MINICONDA=Miniconda2-latest-MacOSX-x86_64.sh; fi
MIN... |
#!/bin/bash
set -e
# Ask node for headers
HEADERS_URL=$(node -p 'process.release.headersUrl')
# Work out the filename from the URL, as well as the directory without the ".tar.gz" file extension:
rm -rf ./build
mkdir build
HEADERS_TARBALL=./build/`basename "$HEADERS_URL"`
# Download, making sure we download to the sa... |
'use strict';
const Sequelize = require('sequelize');
const path = require('path');
const config = require(path.resolve('server/middleware/config/config'));
const sequelize = new Sequelize(config.db.database, config.db.username, config.db.password, config.db.option);
sequelize
.authenticate()
.then(() => {
... |
/*
Build the table with the platform, compiler and core names.
*/
/*
select NB,CATEGORY.category,NAME,CYCLES,PLATFORM.platform,CORE.core,COMPILERKIND.compiler,COMPILER.version,DATE
from BasicBenchmarks
INNER JOIN CATEGORY USING(categoryid)
INNER JOIN PLATFORM USING(platformid)
INNER JOIN CORE USING(coreid)
... |
#!/bin/bash
# usage: sbatch job/bridges.sh
#SBATCH -J box-dm
#SBATCH -p RM-small
#SBATCH -N 2
#SBATCH --ntasks-per-node=28
#SBATCH -t 8:00:00
#SBATCH -o gizmo.log
#SBATCH -D .
set -e
module list
spack env activate gizmo
set -x
pwd
date
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0
export MPIRUN="mpirun -n $SLURM_NTASKS... |
import { Functional } from '../../../../../Class/Functional'
import { Done } from '../../../../../Class/Functional/Done'
import { Config } from '../../../../../Class/Unit/Config'
import { CA } from '../../../../../interface/CA'
export interface I {
canvas: CA
step: any[]
}
export interface O {
i: number
}
expo... |
export class WelcomeMessage {
type: string;
content: string;
} |
def process_data_and_call_script(file_name, lower_threshold, upper_threshold):
with open(file_name, 'r') as file:
data = file.read().strip().split()
measurements = [float(val) for val in data]
count_within_range = sum(1 for measurement in measurements if lower_threshold <= measurement <= upp... |
<reponame>jessehu/app-autoscaler
'use strict';
var expect = require("chai").expect;
var logger = require('../../../lib/log/logger');
var schemaValidator = require('../../../lib/validation/schemaValidator');
var rewire = require('rewire');
var schemaValidatorPrivate = rewire('../../../lib/validation/schemaValidator');
... |
class ServerManager {
private $endStartDate;
private $queryParameters = [];
public function setEndStartDate($endStartDate) {
$this->endStartDate = $endStartDate;
$this->queryParameters["EndStartDate"] = $endStartDate;
}
public function getServerLockStatus() {
// Implement l... |
// Copyright (c) 2015-2016, ETH Zurich, <NAME>, Zurich Eye
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// noti... |
def print_fibonacci(n):
# Negative numbers are not allowed
if n < 0:
print("Incorrect input")
# Initial two numbers of the series
a = 0
b = 1
# Print the series up to the given number
print("Fibonacci series up to", n, ":")
while a < n:
print(a, end=" ")
c = a + b
a = b
b = c
# Driver C... |
#!/bin/sh
nohup python run.py --config=testing_config.py --mode=train > output.txt 2>&1 &
|
#!/bin/bash
set -e
NAME=simple_link
INSTALL_DIR=/usr/local/code/faasm/wasm/rust/$NAME
mkdir -p $INSTALL_DIR
# Depending on whether we are in the Rust-Faasm workspace or not
if [[ -d target ]]; then
cp target/wasm32-unknown-unknown/debug/faasm-sys.wasm $INSTALL_DIR/function.wasm
else
cp ../target/wasm32-unkn... |
<gh_stars>0
/*
* Copyright (C) 2015 The Android Open Source Project
*
* 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 requir... |
<gh_stars>0
package pulse.problem.schemes.rte;
import static pulse.math.MathUtils.fastPowLoop;
import org.apache.commons.math3.analysis.UnivariateFunction;
import pulse.problem.statements.NonlinearProblem;
import pulse.problem.statements.Pulse2D;
/**
* Contains methods for calculating the integral spectral charact... |
<reponame>zhaoyb/LinkAgent<filename>instrument-modules/user-modules/module-rabbitmq/src/main/java/com/pamirs/attach/plugin/rabbitmq/common/ChannelHolder.java
/**
* Copyright 2021 Shulie Technology, Co.Ltd
* Email: <EMAIL>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file ... |
source $stdenv/setup
PATH=$perl/bin:$PATH
tar xvfz $src
cd hello-*
./configure --prefix=$out
make
make install
|
#ifndef LLVM_TRANSFORMS_MY_NEW_PASS_H
#define LLVM_TRANSFORMS_MY_NEW_PASS_H
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/PassPlugin.h"
namespace llvm {
class MyNewPass : public PassInfoMixin<MyNewPass> ... |
module Arbre
module HTML
AUTO_BUILD_ELEMENTS = [ :a, :abbr, :address, :area, :article, :aside, :audio, :b, :base,
:bdo, :blockquote, :body, :br, :button, :canvas, :caption, :cite,
:code, :col, :colgroup, :command, :datalist, :dd, :del, :details,
... |
using UnityEngine;
public class MyClass : MonoBehaviour
{
public GameObject cubePrefab;
// Start is called before the first frame update
void Start()
{
// Instantiate the cube
GameObject cube = Instantiate(cubePrefab);
// Rotate the cube
cube.transform.Rotate(0f, 45f, ... |
<reponame>eden-lab/eden-archetype<gh_stars>1-10
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.dao.repository.mybatis;
// 关系数据库
|
#!/usr/bin/env bash
#
# The entrypoint script is what docker will use
# to set the environment before it is used. In this case,
# we:
#
# 1. Ensure that all required environments are present
# 2. That the project contains a configuration folder and configuration file
# 3. Optionally invite the user to create an e... |
module.exports = async function (message, tokens, command, client) {
require("dotenv").config();
const cc = require('../bot');
const Discord = require('discord.js');
const channel = "845386774327197726";
const config = require('../config.json');
if (message.author.id == process.env.OWNER) {
... |
/*
应用通用功能
*/
// 判断地址栏是否有lang参数,没有则跳转到带lang参数的地址
if(MET['url']['basepath']){
var str=window.parent.document.URL,
s=str.indexOf("lang="+M['lang']),
z=str.indexOf("lang");
if (s=='-1' && z!='-1') {
var s1=str.indexOf('#');
if (s1=='-1') {
str=str.replace(/(lang=[^#]*)/g... |
#https://github.com/hatem-mahmoud/scripts/blob/master/hugepage_usage_ins.sh
total_shmsize=0
total_hugepagesize=0
for pid in `ps -ef | grep ora_pmon_|egrep -v "grep|+ASM"| awk '{print $2}'`
do
echo
echo "-----------------------------------------------------------"
echo
ps -ef | grep $pid | grep -v grep
shmsize=`grep ... |
import { RefObject } from 'react';
export const createUseObserverVisible = (observerOptions: IntersectionObserverInit) => (
containerRef: RefObject<HTMLDivElement>
) => {
return true;
};
|
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import mock
import pytest
import requests
from requests.exceptions import ConnectTimeout, ProxyError
from datadog_checks.checks import AgentCheck
PROXY_SETTINGS = {
'http': 'http(s)://user:passwor... |
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {SimulationEditorComponent} from './simulation-editor.component';
import {SimulationService} from 'projects/gatling/src/app/simulations/simulation.service';
import {simulationServiceSpy} from 'projects/gatling/src/app/simulations/simulation... |
public class User
{
public string Username { get; set; }
public string Email { get; set; }
public int Age { get; set; }
public DateTime CreatedAt { get; set; }
} |
/*
* (c) Copyright 2015 Micro Focus or one of its affiliates.
*
* Licensed under the MIT License (the "License"); you may not use this file
* except in compliance with the License.
*
* The only warranties for products and services of Micro Focus and its affiliates
* and licensors ("Micro Focus") are as may be se... |
<reponame>achouman/IKVM.NET<gh_stars>10-100
/*
* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License ... |
<gh_stars>1-10
// TextStream.cpp: implementation of the CTextStream class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <no5tl\utils.h>
#include <no5tl\mystring.h>
#include <no5tl\colorfader.h>
#include <yahoo\myutf8.h>
#include "TextStream.h"
using n... |
<gh_stars>0
SELECT p.page_id, p.page_title, p.slug, p.keywords, p.description
FROM page p
WHERE slug = '{$url}'; |
#!/bin/sh
set -e
prefix="$HOME/.local/bin"
mkdir -p "$prefix"
this_script=$(basename "$0")
for script in *; do
if test -x "$script" && test -f "$script" && ! [ "$script" = "$this_script" ]; then
abs_script="$PWD/$script"
dest="$prefix/${script%.*}"
ln -s "$abs_script" "$dest"
echo "$... |
import { Injectable, InternalServerErrorException } from '@nestjs/common';
import { createWriteStream, existsSync, mkdirSync, unlinkSync } from 'fs';
import { FileUpload } from 'graphql-upload';
import { join } from 'path';
import * as moment from 'moment';
@Injectable()
export class UploadService {
public async upl... |
#! /usr/bin/env bash
set -e
cd /generator-output
CMDNAME=${0##*/}
usage() {
exitcode="$1"
cat <<USAGE >&2
Postprocess the output of openapi-generator
Usage:
$CMDNAME -p PACKAGE_NAME
Options:
-p, --package-name The name to use for the generated package
-h, --help Show this message
USA... |
<reponame>kkoogqw/OpenItem
package models
import (
"context"
"fmt"
"github.com/qiniu/qmgo/field"
"github.com/qiniu/qmgo/options"
"go.mongodb.org/mongo-driver/bson"
"proj-review/database"
"proj-review/log"
"proj-review/request"
"proj-review/response"
"proj-review/utils"
)
type Assignment struct {
field.Defa... |
# Define the positive and negative words
positive_words = ["good", "great", "excellent", "awesome", "amazing"]
negative_words = ["bad", "terrible", "horrible", "awful", "poor"]
# Prompt the user for their opinion
opinion = input("What do you think of this topic? ")
# Initialize counters for positive and negative word... |
package com.twitter.calculator
import com.twitter.finatra.thrift.ThriftServer
import com.twitter.finatra.thrift.routing.ThriftRouter
import com.twitter.finatra.thrift.filters._
import com.twitter.finatra.thrift.modules.ClientIdWhitelistModule
object CalculatorServerMain extends CalculatorServer
class CalculatorServe... |
public class ReverseString {
public static void main(String[] args) {
String str = "hello world";
System.out.println(reverseString(str));
}
public static String reverseString(String str) {
char[] arr = str.toCharArray();
int n = arr.length;
for (int i = 0; i < n... |
import { checkNpmVersions } from 'meteor/tmeasday:check-npm-versions';
checkNpmVersions({
"eval": "^0.1.2"
}, 'steedos:instance-record-queue');
|
/**
*
*/
package proxy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
/**
* @author dzh
* @date Oct 9, 2013 8:13:15 PM
* @since 1.0
*/
public class OutputHandler implements InvocationHandler {
private Object obj;
public OutputHandler(Object obj) {
this.obj = obj;
}
/*
... |
<filename>app/models/EvaluationResult.scala
package models
import play.api.libs.json._
case class EvaluationResult(mostSpeeches: String, mostSecurity: String, leastWordy: String)
object EvaluationResult {
implicit val writes = Json.writes[EvaluationResult]
}
|
def compute_bmi(height, weight):
bmi = weight / (height * height)
return bmi
bmi = compute_bmi(172, 85)
print("Your BMI is {:.2f}".format(bmi)) |
package ro.msg.learning.shop.dto;
import lombok.*;
import java.time.LocalDateTime;
@NoArgsConstructor
@AllArgsConstructor
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
public class CustomerOrderDto extends BaseDto {
private int locationId;
private String locationName;
private int customerId;
... |
S=`seq 3`
echo "real,user,sys" > ubuntu_classifier_time1.csv && \
(for i in $S; do TIMEFORMAT=%R','%U','%S && \
time ./demos/classifier.py infer ./models/openface/celeb-classifier.nn4.small2.v1.pkl images/examples/{carell,adams,lennon}* 2>/dev/null ;done)>ubuntu_classifier_output1.txt 2>> ubuntu_classifier_time1.csv
|
#!/bin/bash
for filename in src/*.js; do
name=${filename##*/}
base=${name%.js}
./node_modules/.bin/jsdoc2md "$filename" > "docs/$base.md"
done
chmod 777 -R docs; |
#!/usr/bin/env bash
set -e
set -x
SRC=${1:-"src/zenml tests"}
# mypy src/zenml
flake8 $SRC
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place $SRC --exclude=__init__.py,legacy/* --check
isort $SRC scripts --check-only
black $SRC --check
interrogate $SRC -c pyproject.toml |
module SagePay
module Server
class RefundResponse < Response
attr_accessor_if_ok :vps_tx_id, :tx_auth_no
self.key_converter = key_converter.merge({
"VPSTxId" => :vps_tx_id,
"TxAuthNo" => :tx_auth_no
})
self.value_converter[:status]["NOTAUTHED"] = :not_authed
def v... |
#!/usr/bin/env bash
#==========================================================================
#
# Copyright Insight Software Consortium
#
# 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 ... |
IMG=${1}
PSF=${2}
OVERSAMPLE=${3}
ERROR=${4}
XSHIFT=${5}
YSHIFT=${6}
RAC=${7}
DECC=${8}
LARGE_SCALE_FILTER=${9}
MASK_MORE=${10}
GET_SHIFT=${11}
SHIFT_ANCHOR=${12}
SHIFT_MASK=${13}
SHIFT_STEP=${14}
SHIFT_MAX=${15}
echo ${IMG}
DIR=`dirname ${IMG}`
# Change here the directory where the software is located (default: cur... |
<gh_stars>0
import {Component, Input, OnInit} from '@angular/core';
import {SubAssembly} from '../../../../../typescript-generator/configurator';
@Component({
selector: 'app-sub-assembly-tree',
templateUrl: './sub-assembly-tree.component.html',
styleUrls: ['./sub-assembly-tree.component.scss']
})
export cl... |
#!/bin/bash
pipenv run python -m unittest tests/test.py |
<filename>TOJ/toj 144.cpp
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct V{
int a;
int b;
bool x;
};
int main(){
int n,m;
scanf("%d%d",&n,&m);
V v1[m],v2[m];
for(int q=0;q<m;q++){
scanf("%d%d",&v1[q].a,&v1[q].b);
v1[q].x=0;
v2[q].... |
export MIDI_DEV=`amidi -l | grep ZOOM | awk '{print $2}'`
outFile=Check${1}.txt
for midiString in `grep "^SEND" ChangeTo${1}.txt | awk -F\: '{print $2}'`
do
echo "Sending next command"
echo "SEND: ${midiString}" >> ${outFile}
amidi -p ${MIDI_DEV} -S ${midiString} -r tm.bin -t 1 ; hexdump -C tm.bin > tm.txt
cat tm.t... |
<reponame>Gr-UML-SIR/TaxSejour<gh_stars>0
package com.prefecture.gestionlocale.model.service.facade;
import com.prefecture.gestionlocale.bean.Categorie;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
public interface CategorieService {
ResponseEntity<?> findAll(St... |
package model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.an... |
#!/bin/bash
h=false
b=false
dt="$(date "+%Y-%m-%d_%H_%M_%S")"
while getopts ":h :b" o; do
case "${o}" in
h)
h=true;;
b)
b=true;;
esac
done
echo "============================"
echo "Scraping HKN: $h"
echo "Scraping Berkeleytime: $b"
echo "Date/Time: $dt"
echo "=================... |
var $isOk = "";
$(function () {
$("#userName").blur(findUser);
$("#password").blur(password11);
$("#password22").blur(password22);
})
function check11() {
const a1 = $isOk;
const a2 = password11();
const a3 = password22();
const isTrue = a1 && a2 && a3;
if (!isTrue) {
alert("请填写... |
<gh_stars>10-100
#ifndef SLEEP_H
#define SLEEP_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __MINGW32__
#include <windows.h>
#include <unistd.h>
#endif // __MINGW32__
#ifdef __linux
#include <unistd.h>
#endif // __linux
void msleep(uint32_t usec);
#endif
|
<reponame>elko-dev/spawn<filename>firebase/firebase_test.go
package firebase
import (
"testing"
)
func TestPlatformReturnsErrorOnProjectError(t *testing.T) {
// ctrl := gomock.NewController(t)
// defer ctrl.Finish()
// mockProject := NewMockFirebaseProject(ctrl)
// mockProject.EXPECT().Create("projectId").Retu... |
<reponame>JakeKaad/minesweeper-js
mineSweeper.factory('CellsFactory', function CellsFactory() {
var factory = {};
factory.Cell = {};
factory.createCell = function(id) {
var cell = Object.create(factory.Cell);
cell.id = id;
cell.bomb = false;
cell.revealed = false;
cell.flag = false;
retur... |
<filename>opencga-analysis/src/main/java/org/opencb/opencga/analysis/AnalysisJobExecutor.java
/*
* Copyright 2015 OpenCB
*
* 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://... |
<filename>scripts/telaInicial.js
let minimo = 0
let minimoPesq = 0
var imagens = 5
var liTamanho
var scrollTamanho
let operacaoCarrosselLivro = null
let operacaoCarrosseislLivro = null
function frente(valor){
$(`#Carrosseis #carrossel${valor}`).animate({scrollLeft: $(`#Carrosseis #carrossel${valor... |
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <Windows.h>
#include <WinCrypt.h>
#if defined(__STDC__) && __STDC_VERSION__ >= 199901L
#include <std... |
#!/bin/bash
set -ev
go get github.com/Peanuttown/gopacket
go get github.com/Peanuttown/gopacket/layers
go get github.com/Peanuttown/gopacket/tcpassembly
go get github.com/Peanuttown/gopacket/reassembly
go get github.com/Peanuttown/gopacket/pcapgo
|
package com.myprojects.marco.firechat.main;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
imp... |
function make_crc_table(nbits, poly, mask) {
var crcTable = [];
var remainder;
var topbit = 0;
/*
* Count topbit
*/
topbit = 1<<(nbits-1);
poly &= mask;
/*
* Compute the remainder of each possible dividend.
*/
for (var dividend = 0; dividend < 256; ++dividend)
{
/*
* Start with the dividend follow... |
def contains_duplicates(list):
seen = set()
for item in list:
if item in seen:
return True
seen.add(item)
return False
list = [1, 3, 2, 4, 5, 3]
print(contains_duplicates(list)) |
#ifndef _INCLUDE_PRINT_H
#define _INCLUDE_PRINT_H
// Prints string
// String has to be terminated with '$'.
void printString(const char* str);
#endif |
const algorithmia = require("algorithmia")
const augorithmiaApiKey = require('../credentials/algorithmia.json').apiKey
const sentenceBoundaryDetection = require('sbd')
const watsonApiKey = require('../credentials/watson-nlu.json').apikey
const NaturalLanguageUnderstandingV1 = require('ibm-watson/natural-language-under... |
#! /bin/bash
dumpdir=${1-'/var/lib/p-rout/'}
filename=dump$(date +%Y%m%d-%H%M).sql.gz
find $dumpdir/ -name dump*-*.sql.gz -mtime +14 -delete
pg_dump -Z 9 -U p-rout -f $dumpdir/$filename -w p_rout
|
#include <iostream>
using namespace std;
int findMax(int arr[], int n) {
int max = arr[0];
for (int i=1; i<n; i++) {
if (arr[i] > max) {
max = arr[i];
}
}
return max;
}
int main() {
int arr[] = {-1, 3, 5, 8, 10, 15};
int n = sizeof(arr)/sizeof(arr[0]);
int max = findMax(arr, n);
cout << "The maximum v... |
try:
from django.urls import url, include
except:
from django.conf.urls import url, include
from . import views as malice_views
app_name = 'malice'
urlpatterns = [
url(
r'^200/$',
malice_views.OK.as_view(),
name="ok"
),
url(
r'^403/$',
malice_views.Permi... |
#!/bin/bash
#set -x
RATIO_LIST="1/128 1/8 1/4 1/2 2/1 4/1 8/1 128/1"
VALUE_SIZE_POWER_RANGE="8 14"
CONN_CLI_COUNT_POWER_RANGE="5 11"
REPEAT_COUNT=5
RUN_COUNT=200000
KEY_SIZE=256
KEY_SPACE_SIZE=$((1024 * 64))
BACKEND_SIZE="$((20 * 1024 * 1024 * 1024))"
RANGE_RESULT_LIMIT=100
CLIENT_PORT="23790"
COMMIT=
ETCD_ROOT_DI... |
<filename>infinibox_hosts_workload_graphite.py
'''
!/usr/bin/env python
Examples:
Overall Performance Statistics:
python infinibox_hosts_workload_graphite.py
-u "http://<infinimetrics_fqdn>/api/rest/"
-F <host fqdn>
-C "systems/<serialnumber>/monitored_entities"
-f "format=json&page=last&sort=-timestam... |
package it.madlabs.patternrec.web.rest.model;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Abstract a Line based on implicit formula: ax + by + c = 0
*
* Note:
* the explicit form for representing lines is y = m*x + q, but we can't use it to all lines
* because the equation of parallel lines t... |
#!/bin/sh
#uname -r
# 4.19.97-v7+
# remove -v7+ from above output
# -----------------------------
kernel=$(uname -r | awk -F\- '{print $1}')
#echo $kernel
# drivers for kernel
iio=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/iio
# open in browser
chromium-browser $iio/?h=v$kernel
|
import subprocess
def install_dependencies(system_deps, python_deps):
# Install system dependencies using apt-get
apt_command = ["sudo", "DEBIAN_FRONTEND=noninteractive", "apt-get", "install", "--no-install-recommends", "--yes"] + system_deps
try:
subprocess.run(apt_command, check=True)
pri... |
'use strict';
const fs = require('fs');
const { registerAndLogin } = require('../../../test/helpers/auth');
const { createAuthRequest } = require('../../../test/helpers/request');
let rq;
const defaultProviderConfig = {
provider: 'local',
name: 'Local server',
enabled: true,
sizeLimit: 1000000,
};
const re... |
#!/bin/sh
set -euo pipefail
if [ "$#" != "1" ]; then
exit 1
fi
echo $(cd "$(dirname "$1")" && pwd -P)/$(basename "$1")
|
#!/bin/bash
# Test clang-format formating
########################
# BEGIN CONFIG SECTION #
########################
CLANG_FORMAT_VERSIONS=( "7.0.0" "7.0.1" )
CALNG_FORMAT_DEFAULT_CMD="clang-format"
EXTENSIONS=( cpp hpp )
SOURCE_DIRS=( src lib )
CHECK_SUM=md5sum
########################
# END CONFIG SECTION #
###... |
<filename>old-katas/minimum-spanning-trees-kata/minimum-spanning-trees-kata-day-6/src/main/java/kata/java/LazySpanningTree.java
package kata.java;
import java.util.ArrayDeque;
import java.util.HashSet;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.stream.Collecto... |
#!/bin/sh
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
# Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
#
# Oracle and Java are registered trademarks of Oracle and/or its affiliates.
# Other names may be trademarks of their respective owners.
#
# The contents of this fi... |
#!/bin/bash
# AutoBuild Module by Hyy2001 <https://github.com/Hyy2001X/AutoBuild-Actions>
# AutoBuild Functions
Firmware-Diy_Before() {
ECHO "[Firmware-Diy_Before] Start ..."
CD ${GITHUB_WORKSPACE}/openwrt
Diy_Core
Home="${GITHUB_WORKSPACE}/openwrt"
[[ -f ${GITHUB_WORKSPACE}/Openwrt.info ]] && source ${GITHUB_WOR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.