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
// We're writing this code in 32-bit protected mode for now | |
.code32 | |
// Declare multiboot header creation constants | |
.set ALIGN, 1 << 0 // Align loaded modules on page boundaries | |
.set MEMINFO, 1 << 1 // Provide memory map | |
.set FLAGS, ALIGN | MEMINFO // Multiboot 'flag' field | |
.set MAGIC, 0x1BADB002 // Magic number helps bootloader find the header | |
.set CHECKSUM, -(MAGIC + FLAGS) // Checksum of the above to prove it's multiboot |
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
/* The bootloader will look at this image and start execution at the symbol | |
designated as the entry point. */ | |
ENTRY(_bootstrap) | |
/* Tell where the various sections of the object files will be put in the final | |
kernel image. */ | |
SECTIONS | |
{ | |
/* Begin putting sections at 1 MiB, a conventional place for kernels to be | |
loaded at by the bootloader. */ |
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
[17:05][joshua@archbox][~/Documents/Projects/tupai-dev] readelf --relocs build-default/kernel/x86/amd64/arch.o | |
Relocation section '.rela.text' at offset 0x6a0 contains 1 entries: | |
Offset Info Type Sym. Value Sym. Name + Addend | |
000000000002 000500000001 R_X86_64_64 0000000000000000 .rodata.str1.1 + 0 | |
Relocation section '.rela.debug_info' at offset 0x6b8 contains 25 entries: | |
Offset Info Type Sym. Value Sym. Name + Addend | |
000000000006 00080000000a R_X86_64_32 0000000000000000 .debug_abbrev + 0 | |
00000000000c 000b0000000a R_X86_64_32 0000000000000000 .debug_str + b3 |
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
#include <iostream> | |
#include <mutex> | |
#include <unordered_map> | |
namespace PtrTest | |
{ | |
/* Definitions */ | |
typedef long id_t; | |
const id_t ID_INVALID = -1; |
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
import krpc, time, math | |
conn = krpc.connect(name = "PID Hover") | |
vessel = conn.space_center.active_vessel | |
# Find the craft height (altitude from command module and bottom of craft are different) | |
bbox = vessel.bounding_box(vessel.reference_frame) | |
HEIGHT = max(abs(bbox[0][1]), abs(bbox[1][1])) | |
print("Now controlling '" + vessel.name + "'") |
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
#![allow(unused_imports)] | |
#![allow(dead_code)] | |
extern crate core; | |
use core::ops::{ | |
Add, Sub, Mul, Div, | |
AddAssign, SubAssign, MulAssign, DivAssign, | |
}; | |
use core::fmt; |
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
// Run like: ./bf <myfile.bf> | |
#include<stdio.h> | |
main(int u,int**v){char t[1<<12]={0,},c[1<<16];int m=fread(c,1,1<<16,fopen(*++v,"r")); | |
char*p=t,n=0,x=0,*i=c;for(;i-c<m;){ | |
*i==62?p++:*i==60?p--:*i==43?++*p:*i==45?--*p:*i==46?write(1,p,1):*i==44?read(0,p,1):0; | |
if((*i==91&&!*p)||(*i==93&&*p)){*p?n--:n++;for(;n;)*(*p?--i:++i)==91?n++:*i==93?n--:0;*p?0:i--;}i++;}} |
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
import random | |
by_word = True | |
text = open("test.txt").read().replace(" ", " ") | |
if by_word: | |
text = text.split(" ") | |
freq = {} |
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
/// | |
/// This code is procedurally generated using the 4th-order Markov chain generator | |
/// | |
/// Original training material: https://github.com/vurtun/nuklear/blob/master/nuklear.h | |
/// | |
const struct nk_image s; | |
* a = (nk_byte) tmp[3]; | |
} | |
NK_API void |
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
struct Client { | |
jobs: Jobs, | |
depot: PostDepot, | |
} | |
impl Client { | |
fn new() -> Client { | |
Client { jobs: Jobs::new(), depot: PostDepot::new() } | |
} | |
OlderNewer