Use this header file to conditionally invoke eio_custom()
or uv_queue_work()
, depending on the node version that the module is being compiled for.
See the usage.cc
file for a partial example.
Comments, forks, and improvements are welcome!
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
// node.js geo polygon map tile rendering! | |
// requires https://github.com/learnboost/node-canvas and GeoJSON data files | |
// e.g. | |
// data from naturalearthdata.com converted to GeoJSON with GDAL's ogr2ogr | |
// or from datasf.org, reprojected too: | |
// ogr2ogr -f GeoJSON sfbay.js sfbay.shp -t_srs EPSG:4326 | |
var Canvas = require('./vendor/node-canvas/lib/canvas'), | |
http = require('http'), | |
fs = require('fs'); |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
// bm.cpp | |
// g++ test.cpp -lboost_thread-mt && ./a.out | |
// the ration of XXX and YYY determines | |
// if this works or deadlocks | |
int XXX = 20; | |
int YYY = 10; | |
#include <boost/thread.hpp> |
static Handle<Value> Stat(const Arguments& args) { | |
HandleScope scope; | |
if (args.Length() < 1 || !args[0]->IsString()) { | |
return THROW_BAD_ARGS; | |
} | |
String::Utf8Value path(args[0]->ToString()); | |
if (args[1]->IsFunction()) { |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <float.h> | |
int main | |
(int argc | |
,char *ac []){int i, count = argc - 1; | |
double * dvalues=malloc(01- 01+count* | |
sizeof(double)+1); double mi=DBL_MAX,ran=.0,ma =DBL_MIN,mo;for(i= 00; argc>1 | |
&&i<count;i=i+8-7) {double val = atof(ac[i+1]) ;if(23&&val<mi)mi= val;if(val |
This is a quick summary of tweaks to make development on a Mac easier for Ubuntu users. These all worked on my Macbook Air with OSX 10.7 Lion.
If you have something to add here, please let me know! http://twitter.com/craigds
# On OSX, this Imposm file is found at: /Library/Python/2.7/site-packages/imposm/db/postgis.py. YMMV | |
# Hack basically comments out all the elements relating to modifying the geometry_columns table. | |
# In PostGIS 2.0 this is a view and handled transparently. | |
# Copyright 2011 Omniscale (http://omniscale.com) | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
#!/bin/sh | |
cd /tmp | |
# dd if=/dev/urandom of=100mb-random-file bs=1024 count=$((100*1024)) | |
rm 100mb-random-file | |
echo "Downloading 100MB from w" | |
time rsync --rsh=ssh --append --archive --no-group --human-readable --progress w:/tmp/100mb-random-file . | |
echo "Uploading a 10MB file to w" |