text stringlengths 1 1.05M |
|---|
/*! \file CLUtils.hpp
* \brief Declarations of objects,
* functions and classes for the CLUtils library.
* \details CLUtils offers utilities that help
setup and manage an OpenCL environment.
* \author <NAME>
* \version 0.2.2
* \date 2014-2015
* \copyright The MIT License (MIT)
* \p... |
function calculateArea(width, height) {
return width * height;
} |
"""
Zaimplementuj sortowanie babelkowe.
"""
# Zlozonosc czasowa O(n^2)
def sortuj_v1(tablica):
n = len(tablica)
for i in range(n - 1):
for j in range(n - i - 1):
if tablica[j] > tablica[j + 1]:
tablica[j], tablica[j + 1] = tablica[j + 1], tablica[j]
# Testy Poprawnosci
d... |
#!/usr/bin/env bash
# This function checks whether we have a given program on the system.
_have()
{
# Completions for system administrator commands are installed as well in
# case completion is attempted via `sudo command ...'.
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &> /dev/null
}
_have cerberus &&
_ce... |
#!/bin/bash
r=`basename $0`
if [ $r == 'weeklyreminders.sh' ];
then
t=14;
w=Weekly;
elif [ $r == 'dailyreminders.sh' ];
then
t=3;
w=Daily;
else
t=5
w=Test;
fi
cd .rem
for d in * ;
do
if [ "$( ls -A $d/$w 2>/dev/null )" ];
then
echo "Sending a $w reminder to $d"
ft=/tmp/$d-t-$$.txt
f=/tmp/$d-$$.txt
e... |
# bash completion for salticid
_salticid_complete() {
local cur goals
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
goals="$(salticid --show all-tasks)"
cur=`echo $cur | sed 's/\\\\//g'`
COMPREPLY=($(compgen -W "${goals}" "${cur}" | sed 's/\\\\//g') )
}
complete -F _salticid_complete -o filenames salticid
|
def max_difference(arr):
max_diff = 0
for i in range(0, len(arr)):
for j in range(i+1, len(arr)):
diff = arr[j]-arr[i]
if(diff > max_diff):
max_diff = diff
return max_diff
array = [2, 9, 4, 1, 5]
print("Maximum difference =", max_difference(... |
def generate_password():
'''This function generates a random password of 10 alphanumeric characters that also contains at least 1 special character'''
# Initialize an empty string
password = ''
# Populate the string with alphanumeric characters
for i in range(9):
password += random.c... |
for num in range(1, 20):
if num % 5 == 0:
print(num) |
# shell script version of the utest test framework
tests_ok=0
tests_failed=0
utest_running() {
echo -n "$1: "
}
utest_ok() {
tests_ok=`echo $tests_ok + 1 | bc`
echo OK
}
utest_fail() {
tests_failed=`echo $tests_failed + 1 | bc`
echo FAILED
}
utest_run() {
for t in $*; do
utest_running $t
... |
#!/usr/bin/env bash
################################################################################
### Release a new version of tekton-watcher.
###
### This script joins all manifest files into a single one and creates a
### corresponding Github release.
##############################################################... |
import type {Collection, JSCodeshift, TSPropertySignature, TSTypeAnnotation, TSTypeReference} from 'jscodeshift';
function makeTypeName(str: string) {
const a = /^(.*)(Query|Mutation|Subscription)$/.exec(str);
if (!a) throw new Error('Query or Mutation is named wrong');
return `${a[1]}Type`;
}
function dig(typeAnn... |
# Custom Script for Linux
#!/bin/bash
# The MIT License (MIT)
#
# 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 use, copy, ... |
<filename>src/main/java/com/test/MyFirstFeature.java
package com.test;
public class MyFirstFeature {
public String getFeatureMethod(boolean isThrowException) throws Exception {
if (isThrowException) {
throw new Exception("this is my exception");
}
return "test-value";
}
}
|
<gh_stars>1-10
/*
* Copyright 2021 HM Revenue & Customs
*
* 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 appl... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
package com.zebra.domain;
public class OtherInfo{
private String reportTimeStr;
private Integer appTypeCode = 0;
private Long procdureStartTime = 0L;
private Long procdureEndTime = 0L;
private Long trafficUL = 0L;
private Long trafficDL = 0L;
private Long retranUL = 0L;
private Long retranDL = 0L;
private ... |
export default {
namespace: 'app',
state: {
chartRoute: {
group: 'bar',
type: 'bar-basic-column',
query: {},
},
},
subscriptions: {
setup({ dispatch, history }) {
return history.listen(({ pathname }) => {
const { q... |
<gh_stars>1-10
package app.habitzl.elasticsearch.status.monitor.tool.client.data.shard;
import javax.annotation.concurrent.Immutable;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;
@Immutable
public class NodeAllocationDecision {
private final String nodeId;
private final Str... |
#!/usr/bin/python3
"""
Helper class to parse the ini files.
Please note that there is also a python module named configparser. However,
as the example ini module contanined no section header for the first
entry (HOSTKEY), we wrote our own
"""
class IniParser:
"""
Initializes a DHT_TRACE_REPLY message to send... |
#!/bin/bash
ARGS=$@
TESTS=${ARGS:=test*.py}
pytest --capture=no ${TESTS}
echo "Tests complete. All tests should be successful."
echo "Running rebot to get the HTML report and log file."
rebot output.xml
|
package com.google.teampot.model;
import com.google.api.server.spi.config.AnnotationBoolean;
import com.google.api.server.spi.config.ApiResourceProperty;
import com.google.api.services.bigquery.model.TableRow;
import com.google.teampot.tablerow.ProjectActivityEventTableRowWriter;
import com.google.teampot.tablerow.Tas... |
import numpy as np
from sklearn.linear_model import LinearRegression
# define the features
X = np.array([[temperature], [humidity]])
# define the labels
y = np.array([air_quality])
# create the model
model = LinearRegression()
# fit the model to the data
model.fit(X, y) |
#!/bin/bash
for f in `ls -A poc/*`; do
echo "test $f"
mkdir testdir
./ShellgeiBot -test testconfig.json "$f" &&
[[ "$(ls -A testdir | wc -l)" -eq "0" ]] && echo OK || echo NG
rm -r testdir
echo -e "==============================================\n"
done
|
package de.lmu.cis.ocrd.ml;
import weka.core.Instance;
import weka.core.Instances;
import java.io.Writer;
public class DLEEvaluator {
private final Instances instances;
private final LogisticClassifier classifier;
private final Writer writer;
private final int i;
private int good, bad, missed, total;
public ... |
import meeting, { initialState } from './Meeting'
import * as actions from '../actions/Meeting'
describe('Reducers', () => {
describe('WAIT_REQUEST', () => {
it('should wait reqeusts', () => {
expect(meeting(
initialState,
actions.waitRequest()
)).toEqual({...initialState, postDone: false, loadDone: f... |
<filename>datalad_next/patches/tests/test_push.py
from datalad.tests.utils import (
DEFAULT_REMOTE,
assert_result_count,
with_tempfile,
)
from datalad.distribution.dataset import Dataset
from datalad.core.distributed.clone import Clone
# run all -core tests, because with _push() we patched a central piece
... |
<reponame>suckatrash/puppet-jmxtrans<filename>lib/puppet/functions/jmxtrans/to_json.rb
Puppet::Functions.create_function(:'jmxtrans::to_json') do
dispatch :data_to_json do
param 'Data', :data
end
def data_to_json(data)
require 'json'
data.to_json
end
end
|
#!/usr/bin/env sh
# abort on errors
set -e
# build
npm run build
# navigate into the build output directory
cd dist
git init
git add -A
git commit -m 'deploy'
git push -f git@github.com:miguelsilva5989/vuesort.github.io.git master:gh-pages
### np --help to check release types
cd ..
np minor # to increment release... |
<reponame>vfreitas-/ShopCar<filename>ShopCar/src/shopcar/view/VendaVeiculo.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 shopcar.view;
import shopcar.entities.Cliente... |
<filename>public/js/app.js
Vue.http.headers.common['X-CSRF-TOKEN'] = $("meta[name=token]").attr("value");
new Vue({
el: '#appPhone',
data: {
create: false,
searchTerm: '',
phones: [],
phone: {
description: '',
phone: ''
},
errors: {
... |
<reponame>drkitty/cyder
from parsley import wrapGrammar
from ometa.grammar import OMeta
from ometa.runtime import OMetaBase
from constants import *
from dhcp_objects import (Host, Pool, Parameter, Option, Subnet, Group, Allow,
Deny, ClientClass)
from utils import prepare_arguments, is_mac, is_... |
#!/bin/bash
ROOTFS=$1
# Check if rootfs dir exists
if [ ! -d "${ROOTFS}" ]; then
echo "Missing rootfs (${ROOTFS}) directory."
exit 1
fi
# Mount dev directory to rootfs/dev
sudo -S mount --bind /dev ${ROOTFS}/dev
# Enter chroot environment and run bash with provided arguments
sudo -S chroot ${ROOTFS} env HOM... |
<reponame>opentaps/opentaps-1
/*
* Copyright (c) Open Source Strategies, Inc.
*
* Opentaps is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) an... |
package com.github.paolorotolo.gitty_reporter_example;
import android.os.Bundle;
import com.github.paolorotolo.gitty_reporter.GittyReporter;
public class GittyReporterExample extends GittyReporter {
@Override
public void init(Bundle savedInstanceState) {
//noinspection HardCodedStringLiteral
... |
<gh_stars>1-10
export default /* glsl */ `varying float vPixelSize;
float getTriangleUpMask(vec2 uv) {
uv.y -= .25;
return max(-uv.y, abs(uv.x) * .866 + uv.y * .5 + .6);
}
`; |
import React from "react"
import Layout from "../components/layout"
export default function Testimonials() {
return (
<Layout>
<div class="col-lg-12">
<h2 class="about-heading">Testimonials - here's what our lovely clients had to say about their experience with us...</h2>
</div>
<div ... |
def prime_list(start, end):
# List to store all prime numbers
primes = []
# Iterate over all numbers between start to end
for num in range(start, end+1):
#Check whether the number is prime or not
if check_prime(num):
primes.append(num)
return primes
def check_prime(num):
# Check if num is d... |
<filename>amp-admin/src/api/image.js
import request from '@/utils/request'
export function fetchProductSliderImages(query) {
return request({
url: '/image/product/list',
method: 'get',
params: query
})
}
export function uploadImage(query) {
return request({
url: '/image/upload',
... |
#!/usr/bin/env bash
set -e
set -o pipefail
if [[ ! -d system/src ]]; then
echo "compile-system.bash: no system/src directory" >&2
exit 1
fi
function verbosely {
echo "$@"
"$@"
}
mkdir -p system/out
rm -f system/out/*
for src in system/src/*.c; do
out="${src/src/out}"
out="${out/.c}"
verb... |
const mongoose = require('mongoose');
const bcrypt = require('bcryptjs');
const UserSchema = new mongoose.Schema({
username: {
type: String,
required: true
},
firstName : String,
secondName : String,
email : {
type: String,
unique: true,
required: true
}... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.,
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the ",License",); you may not use this file except
* in compliance with the License. You may obtain a copy of the... |
/*
* =============================================================================
*
* Copyright (c) 2011-2016, The THYMELEAF team (http://www.thymeleaf.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may ob... |
/**
*/
package edu.kit.ipd.sdq.kamp4hmi.model.HMIModificationmarks.presentation;
import edu.kit.ipd.sdq.kamp.model.modificationmarks.provider.ModificationmarksEditPlugin;
import edu.kit.ipd.sdq.kamp4hmi.model.Kamp4hmiModel.provider.Kamp4hmiModelEditPlugin;
import edu.kit.ipd.sdq.kamp4iec.model.IECRepository... |
package ofp
const OFPP_V13 = 4
const OFPP_V15 = 6
func ExpectedType(msgType uint8) uint8 {
switch msgType {
case 2, 5, 7, 18, 20, 22, 24, 26:
return msgType + 1
default:
return msgType
}
}
func IsAsymmetric(msgType uint8) bool {
switch msgType {
case 1, 10, 11, 12:
return true
default:
return false
}... |
require "snow_flake/version"
# /**
# * Twitter_Snowflake<br>
# * SnowFlake的结构如下(每部分用-分开):<br>
# * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000 <br>
# * 1位标识,由于long基本类型在Java中是带符号的,最高位是符号位,正数是0,负数是1,所以id一般是正数,最高位是0<br>
# * 41位时间截(毫秒级),注意,41位时间截不是存储当前时间的时间截,而是存储时间截的差值(当前时间截 - 开始时间截... |
#!/bin/bash
source subr.sh
CONFIG_DIR="$(setup)"
echo "config dir: $CONFIG_DIR"
test -f "$CONFIG_DIR/syndicate.conf" || test_fail "Missing syndicate.conf"
test -d "$CONFIG_DIR/users" || test_fail "Missing users/"
test -d "$CONFIG_DIR/volumes" || test_fail "Missing volumes/"
test -d "$CONFIG_DIR/gateways" || test_fa... |
<filename>leetcode/997 Finding The Town Judge/main.go<gh_stars>0
package main
func findJudge(N int, trust [][]int) int {
indegree := make([]int, N)
outdegree := make([]int, N)
for _, v := range trust {
a, b := v[0] - 1, v[1] - 1
outdegree[a]++
indegree[b]++
}
for i := range indegree {
in := indegree[i]
... |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FEED_LOADER_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FEED_LOADER_H_
#include <string>
#include <vec... |
<filename>demo/server.js
const express = require('express');
const app = express();
const cors = require('cors')
const dotenv = require('dotenv');
dotenv.config()
const Scrapers = require('./Scrapers');
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cors())
// api routes
app.get(... |
<gh_stars>0
package operatorconfig
import (
"context"
"github.com/go-logr/logr"
kube "github.com/infinispan/infinispan-operator/pkg/kubernetes"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg... |
<gh_stars>10-100
/*
* Copyright (c) 2004-2021, University of Oslo
* 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... |
#!/usr/bin/env bash
# Developer: Maik Ellerbrock <opensource@frapsoft.com>
#
# GitHub: https://github.com/ellerbrock
# Twitter: https://twitter.com/frapsoft
# Docker: https://hub.docker.com/frapsoft
[[ ! ${CONFIG_LOADED} ]] && echo "ERROR: PLEASE DON'T RUN DIRETLY (CONFIGURATION REQUIRED)" && exit 1
#
# Examples
#... |
#
# 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 may n... |
package weixin.iplimit.entity;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.Date;
/**
* Created by aa on 2016/3/22.
*/
@Entity
@Table(name = "weixin_ip", schema = "")
@SuppressWarnings("serial")
public class IPLimitEntity implements java.io.Serializable {
p... |
#!/bin/bash
# Author: yeho <lj2007331 AT gmail.com>
# BLOG: https://linuxeye.com
#
# Notes: OneinStack for CentOS/RedHat 7+ Debian 8+ and Ubuntu 16+
#
# Project home page:
# https://oneinstack.com
# https://github.com/oneinstack/oneinstack
Install_phpMyAdmin() {
if [ -e "${php_install_dir}/bin/phpize" ... |
export const LOGIN_START = 'LOGIN_START';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const LOGIN_FAILURE = 'LOGIN_FAILURE';
export const LOGOUT_START = 'LOGOUT_START';
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
export const REGISTER_START = 'REGISTER_START';
export const REGISTER_SUCCESS = 'REGISTER_SU... |
#!/bin/bash
source `dirname $0`/../common.sh
docker run -v $OUTPUT_DIR:/tmp/output -v $CACHE_DIR:/tmp/cache -e VERSION=2.5.7 -e STACK=cedar-14 hone/ruby-builder:cedar-14
|
<gh_stars>0
package com.alipay.api.response;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.merchant.mrchsurp.activitysignup.create response.
*
* @author auto create
* @since 1.0, 2021-06-25 14:02:36
*/
public class AlipayMerchantMrch... |
/* eslint-disable no-undef */
console.log('Background.js LOADED');
/* const defaultUninstallURL = () => {
return process.env.NODE_ENV === 'production'
? 'https://wwww.github.com/kryptokinght'
: '';
}; */
browser.runtime.onMessage.addListener(function (message) {
console.log(message);
});
// if (chrom... |
<gh_stars>0
package br.com.zup.mercadolivre.pergunta;
public interface DisparadorEmail {
void enviarEmail(Pergunta pergunta);
}
|
<gh_stars>10-100
require 'rails_helper'
RSpec.describe CancellationDecorator do
let!(:visit) { create(:cancelled_visit) }
let(:cancellation) { create(:cancellation, visit: visit) }
subject { described_class.decorate(cancellation) }
describe '#formatted_reasons' do
before do
cancellation.reasons = r... |
#!/bin/bash
FILES=/bio/lillyl1/EE283/Bioinformatics_Course/data/od_rawdata/*/DNAseq/*SANGER.fq.gz
for f in $FILES
do
mv $f "$(dirname $(dirname "$f"))/DNAseq.SANGER"
done
|
import ServerJSImpl from 'bigpipe-util/src/ServerJS';
export default class ServerJS extends ServerJSImpl {
}
|
class LinearEquation:
def __init__(self, m, c):
self.m = m
self.c = c
def __repr__(self):
return f"y = {self.m}x + {self.c}"
def evaluate(self, x):
return self.m * x + self.c
def find_root(self):
return -self.c / self.m |
<gh_stars>0
export function assignButtons() {
const links = document.querySelector('.footer-links').children;
links[0].addEventListener('click', home);
links[1].addEventListener('click', randomVersion);
links[2].addEventListener('click', latestVersion);
}
function randomVersion() {
const menu = [...document.query... |
//
// TeamView.h
// Team Communicator
//
// Created by <NAME> on 16.04.10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PersonalRecordingItem.h"
#import "ItemCreateViewController.h"
#import <MessageUI/MessageUI.h>
#import "OutputFormatter.h"
#import <iAd/iAd.h>
@in... |
import { uniqueColumnNames } from "./array.ts";
import { assertEquals } from "../../testdeps.ts";
Deno.test("uniqueColumnNames() -> should remove duplicate column names", () => {
const columns = uniqueColumnNames(["name", "email", "password", "email"]);
assertEquals(columns, ["name", "email", "password"]);
});
De... |
unique_dict = {
'alec' : 'alec',
'bob' : 'bob',
'sara' : 'sara',
'john' : 'john',
'elon' : 'elon'
} |
<reponame>erik168/san
/**
* @file 服务
*/
import data from './data'
/**
* 对象属性拷贝
*
* @inner
* @param {Object} target 目标对象
* @param {Object} source 源对象
* @return {Object} 返回目标对象
*/
function extend(target, source) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
target[key] ... |
<reponame>xThundr/cit111_ccac<filename>FoodLand.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 objects1;
/**
*
* @author Tyler
*/
public class FoodLand {
... |
/*
* 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 clientenvoifichiertexteOLD;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.EventQueue;
import java.a... |
import { useState } from 'react'
import '../styles/tasklist.scss'
import { FiTrash, FiCheckSquare } from 'react-icons/fi'
interface Task {
id: number;
title: string;
isComplete: boolean;
}
export function TaskList() {
const [tasks, setTasks] = useState<Task[]>([]);
const [newTaskTitle, setNewTaskTitle] = ... |
<reponame>wm3418925/modbus-utils
package wangmin.modbus.entity.type;
/**
* Created by wm on 2017/1/3.
*/
public enum ModbusByteOrderType {
/**
* 如有多个寄存器,则存储低字节的寄存器在前,每个寄存器内部大端排序,modbus模拟器默认 0 GRM503对应编码 3412
*/
LowFirstBigEndian(0),
/**
* 如有多个寄存器,则存储高字节的寄存器在前,每个寄存器内部大端排序 GRM503对应编码 1234
... |
<filename>src/main/java/org/rs2server/rs2/action/impl/WieldItemAction.java
package org.rs2server.rs2.action.impl;
import org.rs2server.rs2.action.Action;
import org.rs2server.rs2.model.Item;
import org.rs2server.rs2.model.Mob;
import org.rs2server.rs2.model.Skills;
import org.rs2server.rs2.model.Sound;
import org.rs2s... |
<reponame>lillianritchie/DWD-FINAL<gh_stars>0
//here is where we define what our database should expect from us
const mongoose = require('mongoose');
//schema is how we define what goes into our database
const Schema = mongoose.Schema;
const commentSchema = new Schema({
"name": String,
"location": String,
... |
gcloud beta app deploy --no-cache |
<gh_stars>0
import { all, put, takeLatest } from "redux-saga/effects";
import { LOAD_EVENTS, LOAD_FEATURED_EVENTS } from "./constants";
import events from "./mocks/Events";
import featuredEvents from "./mocks/FeaturedEvents";
import {
loadEventsSuccess,
loadEventsError,
loadFeaturedEventsSuccess,
loadFeaturedE... |
<filename>Source/Scene/ModelExperimental/ModelExperimentalSkin.js
import Matrix4 from "../../Core/Matrix4.js";
import Check from "../../Core/Check.js";
import defaultValue from "../../Core/defaultValue.js";
/**
* An in-memory representation of a skin that affects nodes in the {@link ModelExperimentalSceneGraph}.
* S... |
<filename>test/essentials.js
import test from 'tape'
import ReactFauxDOM from '..'
import Element from '../lib/Element'
test('has a create method', function (t) {
t.plan(1)
t.equal(typeof ReactFauxDOM.createElement, 'function')
})
test('creates an element instance with a nodeName', function (t) {
t.plan(2)
va... |
curl -X GET http://localhost:4000/trade/trade-12/status -H "authorization: Bearer ${JWT_EXP}" ; echo
|
<gh_stars>0
const Discord = require('discord.js'),
SQLManager = require('./manager.js'),
fs = require('fs'),
sleep = require('util').promisify(setTimeout),
v = '3.0.3',
inviteCompile = /(?:https?:\/\/)?discord(?:app\.com\/invite|\.gg)\/?[a-zA-Z0-9]+\/?/,
replyCompile = /^:>([0-9]{18}... |
package org.springaop.chapter.two.advice;
import java.lang.reflect.Method;
import java.util.logging.Logger;
import org.springframework.aop.AfterReturningAdvice;
public class AfterAdvice implements AfterReturningAdvice {
public void afterReturning(Object returnValue, Method m, Object[] args, Object target) {
... |
<reponame>fiesta-iot/in-house-dynamic-discovery<gh_stars>0
var globals = require('./globals.js');
module.exports = {
resources_endpoint : globals.config.iot_registry + '/resources',
observations_endpoint : globals.config.iot_registry + '/observations',
sparql_execute_endpoint: globals... |
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
trap "exit" INT
# Removes CSS imports
# Reason: Next.js forbids CSS imports outside `_app.js`.
sed -i.bak '/import "\.\.\/\.\.\/css\/awesomplete\.css";/d' node_modules/auspice/src/components/controls/search.js
sed -i.bak '/import "\.\.\/\.\.\/css\/entr... |
def classify_vowels_consonants(string):
vowels = []
consonants = []
for char in string:
if char.lower() in "aeiou":
vowels.append(char)
else:
consonants.append(char)
return vowels, consonants |
import React, { useState } from "react"
import { css } from "@emotion/core"
import { Link } from "gatsby"
import Img from "gatsby-image"
import { colors } from "../utils/colors"
import useMenu from "../utils/useMenu"
import Headroom from "react-headroom"
import Logo from "../images/logo.inline.svg"
import Hamburger fro... |
#!/bin/bash
dirs=(./rpc ./fabnet ./logger)
echo "mode: set" > coverage.out
for Dir in ${dirs[*]};
do
if ls $Dir/*.go &> /dev/null;
then
go test -coverprofile=profile.out $Dir
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> coverage... |
from rest_framework import serializers
from Notes.models import Notes
class NoteSerializer(serializers.ModelSerializer):
class Meta:
model = Notes
exclude = ('user',)
def create(self, validated_data):
validated_data['user']=self.context['request'].user
note = Notes.objects.cre... |
<filename>src/main/java/com/changqin/fast/event/EventResult.java
package com.changqin.fast.event;
public interface EventResult {
/**
* get a Event Result until time out value: timeoutForReturnResult
*
* @return
*/
Object get();
/**
* Blocking until get a Event Result
*
* @return
*/
Object getBl... |
package media
import (
"github.com/ungerik/go-start/model"
"github.com/ungerik/go-start/view"
)
func NewBlobRef(blob *Blob) *BlobRef {
blobRef := new(BlobRef)
blobRef.Set(blob)
return blobRef
}
type BlobRef string
func (self *BlobRef) String() string {
return string(*self)
}
func (self *BlobRef) SetString(st... |
<gh_stars>0
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
const SignIn = (props) => {
// hooks
const [user, setUser] = useState({});
// event handlers
const handleChanges = e => {
setUser({...user, [e.target.name]: e.target.value});
};
co... |
<filename>src/builder/__tests__/graphql.spec.ts
import buildGraphql from '../graphql';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const mockData = require('./__data__/graphql.json');
// example taken from https://fakerql.com/
describe('graphql', () => {
it('builds from graphql types', () => {
... |
serverName=${1:-test}
serverPort=${2:-27017}
rootUser=${3:-admin}
rootPass=${4:-admin}
mongoVersion=${5:-latest}
containerName=$serverName
echo "MONGO_INITDB_ROOT_USERNAME=$rootUser" > .env
echo "MONGO_INITDB_ROOT_PASSWORD=$rootPass" >> .env
echo "MONGO_VERSION=$mongoVersion" >> .env
echo "CONTAINER_NAME=$containerNam... |
//
// Copyright (C) 2016, <NAME>. <<EMAIL>>
//
#pragma once
#include <pebble.h>
#include "global.h"
#define CLOCK_DIAL_SIZE_W PBL_DISPLAY_WIDTH
#define CLOCK_DIAL_SIZE_H PBL_DISPLAY_HEIGHT
#define CLOCK_DIAL_POS_X 0
#define CLOCK_DIAL_POS_Y 0
#define CLOCK_DIAL_RECT ( GRect( CLOCK_DIAL_POS_X, CLOCK_DIAL_POS_Y, CLOC... |
import vaex
def ascii_to_vaex(path: str) -> vaex.dataframe.DataFrame:
return vaex.from_ascii(path) |
use tracing_subscriber::{EnvFilter, prelude::*, fmt::layer};
use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let non_blocking = std::io::stdout();
let subscriber = layer()
.with_writer(non_blocking)
.json()
.flatten_event(true);
let subscribe... |
import pandas as pd
from sklearn import linear_model
df = pd.read_csv('input.csv')
X = df[['sq_ft', 'bedrooms', 'neighborhood', 'year_built']]
y = df['price']
lm = linear_model.LinearRegression()
model = lm.fit(X, y)
predictions = lm.predict(X) |
package com.google.daq.mqtt.validator.validations;
public class SkipTest extends RuntimeException {
public SkipTest(String reason) {
super(reason);
}
}
|
<gh_stars>100-1000
module.exports = [{
url: 'http://localhost:3000/#/accordion',
label: 'Accordion',
selectors: [
'[data-backstop="accordion-default"]',
'[data-backstop="accordion-compact"]',
'[data-backstop="accordion-border-aligned"]',
],
}];
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.