It should be noted that:
- Basic blocks in SSA can be identified at 3 points:
- Start of the program
- Labels
- Branches
- Basic blocks are used in optimisation.
| var express = require('express') | |
| var app = express() | |
| app.listen(1337) | |
| app.all('/stream/:chunks', function (req, res, next) { | |
| res.writeHead(200, { | |
| 'Content-Type': 'text/plain', |
A zip function in javascript using .reduce.
See Tom MacWright's post making juice with reduce / foldl.
See also _.zip and d3.zip for alternative implementations and sample usage.
| ; 1 2 3 4 5 6 7 | |
| ;01234567890123456789012345678901234567890123456789012345678901234567890 | |
| ;======================================================================= | |
| ;+---------------------------------------------------------------------+ | |
| ;| | | |
| ;| Example using brk() system call for dynamic memory allocations. | | |
| ;| | | |
| ;| DON'T CONFUSE that brk() used in C Function is different with brk() | | |
| ;| systemcall (systemcall 45 for x86 ASM). | | |
| ;| | |
| /* open up chrome dev tools (Menu > More tools > Developer tools) | |
| * go to network tab, refresh the page, wait for images to load (on some sites you may have to scroll down to the images for them to start loading) | |
| * right click/ctrl click on any entry in the network log, select Copy > Copy All as HAR | |
| * open up JS console and enter: var har = [paste] | |
| * (pasting could take a while if there's a lot of requests) | |
| * paste the following JS code into the console | |
| * copy the output, paste into a text file | |
| * open up a terminal in same directory as text file, then: wget -i [that file] | |
| */ |
Inspired by "Parsing CSS with Parsec".
Just quick notes and code that you can play with in REPL.
By @kachayev
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| var inherits = require('inherits'); | |
| var Game = require('crtrdg-gameloop'); | |
| var Entity = require('crtrdg-entity'); | |
| var Keyboard = require('crtrdg-keyboard'); | |
| inherits(Player, Entity); | |
| function Player(options){ | |
| this.position = { | |
| x: options.position.x, |
| ; The stack pointer is going to be an index into the stack, and the | |
| ; stack is an array of words. The alternative would be to have the | |
| ; stack pointer me a pointer to memory, but this is perhaps a bit | |
| ; nicer, as where the stack actually lives is totally irrelevant. | |
| @stack = global [1000 x i64] undef | |
| @sp = global i64 undef; | |
| ; Now we have the basic stack operations: push, pop, and peek. As can | |
| ; be seen from the definitions, LLVM is typed, which is really nice as |
| /** | |
| * Module dependencies. | |
| */ | |
| var pkg = require('../package'); | |
| var env = process.env.NODE_ENV || 'development'; | |
| /** | |
| * Return setting `name`. | |
| * |