text stringlengths 1 1.05M |
|---|
<reponame>blaiszik/globus_ko
var request = require('supertest');
var app = require('../app.js');
// describe('GET /', function() {
// it('should return 200 OK', function(done) {
// request(app)
// .get('/')
// .expect(200, done);
// });
// });
// describe('GET /signin', function() {
// it('shoul... |
import { Page, ElementHandle, Browser, Viewport, launch } from 'puppeteer';
import { TaskEither, tryCatch } from 'fp-ts/lib/TaskEither';
import { ArticleContent, TagName } from './types';
import { articleContentHandler } from './browser';
export const _launchBrowser = async (...params: Parameters<typeof launch>): Pro... |
<!DOCTYPE html>
<html>
<head>
<title>3D Data Visualization</title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r108/three.min.js"></script>
<script>
let scene, camera, renderer;
// Set the scene size.
const WIDTH = 400;
const HEIGHT = 300;
// Set some camera attributes
const VIEW_ANGL... |
# bash
# THIS SCRIPT IS USED FOR NETLIST MANIPULATION
#
# 20210826
#
# SUBSTITUTE KEYWORD
# 将RR变为XRR,CC变为XCC,$[rnpoly]、$[hrpolyu]、$[rppolyu]去掉$[],$W/、$L去掉$
# 电阻值、电容值为无
# sed -i -e 's/替换内容' 文件名
#
sed -i -e 's/\RR/XRR/g ; s/\CC/XCC/g ; s/\$\[rnpoly\]/rnpoly/g ; s/\$\[hrpolyu\]/hrpolyu/g ; s/\$\[rppolyu\]/rppolyu/g ; ... |
#!/bin/bash
# Cloud SDK and App Engine
curl https://sdk.cloud.google.com | bash
gcloud components install app-engine-python
# Node.js
sudo port install nodejs
# Gulp.js
npm install -g gulp
# Python related
curl https://bootstrap.pypa.io/get-pip.py | python
pip install virtualenv
# Git
sudo port install git-core
|
package org.firstinspires.ftc.teamcode.terminators;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import org.firstinspires.ftc.teamcode.hardware.Robot;
/**
* Used to tell if an OpMode is still running and acts as a terminator to stop all threads
* Easier than sending around {@link com.qualcomm.robot... |
from stream_manager import StreamManagerClient
from stream_manager import StreamManagerException
from stream_manager import MessageStreamDefinition
from stream_manager import StrategyOnFull
from stream_manager import Persistence
from stream_manager import ExportDefinition
from stream_manager import S3ExportTaskExecutor... |
Pod::Spec.new do |s|
s.name = "ReactiveCocoa"
s.version = "2.5.2"
s.summary = "Streams of values over time"
s.description = <<-DESC
ReactiveCocoa (RAC) is an Objective-C framework inspired by Functional Reactive Programming. It provides APIs for composing and transforming streams of values.... |
package com.telenav.osv.recorder;
/**
* The class define a custom {@link Throwable} containing all the messages of the errors.
* Created by cameliao on 1/31/18.
*/
public class Errors extends Throwable {
public static final String ERROR_OBD_ALREADY_CONNECTED = "OBD already connected.";
public static fina... |
#!/bin/bash
source ../scripts/init.sh -DBACKEND=mix -DSHOW_SUMMARY=on -DSHOW_SCHEDULE=on -DMICRO_BENCH=on -DUSE_DOUBLE=on -DDISABLE_ASSERT=off -DENABLE_OVERLAP=on -DMEASURE_STAGE=off -DEVALUATOR_PREPROCESS=on -DUSE_MPI=on -DMAT=7
`which mpirun` -host nico3:2 -x GPUPerRank=2 ../scripts/env.sh ../scripts/gpu-bind.sh ./ma... |
<filename>src/main/java/com/alipay/api/response/AntMerchantExpandIndirectActivityQueryResponse.java
package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.ActivityMerchantOrder;
i... |
<filename>src/main/java/de/unistuttgart/ims/coref/annotator/tools/Options.java
package de.unistuttgart.ims.coref.annotator.tools;
import java.io.File;
import com.lexicalscope.jewel.cli.Option;
public interface Options {
@Option
File getInput();
@Option
File getOutput();
@Option
Fixer.Fix getFix();
@Option(... |
#!/bin/bash
function ts {
echo [`date '+%b %d %X'`]
}
echo "$(ts) Starting the server in 5 seconds..."
/root/bin/Xeoma/xeoma -- -service -log -startdelay 5
|
#!/usr/bin/env bash
# Copyright 2019 Jetstack Ltd.
#
# 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... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for USN-2805-1
#
# Security announcement date: 2015-11-09 00:00:00 UTC
# Script generation date: 2017-01-01 21:04:54 UTC
#
# Operating System: Ubuntu 14.04 LTS
# Architecture: x86_64
#
# Vulnerable packages fix on version:
# - linux-image-3.16.0-53-powerpc64-emb:... |
import {Container} from '@material-ui/core';
import CssBaseline from '@material-ui/core/CssBaseline';
import React, {useCallback, useEffect, useState, ReactElement} from 'react';
import AlreadyCompletedDialog from './components/AlreadyCompletedDialog';
import GridQuestionnaire from './components/GridQuestionnaire';
im... |
/***** BEGIN LICENSE BLOCK *****
* Version: EPL 1.0/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Eclipse Public
* License Version 1.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.eclipse.org/legal/epl-... |
<filename>app/controllers/application_controller.rb<gh_stars>1-10
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :set_go
def set_go
if params[:go] and Util.valid_path?(params[:go]) then
@go = params[:go]
end
end
def authorize
... |
#!/bin/bash
# TMP
if [ -d '/tmpfs' ]; then TMP='/tmpfs'; else TMP='/tmp'; fi
if [ -z "${HAL_PERIOD:-}" ]; then HAL_PERIOD=300; fi
CONFIG='{"date":'$(date +%s)',"log_level":"'${LOG_LEVEL}'","debug":'${DEBUG}',"period":'${HAL_PERIOD}'}'
echo "${CONFIG}" > ${TMP}/${SERVICE_LABEL}.json
while true; do
DATE=$(date +%s)
... |
<gh_stars>1-10
import { registerTheme } from '../../theme';
import { DEFAULT_COLUMN_THEME } from '../column/theme';
registerTheme('stackedColumn', DEFAULT_COLUMN_THEME);
//# sourceMappingURL=theme.js.map |
<reponame>jimtje/cloudworker-proxy
/**
* This is the entry point for running the proxy locally using the node-cloudworker lib.
*/
// eslint-disable-next-line
require('dotenv').config();
// eslint-disable-next-line
const ncw = require('node-cloudworker');
ncw.applyShims();
const handler = require('./handler');
ncw.... |
/* © 2017 NauStud.io
* @author Eric
*/
export const slugify = st => {
let str = st.toLowerCase();
// Chuyển hết sang chữ thường
str = str.replace(/(à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ)/g, 'a');
str = str.replace(/(è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ)/g, 'e');
str = str.replace(/(ì|í|ị|ỉ|ĩ)/g, 'i');
str = str.replace(/(ò|ó|ọ|ỏ... |
git clone --depth=1 https://gitlab.com/kaitaiStructCompile.py/kaitaiStructCompile.py.git
export KSCP=./kaitaiStructCompile.py
git clone --depth=1 https://gitlab.com/kaitaiStructCompile.py/kaitaiStructCompile.tests.ksys $KSCP/tests/ksys
pip install --upgrade $KSCP
|
<reponame>TheButlah/Battlecode-2018<filename>src/main/java/com/lodborg/cache/LRUCache.java
/*
MIT License
Copyright (c) 2016 lodborg
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 Sof... |
<filename>src/translations/pt_PT.js
'use strict';
module.exports = {
"payingWith" : "Pagamento com {{paymentSource}}",
"chooseAnotherWayToPay" : "Escolher outra forma de pagamento",
"chooseAWayToPay" : "Escolher forma de pagamento",
"otherWaysToPay" : "Outras formas de pagamento",
"edit" : "Editar",
"doneE... |
<reponame>wiqun/route<filename>internal/crdt/crdtstate_test.go
package crdt
import (
"github.com/stretchr/testify/assert"
"testing"
"time"
)
func TestCrdtState_BatchAdd(t *testing.T) {
peer1 := uint64(1)
peer2 := uint64(2)
topicList := []string{"topic1", "topic2"}
s := NewCrdtState()
r1 := s.BatchAdd(peer1, t... |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.fhwa.c2cri.ntcip2306v109.status;
/**
* The Interface NTCIP2306Status specifies the various error types reported by NTCIP 2306.
*
* @author TransCore ITS, LLC
* Last Updated: 1/8/2014
*/
public interfa... |
package main.unused.fieldStaticAndOverridesStatic;
public class FieldStaticAndOverridesStaticMulti extends FieldStaticAndOverridesStaticMultiS {
}
|
<filename>app/controllers/artists_controller.rb
class ArtistsController < ApiController
# GET /artists
def index
artists = Artist.all
render json: @artists
end
# GET /artists/1
def show
artist = Artist.find(params[:id])
render json: artist
end
end
|
'use strict';
/**
* Module for displaying patient events in time line form.
*/
angular.module('chronos.timeline', [
'chronos.services',
'users.commons.filters',
'ui.notifications',
'ui.generic',
'infinite-scroll'
]);
|
import React, { Component } from 'react';
import { Provider, connect } from 'react-redux';
import ReactGA from 'react-ga';
import './App.css';
import Header from './Components/Header';
import Footer from './Components/Footer';
import About from './Components/About';
import Resume from './Components/Resume';
import Con... |
<gh_stars>1-10
#!/usr/bin/env node
import * as program from 'commander';
const packageConfig = require('../../package.json');
program
.allowUnknownOption(false)
.version(packageConfig.version)
.description(packageConfig.description)
.command('init', 'initialize a lamington project')
.command('build [contract_pat... |
from dialogflow_v2.SessionClient import SessionClient
from dialogflow_v2.Objects import QueryInput, TextInput
session_client = SessionClient.SessionClient() #create a session
def get_response(query):
inputs = QueryInput(text=TextInput(text=query, language_code='en-US'))
query_result = session_client.detect_intent(s... |
#!/bin/bash
# LinuxGSM fix_terraria.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Resolves an issue with Terraria.
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export TERM=xterm
|
#!/bin/bash
arp > arp.out
arp -v > arp-v.out
arp -a > arp-a.out
df > df.out
df -h > df-h.out
dig www.google.com AAAA > dig-aaaa.out
dig www.cnn.com www.google.com > dig.out
dig -x 1.1.1.1 > dig-x.out
env > env.out
free > free.out
free -h > free-h.out
history > histor... |
import { mapGetters } from 'vuex';
export default {
name: 'badge',
computed: {
...mapGetters({
badge: 'badgeNumber'
}),
badgeNumber() {
return this.badge > 99 ? '99+' : this.badge;
}
}
}
|
import cv2
import os
import sys
import dsl
import time
import logging
# Plugin Name and Plugin Category
def createPluginMetaData(plugin):
pmd = dsl.PluginMetaData("doPythonWork", "Basic")
pmd.setAuthor("<NAME>")
pmd.setDescription("Create a Python Work.")
pmd.setCopyright("Allen Institute for Brain Sci... |
from sympy import symbols, diag
def calculate_line_element(metric):
t, x, y, z = symbols('t x y z')
dt, dx, dy, dz = symbols('dt dx dy dz')
g_tt, g_xx, g_yy, g_zz = metric
line_element = f"{g_tt}*dt**2 + {g_xx}*dx**2 + {g_yy}*dy**2 + {g_zz}*dz**2"
return line_element |
<reponame>StellarCrow/wfh-client<gh_stars>0
import {TestBed} from '@angular/core/testing';
import {HideContentService} from './hide-content.service';
describe('HideContentService', () => {
let service: HideContentService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(Hid... |
#ifndef IO_HPP
#define IO_HPP
#pragma once
#include <fstream>
#include <string>
#include <fmt/ostream.h>
#include "util.hpp"
struct Dataset {
unsigned int cardinality; // k
unsigned int universe;
unsigned long totalElements;
unsigned int* sizes;
unsigned int* elements;
unsigned int* offsets;
... |
<filename>extension/popup.js
window.addEventListener('DOMContentLoaded', () => {
// ...query for the active tab...
chrome.tabs.query({
active: true,
currentWindow: true
}, tabs => {
// ...and send a request for the DOM info...
chrome.tabs.sendMessage(
tabs[0].id,
{from: 'popup', s... |
func maxSubarraySum(_ nums: [Int]) -> Int {
var maxSum = nums[0]
var currentSum = nums[0]
for i in 1..<nums.count {
currentSum = max(nums[i], currentSum + nums[i])
maxSum = max(maxSum, currentSum)
}
return maxSum
} |
#!/bin/bash
cat << PREAMBLE
/*
* RELIC is an Efficient LIbrary for Cryptography
* Copyright (C) 2007-2017 RELIC Authors
*
* This file is part of RELIC. RELIC is legal property of its developers,
* whose names are not listed here. Please refer to the COPYRIGHT file
* for contact information.
*
* RELIC is free s... |
<reponame>comptech-soft/CRV<filename>resources/js/Views/Sistem/Colors/columns.js<gh_stars>0
const Columns = require('./../../../Columns/Columns')
module.exports = {
reccount: Columns.RecCount(10),
color: ComptechApp.CreateColumn('color', {
width: 80,
caption: 'Denumire',
orderby: ['c... |
package com.ramusthastudio.mygcmnetworkmanager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private Button fStartB... |
<reponame>johanneswolfgruber/Learn-To-Listen<filename>app/src/main/java/com/johanneswolfgruber/learntolisten/MainMenuActivity.java
package com.johanneswolfgruber.learntolisten;
import android.app.DialogFragment;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
//... |
<filename>sqlalchemy_jsonapi/unittests/test_serializer_post_collection.py
"""Test for serializer's post_collection."""
from sqlalchemy_jsonapi import errors
from sqlalchemy_jsonapi.unittests.utils import testcases
from sqlalchemy_jsonapi.unittests import models
from sqlalchemy_jsonapi import __version__
class PostC... |
package org.paasta.container.platform.broker.serviceInstance;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.paasta.container.platform.common.api.common.Constants;
import org.springframework.test.context.TestProperty... |
import numpy as np
import scipy.misc
import skimage.measure
def count_objects(image):
# Use skimage.measure.label to label distinct objects in the image
labeled_image, num_objects = skimage.measure.label(image, return_num=True)
return num_objects
# Load the grayscale image using scipy.misc.face()
face = s... |
<reponame>rishabhbatra10/india
""" This enables access to indian towns in respective cities """
# @coding: utf-8
# @author: <NAME>
# @email: <EMAIL>
# Write class Town and creating a Town object for every town in database
# python imports
# module imports
from . import cities
TOWNS = []
class Town:
"""
Def... |
#ifndef INCLUDED_MAP_EDITOR_MODE_CHANGED_EVENT_H
#define INCLUDED_MAP_EDITOR_MODE_CHANGED_EVENT_H
#include "platform/event.h"
namespace map {
struct EditorModeChangedEvent : public platform::Event
{
std::string mMode;
std::string mPrevMode;
EditorModeChangedEvent(std::string mode, std::string prevMode )
... |
. ./install-all.sh
npm run flow && npm run eslint && npm run test |
<reponame>chrisprice/honesty-store-1
import apifetch from './apirequest';
import history from '../history';
export const UPDATE_STOCK_COUNT_REQUEST = 'UPDATE_STOCK_COUNT_REQUEST';
export const UPDATE_STOCK_COUNT_SUCCESS = 'UPDATE_STOCK_COUNT_SUCCESS';
export const UPDATE_STOCK_COUNT_FAILURE = 'UPDATE_STOCK_COUNT_FAILU... |
#!/bin/bash
set -ev
IN_DOT=$1
OUT_DOT=$2
TEMP=${OUT_DOT}__temp
mkdir -p $TEMP
python3 src/batchtree_layout/dot2mtx.py $IN_DOT $TEMP/network
libs/BatchTree/bin/BatchTree -input $TEMP/network.mtx -label $TEMP/network.labels -output $TEMP/ -algo 2
python3 src/batchtree_layout/add_pos_to_dot.py $IN_DOT $TEMP/network.mt... |
export interface Map<T> {
[s: string]: T;
}
export function equal(x: any[] | number | string | boolean | null, y: any[] | number | string | boolean | null): boolean {
if (x === y) return true;
else if (x == null || y == null) return false;
else if (Array.isArray(x) && Array.isArray(y)) {
if (x.l... |
<filename>src/parsers/gltf2/Pose.ts
class PoseJoint{
//#region MAIN
index : number;
rot ?: number[];
pos ?: number[];
scl ?: number[];
constructor( idx:number, rot ?: number[], pos ?: number[], scl ?: number[] ){
this.index = idx;
this.rot = rot;
this.... |
package com.nextbreakpoint;
import java.io.IOException;
import java.util.function.Function;
public class TryMain {
public static void main(String[] args) {
Try.of(() -> doSomething()).map(x -> x.toLowerCase()).ifPresent(System.out::println);
Try.of(() -> doSomething()).filter(v -> "X".equals(v)).ifPresent(Syste... |
def all_subsets(s):
subsets = []
for i in range(2**len(s)):
bitmask = bin(i)[2:]
subset = []
for j in range(len(s)):
if bitmask[j] == "1":
subset.append(s[j])
subsets.append(subset)
return subsets |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : 91yxq_manage
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2017-12-29 10:28:55
*/
... |
<reponame>seawindnick/javaFamily
package com.java.study.algorithm.zuo.dadvanced.advanced_class_03;
/**
* 波那契系列问题的递归和动态规划
* 【题目】
* 给定整数N,返回斐波那契数列的第N项。
* 【补充题目1】
* 给定整数N,代表台阶数,一次可以跨2个或者1个台阶,返回有多少种走法。
* 【举例】
* N=3,可以三次都跨1个台阶;也
* 可以先跨2个台阶,再跨1个台阶;
* 还可以先跨1个台阶,再跨2个台阶。所以有 三种走法,返回3。
* 【补充题目2】
* 假设农场中成熟的母牛每年只会生1头小母牛... |
#!/bin/bash
# Enable serial console
sudo sed -i 's/^GRUB_CMDLINE_LINUX=.*$/GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 console=tty1"/g' /etc/default/grub
sudo grep -q 'GRUB_SERIAL_COMMAND' /etc/default/grub && sudo sed -i 's/^GRUB_SERIAL_COMMAND=.*$/GRUB_SERIAL_COMMAND="serial --unit=0 --speed=115200 --word=8 --parity=... |
<gh_stars>1-10
import { Post } from './Post';
import { Comment } from './Comment';
import sequelize from './sequelize';
Post.hasMany(Comment);
Comment.belongsTo(Post);
export {
Post,
Comment,
sequelize,
} |
import React, { useState } from 'react';
const App = () => {
const [word, setWord] = useState('');
const options = ['apple', 'banana', 'mango', 'orange'];
const handleChange = (e) => {
const value = e.target.value;
setWord(value);
}
const filteredOptions = options.filter(option => option.includes(w... |
const router = require("express").Router()
const adminController = require("../../controllers/pageController")
// 📄 "/api/page" +
router.route("/:sol/:page")
.get(adminController.findAll)
module.exports = router
|
#!/bin/bash
# This needs to work for vagrant, Travis builds, and Docker builds.
# in a python virtualenv. in the virtual machine provisioning,
# we're passing the directory this should be run from. in travis-ci,
# its run from the root of the repository.
if [ "$#" -eq 1 ]; then
cd $1
fi
# Install the requiremen... |
import { InputField } from '@segment/actions-core'
/**
* The common fields defined by Amplitude's events api
* @see {@link https://developers.amplitude.com/docs/http-api-v2#keys-for-the-event-argument}
*/
export const eventSchema: Record<string, InputField> = {
user_id: {
label: 'User ID',
type: 'string',... |
#!/bin/bash
curl --data "sub_id=$1" https://www.sinya.com.tw/diy/show_option/ |& sed 's/<i>/###/g'|grep -o 'title=[^#]*###'|sed 's/<[^>]*>/ /g;s/^[^>]*>//;s/###//;s/[ ]\+/ /g;s/^ //'|wc -l|sed "s/^/$1 -> /"
#curl -vs https://www.sinya.com.tw/diy/|& sed '/OPTION/!d;s/[^>]*>//;/OPTION value/d;/OPTGROUP/d;'
|
<reponame>nanagirl0720/pinggu_yj<gh_stars>1-10
package com.ruoyi.project.system.spdeptXm.controller;
import java.io.InputStream;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Auto... |
import os
import imp
import traceback
import re
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
STACKS_DIR = os.path.join(SCRIPT_DIR, '../../../stacks/')
PARENT_FILE = os.path.abspath(os.path.join(STACKS_DIR, 'service_advisor.py'))
try:
with open(PARENT_FILE, 'rb') as fp:
service_advisor = imp.loa... |
<filename>test/data/app/view/details/Details.js
/*globals Ext:false*/
Ext.define('MyApp.view.details.Details', {
extend: 'Ext.window.Window'
});
|
class Customer:
def __init__(self, name, phone, address):
self.name = name
self.phone = phone
self.address = address
class CustomerRecord:
def __init__(self):
self.records = []
def add_record(self, customer):
self.records.append(customer)
def get_record(self, i... |
<reponame>S96EA/spring-boot-demo
package com.xkcoding.dubbo.provider.info.service;
import com.alibaba.dubbo.config.annotation.Service;
import com.xkcoding.dubbo.common.service.InfoService;
import org.springframework.stereotype.Component;
@Component
@Service
public class InfoServiceImpl implements InfoService {
@... |
// Load modules
const express = require('express');
const router = express.Router();
const database = require('../database');
// Get list of items
router.get('/items', (req, res) => {
const sql = 'SELECT * FROM items';
database.query(sql, (err, results) => {
if (err) throw err;
res.json(results);
});
});
// Get ... |
echo "= Init create data"
echo "= Clear all data"
curl -XDELETE -u use:pass http://localhost:11222/rest/v2/caches/users
curl -XDELETE -u use:pass http://localhost:11222/rest/v2/caches/people
curl -XDELETE -u use:pass http://localhost:11222/rest/v2/caches/example
curl -XDELETE -u use:pass http://localhost:11222/rest... |
class ConnectFourAgent:
def __init__(self):
self.action_space = None
self.board_state = None
def create_action_space(self, board_state):
action_space = set()
for col_index in range(7):
# check if the column hasn't filled up yet
if board_state[5][col_ind... |
package com.packtpub.yummy.users.config;
import com.packtpub.yummy.users.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.A... |
const utilMixin = {
computed: {
showLoader: {
get () {
return this.$store.state.showLoader
},
set (value) { }
},
showNotification: {
get () {
return this.$store.state.showNotification
},
set (value) { }
},
showPlayer: {
get () {
ret... |
def is_prime(num):
# Return True if given number is prime; false otherwise
for i in range(2, num):
if num % i == 0:
return False
return True
def generate_prime_numbers(n):
prime_list = []
number = 2
while len(prime_list) < n:
if is_prime(number):
prime_l... |
package org.prebid.server.privacy.gdpr.vendorlist.proto;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
public enum Purpose {
ONE(1),
TWO(2),
THREE(3),
FOUR(4),
FIVE(5),
SIX(6),
SEVEN(7),
EIGHT(8),
... |
#include "shift.h"
void shift_sll8(char *line, int size)
{
if (!line)
return;
if (size > 8)
{
for (int i = size - 9; i >= 0; --i)
{
line[i + 8] = line[i];
line[i] = 0;
}
}
else
{
for (int i = 0; i < size; ++i)
{
... |
#!/bin/bash
function disable {
mv $1 $1.back
ln -s /bin/true $1
}
function enable {
if [ -L $1 ]
then
mv $1.back $1
else
# No longer a symbolic link, must have been overwritten
rm -f $1.back
fi
}
function run_in_chroot {
local chroot=$1
local script=$2
# Disable daemon startup
disabl... |
public static int maxAdjacentProduct(int[] array){
int max_prod = 0;
for (int i = 0; i < array.length-1; i++){
int prod = array[i] * array[i+1];
max_prod = Math.max(max_prod, prod);
}
return max_prod;
} |
import { ExtensionPriority } from '@remirror/core-constants';
import { isNumber, isString, uniqueArray, uniqueId } from '@remirror/core-helpers';
import type {
AcceptUndefined,
CommandFunction,
CommandFunctionProps,
EditorState,
EditorView,
FromToProps,
Handler,
MakeRequired,
Static,
Transaction,
} ... |
<filename>src/components/Providers/TimeFrameSelectRow/index.js<gh_stars>10-100
export { default } from "./TimeFrameSelectRow";
|
package main
import (
"fmt"
"log"
"strconv"
"strings"
"github.com/dmies/adventOfGo/filehandler"
)
// BagAndCount is a struct that wraps a bag color and the number of bags of this kind, that can be contained within an other bag
type BagAndCount struct {
bag string
count int
}
// ParseAll parses the given ru... |
package com.algaworks.pedidovenda.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table... |
#include "lpcsnoop/snoop.hpp"
#include <sdbusplus/bus.hpp>
#include <sdbusplus/test/sdbus_mock.hpp>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
using ::testing::_;
using ::testing::IsNull;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::StrEq;
namespace
{
// Fixture for testing class Pos... |
<reponame>xiaonanln/python-usaco
"""
ID: isaiahl1
LANG: PYTHON2
TASK: milk
"""
TASK = 'milk'
import operator
def readints(fin):
return tuple(int(x) for x in fin.readline().split())
def main(fin, fout):
N, M = map(int, fin.readline().strip().split())
print N, M
farmers = []
for i in xrange(M):
farmers.append( ... |
<!DOCTYPE html>
<html>
<head>
<title>Text Preview</title>
<style>
body {
font-family: Arial;
font-size: 11pt;
}
#input {
margin: 10px;
padding: 10px;
width: 50%;
height: 300px;
border: 1px solid #ccc;
font-family: Arial;
... |
/*
* Copyright (c) 2016 QLogic Corporation.
* All rights reserved.
* www.qlogic.com
*
* See LICENSE.qede_pmd for copyright and licensing details.
*/
#ifndef __ECORE_HSI_INIT_TOOL__
#define __ECORE_HSI_INIT_TOOL__
/**************************************/
/* Init Tool HSI constants and macros */
/*****************... |
#!/bin/bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
INSTALLED="$(command -v nvm)"
if [ "$INSTALLED" != "nvm" ]; then
export NVM_DIR="$HOME/.nvm" && (
git clone https://github.com/nvm-sh/nvm.git "$NVM_DIR"
cd "$NVM_DIR"
git checkout `git describe --abbrev=0 --tags --... |
import random
def generate_password(length, characters):
password = ''
for i in range(length):
password += random.choice(characters)
return password
print(generate_password(10, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')) |
NAME=msm0213
END1=64
ante-MMPBSA.py -p ../${NAME}_buffer.prmtop -c complex.prmtop -r receptor.prmtop -l ligand.prmtop -s :WAT,K+,K,Na+,NA,CL,Cl- -m :1-${END1} --radii mbondi2
|
#!/bin/bash
REPORT_PATH=$1
if [[ "$REPORT_PATH" == "" ]]; then
exit 1
fi
[[ -f "$REPORT_PATH/index.html" ]] && rm "$REPORT_PATH/index.html"
cat /opt/report/header.html | tee -a "$REPORT_PATH/index.html"
for SUITE_FILE in $(find "$REPORT_PATH" -maxdepth 1 -iname *.html -type f | xargs -r -l basename); do
if [[ ... |
<filename>Exp5_4prgs/src/exp5_4prgs/Prg3exp5.java
/*
* 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 exp5_4prgs;
import java.util.Scanner;
/**
*
* @author prakash
*/
public ... |
#!/bin/bash
# Log
log() {
CYAN='\033[0;36m'
NONE='\033[0m'
echo "${CYAN}$1${NONE}"
}
# Check out specific version
log "Checking out specific version..."
git -c advice.detachedHead=false checkout $1
# Update colonyNetwork dependencies
log "Updating colonyNetwork dependencies..."
yarn
|
MININIX_PKG_HOMEPAGE=https://www.gnupg.org/related_software/npth/
MININIX_PKG_DESCRIPTION="New GNU Portable Threads Library"
MININIX_PKG_VERSION=1.6
MININIX_PKG_SHA256=1393abd9adcf0762d34798dc34fdcf4d0d22a8410721e76f1e3afcd1daa4e2d1
MININIX_PKG_SRCURL=https://www.gnupg.org/ftp/gcrypt/npth/npth-${MININIX_PKG_VERSION}.ta... |
#!/bin/sh
echo 'create ./data directory'
mkdir data || true
chmod 777 data
mkdir -p .env
echo 'generating .env/mysql-root.env'
MYSQLROOT=`< /dev/urandom LC_CTYPE=C tr -dc '_\*^A-Z-a-z-0-9' | head -c${1:-32};`
echo 'MYSQL_ROOT_PASSWORD='$MYSQLROOT > .env/mysql-root.env
echo 'generating .env/mysql.env'
MYSQLUSER=`< /d... |
const orderDetectionPlugin = (prop, changeWhenMatches) => {
return {
postcssPlugin: 'order-detection',
Declaration(decl) {
if (changeWhenMatches(decl)) {
decl.prop = prop;
decl.value = 'changed-this-declaration';
}
},
}
}
orderDetectionPlugin.postcss = true
module.exports = {
'basic': {
messa... |
/**
* Simple server to serve builds
*/
const express = require("express"),
path = require("path"),
webpack = require("webpack"),
app = express(),
assert = require("assert");
require('dotenv').config();
assert(process.env.PORT, "Specify a PORT in a .env");
app.use(express.static(path.join(__dirname... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.