text stringlengths 7 3.69M |
|---|
import React from 'react';
import styles from './styles.module.css';
import Modal from '../../elements/Modal';
import Button from '../../elements/Button';
export default function ModalSuccess(props) {
const { onClose, open, message, action } = props;
return (
<Modal onClose={onClose} open={open}>
<sect... |
var CaseManager = require("./common/CaseManager");
var CcdFields = require("./common/ccdFields");
var BrowserWaits = require('../../support/customWaits');
class IACCase {
constructor() {
this.caseManager = new CaseManager();
this.ccdField = new CcdFields();
this.continueBtn = element(by.... |
import { getElement } from '../utils.js';
import display from '../displayProducts.js';
const setupSearch = (store) => {
const form = getElement('.input-form')
const name = getElement('.search-input')
form.addEventListener('keyup',()=>{
const value = name.value;
if(value){
let newStore = store.filter((product)... |
/*
al presionar el botón mostrar 10 repeticiones con números ASCENDENTE, desde el 1 al 10.
*/
function mostrar()
{
var i;
for(i = 0; i < 10 ; i++){
document.write(i + "<br>");
}
} |
class MAttribute{
constructor(){
this.whole = true;
this.fraction = false;
this.decimal = false;
this.degree = false;
this.negative = false;
};
};
|
import Component from '@glimmer/component';
import debugLogger from 'ember-debug-logger';
import { action } from '@ember/object';
import { htmlSafe } from '@ember/template';
import { supportsPassiveEventListeners } from 'twyr-dsl/utils/browser-features';
import { tracked } from '@glimmer/tracking';
export default cla... |
var app = app || {};
// The Application
// Our overall **AppView** is the top-level piece of UI
app.AppView = Backbone.View.extend({
el: '#todoapp',
events: {
'keypress #new-todo': 'createOnEnter',
'click #toggle-all': 'toggleAllToComplete'
},
initialize: function(){
var todos = app.Todos
todos.fetch({... |
import { Layout } from "antd";
import React, { Component } from "react";
import "./style.css";
export default class Header extends Component {
render() {
return (
<Layout.Header className="header">
<img alt="logo" src="/static/img/logo.jpg" />
<span>weekendfuelbag</span>
</Layout.Head... |
var cadastroAluno;
var cadastroFuncionario;
var cadastroAgenda;
var cadastroAtividadeExtraCurricular;
var cadastroCaracteristicaSaude;
var cadastroCargoFuncionario;
var cadastroCronograma;
var cadastroGrauEscolar;
var cadastroItensDeCronograma;
var cadastroItensPorCronograma;
var cadastroMatricula;
var cadastroPeriodo;... |
export default function Jobs() {
let jobs = [];
let handlers = [];
this.add = function (handler, timeout) {
handlers.push(
{
handler: handler,
timeout: timeout
}
);
}
this.run = function () {
for (let i = 0; i < handl... |
import Component from '@glimmer/component';
import debugLogger from 'ember-debug-logger';
export default class TwyrCardTitleComponent extends Component {
// #region Private Attributes
debug = debugLogger('twyr-card-title');
// #endregion
// #region Yielded Sub-components
subComponents = {
'media': 'twyr-card/t... |
/* @flow */
/* **********************************************************
* File: types/functionTypes.js
*
* Brief: Types for functions
*
* Authors: Craig Cheney
*
* 2017.09.10 CC - Document created
*
********************************************************* */
/* Return type of a redux-thunk */
export type thunkType ... |
function TreeNode(val) {
this.val = val;
this.left = this.right = null;
};
function sortedArrayToBST(nums) {
return sortedArrayToBSTRecursive(nums, 0, nums.length);
};
function sortedArrayToBSTRecursive(nums, startIndex, length) {
// Base case
if (length === 1) {
return new TreeNode(nums[start... |
const db = require("../models");
const MalwareURL = db.DevDB.malware;
const Op = db.DevDB.Sequelize.Op;
const { validationResult } = require('express-validator');
/**
*
* @param {Object} req
* @param {Object} res
* @returns create a new records in the database and returns a responed
*/
exports.create = (req,... |
class Component extends HTMLElement {
constructor(props) {
super();
this._innerHtml = props._innerHtml;
this._type = props._type || "anon";
this.attachShadow({ mode: "open" });
this.__attachContent();
}
__attachContent = () => {
this.shadowRoot.innerHTML = this._innerHtml;
};
}
export ... |
import React from 'react'
import Showtime from './Showtime.js'
import $ from 'jquery'
var imageURL, vote_average;
var Listing = React.createClass({
getInitialState: function() {
return ({imageURL: ''});
},
componentDidMount: function() {
var movieDBURL = 'https://api.themoviedb.org/3/search/... |
var $grid = $('.row').isotope({
// options
itemSelector: '.col-md-4',
layoutMode: 'fitRows'
});
$('.filter button').on("click",function(){
var value = $(this).attr('data-name');
$grid.isotope({
filter:value
})
})
|
import Ember from 'ember';
export function dollarFormat(params, namedArgs) {
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
minimumFractionDigits: 2,
});
return formatter.format(params[0]);
}
export default Ember.Helper.helper(dollarFormat); |
import Api from '@/services/Api'
export default {
allquizzes(auth) {
return Api().get('allquizzes', auth)
},
questions(quiz,auth) {
return Api().get(`questions/${quiz}`, auth)
},
takequiz(candidate,quiz,auth){
return Api().get(`takequiz/${candidate}/${quiz}`,auth)
},
... |
require('dotenv').config()
const fs = require('fs');
const exec = require('child_process').exec;
const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const app = express();
const { createEventAdapter } = require('@slack/events-api');
const slackSigningSecre... |
import app from '../../src/app';
import chai from 'chai';
import request from 'supertest';
import Bluebird from 'bluebird';
import { loadFixtures, createAuthorization } from '../helpers';
import {
TOKEN,
MODERATOR,
ADMINISTRATOR,
HIERARCHY,
AUTH_NAMES
} from '../../src/auth/constants';
chai.should();
functi... |
import styled from "styled-components";
export const Ranking = styled.section`
height: 700px;
margin-bottom: var(--marginbottom);
`;
export const More = styled.div`
width: 100%;
height:55px;
text-align: right;
border-top: 1px solid var(--corborda);
padding:.8rem;
a {
color: #9f... |
import React, {Component} from "react";
import Child from "./Child";
class ComponentLifecycle extends Component{
constructor(props) {
super(props);
console.log("Demo3.Parent: execute constructor");
this.state = {
msg: 'this is parent component.'
};
}
static g... |
import React from 'react';
import ReactDOM from 'react-dom';
import AutoSuggest from './Autosuggest';
const suggestions = ['C', 'C++', 'Python', 'Java', 'Javascript', 'PHP'];
const handleSelect = selection => alert(`You selected ${selection}`);
ReactDOM.render(<AutoSuggest suggestions={suggestions} onSelect={handleS... |
const webpack = require('webpack')
const path = require('path')
const pkg = require('./package.json')
const compress = require('compression')
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const year = new Date().getFullYear()
const cont... |
// This [js] object folds an incoming midi-note to a range set within lowOctave and highOctave
// For Example is lowOctave = 3, and highOctave = 5 and a note of octave 1 comes in, it is folded to octave 5
// An incoming octave of 0 is folded to 6, which is then folded to 4
inlets = 1;
outlets = 1;
var lowOctave = 0;
... |
import React, { Component } from 'react';
import Projects from './Projects';
import AboutMe from './AboutMe';
import Navbar from './NavBar';
import Info from './info';
import Photos from './Photos';
import '../style/style.css';
// Main component which displays content.
class Main extends Component {
state = {
s... |
import _ from 'lodash';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { ListView, View, Text } from 'react-native';
import { employeesFetch, loginUser } from '../actions';
import AvailableListItem from './AvailableListItem';
import { Button, CardSection } from './common';
clas... |
/*
* ecommerceTaskDetailController.js
*
* Copyright (c) 2017 HEB
* All rights reserved.
*
* This software is the confidential and proprietary information
* of HEB.
*/
'use strict';
/**
* Component of eCommerce task summary. Used to fetch and display list of eCommerce task only. This component does no... |
import * as fc from 'fast-check';
const alphaNumericString = fc.asciiString({ minLength: 1 }).map((str) => str.replace(/[^a-zA-Z0-9]/g, 'a'));
export default alphaNumericString;
|
'use strict';
const pkg = require( '../../package' );
const _Config=require('../../utils/config')( pkg.name ).load(require('../../config/app'),{});
const Config = require( '../../utils/config' )( pkg.name ).current;
const mongojs = require( '../../utils/mongojs' );
const collection = mongojs( Config().services.db.mon... |
var DoublyLinkedList = function() {
var list = {};
var Node = function(value) {
node = {};
node.value = value;
return node;
}
list.head = null;
list.tail = null;
list.addToHead = function(value) {
var newNode = Node(value);
newNode.previous = null;
if (list.head === null) {
... |
(function ($p) {
var routePrefix = $p.baseUrl + '/venues';
$p.venueService = {
getByVenueId: function (venueId) {
return $p.httpGet(routePrefix + '/' + venueId);
}
};
})($paramount) |
define(['views/index', 'views/register', 'views/login',
'views/forgotpassword', 'views/profile', 'views/contact/contacts',
'views/contact/addcontact','views/invitation/invitations', 'models/Account',
'models/PostsCollection',
'models/ContactCollection','models/InvitationCollection','mode... |
const geoJsonSimple = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"gid": "20",
"name": "gfbfgbfgb",
"videosrc": "xvbxcvb",
"addtime": "2021-01-13 12:50:33",
"id": "6",
"calarea": "0"
},
"geometry": {
"type": "Point",
... |
$('.multiple-items').slick({
infinite: true,
slidesToShow: 3,
speed: 300,
slidesToScroll: 3,
autoplaySpeed :300,
draggable: true,
autoplay: true, /* this is the new line */
autoplaySpeed: 2000,
touchThreshold: 1000,
dots: false,
prevArrow: false,
nextArrow: false
});
... |
// The config for the webserver
module.exports = {
// [string] The URL the webserver is hosted on (e.g. https://webhooks.example.com/)
// The base MUST END WITH A SLASH
base: ""
}; |
(function(){
'use strict';
angular
.module('everycent.setup.institutions')
.factory('InstitutionsService', InstitutionsService);
InstitutionsService.$inject = ['$http', 'Restangular'];
function InstitutionsService($http, Restangular){
var service = {
getInstitutions: getInstitutions,... |
import React from 'react'
import './login-btn.sass'
export default class LoginBtn extends React.Component {
render() {
return(
<button
type="button"
class="login-btn"
onClick={ this.props.loggedIn ? this.props.logout : this.props._toggleSignInBox }
>
{ this.props.logg... |
import { call, put, takeEvery } from 'redux-saga/effects';
import HttpHelper from '../../utils/http-helper';
import { recentActivityUrl } from '../../utils/urls';
import { RECENT_ACTIVITY_REQUEST } from './dashboard-constants';
import {
recentActivitySuccess,
recentActivityFailure,
} from './recent-activity-actio... |
export default class UpdateMenuAddOnUseCase {
constructor({database, logger, config}) {
this.config = config;
this.menuAddOnDao = database.menuAddOnDao();
this.logger = logger;
}
async execute(param) {
return await this.menuAddOnDao.updateMenuAddOn(param.id, param.data)
}
}
|
/**
* 对两个不定长的数组进行相加
* 给 [1,2,3] [4,2] 返回 [1,6,5]
*/
function add(arr1, arr2) {
const arr = arr1.length > arr2.length ? arr2 : arr1;
const arr3 = arr1.length > arr2.length ? arr1 : arr2;
const result = [];
while (arr.length) {
const a = arr.pop();
const b = arr3.pop();
const res = a + b;
resul... |
function solve(input){
let heroes = [];
for (let i = 0; i < input.length; i++) {
let tokens = input[i].split(' / ');
let heroName = tokens[0];
let level = Number(tokens[1]);
let items = tokens.slice(2)[0].split(', ');
heroes.push({Hero: heroName, level, i... |
// 'data-height': 400,
// 'data-theme-id': 0,
// 'data-default-tab': 'result',
// 'data-slug-hash': 'amgpKB',
// 'data-pen-title': 'Codepen',
// 'data-user': 'robert77',
// 'placeholder': 'Unable to load Codepen',
// 'data-border' : '',
// 'data-border-color': '',
// 'data-link-logo-color': ''
// data-tab-bar-color
// ... |
/* global define, Promise */
'use strict';
define([
'lodash',
'lru-cache',
'immutable',
'url-parse',
'rethinkdb',
'-/logger/index.js'
], (_, lru, { Map }, parse, r, logger) => {
let feeds = Map({});
const max = !_.isNaN(parseInt(process.env.MVP_STORE_LRU_MAXSIZE, 10))
? parseInt(process.env.MVP_STORE_LRU_MA... |
X.define('modules.credit.creditDetail', ['model.creditModel', 'data.currencyEntireData', 'data.countryData'], function(model, currencyData, countryData) {
var view = X.view.newOne({
el: $(".xbn-content"),
url: X.config.credit.tpl.creditDetail
})
var ctrl = X.controller.newOne({
view: v... |
// @flow
import React, { Component } from 'react';
type APropsType = {};
class A extends Component<APropsType> {
render() {
return <h2>A</h2>;
}
}
export default A;
|
const express= require ("express");
const router= express.Router();
const registerController= require ("../controllers/registerController.js")
router.get ("/", registerController.entrarRegister);
module.exports = router; |
import React from 'react'
import { StyleSheet } from 'quantum'
const styles = StyleSheet.create({
self: {
display: 'flex',
flexDirection: 'row',
width: '100%',
'& strong': {
color: '#000000',
flexBasis: '40px',
display: 'inline-flex',
flexShrink: 0,
},
'& span': {
... |
import { lang, MTURK } from '../config/main'
import { getUserId, getTurkUniqueId } from '../lib/utils'
import { baseStimulus } from '../lib/markup/stimuli'
const userId = () => {
if (MTURK) {
return {
type: 'html_keyboard_response',
stimulus: baseStimulus(`<h1>${lang.userid.set}</h1>`, true),
r... |
'use strict'
class DeviceFeed {
get rules () {
return {
// validation rules
data: 'required|databodyExists'
}
}
get validateAll () {
return true
}
get messages () {
return {
'data.required': 'You must provide a data array.',
'data.databodyExists': 'You must provide a... |
import { isArray } from 'lodash'
import {buildUrl} from '../url-utils'
export const transformFromApi = (data, transformFunc) => {
let ret = data
if (data) {
if (isArray(data.content)) {
data = data.content
}
// cette partie supporte deux types de retour, soit un retour sous forme d'array d'entit... |
import Component from '@glimmer/component';
import debugLogger from 'ember-debug-logger';
import { action } from '@ember/object';
import { htmlSafe } from '@ember/template';
import { tracked } from '@glimmer/tracking';
export default class TwyrTabsTabComponent extends Component {
// #region Private Attributes
debug... |
import gen from '../helpers/idGenerator'
export default {
Query: {
categories: (root,args,{models})=>{
return models.Category.findAll()
}
},
Category:{
news: (category)=>{
return category.getNews()
}
},
Mutation: {
addCategory: async (root,args,{models})=>{
const newCa... |
class UserLst {
constructor(total, userLst) {
this.total = total;
this.userLst = userLst;
}
applyData(json) {
Object.assign(this, json);
}
}
module.exports = UserLst;
|
// Values and Sum
var testArr = [6, 3, 5, 1, 2, 4];
var sum = 0;
for (var i = 0; i < testArr.length; i++) {
console.log("Num: " + testArr[i]);
sum = sum + testArr[i];
console.log("Sum: " + sum);
}
// Value and Position
var testArr = [6, 3, 5, 1, 2, 4];
for (var i = 0; i < testArr.length; i++) {
conso... |
// Build a function that takes two parameters (two binary trees data structures) and validate they are twins
// If they are twins then return true, else return false
const sameTree = (tree1, tree2) => {
// Code here
}
module.exports = sameTree
|
import React from 'react'
import './Sidebar.css'
// React icons
import { AiFillHome } from 'react-icons/ai';
import { FaBox } from 'react-icons/fa';
import { GiMagnifyingGlass } from 'react-icons/gi';
import { MdPermContactCalendar } from 'react-icons/md';
import { FaUsers } from 'react-icons/fa';
import { AiOutlineTr... |
module.exports = {
jwtSecret: process.env.JWT_SECRET || '27ddee8d-6c5a-4dae-ba1d-b91bfe67fcb9'
}; |
const yargs = require('yargs')
const notes = require('./utilitis.js')
const pieces = require('./mongodb.js')
yargs.command({
command:'search',
description:'Searching Subject',
builder:{
search:{
describe: 'Searching on Web',
demandOption:true,
type:'st... |
import {Component} from "react";
import { Card, Col, Form, Row} from "react-bootstrap";
class Payment extends Component{
state = {
amount : 1000
}
componentDidMount = () => {
if(sessionStorage.token) {
this.setState({amount:0});
}
}
render() {
return(
... |
function capturar(){
//uso del archivo JS
//console.log("Capturar")
function Persona(nombre,edad){
this.nombre = nombre;
this.edad = edad;
}
var nombreCapturar = document.getElementById("nombre").value;
// testeamos la captura de lña primer variable
// console.log(nombreCaptura);
var edadCaptu... |
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
count: 5,
currentIndex: 0,
items: [],
animationData: {},
images: [
'https://lg-7d7cxgzy-1251232205.cos.ap-shanghai.myqcloud.com/0.jpg',
'https://lg-7d7cxgzy-1251232205.cos.ap-shanghai.myqcloud.com/1.jpg'
]
},
onShareAppMe... |
/* eslint-disable quotes */
const { connect, disconnect } = require("mongoose");
const { dbUrl, options } = require("./options");
const connectToDB = () => connect(dbUrl, options);
const disconnectDB = () => disconnect();
module.exports = { connectToDB, disconnectDB };
|
import React from "react"
import ReactDOM from "react-dom"
import App from "./App"
import Child from "./Child"
import { isChild } from "./utils"
if (!isChild()) {
ReactDOM.render(<App />, document.getElementById("root"))
} else {
ReactDOM.render(<Child />, document.getElementById("root"))
}
|
import React, { Component } from 'react';
/**
* @extends {Component}
*/
class Arrow extends Component {
constructor(props) {
super(props);
}
render() {
return (
<defs>
<marker id="end-arrow" viewBox="0 -5 10 10" strokeWidth="1px" refX="32" markerWidth="3.5" markerHeight="3.5" orient="auto">
<path xm... |
var EvalEnv = require('../evalEnv.js');
var util = require('../util.js');
var assert = require('assert');
var HashDB = require('../hashDB.js');
var DummyKVS = require('../keyvalue.js');
describe('EvalEnv', function(){
var hashDB;
var kvs;
beforeEach(function() {
kvs = new DummyKVS();
hashDB = new HashDB(... |
'use strict';
window.Resources = (function(){
/**
* All of the resources loaded into the system
*
* @type Array
*/
var data = [];
/**
* Gets a specific resource for the user.
*
* @param string key The key to look for
* @param object repla... |
export class ScalingMath {
//linear scaling of knob position in degrees, 0 being straight up; 'amp' represents amplitude
linScale(knobPosition, amp){
return this.scaleRound(amp*(knobPosition + 150)/300, amp);
}
revLinScale(paramval, amp) {
return this.scaleRound(300/amp*paramval - 150, amp);
}
expScale(kn... |
module.exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions
let { data } = await graphql(`
query {
allMarkdownRemark {
edges {
node {
fields {
slug
... |
/**Query database every 24hours and notify user if time is up to returned borrowed books */
let path = require('path');
const tempdir = path.join(__dirname, './template/reminder.ejs');
const sendEmail = require('./sendMail').sendEmail;
const Borrowed = require('../models').Borrowed;
const User = require('../models').Us... |
import Vue from 'vue'
import Router from 'vue-router'
import Register from '@/components/Register'
import Login from '@/components/Login'
import Vote from '@/components/Vote'
import RequestService from '../services/RequestService'
Vue.use(Router)
const router = new Router({
routes: [
{
path: '/',
re... |
/**
* window.c.projectReportNoRewardReceived component
* Render project report form
*
*/
import m from 'mithril';
import prop from 'mithril/stream';
import h from '../h';
import _ from 'underscore';
import ownerMessageContent from './owner-message-content';
import modalBox from './modal-box';
const projectReportNo... |
import React, { Component} from 'react';
import HoleTriangle from './holes/HoleTriangle';
import HoleSquare from './holes/HoleSquare';
import HoleCircle from './holes/HoleCircle';
class HolePanel extends Component {
render() {
return (
<div style={styles.panelStyle}>
<HoleTriangle />
<HoleCircle />
... |
import { hostname, tokenHeader } from '../../config/settings'
import { port } from '../../config/constants'
import makeRequest from './makeRequest'
const get = (endpoint) => {
console.log(endpoint)
let options = {
hostname,
port,
method: 'GET',
path: endpoint,
headers: {}
}
if (tokenHeader... |
import Toolbar from './Toolbar'
export {
Toolbar,
}
|
import 'bootstrap';
import {DataCache} from 'dataCache';
import {Plugin1} from 'Plugin1';
import {Plugin2} from 'Plugin2';
export function configure(aurelia) {
let cache = new DataCache();
cache.data.push('1');
cache.data.push('2');
cache.data.push('3');
aurelia.use.instance("apiRoot", "http://bri... |
import { Group } from 'models/models'
class GroupRepository {
getGroupsWithCriteria = search => {
return Group.find(search, '_id name pictureUrl owner moderators')
.populate('owner moderators', '_id info.fullName info.link')
.lean()
}
}
export default GroupRepository
|
(function(){
let customers = [];
let index = 0;
function Customer(id,name,text){
this.id = id;
this.name = name;
this.text = text;
}
function createCustomer(id,name,text){
let fullImg = `img/customer-${id}.jpg`;
const customer = new Customer(fullImg,name,tex... |
/* ************************************************************
title : Scroll Bar ver 0.01
date : 2016.12
author : Heowongeun
************************************************************ */
var DragAndDrop = require('./DragAndDrop');
var Bind = require('../util/Bind');
var windowSize = require('../util/Wind... |
"use strict";
const bench = require("./src/index");
const AlminVersions = {
current: require("./almin-current"),
"0.12": require("./almin-0.12"),
"0.9": require("./almin-0.9")
};
bench(AlminVersions, benchmark => {
console.log(benchmark.join("\n"));
console.log("Fastest is " + benchmark.filter("fast... |
/**
* 图片墙
*
* @param imgs 图片的src 数组
* @param container 放置图片的容器
* @param containerWidth 容器的宽度
* @param rowHeight 行的高度
*/
function imagewall(imgs, container, containerWidth, rowHeight) {
calcImageSizes(imgs).done(function(sizes) {
var newSizes = resizeTo(sizes, rowHeight);
var rows = toRows(newSiz... |
// crossbrowser event adding
function addEvent(event, func) {
if (window.addEventListener) window.addEventListener(event, func, false);
else if (window.attachEvent) window.attachEvent('on' + event, func);
};
// detect if element is a link
function isLink(element) {
if (element.tagName === 'A') return true;
r... |
import { expect, sinon } from '../test-helper'
import mailJet from '../../src/infrastructure/mailing/mailjet'
import NotifyTheme from '../../src/use_cases/notify-theme'
describe('Unit | Service | NotifyTheme', () => {
const theme = {
previousTheme: 'new',
newTheme: 'dark',
}
beforeEach(() => {
sino... |
export class WeatherData{
constructor(cityName, description,humidity){
this.cityName = cityName;
this.description = description;
this.temperature = '';
this.humidity = humidity;
}
}
export const WeatherProxyHandler = {
get: function(target, property){
return Reflect.get(target,property);
},... |
Accounts.config({sendVerificationEmail: true, restrictCreationByEmailDomain: 'zenbanx.com'}); |
'use strict';
/**
* Module dependencies.
*/
const Koa = require('koa');
const request = require('supertest');
const requestId = require('..');
/**
* Uuid regex.
*/
const uuid = /^[a-f0-9]{8}-[a-f0-9]{4}/;
/**
* Test `koa-requestid`.
*/
describe('koa-requestid', () => {
let app;
let server;
beforeEach... |
/* Project Euler: Problem 1
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000. */
var i = 0;
var multiplesArray = [];
while(i<1000){
if(i%3 === 0 || i%5 === 0){
mul... |
const CronJob = require('cron').CronJob;
const Console = require('./Console');
const tradeManager = require('./TradeManager');
var browserManager;
const everyMinute = new CronJob('* * * * *', async () => {
let minute = new Date().getMinutes();
let trades = tradeManager.getTradesByMinute(minute % 15);
... |
(function(){
angular.module('QforQuants')
.factory('userRoleService',function($http,$q){
var modelName = 'userrole';
var apiUrl = '/api/userrole';
var getAll = function(){
var defered = $q.defer();
$http({
method : 'GET',
url : modelName + apiUrl
}).success(function(res... |
import React from 'react'
import { Title } from '../Title'
import { ResumeWrapper, ResumeContent, ResumeItem, ResumeTitle, ResumeValue } from './style'
function Resume({ data, children }) {
const { subTotal, total, shippingTotal, discount } = data;
return (
<ResumeWrapper>
<Title> Resumo do pedido </T... |
var setZeroes = function(matrix) {
if (matrix == null || matrix.length == 0 || matrix[0].length == 0)
return;
m = matrix.lenght, n = matrix[0].length;
var rowZero = false, colZero = false;
for (let j = 0; j < n; ++j) {
if (matrix[0][j] == 0) {
rowZero = true;
... |
!function () {
'use strict';
function Controller($scope, dataService, $location, info) {
$scope.target = {};
$scope.status = info.ContractStatus;
dataService.contract
.query({maxCount: 5, showLatest: true}).$promise
.then(function (response) {
... |
function sumar() {
var num1 = parseInt(document.getElementById('a').value);
var num2 = parseInt(document.getElementById('b').value);
var suma =num1 + num2;
alert('La suma es: '+ suma);
}
function restar() {
var num1 = parseInt(document.getElementById('a').value);
var num2 = parseInt(document.... |
import React from 'react';
import {Button,Checkbox,Select,Radio,Switch,Form,Row,Col,Icon,Modal,Input,InputNumber,Cascader,Tooltip } from 'antd';
const FormItem = Form.Item;
const RadioGroup = Radio.Group;
const Option = Select.Option;
import {FetchUtil} from '../../utils/fetchUtil';
import {trim} from '../../utils/va... |
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(chuck) {
process.stdout.write('Data entered: ' + chuck);
});
process.stdin.on('end', function() {
process.stderr.write('Stream end.\n');
});
process.on('SIGTERM', function() {
process.stderr.write("Terminating pr... |
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkID=397704
// To debug code on page load in Ripple or on Android devices/emulators: launch your app, set breakpoints,
// and then run "window.location.reload()" in the JavaScript Console.
(function () ... |
/**
* Created by root on 15.06.17.
*/
function initMap() {
var latitude = 59.990147,
longitude = 30.159004,
map_zoom = 15;
var style = [{
featureType: 'all',
stylers: [
{saturation: 0}]
}, {
featureType: 'water',
skylers: [
{saturatio... |
const methodHandlers = {}
const requestHandlers = []
const registerMethodHandler = (method, handler) => {
methodHandlers[method] = handler
}
const registerRequestHandler = (requestHandler) => {
requestHandlers.push(requestHandler)
}
const parseBody = (req, callback) => {
const chunks = []
req.on('data', (ch... |
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable jsx-a11y/alt-text */
import React, { Component } from 'react';
import './Project.css'
export default class Project5 extends Component {
render () {
const props = this.props
return (
<div c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.