text stringlengths 3.22k 29.5k |
|---|
/*
Annotation utilities
Includes:
// Algorithm for calculating IAA of triples using BLEU (adapting SemBLEU).
// The current implementation is STRICT. Future work will relax the strict criteria to allow nodes/edges to be
// counted as correct (or partially correct) if they are descendents.... |
/* Copyright 2021 i2c Inc. All rights reserved. */
import { ActiveOverlay } from './ActiveOverlay.js';
import { OverlayTimer } from './overlay-timer.js';
import '../active-overlay.js';
function isLeftClick(event) {
return event.button === 0;
}
function hasModifier(event) {
return !!(event.metaKey || event.altKe... |
import { useEffect, useRef, useState } from 'react'
import PropTypes from 'prop-types'
import { observer } from 'mobx-react'
import styled from 'styled-components'
import Swal from 'sweetalert2'
import Icon from '@mdi/react'
import { mdiArrowTopRightThick, mdiDownload, mdiMagnifyPlusOutline } from '@mdi/js'
import Load... |
// Copyright: All contributers to the Umple Project
// This file is made available subject to the open source license found at:
// http://umple.org/license
//
// Initializes all the tooltips on umpleonline
// This is a dictionary of all the tooltips that are not initialized using the title attribute.
// The are in the... |
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
var __awaiter = (this && th... |
/* Player */
var Player = function (options) {
this.player = options.player;
this.diy = options.diyplayer;
this.currentAudioId = 0;
this.songLength = 0;
this.isPlaying = false;
this.playTimer = 0;
this.totalTime = 0;
this.currentTime = 0;
this.loopMode = 0;
this.volumeValue = .8;... |
if (!process.env.token) {
console.log('Error: Specify token in environment');
process.exit(1);
}
var Botkit = require('./lib/Botkit.js');
var os = require('os');
var solver = require('./solver31.js');
var current_target = 31;
var num_number = 4;
var current_ops = ['+', '-', '*', '/', '**', '<<', '>>'];
var cur... |
'user strict';
var db = require('../modules/db');
var fs = require('fs');
var settings = require('../modules/settings');
var users = require('../modules/users');
module.exports.create = (promo_code,user_id,cb) => {
console.log('creating promo code!')
console.log('getting number of letters for new promo code');
... |
/*
* Copyright 2021 Adobe. All rights reserved.
* This file is licensed to you 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 appli... |
'use strict';
/*
Constants
*/
const SERVER_ADDRESS = window.location.hostname;
const SERVER_PORT = window.location.port;
const RUMOR_CHAT = 0;
const CHATS_TAB = document.getElementById('chats-tab');
const PEERS_TAB = document.getElementById('peers-tab');
const LEFT_PANE_LIST = document.getElementById('lef... |
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { t... |
import React, { useEffect, useState } from "react";
import "./VehicleConfigUserEntry.css";
import VehicleUserEntryFinancing from "../VehicleUserEntry/VehicleUserEntryFinancing/VehicleUserEntryFinancing";
import VehicleUserEntryLeasing from "../VehicleUserEntry/VehicleUserEntryLeasing/VehicleUserEntryLeasing";
import Ve... |
/**
* Created by Administrator on 2016/7/13.
*/
var key_title=1; //对登录注册框标题底部效果设置的状态变量
function move(i){ //点击导航栏使页面滚动,list数组存储对应位置的元素class,传入i
var list=[];
list[1]=".top";
list[2]=".introduction1";
list[3]=".help";
list[4]=".about";
var scroll_offset = $(list[i]).offset(); //得到pos... |
import path from 'path';
import async from 'async';
import cheerio from 'cheerio';
import request from 'request';
import { getPrestigeLevel, getPrestigeStars } from './utils';
import { createEndorsementSVG } from './svg';
// Get HTML from playoverwatch career page.
function getHTML(platform, region, tag, callback) {
... |
/*
* Software License Agreement (MIT License)
*
* Author: <NAME> <<EMAIL>>
*/
import { L } from './lang/lang.js';
import { sleep, escape_html, date2num, val2hex, dat2str, dat2hex, hex2dat,
read_file, download, readable_size, blob2dat } from './utils/helper.js';
import { Idb } from './utils/idb.js';
import... |
import { dragAMover, dragSize } from "./dragdrop.js";
import { config, configDesk } from "../config.js";
const style = /*css*/`
.ventana {
position: absolute;
}
.content-win{
position: relative;
}
.resizable {
position: absolute;
right: 1px;
bottom: 1px;
color: black;
font-size: xx-smal... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { createStructuredSelector } from 'reselect';
import { connect } from 'react-redux';
import Button from 'react-bootstrap/Button';
import Tabs from 'react-bootstrap/Tabs';
import Tab from 'react-bootstrap/Tab';
import { compose } from ... |
var NoteList = {
notes_path: null,
target_params: null,
target_id: 0,
target_type: null,
top_id: 0,
bottom_id: 0,
loading_more_disabled: false,
reversed: false,
init:
function(tid, tt, path) {
this.notes_path = path + ".js";
this.target_id = tid;
this.target_type = tt;
th... |
import {React, Component} from "react";
// node.js library that concatenates classes (strings)
import classnames from "classnames";
// javascipt plugin for creating charts
import Chart from "chart.js";
// react plugin used to create charts
import { Line, Bar } from "react-chartjs-2";
// reactstrap components
import {... |
// @ts-check
import isOnline from "is-online"
import _ from "lodash"
import { downloadContentfulAssets } from "./download-contentful-assets"
import { fetchContent } from "./fetch"
import {
buildEntryList,
buildForeignReferenceMap,
buildResolvableSet,
createAssetNodes,
createNodesForContentType,
makeId,
} f... |
var setAddress = function (session, name, value) {
if (typeof session.airmencert.address == 'undefined')
session.airmencert.address = {};
if (value)
session.airmencert.address[name] = value;
}
var setMedical = function (session, name, value) {
if (typeof session.airmencert.medical == 'undefined')
ses... |
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
var prefix = "$"
client.on('message', message => {
if (true) {
if (message.content === '$invite') {
messag... |
/*
* Copyright 2021-2021 Robbyxp1 @ github.com
*
* 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 l... |
import view from "./view.js"
export default class extends view {
constructor() {
super()
this.setTitle('Signer')
this.jsonFields = {}
}
getHtml() {
return `
<h2>Signer</h2>
<p>Sign an Avalon transaction and broadcast to the blockchain.</p>
... |
import { join, resolve, extname } from "path-browserify";
import json5 from "json5";
import { hasAnyPath } from "bridge-common-utils";
const defaultPackPaths = {
behaviorPack: "./BP",
resourcePack: "./RP",
skinPack: "./SP",
worldTemplate: "./WT"
};
class ProjectConfig {
constructor(basePath) {
this.basePa... |
$(function () {
$(document).ready(function () {
// Change the selector if needed
var $table = $('table.scroll'),
$bodyCells = $table.find('tbody tr:first').children(),
colWidth;
$('#datefrom').val(moment().subtract(7, 'days').format('DD/MM/YYYY'));
... |
/**
* Tencent is pleased to support the open source community by making WePY available.
* Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the Lic... |
/*
* Waltz - Enterprise Architecture
* Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project
* See README.md for more information
*
* 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 ... |
var nextKnop = document.querySelector('button.vooruit');
var backKnop = document.querySelector('button.terug')
var velgfoto1 = document.querySelector('img.foto');
var velgfoto2 = document.querySelector('img.foto2');
var velgfoto3 = document.querySelector('img.foto3');
var velgfoto4 = document.querySelector('img.foto4')... |
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(d... |
function Chart(containerId, data, interval, opts) {
function prepare(data) {
for (var i = 0; i < data.length; i++) {
if (!(data[i] instanceof Array)) {
data[i] = eval(data[i]);
}
}
if (data[0] === undefined) {
return [];
}
return data;
}
function formatTimeForXaxis(timeI... |
"use strict";
/**
* Created by kor on 08/05/15.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var ts = require("typescript");
exports.tsm = require("./tsASTMatchers");
exports.helperMethodExtractor = require("./helperMethodExtractor");
var fsUtil = require("./fsUtils");
var ts_structure_model_1 = ... |
const Discord = require('discord.js');
const translate = require('@vitalets/google-translate-api');
const Command = require('../../base/Command');
const langs = {
auto: 'Automatic',
af: 'Afrikaans',
sq: 'Albanian',
am: 'Amharic',
ar: 'Arabic',
hy: 'Armenian',
az: 'Azerbaijani',
eu: 'Basque',
be: 'Bel... |
'use strict';
/*
* Class used to respond to a received request.
*/
const tls = require('tls');
const pki = require('node-forge').pki;
const out = require('../utils/reloadTraces.js');
const NodeID = require('../Transport/messages/header/NodeID.js');
const ReloadStack = require('../Transport/stack/ReloadStack.js').Relo... |
/*
Copyright 2020 Adobe
All Rights Reserved.
NOTICE: Adobe permits you to use, modify, and distribute this file in
accordance with the terms of the Adobe license agreement accompanying
it. If you have received this file from a source other than Adobe,
then your use, modification, or distribution of it requires the pri... |
// Copyright 2019 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 in ... |
const {findPlatform, getSupportedVersion, getOfficialName, getPlatformOrder,
detectLTS, detectEA, loadLatestAssets, orderPlatforms, setRadioSelectors, setTickLink} = require('./common');
const {jvmVariant, variant} = require('./common');
const loading = document.getElementById('loading');
const errorContainer = docu... |
import React,{ useState,useEffect } from "react";
import PropTypes from "prop-types";
// @material-ui/core components
import { makeStyles,useTheme } from "@material-ui/core/styles";
import Table from "@material-ui/core/Table";
import TableHead from "@material-ui/core/TableHead";
import TableRow from "@material-ui/core... |
var RENDERER = {
RESIZE_INTERVAL : 30,
RADIUS : 25,
RATE : 0.98,
init : function(){
this.setParameters();
this.setup();
this.reconstructMethods();
this.bindEvent();
this.render();
},
setParameters : function(){
this.$window = $(window);
this.$javabox = $('#jsi-hex-container');
this.$canvas = $('... |
var express = require('express');
var cfenv = require('cfenv');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var path = require('path');
var passport = require('passport');
// var exec = require('child_process').exec;
// var favicon = require('ser... |
let currentBookId = null;
let buffer;
// updateTable();
function sendRequest(requestType, URL, data = "", sync = true,
callback = (text) =>
{
console.log(text);
updateTable();
}) {
console.log("Sending", requestType, "request at URL:", URL, "with data", data);
const ... |
import React from "react";
import PropTypes from "prop-types";
import { graphql } from "gatsby";
import styled from "styled-components";
import { MDXRenderer } from "gatsby-plugin-mdx";
import { MDXProvider } from "@mdx-js/react";
import { FONT_WEIGHT, THEME, PALETTE } from "constants/styles";
import { documentationCo... |
import React, { Component } from 'react';
import {
Image,
StatusBar,
Dimensions,
StyleSheet,
TouchableOpacity,
Text,
Slider,
View,
Animated,
ActivityIndicator,
ProgressBarAndroid,
Platform,
} from 'react-native';
import RCTIJKPlayer from './index';
var { height, width } =... |
/* global artifacts contract it assert */
const { expectRevert, expectEvent } = require('@openzeppelin/test-helpers')
const TokenSoftToken = artifacts.require('TokenSoftTokenV2')
const Proxy = artifacts.require('Proxy')
const Constants = require('../Constants')
const NO_WHITELIST = 0
contract('Whitelistable', (accoun... |
var q = require('q');
var async = require('async');
var device_curator = require('../../lib/device_curator');
var utils = require('../utils/utils');
var qExec = utils.qExec;
var ljn = require('labjack-nodejs');
var ljDevice = ljn.getDeviceRef();
var driver = ljn.driver();
var modbus_map = require('ljswitchboard-modbus... |
// ==UserScript==
// @name P2P分享by SeLang
// @namespace http://cmsv1.findmd5.com/
// @version 0.5
// @description 目标是网页右键收藏,一键打包种子,一键分享,浏览器直接查看,在线编辑发布网站。 QQ群号:455809302,点击链接加入群【油猴脚本私人定制】:https://jq.qq.com/?_wv=1027&k=45p9bea。
// @author selang
// @include /https?\:\/\/help\.baidu\.com/
// @... |
/* eslint-disable no-console */
const path = require('path');
const Commando = require('discord.js-commando');
const oneLine = require('common-tags').oneLine;
const sqlite = require('sqlite');
const {MessageEmbed} = require('discord.js');
const _ = require('lodash');
const registerAllCmds = require('./custom-reg');
co... |
"use strict";
var getContext = require('./gl-context');
/**
* Create the surface to draw onto
* @param {WebGLRenderingContext} context
* @returns {WebGLBuffer} Buffer of the surface
*/
var createBuffer = function createBuffer(context) {
var triangleVertexPositionBuffer = context.createBuffer();
context.bi... |
#!/usr/bin/env node
"use strict";
/**
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author <NAME> <<EMAIL>>
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var argparse = (0, tslib_1.__importStar)(requ... |
////////////////////////////////////////////////////////////////////////////////
// Scientific Units Grid
////////////////////////////////////////////////////////////////////////////////
var camera, scene, renderer;
var windowScale;
var cameraControls;
var clock = new THREE.Clock();
var gridX = false;
var gridY = fal... |
import BN from 'bignumber.js';
import { CACHE_MAPS, OPERATIONS_IDS } from 'echojs-lib';
import {
setFormError, setFormValue, setValue,
} from './form-actions';
import {
checkFeePool, getTransactionFee, sendTransaction,
} from './transaction-actions';
import ValidateSendHelper from '../helpers/validate-send-helper'... |
'use strict';
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
/**
* The TextMetrics object represents the measurement of a block of text with a specified style.
*
* @class
* @membe... |
//Pequeno projeto feito para estudar a implementação de matrizes de rotação
//array para conter os pontos da função que será plotada.
var nodes = [];
//pontos extremos das linhas de cada coordenada, com os nomes dos eixos.
var coord_names = ["X axis", "Y axis", "Z axis"];
var coord_nodes = [
[-300, 0, 0],
[ 30... |
import React, { Component } from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
ActivityIndicator,
Button,
} from 'react-native';
// import { NavigationContainer } from '@react-navigation/native';
// import { createStackNavigator } from '@react-navigation/stack';
import ... |
// Copyright (c) 2014-2017 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.
"use strict";
var ensure = require("./util/ensure.js");
var shim = require("./util/shim.js");
var quixote = require("./quixote.js");
var QElement = require("./q_element.js");
var QElementList = require("./q_... |
import React from 'react';
import { View, Image, PanResponder, StyleSheet, Animated, TouchableWithoutFeedback } from 'react-native';
import PropTypes from 'prop-types';
class CollageImage extends React.Component {
constructor(props) {
super(props);
this.state = {
selected: false, animating: false,
... |
function calendarExtender (theInput) {
var self = this;
this.theInput = theInput;
this.container = null;
this.theCalDiv = null;
this.selectedDate = new Date();
this.init = function () {
this.getDateFromInput();
this.createCal();
};
//update selectedDate with the date from the input, return t... |
import React from 'react';
let Helpers = {
_16color1: ["#000000", "#CD0000", "#00CD00", "#CDCD00", "#0000CD", "#CD00CD", "#00CDCD", "#E5E5E5"],
_16color2: ["#0C0C0C", "#FF0000", "#00FF00", "#FFFF00", "#0000FF", "#FF00FF", "#00FFFF", "#FFFFFF"],
isForeground: (num) => {
return [39, 30, 31, 32, 33, 3... |
// Copyright 2019 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 in ... |
// Access control logic
const $rdf = require('rdflib')
const ACL = $rdf.Namespace('http://www.w3.org/ns/auth/acl#')
const FOAF = $rdf.Namespace('http://xmlns.com/foaf/0.1/')
const VCARD = $rdf.Namespace('http://www.w3.org/2006/vcard/ns#')
let _logger
function publisherTrustedApp (kb, doc, aclDoc, modesRequired, ori... |
/**
* Copyright (c) 2015-present, Zippy Technologies
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import PropTypes from 'prop-types';
import { findDOMNode } from 'react-dom';
import Component from '@zipp... |
/*!
* issue/models/model-issue.js
* teamwork-ds (https://github.com/dstegen/teamwork-ds)
* Copyright 2021 <NAME> <<EMAIL>>
* Licensed under MIT (https://github.com/dstegen/teamwork-ds/blob/master/LICENSE)
*/
'use strict';
// Required modules
const fs = require('fs');
const path = require('path');
const { newDate... |
import { basename, dirname, extname, relative, resolve } from 'path';
import { readFile, Promise } from 'sander';
import MagicString from 'magic-string';
import { blank, keys } from './utils/object';
import Module from './Module';
import ExternalModule from './ExternalModule';
import finalisers from './finalisers/index... |
/* eslint-disable react/jsx-key */
import {Form} from 'widget/form/form'
import {RecipeFormPanel, recipeFormPanel} from 'app/home/body/process/recipeFormPanel'
import {compose} from 'compose'
import {msg} from 'translate'
import {selectFrom} from 'stateUtils'
import ClassMappingStep from './classMappingStep'
import Cla... |
//contexts
var ctx = new AudioContext();
var cv = document.getElementById('canvas').getContext("2d");
// var songInput = document.getElementById('songInput');
// var songAudio = document.getElementById('songAudio');
var audioSrc, analyzer, frequencyData, renderInterval;// = new Uint8Array(analyzer.frequencyBinCount);
... |
const i2c = require('i2c-bus');
const HTS221_ADDRESS_W = 0x5E;
const HTS221_ADDRESS_R = 0x5F;
const HTS221_ID = 0xBC;
const HTS221_WHO_AM_I = 0x0F;
const HTS221_AV_CONF = 0x10;
const HTS221_CTRL1 = 0x20;
const HTS221_CTRL2 = 0x21;
const HTS221_CTRL3 = 0x22;
const HTS221_STATUS = 0x27;
const HTS221_HUMIDITY_OUT_L = 0x2... |
var reload_seconds_for_try = {0: 1, 1: 1, 2: 2, 3: 2, 4: 3, 5: 7, 6: 7, 7: 7, 8: 7, 9: 7, 10: 30, 11: 30, 12: 60, 13: 120, 14: 120, 15: 120, 16: "STOP"}
var _reloading_class = 'loading'
var ajax_processes = []
function update_ajax_counter(){
$('#ajax_processes').html(ajax_processes.length)
}
function add_ajax(url){
... |
const test = require('tape')
const MockCrock = require('../test/MockCrock')
const helpers = require('../test/helpers')
const bindFunc = helpers.bindFunc
const isFunction = require('../core/isFunction')
const isObject = require('../core/isObject')
const isString = require('../core/isString')
const fl = require('../co... |
'use strict';
var $ = require('preconditions').singleton();
var _ = require('lodash');
var Bitcore = require('bitcore-lib');
var Mnemonic = require('bitcore-mnemonic');
var sjcl = require('sjcl');
var log = require('./log');
const async = require('async');
const Uuid = require('uuid');
var Common = require('./common... |
"use strict";
var mongoose = require('mongoose'); // MongoDB integration
var config = require("../config");
var path = require("path");
// var fs = require("fs");
// Connect to database, using credentials specified in your config module
mongoose.connect('mongodb://' +config.dbuser+ ':' +config.dbpass+
... |
//--
//-- DOM utilities - many derived from www.quirksmode.org
//--
function drawGradient(place,horiz,locolors,hicolors)
{
if(!hicolors)
hicolors = locolors;
var t;
for(t=0; t<= 100; t+=2) {
var bar = document.createElement("div");
place.appendChild(bar);
bar.style.position = "absolute";
bar.style.left = ... |
const EthereumTx = require('ethereumjs-tx').Transaction
// Example to borrow DAI (or any ERC20 token) using ETH as collateral
// from a Solidity smart contract
const Web3 = require('web3');
//const web3 = new Web3('http://127.0.0.1:8545');
const web3 = new Web3('https://kovan.infura.io/v3/d8669df2db504336a704e52a6126b... |
var Config = require('./config');
var SegmentBytesProp = "segment.bytes"
, SegmentMsProp = "segment.ms"
, SegmentJitterMsProp = "segment.jitter.ms"
, SegmentIndexBytesProp = "segment.index.bytes"
, FlushMessagesProp = "flush.messages"
, FlushMsProp = "flush.ms"
, RetentionBytesProp = "retention.bytes"
, ... |
var testConfiguration = browser.params.configuration;
var chaisePage = require('../../../utils/chaise.page.js');
var recordEditHelpers = require('../../../utils/recordedit-helpers.js');
var moment = require('moment');
var currentTimestampTime = moment().format("x");
var testParams = {
schema_name: "multi-edit",
... |
import dateFormat from "dateformat";
import {createSelector} from 'reselect'
export const reports = (state) => state.ReportsReducer.get('reports');
export const aggregateReport = (state) => state.ReportsReducer.get('aggregate_reports');
export const errorOnGetReports = (state) => state.ReportsReducer.get('error_get_re... |
/* eslint-disable new-cap, max-len, no-var, key-spacing, quotes */
"use strict";
// Initialize variables
// var $window = $(window);
var $newChat = $('#chatSound')[0];
var $messages = $('.messages'); // Message area
var $inputMessage = $('.inputMessage'); // Text area to input msg
// var $nameInput = $('.nameInput')... |
"use strict";
exports.GanttTreeList = void 0;
var _size = require("../../core/utils/size");
var _renderer = _interopRequireDefault(require("../../core/renderer"));
var _tree_list = _interopRequireDefault(require("../tree_list"));
var _position = require("../../core/utils/position");
var _type = require("../../cor... |
function PMT(interestRate, numberPeriods, loanAmount) {
var discountFactor = (Math.pow(1 + interestRate, numberPeriods) - 1) / (interestRate * Math.pow(1 + interestRate, numberPeriods));
return loanAmount / discountFactor;
}
// TODO: This function should be split and unit tested as it's critical!!!!
// TODO: This ... |
const { join } = require("path");
const sound = require("sound-play");
const mm = require("music-metadata");
const fs = require("fs-extra");
const scl = require("svcorelib");
const asciify = require("asciify-image");
const packageJson = require("./package.json");
const col = scl.colors.fg;
const cursor = require("an... |
const crypto = require("crypto");
const {
BN,
constants,
expectEvent,
expectRevert,
} = require('@openzeppelin/test-helpers')
const { min } = require('bn.js')
const { MAX_UINT256, ZERO_ADDRESS, ZERO_BYTES32 } = constants
const { expect } = require('chai')
const { default: Wallet } = require('ethereumjs-wallet')... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: 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 ("va... |
// JavaScript Document
var turnplate={
restaraunts:[], //大转盘奖品名称
colors:[], //大转盘奖品区块对应背景颜色
//fontcolors:[], //大转盘奖品区块对应文字颜色
outsideRadius:222, //大转盘外圆的半径
textRadius:165, //大转盘奖品位置距离圆心的距离
insideRadius:65, //大转盘内圆的半径
startAngle:0, //开始角度
bRotate:false //false:停止;ture:旋... |
import React, {useEffect, useMemo, useRef, useState} from 'react';
import {Breadcrumb, Card, Image, message, Modal, Popconfirm, Progress} from "antd";
import ProTable from '@ant-design/pro-table';
import {formatSize, post, request, translate, waitTime} from "../utils/utils";
import dayjs from "dayjs";
import i18n from ... |
/* global L */
var queue = require('d3-queue').queue;
var cacheBusterDate = +new Date();
// leaflet-image
module.exports = function leafletImage(map, callback) {
var hasMapbox = !!L.mapbox;
var dimensions = map.getSize(),
layerQueue = new queue(1);
var canvas = document.createElement('canvas')... |
'use strict';
// Other extensions (e.g. ebates) can load other versions of jQuery. We need to use ours in noconflict mode
// or we lose bootstrapSwitch() which then breaks the options page.
// For more info, see here: https://github.com/toolkit-for-ynab/toolkit-for-ynab/issues/287
var jq = jQuery.noConflict(true);
/*... |
function saveNotify(checkIsExist){
var commitInfo={},saveIsOk=false,saveKey;
if(checktSaveInfo()){
saveIsOk=true;
}
if(checkIsExist && saveIsOk){
checkUpNotifyStgy_RestfulClient(saveKey,commitInfo);
}else if(saveIsOk){
updateNotify_RestfulClient(commitInfo);
}
function checktSaveInfo(){
$("#... |
/*
@license
MIT License
Copyright (c) 2019 Editor.js
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, merge, pub... |
import fetch from "node-fetch"
import Cheerio from "cheerio"
// import { q, l } from './ELC'
const scrape = (e) => {
if (e) e.preventDefault()
return new Promise(async function(resolve, reject) {
// Get html from IGN first by calling the Netlify fetchPastCORS function.
const IGNScrape =... |
'use strict';
function rKBulletinCapitaliseFirstLetter(string)
{
return string.charAt(0).toUpperCase() + string.substring(1);
}
/**
* Initialise the quick navigation form in list views.
*/
function rKBulletinInitQuickNavigation()
{
var quickNavForm;
var objectType;
if (jQuery('.rkbulletinmodule-qui... |
// Requirements
var twit = require('twit')
var http = require('http')
var username = process.env.TWITTERBOT_USERNAME
var language = process.env.TWITTERBOT_LANGUAGE
var debug = process.env.TWITTERBOT_DEBUG || false
//
var retweetQuery = process.env.TWITTERBOT_RETWEET_QUERY || ''
var retweetInterval = parseInt(process.... |
const authorizationRequestCreatedEventBody = {
actorId: 'patrick',
actorName: '<NAME>',
granteeType: 'USER',
granteeEmail: '<EMAIL>',
granteeId: 'patrick',
granteeName: '<NAME>',
resourceId: 'use-case-discvoerable',
resourceName: 'use-case-discvoerable',
resourceOwner: 'use-case-org',
resourceOwnerN... |
// Radial "lines" are sent out at angles [0, dt, 2dt, ..., (T-1)*dt].
var T = 90;
var dt = 2 * Math.PI / T;
// Each "line" is composed of numsegs segments. Each successive segment vertex is drawn at coordinates [x,y] chosen uniformly at random from [segrangex, segrangey] (relative to the previous segment vertex). ... |
import React from 'react';
import styled from 'styled-components';
import Header from '../Shared/Header/Header';
import { Relational } from '../Assets/Assets';
import { flexContainer } from '../../utils/mixins';
const StyledRelational = styled(Relational)`
height: 150px;
width: 5rem;
`;
const Section = styled.s... |
import React, { Component } from 'react'
// import { compose, graphql } from 'react-apollo'
// import gql from 'graphql-tag'
import { notification } from 'antd'
import { message } from '../../utils/message'
import ChecklistRequest from '../../views/Checklist/ChecklistRequest'
const searchParams = params =>
Object.... |
const VARIANT = 7, // <NAME>
WIDTH = 4000, // meters
HEIGHT = 4000,
STEP = 100,
INITIAL_FIREPLACE = [-100, -100, 100, 100], // (x;y) from -> (x;y) to
SIMULATION_SPEED = 40000; // number of milliseconds to simulate an hour
const TREES = { type: 0, price: 500, class: "forest" },
FIRE ... |
// *****************************************************************************
// Notices:
//
// Copyright � 2019 United States Government as represented by the Administrator
// of the National Aeronautics and Space Administration. All Rights Reserved.
//
// Disclaimers
//
// No Warranty: THE SUBJECT SOFTWARE IS PRO... |
'use strict';
const sinon = require('sinon');
const chai = require('chai');
const sinonChai = require('sinon-chai');
chai.use(sinonChai);
const expect = chai.expect;
const timer = require('../index').timer;
const FakeTick = function (diffToReturn) {
this.getDiff = function () {
return diffToReturn;
... |
// =================================================Set constant variables for server use
const portNum = 3000; // Note: this must be unique on the server this app is hosted on
const maxNumOfRooms = 8;
const maxPlayers = 7;
const minPlayers = 5;
var questionsDeck = "q.csv";
var answersDeck = "a.csv";
var app = requir... |
'use strict';
let tableData=new Array();
let tempArray=new Array();
let maxLen=0;
var dataTosend;
(function () {
$(document).ready(function () {
// Initialises Tableau Data Extension
tableau.extensions.initializeAsync().then(function () {
// Once we initialize we call teh drawChartJS function.
d... |
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); y... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.