Skip to content

Instantly share code, notes, and snippets.

Scott Frees freezer333

Block or report user

Report or block freezer333

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@freezer333
freezer333 / array_prop.cpp
Created Mar 22, 2017
Access array in object via NAN
View array_prop.cpp
// JS calling code
var obj = {
a: 5,
b : [1, 2, 3]
}
addon.add_array(obj);
assert(obj.b[0] == 6);
assert(obj.b[1] == 7);
assert(obj.b[2] == 8);
@freezer333
freezer333 / prime_sieve.c
Created Dec 12, 2015
Prime Sieve C implementation written by Achim Flammenkamp, Bielefeld, D, achim@uni-bielefeld.de
View prime_sieve.c
#include <stdio.h> /* Achim Flammenkamp, Bielefeld, D, achim@uni-bielefeld.de */
#include <malloc.h>/* ifdefs: LONG=uns64 _ANSI_EXTENSION true_64bit_words */
#include <stdlib.h>/* SUM_{p<x} 1/p= ln(ln(x))+0.5772156649015-0.315718451893 */
#include <math.h> /* extern double sqrt(double), log(double), floor(double); */
#ifndef uns32 /* Version 1.0a 1998-05-19 source availible */
#define uns32 unsigned /* Version 2.0a 1998-05-23 5 years in the WWW */
#endif /* Version 2.0b 2003-06-03 0-1-typo fixed Argh! */
#ifndef uns64 /* Version 2.0c 2003-06-04 works up to 2^64-1 */
# ifdef _ANSI_EXTENSION /* uses < 1938 MB for minimal sieve size to 2^64 */
# define uns64 unsigned long long
You can’t perform that action at this time.