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
// PROTOTYPE PROGRAM THAT DEMONSTRATES | |
// CONVERTING SNF TO WAV FORMAT | |
#include <string> | |
#include <fstream> | |
#include <iostream> | |
#include <filesystem> | |
namespace fs = std::filesystem; | |
typedef unsigned char BYTE; // 1 byte |
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
#ifndef java_util_Random | |
#define java_util_Random | |
/// this mimics the java.util.Random class using C language | |
/// ensure thread safety on your own as there is no synchronization | |
/// JavaRandom rand = MAKESEED(seed); // | |
typedef long long JavaRandom; // no need for classes! | |
/// for default constructor feed it millis since epoch | |
#define MAKESEED(seed) (((seed) ^ 0x5DEECE66DLL) & ((1LL << 48) - 1)) | |
#define UPDATESEED(seed) (((seed) * 0x5DEECE66DLL + 0xBLL) & ((1LL << 48) - 1)) |
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
/* Here are stored functions that | |
* mimic Baritone and Java internals | |
* just to simplify the converter*/ | |
// baritone.utils.pathing.PathingBlockType | |
enum PathingBlockType {AIR, WATER, AVOID, SOLID}; | |
// Base values used you need to know: | |
#define CACHED_REGION_MAGIC 0x1B2E5B7E // 456022910 BE! | |
#define CHUNK_NOT_PRESENT 0 |
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
-- bind to keypress MOSE:4 | |
-- halts movement till sound comes back | |
-- prevents kicking caused by outrunning server | |
-- basically waits for getting sound packets back | |
local player, horse, last_gallop, action, x, y, z, a, b, c, hi, lo, last | |
local unpack, format, sqrt = table.unpack, string.format, math.sqrt | |
local waitTick, runOnMC, getPlayer = waitTick, runOnMC, getPlayer | |
local logdel, gal = logdel, 420780262 |
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
-- event container open | |
local _, _, controls, name = ... | |
if name ~= "chest" then return end | |
if not craft_sync then return end -- craft script not invoked | |
if not craft_type then craft_type = "minecraft:cobblestone" end | |
if craft_type == "minecraft:ender_pearl" then craft_stack = 16 end | |
if not craft_stack then craft_stack = 64 end | |
-- making these local for efficiency | |
local clock, push, pop = os.clock, table.insert, table.remove |
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
// Example program | |
#include <iostream> // std::cout | |
#include <utility> // std::swap | |
using std::cout; | |
using std::swap; | |
struct Node { | |
int data; | |
Node* next; | |
Node* prev; |
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
[bits 16] | |
[org 0x7c00] | |
; BIOS loads it at ... or ... : | |
; CS:IP = 07c0:0000 | |
; CS:IP = 0000:7c00 | |
jmp word 0x0000:start | |
start: ; just to be sure it has proper origin | |
; loading machine code from floppy | |
mov ah, 2 ; int 13h service: read sectors |