text stringlengths 3 1.05M |
|---|
// Main application
import path from 'path'
import React from 'react'
import { render, hydrate } from 'react-dom'
import {
StaticRouter,
BrowserRouter,
Switch,
Route,
Link,
withRouter
} from 'react-router-dom'
import { Provider as RebassProvider } from 'rebass'
import minimatch from 'minimatch'
import sortB... |
class Solution:
def arrayNesting(self, nums: List[int]) -> int:
result = 0
for i in range(len(nums)):
if nums[i] != -1:
start, count = nums[i], 0
while nums[start] != -1:
temp = start
start = nums[start]
... |
import pytest
from django.urls import reverse
from ..models import Snapshot
users = (
('owner', 'owner'),
('manager', 'manager'),
('author', 'author'),
('guest', 'guest'),
('api', 'api'),
('user', 'user'),
('site', 'site'),
('anonymous', None),
)
view_snapshot_permission_map = {
'... |
from PersistentBST import *
print("\n\tARCHEIO")
Tree = PBST()
currentBranch = "master"
prevBranch = None
branches = ["master"]
while True:
print("\nCurrent Branch:", currentBranch)
print("\n1. List Files\n2. View File\n3. New File\n4. Delete File\n5. Edit File\n6. List Branches\n7. New "
"Branc... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
/**
* @fileoverview Rule to enforce grouped require statements for Node.JS
* @author Raphael Pigulla
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
module.exports ... |
/**
* Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
* Licensed under MIT
* @author Ariel Flesler
* @version 2.1.2
*/
;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(req... |
// @ts-nocheck
'use strict';
const _ = require('lodash');
const EventEmitter = require('events');
const {Telnet} = require('telnet-rxjs');
const newLine = String.fromCharCode(13);
const START_SOP = 'start_sop';
const ENDE_SOP = 'ende_sop';
const START_SKD = 'start_skd';
const ENDE_SKD = 'ende_skd';
const START_SMO = ... |
from numpy import nan
from .drop_dataframe_slice_greedily import drop_dataframe_slice_greedily
def clean_and_write_dataframe_to_tsv(dataframe, index_name, tsv_file_path):
assert not dataframe.index.hasnans
assert not dataframe.columns.hasnans
assert not dataframe.index.has_duplicates
assert not d... |
const colors = require('tailwindcss/colors')
module.exports = {
purge: [
'./resources/**/*.blade.php',
'./resources/**/*.js',
],
darkMode: false, // or 'media' or 'class'
theme: {
container: {
padding: {
default: 12px
}
},
},
varian... |
# import the necessary packages
from __future__ import print_function
from pyimagesearch.photoboothapp import PhotoBoothApp
from imutils.video import VideoStream
import argparse
import time
# construct the argument parse and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-o", "--output", required... |
# coding: utf-8
import re
import sys
import os
import logging
import fnmatch
import json
import time
import collections
import py
import pytest
import _pytest
import _pytest.mark
try:
import resource
except ImportError:
resource = None
try:
import library.python.pytest.yatest_tools as tools
except Import... |
import React from 'react'
import {render} from 'react-dom'
import App from './App'
render(<App foo="bar" />, document.getElementById('app'))
|
/* jshint esversion: 6 */
import axios from '../axios';
/*
* 公共枚举/字典数据获取
*/
// 包含"全部"的枚举
export const findEnumIncludeAll = (module, data) => {
return axios({
url: '/common/findEnumIncludeAll/' + module,
method: 'post',
data
});
};
// 不包含"全部"的枚举
export const findEnumExcludeAll = (module, data) => {
... |
module.exports = {
root: true,
env: {
node: true,
browser: true,
jquery: true
},
globals: {
document: true,
Qs: true,
axios: true,
$vm: true,
localStorage: true,
VueRouter: true,
window: true,
AMap: true,
Vuex: true,
Vue: true,
moment: true,
ELEMENT: t... |
import React from 'react';
import Constants from './../Constants';
class CreatureRow extends React.Component{
constructor(props){
super(props);
this.get_row_color = this.get_row_color.bind(this);
this.set_num = this.set_num.bind(this);
this.select = this.select.bind(this);
}
... |
flarum.core=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toS... |
from pathlib import Path
from gensim.corpora import Dictionary
from gensim.models import TfidfModel
from gensim.similarities import MatrixSimilarity, SparseMatrixSimilarity
from tqdm import tqdm
from claf.decorator import register
@register("component:tfidf")
class TFIDF:
"""
TF-IDF document retrieval mod... |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
When "continue Identifier" is evaluated Identifier must be label in the
label set of an enclosing (but not crossing function boundaries)
IterationStatement
es5id... |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... |
import { isAbsolute } from 'path';
import linaria from '@linaria/rollup';
import postcss from 'rollup-plugin-postcss';
import { babel } from '@rollup/plugin-babel';
import nodeResolve from '@rollup/plugin-node-resolve';
import pkg from './package.json';
const extensions = ['.ts', '.tsx'];
export default {
input: '.... |
function displayPopUpAtForDiv(oObj, anchorPos) {
if (!!oObj) {
oObj.style.position = const_absolute_symbol;
if ( (!!anchorPos) && (!!anchorPos.x) ) oObj.style.left = (anchorPos.x - 310) + "px";
if ( (!!anchorPos) && (!!anchorPos.y) ) oObj.style.top = (anchorPos.y - 165) + "px";
oObj.style.display = ((oObj... |
# *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
from typing import Optional
import pulumi
import pulumi.runtime
from pulumi import Input, ResourceOptions
from ... import tables, version
... |
/*Debemos lograr tomar el importe por ID ,
transformarlo a entero (parseInt), luego
mostrar el importe con un aumento del 10 %
en el cuadro de texto "RESULTADO".*/
function MostrarAumento()
{
/*var sueldo = parseInt(document.getElementById("sueldo").value);
resultado = document.getElementById("resultado").valu... |
# Copyright 2021 Dynatrace LLC
#
# 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 t... |
import styled from "styled-components";
import { margin } from "styled-system";
const MessageContentStyle = styled.div`
padding: 15px 50px 15px 20px;
white-space: pre-wrap;
flex: 1;
.carbon-content__title {
margin-bottom: 2px;
}
.carbon-content__body {
margin-top: 0px;
}
${margin}
`;
export... |
import React from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import ConditionReport from "./pages/ConditionReport";
import HouseProfile from "./pages/HouseProfile";
import Home from "./pages/Home";
import Nav from "./components/Nav";
// import NavTabs from "./components/NavTabs... |
function rot(string, rotAmount){
var alphabetupper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var alphabetlower = "abcdefgjijklmnopqrstuvwxyz";
var newString = "";
for(i = 0; i < string.length; i++){
var index = alphabetupper.indexOf(string[i]);
if(index >= 0){
newString += alphabetupper[(index + rotAmount) % alphabetu... |
twin = dict(
type='SingleStageDetector',
pretrained='zoo/mobilenet_v2.pth.tar',
backbone=dict(
type='SSDMobileNetV2',
input_size=-1,
frozen_stages=18,
out_layers=('layer4', 'layer7', 'layer14', 'layer19'),
with_extra=False,
norm_eval=True,
),
neck=... |
$(document).ready(function(){
var switchIndex = 0;
function switchPair(i){
return function(){
if(i===0 | i===1){
$('.pic-0, .pic-1').css('border', '4px solid black');
$('.pic-'+i).css('border', '4px solid #2AACE8');
$('.pic-0 img, .pic-1 img').css('-webkit-filter','none');
... |
const { Pool } = require("pg");
module.exports = new Pool({
user: "postgres",
password: "admin",
host: "localhost",
port: 5432,
database: "foodfy"
}); |
const isInViewport = elem => {
const distance = elem.getBoundingClientRect();
return (
distance.top >= 0 &&
distance.left >= 0 &&
distance.bottom <=
(window.innerHeight || document.documentElement.clientHeight) &&
distance.right <=
(window.innerWidth || document.documentElement.clientWid... |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bwbcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b... |
import setuptools
setuptools.setup(
name="soccer_scraper",
version="1.0.0",
author="Ireneusz Niedziałkowski",
author_email="irek.niedzialkowski@gmail.com",
description="Soccer/Football scraping scripts enabling the user to view all the goals and other media highlights directly under results scraped from flas... |
from django.urls import path, include
from AccountManager import views
urlpatterns = [
path('', views.Login.as_view()),
path('login/', views.Login.as_view(), name='login'),
path('logout/', views.Logout.as_view(), name='logout'),
] |
/* eslint-disable react/jsx-props-no-spreading */
import { ThemeProvider } from "styled-components";
import GlobalStyle from "../styles/global";
import Themes from "../styles/themes";
export default function App({ Component, pageProps }) {
return (
<>
<ThemeProvider theme={Themes}>
<GlobalStyle />
<Compo... |
const MessageType = require('./../enum/MessageType');
const RequestType = require('./../enum/RequestType');
//dinh nghia message
export function RealtimeEntity(entity, action, actor, time) {
this.BaseEntity = entity;
this.EntityAction = action;
this.Actor = actor;
this.LastUpdate = time;
}
export func... |
!function(){var s=require("preload-store").default,e=document.getElementById("data-preloaded"),r=document.getElementById("data-discourse-setup").dataset;if(e){var o=JSON.parse(e.dataset.preloaded);Object.keys(o).forEach(function(e){s.store(e,JSON.parse(o[e])),"true"===r.debugPreloadedAppData&&console.log(e,s.get(e))})}... |
from decimal import Decimal as D
from django.test import TestCase
from django.conf import settings
import mock
from oscar.apps.basket import forms
from oscar.apps.offer.utils import Applicator
from oscar.core.loading import get_model
from oscar.test import factories
from oscar.test.basket import add_product
from osca... |
/* eslint-disable */
import React from 'react';
import { isEqual } from 'lodash';
import { Field, change } from 'redux-form';
import { translate } from 'react-i18next';
import { Select } from '@components/Select';
@translate()
export default class SearchField extends React.Component {
state = {
data: [],
};
... |
/*!
* jQuery JavaScript Library v1.12.4
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2016-05-20T17:17Z
*/
(function(a,b){if(typeof module==="object"&&typeof mod... |
/*
* RedGPU - MIT License
* Copyright (c) 2019 ~ By RedCamel( webseon@gmail.com )
* issue : https://github.com/redcamel/RedGPU/issues
* Last modification time of this file - 2020.1.29 22:10:29
*
*/
"use strict";
export default class ShareGLSL {
static MESH_UNIFORM_POOL_NUM = 100;
static GLSL_VERSION = ... |
/* mod */
import MidiIO from '../../../MidiIO/src/MidiIO';
/**
* Download midi from url and parse it into JSON {meta, musicTracks}.
* Wrapper around MidiIO.parseMidi(url)
* @function
* @name getJSONFromMidiURL
* @param {string} url - URL to a midi file.
* @example
* getJSONFromMidiURL('https://s3-eu-west-1.amaz... |
var mongoose = require('mongoose');
var DevSchema = new mongoose.Schema({
id: String,
name: String,
username: String,
timestamp: {
type: Date,
default: Date.now
}
});
module.exports = mongoose.model('Dev', DevSchema);
|
https://api.github.com/search/code?q=text+in:file+language:json+repo:misak1/electron-regexp-editor
https://api.github.com/search/code?q=regexp+in:path+language:json+repo:misak1/regexp-json
https://github.com/misak1/electron-regexp-editor/blob/b01293f0cfc95aaf2bdc63b77ca4807065e2f7cb/RegExp/Excel/HTML%E3%83%86%E3%83%B... |
/**
* Bio component that queries for data
* with Gatsby's useStaticQuery component
*
* See: https://www.gatsbyjs.org/docs/use-static-query/
*/
import React from "react"
import { useStaticQuery, graphql } from "gatsby"
import Image from "gatsby-image"
import { rhythm } from "../utils/typography"
const Bio = () =... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import docker
import platform
import tarfile
import tempfile
import errno
import os
import subprocess
from helpers.shell import execute
class UnitHelper(object):
@staticmethod
def default_config():
return {
"LOG_LEVEL": "DEBUG",
"SNAPSHOT_SATURATION... |
import { StyleSheet } from 'react-native';
import { ApplicationStyles, Colors, Metrics } from '../../Themes/';
export default StyleSheet.create({
gradient: {
flex: 1,
backgroundColor: Colors.blue,
paddingTop: Metrics.statusBarHeight,
paddingHorizontal: Metrics.baseMargin,
},
container: {
padd... |
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter')
/**
* @type { import("protractor").Config }
*/
exports.config = {
allScriptsTimeout: 11000,
... |
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'ion';
var iconName = 'chevron-back-sharp';
var width = 512;
var height = 512;
var ligatures = [];
var unicode = null;
var svgPathData = 'M 328 78.058594 L 311.0293 95.029297 L 150.05859 256 L 311.0293 416.9707 L 328 433.94141 L 3... |
'use strict';
/**
* collection8 service.
*/
const { createCoreService } = require('@strapi/strapi').factories;
module.exports = createCoreService('api::collection8.collection8');
|
import React from 'react';
import { Link } from 'react-router-dom';
import striptags from 'striptags';
import Truncate from 'react-truncate';
const BlogItem = props => {
/* this is called destructuring */
const {
id, blog_status, content, title, featured_image_url
} = props.blogItem;
return (
<div... |
import {eventMap} from '@testing-library/dom/dist/event-map'
// this is pretty helpful:
// https://codesandbox.io/s/quizzical-worker-eo909
// all of the stuff below is complex magic that makes the simpler tests work
// sorrynotsorry...
const unstringSnapshotSerializer = {
test: val => val && val.hasOwnProperty('sna... |
const uuid = require('uuid/v4')
const axios = require('axios')
const moment = require('moment')
const casAdapter = require('../adapter/cas-adapter')
module.exports = {
async wechatLoginCallback(ctx, next) {
const { code, state: session } = ctx.request.query
let t_startTime = +moment()
// 确保 session 有效
... |
/*!
* ${copyright}
*/
// Provides control sap.m.GenericTag.
sap.ui.define([
"sap/ui/core/Control",
"sap/ui/events/KeyCodes",
'./library',
"sap/ui/core/library",
"sap/ui/core/Icon",
"./GenericTagRenderer"
], function(Control, KeyCodes, library, coreLibrary, Icon /* , GenericTagRenderer */) {
"use strict";
/... |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
(function(){if(window.CKEDITOR&&window.CKEDITOR.dom)return;window.CKEDITOR||(window.CKEDITOR=function(){var b={timestamp:"D6IE",version:"4.2",revision:"f74e558",rnd:Math.floo... |
import { shallowMount } from '@vue/test-utils'
import BModal from '@components/modal/Modal'
import config, {setOptions} from '@utils/config'
let wrapper
describe('BModal', () => {
beforeEach(() => {
wrapper = shallowMount(BModal, {
propsData: {
active: true
},
... |
import {STATION_LIST} from '../constants/localStorage.js';
import {getLocalStorage, setLocalStorage} from '../utils/localStorage.js';
import {renderStationList} from '../viewController/subway.js';
import {STATION_DUPLICATE_MSG} from '../constants/message.js';
import {$} from '../utils/DOM.js';
export const stations = ... |
#
# frontend.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it wi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'unisdk'
DESCRIPTION = 'Uni SDK for Python.'
URL = 'https://github.com/apistd/uni-python-sdk'
EMAIL = 'i@acathur.com'
AUTHOR = 'Acath... |
var convert = require('./convert'),
func = convert('startsWith', require('../startsWith'));
func.placeholder = require('./placeholder');
module.exports = func; |
#!/usr/bin/env python3
'''
LDA with variable precision
'''
import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
__author__ = "Michael Hersche"
__email__ = "herschmi@ethz.ch"
class lda_multires(LinearDiscriminantAnalysis):
def __init__(self,solver='svd',shrinkage=None,precisio... |
import React from "react";
import PropTypes from "prop-types";
export default function LargeHeader(props) {
return (
<div>
<h1 className="text-3xl font-serif font-medium text-gray-900 mb-4">
{props.title}
</h1>
<p className="w-10/12 text-gray-700 font-light">{props.description}</p>
... |
//! moment.js locale configuration
//! locale : Central Atlas Tamazight [tzm]
//! author : Abdel Said : https://github.com/abdelsaid
import moment from '../moment';
export default moment.defineLocale('tzm', {
months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.... |
require('dotenv').config();
const faunadb = require('faunadb');
const client = new faunadb.Client({
secret: process.env.FAUNADB_TEST_ADMIN_SECRET,
});
const q = faunadb.query;
/**
* Jest teardown
*
* @return {Promise}
*/
module.exports = async () => {
await client.query(
q.Do(
q.Delete(q.Database(... |
#!/usr/bin/python3
import os
import subprocess
import sys
import getpass
def add_user():
username = input("Enter Username : ")
passwd = getpass.getpass()
confirm_password = getpass.getpass(prompt="To confirm, re-enter password: ")
try:
subprocess.run(['useradd', '-p', password, username ])
... |
/* eslint-disable function-paren-newline */
// @flow
import reducer, { initialState } from '../../app/containers/Login/reducer';
import * as actions from '../../app/containers/Login/actions';
import type { AuthType } from '../../app/types/auth';
test('provide the initial state', () => {
expect(reducer(undefined, { t... |
from .idle_time import IdleTimeMetric
from .job_makespan import JobMakespanMetric
from .job_turnaround_time import JobTurnaroundTimeMetric
from .job_waiting_time import JobWaitingTimeMetric
from .power_consumption import PowerConsumptionMetric
from .task_throughput import TaskThroughputMetric
from .metric import Metri... |
'''
Reverse Polish Notation algorithm
'''
def rpn(expr):
PREC = {
'^': 4,
'*': 3,
'/': 3,
'+': 2,
'-': 2,
'(': 1
}
postfix = []
ops = []
for token in expr:
if token.isdigit():
postfix.append(token)
elif token == '(':
... |
"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
... |
import React, { Component } from 'react'
import {
Modal,
Text,
TouchableWithoutFeedback,
View,
StyleSheet,
} from 'react-native'
import Textbox from 'components/atoms/textbox'
import { Colors } from 'constants/colors'
import Typography from 'constants/typography'
export default class Prompt extends Componen... |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/builtin/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _createSvgIcon = _interopRequireDefault(require("./utils/c... |
import React, { useState, useContext } from "react";
import { Link } from "react-router-dom";
import UserService from "../../Services/User";
import UserContext from "../../UserContext";
const Login = (props) => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const userCont... |
import { invenioConfig } from '@config';
import { DeleteActionButton } from '@forms/components/DeleteActionButton';
import { IdentifiersField } from '@forms/components/IdentifiersField';
import { AccordionField } from '@forms/core/AccordionField';
import { ArrayField } from '@forms/core/ArrayField';
import { GroupField... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import PropTypes from 'prop-types'
import React, { Component } from 'react'
import styled from 'styled-components'
import { ExternalLink, ListItem, Modal, OrderedList, TextButton } from '@gnomad/ui'
import Link from '../Link'
import { getLabelForConsequenceTerm } from '../vepConsequences'
import TranscriptConsequence... |
// console.log('Loading DiscountField...')
Spontaneous.Field.Markdown = (function($, S) {
var dom = S.Dom;
var TextCommand = new JS.Class({
name: '',
pre: '',
post: '',
extend: {
get_state: function(input) {
var start = input[0].selectionStart, end = input[0].selectionEnd, value = input.val(),
be... |
$(function () {
// Prepare demo data
var data = [
{
"hc-key": "de-ni-03452000-03452501",
"value": 0
},
{
"hc-key": "de-ni-03457000-03457501",
"value": 1
},
{
"hc-key": "de-ni-03458000-03458003",
"val... |
# 线程是操作系统直接支持的执行单元,Python的线程是真正的Posix Thread,不是模拟出来的
# _thread是低级模块,threading是高级模块,对 _thread进行封装
'''
import time, threading
# 新线程执行的代码
def loop():
print ('thread %s is running...' % threading.current_thread().name)
n = 0
while n < 5:
n = n + 1
print ('thread %s >>> %s' % (threading.current_... |
"use strict";
var LoginService = (function () {
function LoginService() {
this.instagramClientId = 'ee5ef913d1a347b488174752523f16c2';
this.instagramUrl = 'https://api.instagram.com/oauth/authorize/?client_id=' + this.instagramClientId + '&redirect_uri=http://localhost:3000&response_type=token';
... |
const express = require("express");
const db = require("../models");
const { isLoggedIn } = require("./middleware");
const router = express.Router();
const { Op } = db.Sequelize;
router.get("/", isLoggedIn, async (req, res, next) => {
try {
const followingList = req.user.Followings.map((v) => v.id);
followi... |
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashDevice = void 0;
const crypto_1 = __importDefault(require("crypto"));
const deviceToString =... |
/**
* Created by Bell on 16/8/25.
*/
import Permission from '../models/permission';
import Debug from 'debug';
import pkg from '../../package.json';
const debug = new Debug(pkg.name);
/**
* get permission by type
*
* @param ctx
* @param next
* @returns {*}
*/
export async function get(ctx, next) {
const t... |
const got = require('got');
const { strict: assert } = require('assert');
const { Agent: HttpsAgent } = require('https');
const { HttpStatusError } = require('common-errors');
const { pick } = require('lodash');
const { USERS_INVALID_TOKEN, lockBypass, ErrorConflictUserExists } = require('../../constants');
const conta... |
#!/bin/python3
import math
import os
import random
import re
import sys
class Crossword():
EMPTY = "-"
BLOCKED = "+"
def __init__(self, grid, words):
self.grid = grid
self.words = words
def solve(self):
while self.is_unsolved():
word = self.words.pop()
... |
import React from 'react';
import moment from 'moment';
import { Input, Checkbox, DatePicker, Form, Row, Col, Button } from 'antd';
const FormItem = Form.Item;
const Layout2 = () => (
<div id="test">
<Row>
<Col span={6}>
<FormItem label="Amount in Euro">
<Input className="example-input" p... |
const isFunction = require('lodash/isFunction');
module.exports = function processReaddirFiles(files, each) {
const out = [];
for (const file of files) {
if (file === 'index.js') continue;
if (file.slice(-3) !== '.js') continue;
if (isFunction(each)) {
each(file, file.slice(0, -3));
}
out... |
import React, { useEffect, useState } from "react";
import { Modal, Button } from "react-bootstrap";
import { useDispatch } from "react-redux";
import { REACT_APP_SERVER } from "../../../../grobalVars"
export default function Popup(props) {
const [num, setnum] = useState(0);
const [reason, setreason] = useState(""... |
/**
* Copyright 2013-2020 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see http://www.jhipster.tech/
* for more information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Li... |
import * as ls from '../localStorage';
let lsState = ls.get('setting.tooltips') ? ls.get('setting.tooltips') : { detailedMode: false };
export default function themeReducer(state = lsState, action) {
switch (action.type) {
case 'SET_TOOLTIPS':
ls.set('setting.tooltips', action.payload);
return actio... |
import path from 'path'
import { dependencies } from '../package.json'
export const template = {
dependencies,
dir: path.join(__dirname, '..', 'template'),
files: [
'App.js',
'client.js',
'index.js',
'router.js',
'router.scrollBehavior.js',
'server.js',
'utils.js',
'empty.js',
... |
const LoginAssert = require('../asserts/Login.assert');
const LoginPage = require('../pages/LoginPage');
const { Given, When, Then } = require('cucumber');
Given(/^user navigates to "([^"]*)"$/, (endpoint) => {
LoginPage.open(endpoint);
});
When(/^user fills the fields with the following information$/, (dataTable) ... |
Redactor.lang.sk={format:"Formát",image:"Obrázok",file:"Súbor",link:"Odkaz",bold:"Tučné",italic:"Kurzíva",deleted:"Preškrtnuté",underline:"Podčiarknuté",superscript:"Horný index",subscript:"Spodný index","bold-abbr":"B","italic-abbr":"I","deleted-abbr":"S","underline-abbr":"U","superscript-abbr":"Sup","subscript-abbr":... |
import numpy as np
from collections import OrderedDict
def flatten_to_dict(flatten_obs, dict_space, dict_keys=None):
if dict_keys is None:
dict_keys = dict_space.spaces.keys()
obs_dict = OrderedDict()
begin_index = 0
end_index = 0
for key in dict_keys:
origin_shape = dict_space.spa... |
import { useState } from 'react';
import Link from 'next/link';
import { emailContactForm } from '../../actions/form';
const ContactForm = ({ authorEmail }) => {
const [values, setValues] = useState({
message: '',
name: '',
email: '',
sent: false,
buttonText: 'Send Message',... |
import { baseAxios } from '@/utils/axios';
import { DELETE_FLAG } from "../utils/enums";
import { json2filter } from '../utils/json2filter';
export const coursewareGet = (params, others) => baseAxios.get('/api/v1/courseware', { params: { q: JSON.stringify(params), results_per_page: 10, ...others } });
export const co... |
/*
Copyright 2019-2020 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
'use strict';
const array = [];
const charCodeCache = [];
const leven = (left, right) => {
if (left === right) {
return 0;
}
const swap = left;
// Swapping the strings if `a` is longer than `b` so we know which one is the
// shortest & which one is the longest
if (left.length > right.length) {
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# built-in modules
from collections import defaultdict
from datetime import datetime
# 3rd-party modules
from botocore.client import Config
import arrow
import boto3
# local modules
from mass.scheduler.swf import config
def workflows_to_jobs(workflows):
workflows ... |