Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-goption.
A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.
The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.
| // | |
| // The new assembly support in Solidity makes writing helpers easy. | |
| // Many have complained how complex it is to use `ecrecover`, especially in conjunction | |
| // with the `eth_sign` RPC call. Here is a helper, which makes that a matter of a single call. | |
| // | |
| // Sample input parameters: | |
| // (with v=0) | |
| // "0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad", | |
| // "0xaca7da997ad177f040240cdccf6905b71ab16b74434388c3a72f34fd25d6439346b2bac274ff29b48b3ea6e2d04c1336eaceafda3c53ab483fc3ff12fac3ebf200", | |
| // "0x0e5cb767cce09a7f3ca594df118aa519be5e2b5a" |
| contract random { | |
| /* Generates a random number from 0 to 100 based on the last block hash */ | |
| function randomGen(uint seed) constant returns (uint randomNumber) { | |
| return(uint(sha3(block.blockhash(block.number-1), seed ))%100); | |
| } | |
| /* generates a number from 0 to 2^n based on the last n blocks */ | |
| function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) { | |
| uint n = 0; | |
| for (uint i = 0; i < size; i++){ |
| "use strict"; | |
| const vm = require("vm"); | |
| const sandbox = { anObject: {} }; | |
| const whatIsThis = vm.runInNewContext(` | |
| const ForeignObject = anObject.constructor; | |
| const ForeignFunction = ForeignObject.constructor; | |
| const process = ForeignFunction("return process")(); | |
| const require = process.mainModule.require; | |
| require("fs"); |
With Ruby 1.8 (default version on MacOS) :
sudo gem install json
curl -s https://api.github.com/orgs/[ORGANIZATION]/repos | ruby -rubygems -e 'require “json”; JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}'
With Ruby 1.9+, the json library is by default thus you just use :
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| // # Mocha Guide to Testing | |
| // Objective is to explain describe(), it(), and before()/etc hooks | |
| // 1. `describe()` is merely for grouping, which you can nest as deep | |
| // 2. `it()` is a test case | |
| // 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
| // before/after first/each it() or describe(). | |
| // | |
| // Which means, `before()` is run before first it()/describe() |
| roomrate | |
| ======== | |
| { | |
| 'city': 'Berlin', | |
| 'hotel': 'Hilton', | |
| 'date': '2013-08-09' | |
| 'room_type': 'single', | |
| 'occupancy': 2, | |
| 'avail_count': 13, | |
| 'booked_count': 4, |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: