This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qs = require('querystring'); | |
var request = require('request'); | |
var app_id = '<your_fb_app_id>'; | |
var app_secret = '<your_fb_app_secret>'; | |
var app_login_url = 'https://graph.facebook.com/oauth/access_token' | |
var app_login_qs = { | |
client_id: app_id, | |
client_secret: app_secret, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Random integer in range algorithm: | |
given that rand() produces a random number between 0 and RAND_MAX (defined in stdlib.h) | |
and we want a random integer (rand_index) between 0 and page_range where page_range = malloc_size / page_size | |
page_range = malloc_size / page_size; | |
if ( RAND_MAX > page_range ) { | |
rand_index = ( rand() % page_range ) * page_size; | |
} else { |
NewerOlder