text
stringlengths
3.07k
16k
require('babel-core/register'); var config = require('../config/config.json') , async = require('async') , mongoose = require('mongoose') , _ = require('underscore') , fs = require('fs-extra') , slug = require('slug') , temp = require('temp') , zipFolder = require('zip-folder') , colors = require('c...
require("dotenv").config(); var Mysql = require("mysql"); var Inquirer = require("inquirer"); var Table = require("cli-table2"); var Colors = require("colors"); var keys = require("./keys.js") var connection = Mysql.createConnection({ // host: "localhost", // port: 3306, // user: "root", // password: ...
import React from 'react' import PropTypes from 'prop-types' import { ensurePluginOrder } from '../utils' import { addActions, actions } from '../actions' import { defaultState } from '../hooks/useTableState' import * as sortTypes from '../sortTypes' import { mergeProps, applyPropHooks, getFirstDefined, defaul...
import React, { Component } from 'react'; import { View, Text, Button, Linking, AsyncStorage } from 'react-native'; import qs from 'qs'; import config from '../config'; class CurrentJourney extends Component { constructor() { super(); this.onPressFetchSteps = this.onPressFetchSteps.bind(this); ...
import { hasFile, firstFile, typeOfFile, getImage, canvasToBlob, blobToFile, fileToFormData, sendFormData, size, clear, rotate, drawCrop, getCanvasPosition } from './utils'; import { Tag, LockElement } from './dom'; import './css/main.css'; const winowToCanvas = (canvas, x, y) => { const { width, height, left, top ...
/*refocus top upon refresh*/ window.onbeforeunload = function (){ window.scrollTo(0,0); } /*Change slide*/ var Image_Number = 0; function change_image (num) { var image = ["http://i.imgur.com/aWa1qLW.png", "http://i.imgur.com/cbzdSOd.jpg", "http://i.imgur.com/VRPlUgY.jpg"]; var Image_Length = image.len...
var isMobile = false; //initiate as false // responsiveness var w=window, dw=document, ew=dw.documentElement, gw=dw.getElementsByTagName('body')[0] var ww = w.innerWidth||ew.clientWidth||gw.clientWidth if (ww <= 768){ // mobile isMobile = true; } else { //desktop } keys_one = ['female_con_per', 'male_con_p...
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof o...
import React, { PropTypes } from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import FontAwesome from 'react-fontawesome' import TrackList from '../components/TrackList' import Thumbnail from '../components/Thumbnail' import Parallax from '../components/Parallax' i...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash); var _Logger = require('../utils/Logger'); var _Logger2 = _interopRequireDefault(_Logger); var _decodeLogs = require('../helpers/decodeLogs'); var _decode...
const HeapStash = require("../../dist"); const RedisPlugin = HeapStash.Plugin.Redis; const redisMock = () => { let expirationTimes = {}; let items = {}; return { get: (key) => { const expirationTime = expirationTimes[key]; if (expirationTime && expirationTime < Date.now()) { delete items[key]; delet...
/* Copyright (c) 2017-present, salesforce.com, inc. All rights reserved */ /* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */ 'use strict'; var moment = require('moment-timezone'); var pluralize = require('pluralize'); var violet = require('violet').script(); // var violetClientTx = require('...
import clone from 'clone'; import JSInterpreter from 'js-interpreter'; import { observer as globalObserver } from '../../common/utils/observer'; import { createScope } from './CliTools'; import Interface from './Interface'; /* eslint-disable func-names, no-underscore-dangle */ JSInterpreter.prototype.takeStateSnapshot...
'use strict'; // reserved Postgres words var reservedMap = require('./reserved.js'); var fmtPattern = { ident: 'I', literal: 'L', string: 's', }; // convert to Postgres default ISO 8601 format function formatDate(date) { date = date.replace('T', ' '); date = date.replace('Z', '+00'); return d...
/* DLLHijackAuditKit (C) 2010 Rapid7, Inc */ function print_status(msg) { try { WScript.StdOut.WriteLine("[*] "+ msg); } catch(e) {} } function process_list() { var res = new Array(); var wbemFlagReturnImmediately = 0x10; var wbemFlagForwardOnly = 0x20; var oWMI = GetObject("winmgmts:\\\\localhost...
import point from 'point-at-length'; const getFirstControlPoints = rhs => { const n = rhs.length; const x = new Array(n).fill(0); const tmp = new Array(n).fill(0); let b = 2.0; x[0] = rhs[0] / b; for (let i = 1; i < n; i += 1) { tmp[i] = 1.0 / b; b = (i < n - 1 ? 4.0 : 3.5) - tmp[i]; x[i] = (r...
var _ = require('../util') var dirParser = require('../parsers/directive') var propDef = require('../directives/internal/prop') var propBindingModes = require('../config')._propBindingModes var empty = {} // regexes var identRE = require('../parsers/path').identRE var settablePathRE = /^[A-Za-z_$][\w$]*(\.[A-Za-z_$][\...
const path = require('path'); const jsonStableStringify = require('json-stable-stringify'); const xxHash = require('xxhashjs'); const webpack = require('webpack'); const autoprefixer = require('autoprefixer'); const NameAllModulesPlugin = require('name-all-modules-plugin'); const ManifestPlugin = require('webpack-manif...
import axios from 'axios' import CONFIG from '../config' import $$ from './tools' import { getLangFromCookie, setDefaultLanguageCookie } from './languages' import { handleNotificate } from '@hi-ui/hiui/es/notification' const TIMEOUT = 20000 /** * only in development environment, mock API should be called. * and par...
/** * Created by li_xiaoliang on 2015/4/18. */ var request = require('request'); var cheerio = require('cheerio'); var async = require('async'); process.on('message', function (m) { if (m.name === 'hupuNews') { hupu(); } else if (m.name === 'article') { getArticle(m.option.url); } else if...
const { default: SignJWT } = require('jose/jwt/sign'); const express = require('express'); const crypto = require('crypto'); const auth = require('./auth.json'); const { ADJECTIVES, NOUNS } = require('./words'); // This is your "App ID" as obtained from the High Fidelity Audio API Developer Console. Do not share...
"use strict"; const dbapi = require('../../dbapi'); const nameAndKey = require('./nameAndKey'); const sqlParameterImpl = require('../common/sql/sqlParameterImpl'); const parameters = require('./parameters'); const sqlUtil = require('../common/sql/sqlUtil'); const postgisSqlUtil = require('../common/sql/postgisSqlUtil'...
const assert = require('assert'); const StoreControl = require('./../lib/index.js'); const StoreControlMin = require('./../lib/index.min.js'); describe('StoreControl', test(StoreControl)); describe('StoreControl - Minified', test(StoreControlMin)); function test(StoreControl){ return function(){ const store...
/* * Main function to set the clock times */ (function() { // Initialise the locale-enabled clocks initInternationalClocks(); // Start the seconds container moving moveSecondHands(); // Set the intial minute hand container transition, and then each subsequent step setUpMinuteHands(); $( '.js-new-york...
import React, { useContext, useState, useEffect, useReducer } from 'react'; import styled from 'styled-components'; import { axiosWithAuth } from '../utils/axiosWithAuth'; import { useHistory, Link } from 'react-router-dom'; // contexts // import { PlantsContext } from '../contexts'; // assets // import Start from '....
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*- // // This file is part of Almond // // Copyright 2017-2020 The Board of Trustees of the Leland Stanford Junior University // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Licen...
"use strict"; var actPage = 0; var maxEntry = CONFIG.ProfilListe.maxEntry; var pages = CONFIG.ProfilListe.pages; function getAllProfile(act){ var von = (act*maxEntry)+1; var bis = (maxEntry-1) + von; console.log("von ", von); console.log("bis ", bis); $.getJSON('/api/profil/' + von + '-' + bis, function(data){ /...
/* * HTML5 lightcycles * copyright (c) 2013 <NAME> - JDStraughan.com * MIT License - http://opensource.org/licenses/MIT */ canvas = document.getElementById("the-game"); context = canvas.getContext("2d"); enemy = { type: 'program', width: 8, height: 8, color: '#92F15F', history: [], current_direction: n...
/* * Copyright © 2019 Lisk Foundation * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation, * no part of this software, including this file, may be copied, modified, * propagated...
const m = require('mithril') const R = require('ramda') const SIGEVENT_URL = 'http://localhost:3000/sigevents' /** * Connect to backend. */ const Store = { // All our Notes belong here! events: [], // The key will be the locale date of the note's timestamp. eventsMap: {}, // We will be grouping by date ...
'use strict' /** * Lightweight web framework for your serverless applications * @author <NAME> <<EMAIL>> * @license MIT */ const QS = require('querystring') // Require the querystring library const UTILS = require('./utils') // Require utils library const LOGGER = require('./logger') // Require logger library con...
/* * 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/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
// alertify设置 initAlertifySetting(); // ajax 设置 $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, statusCode: {401: function() { window.location.href = '/'; }, 422: function(XMLHttpRequest) { var fieldErrors = XMLHttpRequest.responseJSON.da...
const localIP = require('ip'); const glob = require('glob'); const os = require('os'); const path = require('path'); const determineSeleniumConfig = require('./selenium.config').determineConfig; const { dynamicRequire } = require('../configUtils'); const { SeleniumDocker: SeleniumDockerService, ServeStaticService, T...
require('./_setup'); const test = require('tape'); const GA = require('../dist/ganalytics'); const KEY = 'ga:user'; const isEmpty = x => Object.keys(x).length === 0; const isObject = x => Object.prototype.toString.call(x, '[object Object]'); function isData(t, tid, evt, obj={}) { let src = _SENT_.src; t.ok(src, '~>...
const { ORDER_STATE_PROCESSING } = require('../../constants'); const { TRAVEL_MODE_DRIVING } = require('../../constants'); const { SELLER_SECTION_STATE_AVAILABLE } = require('../../constants'); const { admin } = require('../../config.test'); const { v4: uuidv4 } = require('uuid'); const fakeUser = { id: 'test_user',...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = undefined; var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); var _defineProperty3 ...
var $surveyCont = $('[data-surveyjs-wrapper]'), $surveyForm = $surveyCont.find('[data-surveyjs-form]'), $surveyBtn = $surveyForm.find('.surveyjs-submit-btn'); var formEl = document.querySelector('[data-surveyjs-form]'); var options = { url: '../json/survey.json', cssClasses: { selec...
import React, { Component } from "react" import { getCart, removeItem } from "../store/cart" import { getProducts } from "../store/allProducts" import { connect } from "react-redux" import axios from "axios" import { Link } from "react-router-dom" class CheckoutCart extends Component { constructor(props) { ...
import React, { Component } from "react"; import { connect } from "react-redux"; import { Redirect } from "react-router-dom"; import { patchChat, removeChat } from "actions/chats"; import { hasRole } from "services/auth"; import { canManage, isActive } from "services/chats"; import Loader from "components/loader"; impo...
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *-------------------------------------------------...
/*! * Copyright (c) 2018-2019 Veres One Project. All rights reserved. */ 'use strict'; const {create} = require('apisauce'); const base64url = require('base64url-universal'); const httpSignatureHeader = require('http-signature-header'); const jsonld = require('jsonld'); const {WebLedgerClient} = require('web-ledger-...
/* globals React, Hedgehog */ const useState = React.useState const useEffect = React.useEffect const useRef = React.useRef const AUTH_TABLE = 'Authentications' const USER_TABLE = 'Users' const requestToServer = async (axiosRequestObj) => { axiosRequestObj.baseURL = 'http://localhost:3001/' try { const resp ...
const template = document.createElement("template"); template.innerHTML = ` <style> /*tag styles*/ div { display: flex; justify-content: center; flex-direction: row-reverse; } img { width: 60px; height: 60px; margin: 10px; } p, ::slotted(p) { text-align: center; font-size: 32px; marg...
/* global window document */ import { h } from './element'; import { cssPrefix } from '../config'; import Button from './button'; import { Draw } from '../canvas/draw'; import { renderCell } from './table'; // resolution: 72 => 595 x 842 // 150 => 1240 x 1754 // 200 => 1654 x 2339 // 300 => 2479 x 3508 // 96 * cm / 2....
/** * @license * Copyright 2018 Brigham Young University * * 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 * * Un...
/* Copyright 2021 Intel 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 Unless required by applicable law or agreed to in writing, softwa...
import { locate, move } from '../../animation/translator'; import domAdapter from '../../core/dom_adapter'; import { getOffset, getOuterWidth, getOuterHeight } from '../../core/utils/size'; import { fitIntoRange } from '../../core/utils/math'; import { isWindow } from '../../core/utils/type'; import eventsEngine from '...
/* global window */ import React, {Component} from 'react'; import AutoSizer from 'react-virtualized-auto-sizer'; import DeckGL from '@deck.gl/react'; import {_JSONConverter as JSONConverter} from '@deck.gl/json'; import {StaticMap} from 'react-map-gl'; import AceEditor from 'react-ace'; import 'brace/mode...
// Express subapp var express = require('express'); var path = require('path'); var config = require('../../config'); var app = module.exports = express(); app.use(express.static(path.join(__dirname, './static/html/'))); app.use(express.static(path.join(__dirname, './static/'))); // set views for scannet app.set('vi...
import { modelLogger as logger } from '../configuration/LoggerConfig'; /** * Stroke symbol * @typedef {Object} Stroke * @property {String} type=stroke Symbol type, 'stroke' for stroke * @property {String} pointerType=undefined Pointer type * @property {Number} pointerId=undefined Pointer id * @property {Array<Nu...
/*jslint es5:true, indent: 2 */ /*global Vue, io */ /* exported vm */ 'use strict'; var socket = io(); var vm = new Vue({ el: '#page', data: { orderId: null, map: null, fromMarker: null, destMarker: null, clicks: 0, taxiMarkers: {} }, created: function () { socket.on('initialize', f...
'use strict'; var gulp = require('gulp'), path = require('path'), colors = require('colors'), sequence = require('run-sequence'), clean = require('gulp-clean'), electron = require('electron-connect'), notifier = require('node-notifier'), eslint ...
import React from 'react'; import { Calendar } from 'react-feather'; import { breakpoints } from '../../../styles'; function Banner() { return ( <section> <div className="container"> <div className="wrapper"> <div className="containerInfo"> <h1> Student Develop...
exports.PoliteWebSocket = PoliteWebSocket; const WebSocket = require('ws'); const logger = require(__dirname + '/logger.js').logger(); function PoliteWebSocket(opts) { opts = opts || { wait_for_response: false, enforce_remote_wait_for_response: false }; // use one of the following two methods to initia...
import { resolve, reject } from 'rsvp'; import Service, { inject as service } from '@ember/service'; import { addQueryParams, uniqKeys } from 'shared/utils/util'; import EmberObject from '@ember/object' import { set, get, observer, setProperties } from '@ember/object'; import { /* parseExternalId, */ parseHelmExternalI...
/** * @fileOverview pandora-cli create command * @author sizhao | <EMAIL> * @version 1.0.0 | 2018-06-24 | sizhao // 初始版本 * @version 1.1.0 | 2018-07-31 | sizhao // pa create 支持 templates 配置 */ const Inquirer = require('inquirer') const { currentDate, getConfig, getGitUser, renderAscii, log, getCwd, temp...
'use strict' const fastClone = require('rfdc')({ circles: false, proto: true }) const kFluentSchema = Symbol.for('fluent-schema-object') const { codes: { FST_ERR_SCH_MISSING_ID, FST_ERR_SCH_ALREADY_PRESENT, FST_ERR_SCH_NOT_PRESENT, FST_ERR_SCH_DUPLICATE } } = require('./errors') const URI_NAME_FR...
import axios from '../service/handleService' import CryptoJS from 'crypto-js' import { LOCALSTORAGE_KEYS } from '../config' export function getBrowserLang () { const lang = navigator.language || navigator.browserLanguage return lang.toLowerCase().includes('zh') ? 'en' : 'zh' } export function getGlobalLang () { ...
//Colors var redFill = "rgba(255,0,0,1)"; var greenFill = "rgba(34,139,34,1)"; var blueFill = "rgba(0,0,255,1)"; var blackFill = "rgba(0,0,0,1)"; var whiteFill = "rgba(255,255,255,1)"; //draws text to screen, font is optional function drawText(x, y, text, color, font) { context.fillStyle = color; context.font = type...
import d3 from 'd3'; import Barchart from './bar_chart.js'; import {range, sortBy} from 'lodash'; class Explanation { constructor(class_names) { this.names = class_names; if (class_names.length < 10) { this.colors = d3.scale.category10().domain(this.names); this.colors_i = d3.scale.category10().do...
let OS = {windows:"windows", mac:"mac",other:"other", userText: "text"} var myOs = OS.windows; // default var prefixKeys = ""; var prefixKeysHtml = ""; var isTextInputMode = false; $('document').ready(function () { if(platform.os.family.indexOf("Win") != -1) { setCustomOS(OS.windows); } else if(platf...
var HOSTNAME = 'yiwen-zhang.github.io' var DST_DIR = '/Users/YiwenZ/workspace/yiwen-zhang.github.io/sections' var POST_LAYOUT = 'post' var DRY_RUN = false var TAGS_FILTER = function (tag) { return true; } var TAGS_MAPPER = function (tag) { return tag.toLowerCase(); } var CUSTOM_FRONT_MATTER = function (post) { retur...
// Copyright DocuSign, Inc. Ⓒ 2020. MIT License -- https://opensource.org/licenses/MIT /** * dsEnvelopePlusJSON adds a fluent interface to the DocuSign API * It creates a JSON output * @type {{}} */ import parents from "./parents.json"; import children from "./children.json"; import autoContainers from "./autoCon...
"use strict"; // Variaveis const titulo = document.querySelector(".titulo"); const radio_em = document.querySelector(`#em`); const radio_label_em = document.querySelector(`#label-em`); const radio_as = document.querySelector(`#as`); const radio_label_as = document.querySelector(`#label-as`); const hora_input = docum...
const Discord = require('discord.js'); const GraphemeSplitter = require('grapheme-splitter'); const config = require("../../config/config.json"); const splitter = new GraphemeSplitter(); module.exports = { name: 'slots', description: 'Play the slot machine', category: 'Monetary', cooldown: 5000, us...
//マークがcards_on_raceのインデックスとして扱う const SUIT = { SPADE: 0, CLUB: 1, DIAMOND: 2, HEARTS: 3, } let cards_on_race = [ { "url": "../../static/torannpu-illust1.png", pos: 0, pre_pos: 0, suit: SUIT.SPADE, rank: 99 }, { "url": "../../static/torannpu-illust14.png", pos: 0, pre_pos: 0, suit: SUIT.CLUB, rank: 99 }, {...
const npsUtils = require('nps-utils'); const os = require('os'); function withPlatform(command) { let platform; switch (os.platform()) { case 'win32': platform = 'win'; break; case 'darwin': platform = 'mac'; break; default: platform = 'linux'; break; } return `$...
const { JSDOM } = require("jsdom"); const dom = new JSDOM(``); // @ts-ignore global.window = dom.window; global.document = window.document; var test = require("tape"); let { hash, getRaw, add, glob, css, reset, setup } = require("../cjs"); /** * @type {HTMLStyleElement} */ const style = document.querySelector("style...
import React, { Component, PropTypes } from 'react'; import { connect } from 'react-redux'; import { Form, Checkbox, Card, Icon, Sidebar, Menu, Button, Segment } from 'semantic-ui-react'; import SimpleMDE from 'react-simplemde-editor'; import 'simplemde/dist/simplemde.min.css'; import './editor/github-markdown.css'; im...
/** * This example demonstrate implementing a lexer for a language using python style indentation. * This is achieved by using custom Token patterns which allow running user defined logic * to match tokens. * * The logic is simple: * - Indentation tokens (Indent, Outdent) can only be created for whitespace on the...
import EEmitter from '../EEmitters/EEmitter'; import HoSoHelper from '../helpers/HoSoHelper-legacy'; class ConnectionService { wsConnectionStates = { connecting: 0, open: 1, closing: 2, closed: 3, }; wsCustomInterdiaryStates = { disconnecting: 4, notAuthorized: 5, authori...
const { join } = require('path'); // =-=-=-=-=-=-= // Discord oauth // =-=-=-=-=-=-= const express = require('express'); const cookieParser = require('cookie-parser'); const { catchAsync } = require('./utils'); // Get database const { bot } = require('../../../bot'); const { sessions } = bot.db; // Express router co...
import fetchPromise from 'node-fetch'; import { take } from 'ramda'; let CALLBACK_NAME = 'zipdata'; const CACHE = []; const PREFMAP = [ null, '北海道', '青森県', '岩手県', '宮城県', '秋田県', '山形県', '福島県', '茨城県', '栃木県', '群馬県', '埼玉県', '千葉県', '東京都', '神奈川県', '新潟県', '富山県', '石川県', '福井県', '山梨県', '長野県', '岐阜県', '静岡県', '愛知県', '三...
import { getAllStructureMatchUps } from '../../../drawEngine/getters/getMatchUps/getAllStructureMatchUps'; import { getStructureSeedAssignments } from '../../../drawEngine/getters/getStructureSeedAssignments'; import { getPositionAssignments } from '../../../drawEngine/getters/positionsGetter'; import { findStructure }...
import uuid from 'uuid/v1'; export const atendimentos = [ { id: uuid(), disciplina: 'DENTISTICA E PERIO I', paciente: '<NAME>', professorOrientador: 'RODRIGO', procedimento: 'EC/OH/PC', data: 1555016400000 }, { id: uuid(), disciplina: 'Integrada III', paciente: '<NAME>', p...
/* * #%L * React Site Starter * %% * Copyright (C) 2009 - 2017 Broadleaf Commerce * %% * Broadleaf Commerce React Starter * * Written in 2017 by Broadleaf Commerce <EMAIL> * * To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to ...
const argv = require('yargs') .usage('Usage: node $0 [options]') .example('node $0 --src ./bigXML.xml --dest ./result.json') .example('node $0 -s ./bigXML.xml -d ./result.json') .alias('s', 'src') .alias('d', 'dest') .describe('s', 'Source XML file') .describe('d', 'Destination JSON file') ...
// https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm const { create: createShuntingYard, operator: createOperator, SENTINEL } = require('./shunting-yard'); const tokenStream = require('./token-stream'); const builder = require('./node-builder'); module.exports = parseFormula; function parseFormula(tokens) { ...
'use strict'; exports.__esModule = true; var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writab...
'use strict' const Bignumber = require('bignumber.js') const constants = require('./constants') const SHIFT32 = constants.SHIFT32 const SHIFT16 = constants.SHIFT16 const MAX_SAFE_HIGH = 0x1fffff exports.parseHalf = function parseHalf (buf) { var exp, mant, sign sign = buf[0] & 0x80 ? -1 : 1 exp = (buf[0] & 0x7...
const PI = Math.PI; const arcMinRadius = 10; const arcPadding = 10; const labelPadding = -5; function createRadial() { let canvasWidth = $(chart_dest).width(); let canvasHeight = $(chart_dest).height(); let margin = { top: 0, right: 0, bottom: 0, left: 0 }; let width = canvasWidth - margin.right - margin.l...
import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import logo from '../assets/img/logo.png' import $ from 'jquery'; class NavBar extends Component { constructor(props) { super(props); this.state = { location:'/', mobile:true } this.handleChangeMobile = t...
/** * Ejemplo del Complemento de pago API Multiemisor * * puedes ver mas información en: https://apisandbox.facturama.mx/guias/api-web/cfdi/complemento-pago */ // El cfdi incial, es un CFDI regular, con la variante del "Método de pago" var cfdiInicial = { "Serie": "R", "Currency": "MXN", "ExpeditionP...
#!/usr/bin/env node /* eslint-disable no-console */ const BabelParser = require('@babel/parser'); const color = require('cli-color'); const emphasize = require('emphasize'); const estraverse = require('estraverse'); const fs = require('fs'); const Path = require('path'); const common = re...
const mysql = require("mysql"); const inquirer = require("inquirer"); const cTable = require("console.table"); const password = require("./password"); const connection = mysql.createConnection({ host: "localHost", port: 3306, user: "root", password: password, database: "employeeDB" }); connection....
const React = require('react'); const Paper = require('material-ui/Paper'); const RaisedButton = require('material-ui/RaisedButton'); const Invaders = React.createClass({ displayName: 'Invaders', propTypes: { onFinishGame: React.PropTypes.func.isRequired }, getInitialState: function () { ...
// cost functions const COST_MSE = 1; // MSE: 最小二乗誤差 const COST_CROSS = 2; // CrossEntropy: 交差エントロピー function SimpleNN() { var me = this; // log flag me.is_log = false; // node vars // 重みやバイアスの初期値、変数宣言 me.first_w = 0.6; me.first_b = 0.9; me.w = me.first_w; me.b = me.first_b; // in/out // 入力値は常に1として、出力...
const express = require('express'); const { wfs, generateNavLinks, generateAppUrl, logger, logRequest, makeAsyncHandler } = require('../util'); const settings = require('../settings'); const cmr = require('../cmr'); const Promise = require('bluebird'); const CONFORMS_TO = [ 'https://api.stacspec.org/v1.0.0-beta.1/co...
// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. /* eslint-disable no-unused-vars */ /* eslint-disable no-new */ import Vue from 'vue' import App from './App.vue' import i18n from './i18n' import router from './router' import sto...
require('dotenv').config() const { MessageEmbed, MessageAttachment } = require('discord.js'); const Utils = require('../Utils/Utils'); const util = require('util') const request = require('request-promise'); const config = require('../config.json'); const { createCanvas, loadImage } = require('canvas') Utils.registerFo...
/* * Bowser extension for Gnome 3 * This file is part of the Bowser Gnome Extension for Gnome 3 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyrigh...
'use strict'; let github; let context = {}; $(() => { initContext() .then(updateRepo) .then(initPopup) .then(() => { if (github.repository === undefined) { return } else { updateBranch() } }) .then(() => { return new Promise((resolve) => { chrome.storage.sync.get(['branch...
import PropTypes from 'prop-types' import React, { Component } from 'react' import shortid from 'shortid' import styled from 'styled-components' import { connect } from 'react-redux' import { Redirect, Link, withRouter } from 'react-router-dom' import { storeAllPlaylists, recievedPlaylistFromServer, addNewPlaylistToSto...
/* Endpoints */ import React, { PropTypes } from 'react'; import autobind from 'autobind-decorator'; import reactMixin from 'react-mixin'; import helpers from '../../helpers'; import $ from 'jquery'; import scrollto from 'jquery.scrollto'; import Card from 'material-ui/lib/card/card'; import CardActions from 'mater...
const assert = require('assert') const RBTree = require('bintrees').RBTree const Monotonic = require('paxos/monotonic') // TODO We can have an arrivals queue. Not difficult. Arrival does not return a // new version. A separate function determines if there is a next version. class Table { constructor (multipler) ...
// Connecting to ROS // ----------------- var ros = new ROSLIB.Ros({ url : 'ws://localhost:9090' }); // Publishing a Topic // ------------------ var cmdVel = new ROSLIB.Topic({ ros : ros, name : '/cmd_vel', messageType : 'geometry_msgs/Twist' }); var twist = new ROSLIB.Message({ linear : { x : 0.1, ...
/* Checklist: 1. we need a rectangle - CHECKED; 2. We need 4 inputs - CHECKED; 3. Use JS to get the values of the inputs - CHECKED; 4. console.log inputTopLeft.value - CHECKED; 5. Set up the function to change the border-radius top-left - CHECKED; 6. Set up the function to change the border-radius top-r...
const fs = require('fs'); const path = require('path'); const { craNpm, craYarn } = require('../util/create'); const { v4: uuid } = require('uuid'); const StaticMethods = require('./utils'); class ProjectApi extends StaticMethods { constructor(client, db, folder, logs) { super(db); this.client = client; ...
/* eslint-disable no-underscore-dangle */ /* eslint-disable no-shadow */ /* eslint-disable react/prop-types */ /* eslint-disable react/no-unused-prop-types */ /** * * ProjectPreview * */ import React, { memo, useEffect, useState, useRef } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'r...