- Modern Algorithms and Data Structures - 1. Bloom Filters, Merkle Trees
- https://bitly.com/bundles/quipo/2
- Merkle Tree Traversal Techniques 2007 Boris Ederov
- Merkle tree traversal revisited 2008 Johannes Buchmann, Erik Dahmen, and Michael Schneider
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 spheron = require('spheron'); | |
var sphero = spheron.sphero(); | |
var spheroPort = '/dev/cu.Sphero-BYR-RN-SPP'; | |
sphero.on('open', function() { | |
console.log("opened"); | |
var maskX = 0x1000, | |
maskY = 0x0800, | |
maskZ = 0x0400, |
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
/usr/local/bin/ruby extconf.rb | |
checking for ffi.h... *** extconf.rb failed *** | |
Could not create Makefile due to some reason, probably lack of necessary | |
libraries and/or headers. Check the mkmf.log file for more details. You may | |
need configuration options. | |
Provided configuration options: | |
--with-opt-dir | |
--without-opt-dir | |
--with-opt-include |
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 = "parshap" | |
# Create a resource to create the user (but do not execute) | |
create_user = user NAME do | |
gid NAME | |
supports :manage_home => true | |
home HOME | |
action :nothing | |
end |
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
class Plugin < ::Vagrant.plugin("2") | |
name "build" | |
action_hook('build') do |hook| | |
hook.after(Vagrant::Action::Builtin::Provision, 2) do | |
system("bash build.sh") | |
end | |
end | |
end |
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
module.exports = function(sources, options, callback) { | |
if ( ! callback) { | |
callback = options; | |
options = {}; | |
} | |
options = _.defaults(options, LESS_OPTIONS); | |
async.map(sources, function(source, callback) { | |
compile(source, options, callback); |
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
// Return the "pivot index" of the given array of numbers. The pivot index is | |
// the index where the sum of the numbers on the left is equal to the sum of | |
// the numbers on the right. | |
function pivot(numbers) { | |
validateInput(numbers); | |
// Find a pivot index by testing each index | |
for (var i = 0; i < numbers.length; i++) { | |
var leftSum = sum(numbers.slice(0, i)); | |
var rightSum = sum(numbers.slice(i + 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
select sum(transactions.price) from sellers | |
left join products on products.seller_id = sellers.id | |
left join purchases on purchases.product_id = products.id | |
left join transactions on transactions.purchase_id = purchases.id | |
where sellers.id = SELLER_ID and | |
transactions.is_payed = 0 and | |
transactions.date <= date_sub(now(), interval 1 week) |
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 cluster = require("cluster"); | |
function master() { | |
var worker = cluster.fork(); | |
process.on("SIGUSR2", function() { | |
var newWorker = cluster.fork(); | |
newWorker.on("listening", function() { | |
worker.disconnect(); | |
worker = newWorker; |
Parse CSV rows by defining parsing blocks for individual columns.
Each row is parsed one-by-one. First a new Hash is initialized to store data for the row. Then, each individual column is parsed by calling matching parsing blocks. Parsing blocks are passed the column's value and header key and can set arbitrary state on the Hash for the current row.
Example: