text stringlengths 7 3.69M |
|---|
var cesar = cesar || (function(){
var proceso = function(txt, desp, action){
var remplazo = (function(){
var abc = ['a','b','c','d','e','f','g','h','i','j',
'k','l','m','n','o','p','q','r','s','t',
'u','v','w','x','y','z'];
var l = abc... |
/*
* Copyright (C) 2012-2013 DFKI GmbH
* Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
* German Research Center for Artificial Intelligence
* http://www.dfki.de
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentati... |
var tokki = angular.module("tokkiFilters").filter('despacho', function() {
return function(input){
switch(input) {
case 0:
case "0":
return 'Despacho Interno';
break;
case 1:
case "1":
return 'Despacho por Receptor';
break;
case 2:
case "2":... |
// JavaScript - Node v8.1.3
var arr = [1, 2];
swapValues(arr);
Test.assertEquals(arr[0], 2, 'Failed swapping numbers');
Test.assertEquals(arr[1], 1, 'Failed swapping numbers');
|
'use strict';
var $ = require('jquery');
var _ = require('underscore');
var Backbone = require('backbone');
var AppModel = require('../../models/appModel');
var AppRouter = require('../../routers/appRouter');
var App = Backbone.View.extend({
model: null,
loaded: 0,
loading:0,
preloadBar: null,
initialize:... |
$(document).ready(function() {
var selected_dates = [];
// gets all the events from the database using AJAX
selected_dates = getSelectedDates();
$('#datepicker').datepicker({
inline: true,
dateFormat: 'dd-mm-yy',
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
befo... |
import React, { AppRegistry,
Component
} from 'react-native';
import LoginPage from '../components/LoginPage';
export default class App extends Component {
render() {
return (
<LoginPage />
);
}
}
|
/**
* Created by xuwusheng on 15/12/18.
*/
define(['../../../app'], function (app) {
app.factory('tackGoodsDifference', ['$http','$q','$filter','HOST',function ($http,$q,$filter,HOST) {
return {
getThead: function () {
return [
{name:'序号',type:'pl4GridCount'... |
const mongoose = require('mongoose')
const schema = new mongoose.Schema({
name: { type: String },//名称
spec: { type: String },//规格
avatar: { type: String },//头像
banner: { type: String },
categories: [{ type: mongoose.SchemaTypes.ObjectId, ref: 'GoodsCategory' }],//关联分类
//评分
scores: {
... |
alert("hola");
alert("hola2");
//este es un archivo de prueba 2
//prueba 2 jjjjjj kkkk jjjjj |
$(document).ready(function () {
$("#wizard").steps();
$("#form").steps({
labels: {
current: "current step:",
pagination: "Pagination",
finish: "Kaydet",
next: "İleri",
previous: "Geri",
loading: "Yükleniyor.."
},
... |
/**
* Created by xiaojiu on 2017/4/24.
*/
define(['../../../app'], function (app) {
app.factory('thirdPartyFreightPay', ['$http','$q','$filter','HOST',function ($http,$q,$filter,HOST) {
return {
getThead: function () {
return [
{name:'序号',type:'pl4GridCount'... |
const Appacitive = require('appacitive');
const promise = Appacitive.initialize({
apikey: "MEk6aMTDtliwwwQvQgT7GXNS+Ak8P7FI6Q/pqYTpgVY=",
env: "sandbox",
appId: "168002687610258053"
});
/* function contractUserObject(userData){
let user = {};
user.username = userData.username;
user.password = u... |
$(document).ready(function(){
$(".burger").click(function(){
$(".menu_list").css({
"margin-top": "15px",
"background-color": "rgb(134,128,135)"
}).toggle();
$("li a").css({
"padding-right": "60px",
});
});
$(".left_img").mouseenter(f... |
import { LoadingOutlined } from '@ant-design/icons';
import React, { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { useParams } from 'react-router';
import { toast } from 'react-toastify';
import { getLeague } from '../../../api/league';
import { createTeam, getTeams, removeTeam... |
import React from 'react';
import { PropTypes as T } from 'prop-types';
import styled from 'styled-components';
import { getTarget } from '../../../../utils/targets';
import { getArrow } from '../../../../utils/arrows';
import { themeVal } from '../../../../styles/utils/general';
import collecticon from '../../../../s... |
import React from "react";
import MessageType from "../uitils/MessageTypeUtils";
const AlertMessage = ({ message, messageType }) => {
const alertClassTypes =
messageType === MessageType.SUCCESS ? " alert-success" : " alert-danger";
const alertClasses = `alert ${alertClassTypes} alert-dismissible fade show`;
... |
/**
* TODO
* Maybe add an implementation for a real hardware joystick, like: https://www.play-zone.ch/en/ps2-daumen-joystick-mit-select-button-breakout-board.html
*/
const J5 = require('johnny-five');
class Joypad {
constructor({ wsConnection, pins, player }) {
this.wsConnection = wsConnection;
this.pin... |
//make the NYC station list selectable
$( document ).ready(function() {
var available_NYCTraffic={
1:"#1 - 11th ave n ganservoort - 12th ave @ 40th st",
2:"#2 - 11th ave s ganservoort - west st @ spring st",
3:"#3 - 12th ave @ 45th - 11 ave ganservoort st",
4:"#4 - 12th Ave N 40th - 57th St",
106:"#106 - 12th Ave S 57t... |
const NotificationActionTypes = {
NOTIFICATION_HIDDEN: "NOTIFICATION_HIDDEN",
ALL_REQUEST_SUCCESS: "ALL_REQUEST_SUCCESS"
};
export default NotificationActionTypes;
|
///TODO: REVIEW
/**
* @param {number[][]} matrix
* @return {void} Do not return anything, modify matrix in-place instead.
*/
var rotate = function(matrix) {
if(!matrix || matrix.length === 1) return;
var n = matrix.length;
for (var i = 0; i <= n/2; i++) {
for (var j = i; j < n-1-i; j++) {
var temp = ... |
export const LOAD_CEREMONY_DETAILS = 'my-project/ceremony/LOAD_CEREMONY_DETAILS';
export const LOAD_CEREMONY_DETAILS_SUCCESS =
'my-project/ceremony/LOAD_CEREMONY_DETAILS_SUCCESS';
export const LOAD_CEREMONY_DETAILS_FAILURE =
'my-project/ceremony/LOAD_CEREMONY_DETAILS_FAILURE';
export const LOAD_SIMILAR_CEREMONIES... |
(function(){
var app = angular.module('openmuc');
app.config(['$stateProvider', '$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/');
$stateProvider.
state('home', {
url: "/",
templateUrl: '/openmuc/html/sessi... |
import React, { Component } from "react";
import { withRouter } from "react-router-dom";
import { connect } from "react-redux";
import ReactDOM from "react-dom";
// Actions
import * as actionCreators from "../store/actions";
//Components
import PostMessageForm from "./PostMessageForm";
import Loading from "../component... |
$('.b-slider-main-photo').slick({
infinite: true,
speed: 500,
fade: true,
cssEase: 'linear',
arrow: true,
prevArrow: '.arrows-left-1',
nextArrow: '.arrows-right-1',
responsive: [{
breakpoint: 1275,
settings: {
dots: true
}
... |
// @flow
import { curry2, curry3, curry5 } from "./utils";
type ParseResult<A> = {
parsed: A,
remaining: string
} | null;
type Parser<A> = string => ParseResult<A>;
const numerals = new Set([
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]);
function number(str: string) : ParseResult<number> {
let i = 0... |
function Socket(paramPosX, paramPosY, figure) {
this.x = paramPosX;
this.y = paramPosY;
this.figure = figure;
}
Socket.prototype.draw = function () {
ctx.strokeStyle = strokeSocketColor;
this.figure.draw(this.x, this.y, true);
}
Socket.prototype.checkIfFigureIsInside = function (fig) {
if (fig === this.... |
// Config Variables
var colorchange = 5;
var colorstop = 1;
var clear = 2.5;
var flashstart = 0.2;
// Declare Variables
var colordif = (colorchange-colorstop)
var realtime; //Current time
var realtimedisplay; //Current time display
var json; //JSON Array
var targettime; //Target Time
var remainingt... |
module.exports = {
url: 'https://devmountain-qa.github.io/weatherman/build/index.html',
elements: {
searchBar: '.enter-location__input',
submitBtn: {
selector: '//button',
locateStrategy: 'xpath'
},
resultCity:{
selector: '//h3[@class=... |
import test from 'tape'
import filterMap from '../../../signals/processes/filterMap'
import { spy } from 'sinon'
import equals from 'ramda/src/equals'
test('filterMap', (assert) => {
const signal = spy()
const next = spy()
filterMap(equals(1))(signal)(next)
const handler = signal.getCall(0).args[0]
handler... |
// creating link to public remote communications
const remote = require('electron').remote;
const main = remote.require('./main.js');
module.exports = {
generate: function(text) {
var result = main.generateERD(text);
}
}
|
(function() {
'use strict';
angular
.module('webHipsterApp')
.controller('LivroDetailController', LivroDetailController);
LivroDetailController.$inject = ['$scope', '$rootScope', '$stateParams', 'previousState', 'entity', 'Livro', 'Editora'];
function LivroDetailController($scope, $ro... |
/**
*
* BitReaderLSB.js
*
* copyright 2003,2013 Kevin Lindsey
*
*/
/**
* BitReaderLSB
*
* @param {Array<Byte>} data
* @returns {BitReaderLSB}
*/
function BitReaderLSB(data) {
this.data = data;
this.index = 0;
this.mask = 0x01;
this.currentByte = null;
}
/**
* re... |
(function () {
'use strict';
angular.module('myapp.tracking', ["ngMap"]);
}()); |
function initOperDialog() {
$("#operHold").bootstrapValidator({
// 提示的图标
feedbackIcons: {
valid: 'glyphicon glyphicon-ok', // 有效的
invalid: 'glyphicon glyphicon-remove', // 无效的
validating: 'glyphicon glyphicon-refresh' // 刷新的
},
// 属性对应的是表单元素的名字
... |
import React, {Component, PropTypes} from 'react';
class Option extends Component{
render(){
var obj = this.props.option;
return (
<div className={this.props.className}
onMouseEnter={this.props.mouseEnter}
onMouseLeave={this.props.mouseLeave}
... |
// class Spectrum{
// constructor(folder,scanId,spectrumId,centerValue){
// this.folder = folder ;
// this.scanId = scanId ;
// this.spectrumId = spectrumId;
// this.centerValue = centerValue ;
// }
// getSpectrum(){
// console.log("this.scanId : "+ this.scanId);
// let scanId = this.scanId;
// let fol... |
import React, {Component} from 'react';
import {Resumo3,
Resumo4,
Resumo6,
Resumo7,
Resumo10,
Resumo11,
Resumo12} from './Content/resumos';
class Resume extends Component {
render(){
return(
<div className="corpo_resumo">
<Resumo12... |
besgamApp
.controller('tweets', function( $scope, dataFactory )
{
var now = new Date();
$scope.offsetutc = now.getTimezoneOffset();
dataFactory.getDataTwitter().then( function(response)
{
$scope.tweets = response.data;
});
$scope.submit = function(form)... |
const urlsToCache = [
{ url: "/", revision: "1" },
{ url: "/nav.html", revision: "1" },
{ url: "/index.html", revision: "1" },
{ url: "/detailsTeam.html", revision: "1" },
{ url: "/manifest.json", revision: "1" },
{ url: "assets/images/logo/brandPL.png", revision: "1" },
{ url: "assets/images/icons/favico... |
$(document).ready(function(){
$("a").on('click', function(event) {
if (this.hash !== "") {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({
scrollTop: $(hash).offset().top
}, 800, function(){
window.location.hash = hash;
});
}
});
});
AOS... |
var clienteClass = Backbone.Model.extend({
initialize: function() {
if (!this.get("nombres")) {
this.set("nombres", this.attributes.fields.usuario[0]);
}
if (!this.get("apellidos")) {
this.set("apellidos", this.attributes.fields.usuario[1]);
}
if (!this.get("cedula")) {
this.set("cedula", this.attri... |
import BannerCategory from 'components/Banner/Banner';
import BreadCrumbs from 'components/BreadCrumbs/BreadCrumbs';
import Sidebar from 'components/Sidebar/Sidebar';
import Flex from 'components/UI/Flex';
import MainLayout from 'layouts/MainLayout';
import React, {useMemo} from 'react';
import { useParams } from... |
import React from 'react';
import style from "./ProfilePage.module.css"
import ProfilePage from "./ProfilePage";
import * as axios from "axios";
import {withRouter} from "react-router-dom";
class ProfileContainer extends React.Component {
componentDidMount() {
//this.props.toggleIsFetching(true)
de... |
"use strict";
const TelegramBot = require("node-telegram-bot-api");
const config = require("../../../config/index");
const {
telegram: { botToken },
} = config;
const deubgBotToken = process.argv[2];
const bot = new TelegramBot(deubgBotToken || botToken, {
polling: {
interval: 10000, // Optional. How often c... |
const assert = require('chai').assert
const { sorter, athletes, Animal, TuringStudent } = require('../01-26-17')
describe('Problems', () => {
it.skip('should return a string stating who the winningest athlete was', () => {
assert.strictEqual(sorter(athletes), 'Tom Brady has won the most titles with 4.');
});
... |
const Url = "https://exam1api.sebbeprojects.com/wp-json/wp/v2/posts?_embed&per_page=18";
const blogPost = document.querySelector(".blogpost-content");
let moreContentbutton = document.querySelector("#more-contentbtn");
moreContentbutton.onclick = loadMore;
function loadMore() {
console.log("test");
const iteratio... |
var path = require('path');
var fs = require('fs');
var _ = require('lodash');
var crypto = require('crypto');
module.exports = function (Galleon, query, callback) {
if (!Galleon.connection.collections.queue) return callback(new Error('Collection Not Found!'));
Galleon.connection.collections.queue.findOne({
as... |
/// <reference path="../..\..\bower_components/polymer-ts/polymer-ts.d.ts"/>
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype,... |
/* eslint-env mocha */
const levenshteindistance = require('../../../src').algorithms.string.levenshteindistance;
const assert = require('assert');
describe('Levenshtein Distance', () => {
it('should find levenshtein distance between two strings', () => {
const stringA = 'sunday';
const stringB = 'saturday';... |
const db = require('../db')
const sequelize = require('sequelize');
const stpr = db.define("Order", {
storageID: sequelize.INTEGER,
productID: sequelize.INTEGER,
total: sequelize.INTEGER
})
db.sync()
.then(()=>{
console.log("Create Order successfully...")
})
module.exports = stpr |
module.exports = {
jwtSecret: process.env.JWT_SECRET || '8dc7dfb4-dd21-4916-b99a-b8bab0420974'
}; |
/* eslint-disable @typescript-eslint/restrict-plus-operands */
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require('path');
const mkdirp = require('mkdirp');
const fs = require('fs');
exports.onPreBootstrap = ({ store, reporter }) => {
const { program } = store.getState();
const dirs = [p... |
import { OwcDemo } from './src/OwcDemo.js';
window.customElements.define('owc-demo', OwcDemo);
|
var currentYear = "2019";
//get xml data
function loadStory(){
fetch('/data/storyData.xml').then((res) => {
res.text().then((xml) => {
let parser = new DOMParser();
let xmlDom = parser.parseFromString(xml, 'text/xml');
var eleList = xmlDom.getElementsByTagName('table');
var output ... |
import React from 'react';
import cloneDeep from 'lodash/cloneDeep';
class CreateDocument extends React.Component {
constructor(props) {
super(props);
this.state = {
title: '',
categoryId: '',
url: '',
file: null
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = t... |
import React from 'react';
import { useRouter } from 'next/router';
import Query from 'components/query';
import PRODUCT_QUERY from 'apollo/queries/product/product';
import Wallet from 'components/svg/wallet';
import Truck from 'components/svg/truck';
import Warranty from 'components/svg/warranty';
const Forminfo = ()... |
var RowdyruffBoys = window.RowdyruffBoys || {};
RowdyruffBoys.map = RowdyruffBoys.map || {};
var data = {
UserPoolId: _config.cognito.userPoolId,
ClientId: _config.cognito.userPoolClientId
};
var userPool = new AmazonCognitoIdentity.CognitoUserPool(data);
var cognitoUser = userPool.getCurrentUse... |
angular.module('esCore', []); |
/**
* Configurable authorizer,
* Set the authorizer to a module relative to this module that handles validating
* username and password.
*
* Authorizer modules must expose a function exports.authorize = function(username, password, cb)
*
* If the authorizer function has a function called init() it will be call... |
import React, { Component } from 'react'
import { NavLink } from 'react-router-dom'
import { Container } from 'semantic-ui-react'
import { cookies } from '../../cookie'
class AgeAllowance extends Component {
handleClick = (res) => {
if (res === 'Yes') {
cookies.set('verification', 'yes'... |
import { all } from "redux-saga/effects";
import gistsSaga from "./gists";
import category from './category'
export default function* () {
yield all( [
category(),
gistsSaga(),
] );
}
|
// console.log("app");
// alert();
|
$(function () {
var total = $('#row_dates').val();
var selectedId;
var dialog;
var getLabel = function(label) {
console.log(this);
}
$('#source_select, #month_value_select').select2();
//окно добавления записи
$(document).on('click', '#create-user', functio... |
import { combineReducers, configureStore } from '@reduxjs/toolkit';
import { appSlice } from '../Pages/home/homeSlice';
import { listSlice } from '../Pages/list/listSlice';
const rootReducer = combineReducers({
details: appSlice.reducer,
listdetails: listSlice.reducer,
});
export const store = configureStore({
... |
// This source file will have some operations.
// 1. Create a valid group of elements
// Let's say we have an array of arrays and we want the first and second element of each array.
// e.g. [88, 99, 200] we want to have [88, 99], so we need to remove the third element in each array.
// We want all the valid elements i... |
import Carousel from 'react-bootstrap/Carousel' ;
import {Row, Col} from 'react-bootstrap';
import "./Country.css";
import axios from 'axios';
import { useState, useEffect } from "react";
const Country = () => {
const [userDatas, setUserDatas] = useState([]);
useEffect(()=>{
axios.get('https://restcount... |
var slashcommand = require('./index');
var hemera = require('../hemera');
var whitelist = require('../utils/10amwhitelist');
var controller;
/**
* Responds to the 10AM slash command
* @param {Object} bot
* @param {Object} message
*/
module.exports = function (bot, message) {
console.log('[HEMERA] Got a 10AM ... |
let result = 0;
const memo = [];
function solution(user_id, banned_id) {
const banned_list = banned_id.map(bannedId => bannedId.replace(/\*/g,'.'));
const visit = [...user_id].fill(false);
dfs(user_id, banned_list,0, 0, visit);
return result;
}
function dfs(user_id, banned_id, idx, n, visit){
cons... |
import React, { Fragment } from 'react';
import styled from 'styled-components';
import PropTypes from 'prop-types';
import { Backdrop } from './Backdrop';
import CancelRequest from './CancelRequest';
import ErrorPrompt from './ErrorPrompt';
import ModalFooter from './ModalFooter';
import ModalHeader from './ModalHeade... |
/*****************************************************************************/
/* MasterLayout: Event Handlers */
/*****************************************************************************/
Template.MasterLayout.events({
'submit #search': function(event) {
event.preventDefault();
var listOpt... |
// The main JavaScript file for the Child Flashcards Vue app
// Define our routes
const routes = [
{ path: '/', component: VueCompEntryPage },
{ path: '/num-0-100', component: VueCompNum0100 },
{ path: '/num-tens', component: VueCompNumTens },
{ path: '/letters-upper', component: VueCompLettersUpper },
{ pat... |
import { Fragment } from "react";
import Head from "next/head";
import Link from "next/link";
import Blog from "../components/Blog";
import Projects from "../components/Projects";
import Language from "../components/Language";
import Buttons from "../components/ui/Buttons";
import Heading from "../components/ui/Heading... |
import React, { Component, Fragment } from 'react';
import { connect } from 'react-redux';
import * as actions from '../../store/actions/index';
import Toolbar from '../../components/Navigation/Toolbar/Toolbar';
import SideDrawer from '../../components/Navigation/SideDrawer/SideDrawer';
class Layout extends Componen... |
// import mongoose from 'mongoose';
const mongoose = require("mongoose");
var FeatureSchema = mongoose.Schema({
data: {
geometry: {
type: {
type: String,
default: "Point"
},
coordinates: [Number]
},
properties: {
id: Number,
price: Number,
street: String... |
import React from 'react'
import ReactDOM from 'react-dom'
import { createStore, combineReducers, compose } from 'redux'
import { Provider } from 'react-redux'
import ui from './ui/reducers'
import auth from './auth/reducers'
import App from './App'
import 'babel-core/polyfill'
import 'whatwg-fetch'
import 'semantic-ui... |
import { Header, Footer, Img } from "./Elements";
const HowItWorks = () => {
return (
<div className="generic howItWorks">
<Header />
<div className="content">
<h1>How it Works</h1>
<section>
<Img src="/how_it_works.png" />
</section>
</div>
<Footer />
... |
/**
* 1 页面加载的时候
* 1 从缓存中获取购物车的数据 渲染到页面中
* 这些数据,checked=true
* 2 微信支付
* 1 哪些人 哪些账号 可以实现微信支付
* 1 企业账号
* 2 企业账号的小程序后台中,必须给开发者添加上白名单
* 1 一个AppId可以同时绑定多个开发者
* 2 这些开发者就可以公用这个AppId和他的开发权限
* 3 支付按钮
* 1 先判断缓存汇总有没有token
* 2 没有,跳转到授权页面,进行获取token
* 3 有token
* 4 创建... |
import React from 'react';
import { storiesOf } from '@storybook/react';
import { select, text } from '@storybook/addon-knobs';
import TextOrInput from './index';
import Card from '../_storybookWrappers/Card';
const stories = storiesOf('Components|TextOrInput', module).addParameters({
component: TextOrInput,
compo... |
(function($, ls) {
"use strict";
/*
* Only gets called when we're using $('$el').flightStatus format
*/
var FlightStatus = function(el, customOptions) {
var _ = this;
_.$el = $(el).addClass('flight-status');
_.defaults = defaults;
document.body.addEventListener('flightQuerySuccess');
_.async(customO... |
class SleepRepository {
constructor(sleepData, id) {
this.sleepData = sleepData;
this.id = id;
this.user = this.getSleepData();
}
getSleepData() {
return this.sleepData.filter(user => user.userID === this.id);
}
getAllTimeAvg() {
const totalHrs = this.user.reduce((totalHours, day) => {
... |
import React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import Color from '../constants/color'
import TitleText from '../components/TitleText'
const Header = props => {
return (
<View style={styles.header}>
<TitleText style={styles.headerTitle}>{props.title}</TitleText>
</View>
)
};
... |
import React, { Component } from "react";
import { NavLink } from "react-router-dom";
import Logo from "../components/Logo";
import Button from "../components/Button";
import DropDown from "../components/DropDown";
const options = ["one", "two", "three"];
class Navigation extends Component {
constructor(props) {
... |
"use strict";
/**
* This example shows how to define different authn/authz methods for different routes.
*
* Example:
*
* - Try to call /aaa/hello. It will call "aaaAuthn" and "aaaAuthz" methods
* http://localhost:3000/aaa/hello
*
* - Try to call /bbb/hello. It will call "bbbAuthn" and "bbbAuthz" methods
... |
const sendMail = require("../my_modules/sendMail.js");
process.on('message', function(megObj){
console.log('message from parent: ' + megObj.meg);
sendMail({"to":"1533165085@qq.com","subject":"nodeApp-LayUI exit","html":megObj.meg},function(err, info){
if(err){
console.log(err);
process.send({"meg": 'www_err发... |
/**A string S of lowercase English letters is
* given. We want to partition this string
* into as many parts as possible so that
* each letter appears in at most one part,
* and return a list of integers representing
* the size of these parts.
Example 1:
Input: S = "ababcbacadefegdehijhklij"
Output: [9,7... |
class Cell{
constructor(pos){//X and Y will be row and column number
this.pos = pos;
this.x = pos % colsRows;
this.y = Math.floor(pos / colsRows);
this.isVisited = false;
this.walls = [true, true];//Top, Right
}
getNeighbors(){
let neighbors = [];
nei... |
import React, { useState } from 'react'
import TextField from '@material-ui/core/TextField'
import Button from '@material-ui/core/Button'
import useStyles from './searchform.styles'
const SearchForm = (props) => {
const [pokemon, handlePokemon] = useState('')
const { onSubmit } = props
const classes = useStyl... |
import React from 'react'
import { compose } from 'redux';
import { withAuthentication, withNav } from '../../hoc'
import { Navagation } from '../index.js'
import MapContainer from './mapContainer.js'
import './map.scss'
class Map extends React.Component {
state = {
rangeSliderValue: 4
}
handleSliderChang... |
import React, {useState, useEffect} from 'react';
import { doctorAPI } from '../../api';
import Spinner from '../Spinner';
const Doctor = (props) => {
const [doctorInfo, setDoctorInfo] = useState(undefined);
const [id, setId] = useState(undefined);
const [loading, setLoading] = useState(true);
useEff... |
function Player() {
this.pos = createVector(width/2, height/2);
this.r = 20;
this.moveSpeed = 5;
this.stamina = 100;
this.health = 100;
this.bearing = PI / 2;
this.dead = false;
this.update = function() {
this.bearing = PI / 2 + atan2(mouseY-this.pos.y, mouseX-this.pos.x); // Angle towards mous... |
let price_value = document.getElementById('price_addend');
let setMinPriceTags = document.getElementById('setMinPriceTags');
let setMinPriceCats = document.getElementById('setMinPriceCats');
let setMinRate = document.getElementById('setMinRate');
let setMidPriceTags = document.getElementById('setMidPriceTags');
let s... |
const request = require('request');
var async = require("async");
const calls = ['activities/distance/date/today/7d.json',
'activities/steps/date/today/7d.json',
'activities/calories/date/today/7d.json',
'activities/date/today.json'
];
var token;
var apiCallCount = 0;
function init_api_calls(auth... |
import React, { useEffect } from "react";
import ScrollAnimation from "react-animate-on-scroll";
import Aos from "aos";
import "aos/dist/aos.css";
import EmailForm from "../components/EmailComp";
import New from "../components/NewBtn";
import Learn from "../components/Learn";
import Footer from "../components/Footer"... |
const Request = require("../models/request");
const Archive = require("../models/archive");
const User = require("../models/user");
const Profile = require("../models/profile");
const Mailer = require("../mail/mailer");
const Sonarr = require("../services/sonarr");
const Radarr = require("../services/radarr");
const lo... |
/**
* @param {number} n
* @return {boolean}
*/
var isPowerOfThree = function(n) {
if (n === 0) return false;
var res = Math.round(Math.log(n) / Math.log(3));
return Math.pow(3, res) === n;
};
console.log(isPowerOfThree(3));
console.log(isPowerOfThree(0));
console.log(isPowerOfThree(45)); |
/**
* Created by Wujianxiong on 2016/12/19.
*/
var formidable = require('formidable');
var fs = require('fs');
var path = require('path');
var config = require('../../config');
function UploadService() {
}
/**
* 上传文件(前端input的name="file")
* @param req request
* @param dir 文件保存目录
*/
UploadService.upload = func... |
"use strict";
(function () {
/* Создайте массив объектов-стран. У страны есть название и список городов.
У города есть название и численность населения */
var countries = [
{
name: "Россия",
cities: [
{
name: "Москва",
... |
var ntk = require('../lib');
ntk.createClient( (err, app) => {
var wnd = app.createWindow({ width: 800, height: 600});
var ctx = wnd.getContext('2d');
var text = 'This is Test test';
var lastx = 0;
var lasty = 0;
wnd.on('expose', (ev) => {
ctx.fillStyle = 'white';
ctx.fillRect(ev.x, ev.y, ev.wid... |
import * as f from './testFixtures.js';
import * as tmp from 'tmp';
import * as fs from 'fs';
import { execSync } from 'child_process';
const glob = require('glob');
describe('separate compilation using --es=es5 and --webpack', () => {
const files = glob.sync('test/es5-mode/*.js');
for (const src of files) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.