text stringlengths 3 1.05M |
|---|
#!/usr/bin/env python3
'''
Move a motor back and forth using the TMCM6212 module
Created on 28.02.2019
@author: JM
'''
import PyTrinamic
from PyTrinamic.connections.ConnectionManager import ConnectionManager
from PyTrinamic.modules.TMCM6212.TMCM_6212 import TMCM_6212
import time
PyTrinamic.showInfo()
connectionMan... |
import React from 'react'
function Popup({ selected, closePopup }) {
return (
<section className="popup">
<div className="content">
<h2>{ selected.Title } <span>({ selected.Year })</span></h2>
<p className="rating">Rating: {selected.imdbRating}</p>
<div className="plot">
<img src={selec... |
var Products;
exports.setModel = function (modelo) {
Products = modelo;
};
exports.create = function(req, res){
res.render('save', {
title: 'Carro De Compras',
put: false,
action: '/additem',
products: new Products({
title: '',
description: '',
price: '',
pathImage: ''
})... |
from flask import Flask, render_template, request, make_response, jsonify, url_for, redirect
from flask_cors import *
from HDUCal.schedule2ics import Schedule2ICS
from HDUCal.schedule2json import Schedule2JSON
from HDUCal.gain_schedule import GainSchedule
import os
import json
app = Flask(__name__)
CORS(app, supports_... |
from collections.abc import Iterable
from math import sqrt
from numbers import Real
from functools import partial
from warnings import warn
from operator import attrgetter
from openmc import (
XPlane, YPlane, Plane, ZCylinder, Quadric, Cylinder, XCylinder,
YCylinder, Material, Universe, Cell)
from openmc.check... |
/**
* AnyChart is lightweight robust charting library with great API and Docs, that works with your stack and has tons of chart types and features.
*
* Modules: pareto, theme-pareto
* Version: 8.4.0.1922 (2018-10-04)
* License: https://www.anychart.com/buy/
* Contact: sales@anychart.com
* Copyright: AnyChart.com... |
import scrapy
class BaiduSpider(scrapy.Spider):
# 爬虫名,默认和文件名是一样的。作用:用于运行爬虫 ·scrapy crawl 爬虫名·
name = 'baidu'
# 允许抓取的域名
allowed_domains = ['www.baidu.com']
# 起始的url地址
start_urls = ['http://www.baidu.com/'] # 是一个列表,第一个或者第一批
def parse(self, response):
r = response.xpath('/html/head/t... |
from typing import Union
from ray.rllib.models.action_dist import ActionDistribution
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.utils.annotations import override
from ray.rllib.utils.exploration.exploration import Exploration
from ray.rllib.utils.exploration.random import Random
from ray.rllib.utils.f... |
#include "modes.h"
void enter_tab_mode(void)
{
if (!editor.tabs_length)
return;
SDL_Log("Mode_tab");
editor.mode = Mode_tab;
editor.refresh_needed = true;
}
void exit_tab_mode(void)
{
SDL_Log("Mode_normal");
editor.mode = Mode_normal;
editor.refresh_needed = true;
... |
###########################################################################
#
# Copyright 2020 Google 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
#
# https://www.apache.org/l... |
from enum import Enum
from tortoise import Model, Tortoise, fields
class UserRole(str, Enum):
PARTICIPANT = "participant"
CAPTAIN = "captain"
ORGANIZER = "organizer"
ADMIN = "admin"
class User(Model):
id = fields.IntField(pk=True)
email = fields.CharField(max_length=128, unique=True)
ha... |
/* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
*/
@interface CILightenBlendMode : CIBlendModeFilter
- (id)_kernel;
@end
|
from __future__ import absolute_import, unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.1.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-SiriusXM'
ext_name = 'siriusxm'
version = __version__
def get_default_co... |
import numpy as np
from numpy.testing import assert_allclose
import pytest
from scipy.fft._fftlog import fht, ifht, fhtoffset
from scipy.special import poch
def test_fht_agrees_with_fftlog():
# check that fht numerically agrees with the output from Fortran FFTLog,
# the results were generated with the provid... |
/**
* Created by shunchen_yang on 16/10/25.
*/
UE.registerUI('dialog', function (editor, uiName) {
var btn = new UE.ui.Button({
name : 'xiumi-connect',
title : '秀米',
onclick: function () {
var dialog = new UE.ui.Dialog({
iframeUrl: 'xiumi/xiumi-ue-dialog-v5.h... |
var data=[['20061208',3.99],
['20061211',3.965],
['20061212',3.9],
['20061213',3.8],
['20061214',3.78],
['20061215',3.685],
['20061218',3.635],
['20061219',3.63],
['20061220',3.8],
['20061221',3.8],
['20061222',3.785],
['20061227',3.715],
['20061228',3.75],
['20061229',3.885],
['20070102',3.95],
['20070103',4.07],
['20... |
/*******************************************************************************
*
* Copyright(c) 2015,2016 Intel Corporation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source co... |
from output.models.nist_data.atomic.short.schema_instance.nistschema_sv_iv_atomic_short_min_inclusive_2_xsd.nistschema_sv_iv_atomic_short_min_inclusive_2 import NistschemaSvIvAtomicShortMinInclusive2
__all__ = [
"NistschemaSvIvAtomicShortMinInclusive2",
]
|
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/
require('./bootstrap');
window.Vue = require('vue');
import VueRouter from 'vue-router'
/**
* ... |
const NewsletterItem = require('../../models/NewsletterItem');
const tokenService = require('../../tokenService');
module.exports = {
registerRoutes(app) {
app.get('/api/newsletters', (req, res) => {
tokenService.isAuthenticated(req, res, () =>
NewsletterItem.find(
{},
(err, do... |
"""
FI API
Allow clients to fetch Analytics through APIs. # noqa: E501
The version of the OpenAPI document: 1
Contact: analytics.api.support@factset.com
Generated by: https://openapi-generator.tech
"""
from setuptools import setup, find_packages # noqa: H301
import os
def read(filename):
re... |
import pytest
from meiga import Success
from petisco import controller_handler, INFO, ERROR
from petisco.controller.tokens.jwt_config import JwtConfig
from tests.unit.mocks.fake_logger import FakeLogger
from tests.unit.mocks.log_message_mother import LogMessageMother
@pytest.fixture
def given_any_token_type():
r... |
var geojson;
var defaultStyle = {'weight': '0', fillColor: '#381f5e', fillOpacity: '1'};
L.mapbox.accessToken = 'pk.eyJ1IjoiZHVuZXIiLCJhIjoiaWkwMnJIZyJ9.2zMvIebbUOk9C5R2itT7Dg';
var map = L.mapbox.map('small-map', 'duner.m3npglde', {
minZoom: 15,
maxBounds: [
[42.07095890994855, -87.659225463867... |
from unittest.mock import patch
import pytest
from constants.jobs import JobLifeCycle
from db.models.build_jobs import BuildJob
from factories.factory_build_jobs import BuildJobFactory
from factories.factory_projects import ProjectFactory
from factories.factorycode_reference import CodeReferenceFactory
from polyaxon_... |
/*
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.plugins.setLang( 'showblocks', 'fr-ca', {
toolbar: 'Afficher les blocs'
} );
|
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import os
from pants.backend.jvm import argfile
from pants.backend.jvm.su... |
/**
* @ngdoc controller
* @name Umbraco.Editors.DataType.CreateController
* @function
*
* @description
* The controller for the data type creation dialog
*/
function DataTypeCreateController($scope, $location, navigationService, dataTypeResource, formHelper, appState) {
$scope.model = {
folderName: ... |
'''
cd zjx/DL_Traff_Graph_main/airSTTN
nohup python -u run_tstn.py > run_tstn.log 2>&1 &
'''
import sys
import os
import shutil
import math
import numpy as np
import pandas as pd
import scipy.sparse as ss
from sklearn.preprocessing import StandardScaler
from datetime import datetime
import time
import torch
import tor... |
module.exports={A:{A:{"2":"J D E F A B xB"},B:{"1":"C K L G M N O P Q R S T U V W Z a b c d e f g h i j k l H X"},C:{"1":"0 1 2 3 4 5 6 7 8 9 t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB mB RB nB SB TB Y UB VB WB XB YB ZB aB bB cB dB eB fB gB hB P Q R oB S T U V W Z a b c d e f g h i j k l H X pB","... |
import numpy as np
import pandas as pd
import sklearn.preprocessing as pp
from sklearn.compose import ColumnTransformer
from sklearn.datasets import load_iris
from sklearn.model_selection import cross_val_score, train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import GridSe... |
import React from 'react';
import classnames from 'classnames';
var IonView = React.createClass({
propTypes: {
customClasses: React.PropTypes.string
},
getDefaultProps: function() {
return {
customClasses: ''
};
},
contextTypes: {
ionSetTransitionDirection: React.PropTypes.func
},
c... |
// region import
import fs from 'fs'
// internal
import * as session from './session'
// endregion
// region routes
export default ({api, config}) => ({
name: 'web-api',
routes: [
['get', 'v1/session', ['headers'], session.verify(api)],
['post', 'v1/session', ['headers', 'body'], session.signIn(api)],
['d... |
from twython import TwythonStreamer
from urllib import request
import base64
import os
import subprocess
import json
import sys
import datetime
import hashlib
"""
скрипт слушает ленту пользователя, переданного через credentials.py,
печатает в консоль дату и текст твита и результат обработки медиа.
Обработка медиа заклю... |
#pragma once
#include "EdgesDetector.h"
class DFTFilter : public EdgesDetector {
public:
DFTFilter() { filterSize_ = 32; };
DFTFilter(int filterSize) : filterSize_(filterSize) {};
virtual void detect(cv::Mat& inputImage, cv::Mat& outputImage);
private:
int filterSize_;
void dftShift(cv::Mat& i, cv::Ma... |
var class_puck_detector_builder_1_1_puck_detector_builder =
[
[ "__init__", "class_puck_detector_builder_1_1_puck_detector_builder.html#a3ad605fef8650da4d031e7ff9bf3caa8", null ],
[ "build", "class_puck_detector_builder_1_1_puck_detector_builder.html#ab04534170dcf872cd34b6fcbcbecd876", null ],
[ "m_broadcas... |
/*
* Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/clk.h>
#include <linux/interrupt.h>
#inclu... |
var benchmark_2_n_e_o_n_2_color_convert_8cpp =
[
[ "NEColorConvertFixture", "benchmark_2_n_e_o_n_2_color_convert_8cpp.xhtml#ab8fb396866bcf9936ff357f16a871325", null ],
[ "REGISTER_FIXTURE_DATA_TEST_CASE", "benchmark_2_n_e_o_n_2_color_convert_8cpp.xhtml#a4adf2c31c9668a635ba7a16620eac36e", null ],
[ "REGISTER... |
# -*- coding: utf-8 -*-
"""
test_ext_inheritance_diagram
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test sphinx.ext.inheritance_diagram extension.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import pytest
from sphinx.ext.in... |
#!/usr/bin/env python3
import os
import sys
min_python_version = [3,6,0]
for i,v in enumerate(min_python_version):
if sys.version_info[i] < v:
print("Randomizer requires at least version 3.6 and you are using %s" % '.'.join([str(i) for i in sys.version_info[0:3]]))
exit(1)
if sys.version_info[i... |
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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 app... |
# -*- coding: utf-8 -*-
from datetime import timedelta
from odoo import models, fields, api, exceptions
class Course(models.Model):
_name = 'academy.course'
_description = 'Academy Courses'
name = fields.Char(string="Title", required=True)
description = fields.Text()
responsible_id = fields.Many... |
import React from "react"
import { useStaticQuery,graphql } from "gatsby"
import Img from "gatsby-image"
import { navigate } from '@reach/router';
import { Navbar, Nav } from 'react-bootstrap';
import "./style.scss";
export const Footer = () => {
return (
<footer className="footer bg-primary text-white py... |
const ENV = {
development: {
router: './routes/dev', // 测试
maxAge: 0, // 缓存时间
},
production: {
router: './routes/prod', // 正式
maxAge: 1000 * 60 * 60 * 24 * 30, // 缓存时间
}
};
module.exports = ENV[process.env.NODE_ENV];
|
import React, { useEffect, useState } from 'react'
import ReactPaginate from 'react-paginate';
import ContactItem from './Contacts.ListItem';
import { Link } from 'react-router-dom';
import { getAllCategories } from '../../services/category.service'
import { FiArrowDown, FiArrowUp, FiChevronDown, FiSearch } from 'react... |
// Webfont configuration
var urls = [
'http://s.npr.org/templates/css/fonts/GothamSSm.css',
'http://s.npr.org/templates/css/fonts/Gotham.css',
'http://s.npr.org/templates/css/fonts/Knockout.css'
];
if (window.location.protocol == "https:") {
urls = [
'https://secure.npr.org/templates/css/fonts/... |
const contentToElement = (contentText) => {
const element = document.createElement('div');
element.innerHTML = (contentText || '').toString().trim();
return element;
};
const writeElements = (element, contentElement, replaceParent) => {
if (replaceParent && contentElement.childNodes.length === 1) {
const ... |
from typing import Any, Callable, Dict, List, Union # isort:skip
from pathlib import Path
import numpy as np
from torch.utils.data import Dataset
from catalyst.utils import merge_dicts
_Path = Union[str, Path]
class ListDataset(Dataset):
"""
General purpose dataset class with several data sources `list_d... |
/*
* EVE Swagger Interface
* An OpenAPI for EVE Online
*
* OpenAPI spec version: 1.3.8
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.14
*
* Do not edit the class manually.
*
*/
(function(r... |
from __future__ import print_function, division
from sympy.core.compatibility import range
from .vector import Vector, _check_vector
from .frame import _check_frame
__all__ = ['Point']
class Point(object):
"""This object represents a point in a dynamic system.
It stores the: position, velocity, and accelera... |
(function() {
'use strict';
angular
.module('App')
.controller('UploadFileController', UploadFileController);
UploadFileController.inject = ['$scope', '$http', 'fileUpload'];
function UploadFileController($scope, $http, fileUpload) {
function resetItem() {
$scope.uploadfile =... |
// @flow
import React, { Component } from 'react';
import { observer } from 'mobx-react';
import { ThemeProvider } from 'react-css-themr';
import { IntlProvider } from 'react-intl';
import AboutPage from './containers/static/AboutPage';
import { luxTheme } from './themes/lux';
import translations from './i18n/translati... |
import React, { useState } from "react";
import "./Login.css";
import { Link } from "react-router-dom";
import Footer from "../../../components/Footer/Footer";
import InputField from "./../../../components/UI/InputField/InputField";
import RoleField from "./../../../components/UI/RoleField/RoleField";
import { ToastCon... |
# -*- coding: utf-8 -*-
"""DNA Center Get Polling Interval by Id data model.
Copyright (c) 2019 Cisco and/or its affiliates.
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, i... |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef CHEETAHCOIN_KEY_H
#define CHEETAHCOIN_KEY_H
#include <stdexcept>
#include ... |
const IncomingForm = require('formidable').IncomingForm
module.exports = function upload(req, res) {
var form = new IncomingForm()
form.parse(req, function (err, fields, files) {
var dir = __dirname + '/upload';
if (!path.existsSync(dir)) {
fs.mkdirSync(dir, 0744);
}
var oldpath = file... |
'''
Modules for Numerical Relativity Simulation Catalog:
* catalog: builds catalog given a cinfiguration file, or directory containing many configuration files.
* scentry: class for simulation catalog entry (should include io)
'''
#
from nrutils.core import settings as gconfig
from nrutils.core.basics import *
fro... |
# -*- encoding: utf-8
import socket
from suplemon.suplemon_module import Module
class Hostname(Module):
"""Shows the machine hostname in the bottom status bar."""
def init(self):
self.hostname = ""
hostinfo = None
try:
hostinfo = socket.gethostbyaddr(socket.gethostname()... |
from time import time
import logging
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.decomposition import PCA
from sklearn.svm... |
// David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2019
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// Version: 4.0.2019.08.13
#pragma once
#include <Mathematics/TI... |
// Copyright 2016 The TensorFlow Authors. All Rights Reserved.
// Modifications copyright (C) 2019 Uber Technologies, 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:/... |
"""Create collage from images in a folder."""
from argparse import ArgumentParser
from pathlib import Path
from collamake.make import CollaMake
if __name__ == "__main__":
parser = ArgumentParser(description="A simple collage maker")
parser.add_argument("-f", "--file", type=Path, required=True)
args = pars... |
"""Definition of boards and/or ids"""
# Allow for aligned constant definitions:
BEAGLEBONE = "BEAGLEBONE"
BEAGLEBONE_BLACK = "BEAGLEBONE_BLACK"
BEAGLEBONE_BLUE = "BEAGLEBONE_BLUE"
BEAGLEBONE_BLACK_WIRELESS = "BEAGLEBONE_BLACK_WIRELESS"
BEAGLEBONE_POCKETBEAGLE = "BEAGLEBONE_POCKETBEAGLE"
BEAGLEBONE_GREEN = "BEAGLEBONE_G... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
//Write a generic function chainer that takes a starting value, and an array of functions to execute on it (array of symbols for ruby). Return the final value after execution is complete.
//
function add(num) {
return num + 1
}
function mult(num) {
return num * 30
}
//// returns 90;
function chain(num, funcArr)... |
export class BaseStore {
sortProcessingOrder = []; // Represents which order to apply sorts to each column
constructor(settings) {
this.sortable = settings.sortable;
this.filterable = settings.filterable;
this.columnDefinitions = settings.columnDefinitions;
this.pageable = settings.pageable;
t... |
# -*- coding: utf-8 -*-
# Copyright © 2015 The Coil Contributors
# Copyright © 2014 Roberto Alsina
# 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 l... |
#ifndef KALMAN_FILTER_H_
#define KALMAN_FILTER_H_
#include "Eigen/Dense"
class KalmanFilter {
public:
/**
* Constructor
*/
KalmanFilter();
/**
* Destructor
*/
virtual ~KalmanFilter();
/**
* Init Initializes Kalman filter
* @param x_in Initial state
* @param P_in Initial state covaria... |
/* generated by Svelte vX.Y.Z */
import { create_ssr_component } from "svelte/internal";
import { onDestroy, onMount } from 'svelte';
function preload(input) {
return output;
}
function foo() {
console.log('foo');
}
function swipe(node, callback) {
} // TODO implement
const Component = create_ssr_component(($$... |
#!/usr/bin/env python
def auto_run(root='j023507-040202'):
import os
import matplotlib.pyplot as plt
from grizli import utils
from grizli.pipeline import auto_script, photoz
utils.set_warnings()
tab = utils.GTable.gread('{0}_footprint.fits'.format(root))
HOME_PATH = os.ge... |
# Copyright (c) 2022 Tulir Asokan
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import annotations
from typing import Type
import logging
from maut... |
# -*- coding: utf-8 -*-
# Copyright 2015-2020 CERN
#
# 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 a... |
'''
RSA_OOP_test
@author: Sollazzo Nicholas
@date: March 20th 2017
@version: 1.0
@status: GREEN
'''
from RSA import RSA
rsa = RSA()
print(rsa.dict())
#en = rsa.encrypt(input('>'))
en = rsa.encrypt('das')
print('encrypted:', en)
print('decrypted:', rsa.decrypt(en))
|
"""
UhbdInterface.py
Module to interface with uhbd binaries.
"""
__author__ = "Michael J. Harms"
# ---------- Initialize module --------------------
import __init__, UhbdFullFunctions, UhbdSingleFunctions, UhbdErrorCheck
import os, shutil
from common import SystemOps, Error
# Set up uhbd binary
global uhbd
bin_pat... |
BOOL FlagGET(int& nFlagType, int nField);
void FlagSET(int& nFlagType, int nField, BOOL bSet);
int GetFileImageIndex(CString strPath, BOOL bIsDirectory);
int CompareFileName(TCHAR* name1, TCHAR* name2);
int GetLine(CString& strText, int nPos, CString& strLine, CString strToken);
BOOL WriteCStringToFile(CString strFile,... |
!function(a,b){"function"==typeof define&&define.amd?define(["../numeral"],b):b("object"==typeof module&&module.exports?require("../numeral"):a.numeral)}(this,function(a){a.register("locale","ja",{delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"千",million:"百万",billion:"十億",trillion:"兆"},ordinal:function... |
########################################################################################################
# #
# The module provides one solution to the "horse race problem" #
# ... |
/*!
* The MIT License (MIT)
*
* Copyright (c) 2016 Mykhailo Stadnyk <mikhus@gmail.com>
*
* 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 limita... |
#include <stdio.h>
#include <stdlib.h>
#define ll long long
#define f(i,a,b) for(i=a;i<b;i++)
#define fd(i,b,a) for(i=b;i>=a;i--)
#define nl '\n'
int min(int a, int b)
{
return (a<b?a:b);
}
int max(int a, int b) {
return (a>b?a:b);
}
int findMax(int A[], int n, int m) {
int M[16][16] = {0};
int cum[16] =... |
"""
Definition of all exceptions.
"""
class ArtifactoryException(Exception):
"""Generic artifactory exception."""
class UserAlreadyExistsException(ArtifactoryException):
"""User already exists."""
class GroupAlreadyExistsException(ArtifactoryException):
"""Group already exists."""
c... |
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors.
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
*/
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requirejs.exec()/transpiler pl... |
#!/usr/bin/env python
'''Parameters for an Monte Carlo HSA agent for the pegs on disks task.'''
# python
import os
# scipy
from scipy.io import loadmat, savemat
from numpy.random import choice, normal, uniform
from numpy import cos, pi
def Parameters(realization):
'''Specifies simulation hyperparameters.'''
... |
/**
** @Author:pandayu
** @Version:1.0
** @DateTime:2018-09-09
** @Project:pandaCard CardGame
** @Contact: QQ:815099602
**/
/**
* 打开小伙伴添加伙伴时的士兵展示排序
*/
//士兵上阵层的创建
var armyChoiseLayer = ModalDialog.extend({
LayerName:"armyChoiseLayer",
_item:null,
skillItem:null,
_skillList:null,
_intoSoldie... |
import os
current_directory = os.path.dirname(os.path.abspath(__file__))
db = os.path.join(current_directory, 'hlpl_arabic_words.db')
import sqlite3
def get(case):
conn = sqlite3.connect(db)
conn.row_factory = lambda cursor, row: row[0]
cur = conn.cursor()
if case=='فاعل':
lst=cur.execu... |
var iconFactory
module.exports = function (jazzicon) {
if (!iconFactory) {
iconFactory = new IconFactory(jazzicon)
}
return iconFactory
}
function IconFactory (jazzicon) {
this.jazzicon = jazzicon
this.cache = {}
}
IconFactory.prototype.iconForAddress = function (address, diameter, imageify) {
if (im... |
/*
* @Description:
* @Author: yamanashi12
* @Date: 2019-05-22 09:31:50
* @LastEditTime: 2020-03-24 10:17:49
* @LastEditors: Please set LastEditors
*/
export default [
{
path: '/page/manage',
name: 'pageManage',
meta: {
title: '页面管理'
},
component: () => import(/* webpackChunkName: "doc... |
// db.js
var DB;
(function() {
if (DB === undefined) {
DB = function( mongo , name ){
this._mongo = mongo;
this._name = name;
}
}
DB.prototype.getMongo = function(){
assert( this._mongo , "why no mongo!" );
return this._mongo;
}
DB.prototype.getSiblingDB = function( name ){
retu... |
from rules import Rule
from scope import *
import math
import string
keywords = [
# C reserved keywords #
"AUTO",
"BREAK",
"CASE",
"CHAR",
"CONST",
"CONTINUE",
"DEFAULT",
"DO",
"DOUBLE",
"ELSE",
"ENUM",
"EXTERN",
"FLOAT",
"FOR",
"GOTO",
"IF",
"IN... |
from .handlers import uri_rewrites
|
from sklearn.naive_bayes import MultinomialNB
from sklearn.utils.class_weight import compute_sample_weight
from sklearn.pipeline import Pipeline
from sklearn import metrics
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
import os
file_path = os.p... |
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(r... |
function checkTime(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
function deletes(e) {
dom_parent = $(e).parent().remove();
}
function show_depament(id, id_small) {
$('#scroll').html("");
var data = new FormData();
data.append('id', id);
data.append('id_small', id_small);
$... |
# -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from tests.utils.grammar import get_record_grammar
"""
CWR Performing Artist grammar tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class TestPerforming... |
#!/usr/bin/env python3
import json
from pathlib import PurePath, Path
import subprocess
import tempfile
import zipfile
wasm_pack = Path("~/.cargo/bin/wasm-pack").expanduser()
root_files = ["module.json", "README.md", "CHANGELOG.md", "LICENSE"]
wasm_files = ["gridless_pathfinding_bg.wasm", "gridless_pathfinding.js"]
... |
$(document).ready(function(){
// Add smooth scrolling to all links
$("a").on('click', function(event) {
// Make sure this.hash has a value before overriding default behavior
if (this.hash !== "") {
// Prevent default anchor click behavior
event.preventDefault();
// Store hash
var ... |
#include <dsverifier.h>
digital_system ds = {
.b = {4.244336814021699e-05, 8.488673628043397e-05, 4.244336814021699e-05},
.b_size = 3,
.a = { 1.000000000000000, -1.981488509144574, 9.816582826171342e-01},
.a_size = 3
};
implementation impl = {
.int_bits = 2,
.frac_bits = 5,
.min = -1.6,
... |
const path = require('path');
const fixtures = require('require-all')({
dirname: __dirname,
filter: /.json$/,
map: function (__, path) {
return `${path}`;
}
})
module.exports = Object.keys(fixtures).map(item => {
return {
fileName: path.basename(item, '.json'),
data: fixtur... |
var cooking = require('cooking');
var path = require('path');
var config = require('../../build/config');
cooking.set({
entry: {
index: path.join(__dirname, 'index.js')
},
dist: path.join(__dirname, 'lib'),
template: false,
format: 'umd',
moduleName: 'MintSideNavbar',
extractCSS: 'style.css',
exten... |
import random
import time
from enos.message.upstream.tsl.MeasurepointPostBatchRequest import MeasurepointPostBatchRequest
from enos.message.upstream.status.SubDeviceLoginRequest import SubDeviceLoginRequest
from enos.message.upstream.tsl.MeasurepointPostRequest import MeasurepointPostRequest
from enos.sample.SampleHe... |
import os
DB_URI = os.environ.get('DB_URI', 'sqlite:///app.db')
DB_API = os.environ.get('DB_API', 'http://localhost:57302')
|
// drawing.js
// This file contains functions to draw on the HTML5 canvas
var clearScreen = function(game) {
game.ctx.clearRect(0, 0, game.world.width, game.world.height);
};
var drawScreen = function(game, mouseX, mouseY) {
var player = {}; //game.get_player(globalGame.my_id)
// draw background
g... |