text stringlengths 1 1.05M |
|---|
#!/usr/bin/env bash
################################################################################
################################################################################
########### Super-Linter (Lint all the code) @admiralawkbar ####################
########################################################... |
package cbedoy.cblibrary.widgets;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
/**
* Created by <NAME> on 28/12/2014.
*
* Mobile App Developer
* CBLibrary
*
* E-mail: <EMAIL>
* Facebook: htt... |
require 'update_in_batches'
class BackfillLibraryTimestamps < ActiveRecord::Migration
using UpdateInBatches
self.disable_ddl_transaction!
def change
LibraryEntry.where("progress > 0").update_in_batches(<<-SQL)
progressed_at = updated_at,
finished_at = CASE WHEN status = #{LibraryEntry.statuses[:... |
<filename>config.js
if (process.env.NODE_ENV !== 'production') {
require('dotenv').load();
}
var config = {
pb: {
app_id: process.env.PB_APP_ID,
user_key: process.env.PB_USER_KEY,
botname: process.env.PB_BOTNAME,
url: process.env.PB_URL
},
telegram: {
token: process.env.TELEGRAM_TOKEN
},
... |
import smbus
import paho.mqtt.publish as publish
def read_light(mode, sensor_address, bus, broker, port, topic):
# Set the measurement mode
if mode == CONTINUOUS_HIGH_RES_MODE_1 or mode == CONTINUOUS_HIGH_RES_MODE_2 or mode == ONE_TIME_HIGH_RES_MODE_1 or mode == ONE_TIME_HIGH_RES_MODE_2 or mode == ONE_TIME_LOW... |
import React, { useEffect, useState } from 'react';
import Layout from "../components/layout";
import CopperImageSection from "../components/CopperImageSection";
import FillerImageSection from "../components/FillerImageSection";
import ProductCards from "../components/ProductCards";
import HomeSlider from "../component... |
#!/bin/sh
# Copyright (c) 2014-2015 The Pocketcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C
if [ -z "$OSSLSIGNCODE" ]; then
OSSLSIGNCODE=osslsigncode
fi
if [ ! -n "$1" ]; then
echo "usag... |
#!/bin/bash
ze_dir=`readlink -f $(dirname $0)`
source $TRUST_MEDCOUPLING_ROOT/env.sh
export PYTHONPATH=$ze_dir/install/lib:$PYTHONPATH
cd build/test
echo "Testing ICoCo (version 2) ..."
python test_trusticoco.py 1>test_trusticoco.log 2>&1
if ! [ $? -eq 0 ]; then
echo Failed!
exit 255
fi
echo All OK.
|
#ifndef NETCOWORKER_H
#define NETCOWORKER_H
#include "message.h"
#include <QObject>
#include <QDataStream>
class NetCoworkFactory;
class NetCoworker : public QObject
{
Q_OBJECT
public:
explicit NetCoworker(const NetCoworkFactory* _factory, uint32_t object_id = UINT32_MAX);
virtual void handle_call(M... |
import { v4 } from 'uuid';
import Painter from './Painter';
class Store {
constructor() {
this.messages = {};
}
addMessage(message, time) {
const id = v4();
const messageObj = {
id,
message,
time: Number(time),
};
this.messages[id] = messageObj;
const targetIndex = th... |
import type { IncomingMessage, ServerResponse } from 'node:http';
import { RequestCapability, RequestContext, RequestHandler } from '../core';
import type { HttpMeans } from './http.means';
/**
* HTTP middleware signature.
*
* This is a [Connect]-style middleware.
*
* [Connect]: https://github.com/senchalabs/conn... |
package com.renrenbit.rrwallet.utils;
import android.text.TextUtils;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
* Created by jackQ on 2018/6/12.
*/
public class Md5 {
public static String md5(String str) {
if (TextUtils.isEmpty(str)) {
return "";... |
# GENERATED - DO NOT EDIT
source matchers/toMatch.sh
@spec.toMatch.wrong_number_of_arguments() {
refute run [[ expect "Hello" toMatch ]]
assert [ -z "$STDOUT" ]
assert [ "$STDERR" = "toMatch expects at least 1 argument (BASH regex patterns), received 0 []" ]
}
@spec.toMatch() {
assert run [[ expect "Hello the... |
#!/bin/bash
if [ $# -gt 1 ] && [ x$2 = xcanonical ]; then
new_host_name=$(sed -n -e "s/$1[ ]*name *= *\(.*\)/\1/p" /tmp/nslookup.$$)
else
new_host_name=$1
fi
rm /tmp/nslookup.$$
if [ x$new_host_name != x ]; then
hostname $new_host_name
fi |
package io.core9.rules;
public class Client {
private String ip;
private Modifier modifier;
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Modifier getModifier() {
return modifier;
}
public void setModifier(Modifier modifier) {
this.modifier = modifie... |
#include "databasefixture.h"
#include "infotestdata.h"
/////////////////////////////
using namespace std;
using namespace info;
//////////////////////////////
DatabaseFixture::DatabaseFixture() :m_nbcols(0), m_nbrows(0) {
string filename;
InfoTestData::get_database_filename(filename);
assert(!filename.empty());
thi... |
<filename>src/main/java/fr/clementgre/pdf4teachers/panel/sidebar/grades/export/GradeExportRenderer.java
package fr.clementgre.pdf4teachers.panel.sidebar.grades.export;
import fr.clementgre.pdf4teachers.document.editions.elements.GradeElement;
import fr.clementgre.pdf4teachers.document.editions.elements.TextElement;
im... |
<reponame>jsonbruce/MTSAnomalyDetection
#!/usr/bin/env python
# coding=utf-8
# Created by max on 17-10-31
"""
Anomaly Detection (ad) Using hp filter and mad test
"""
import sys
import numpy as np
import pandas as pd
from scipy import sparse, stats
import matplotlib.pyplot as plt
# Hodrick Prescott filter
def hp_fi... |
import spacy
# Load the spacy model
nlp = spacy.load("en_core_web_sm")
# Create a spacy document
text = "Today, Apple released the new iPhone 12"
doc = nlp(text)
# Extract and print named entities to the console
for ent in doc.ents:
print(f'{ent.text}: {ent.label_}')
# Output:
# Apple: ORG
# iPhone 12: PRODUCT |
<reponame>AndrewFedoseev/java_pft
package stqa.pft.soap;
import net.webservicex.GeoIP;
import net.webservicex.GeoIPService;
import org.testng.Assert;
import org.testng.annotations.Test;
/**
* Created by Andrii.Fiedosieiev on 7/19/2017.
*/
public class GeoIpServiceTests {
@Test
public void testMyIp(){
... |
mkdir results
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..
cmake --build . --config Release
cd ..
./build/Release/GammaCorrect.exe |
#!/bin/bash
# Easy & Dumb header check for CI jobs, currently checks ".go" files only.
#
# This will be called by the CI system (with no args) to perform checking and
# fail the job if headers are not correctly set. It can also be called with the
# 'fix' argument to automatically add headers to the missing files.
#
# C... |
<reponame>rjacobs91/baker
package com.ing.baker.playground
import cats.implicits._
import com.ing.baker.playground.AppUtils._
import com.ing.baker.playground.Command.RunCommand
import com.ing.baker.playground.commands.Docker
object PlaygroundApp {
def loop: App[Unit] =
for {
_ <- print("playground> ")
... |
<filename>src/greedy/Boj15975.java
package greedy;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
/**
*
* @author minchoba
* 백준 15975번: 화살표 그리기
*
* @see https://www.acmicpc.net/problem/15975/
*
*/
public class Boj15975 {
public static... |
<reponame>bensonnalle/incisive-3.0<gh_stars>0
import React, { Component } from 'react';
import Link from 'gatsby-link';
import Markdown from 'react-markdown';
import Helmet from 'react-helmet';
import { Grid, Typography, Paper, List, ListItem, ListItemText, ListSubheader, Divider, Card, CardContent } from 'material-ui'... |
define([
"dojo/on","dojo/dom"
,"dojox/mobile/TransitionEvent"
,"dojox/mobile/View","dojox/mobile/GridLayout","dojox/mobile/Pane"
],
function(on,dom,TransitionEvent){
//无法用on??
return {
init:function(){
this.addEventListener();
},
addEventListener:function(){
on(dom.byId("TGPrd"),"click"... |
def remove_vowels(input_str):
vowels = ['a', 'e', 'i', 'o', 'u']
output_str = ""
for char in input_str:
if char not in vowels:
output_str += char
return output_str
input_str = 'Hello World!'
output_str = remove_vowels(input_str)
print(output_str) # Output: Hll Wrld! |
#!/bin/bash --login
# Cf. http://stackoverflow.com/questions/33041109
#
# Xcode 7 (incl. 7.0.1) seems to have a dependency on the system ruby.
# xcodebuild is screwed up by using rvm to map to another non-system
# ruby†. This script is a fix that allows you call xcodebuild in a
# "safe" rvm environment, but will not (... |
/* cc54 fullAdder https://repl.it/student/submissions/1721915
Construct a four bit full adder.
You must use the provided NAND function to create any other logic gates
you require to make a 4 bit full adder.
x and y will come in array format where [true, true, true, true] === 1111 === 15.
The expected return is an array... |
#!/bin/bash
IMAGE_NAME=metro/orderservice
if mvn clean package; then
printf "\nMaven build successful. Building docker image %s...\n\n" $IMAGE_NAME
docker build . -t="$IMAGE_NAME"
else
printf "\nMaven build not successful. Aborting.\n\n"
fi
|
# uniq_command_4.sh
uniq -u |
<filename>client/src/main/java/de/hswhameln/typetogether/client/gui/MainWindow.java
package de.hswhameln.typetogether.client.gui;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.*;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import... |
<reponame>magicoflolis/Userscript-Plus<gh_stars>10-100
/******/ (() => { // webpackBootstrap
var __webpack_exports__ = {};
/*!********************!*\
!*** ./options.js ***!
\********************/
const brws = typeof browser === "undefined" ? chrome : browser;
brws.storage.local.get(storedConfig => {
$form = docum... |
<filename>02_structural_patterns/07_bridge/mailman_test.go
package bridge
import "testing"
func TestSendMessage(t *testing.T) {
cases := []struct {
name string
mail Mail
mailman Mailman
want string
}{
{
name: "common_mailman_dog",
mail: Mail{
from: "Tom",
to: "Jerry",
co... |
<reponame>mehh/devin-chase-cnoa
import React from "react"
import { Container, Row, Col } from "reactstrap"
import { Link } from "gatsby"
import "../nav/nav.scss"
import logo from "../../images/logo.png"
const Nav = () => {
return (
<nav>
<Container>
<Row>
<Col xs="2" md="6">
... |
<reponame>awslabs/clencli<gh_stars>10-100
/*
Copyright © 2020 Amazon.com, Inc. or its affiliates. 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/licen... |
import {MigrationInterface, QueryRunner} from "typeorm";
export class changeImageTypeAtUser1644679098215 implements MigrationInterface {
name = 'changeImageTypeAtUser1644679098215'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "image... |
#include <chrono>
#include <stdio.h>
#include <CL/sycl.hpp>
// reference
// https://stackoverflow.com/questions/59879285/whats-the-alternative-for-match-any-sync-on-compute-capability-6
#define warpSize 32
inline int ffs(int x) {
return (x == 0) ? 0 : sycl::ext::intel::ctz(x) + 1;
}
// increment the value at ptr ... |
<filename>relay_in.py
# pylint: disable=import-error,invalid-name,bare-except,unused-argument,no-self-use
""" Python ZNC module for passing mosquitto mq messages to ZNC """
import re
import multiprocessing
import znc
import paho.mqtt.client as mqtt
def _contains_required_args(args, required_args):
""" Validates... |
def compare_strings(string1, string2):
if string1 == string2:
return "Strings are equal"
else:
return "Strings are not equal" |
import { computed, observable } from "mobx";
import { FormDesignerModel } from "../../designer";
import {
FieldModel,
FormComponent,
FormComponentConstructor,
IFieldModelOptions,
ISectionModelOptions,
RepeatableSubFormFieldModel,
SectionModel,
SubFormFieldModel,
TypedValue,
ValidationErrorModel,
I... |
<filename>24.HMM/24.2.Segmentation.py
# !/usr/bin/python
# -*- coding:utf-8 -*-
import math
import matplotlib.pyplot as plt
import numpy as np
import codecs
import random
infinite = -(2 ** 31)
def log_normalize(a):
s = 0
for x in a:
s += x
s = math.log(s)
for i in range(len(a)):
if a... |
<reponame>Qolzam/telar-core-ext-js<filename>__tests__/endpoint-routing-application-builder-extensions.test.ts<gh_stars>1-10
import { IServiceCollection } from '@telar/core/IServiceCollection';
import { IApplicationBuilder } from '@telar/core/IApplicationBuilder';
import { IConfiguration } from '@telar/core/IConfigurati... |
var bun = require('bun');
var tstream = require('tstream');
var delimiter_frame = require('./lib/delimiter-frame');
var json_stream = {
Parse: tstream(function(chunk, encoding, callback){
try {
var data = JSON.parse(chunk.toString());
this.push(data);
} catch(err) {
this.emit('warn', err,... |
import React from 'react'
import PropTypes from 'prop-types'
function Error (props) {
const { message } = props
return (
<div className="col-12 heading justify-content-center loading">
<br />
<br />
<br />
<br />
<h3 align="center" className="text-danger">
{`Oops! ${messag... |
famsa -gt import ${guide_tree} ${seqs} \
${id}.prog.${align_method}.with.${tree_method}.tree.aln
|
export default {
skip: true,
data: {
visible: true
},
html: 'before\n<p>Widget</p><!--#if visible-->\nafter',
test ( assert, component, target ) {
component.set({ visible: false });
assert.equal( target.innerHTML, 'before\n<!--#if visible-->\nafter' );
component.set({ visible: true });
assert.equal( targ... |
################
# User setup
################
# Create new user with sudo privileges
sudo adduser --disabled-password --gecos "" $NONROOT_USERNAME
sudo usermod -aG sudo $NONROOT_USERNAME
echo "$NONROOT_USERNAME:$NONROOT_PASSWORD" | sudo chpasswd
# Set zsh as default shell
sudo chsh -s `which zsh` $NONROOT_USERNAME
... |
#ifndef _MATH_H
#define _MATH_H
class Math {
public:
static float fastInverseSquareRoot(float x) {
float halfx = 0.5f * x;
float y = x;
long i = *(long*)&y;
i = 0x5f3759df - (i>>1);
y = *(float*)&i;
y = y * (1.5f - (halfx * y * y));
return y;
}
static float mapfloat(float x, float in_min, f... |
#!/bin/bash
##
## Copyright (c) 2014-2017 Leidos.
##
## License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
##
##
## Developed under contract #FA8750-14-C-0241
##
# Iterate all corpus projects; read/parse files from each project
AVEIFS=$IFS
IFS=$(echo -en "\n\b")
count=1
fcount=0
path="/data/corp... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+0+512-SWS/13-model --tokenizer_name model-configs/1024-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+0+512-SWS/13-512+0+512-old-first-256 --do_eval --per_device_... |
# This is a toolkit file to be sourced whenever bash is used for scripting
# It includes tools, like env vars, looger and trap functions
# This file is based on a deep revision of a template by BASH3 Boilerplate v2.3.0
# http://bash3boilerplate.sh/#authors
# Exit on error inside any functions or subshells.
# don't us... |
#!/bin/bash
set -ex
command -v ci
command -v clean_up_reusable_docker
command -v ensure_head
command -v print_env
command -v push_image_to_ecr
command -v push_image_to_docker_hub
command -v pull_image_from_ecr
command -v push_lambda
command -v wfi
docker-compose version
docker --version
python3 --version
aws --versi... |
//
// HNSubmission.h
// newsyc
//
// Created by <NAME> on 3/30/11.
// Copyright 2011 Xuzz Productions, LLC. All rights reserved.
//
#import "HNKit.h"
#import "HNAPISubmission.h"
#define kHNSubmissionSuccessNotification @"kHNSubmissionSuccessNotification"
#define kHNSubmissionFailureNotification @"kHNSubmissionFai... |
<reponame>Team-Orochimaru/finacial-planner
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'
import {logout} from '../store'
import Home from './home'
import 'materialize-css/dist/css/materialize.min.css'
import M from 'ma... |
use std::fs;
use std::path::Path;
pub fn select_files(directory_path: &str, extension: &str) -> Result<Vec<String>, String> {
let dir = Path::new(directory_path);
if !dir.is_dir() {
return Err("Invalid directory path".to_string());
}
let files = match fs::read_dir(dir) {
Ok(files) => f... |
<!DOCTYPE html>
<html>
<head>
<title>Table</title>
<style type="text/css">
table, th, td {
border: 1px solid black;
}
td {
background-color: green;
}
td:nth-child(2) {
background-color: yellow;
}
td:nth-child(3) {
background-color: blue;
}
td:nth-child(4) ... |
/** @module fs/all */
export * from "./ls.js"
export * from "./path.js"
export { default as ResourceExplorer } from "./ResourceExplorer.js"
export { default as ResourceManager } from "./ResourceManager.js"
|
import { get } from "needle";
import { config } from "../config";
import { isJSONString } from "../helpers";
import { sendToQueue } from "./mq";
const { streamURL, bearerToken } = config;
export const streamConnect = (retryAttempt: number) => {
const stream = get(streamURL, {
headers: {
"User-Agent": "par... |
<gh_stars>1-10
var __extends = this.__extends || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
var textBase = require("ui/text-base");
var editableTextBase = require("ui/editable-tex... |
import React, {Component} from 'react'
class Search extends Component {
constructor(props){
super(props);
this.state = {
text:''
}
}
handleClick(ev){
let text = ev.target.value;
this.setState({"text":text});
this.props.handleChange(text);
}
co... |
#! /bin/sh
SRCDIR=`dirname "$0"`
. "$SRCDIR/testutils.sh"
verbose_run $VALGRIND "$DTC" -o/dev/null "$@"
ret="$?"
if [ "$ret" -gt 127 ]; then
FAIL "dtc killed by signal (ret=$ret)"
elif [ "$ret" != "1" ]; then
FAIL "dtc returned incorrect status $ret instead of 1"
fi
PASS
|
<gh_stars>0
import React, {Component, useState} from 'react';
import {
Text,
View,
StyleSheet,
Picker,
Image,
Platform,
TouchableOpacity,
FlatList,
Alert,
} from 'react-native';
import * as Resources from '../../config/resource';
import moment from 'moment';
export default function DetailTask({route,... |
import React from 'react'
import { avatar, flexRow } from './User.module.css'
export default function User({ user: { name, picture } }) {
return (
<div className={flexRow}>
<img
className={avatar}
src={picture.large}
alt={`Foto de ${name.first}`}
... |
import {ClassNames} from '@emotion/core';
import assign from 'lodash/assign';
import flatten from 'lodash/flatten';
import isEqual from 'lodash/isEqual';
import memoize from 'lodash/memoize';
import omit from 'lodash/omit';
import PropTypes from 'prop-types';
import React from 'react';
import {NEGATION_OPERATOR, SEARC... |
#!/bin/bash
#
# Install Pre-requisites for DBS script
#
# Author: Mrigesh Priyadarshi
ruby_apps="ruby-cheerio rest-client terminal-notifier colorize"
epel_repo="http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm"
install_brew()
{
if [[ ! -f $(which brew) ]]; then
/usr/bin/ruby -e "$(curl ... |
import assert from "assert";
import { LockAndCache } from "../lib";
import { serializeKey } from "../lib/serialization";
describe("cache", () => {
const cache = new LockAndCache();
let executionCount = 0;
async function double(a: number) {
executionCount++;
return a * 2;
}
beforeEach(() => {
e... |
import requests
from bs4 import BeautifulSoup
r = requests.get("https://example.com")
soup = BeautifulSoup(r.text, "html.parser")
links = []
for link in soup.find_all('a'):
href = link.get('href')
links.append(href)
print(links) |
#!/bin/sh
set -e
UNSIGNED=$1
SIGNATURE=$2
ARCH=x86_64
ROOTDIR=dist
BUNDLE=${ROOTDIR}/AeriumX-Qt.app
TEMPDIR=signed.temp
OUTDIR=signed-app
if [ -z "$UNSIGNED" ]; then
echo "usage: $0 <unsigned app> <signature>"
exit 1
fi
if [ -z "$SIGNATURE" ]; then
echo "usage: $0 <unsigned app> <signature>"
exit 1
fi
rm -r... |
xoV#!/bin/bash
#Create Shadowsocks
clear
echo -e ""
echo -e "==================="
echo -e "| SHADOWSOCKS |"
echo -e "-------------------"
echo -e ""
echo -e "List :"
echo -e ""
echo -e "[1] Addss"
echo -e "[2] Cekss"
echo -e "[3] Delss"
echo -e "[4] Renewss"
echo -e "[5] Xp-ss"
echo -e ""
read -p "Mana yang ingin a... |
#!/usr/bin/env bash
# Grab QR codes from webcam
# Grab and save the path to this script
# http://stackoverflow.com/a/246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
SOURCE="$(readlink "$SOURCE")"
[[ ... |
<filename>templates/project/content/common/models/privilege.js
'use strict';
module.exports = (sequelize, DataTypes) => {
const Privilege = sequelize.define('Privilege', {
name: DataTypes.STRING,
description: DataTypes.STRING
});
Privilege.associate = models => {
models.Privilege.belongsToMany(mode... |
<gh_stars>1-10
// Simple Password Reset
// Please PLEASE PLEASE DO NOT USE THIS! This is incredibly stupid and dangerous!
// Generate a new password reset token using the user's email address - then generate a random token connected to the email address
// Then, send a password reset link to the user using
// The passw... |
<reponame>BorisNikulin/CS-113-Homework
package edu.miracosta.cs113.dataStructures;
import java.util.Collection;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.stream.Collectors;
public class ListStack<E> implements Iterable<E>
{
// TODO make a double ended singly linked list an... |
#!/usr/bin/env bash
# Change this line to return 1 even on success if you want to leave
# the output files around for inspection
KEEP_LOG_ON_SUCCESS=0
WRITE_GOLD=0
RANGE=`seq 1 200`
if [ -n "$HAVE_MYSQL" ]; then
ods_setup_conf conf.xml conf-mysql.xml
fi &&
ods_reset_env -i &&
rm -rf base && mkdir base &&
ods_start... |
package jenkins.plugins.logstash.persistence;
import static net.sf.json.test.JSONAssert.assertEquals;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import net.sf.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import org.jun... |
#!/usr/bin/env bash
# Downloads and unpacks Abitti (www.abitti.fi) disk images.
#
# This script is public domain.
#
# This script is not supported by Matriculation Examination Board of
# Finland. The download URLs may change without any notice. For
# supported tools see www.abitti.fi.
IMAGEPATH=~/abitti_images
if [ ... |
package chylex.hee.mechanics.compendium.content;
import gnu.trove.map.hash.TIntObjectHashMap;
import java.util.Set;
import java.util.stream.Collectors;
import chylex.hee.gui.GuiEnderCompendium;
import chylex.hee.mechanics.compendium.content.fragments.KnowledgeFragmentType;
import cpw.mods.fml.relauncher.Side;
import cp... |
# loading the data
from keras.datasets import mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# normalizing the data
X_train = X_train.reshape(60000, 784) / 255
X_test = X_test.reshape(10000, 784) / 255
# one-hot encode target column
from keras.utils import to_categorical
y_train = to_categorical(y_tr... |
#include <iostream>
#include <list>
#include <cstdlib>
#include <string>
void tokenizer(const std::string& line, char delimiter, std::list<const char*>& tokens) {
std::string token;
std::istringstream tokenStream(line);
while (std::getline(tokenStream, token, delimiter)) {
tokens.push_back(token.c_... |
#!/bin/bash
if [ -z $1 ]; then
sudo docker run -itd --rm -v /mnt/slab/squid/log/:/var/log/squid/ squid
else
sudo docker run -itd --rm --name $1 -v /mnt/slab/squid/log/:/var/log/squid/ squid
fi
|
<filename>lib/geometry/edge.rb
require_relative 'point'
module Geometry
=begin rdoc
An edge. It's a line segment between 2 points. Generally part of a {Polygon}.
== Usage
edge = Geometry::Edge.new([1,1], [2,2])
edge = Geometry::Edge([1,1], [2,2])
=end
class Edge
attr_reader :first, :last
# Constr... |
class ServerChan {
private static SCKEY: string
/**
* 初始化
*
* @author CaoMeiYouRen
* @date 2019-08-24
* @export
* @param {string} SCKEY https://sc.ftqq.com 发的sckey,此处配置后为全局配置
*/
static init(SCKEY: string) {
this.SCKEY = SCKEY
}
/**
* Sends a notifica... |
#!/bin/bash
npx ts-node \
contract-deployer.ts \
--cosmos-node="http://localhost:26657" \
--eth-node="http://localhost:8545" \
--eth-privkey="0xb1bab011e03a9862664706fc3bbaa1b16651528e5f0e7fbfcbfdd8be302a13e7" \
--contract=Gravity.json \
--test-mode=true |
#ifndef INCLUDED_CORE_AUTO_ID_H
#define INCLUDED_CORE_AUTO_ID_H
#include <string>
#include "rstdint.h"
namespace platform {
class AutoId
{
public:
AutoId( std::string const& Name );
int32_t GetId()const;
~AutoId();
operator int32_t()const;
protected:
const int32_t mId;
};
} // namespace platform... |
/*
* CPAchecker is a tool for configurable software verification.
* This file is part of CPAchecker.
*
* Copyright (C) 2007-2018 <NAME>
* 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 ... |
<filename>database/auth/auth-router.js
const bcryptjs = require("bcryptjs");
const router = require("express").Router();
const jwt = require("jsonwebtoken");
const secrets = require('../config/secrets');
const authenticate = require('../middleware/restricted');
const Users = require("../users/users-model.js");
functi... |
package cli
import (
"testing"
"time"
)
func TestProcessBar(t *testing.T) {
var bar Bar
bar.NewOption(0, 100)
for i := 0; i <= 100; i++ {
time.Sleep(100 * time.Millisecond)
bar.Play(int64(i))
}
bar.Finish()
}
|
<reponame>JenKinY/MallVipManage
package com.yingnuo.web.servlet.admin.handle;
import com.google.gson.Gson;
import com.sun.org.apache.xpath.internal.operations.Or;
import com.yingnuo.domain.Admin;
import com.yingnuo.domain.Order;
import com.yingnuo.service.AdminService;
import com.yingnuo.service.OrderService;
import ... |
#!/bin/sh
#cabal clean && cabal configure --enable-tests --enable-library-coverage --enable-library-profiling --enable-executable-profiling && cabal build && cabal test && cabal haddock
cabal clean && cabal configure --enable-tests && cabal build && cabal test && cabal haddock
|
from typing import List, Tuple
def get_combos() -> List[Tuple[int, int]]:
result = []
for i in range(-1, 2):
for j in range(-1, 2):
if i != 0 or j != 0: # Exclude the center element
result.append((i, j))
return result |
#!/bin/bash
check_android_home() {
if [ "$#" -lt 1 ]; then
if [ -z "${ANDROID_HOME}" ]; then
echo "Please either set ANDROID_HOME environment variable, or pass ANDROID_HOME directory as a parameter"
exit 1
else
ANDROID_HOME="${ANDROID_HOME}"
fi
else
ANDROID_HOME=$1
fi
echo "AN... |
def compute_GCD(a, b):
while b > 0:
temp = b
b = a % b
a = temp
return a |
#! /bin/bash
# Builds a toolchain and qemu-system for testing and debugging WebKit.
#
# Usage:
# build.sh [ --? | -h | --help ]
# [ -a | --arch "..." ]
# [ -j ] Number of cores to use during build (default: $(nproc))
# [ -k ]
# [ --br2 "...... |
package com.twitter.finatra.http.tests.integration.tweetexample.main.services
import com.twitter.concurrent.AsyncStream
import com.twitter.concurrent.AsyncStream.fromOption
import com.twitter.finatra.http.tests.integration.tweetexample.main.domain.Tweet
import com.twitter.util.Future
class MyTweetsRepository extends ... |
#!/bin/bash
dieharder -d 12 -g 45 -S 2720877956
|
#!/usr/bin/env node
'use strict'
exports.run = run
const fs = require('fs')
const path = require('path')
const minimist = require('minimist')
const pkg = require('../package.json')
const npmls2dg = require('../npmls2dg')
const Logger = require('./logger').getLogger()
// run from the cli
function run () {
const... |
import React, { useRef, useState, useEffect } from 'react';
import { Link, RouteComponentProps } from 'react-router-dom';
import { motion } from 'framer-motion';
import { useTracking } from 'react-tracking';
import Observer from '@researchgate/react-intersection-observer';
import SearchBar from '../../components/search... |
package database
import (
"time"
"github.com/backpulse/core/models"
"gopkg.in/mgo.v2/bson"
)
// AddVideo : add video to db
func AddVideo(video models.Video) error {
video.UpdatedAt = time.Now()
video.CreatedAt = time.Now()
err := DB.C(videosCollection).Insert(video)
return err
}
// GetVideo : Return specific... |
#!/bin/sh
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y xboxdrv
sudo apt-get install -y kodi
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.