made with esnextbin
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
function background() { | |
const m = {} | |
function create(p) { | |
return { | |
withValue(prop, value) { | |
// Create a new "memory" | |
const p1 = Object.assign({}, p) | |
m[prop] = m[prop] || [] | |
p1[prop] = m[prop].push(value) - 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 os = require('os') | |
const cp = require('child_process') | |
const Rx = require('rxjs') | |
// https://github.com/coopernurse/node-pool | |
const pool = require('generic-pool') | |
const MAX_WORKERS = os.cpus().length | |
const createWorkerPool = () => { | |
const factory = { |
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
{ | |
"products": [ | |
{ | |
"id": "1", | |
"name": "Ohrensessel Josslyn", | |
"price": 499.99, | |
"currency": "EUR", | |
"image": "images/01.jpg", | |
"url": "http://www.home24.de/m-rteens/mit-hocker-917965" | |
}, |
made with esnextbin
made with esnextbin
- There are two kinds of items:
A
andB
- Each item
B
could be replaced byA'
andA"
- Given a list with items
A
andB
(the order is not important), generate the most quantity of target-lists only with itemsA
,A'
andA"
below the time limitt
- Each target-list is sorted after generation, so there isn't necessary to generate each permutation (only replacements are sufficient)
- The source list have an arbitrary size
- The number of unique possibilities is
n²
wheren
is the number ofB
items A
items doesn't need to be modified, so it could be reused
Given the source list:
- Há dois tipos de itens: A e B
- Os items do tipo B podem ser convertidos para A' e A"
- Dado uma lista com itens A e B (ordem dos itens não é relevante), é necessário gerar o maior número possível de listas-alvo somente com A, A' e A" (substituindo o itens B em A' ou A") dentro do tempo limite
t
- O número de possibilidades únicas é
n²
onn
é o número de itens B - Os itens A não precisam ser modificados, podendo ser reutilizados como lista-alvo inicial (concatenado-se as substituições de B)
Dado a lista inicial (pode ter tamanho arbitrário):
[A, A, B, A, B]
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 {div, input} from '@cycle/dom' | |
import isolate from '@cycle/isolate' | |
import xs from 'xstream' | |
import {assoc} from 'ramda' | |
function Form (sources) { | |
const billingAddressChange$ = sources.DOM | |
.select('.billing-address').events('input') | |
.map(ev => ev.target.value) | |
.startWith('') |
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
[ | |
{ | |
"name": "ES6 (babel) + Browserify", | |
"value": "cycle-scripts-es-browserify" | |
}, | |
{ | |
"name": "TypeScript + Browserify", | |
"value": "cycle-scripts-ts-browserify" | |
}, | |
{ |