text stringlengths 1 1.05M |
|---|
check_string <- function(string){
is_a_letter <- grepl("[a-zA-Z]", string)
return(is_a_letter)
} |
module Rspiderx
# Sample implementation for feeding the initial data for the fetcher
class FeederSimple
def feed(input)
return {
event: 'feed',
data: input
}
end
end
end
|
<gh_stars>0
'use strict';
angular.module('myApp.community', ['ngRoute','ngResource'])
.factory('Community',function($resource) {
return $resource('http://localhost:4000/community/:id')
})
.controller('communityCtrl', function($scope, Community,$http,$routeParams) {
/*var test = [];
test = ... |
#!/bin/bash
# todo: update arg handling
if [ $# -eq 0 ]; then
echo
echo Please provide archive file name, \'.tar.gz\' will be appended
echo
exit
fi
rm -f "./$1.tar.gz" >/dev/null
tarball_parent=/tmp
tarball_source=tari_testnet
tarball_folder=${tarball_parent}/${tarball_source}
if [ -d "${tarball_folde... |
<gh_stars>0
"use strict";
var str = "abcababcababcab";
//const str: string = "abab";
/**
*
* @param str String to find period in
* @returns
*/
function StringPeriod(str) {
console.log(str);
for (var size = str.length / 2; size >= 2; size--) {
for (var ind = 0; ind <= str.length - size; ind++) {
... |
import * as React from "react"
import PropTypes from "prop-types"
import { Container, Title, TitleSub, Section, UnOrderingList } from '../styles';
const servicesList = [
{
id: 1,
background: '#f9d423',
title: 'Digital Marketing'
},
{
id: 2,
background: '#2575fc',
... |
<reponame>WGBH/django-pbsmmapi
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-31 15:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
class Migration(migrations.Migration):
initial = True
dependenci... |
<gh_stars>1-10
import {
managedChild,
ManagedList,
ManagedRecord,
ManagedService,
service,
} from "typescene";
import { RemoteService } from "./Remote";
import { Profile } from "./User";
/** All fields for an article object */
export class Article extends ManagedRecord {
constructor(
public slug = "",
... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
export class Lists extends Component {
render() {
let arrTasks = this.props.items;
let componentUI = {
title: 'Uncompleted tasks',
style: ''
}
this.props.titleStatus === 1 ?
... |
#!/bin/bash
SAVEIFS=$IFS;
IFS=$(echo -en "\n\b");
if [ A$1 == "A" ]; then
echo "Need an input file"
exit 0;
fi
MIX_ENERGY_DATA_FILE=$1
#Filter Wind
awk -F, '{if(match($3,/Wind/)) print;}' $MIX_ENERGY_DATA_FILE > filter_wind.csv;
#then Aggregate all regions electricity generation by hour
awk -F, '{data[$1]+=$4;}EN... |
<reponame>iamareebjamal/roboclub-amu
package amu.roboclub.ui.fragments;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridL... |
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import { storiesOf } from '@storybook/react';
import Filter16 from '@carbon/icons-react/lib/filter/16';
import { wi... |
function UserService(editor, host) {
function update(ed, concepts, property, single, callback) {
if (!ed.active) return;
if (!ed.graph) return;
var delExisting = (single == true);
var urlParams="?property="+encodeURIComponent(property)
+ "&context="+encodeURIComponent(... |
<reponame>mikitamironenka/job4j<gh_stars>0
package ru.job4j.io;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
//Метод main - записывает текст в файл "unavailable.csv"
//Задание.
//1. Реализуйте метод unavailable.
//source - имя файла лога
//target - имя файла после анализа.
//2. Метод unavailab... |
package de.ids_mannheim.korap.config;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author hanl
* @date 17/06/2015
*/
public class DefaultHandler {
private Map<String, Object> defaults;
public DefaultHandler () {
this.defaults = new HashMap<>();
loadClasses... |
<filename>gatsby-config.js
const path = require('path')
module.exports = {
siteMetadata: {
title: `<NAME> | Fullstack Software Developer`,
description: `Fullstack web and software developer with experinces in NodeJS, React, GO and DevOps.`,
author: `@alexanderhorl`,
nav: [
{
name: 'Cont... |
import 'babel-polyfill'
import Mappersmith from 'mappersmith'
import 'mappersmith/fixtures'
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
const middlewares = [ thunk ]
const mockStore = configureMockStore(middlewares)
import {
FAILURE_SHOW_RETRY,
FAILURE_HIDE_RETRY,
REQUEST_F... |
<filename>opendnp3/APL/PhysicalLayerMonitor.h
//
// Licensed to Green Energy Corp (www.greenenergycorp.com) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Green Enery Corp licenses this file
// to you u... |
<reponame>nimbus-cloud/cli<filename>src/cf/net/gateway.go
package net
import (
"cf"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"runtime"
"strings"
"time"
)
const (
INVALID_TOKEN_CODE = "GATEWAY INVALID TOKEN CODE"
JOB_FINISHED = "finished"
JOB_FAILED = "failed"... |
<gh_stars>0
const formatNumber = require('.')
const tp = require('testpass')
const tests = [
[1, '1.00'],
[1.1, '1.10'],
[1.11, '1.11'],
[1.111, '1.11'],
[1.115, '1.11'],
[9.99, '9.99'],
[9.995, '9.99'],
// Hundreds
[100, '100.00'],
[100.1, '100.10'],
[100.11, '100.11'],
[100.001, '100.00'],... |
package com.klk.mobilefingerprint.data;
import com.klk.mobilefingerprint.models.Staff;
import java.util.ArrayList;
public class GlobalData {
public static ArrayList<Staff> StaffList = new ArrayList<>();
private static GlobalData instance;
public static GlobalData getInstance() {
if(null == inst... |
public static int maxSumOfSubArray(int[] arr, int k) {
int n = arr.length;
int max_sum = 0;
for (int i = 0; i < n - k + 1; i++)
{
int current_sum = 0;
for (int j = 0; j < k; j++)
current_sum += arr[i + j];
max_sum = Math.max(current_sum, max_sum);
}
return max_sum;
}
System.out.pr... |
#!/bin/sh
if which redis-server > /dev/null 2>&1 ;
then
echo 0 > ~/install-exit-status
else
echo "ERROR: Redis server is not found on the system! No redis-server found in PATH."
echo 2 > ~/install-exit-status
fi
tar -xzf memtier_benchmark-1.3.0.tar.gz
cd memtier_benchmark-1.3.0
autoreconf -ivf
./configure
make -j ... |
#!/bin/bash -l
export DATA_DIR=../data/cogs
source activate pytorch_p36
mkdir $DATA_DIR
python ../preprocess.py -train_src $DATA_DIR/train_source.txt -train_tgt $DATA_DIR/train_target.txt -valid_src $DATA_DIR/dev_source.txt -valid_tgt $DATA_DIR/dev_target.txt -save_data $DATA_DIR/1_example -src_seq_length 5000 -tgt_... |
<filename>src/academy/devonline/java/home_section001_classes/function_methods/Remove.java
/*
* Copyright 2022. http://devonline.academy
*
* 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 Lice... |
package br.com.papyrus.controller;
import br.com.papyrus.model.ModelEditorasDAO;
import br.com.papyrus.model.ModelEditorasTableModel;
import br.com.papyrus.model.ModelEditorasVO;
import br.com.papyrus.view.ViewEditoras;
import static br.com.papyrus.view.ViewPrincipal.DesktopPrincipal;
import java.awt.Component;... |
<filename>Reference/qpc/html/search/variables_9.js
var searchData=
[
['l_5fidlethread_1235',['l_idleThread',['../qxk_8c.html#a0458880fea6279421c6acde673d48e3f',1,'qxk.c']]],
['l_5fmsm_5ftop_5fs_1236',['l_msm_top_s',['../qep__msm_8c.html#aae45de5c95eacc55233bf6773aab8049',1,'qep_msm.c']]],
['locfilter_1237',['locF... |
// Loads a JSON file
function loadJSON(jsonUrl) {
return $.ajax({
url: jsonUrl,
dataType: "json"
});
}
//draw the map key with D3
function drawKey() {
//key width and height
var width = 250;
var height = 500;
//get the key element from index
var key = d3.select("#key");
var svg = key.append("svg")
.attr... |
#!/usr/bin/env bash
export DEVENVROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
source $DEVENVROOT/scripts/cmn.sh
final_ret=0
probe_module cfg80211
if [ $? -ne 0 ]; then
final_ret=1
fi
insert_module vwifi.ko
if [ $? -ne 0 ]; then
final_ret=2
fi
if [ $final_ret -eq 0 ]; then
sudo ip link set owl... |
#!/bin/bash
env=$1
fails=""
inspect() {
if [ $1 -ne 0 ]; then
fails="${fails} $2"
fi
}
# run client and server-side tests
dev() {
docker-compose up -d --build
docker-compose exec users python manage.py test
inspect $? users
docker-compose exec users black .
inspect $? users-fix
docker-compose ex... |
import axios from 'axios'
const GET_SINGLE_USER = 'GET_SINGLE_USER'
const getSingleUser = user => ({
type: GET_SINGLE_USER,
user
})
export const getSingleUserThunk = id => async dispatch => {
try {
const response = await axios.get(`/api/users/${id}`)
const user = response.data
dispatch(getSingleUse... |
<gh_stars>1-10
/**
* 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 (the
* ... |
package com.imooc.o2o.service;
import com.imooc.o2o.BaseTest;
import org.junit.Test;
import redis.clients.jedis.Jedis;
public class RedisTest extends BaseTest {
@Test
public void methodOne(){
Jedis jedis = new Jedis("172.16.31.10",6379);
jedis.set("name","xixi");
String vale = jedis... |
<reponame>3Xpl0it3r/loki-operator<gh_stars>1-10
package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:defaulter-gen=true
// Promtail defines Promtail deployment
type Promtail struct {
metav1.TypeMeta `json... |
var searchData=
[
['ratelimiter',['RateLimiter',['../classserver_1_1RateLimiter.html',1,'server']]]
];
|
<reponame>christopherwallis/Fixate
import sys
import time
import re
from pubsub import pub
from fixate.core.common import TestList, TestClass
from fixate.core.exceptions import SequenceAbort, CheckFail
from fixate.core.ui import user_retry_abort_fail
STATUS_STATES = ["Idle", "Running", "Paused", "Finished", "Restart",... |
#
# Copyright (C) 2021 Vaticle
#
# 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... |
package com.google.teampot.servlet.task;
import java.io.IOException;
import java.util.logging.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.teampot.Config;
import com.google.teampot.model.User;
import com.... |
package math;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Boj1008 {
private static final String SPACE = " ";
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Str... |
#!/bin/bash
# import.js
printf "import.js:5:1 = "
assert_ok "$FLOW" type-at-pos import.js 5 1 --strip-root --pretty
# exports.js
printf "exports.js:3:24 = "
assert_ok "$FLOW" type-at-pos exports.js 3 24 --strip-root --pretty
printf "exports.js:5:25 = "
assert_ok "$FLOW" type-at-pos exports.js 5 25 --strip-root --pret... |
package com.leetcode;
import java.util.Arrays;
public class Solution_1099 {
public int twoSumLessThanK(int[] nums, int k) {
Arrays.sort(nums);
int ans = -1;
int left = 0;
int right = nums.length - 1;
while (left < right) {
if (nums[left] + nums[right] < k) {
... |
package logging;
import java.util.logging.*;
public class LogUtils {
private Logger logger;
private String TAG = "";
private boolean isEnabled = false;
private LogUtils(){
// prevent default constructor
}
public LogUtils(String TAG, boolean enable){
this.TAG = TAG;
... |
#!/bin/bash -
#===============================================================================
#
# FILE: repo_prepare.sh
#
# USAGE: ./repo_prepare.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Kacper Kowalski (kk), kac... |
import { of, race, timeout } from '@tanbo/stream';
describe('race', () => {
test('发送时间最近的值', done => {
const unsub = race(timeout(100, 1), timeout(10, 2)).subscribe(value => {
unsub.unsubscribe();
expect(value).toBe(2)
done()
})
})
test('只发送一个值', done => {
const arr: any[] = []
... |
def process_experiment_data(block, ads_press, ads_amount, des_press, des_amount):
if not all(isinstance(lst, list) for lst in [ads_press, ads_amount, des_press, des_amount]):
return None # Invalid input format
material_id = block.get('_sample_material_id')
units_loading = block.get('_units_loading... |
struct CustomArray<T> {
private var elements: [T]
init(_ elements: [T]) {
self.elements = elements
}
func prettyDescription() -> String {
var output: [String] = ["\n["]
for (index, element) in elements.enumerated() {
output.append("\t\(index): \(element)")
}... |
import * as path from 'path';
import * as vscode from 'vscode';
export class OnlyLocalScriptItem extends vscode.TreeItem {
contextValue = "onlyLocalScriptItem";
constructor(public fileUri: vscode.Uri) {
super("", vscode.TreeItemCollapsibleState.None);
this.description = `${path.base... |
# SQLiteファイル作成スクリプト
# $ start -i /tmp/DatabasesDefine -o /tmp/DatabaseOutput
# -i: DBディレクトリとsqlファイルが存在するルートディレクトリパス
# -o: .sqlite3ファイルを出力するディレクトリパス
InputDir=`pwd`
OutputDir=`pwd`
while getopts "i:o:" OPT
do
case $OPT in
i) InputDir="$OPTARG"; echo "InputDir: ${InputDir}"; ;;
o) OutputDir="$OPTARG"; echo "Out... |
<reponame>UrbanRiskSlumRedevelopment/Maya<gh_stars>0
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'bootstrap-grid',
template: '<ng-content></ng-content>',
styles: [`
@-ms-viewport {
width: device-width;
}
html {
-webkit-box-sizing: border-box;
... |
/*
*
*/
package net.community.chest.ui.components.panel;
import java.awt.Component;
import java.awt.FlowLayout;
import javax.swing.Icon;
import javax.swing.JLabel;
import net.community.chest.awt.TypedComponentAssignment;
import net.community.chest.awt.attributes.Iconable;
import net.community.chest.awt.attributes.... |
#!/bin/sh
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2015 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... |
<gh_stars>0
import path from 'path'
import { GatsbyNode } from 'gatsby'
// @ts-ignore
import createPaginatedPages from 'gatsby-paginate'
import postSlug from './src/utils/post-slug'
import { CATEGORY_BASE, TAG_BASE } from './src/templates/blog-post/url-base'
export const createPages: GatsbyNode['createPages'] = ({
... |
<gh_stars>1-10
class UiState {
constructor() {
this.hours = new Array();
this.minutes = new Array();
this.seconds = new Array();
}
setHours(val) {
this.hours = this.splitIntoParts(val);
}
setMinutes(val) {
this.minutes = this.splitIntoParts(val);
}
setSeconds(val) {
this.seconds... |
#!/bin/bash
# Author: yeho <lj2007331 AT gmail.com>
# BLOG: https://linuxeye.com
#
# Notes: OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+
#
# Project home page:
# https://oneinstack.com
# https://github.com/oneinstack/oneinstack
Install_PHP72() {
pushd ${oneinstack_dir}/src > /dev/null
if ... |
#!/usr/bin/zsh
echo "== Starting ship script =="
cd `realpath "$0" | xargs dirname`
. ./config.sh
[ -z "$BUILD_DIR" ] \
&& echo 'No build directory (BUILD_DIR) specified or config didnt load' \
&& exit 1
cd "$BUILD_DIR"
[ $? -eq 1 ] \
&& echo "Cant change into build directory (BUILD_DIR) at '$BUILD_DIR'" \
... |
<reponame>libertyernie/3DSFE-Randomizer<gh_stars>1-10
package randomizer.common.enums;
public enum SkillType
{
Basic, Enemy, DLC, Personal
}
|
def compress_file(file_path: str) -> None:
if COMPRESSOR_DEBUG:
print(f"Debugging information: Compressing file {file_path}")
if COMPRESSOR_OFFLINE_COMPRESS:
print("Performing offline compression")
else:
print("Using online compression services") |
/*
* Core
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 6.1-preview
* Contact: <EMAIL>
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not ... |
package cmu.xprize.asm_component;
/**
*
*/
public interface IDotMechanics {
// set up?
void preClickSetup();
// just resets to the default state
void next();
// called by C_Component.nextDigit()
void nextDigit();
// I *think* this is where the magic of moving the dots happens
// i... |
<filename>src/components/Buttons.js
import React, { Component } from 'react';
export default class Buttons extends Component {
render() {
return (
<div>
<div onClick={() => this.props.fetchData('starships')}>Starships</div>
<div onClick={() => this.props.fetchData('people')}>People</div>
... |
<gh_stars>10-100
package io.opensphere.mantle.data.cache;
import java.io.File;
/**
* The CacheConfiguration for the DataElementCache.
*/
public final class CacheConfiguration
{
/** The disk cache location. */
private final File myDiskCacheLocation;
/**
* The max allowed elements in me... |
<gh_stars>10-100
import numpy as np
np.set_printoptions(threshold=np.inf)
Model_name = 'level_1012'
outputs_ori = f'SSIM/results/{Model_name}_outputs_ori.npy'
outputs_scal = f'SSIM/results/{Model_name}_outputs_scal.npy'
outputs_ori_array = np.load(outputs_ori)
outputs_scal_array = np.load(outputs_scal)
print(outputs... |
#!/bin/bash
# Copyright (c) 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
#Function to output message to StdErr
function echo_stderr ()
{
echo "$@" >&2
}
#Function to display usage message
function usage()
{
echo_std... |
function averageOfNums(nums) {
let sum = 0;
for (let num of nums) {
sum += num;
}
return sum / nums.length;
} |
"use babel"
import { CompositeDisposable } from "atom"
import IndentationLinesView from "./indentation-lines-view"
export default {
activate() {
this.subscriptions = new CompositeDisposable()
this.subscriptions.add(atom.workspace.observeTextEditors((editor) => {
new IndentationLinesView(editor)
}... |
#!/usr/bin/env bash
SRC=/$1
docker-compose \
run \
--rm \
img-convert \
convert -density 256x256 -background none $SRC -colors 256 /src/static/favicon.ico
#convert -density 384 -background transparent $SRC -define icon:auto-resize -colors 256 /src/static/favicon.ico
|
<reponame>zonesgame/StendhalArcClient
package mindustry.type;
import arc.func.*;
import mindustry.ctype.*;
import mindustry.ctype.ContentType;
import mindustry.entities.traits.*;
/**
* Unit的Trait类型ID
* */
public class TypeID extends MappableContent{
public final Prov<? extends TypeTrait> constructor;
publ... |
package com.chequer.axboot.core.mybatis;
public interface MyBatisMapper {
}
|
#!/usr/bin/env bash
# Don't use the default trap in common.bash
NOTRAP=1
HEREDIR=$(readlink -f "$(dirname "$0")")
# shellcheck source=common.bash
source "$HEREDIR/common.bash"
function usage {
echo "usage: $0 [FLAGS] [-r trials] [-f fuzzer-name] [-p snaps-placement] -d outdir -o output-csv -t target"
echo " ... |
<reponame>Sopiro/Physics
import { Vector2 } from "./math.js";
import { Simplex } from "./simplex.js";
export interface ClosestEdgeInfo
{
index: number;
distance: number;
normal: Vector2;
}
export class Polytope
{
public readonly vertices: Vector2[];
constructor(simplex: Simplex)
{
if ... |
var NAVTREEINDEX31 =
{
"armnn_tf_parser_2test_2_mean_8cpp.xhtml#ac13d193e18724ec1171e0e1a7909ac7f":[8,0,1,8,0,21,4],
"armnn_tf_parser_2test_2_mean_8cpp.xhtml#ac46e1d1e4c8f3de33bb8d22c5b57c7c1":[8,0,1,8,0,21,1],
"armnn_tf_parser_2test_2_mean_8cpp.xhtml#ae777849f6582f53b6b29eb3fd9c3bc22":[8,0,1,8,0,21,3],
"armnn_tf_parse... |
'use strict';
// Add your code here
const createBase = function ( num ) {
return function constructing (value) {
return num + value;
};
};
let addSix = createBase(6);
addSix(10); // returns 16
addSix(21); // returns 27
console.log(addSix(10));
console.log(addSix(21));
|
<reponame>felipebaloneker/Practice<filename>javascript/150 exercicios basicos/102_Find_Inversion.js
function FindInversion(array){
var result = 0;
for(i=0;i < array.length;i++){
// test for all numbers is more than i
for(y=i +1; y < array.length;y++){
if(array[i] > array[y]){result++... |
def bubble_sort(arr):
# Traverse the array
for i in range(len(arr)-1):
# Perform N-1 passes
for j in range(0, len(arr) - i - 1):
# Swap if element is greater than its adjacent neighbor
if arr[j] > arr[j+1] :
arr[j], arr[j+1] = arr[j+1], arr[j]
# Dr... |
<reponame>MrBattary/ncstore-back
package com.netcracker.ncstore.security.filter;
/**
* Custom filter exception
*/
public class JwtAuthFilterException extends RuntimeException {
/**
* Exception
*
* @param message - message
*/
public JwtAuthFilterException(final String message) {
su... |
import { StakePoolsActions } from './actions';
import { StakePoolsApi } from './api';
import { StakePoolsStore } from './store';
export const stakePoolsActions = new StakePoolsActions();
export const stakePoolsApi = new StakePoolsApi();
export const stakePoolsStore = new StakePoolsStore(
stakePoolsActions,
stakePo... |
// Copyright 2015 PLUMgrid
//
// 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... |
<filename>tests/hooks/chroot_test.go
package cos_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/rancher-sandbox/cOS/tests/sut"
)
var _ = Describe("cOS Feature tests", func() {
var s *sut.SUT
BeforeEach(func() {
s = sut.NewSUT()
s.EventuallyConnects(360)
})
Context("After i... |
#!/bin/bash
cd utils && yarn
cd ..
cd aframe && yarn && yarn run build
cd ..
cd babylonjs && yarn && yarn run build
cd ..
cd r3f && yarn && yarn run build
cd ..
cd threejs && yarn && yarn run build
cd ..
cd web && yarn && yarn run build
cd ..
cd wonderland && yarn && yarn run build
cd ..
cp -R aframe/dist dist
cp -R ... |
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "pml.hpp"
using namespace pml;
void interactive_mode(Thms & theorems, ThmDict & thm_dict);
void filechecking(const std::string & filename, Thms & theorems, ThmDict & thm_dict);
int main(int argc, char *argv[]) {
Thms theorems;
Thm... |
class FormValidator {
func validateFormInput(_ input: String) -> Bool {
return !input.isEmpty && input.count >= 8
}
} |
from flask_restplus import Resource, reqparse
from flask_jwt import jwt_required
from models.item import ItemModel
class Item(Resource):
# Adding parser as part of the class
parser = reqparse.RequestParser()
parser.add_argument('price',
type = float,
required = True,
help = "Price is required!" )... |
<gh_stars>0
"""Retrieve data from Meetup API
"""
# -*- coding: utf-8 -*-
import os
import json
import urllib2
from datetime import datetime
import requests
from bs4 import BeautifulSoup
import MySQLdb
import predictor
MEETUP_API_KEY = '<KEY>'
MEETUP_API_BASE = 'https://api.meetup.com'
URL_RE = r'^https?:\/\/.*[\r\n]*... |
#!/bin/sh
echo "myDBPassword" | docker secret create psql-pw -
|
import { RenderPassDescriptor } from "../webgpu";
import { Subpass } from "./Subpass";
import { Scene } from "../Scene";
import { Camera } from "../Camera";
export class RenderPass {
renderPassDescriptor = new RenderPassDescriptor();
private _subpasses: Subpass[] = [];
private _activeSubpassIndex: number = 0;
... |
/*
* Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
#!/usr/bin/env bash
# Compiling with ghcjs
stack build --stack-yaml=stack-ghcjs.yaml
# Moving the generated files to the js folder
rm -r js
cp -r .stack-work/dist/x86_64-linux/Cabal-1.24.0.0_ghcjs/build/mockClient/mockClient.jsexe/ js
# Swapping the default html with the one serving a minified version
cp assets/html... |
#include <GA/GA_Handle.h>
#include <GU/GU_Detail.h>
#include <OP/OP_AutoLockInputs.h>
#include <OP/OP_Operator.h>
#include <OP/OP_OperatorTable.h>
#include <PRM/PRM_Include.h>
#include <UT/UT_DSOVersion.h>
#include "Calculator.h"
#include "SOP_ComputeTangents.h"
static PRM_Name modeName("basic", "Basic Mode");
PRM_Te... |
<gh_stars>1-10
import { Price } from "@interfaces/price.interface";
import { MainCurrency } from "./main-currency.interface";
export interface ExchangeUIContainer {
mainCurrencies: MainCurrency[];
prices: Price[];
applicationNames: string[];
} |
#! /bin/bash
export SCRIPT="$( basename "${BASH_SOURCE[0]}" )"
export SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export WORKSPACE=${WORKSPACE:-$SCRIPTPATH/../workspace}
source $SCRIPTPATH/common.sh
export BOSH_NON_INTERACTIVE=${BOSH_NON_INTERACTIVE:-true}
export BOSH_ENV_FILE=${BOSH_ENV_FILE:-$W... |
#!/bin/sh
export GPU_ID=$1
echo $GPU_ID
cd ..
export DATASET_DIR="datasets/"
export CUDA_VISIBLE_DEVICES=$GPU_ID
# Activate the relevant virtual environment:
python train_continual_learning_few_shot_system.py --name_of_args_json_file experiment_config/omniglot_variant_default_5_way_1_maml++_high-end_shot__True_10_10... |
# !/usr/bin/env python3
#
# Copyright 2014 <NAME>
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to u... |
"use strict";
const nums = [1, 2, 3];
function permute(nums) {
const permutations = [];
const foo = (permutation, unique) => {
if (nums.length === permutation.length) {
permutations.push(permutation.slice(0));
return;
}
for (let i = 0; i < nums.length; i++) {
... |
def avg_arr(arr):
s = 0
for i in arr:
s += i
return s/len(arr)
print(avg_arr(arr)) |
<filename>dot-plot/dot-plot.js
function makeChart(data,stylename,media,plotpadding,legAlign,yAlign,xMin,xMax, xAxisHighlight, numTicksx, size){
var titleYoffset = d3.select("#"+media+"Title").node().getBBox().height
var subtitleYoffset=d3.select("#"+media+"Subtitle").node().getBBox().height;
// return th... |
#include <iostream>
#include <sstream>
#include <string>
namespace mime {
struct text_t {
std::string data;
};
void serialize(std::stringstream &s, const mime::text_t &text) {
if (text.data.empty()) {
s << "EMPTY"; // Placeholder for handling empty text data
} else {
bool containsWh... |
/*
* (C) Copyright 2016-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 the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation, or (at... |
<filename>targets/TARGET_Silicon_Labs/TARGET_EFM32/trng/sl_trng.c
/*
* True Random Number Generator (TRNG) driver for Silicon Labs devices
*
* Copyright (C) 2016, Silicon Labs, http://www.silabs.com
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you m... |
import re
def parse_url_info(url):
url_parts = url.split('/')
filename = url_parts[-1]
version_match = re.search(r'-(\d+\.\d+)', filename)
if version_match:
version = version_match.group(1)
else:
version = None
sha256_match = re.search(r'sha256=([a-fA-F0-9]{64})', url)
if s... |
#!/bin/bash
while [[ $(grep -c "Installation completed" /var/tmp/dietpi/logs/dietpi-firstrun-setup.log) == 0 ]]
do
sleep 5
done
sleep 30
reboot
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.