Underscore example:
_.each([1, 2, 3], function(num) { alert(num); });
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
#!/usr/bin/perl | |
#fetch Gravatars | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 90; |
var http = require('http'); | |
http.createServer(function (req, resp) { | |
var h = req.headers; | |
h.host = "stackoverflow.com"; | |
var req2 = http.request({ | |
host: h.host, port: 80, path: req.url, method: req.method, headers: h | |
}, function (resp2) { | |
resp.writeHead(resp2.statusCode, resp2.headers); | |
resp2.on('data', function (d) { resp.write(d); }); | |
resp2.on('end', function () { resp.end(); }); |
/************************************************************************** | |
* OSM2GEO - OSM to GeoJSON converter | |
* OSM to GeoJSON converter takes in a .osm XML file as input and produces | |
* corresponding GeoJSON object. | |
* | |
* AUTHOR: P.Arunmozhi <[email protected]> | |
* DATE : 26 / Nov / 2011 | |
* LICENSE : WTFPL - Do What The Fuck You Want To Public License | |
* LICENSE URL: http://sam.zoy.org/wtfpl/ | |
* |
This example expects to have d3.min.js and d3.layout.min.js in the same directory as pie.js and pie_serv.js. | |
Run with node pie_serv.js |
var cluster = require('cluster'); | |
if (cluster.isWorker) { | |
console.log('Worker ' + process.pid + ' has started.'); | |
// Send message to master process. | |
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'}) | |
// Receive messages from the master process. |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
* MCrypt API available online: | |
* http://linux.die.net/man/3/mcrypt | |
*/ | |
#include <mcrypt.h> |
import bpy | |
from bpy_extras.view3d_utils import location_3d_to_region_2d as loc3d2d | |
import os | |
def write_svg(edge_list, region): | |
width, height = region.width, region.height |