Skip to content

Instantly share code, notes, and snippets.

const Koa = require('koa');
const app = new Koa();
const router = require('koa-router')();
router.get('/', async (ctx, next) {
const result = await new Promise( resolve => {
setTimeout(() => {resolve('YES!!!') }, 500)
})
ctx.body = result
});
import numpy as np
def nonlin(x, deriv = False):
if(deriv == True):
return x*(1 - x)
return 1 / ( 1 + np.exp(-x) )
#input dataset
X = np.array([
[0,0,1],
const path = require('path')
const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const prod = process.env.NODE_ENV === 'prod'
const extractStylus = new ExtractTextPlugin('../css/[name].css')
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import injectSheet from 'react-jss'
import { connect } from 'react-redux'
import { compose } from 'redux'
import shared from '../../lib/shared-var'
const styles = {
}
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
var audioElement = document.getElementById('myAudio');
var audioSrc = audioCtx.createMediaElementSource(audioElement);
var analyser = audioCtx.createAnalyser();
document.getElementById('file').addEventListener('change', function(event){
audioElement.src = URL.createObjectURL(this.files[0]);
});
const arr = [
{ val: 'A' },
{ val: 'B' },
{ val: 'C' },
{ val: 'B' },
{ val: 'D' },
{ val: 'C' },
{ val: 'B' },
{ val: 'D' },
{ val: 'C' },
<!DOCTYPE html>
<html>
<head>
<title>brain</title>
</head>
<body>
<script type="text/javascript">
/*------example------
exampleInputData = [0,1,2,3,4,5,6]
exampleOutputData = [1,3,5]
/*
нужно расчитать график касиров
каждый касир должен работать не больше 5 дней в неделю И не больше 9 часов в день
рабочий день начинаеться с 8 до 23 - 15 раб часов
* ---------------------
const kAll = 70 // кол-во касиров всего
let k = 0 // кол-во касиров в день (нужно найти эту переменную)
let p = 0 // поток покупателей
let t = 0 // время (от 8 до 23)
<audio src="song.mp3" id="myAudio"></audio>
var dictinary = {};
function addWord(word, value) {
value = value ? value : word
var letters = word.split('')
var newDic = letters.reduce((prev, curr, i) => {
if (letters.length -1 === i) {
return prev[curr] = value
}
return prev[curr] ? prev[curr] : prev[curr] = {}