with node > 7
npm install sack.vfs
node testWssHttps.js
opens a server on port 8080, and 8081
struct malloc_chunk_tag | |
{ | |
uint16_t dwOwners; // if 0 - block is free | |
uintptr_t dwSize; // limited to allocating 4 billion bytes... | |
uint16_t alignment; // this is additional to subtract to get back to start (aligned allocate) | |
uint16_t to_chunk_start; // this is additional to subtract to get back to start (aligned allocate) | |
uint8_t byData[1]; // uint8_t is the smallest valid datatype could be _0 | |
}; | |
typedef struct malloc_chunk_tag MALLOC_CHUNK; |
#include <wchar.h> | |
#include <malloc.h> | |
#include <stdint.h> | |
// returns pointer to utf8 string; | |
// the result must be released with free(). | |
// | |
// length is in count of wide characters passed. |
<HTML> | |
<HEAD> | |
</HEAD> | |
<BODY> | |
<DIV class="fullpage"> | |
<IFrame class="fullpage"ID="Login"></IFRAME> | |
</DIV> | |
<DIV class="fullpage" style="display:none;"> | |
<IFrame class="fullpage"ID="App"></IFRAME> | |
</DIV> |
Gun.on('opt', function(ctx){ | |
const ACK_ = '@'; | |
const SEQ_ = '#'; | |
var gun = ctx.gun; | |
this.to.next(ctx); | |
ctx.on('put', function(at) { | |
this.to.next(at); | |
ctx.on('in', {[ACK_]: at[SEQ_], gun:gun, ok: 1}); |
with node > 7
npm install sack.vfs
node testWssHttps.js
opens a server on port 8080, and 8081
var lame = require( "lame" ) | |
, Speaker = require('speaker') | |
var sack = require( "../node_modules/sack-gui" ) | |
var disk = sack.Volume(); | |
["Click-SoundBible.com-1387633738.mp3" | |
,"Cracking Chest Open-SoundBible.com-2009973824.mp3" |
function pcg_setseq_128_srandom_r() | |
{ | |
//const state = new Uint32Array([0,0,0,0,0,0,0,0]); | |
const state = [0,0,0,0,0,0,0,0]; | |
const b = [ 0x7F2D, 0x4C95, 0xF42D, 0x5851 ]; | |
const c = [ 0x7F2D, 0x4C95, 0xF42D, 0x5851 ]; | |
const rng = { | |
state: new Uint32Array([0,0,0,0,0,0,0,0]), |
// ported from https://github.com/imneme/pcg-c | |
// http://www.pcg-random.org/using-pcg.html | |
const _UINTS = 4; | |
// records | |
// : 2 : Done in 1321 /ms 75700.2271006813 151400.4542013626 | |
// : 4 : Done in 3538 /ms 28264.55624646693 113058.22498586772(kbpms) | |
// : 8 : Done in 5671 /ms 17633.574325515783 141068.59460412627 | |
// |
var x = 13 | |
var y = 12; | |
var centerX = 10; | |
var centerY = 10; | |
function getOctant( x, y ) { | |
x-=centerX; | |
y -= centerY; |