This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr = [ | |
{ val: 'A' }, | |
{ val: 'B' }, | |
{ val: 'C' }, | |
{ val: 'B' }, | |
{ val: 'D' }, | |
{ val: 'C' }, | |
{ val: 'B' }, | |
{ val: 'D' }, | |
{ val: 'C' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
нужно расчитать график касиров | |
каждый касир должен работать не больше 5 дней в неделю И не больше 9 часов в день | |
рабочий день начинаеться с 8 до 23 - 15 раб часов | |
* --------------------- | |
const kAll = 70 // кол-во касиров всего | |
let k = 0 // кол-во касиров в день (нужно найти эту переменную) | |
let p = 0 // поток покупателей | |
let t = 0 // время (от 8 до 23) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<audio src="song.mp3" id="myAudio"></audio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] = {} |