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
//// | |
//// | |
//// GB.H | |
//// | |
//// | |
// NOTE(bumboni): GameBoy technical data | |
// | |
// CPU: LR25902 | |
// Clock speed: 4.194304MHz |
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 pygame; | |
import math; | |
pygame.init(); | |
pygame.display.init(); | |
pygame.display.set_mode(size=(600,400)); | |
to_render = [ | |
# bottom edge | |
[(0,0,0), (0,0,1), (1,0,0)], |
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
print('enter row count:'); | |
row_count = int(input()); | |
print('enter col count:'); | |
col_count = int(input()); | |
print(f'creating matrix size %dx%d' % (col_count, row_count)); | |
m = []; |
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
n = 10 | |
# stack data | |
class t_stack: | |
arr = 0; | |
top = 0; | |
def __init__(self): | |
self.arr = []; |
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 script correctly sorts strings that contain mix of characters | |
# and numbers. | |
# For example it is common for files in filesystems to | |
# have the following names: | |
# "file1" | |
# "file2" | |
# ... | |
# "file10" | |
# Though most operating systems sort blindly by comparing |
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<stdbool.h> | |
#include<stdio.h> | |
#define WIN32_LEAN_AND_MEAN | |
#include<Winsock2.h> | |
#include<Ws2tcpip.h> | |
#define nil ((void *)0) | |
#define kb 1024 |
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
#define LO32(x) (x&((UINT64_C(1)<<32)-1)) | |
#define HI32(x) (x >> 32) | |
// Returns the high 64-bits of the 128-bit result. | |
// the `result` variable specifies the address of the low 64-bits | |
static uint64_t add_u64(uint64_t *result, uint64_t a, uint64_t b) | |
{ | |
uint64_t al = LO32(a); | |
uint64_t ah = HI32(a); |
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
package main; | |
import ( | |
"fmt" | |
"net/http" | |
"io" | |
"os" | |
"path" | |
"path/filepath" | |
"github.com/fsnotify/fsnotify" |
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<stdio.h> | |
#pragma message "Enable SSE? (Enter 0 or 1)" | |
enum { | |
sse = | |
#include</dev/stdin> | |
}; | |
#pragma message "Enable Logging? (Enter 0 or 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
// This code is Public Domain | |
// General information: | |
// Thread safety: none, wrap in a mutex or something | |
// Allocator type: combination of freelist and bitmap allocator | |
// Usage: | |
// include bballoc.h in every file that uses functionality from the library. | |
// define bballoc_implementation in EXACTLY one of the files. |
OlderNewer