This file contains hidden or 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
const fs = require('fs') | |
const path = require('path'); | |
const { AnvilParser, NBTParser } = require('mc-anvil'); | |
const minecraftIds = require('./minecraft-ids.js'); | |
// iterate biomes for biomes | |
// determine mountains / caverns / ocean floor from heightmaps | |
// iterate sections for block info | |
function getWorldAttributes(worldRegionDirectoryPath) { |
This file contains hidden or 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
const fs = require('fs'); | |
//const CircularJSON = require('circular-json'); | |
var Heap = require('heap'); | |
module.exports = BitsyDictionary; | |
function BitsyDictionary() { | |
this._dictionary = { // trie of symbols, with root to a given node representing a possible symbol. | |
symbolPointers: [], | |
huffmanTree: {} // Huffman tree for generating the binary code. |
This file contains hidden or 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
const fs = require('fs'); | |
const os = require('os'); | |
const path = require('path'); | |
const BloomFilter = require('bloomfilter').BloomFilter; | |
const BitsyDictionary = require('../libs/dictionary'); | |
module.exports = function(commander) { | |
commander | |
.command('dictionary <directoryPath> <outputFilePath>') | |
.description('Generate a bitsy dictionary from files within a directory.') |
This file contains hidden or 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 fs = require('fs'); | |
var matches = {}; | |
var input = fs.readFileSync('/Users/braydonbatungbacal/Desktop/big.txt').toString(); | |
var validIndexes = []; | |
var length = 2; // the start length | |
for (var i = 0; i < input.length; i++) { |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
console.clear(); | |
const test_string = 'The Project Gutenberg EBook of The Adventures of Sherlock Holmesby Sir Arthur Conan Doyle(#15 in our series by Sir Arthur Conan Doyle)Copyright laws are changing all over the world Be sure to check thecopyright laws for your country before downloading or redistributingthis or any other Project Gutenberg eBookThis header should be the first thing seen when viewing this ProjectGutenberg file Please do not remove it Do not change or edit theheader without written permissionPlease read the "legal small print," and other information about theeBook and Project Gutenberg at the bottom of this file Included isimportant information about your specific rights and restrictions inhow the file may be used You can also find out about how to make adonation to Project Gutenberg, and how to get involved**Welcome To The World of Free Plain Vanilla Electronic Texts****eBooks Readable By Both Humans and By Computers, Since 1971*******These eBooks Were Prepared By Thousands of Volunteers! |
This file contains hidden or 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
/* | |
Preface: | |
I'm issuing this challenge as I've hit a major roadblock in the development process | |
of one of my personal side projects. I've spent the last 2 weeks exhaustively exploring | |
solutions to the following problem and I'm at my wits end. I've taken a number of approaches | |
using various tree data structures and clever algorithms with no success. | |
This file contains hidden or 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
function VehicleConstructor(name) { | |
var vehicle = {}; | |
//Properties | |
vehicle.name = name; | |
vehicle.milesTravelled = 0; | |
vehicle.maxPassengers = 0; | |
vehicle.currentPassengers = 0; | |
// Default Assignments |
This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <memory.h> | |
#include <dirent.h> | |
#include <dictionary_c.h> | |
#define DICT_MAX_SIZE_BYTES 1024 * 1024 * 32 | |
#define DICT_MIN_PATTERN_SIZE_BYTES 2 | |
#define DICT_STOP_SYMBOL '\0' | |
#define DICT_MAX_AUTOMATON_SIZE_BYTES 2 << 30 |
This file contains hidden or 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
#include <stdio.h> | |
int mystrend(char *s, char *c) { | |
int sLen = 0; | |
int cLen = 0; | |
while (*s != '\0') { | |
s++, sLen++; | |
} |
This file contains hidden or 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
#include <stdio.h> | |
int main() { | |
int test[100]; | |
int *testP = test; | |
while (1) { | |
printf("%c, %p\n", testP); | |
//*testP = 0; // This will segfault, however reading does not?.. | |
testP++; |
NewerOlder