text stringlengths 1 1.05M |
|---|
<filename>components/table/hooks/usePagination.ts
import useState from '../../_util/hooks/useState';
import type { Ref } from 'vue';
import { computed } from 'vue';
import type { PaginationProps } from '../../pagination';
import type { TablePaginationConfig } from '../interface';
export const DEFAULT_PAGE_SIZE = 10;
... |
const findTwoSmallestElements = function(array) {
let smallestNumber = array[0];
let secondSmallestNumber = null;
for (let i=1; i<array.length; i++) {
if (array[i] > 0 && array[i] < smallestNumber) {
secondSmallestNumber = smallestNumber;
smallestNumber = array[i];
} ... |
# Using recursion to sum the numbers in a list
def recursive_sum(arr):
if len(arr) == 0:
return 0 # Base case
else:
return arr[0] + recursive_sum(arr[1:]) # Recursive case
print("Sum of the list:", recursive_sum([2, 4, 6, 8])) |
package io.opensphere.mantle.icon.chooser.view;
import javafx.scene.layout.AnchorPane;
import io.opensphere.mantle.icon.chooser.model.IconModel;
/** Packages UI elements into one pane. */
public class IconView extends AnchorPane
{
/** Panel comprised of Tree and icon display. */
final private IconS... |
<gh_stars>1-10
from django.contrib.auth.backends import ModelBackend as BaseModelBackend
class ModelBackend(BaseModelBackend):
"""Custom permission backend that uses model methods to check for permissions."""
def get_user_permissions(self, user_obj, obj=None):
base_permissions = super().get_user_perm... |
import { Trans } from '@lingui/macro';
import React, { Component } from 'react';
import Dialog from '../UI/Dialog';
import Window from '../Utils/Window';
import FlatButton from '../UI/FlatButton';
import Text from '../UI/Text';
import { ResponsiveWindowMeasurer } from '../UI/Reponsive/ResponsiveWindowMeasurer';
import ... |
#
# Sets completion options.
#
# Authors:
# Robby Russell <robby@planetargon.com>
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Return if requirements are not found.
if [[ "$TERM" == 'dumb' ]]; then
return 1
fi
# Add zsh-completions to $fpath.
fpath=("${0:h}/external/src" $fpath)
# Load and initialize the comp... |
../phyhat_gene.py -f ex_gene.fa -d ex_gene.db -n "SpA SpB SpC SpD spE" |
package com.mblinn.mbfpp.oo.strategy
object PeopleExample {
case class Person(
firstName: Option[String],
middleName: Option[String],
lastName: Option[String])
def isFirstNameValid(person: Person) = person.firstName.isDefined
def isFullNameValid(person: Person) = person match {
case... |
export * from './error.middleware';
export * from './validation.middleware';
export * from './i18n.middleware';
|
const assert = require('assert');
const std = require('../../src');
/* global describe it */
describe('unique test', () => {
it('list test', () => {
const list = new std.List();
const limit = 1000;
for (let i = 0; i < limit; i += 1) {
list.pushBack(Math.floor(Math.random() * 10));
}
std.uni... |
package info.u250.c2d.box2d.model.joint;
import info.u250.c2d.box2d.model.b2JointDefModel;
import com.badlogic.gdx.math.Vector2;
public class b2RevoluteJointDefModel extends b2JointDefModel{
private static final long serialVersionUID = 1L;
/** The local anchor point relative to body1's origin. */
publ... |
package malte0811.controlengineering.util;
import com.mojang.datafixers.util.Pair;
import net.minecraftforge.common.util.NonNullConsumer;
import java.util.Objects;
public class Clearable<T> {
private T value;
private Clearable(T value) {
this.value = value;
}
public static <T> Pair<Clearabl... |
import base64
# Function to encode
def encode(text):
encoded_text = base64.b64encode(text.encode('utf-8'))
return encoded_text
# Function to decode
def decode(text):
decoded_text = base64.b64decode(text).decode('utf-8')
return decoded_text
# Main function
def main():
text = "Hello World!"
encoded_text = encode... |
package network
import (
"net"
"os"
"testing"
)
func TestAllocate(t *testing.T) {
subnet := `{"192.168.0.0/24":"1100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... |
#!/bin/bash
# Copied from upstream logrotate
# Upstream source at https://github.com/ceph/ceph/blob/master/src/logrotate.conf
if which invoke-rc.d > /dev/null 2>&1 && [ -x `which invoke-rc.d` ]; then
invoke-rc.d ceph reload >/dev/null
elif which service > /dev/null 2>&1 && [ -x `which service` ]; then
service ... |
<filename>App.js<gh_stars>0
import React, { useContext, useState, useEffect, useMemo, useReducer } from 'react';
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createDrawerNaviga... |
<filename>test/test_parse_sql.rb
require File.join(File.expand_path(File.dirname(__FILE__)), 'required_file.rb')
class TestParseSql < Test::Unit::TestCase
def test_parse_sql
contents = "execute \"UPDATE topics SET highest_staff_post_number = highest_post_number\""
ast = YARD::Parser::Ruby::RubyParser.parse(c... |
<filename>js/sykepengesoknad/utils/beregnBrodsmulesti.js<gh_stars>1-10
import { getLedetekst } from '@navikt/digisyfo-npm';
import beregnSteg, { KVITTERING } from './beregnSteg';
import { getSykefravaerUrl, getUrlTilSoknad, getUrlTilSoknader } from '../../utils/urlUtils';
const beregnBrodsmulesti = (sti, id) => {
... |
<filename>models/leave.schema.js
import mongoose from "mongoose"
const leaveSchema = {
leaveType: { type: String},
leaveTaken: { type: Number }
}
export const leaveModel = mongoose.model("leave", leaveSchema, 'leave') |
<filename>jframe-demo/demo-plugin/jframe-demo-elasticsearch/src/main/java/jframe/demo/elasticsearch/weike/Domain.java
package jframe.demo.elasticsearch.weike;
import java.io.Serializable;
public interface Domain extends Serializable {
}
|
/*
* Copyright 2015-present Open Networking 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 appli... |
<filename>jgrapht-master/jgrapht-core/src/main/java/org/jgrapht/traverse/DegeneracyOrderingIterator.java
/*
* (C) Copyright 2017-2018, by <NAME> and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under
* either
*
* (a) the terms of ... |
#!/bin/bash
set -eux
image_name=kiyoad/wb_centos6
id=$(date '+%Y%m%d')
script -ac "docker build -t ${image_name} -f Dockerfile.centos6 ." docker_build_centos6_${id}.log
|
<filename>packages/app/src/components/VisualizationOptions/__tests__/CheckboxBaseOption.spec.js
import React from 'react'
import { shallow } from 'enzyme'
import { Checkbox } from '@dhis2/ui'
import { CheckboxBaseOption } from '../Options/CheckboxBaseOption'
describe('DV > Options > CheckboxBaseOption', () => {
... |
const crypto = require('crypto');
let sessions = [];
const FILES_REMOVE_EXPIRED_SESSIONS_FREQ_MILLI = process.env.FILES_REMOVE_EXPIRED_SESSIONS_FREQ_MINS * 60 * 1000;
setInterval(removeExpiredSessions, FILES_REMOVE_EXPIRED_SESSIONS_FREQ_MILLI);
const ROLE = {
ADMIN: 'admin',
USER: 'user',
INVITEE: 'invit... |
#!/usr/bin/env bash
#--------------------------------
# NO PASSWORD IS DISPLAYED!!!!
# FOR EDUCATIONAL PURPOSES ONLY!
#--------------------------------
CLEAN="\033[0m"
RED='\033[01;31m'
YELLOW='\033[01;33m'
WHITE='\033[01;37m'
GREEN='\033[01;32m'
BOLD='\033[1m'
if [ "$EUID" -ne 0 ]
then printf "${RED}[-]${CLEAN... |
<reponame>uwap/BahnhofsAbfahrten
// @flow
import { Actions } from 'client/actions/config';
import { type ActionType, handleActions } from 'redux-actions';
import { defaultConfig, setCookieOptions } from 'client/util';
import Cookies from 'universal-cookie';
export type State = {|
cookies: Cookies,
open: boolean,
... |
const toBin = (num) => {
return num.toString(2);
}
console.log(toBin(10)); // 1010 |
<filename>src/config/mail.js
/**
* @author: <NAME> <<EMAIL>>
* @description: Configuration for App Email tests with mailtrap.io
*/
export default {
host: 'smtp.mailtrap.io',
port: 2525,
secure: false,
auth: {
user: 'cfffd6667b5174',
pass: '<PASSWORD>'
},
default: {
from: 'FastFeet Notificati... |
package org.jeecg.modules.device.service;
import com.ciat.bim.server.dao.ToData;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import org.apache.poi.ss.formula.functions.T;
import org.jeecg.modules.device.entity.TsKvLatest;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package binarytree;
/**
*
* @author jeff
*/
public class BinaryTree {
Nodo root;
//inserta un nodo
public void add... |
<filename>tests/shared/src/main/scala/caseapp/demo/ManualCommandNotAdtOptions.scala
package caseapp.demo
import caseapp.{ArgsName, ProgName}
object ManualCommandNotAdtOptions {
@ProgName("c1")
@ArgsName("c1-stuff")
final case class Command1Opts(s: String)
@ProgName("c2")
final case class Command2Opts(b: B... |
<gh_stars>0
const { Agent, api, db, util } = require('../lib')
describe('db-noauth', function () {
let agent
before(function () {
agent = new Agent()
// Change the organization name to trigger unknown organization errors.
agent.orgName = util.randomString()
})
it('fails exists with bad parameter ... |
import requests
# api-endpoint
URL = "http://www.marketwatch.com/investing/stock/AAPL"
# sending get request and saving the response as response object
r = requests.get(url = URL)
# extracting data in json format
data = r.json()
# extracting stock quote
stock_quote = data['price']
# creating the web ... |
# frozen_string_literal: true
module Bridgetown
class PluginManager
attr_reader :site
# Create an instance of this class.
#
# site - the instance of Bridgetown::Site we're concerned with
#
# Returns nothing
def initialize(site)
@site = site
end
# Require all the plugins wh... |
import {Exception} from "./Exception";
export class InvalidTokenException extends Exception {
constructor(code: string = null, message: string = null, data: any = null) {
super();
if (!code) {
this.code = 'INVALID';
} else {
this.code = code;
}
if (... |
import scipy.io as sio
import numpy as np
import scipy
import matplotlib.pyplot as plt
import matplotlib as mpl
from svm import *
from svmutil import *
def get_hyper_param(y, x):
'''
Get the best hyperparameters, C and gamma.
Args:
y: label
x: data
Returns:
C, gamma
'''
... |
const assert = require('assert');
const flatstr = require('flatstr');
const hook = require('../../../src/custom/cappasity-info-post');
const file = {
uploadId: 'f1c9d940-35bf-44f7-9134-89bee51d0ee3',
uploadType: 'simple',
c_ver: '4.0.0',
packed: false,
status: '3',
};
describe('cappasity-info-post hook tes... |
#!/bin/sh
CONF_FILE="etc/system.conf"
YI_HACK_PREFIX="/tmp/sd/yi-hack"
YI_HACK_UPGRADE_PATH="/tmp/sd/.fw_upgrade"
YI_HACK_VER=$(cat /tmp/sd/yi-hack/version)
MODEL_SUFFIX=$(cat /tmp/sd/yi-hack/model_suffix)
get_config()
{
key=$1
grep -w $1 $YI_HACK_PREFIX/$CONF_FILE | cut -d "=" -f2
}
start_buffer()
{
#... |
#! /bin/bash
bash ../Helper/BiomarkerBenchmark/download.sh "https://osf.io/k4sng/download?version=4"
|
<gh_stars>1-10
/*
* src/bin/pgcopydb/filtering.c
* Implementation of a CLI which lets you run individual routines
* directly
*/
#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include "env_utils.h"
#include "ini.h"
#include "log.h"
#include "filtering.h"
#include "parsing.h"
#include "string... |
<filename>lib/car/obj/src/cals_flag_e.c
/* **** Notes
Flag
//*/
# define CALEND
# define CAR
# include "../../../incl/config.h"
signed(__cdecl cals_flag_e(cals_t(*argp))) {
auto signed char **argv;
auto cals_event_t event;
auto signed i,r;
if(!argp) return(0x00);
r = cals_init_event(&event);
if(!r) {
printf("%s ... |
#ifndef __C99INT_H__
#define __C99INT_H__
/* Visual Studio 2013+ supports (some of) the c99 standard. */
#if defined(_MSC_VER) && _MSC_VER < 1800
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint... |
class Gobo:
def __init__(self, x, y, health):
self.x = x
self.y = y
self.health = health
def move(self, new_x, new_y):
self.x = new_x
self.y = new_y
def take_damage(self, damage):
self.health -= damage
def is_alive(self):
return self.health > 0
... |
<filename>packages/styled-components/src/models/test/ThemeProvider.test.js
// @flow
/* eslint-disable react/no-multi-comp */
import React from 'react';
import TestRenderer from 'react-test-renderer';
import ThemeProvider from '../ThemeProvider';
import withTheme from '../../hoc/withTheme';
import { resetStyled } from '... |
import { Router } from "express";
import { processCreditcardPayment } from "./../services/dataHandler";
import CreditCardExpiredError from "./../errors/CreditCardExpiredError";
import Jaeger from "./../jaeger";
import CircuitBreaker from "opossum";
const router = Router();
const opossumOptions = {
timeout: 15000, /... |
#include <cmath>
double slerp(double startAngle, double endAngle, double t) {
const double PI = 3.14159265358979323846;
double delta = endAngle - startAngle;
if (delta > PI) {
endAngle -= 2 * PI;
} else if (delta < -PI) {
endAngle += 2 * PI;
}
return startAngle + t * (endAngle -... |
#! /bin/sh
# https://gist.github.com/SkyWriter/58e36bfaa9eea1d36460
# For each of the above filesystems, delete empty snapshots except the latest snapshot
FIRST_RELEASE=2017-08-25
VERSION=1.0
PROJECT_PAGES="https://github.com/Josef-Friedrich/zfs-delete-empty-snapshots.sh"
SHORT_DESCRIPTION='Delete empty ZFS snapshot... |
#!/usr/bin/env sh
# generated from catkin/cmake/template/setup.sh.in
# Sets various environment variables and sources additional environment hooks.
# It tries it's best to undo changes from a previously sourced setup file before.
# Supported command line options:
# --extend: skips the undoing of changes from a previou... |
const { GraphQLClient } = require('graphql-request');
const btoa = require("btoa");
async function main() {
const endpoint = process.env.TURBOT_GRAPHQL_ENDPOINT;
const accessKeyId = process.env.TURBOT_ACCESS_KEY_ID;
const secretAccessKey = process.env.TURBOT_SECRET_ACCESS_KEY;
const graphQLClient = new GraphQ... |
#!/bin/bash
# update/generate kubernetes config file to access eks cluster
set -e
CURDIR=`dirname $0`
EKS_NAME=eks
SPINNAKER_MANAGED=false
export AWS_DEFAULT_REGION=us-east-1
export KUBECONFIG=$CURDIR/kubeconfig
function print_usage() {
echo "Usage: $0 -k <kubeconfig-path> -n(name) <eks-name> -r(region) <aws-regio... |
#!/usr/bin/env bash
PHP_VERSION_MIN="70300"
PHP_VERSION_MAX="70399"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/dbal:~2.5"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/orm:~2.6.3"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/doctrine-bundle"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE symfony/config:~3.3"
COMPOSER_REQUIRE="$C... |
<gh_stars>0
package com.acgist.snail.pojo.message;
import com.acgist.snail.net.torrent.tracker.TrackerLauncher;
import com.acgist.snail.utils.BeanUtils;
/**
* <p>Tracker刮檫响应消息</p>
* <p>UDP:http://www.bittorrent.org/beps/bep_0048.html</p>
* <p>HTTP:https://wiki.theory.org/index.php/BitTorrentSpecification</p>
*
... |
<gh_stars>10-100
jest.mock( '../column' );
import { Column } from '../column';
import { DefaultHandler } from './default-handler';
const rows = [
{ id: 1, user: { firstName: 'John', lastName: 'Doe' }, order: 2, eq: 42 },
{ id: 2, user: { firstName: 'Jane', lastName: 'Doe' }, order: 1, eq: 42 },
{ id: 3, user: { fir... |
#!/bin/bash
set -eo pipefail
dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
serverImage="$1"
# Use a client image with curl for testing
clientImage='buildpack-deps:jessie-curl'
# Create an instance of the container-under-test
cid="$(docker run -d "$serverImage")"
trap "docker rm -vf $cid > /dev/null" EXIT
_reque... |
<reponame>shammishailaj/ghd<gh_stars>0
package utils
import (
"log"
"reflect"
)
func GetFieldTagMap(d interface{}, tagIdentifier string) map[string]string {
log.Printf("============================================================GetFieldTagMap()")
log.Printf("d = %#v", d)
var fieldTagMap map[string]string
if d... |
# Generated by Powerlevel10k configuration wizard on 2020-12-06 at 19:56 +07.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 24826.
# Wizard options: nerdfont-complete + powerline, small icons, rainbow, unicode,
# vertical separators, round heads, flat tails, 2 lines, dotted, no frame,
# darkest-orn... |
<reponame>appigram/windmill-react-ui
import React from 'react';
interface Props extends React.TdHTMLAttributes<HTMLTableCellElement> {
}
declare const TableCell: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLTableCellElement>>;
export default TableCell;
//# sourceMappingURL=TableCell.d.ts.map |
// Source : https://leetcode.com/problems/sum-root-to-leaf-numbers/
// Author : <NAME>
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {number}
*/
var ans;
function dfs(root, sum) {
... |
#!/bin/bash
if [ -n "$EMAIL" ]; then
git config user.email "$EMAIL"
fi
if [ -n "$PASSWORD" ]; then
git config user.name "Travis Ci"
fi
export TAG=$(git log -1 | grep -Eo 'tag: ([0-9\.]+)' | cut -d' ' -f2)
if [ -n "$TAG" ]; then
git remote set-url origin "https://brunodles:${PASSWORD}@github.org/brunodles... |
import os
import errno
def is_process_running(pid):
try:
os.kill(pid, 0)
except OSError as err:
if err.errno == errno.ESRCH:
# ESRCH == No such process
return False
return True |
<reponame>ismetguzelgun/cooking-js<gh_stars>0
//v1
a = 2;
var a;
console.log( a );
//v1 changes into
var a;
a = 2;
console.log( a );
//v2
console.log( a );
var a = 2;
//v2 changes into
var a;
console.log( a );
a = 2;
//v1 vs. v2
/**
* JS sadece deklarasyonları yukarı taşıyor
* yani birinci örnekte var a, a=2 nin... |
package acceptance
import (
"github.com/onsi/gomega/ghttp"
"net/http"
"os/exec"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-installation command", func() {
var (
server *ghttp.Server
)
BeforeEach(func() ... |
import io
# Google Cloud Platform
from google.cloud import speech_v1
from google.cloud.speech_v1 import enums
# Audio configuration
sample_rate_hertz = 44100
channels = 1
language_code='en-US'
client = speech_v1.SpeechClient()
# Set audio encoding
encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16
config = {... |
#!/usr/bin/env bash
# Common IBM blockchain platform functions, e.g. to provision a blockchain service
# shellcheck disable=2086
# shellcheck source=src/common/utils.sh
source "${SCRIPT_DIR}/common/utils.sh"
#######################################
# Setup constants for bluemix cloud foundry interaction
# Globals:
# ... |
/* eslint-disable @typescript-eslint/no-var-requires */
import { HttpCode, HttpException, HttpStatus, Injectable } from '@nestjs/common';
const bcrypt = require('bcrypt');
import { PrismaService } from '../Prisma/prisma.service';
import { users, usersCreateInput, usersWhereUniqueInput } from '@prisma/client';
import { ... |
def most_frequent_letter(word, letters):
# Create a dictionary of letter frequency
frequency = {letter : word.count(letter) for letter in letters}
# Get the highest frequency letter
max_frequency = max(frequency.values())
# Get the index of the letter with the highest frequency
index = word.find... |
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import Dropzone from 'react-dropzone';
import ReactTooltip from 'react-tooltip';
// material ui
import { Button, Tooltip, Typography } from '@material-ui/core';
import { Help as HelpIcon, Sort as SortIcon } from ... |
#!/usr/bin/env mocha -R spec
import {strict as assert} from "assert";
import {binJSON} from "../";
const TITLE = __filename.split("/").pop();
type Filter = (num: number) => any;
const toHex = (obj: ArrayBufferView | number[]) => {
if (ArrayBuffer.isView(obj)) {
obj = Array.from(new Uint8Array(obj.buffer... |
<filename>src/flatten.js
// @flow
import type { ReadableStreamController } from "./streams";
import { ReadableStream, WritableStream } from "./streams";
import { zipWith } from "./utils";
/**
* This function takes one or more streams and returns a readable combining
* the streams, returning chunks as they arrive i... |
// Copyright The OpenTelemetry 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 agre... |
#!/bin/bash
echo "+name" >> /etc/group
echo "+" >> /etc/group
echo "+@group" >> /etc/group
|
import React from "react";
export const CustomTextarea: React.FC<CustomTextareaProps> = ({
field,
form: { touched, errors },
label,
...props
}) => (
<div className="input-group">
{touched[field.name] && errors[field.name] ? (
<span className="label-input label-error">{errors[field.name]}</span>
... |
<filename>src/main/resources/META-INF/resources/js/cric_controllers.js
'use strict';
/* Controllers */
envyLeagueApp.controller('CricMyLeaguesController', function ($scope, $cookies, $location, Session, CricketLeague) {
$scope.error = null;
$scope.errorMessage = null;
$scope.updateVisible = true;
//Or... |
body {
font-family: sans-serif;
}
#title {
text-align: center;
font-size: 1.5em;
font-weight: bold;
}
#navigation {
text-align: center;
bottom: 0;
width: 100%;
position: fixed;
background: #ddd;
}
#navigation a {
text-decoration: none;
padding: 0.5em;
color: black;
}
... |
/*
Copyright (c) 2017, UPMC Enterprises
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
notice, this list of conditions and the f... |
#!/bin/bash -e
time=$(date +%Y-%m-%d)
mirror_dir="/var/www/html/rcn-ee.us/rootfs/bb.org/testing"
DIR="$PWD"
git pull --no-edit https://github.com/beagleboard/image-builder master
export apt_proxy=apt-proxy:3142/
if [ -d ./deploy ] ; then
sudo rm -rf ./deploy || true
fi
if [ ! -f jenkins.build ] ; then
./RootStock... |
#!/bin/sh
set -e
. `dirname "$0"`/common.sh
DATASET="$1"
CSV_FILE="$DATA_DIR/${DATASET}.csv"
CONFIG_FILE="$MODEL_DIR/${DATASET}.config.xml"
PROJECT="${2:-$(cat tmp/pid)}"
UPDATE="${3:-}"
if [ ! "$CONFIG_FILE" ] ; then
die "Usage: $0 <dataset> [<project> [<update_flag>]]"
fi
if [ $UPDATE ] ; then
command='Generat... |
#!/bin/sh
HOST="172.16.238.15"
USER="$1"
PASS="$2"
FILE="$3"
#Choose random file
#FILE=$(ls /dataToShare/ | sort -R | tail -1)
cd /dataToShare
echo "CONNECTING ..."
ftp -p -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASS
pwd
ls
bin
verbose
prompt
put $FILE newfile
quit
END_SCRIPT
exit 0
|
#!/usr/local/bin/ksh93 -p
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or htt... |
#!/bin/bash
#
# (C) Copyright 2013 The CloudDOE Project and others.
#
# 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 ... |
/*
* Copyright 2016-2017 <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 ap... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2929-2
#
# Security announcement date: 2016-03-14 00:00:00 UTC
# Script generation date: 2017-01-01 21:05:16 UTC
#
# Operating System: Ubuntu 12.04 LTS
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - linux-image-3.13.0-83-generic-lpae:3... |
read -p "?" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
...
fi
|
<reponame>josebright/tulip_foundation_website
import { Press } from '../constant';
const initialState = {
loading: false,
Press: [],
message: null,
error: null,
};
const PressReducer = (state = initialState, action) => {
switch (action.type) {
case Press.PRESS_REQUEST:
return {
...state,
... |
<reponame>groupon/nakala
/*
Copyright (c) 2013, Groupon, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditio... |
package org.vertx.java.core.cluster;
import org.jboss.netty.util.CharsetUtil;
import org.vertx.java.core.buffer.Buffer;
import org.vertx.java.core.logging.Logger;
import org.vertx.java.core.net.NetSocket;
import org.vertx.java.core.net.ServerID;
/**
* <p>Represents a message sent on the event bus.</p>
*
* @author ... |
<reponame>savvytruffle/cauldron
import matplotlib
matplotlib.use('agg')
import sys, itertools, time, os
print(os.uname())
import emcee
from emcee.utils import MPIPool
#from helper_funcs import *
from eb_fitting import *
kic = int(sys.argv[1])
try:
prefix = sys.argv[2]
except:
prefix = '/astro/store/gradscratch... |
# WEBPORTHTTP MODE #####################################################################################################
if [ "$MODE" = "webporthttp" ]; then
if [ "$REPORT" = "1" ]; then
if [ ! -z "$WORKSPACE" ]; then
args="$args -w $WORKSPACE"
LOOT_DIR=$INSTALL_DIR/loot/workspace/$WORKSPACE
ech... |
<reponame>Lysandroc/topcriptocurrency<filename>src/components/CryptoCoins.js<gh_stars>0
import React from 'react';
import {StyleSheet, ScrollView, Text, Alert, View} from 'react-native';
import { connect } from 'react-redux';
import fetchCurrency from '../actions/fetchCurrency'
import CryptoCoinDetail from './CryptoCoi... |
#!/usr/bin/env bash
# Capstone Disassembly Engine
# By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014
# Note: to cross-compile "nix32" on Linux, package gcc-multilib is required.
# build iOS lib for all iDevices, or only specific device
function build_iOS {
IOS_SDK=`xcrun --sdk iphoneos --show-sdk-path`
IOS_CC=`x... |
package com.github.mikephil.charting.test;
import com.github.mikephil.charting.data.*;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.IPieDataSet;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static junit.framework.A... |
package com.acgist.snail.net.torrent.tracker;
import org.junit.jupiter.api.Test;
import com.acgist.snail.context.TorrentContext;
import com.acgist.snail.context.exception.DownloadException;
import com.acgist.snail.context.exception.NetException;
import com.acgist.snail.pojo.session.TorrentSession;
import com.acgist.s... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-SWS/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-SWS/512+512+512-shuffled-N-first-256 --do_eval --per_de... |
require 'sinatra'
require 'mongoid'
# Connect to the MongoDB
Mongoid.load!("mongoid.yml")
# Fetch all documents from the `Posts` collection
get '/posts' do
@posts = Post.order(created_at: :desc).all
erb :index
end
# Show a single post based on the id
get '/posts/:id' do
@post = Post.find(params[:id].to_i)
er... |
<gh_stars>1-10
import pytest
import os
import constants as c
import iosm
def area_coor():
# Define the area for test: Inaccessible Island in south Atlantic Ocean
lon_min = -12.707272
lon_max = -12.640879
lat_min = -37.322413
lat_max = -37.279825
return lon_min, lon_max, lat_min, lat_max
de... |
import {Link} from 'react-router';
import {RouteComponentProps} from 'react-router/lib/Router';
import {css} from '@emotion/core';
import PropTypes from 'prop-types';
import React from 'react';
import styled from '@emotion/styled';
import {IssueAlertRule} from 'app/types/alerts';
import {SavedIncidentRule} from 'app/v... |
public class StarPattern {
public static void main(String[] args) {
//Rows
for (int i = 0; i < 10; i++) {
//Columns
for (int j = 0; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}
}
} |
<gh_stars>0
const router = require("express").Router();
const Potlucks = require("./potluck-model");
router.get("/", async (req, res, next) => {
try {
const potlucks = await Potlucks.getAll();
res.json(potlucks);
} catch (err) {
next(err);
}
});
router.post("/", async (req, res, next) => {
try {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.