Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"| var input = [1,2,3,4,5,6,7,8,9]; | |
| var bs = function(input){ | |
| var middleIndex = Math.ceil(input.length/2) - 1; | |
| var middle = input[middleIndex]; | |
| var target = 6; | |
| //base | |
| if(middle === target){ |
| function find_deviation(v, d) { | |
| var seq = [], | |
| diff = 0, | |
| seqMax = []; | |
| for(var i=0; i<v.length + 1 -d; i++){ | |
| console.log('v', v); | |
| seq = v.slice(i, i + d); | |
| console.log('seq', seq); | |
| seq.sort(function(a, b){ | |
| return a-b; |
| #!/usr/bin/env node | |
| /* | |
| https://gist.github.com/stangah/04e7ce784ab64beb9919 | |
| Call from command line to create files of various sizes: | |
| node fileCreatorThingy.js 1 10 100 200 300 | |
| */ | |
| var fs = require('fs'); |
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you use a pattern that is repeatable and readable for the type of test you need.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
The sweet spot for Cassandra secondary indexing Posted on October 21, 2013 Secondary indexes
Secondary indexes have been in Cassandra since 0.7 and can be incredibly useful. For example, if you were implementing a user accounts database, you might have the schema
1 2 3 4
| /* use v7.9.0 */ | |
| /* v0, just async */ | |
| (async function() { | |
| var sleep = async function() { | |
| return 'done'; | |
| } | |
| var result = await sleep(); | |
| console.log('v0 result', result); | |
| })(); |