text stringlengths 1 1.05M |
|---|
#!/bin/sh
source activate bokeh_server
redis-server --port 7001 |
<filename>js/articles/table.controller.js
angular
.module('news')
.controller('ArticleTableCtrl', ArticleTableCtrl);
function ArticleTableCtrl($http, BASE_URL) {
var vm = this,
fb = new Firebase(BASE_URL),
user = fb.getAuth();
vm.vote = function (direction, uuid) {
var data = vm.arti... |
public static boolean isValidEmail(String email) {
String regex = "^[\\w-_.+]*[\\w-_.]@([\\w]+\\.)+[\\w]+[\\w]$";
return email.matches(regex);
} |
##################################################################
## (c) Copyright 2015- by <NAME> ##
##################################################################
#====================================================================#
# qmcpack_method_analyzers.py ... |
#!/bin/bash
ifconfig p1p1 192.168.1.2 mtu 9710
arp -s 192.168.1.1 00:25:90:eb:e0:9e
sysctl -w \
net.core.rmem_max=26214400 \
net.core.wmem_max=16777216 \
net.core.rmem_default=524288 \
net.core.wmem_default=524288 \
fs.file-max=100000 \
vm.swappiness=10 \
net.core.optmem_max=40960 \
net.core.netdev_max_... |
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import ArrowUp2Svg from '@rsuite/icon-font/lib/legacy/ArrowUp2';
const ArrowUp2 = createSvgIcon({
as: ArrowUp2Svg,
ariaLabel: 'arrow up 2',
category: 'legacy',
displayName: 'ArrowUp2'
});
export default ArrowUp2;
|
#!/bin/sh
list1="Proliferation_b1,Proliferation_b2"
#Please first cd to the parent folder
python3 Scripts/Simulations/MaBoSS_PROFILE_drugs.py BRAF_Model -sy Mac -p 2 "Tests/BRAF_Model_CL_n5000_t100.txt" -o $list1 -s "n5000_t50" -rb "Results/Profiles/BRAF_Model_Test.csv" -rf 100
#for i in {1..100}
#do
# python3 Scr... |
#!/bin/bash
sleep 60
(nohup java -Dhost.name=$HOSTNAME -Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.port=9002 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -classpath ./lib/*:./conf/ io.cantor.service.InitialService &) &&... |
#include <vector>
#include <string>
#include <memory> // *_ptr family
#include <memory.h> // memcpy
#include <iostream>
class ObjRaw { // simple rule-of-5 class using raw pointers
size_t bs; // buffer size
uint8_t* bp; // buffer pointer
public:
ObjRaw(int s) : bs(s), bp(new uint8_t(bs)... |
def find_four_letter_words(sentence):
words = sentence.split()
four_letter_words = []
for word in words:
if len(word) == 4:
four_letter_words.append(word)
return four_letter_words
four_letter_words = find_four_letter_words("The quick brown fox jumps over the lazy dog.")
print(four_l... |
public IEnumerable<SourceItem> CreateItemsFromRange(Source source, DateTime startDate, DateTime endDate, int minQuantity, int maxQuantity, DateTime creationDate, string creatorName, SourceGroupEnum groupEnum)
{
List<SourceItem> sourceItems = new List<SourceItem>();
// Generate source items within the date rang... |
<filename>fetch.py
from yipy.api import Yipy
from math import ceil
import json
def fetch_movies():
api = Yipy()
movie_list = api.list(limit=1)
genres = set()
page_count = ceil(movie_list["data"]["movie_count"]/50)
# page_count = 2
movies = []
for page in range(1, 1+page_count):
prin... |
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
int countOccurrences(int arr[], int size)
{
// Sort the array
sort(arr, arr+size);
// create an empty hash map
unordered_map<int, int> counts;
// Counting the occurrance of elements of the array
fo... |
import React from "react";
import { ScreenRecorder, IScreenRecorderOptions, safeCallback } from 'screen-recorder-base';
import bindkey from '@w-xuefeng/bindkey';
import Video from './Video';
export interface IScreenRecorderComponentProps {
shortKey?: string;
preview?: boolean;
videoOptions?: MediaTrackConstraint... |
#!/bin/bash
APP=gmall
# 如果是输入的日期按照取输入日期;如果没输入日期取当前时间的前一天
if [ -n "$2" ] ;then
do_date=$2
else
do_date=`date -d "-1 day" +%F`
fi
dws_visitor_action_daycount="insert overwrite table ${APP}.dws_visitor_action_daycount partition(dt='$do_date')
select
t1.mid_id,
t1.brand,
t1.model,
t1.is_new,
... |
package org.apache.commons.chain2.testutils;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.chain2.Catalog;
import org.apache.commons.chain2.Command;
import org.apache.commons.chain2.Context;
/**
* @version $Id$
*/
public class TestCatalog<K, V, C extends Conte... |
// j * j = i was pain
#include<bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define all(c) (c).begin(), (c).end()
#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", 1.0*clock()... |
<filename>src/configuration.ts<gh_stars>1-10
import { JsonRpc } from "eosjs";
import fetch from 'node-fetch'
/**
* A configuration entry for an InfraBlockchain network
*
* @example ```js
* {
* networkId: '01',
* registryContract: 'infradidregi',
* rpcEndpoint: 'http://localhost:8888'
* }
* ... |
package libs.trustconnector.scdp.smartcard.application.pboc;
import libs.trustconnector.scdp.smartcard.application.*;
import libs.trustconnector.scdp.smartcard.*;
import libs.trustconnector.scdp.smartcard.AID;
import libs.trustconnector.scdp.smartcard.SmartCardReader;
import libs.trustconnector.scdp.smartcard.applica... |
#!/bin/sh
python2 setup.py build
sudo python2 setup.py install |
#!/bin/bash
# ES1_URL="`cat ES_URL.prod.secret`"
# ES2_URL="`cat ES_URL.test.secret`"
# IDX1='bitergia-git_symphonyoss_200604_enriched_200930'
# IDX2='sds-cncf-k8s-git'
# KEY1=url_id
# KEY2=url_id
# ID1='finos/alloy/commit/f12d39aa02375258c444bd8815ba8bf621045615'
# ID2='kubernetes-csi/external-attacher/commit/28c78291... |
package io.cattle.platform.engine.model;
public interface Trigger {
String METADATA_SOURCE = "metadata";
void trigger(Long accountId, Long clusterId, Object resource, String source);
}
|
<gh_stars>10-100
const {
AoijsAPI,
DbdTsDb,
AoiMongoDb,
CustomDb,
Promisify,
} = require("../../../classes/Database.js");
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);
const [
variable,
order = "asc",
t... |
# CelebA images and attribute labels
# bash download_celeba.sh
URL=https://www.dropbox.com/s/d1kjpkqklf0uw77/celeba.zip?dl=0
ZIP_FILE=./data/celeba.zip
mkdir -p ./data/
wget -N $URL -O $ZIP_FILE
unzip $ZIP_FILE -d ./data/
rm $ZIP_FILE |
import React from 'react';
import Masonry from 'react-masonry-component';
import { Link } from 'react-router-dom';
const masonryOptions = {
transitionDuration: 0,
};
type ProjectsProps = {
images: IImage[];
};
export function Projects(props: ProjectsProps) {
const images = props.images.map((image, idx) => {
... |
export class Profile {
jti: string;
password: string;
} |
<gh_stars>0
#include <string.h>
#include <stdio.h>
#include <glib/gi18n.h>
#include <glib-object.h>
#include "pacat-control-object.h"
#include "pacat-control-stub.h"
/* Properties */
enum
{
PROP_0,
PROP_REC_ALLOWED
};
enum
{
SIGNAL_REC_ALLOWED_CHANGED,
LAST_SIGNAL
};
static guin... |
KSET_DEFAULT_KUBECONFIG=$HOME/.kube/config
KSET_KUBECONFIG_DIR="$HOME/.kube/configs/"
KSET_COMPLETION_TOOLS="kubectl oc velero tkn helm kn kustomize"
KSET_KUBECONFIG=${KSET_KUBECONFIG_DIR}/config.$$
kset_logout() {
rm -f "$KSET_KUBECONFIG"
}
trap kset_logout EXIT
kon() {
local _KUBECONFIG
if [ "$KUBECONFIG"... |
<reponame>aadorian/baseline
import { Commitment } from './commitment';
export class MerkleTreeNode implements Commitment {
readonly hash: string;
readonly leafIndex: number;
constructor(hash: string, leafIndex: number) {
this.hash = hash;
this.leafIndex = leafIndex;
}
location(): number {
retu... |
# makefile
tail +7 cv/cv-pandoc.md > cv/cv-body.md
pandoc -S cv/cv-body.md -o cv/cv-body.tex
perl -p -i -e "s/~/\\\ /g" cv/cv-body.tex
perl -p -i -e "s/M.Sc./M.Sc.\\\/g" cv/cv-body.tex
perl -p -i -e "s/B.Sc./B.Sc.\\\/g" cv/cv-body.tex
perl -p -i -e "s/itemsep1pt/itemsep3pt/g" cv/cv-body.tex
pdflatex -output-directory=... |
<reponame>Anth0nyWu/mmf<filename>mmf/datasets/builders/visual_genome/dataset.py
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import json
import torch
from mmf.common.sample import Sample, SampleList
from mmf.datasets.builders.vqa2 import VQA2Dataset
from mmf.datasets.databases.scene_graph_database im... |
#!/bin/bash -eE
set -o pipefail
[ "${DEBUG,,}" == "true" ] && set -x
my_file="$(readlink -e "$0")"
my_dir="$(dirname $my_file)"
source "$my_dir/definitions"
MAX_DURATION="259200"
LOCKED=$(nova list --tags-any "SLAVE=vexxhost" --status ACTIVE --field locked,name | grep 'True' | tr -d '|' | awk '{print $1}' || true)... |
#!/bin/bash -l
set -x
set -e
set -o
source /etc/profile.d/modules.sh
module load mpi
function mpirun() {
IFS=',' read -ra HOSTS <<< "$AZ_BATCH_HOST_LIST"
nodes=${#HOSTS[@]}
/usr/lib64/openmpi/bin/mpirun \
-np $nodes\
--allow-run-as-root \
--host $AZ_BATCH_HOST_LIST \
"$@"
}... |
import { BindGroupInfo, WGSL } from "./WGSL";
import { ShaderMacroCollection } from "../shader";
import {
WGSLBeginPositionVert,
WGSLBlendShapeInput,
WGSLBlendShapeVert,
WGSLCommon,
WGSLCommonVert,
WGSLPositionVert,
WGSLSkinningVert,
WGSLUVShare,
WGSLUVVert
} from "./functors";
import { WGSLEncoder } ... |
def create_linting_config(ctx, args):
# Construct the command for linting using the provided executable and source files
lint_command = "%s %s %s" % (
ctx.executable.linter.short_path,
args,
" ".join([src.short_path for src in ctx.files.srcs])
)
# Define the output of the lintin... |
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import styled from 'styled-components'
import merge from 'lodash.merge'
const Wrapper = styled.div`
align-items: center;
display: flex;
transform: translate3d(${p => p.translateOffset}px, 0, 0);
transition: transform ${p => p.transitio... |
# for bash-git-prompt integration, shows current bucket if you're in one
function prompt_callback {
if [ -x "$(which t)" -a -n "$T_BUCKET_ID" ] ; then
echo -n " bucket:$(t title "$T_BUCKET_ID")"
fi
}
|
<reponame>menghuanlunhui/springboot-master<filename>jframe-demos/base-test/src/main/java/com/jf/system/redisson/lock/DistributedLocker.java
package com.jf.system.redisson.lock;
import com.jf.exception.SysException;
/**
* Created with IntelliJ IDEA.
* Description:获取锁管理类
* User: admin
* Date: 2018-01-03
* Time: 09... |
package stats
import (
"fmt"
"net/http"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v14/internal/git/gittest"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper"
"gitlab.com/gitlab-org/gitaly/v14/internal/testhelper/testcfg"
)
func TestClone(t *tes... |
#!/usr/bin/env bash
# **install_pip.sh**
# install_pip.sh [--pip-version <version>] [--use-get-pip] [--force]
#
# Update pip and friends to a known common version
# Assumptions:
# - update pip to $INSTALL_PIP_VERSION
set -o errexit
set -o xtrace
# Keep track of the current directory
TOOLS_DIR=$(cd $(dirname "$0") ... |
package com.github.thinkerou.karate.grpc;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.MethodDescriptor.newBuilder;
import java.util.logging.Logger;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.pro... |
<gh_stars>0
package utils;
import javafx.application.Platform;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
public class SwapAnchorPaneForSelectedNode {
public synchronized static void swapToTopPane(AnchorPane topPane, AnchorPane bottomPane, ImageView image)
{
Platform.... |
/**
* @file libimobiledevice/restore.h
* @brief Initiate restore process or reboot device.
* @note This service is only available if the device is in restore mode.
* \internal
*
* Copyright (c) 2010 <NAME>. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under... |
<reponame>Exploder98/COMP.SE.200-2020-assignment<gh_stars>0
/**
* at-funktion yksikkötestit
*
* @group unit
*/
import at from "../../src/at.js";
describe("unit/at", () => {
it("Tyhjä objekti ja polku", () => {
expect(at({}, ""))
.toStrictEqual([undefined]);
});
it("Indeksointi obj... |
<filename>scan/detect_swaps.js<gh_stars>0
const asyncAuto = require('async/auto');
const {getJsonFromCache} = require('./../cache');
const {getTransaction} = require('./../blocks');
const {returnResult} = require('./../async-util');
const {setJsonInCache} = require('./../cache');
const swapsFromInputs = require('./swa... |
<reponame>abin1525/rose-edg<gh_stars>1-10
#ifndef FIXUP_CXX_TO_USE_ALIASING_SYMBOLS_H
#define FIXUP_CXX_TO_USE_ALIASING_SYMBOLS_H
// DQ (4/14/2010):
/*! \brief Fixup C++ symbol tables to use aliasing symbols for using declarations.
C++ using declarations and use directives shold have an effect on the
symbol t... |
<filename>hummer-core/src/main/java/com/hummer/core/base/HMPerformancePlugin.java
package com.hummer.core.base;
public interface HMPerformancePlugin {
/**
* 输出性能统计信息
*
* @param key 性能类型,TimeCostType.*
* @param value 性能值,单位ms
*/
void printPerformance(String key, int value);
}
|
<filename>iot-suite-server-ability/src/main/java/com/tuya/iot/suite/ability/asset/model/AssetAuthBatchToUser.java
package com.tuya.iot.suite.ability.asset.model;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.List;
/**
* @author mickey
* @date 2021... |
package cyclops.reactor.container.transformer.seq.convertable;
import cyclops.container.foldable.AbstractConvertableSequenceTest;
import cyclops.container.immutable.impl.ConvertableSequence;
import cyclops.monads.AnyMs;
import cyclops.monads.Witness;
import cyclops.reactive.ReactiveSeq;
public class StreamTSeqConver... |
public class Carousel
{
private int _NumberOfItems;
private int _CurrentPosition;
public Carousel(int numberOfItems)
{
_NumberOfItems = numberOfItems;
_CurrentPosition = 1; // Start at the first item
}
public void ScrollToNext()
{
if (_CurrentPosition <= _NumberOfIt... |
package net.toshirohex.lycurgus.interfaces;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;
public interface KingCotton {
TypedAc... |
<html>
<head>
<title>Book Search</title>
</head>
<body>
<h1>Book Search</h1>
<form action="/search" method="POST">
<input type="text" name="title" placeholder="Enter book title...">
<input type="submit" value="Search">
</form>
</body>
</html> |
# -*- coding: utf-8 -*-
# MIT license
#
# Copyright (C) 2016 by XESS Corp.
#
# 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... |
package io.opensphere.core.cache.accessor;
import io.opensphere.core.cache.matcher.IntervalPropertyMatcher;
/**
* An accessor for property values with lower and upper bounds.
*
* @param <S> The type of object that provides the property values.
* @param <T> The type of the property values.
*/
public int... |
<gh_stars>1-10
"use strict";
exports.__esModule = true;
var countSteps_1 = require("../math/countSteps");
var pad_1 = require("../number/pad");
var HOUR = 3600000;
var MINUTE = 60000;
var SECOND = 1000;
/**
* Format timestamp into a time string.
*/
function toTimeString(ms) {
var h = ms < HOUR ? 0 : countSteps_1[... |
<gh_stars>0
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
import static java.util.stream.Collectors.... |
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
php "$DIR/vendor/phpunit/phpunit/phpunit" -c "$DIR/tests" |
# 本地创建公私密钥
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
# 登录远程主机配置
# 修改sshd_config 配置文件
vi /etc/ssh/sshd_config
# 通过配置以下属性,允许SSH登录
# RSAAuthentication yes
# PubkeyAuthentication yes
# AuthorizedKeysFile .ssh/authorized_keys
# 把本地公钥追加到authorized_keys中
vi ~/.ssh/authorized_keys
# 重启SSH服务
systemctl restart sshd
# SSH 登录远程主机
... |
#!/bin/bash
printf "SERV CPI on Compliance Tests\n\n" | tee ../serv-cpi.txt
echo " Opcode Avg. Min Max" | tee -a ../serv-cpi.txt
single_ops="AUIPC LUI
ADD ADDI SUB AND ANDI OR ORI XOR XORI
ECALL
SLT SLTI SLTU SLTIU
SLL SLLI SRA SRAI SRL SRLI"
for op in $single_ops; do
wawk inst.wawk trace... |
CREATE TABLE [auth].[ApiClientRoles]
(
[Id] INT NOT NULL identity(100000, 1),
[ApiClientId] int not null,
[RoleId] int not null,
[CreatedByUserId] int null,
[CreatedByClientId] int null,
[CreatedDate] as getdate(),
[UpdatedByUserId] int null,
[UpdatedByClientId] int null,
[UpdatedDate] datetime null,
constra... |
#!/bin/bash
PROGNAME=$(basename "$0")
UPLOAD_DIR="$(pwd)/uploads"
# Create unique temp dir
UUID=$(uuidgen)
TEMP_DIR="$UPLOAD_DIR/tmp/$UUID"
# DATA_LOADER="$HOME/github/pathomics_featuredb/src/build/install/featuredb-loader/bin/featuredb-loader"
# TODO: data loader is now a docker container.
# DATA_LOADER="quip-loader"... |
package com.example.wolweather;
/**
* Created by Administrator on 2017/7/16.
*/
public class Basic {
}
|
# @param string $file
#
function do_hook_file() {
local file=$1
if [[ ${file##*.} == 'php' ]]; then
cmd="$docs_php"
elif [[ ${file##*.} == 'sh' ]]; then
cmd=$docs_bash
fi
echo $cmd # or execute the command using $cmd
} |
<gh_stars>0
package cn.stylefeng.roses.kernel.auth.api.loginuser.pojo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 获取登录用户信息的请求
*
* @author fengshuonan
* @date 2021/9/29 11:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginUserRequest {
/**
... |
package com.example.androidpractice;
import android.app.Application;
import android.content.Context;
import android.util.Log;
/**
* androidPractice 的 Application 入口。
* Created by yntense on 21/6/10.
*/
public class CPApplication extends Application {
private static final String TAG = "CPApplication";
priv... |
#!/bin/bash
# Copyright 2020 Langston Howley
# 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 applic... |
# Create the project structure
mkdir app
cd app
mkdir static templates
# Install all the dependencies
pip install flask
pip install flask-sqlalchemy
# Create the application
touch app.py
# Create the base template
touch templates/base.html
# Create the model
touch models.py
# Create the view
touch views.py
# Crea... |
<gh_stars>1-10
import React from 'react';
import PropsType from 'prop-types';
import { logout } from 'containers/App/actions';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { makeSelectCurrentUser } from 'containers/App/selectors';
function Settings({ onLogout }) {
... |
<gh_stars>0
//
// author: Kang
// date: 2017-05-27
package qrcode
//(JIS 8-bit character set (Latin and Kana) in accordance with JIS X 0201
//var characters string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:"
//8位字节数据编码器
type EightBitByteEncoder struct {
}
//编码
func (encoder EightBitByteEncoder) Encode(content... |
"""ServiceNow dispatcher
envars:
- config
- SA_SN_API_HOST
- SA_SN_API_ENDPOINT
- SA_SN_FIELD_PREFIX
- auth1
- SA_SN_API_USER
- SA_SN_API_PASS
- auth2
- SA_SN_OAUTH_CLIENT_ID
- SA_SN_OAUTH_CLIENT_SECRET
- SA_SN_OAUTH_REFRESH_TOKEN
"""
from os import environ as env
import requests
from runners.hel... |
# Libraries
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn import datasets, svm, metrics
# Load the data
digits = datasets.load_digits()
# Training set
X_train = digits.data[0:1200]
y_train = digits.target[0:1200]
# Test set
X_test = digits.data[1200:1797]
y_test = digits.target[... |
<reponame>vagechirkov/mne-python
from itertools import product
import os
import os.path as op
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose, assert_array_equal
from mne.channels import make_standard_montage
from mne.datasets import testing
from mne.io import read_raw_fif, re... |
mylist = [1, 2, 3, 2, 5, 8, 8]
newList = []
for i in mylist:
if i not in newList:
newList.append(i)
print(newList) |
<filename>jgrapht-master/jgrapht-io/src/test/java/org/jgrapht/io/DOTImporter1Test.java
/*
* (C) Copyright 2015-2017, 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 Gen... |
<reponame>Daniel-Liu-c0deb0t/UMICollapse
package umicollapse.util;
import java.util.Arrays;
import htsjdk.samtools.fastq.FastqRecord;
import static umicollapse.util.Utils.toBitSet;
import static umicollapse.util.Utils.toPhred33ByteArray;
import static umicollapse.util.Utils.toPhred33String;
public class FASTQRead e... |
<reponame>python-programmer/web_frameworks_benchmark<gh_stars>1-10
from django.contrib import admin
from .models import Order, OrderItem
admin.site.register(OrderItem)
admin.site.register(Order)
|
require 'rails_helper'
RSpec.describe 'Events Management' do
describe 'add a new event' do
it 'creates a new user and generates a new event' do
visit('/')
click_link('Sign up')
expect(current_path).to have_content('/users/new')
fill_in('user[name]', with: 'user1004')
click_button(... |
DATA_DIR=./finetune_data/NTG_processed_en
USER_DIR=./prophetnet
ARCH=ngram_transformer_prophet_large
CRITERION=ngram_language_loss
SAVE_DIR=./models/xprophetnet_ntg_en
TENSORBOARD_LOGDIR=./models/logs_xprophetnet_ntg_en
PRETRAINED_MODEL=./prophetnet_multi.pt
fairseq-train \
--user-dir $USER_DIR --task translation_pro... |
#!/bin/bash
eng="xkb:us::eng"
yue="rime"
case "$1" in
"print")
ibus engine | sed 's/.*eng.*/英文/;s/rime/廣東話/;'
;;
*)
case "$(ibus engine)" in
"$eng")
ibus engine $yue
;;
"$yue")
ibus engine $eng
;;
... |
#!/bin/bash
# <bitbar.title>Kubernetes</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Peter Golm</bitbar.author>
# <bitbar.author.github>pgolm</bitbar.author.github>
# <bitbar.desc>Nagios info</bitbar.desc>
# <bitbar.dependencies>bash</bitbar.dependencies>
if [[ "$1" = "copy" ]]; then
echo ... |
from skimage import io, transform, color
from os import remove
class GAN:
def apply(self, image):
# Apply GAN processing to the image
return image # Placeholder for GAN processing
def safe_remove(models, file_name):
if file_name in models:
models.remove(file_name)
def rgb2yuv(image):... |
<gh_stars>10-100
const body = document.body;
const onOff = document.querySelector("#isDark")
const Darkbtn = document.querySelector("#DarkBtn")
if (load("dark") == "On") Darkbtn.checked = true
else Darkbtn.checked = false
onOff.innerText = load("dark")
Darkbtn.addEventListener("click", changeDark)
function changeDar... |
# Run an instance of a web service.
#
# Run in folder with Dockerfile.
#
# Command line options:
# $1: port number for container (default: 8090)
# $2: name for container (default: spase-website)
#
port=${1:-8090}
name=${2:-spase-validate}
# Set SUDO appropriate for OS
SUDO=""
case "$OSTYPE" in
solaris*) SUDO="sudo"... |
<reponame>jiangshaofen/spring-boot-example
package com.example.starter;
//几个和Starter相关的注解
//@ConditionalOnClass,当classpath下发现该类的情况下进行自动配置。
//@ConditionalOnMissingBean,当Spring Context中不存在该Bean时。
//@ConditionalOnProperty(prefix = "example.service",value = "enabled",havingValue = "true"),当配置文件中example.service.enabled=tru... |
package io.opensphere.tracktool.model.persist.v1;
import java.awt.Color;
import java.awt.Font;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
... |
import React from 'react'
import { compose, withHandlers } from 'recompose'
import { MentionsInput, Mention } from '../../../src'
import { provideExampleValue } from './higher-order'
import defaultStyle from './defaultStyle'
import defaultMentionStyle from './defaultMentionStyle'
import { merge } from '../../../src... |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Order extends Model {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'orders';
/**
* Calculate the total price of the order.
*
* @return float
*/
public function calculateTotalPrice()
{... |
// Copyright 2018, RadiantBlue Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law ... |
for (int i = 1; i <= 50; i++) {
System.out.println(i);
} |
/*
* 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 ... |
<reponame>LukasVolgger/delivery-service<gh_stars>0
function generateLanguageAndCountrySectionHTML() {
return `
<div class="pop-up-container-language-country hide-mobile" onclick="closePopUp()">
<div id="language-country-container" class="language-country-container" onclick="event.stopPropagation()">
... |
#!/bin/bash
CONFIGURATION=$1
if [ -z $CONFIGURATION ]; then
CONFIGURATION=Debug
fi
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
SRCDIR=$SCRIPTDIR/../..
ROOTDIR=$SRCDIR/..
PUBLISHDIR=$ROOTDIR/Publish
sudo mkdir /GVFS.FT
sudo chown $USER /GVFS.FT
$SRCDIR/ProjFS.Mac/Scripts/LoadPrjFSKext.sh
$PUBLISHDIR/GVFS.FunctionalTes... |
#!/bin/bash
# composer install -o --working-dir="$WORKDIR"/application
php-fpm
|
<reponame>artprojectteam/lsc
/**
* YAMLで作ったStylusの定義データをJSONに変換する
*/
import config from 'config'
import { relativePath } from '../modules/getPath'
import MultipleYamlBuild from '../modules/MultipleYamlBuild'
const stylusDir = [config.get('input.root'), config.get('input.files.stylus'), '_assets']
const outputPath = ... |
<gh_stars>0
export default function recreateSheet(context: Excel.RequestContext, name: string) {
const book = context.workbook;
const sheets = book.worksheets;
const sheet = sheets.getItemOrNullObject(name);
sheet.delete();
return sheets.add(name);
}
|
import random
def get_user_choice():
while True:
user_choice = input("Enter your choice (rock, paper, or scissors): ").lower()
if user_choice in ['rock', 'paper', 'scissors']:
return user_choice
else:
print("Invalid choice. Please enter rock, paper, or scissors.")
d... |
<gh_stars>1-10
import functools
import socket
def read_socket_bytes(s):
try:
for b in iter(functools.partial(s.read, 1), b""):
yield ord(b)
except socket.timeout:
pass
|
<gh_stars>1-10
/**
* Copyright 2014 isandlaTech
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... |
package commands
import (
"context"
"errors"
"github.com/urfave/cli/v2"
"golang.org/x/xerrors"
cmd "github.com/aquasecurity/trivy/pkg/commands/artifact"
"github.com/aquasecurity/trivy/pkg/k8s/report"
"github.com/aquasecurity/trivy/pkg/k8s/scanner"
"github.com/aquasecurity/trivy/pkg/log"
"github.com/aquasec... |
<reponame>belugafm/beluga-v3-api-server<filename>src/infrastructure/prisma/repository/query/LoginCredential.ts
import { LoginCredential, PrismaClient } from "@prisma/client"
import {
RepositoryError,
UnknownRepositoryError,
} from "../../../../domain/repository/RepositoryError"
import { ILoginCredentialQueryRe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.