text stringlengths 1 1.05M |
|---|
head -n 2 *.state | tail -n 1 | awk '{print $2}'
tail -n 1 *traj | awk '{print $1}'
tail -n 1 *xsc | awk '{print $1}'
#find -type f -name '*.count' ! -iname '*hist.count' -path '*noMin*'
#find -type f -name '*.count' ! -iname '*hist.count' -path '*noMin*' -exec tail -f "$file" {} +
|
<reponame>kokoropie/shopee-auto-login
import datetime
import os
import signal
import time
from settings import *
from crontab import CronTab
time_format = "%Y-%m-%d %H:%M:%S"
def stop_me(_signo, _stack):
log.info("Docker container has stoped....")
exit(-1)
def main():
signal.signal(signal.SIGINT, stop... |
<reponame>incessantmeraki/labmanagement
'use strict';
const Subject = require('../models/subject.js');
const Question = require('../models/question.js');
const Batch = require('../models/batch.js');
const subjects = module.exports = {};
/**
* GET /subjects - render list-subjects page.
*
* Results can be filte... |
#!/bin/bash
filewebsite="https://raw.githubusercontent.com/RetroFlag/retroflag-picase/master"
sleep 2s
#Step 1) Check if root--------------------------------------
if [[ $EUID -ne 0 ]]; then
echo "Please execute script as root."
exit 1
fi
#-----------------------------------------------------------
#Step 3) U... |
#!/bin/sh
if [ ! -f /tmp/mnt/sda1/myswap.swp ]; then
dd if=/dev/zero of=/tmp/mnt/sda1/myswap.swp bs=1M count=2048
mkswap /tmp/mnt/sda1/myswap.swp
fi
#enable swap
swapon /tmp/mnt/sda1/myswap.swp
echo 20 > /proc/sys/vm/swappiness
#check if swap is on
free
|
#https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
set -e
mkdir -p build
cd build
arm-none-eabi-g++ -Wall -Os -Werror -fno-common -mcpu=cortex-m3 -mthumb -msoft-float -fno-exceptions -fno-rtti -fno-threadsafe-statics -nostdlib -Wno-psabi -DLA104 -MD -D _ARM -c ../source/main.cpp ../../../os_host/so... |
import tensorflow as tf
# Create the model
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Flatten())
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))
model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu))
model.add(tf.keras.layers.Dense(10, activation=tf.nn.softmax))
# Compile the m... |
#!/bin/sh
if uname -a | grep -i -q ubuntu; then
lvmLine=`/usr/bin/nsenter --mount=/proc/1/ns/mnt dpkg --get-selections lvm2 | grep install -w -i | wc -l`
if [ "$lvmLine" = "0" ]; then
/usr/bin/nsenter --mount=/proc/1/ns/mnt apt install lvm2 -y
fi
else
lvmLine=`/usr/bin/nsenter --mount=/proc/1/ns/mnt rpm -q... |
package main
import "fmt"
// 类型别名
type mySentence string
type myInt int
type myFloat64 float64
func main() {
var message mySentence = "Hello World!"
var i myInt = 10
var f myFloat64 = 10.01
fmt.Println(message)
fmt.Printf("%T\n", message)
fmt.Println(i)
fmt.Printf("%T\n", i)
fmt.Println(f)
fmt.Printf("%T\... |
<gh_stars>0
/*
Buttons (UI elements)
*/
var pin_button;
var option_button;
var menu_button;
var start_button;
var stop_button;
var update_button;
/*
Links
*/
var recovery_link;
/*
Visual elements (pop-up's, menu's)
*/
var update_screen;
var login_screen;
var overlay;
var navbar;
var temp;
var time;
var state;
... |
<reponame>vikneshwara-r-b/chaosmonkey
// Copyright 2016 Netflix, 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 req... |
/*
* 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
* "License"); you ... |
#include <iostream>
using namespace std;
// Function to copy one array to another
void copyArray(int dest[], const int src[], int size) {
for (int i=0; i<size; i++)
dest[i] = src[i];
}
// Main method
int main() {
const int size = 4;
int arr1[size] = {1, 3, 5, 7};
int arr2[size];
copyArray(arr2... |
<filename>database_manager.py<gh_stars>0
import sqlite3
class DatabaseManager:
def __init__(self, database_file):
self.conn = sqlite3.connect(database_file, check_same_thread=False)
def __del__(self):
self.conn.commit()
self.conn.close()
def get_cursor(self):
return self.... |
#!/bin/bash
pipenv shell
/docker_start.sh
|
<filename>src/main/resources/static/clustergrammer/d3_clustergram.py<gh_stars>0
# define a class for networks
class Network(object):
'''
Networks have two states: the data state where they are stored as: matrix and nodes;
and a viz state where they are stored as: viz.links, viz.row_nodes, viz.col_nodes.
The goal... |
#!/bin/bash
set -e
# Load gcc
GCC_VERSION=gcc-9.2.0
set CC=/usr/bin/gcc
set GCC=/usr/bin/gcc
INSTALL_PREFIX=/opt
# HPC-X v2.9.0
MLNX_OFED_VERSION="5.4-1.0.3.0"
HPCX_VERSION="v2.9.0"
$COMMON_DIR/write_component_version.sh "HPCX" ${HPCX_VERSION}
TARBALL="hpcx-${HPCX_VERSION}-gcc-MLNX_OFED_LINUX-${MLNX_OFED_VERSION}-ub... |
/*
* $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/logger/FileLogger.java,v 1.8 2002/06/09 02:19:43 remm Exp $
* $Revision: 1.8 $
* $Date: 2002/06/09 02:19:43 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
... |
<filename>wallet/wallet.go<gh_stars>0
package wallet
import (
"encoding/hex"
"github.com/paw-digital/crypto/ed25519"
"github.com/paw-digital/nano/address"
"github.com/paw-digital/nano/blocks"
"github.com/paw-digital/nano/store"
"github.com/paw-digital/nano/types"
"github.com/paw-digital/nano/uint128"
"github.... |
<filename>crow/nodes/beam.h
#ifndef CROW_BEAM_H
#define CROW_BEAM_H
#include <crow/proto/node.h>
namespace crow
{
class beam : public crow::node, public crow::alived_object
{
std::string client_name;
crow::hostaddr crowker;
nodeid_t nodeno = CROWKER_BEAMSOCKET_BROCKER_NODE_NO;
pub... |
import * as React from 'react';
import { bind } from 'decko';
import { IActiveOrderColumnData, IOrderListSettings, IWidgetContentProps, IActiveOrder } from 'shared/types/models';
import { ISortInfo } from 'shared/types/ui';
import { OrderList } from '../../../containers';
type IProps = IWidgetContentProps<IOrderList... |
<filename>coati/merge.py
from coati.win32 import copy, execute_commandbar
from coati import utils, excel, powerpoint
import time
def resources(slide, resources):
for resource in resources:
resource.merge(slide)
|
package com.example.veterineruygulamas.Pojos;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AskPojo {
@SerializedName("_id")
@Expose
private String id;
@SerializedName("cevaptext")
@Expose
private String cevaptext;
... |
const BASE_URL = process.env.REACT_APP_BACKEND_URL;
const SUFFIX = 'api';
export const AUTH_ENDPOINTS = {
login: `${BASE_URL}/${SUFFIX}/user/auth`,
register: `${BASE_URL}/${SUFFIX}/user/`,
profile: `${BASE_URL}/profile`,
};
|
const Page = require("./page");
/**
* sub page containing specific selectors and methods for a specific page
*/
class Header extends Page {
/**
* define selectors using getter methods
*/
get menuButton() {
return $(".global-menu-icon")
}
/**
* a method to encapsule automation code to in... |
#!/bin/bash
LINK_OPTIONS=$1 # no force by default
# LINK_OPTIONS=${1:-"-f"} # force by default
echo "[OPTIONS] $LINK_OPTIONS"
echo
#
function _get_directory {
echo $(dirname "$1")
}
# absolute path
function _get_absolute_path {
echo $(readlink -f "$1")
}
# (internal helper function)
# e.g. echo `_get_absolute_pat... |
<gh_stars>1-10
package com.jiker.keju.taxicost;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class StringTools {
public static String getNumberFromText(String text) {
String regEx = "[0-9]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(text);
... |
<gh_stars>10-100
/* Copyright 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 applicable law or ag... |
#!/bin/bash
#set -o verbose
SCRIPT=`realpath $0`
echo "Running ${SCRIPT}"
#USER_GROUP="${USER}:$(id -gn $USER)"
echo "You are: ${USER}"
echo "First argument is: ${1}"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
echo "Please enter your root password below."
su --preserve-environment --com... |
#export MAIL_SERVER=localhost
#export MAIL_PORT=8025
python -m smtpd -n -c DebuggingServer localhost:8025
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const ServiceProvider_1 = require("../Application/ServiceProvider");
const Validation_1 = require("../Validation");
/**
* @name ValidationServiceProvider
* @author <NAME>
*/
class ValidationServiceProvider extends ServiceProvider_1.default ... |
define(['../map/VisibleArea','../../worldwind/navigate/LookAt'], function (VisibleArea,LookAt) {
var LookAtNavigator = LookAt;
/**
* Specific navigator for movement. It allows us to add logic to handling of the mouse wheel.
* @constructor
* @param options {Object} Options object containing
... |
. ./0env.sh
set -e
set -x
# If there are errors and you want to edit and resume,
# comment out the rm -rf, the git clone, usually
# the configure -- just cd and make
rm -rf $gcc
git clone git://git.saurik.com/llvm-gcc-4.2 $gcc
rm -rf $gcc/intl
rm -rf $build/gcc
mkdir -p $build/gcc
cd $build/gcc
$gcc/configure -targe... |
<reponame>dldhk97/ddonawa-server
package db;
import java.util.ArrayList;
import java.util.Arrays;
import model.Favorite;
public class FavoriteManager extends DBManager {
// 계정_id가 일치한 찜 목록을 반환한다.
public ArrayList<Favorite> findByAccountId(String accountId) throws Exception{
ArrayList<String> tableCo... |
<filename>test/tests.js
// import './renderPlants.test.js';
import './determineWaterAmount.test.js';
|
#!/bin/bash
dir=$(pwd)
cd $(dirname "${BASH_SOURCE[0]}")
cd ..
# Build
docker build -t meedan/%app_name% .
# Run
secret=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
docker run -d -p 3000:80 --name %app_name% -e SECRET_KEY_BASE=$secret meedan/%app_name%
echo
docker ps | grep '%app_name%'
echo
e... |
<gh_stars>100-1000
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms... |
//============================================================================
// Copyright 2009-2020 ECMWF.
// This software is licensed under the terms of the Apache Licence version 2.0
// which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
// In applying this licence, ECMWF does not waive the privil... |
// Copyright (c) 2012-2020 <NAME>
// SPDX-License-Identifier: MIT
#include <defs.h>
#include <file.h>
#include <fs.h>
#include <ip.h>
#include <net.h>
#include <param.h>
#include <sleeplock.h>
#include <socket.h>
#include <spinlock.h>
#include <types.h>
//
struct socket {
int type;
int desc;
};
struct file *
socke... |
<reponame>growsimplee/django-helper
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
VERSION = open(os.path.join(here, 'VERSION')).read()
README = open(os.path.join(here, 'README.md')).read()
setup(
name='django-helper',
version=VERSION,
package_dir={... |
import re
# Clean a string of HTML tags
def clean_html_tags(str):
clean_str = re.sub("<.*?>", "", str)
return clean_str
html_string = "<p>This is a <b>test</b> string</p>"
clean_str = clean_html_tags(html_string)
print(clean_str) #This is a test string |
module PoolParty
module Callbacks
module ClassMethods
def additional_callbacks(arr=[])
@additional_callbacks ||= arr
end
end
module InstanceMethods
def defined_callbacks
[
:before_bootstrap,
:after_bootstrap,
:before_configure,
... |
import { lighten, darken } from 'polished';
const primaryColor = '#272A2E';
const secondaryColor = darken(0.1, primaryColor);
const accentColor = '#D0021B';
const tertiaryColor = darken(0.1, '#fff');
const lightFontColor = '#fff';
const darkFontColor = 'rgb(50,50,50)';
const sansSerifFont = '"Alegreya Sans", sans-seri... |
import { ComponentClass, connect, Dispatch, MapDispatchToProps, MapStateToProps } from 'react-redux';
import { State } from '../state';
import { currentScreenChanged } from '../actions';
import ToolBar from '../toolbar';
import { ZeldaGame } from '../../ZeldaGame';
import { Position } from '../../Position';
import { Ac... |
# add path for /opt/vc/bin(sbin)
PATH=$PATH:/opt/vc/bin:/usr/lib/klibc/bin
if [ $(id -u) -eq 0 ]; then
PATH=$PATH:/opt/vc/sbin
fi
|
<filename>script.js
(function () {
'use strict';
$(document).ready(function () {
$('#files').dataTable({
'paging': false,
'info': false,
'order': [[1, 'desc']]
});
$('form[name="delete"]').submit(function () {
if ($('form[name="delete"] ... |
import java.util.HashMap;
import java.util.Map;
public class PerformanceLogger {
private Map<String, Long> processStartTimeMap;
public PerformanceLogger() {
processStartTimeMap = new HashMap<>();
}
public void startProcess(String processName) {
processStartTimeMap.put(processName, Sys... |
<filename>app.js
let parentEl = document.getElementById('seattle');
let parentEl2 = document.getElementById('tokyo');
let parentEl3 = document.getElementById('dubai');
let parentEl4 = document.getElementById('paris');
let parentEl5 = document.getElementById('lima');
let table = document.getElementById('salestable')
let... |
<filename>src/Auth.tsx
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import config from 'src/config/config';
import AppRouter from './AppRouter';
import history from 'src/redux/utils/history';
import { initClient, setActiveClient } from 'src/redux/modules/auth';
import { getOrganizat... |
#!/bin/bash
# Navigate to the static resources directory
cd $(dirname "${BASH_SOURCE[0]}")
cd ../looking_glass/static
# References:
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html
# https://github.com/nvm-sh/nvm/blob/master/README.md
# https://www.npmjs.com/pac... |
<reponame>fusepoolP3/skosjs
/**
* Created by IntelliJ IDEA.
* User: tkurz
* Date: 20.03.12
* Time: 11:12
* To change this template use File | Settings | File Templates.
*/
/**
* This is a simple demonstrator how you can write extensions.
* @param editor
* @return {Extension}
* @constructor
*/
function Simpl... |
def partition(arr, low, high):
i = (low - 1)
pivot = arr[high]
for j in range(low, high):
if arr[j] <= pivot:
i = i + 1
arr[i], arr[j] = arr[j], arr[i]
arr[i + 1], arr[high] = arr[high], arr[i + 1]
return (i + 1)
def quickSort(arr, low, high):
if... |
<reponame>mxjoly/MagicSlate
package component;
import java.awt.*;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.border.TitledBorder;
/**
* A JComboBox whose each items have icons and text
*/
public class CustomComboBox extends JPanel {
private static final long serialVersionUID =... |
// Setter dan Getter (Method untuk mendapatkan dan mengubah property yang private)
class ProductA {
private _price: number = 0;
private _discount: number = 0.05;
set price(val: number) {
this._price = val;
}
get price(): number {
return this._price - this._price * this._discount;
}
}
const produc... |
<reponame>acpatison/React-Portfolio
import 'bootstrap/dist/css/bootstrap.css';
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './app';
import * as serviceWorkerRegister from './serviceWorkerRegister';
import webVitals from './webVitals';
ReactDOM.render(
<React.St... |
#!/bin/sh
REPO=$(dirname "$0")
PREVCC="$CC"
PREVCXX="$CXX"
if command -v clang &> /dev/null
then
echo "-- Clang found on system, great! Long live LLVM! :D"
export CC=clang
export CXX=clang++
fi
rm -rf "$REPO"/build
mkdir -p "$REPO"/build && cd "$REPO"/build || exit
cmake -DBUILD_SHARED_LIBS=Off -DORLP_... |
#include <bits/stdc++.h>
using namespace std;
bool isUniqueChars(string str)
{
int checker = 0;
for (int i = 0; i < str.length(); i++)
{
int val = (str[i] - 'a');
if ((checker & (1 << val)) > 0)
return false;
checker |= (1 << val);
}
return true;
}
int main()
{
string str;
cin>>str;
c... |
function getAbsoluteMax(a, b) {
// First calculate the maximum number
let max = a > b ? a : b;
// Then calculate the absolute maximum
let absoluteMax = (max > 0) ? max : -max;
return absoluteMax;
} |
/*==================================================================*\
| EXIP - Embeddable EXI Processor in C |
|--------------------------------------------------------------------|
| This work is licensed under BSD 3-Clause License |
| The full license terms and condit... |
#!/bin/sh
# Don't ask ssh password all the time
if [ "$(uname -s)" = "Darwin" ]; then
git config --global credential.helper osxkeychain
else
git config --global credential.helper cache
fi
# better diffs
if which diff-so-fancy > /dev/null 2>&1; then
git config --global core.pager "diff-so-fancy | less --tabs=4 -... |
const { User } = require('../models')
const passport = require('passport')
const register = async (req, res, next) => {
const { username, password } = req.body
try {
const user = await User.register({ username }, password)
req.logIn(user, function (err) {
if (err) {
return next(err)
}
... |
/*
* Copyright The Stargate 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 agreed to ... |
<gh_stars>1-10
package com.minenash.soulguard.config;
import net.minecraft.particle.DustParticleEffect;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.Identifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Config {
public static int minutesUn... |
#!/bin/sh
# ssl-opt.sh
#
# This file is part of mbed TLS (https://tls.mbed.org)
#
# Copyright (c) 2016, ARM Limited, All Rights Reserved
#
# Purpose
#
# Executes tests to prove various TLS/SSL options and extensions.
#
# The goal is not to cover every ciphersuite/version, but instead to cover
# specific options (max f... |
#!/bin/bash
## Choose extra configure options depending on the operating system
## (mac or linux)
##
if [ `uname` == Darwin ] ; then
extra_config_options="LDFLAGS=-Wl,-headerpad_max_install_names"
fi
## Configure and make
./configure --prefix=$PREFIX \
--with-kinwalker \
--with-cluster \
... |
#!/bin/sh
systemctl status docker 1>/dev/null 2>&1 || STOP_DOCKER=1
systemctl start docker
docker system prune -f
docker system prune --volume -f
docker system prune --all -f
[ "${STOP_DOCKER}" = "1" ] && systemctl stop docker
|
$(document).on('ready', function () {
$('.dragg-taller-div').draggable({
helper: 'clone',
zIndex: 2000,
handle: '.panel-heading',
start: function (event, ui) {
ui.helper.css("width", "373px");
ui.helper.find('.panel-footer').remove();
ui.helper.fin... |
<reponame>ideacrew/pa_edidb
module LegacySpec
def be_true
be_truthy
end
def be_false
be_falsey
end
end
|
<gh_stars>0
//createStore is the function for creating the Redux store.
import { createStore } from 'redux';
import rootReducer from "../reducers/index"
// createStore takes a reducer
// as the first argument, rootReducer
const store = createStore(rootReducer)
export default store;
|
while read i; do
echo $i
SAMPLE=$i
SERVER=ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/${SAMPLE}/alignment/
FILE=$(curl ${SERVER} | grep -E '\.mapped.ILLUMINA.*bam$' | awk '{print $9}')
echo path is ${SERVER}${FILE}
samtools view -b ${SERVER}${FILE} 6:161033785-161066618 -o ${FILE}.lpa.bam
bamToFastq -i ${FI... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.basic_elaboration_folder_note = void 0;
var basic_elaboration_folder_note = {
"viewBox": "0 0 64 64",
"children": [{
"name": "polygon",
"attribs": {
"fill": "none",
"stroke": "#000000",
"stroke-width": ... |
# Initialize an empty list to store the elements
elements = []
while True:
# Display the menu options
print("Введіть 1, щоб вибрати стратегію 1.")
print("Введіть 2, щоб вибрати стратегію 2.")
print("Введіть 3, щоб генерувати дані.")
print("Введіть 4, щоб видалити елемент за вказаною позицією.")
... |
def max_of_two(a,b):
if a> b:
return a
else:
return b
max_of_two(10,11) |
package com.yoga.utility.quartz;
import com.yoga.core.exception.BusinessException;
import com.yoga.core.utils.DateUtil;
import org.hibernate.service.spi.ServiceException;
import org.quartz.*;
import org.quartz.impl.matchers.GroupMatcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springf... |
<reponame>nevermined-io/cryptoarts<filename>client/src/components/templates/Asset/ArtworkFile.tsx<gh_stars>1-10
import React, { PureComponent } from 'react'
import { Logger, DDO, File, Account } from '@nevermined-io/nevermined-sdk-js'
import Button from '../../atoms/Button'
import Spinner from '../../atoms/Spinner'
imp... |
#! /bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
source $DIR/common.sh
if [ -f ~/.liquidfiles/credentials ]; then
mv ~/.liquidfiles/credentials ~/.liquidfiles/.credentials
fi
$EXEC messages > /dev/null
status=$?
if [ $status -eq 0 ]; then
if [ -f ~/.liquidfiles/.credentials ]; then
... |
<gh_stars>1-10
#ifndef AES_H
#define AES_H
#include <stdint.h>
#include <stdlib.h>
#include <oqs/aes.h>
#define AES128_KEYBYTES 16
#define AES192_KEYBYTES 24
#define AES256_KEYBYTES 32
#define AESCTR_NONCEBYTES 12
#define AES_BLOCKBYTES 16
typedef void * aes128ctx;
static void aes128_keyexp(aes128ctx *r, const uns... |
<reponame>evazion/ruby-booru
require "danbooru/resource"
class Danbooru::Resource::Posts < Danbooru::Resource
def search(workers: 2, by: :page, **params)
all(workers: workers, by: by, **params)
end
def tag(id, tags)
tags = tags.join(" ") if tags.is_a?(Array)
update(id, "post[old_tag_string]": "", "p... |
/*
* Copyright 2013 Stanford University.
* 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 co... |
<filename>tests/events/bootup.js
module.exports = {
event:"ready",
execute({client}){
client.user.setActivity("I'm ready!");
}
} |
import { Request, Response, Router } from 'express';
import { generateRandomPairs } from './helpers';
import { VoteResult } from '../types';
import { DummyStorage } from '../store';
const router = Router();
const storage = new DummyStorage();
router.get('/', async (req: Request, res: Response) => {
const pairs = aw... |
from sklearn.cluster import KMeans
X = [[1, 2], [3, 4], [5, 6], [9, 1], [2, 8]]
kmeans = KMeans(n_clusters=2).fit(X)
clusters = kmeans.labels_
cluster_0 = [X[i] for i in range(len(clusters)) if clusters[i] == 0]
cluster_1 = [X[i] for i in range(len(clusters)) if clusters[i] == 1]
print(cluster_0) # [[1, 2], [3, 4], ... |
<reponame>sergirubio/PyTangoArchiving<filename>PyTangoArchiving/hdbpp/check_and_recover_attributes.py
import PyTangoArchiving as pta, fandango as fn, PyTangoArchiving.hdbpp.maintenance as ptam
import traceback
#dbs = ['hdbacc','hdbct','hdbdi','hdbpc','hdbrf','hdbvc']
dbs = pta.get_hdbpp_databases()
checks = dict((d,p... |
#!/bin/bash
#
# You should only work under the /scratch/users/<username> directory.
#
# Example job submission script
#
# -= Resources =-
#
#SBATCH --job-name=e-nonex-cardiac-sim
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=32
#SBATCH --partition=short
##SBATCH --exclusive
##SBATCH --constraint=e52695v4,36cpu
#SBATCH --... |
package malte0811.controlengineering.gui.panel;
import com.mojang.blaze3d.vertex.PoseStack;
import malte0811.controlengineering.ControlEngineering;
import malte0811.controlengineering.controlpanels.PlacedComponent;
import malte0811.controlengineering.gui.StackedScreen;
import malte0811.controlengineering.util.ScreenUt... |
<gh_stars>1-10
module.exports = {
getStaticProps: jest.fn(),
render: (req, res) => {
res.end("pages/fallback/[slug].js");
},
renderReqToHTML: (req, res) => {
return Promise.resolve({
html: "<div>Rendered Page</div>",
renderOpts: {
pageData: {
page: "pages/fallback/[slug].js... |
def sum_without_arithmetic_ops(a, b):
while b > 0:
carry = a & b
a = a ^ b
b = carry << 1
return a
result = sum_without_arithmetic_ops(3, 4)
print(result) |
#!/bin/sh
WEIRD_BG="\033[48;5;194m"
BLACK_FG="\033[38;5;0m"
BLACK_BG="\033[48;5;0m"
CLEAR_COLOR="\033[m"
MAIN_BG="\033[48;5;39m"
SIZE_BG="\033[48;5;11m"
TEST_FILE_BG="\033[48;5;172m"
FOLD="./copy_in_here_GNL_files/"
if [ ! -f "${FOLD}get_next_line.c" ] || [ ! -f "${FOLD}get_next_line_utils.c" ] || [ ! -f "${FOLD}g... |
#!/bin/bash
# Setup CPU port
ip link add name veth250 type veth peer name veth251
ip link set dev veth250 up
ip link set dev veth251 up
# Setup front panel ports
num_ports=16
for i in `seq 1 ${num_ports}`
do
ip tuntap add dev swp${i} mode tap
ip link set swp${i} up
done
|
#!/bin/bash
cd `dirname "$0"`
echo Starting HTTP server in `pwd` on http://localhost:8001
python -m SimpleHTTPServer 8001 &
echo Starting HTTP server in `pwd` on http://localhost:8000
python -m SimpleHTTPServer 8000
kill `jobs -p`
|
#!/bin/sh
if [ $# != 1 ]; then
echo Usage: ./release.sh 1.2.3
exit 1
fi
if [ -z "$OVSX_PAT" ]; then
OVSX_PAT="$(pass pat/openvsx)" || exit 1
export OVSX_PAT
fi
set -ex
new_version="$1"
sed -i 's/"version": ".*"/"version": "'$new_version'"/' package.json
npm i
git commit -am "Release $new_version"
git tag -a v... |
<reponame>NIRALUser/BatchMake
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: MomentRegistrator.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Insight Software Consortium. All rights reser... |
#!/bin/sh
closureLibPath=/home/olmozavala/Dropbox/TutorialsByMe/JS/ClosureLibrary/closure-library
closureCompilerPath=/home/olmozavala/Dropbox/TutorialsByMe/JS/ClosureLibrary/closure-compiler
ol3Path=/home/olmozavala/Dropbox/OpenLayers3/ol3
python $closureLibPath/closure/bin/build/closurebuilder.py \
--root=$closure... |
basic.forever(function () {
serial.writeValue("x", STTS751.temperature(STTS751.STTS751_T_UNIT.C))
basic.pause(1000)
}) |
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Peer from 'simple-peer';
import MediaHandler from '../MediaHandler';
import Echo from "laravel-echo";
import Swal from 'sweetalert2';
import withReactContent from 'sweetalert2-react-content';
import axios from 'axios';
const MySwal = wi... |
# 是否使用GPU(即是否使用 CUDA)
WITH_GPU=OFF
# 使用MKL or openblas
WITH_MKL=OFF
# 是否集成 TensorRT(仅WITH_GPU=ON 有效)
WITH_TENSORRT=OFF
# TensorRT 的路径,如果需要集成TensorRT,需修改为您实际安装的TensorRT路径
TENSORRT_DIR=/root/projects/TensorRT/
# Paddle 预测库路径, 请修改为您实际安装的预测库路径
PADDLE_DIR=/root/projects/fluid_inference
# Paddle 的预测库是否使用静态库来编译
# 使用TensorRT时,... |
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
<reponame>rafax/sourcegraph
package debugproxies
import (
"testing"
"github.com/google/go-cmp/cmp"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
)
func TestClusterScan(t *testing.T) {
var eps []Endpoint
consumer := func(seen []Endpoint) {
eps = nil... |
package monkey
import (
"errors"
"fmt"
"net/http"
"reflect"
"testing"
)
func TestMockGlobalFunc(t *testing.T) {
type args struct {
target interface{}
replacement interface{}
}
tests := []struct {
name string
args args
want *PatchGuard
}{
{
name: "test1",
args: args{
target: fmt.Pri... |
nunit-console ./Testity.EngineServices.Tests/bin/Debug/Testity.EngineServices.Tests.dll
nunit-console ./Testity.EngineComponents.Tests/bin/Debug/Testity.EngineComponents.Tests.dll
nunit-console ./Testity.EngineMath.Tests/bin/Debug/Testity.EngineMath.Tests.dll
nunit-console ./Testity.BuildProcess.Tests/bin/Debug/Testity... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.