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
// My investigations on the C standard compliance of Gob and related techniques: | |
// https://gist.github.com/pervognsen/5249a405fe7d76ded1cf08ed50fa9176 | |
#pragma once | |
#include <stdint.h> | |
#pragma pack(push, 8) | |
#if __cplusplus >= 201103L || (__cplusplus && _MSC_VER >= 1900) |
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
max(-x,-y) = -min(x,y) | |
min(-x,-y) = -max(x,y) | |
abs(x) = abs(-x) | |
abs(x) = max(x,-x) = -min(x,-x) | |
abs(x*a) = if (a >= 0) abs(x)*a | |
(a < 0) -abs(x)*a | |
// basically any commutative operation | |
min(x,y) + max(x,y) = x + y |
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
#!/usr/local/bin/python3.2 | |
""" | |
Python interpreter for the esoteric language ><> (pronounced /ˈfɪʃ/). | |
Usage: ./fish.py --help | |
More information: http://esolangs.org/wiki/Fish | |
Requires python 2.7/3.2 or higher. |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
GameBoy Color DMA-Transfers v0.0.1 13.04.2000/GPZ-HIT | |
------------------------------------------------------------------------------- | |
"old" DMA Transfer (aka 'OAM-DMA') | |
---------------------------------- | |
source: - anywhere from $0000 to $dfff | |
- must be page-aligned | |
destination: - always OAM-Ram at $fe00 - $fe8f | |
length: - always 4*40 (=160 / $a0) bytes |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
window.gobmod={}; | |
window.gobmod.attachPlayer = function(elem){ | |
elem = $(elem); | |
var player = new Element('a',{'class':'modplaybutton', href: '#'}); | |
player.innerHTML='>' | |
elem.insert({top: player}); | |
// Start playback | |
var startPlayback=function(){ |
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
ChDir "C:\Program Files (x86)\CoolBasic" | |
// CBRAYCASTER | |
// ----------- | |
// Esimerkin näppäimet: | |
// - Enter: Vaihtaa debug-tilaa | |
// - Välilyönti: Generoi kartan uudelleen | |
// - Hiiren rulla: Muuttaa kartan satunnaisuuden astetta | |
// - WASD: Liikuttaa objektia | |
// - Nuolet vasen-oikea: Kääntää objektia |
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
#!/usr/bin/env python3 | |
# ircecho.py | |
# Copyright (C) 2011 : Robert L Szkutak II - http://robertszkutak.com | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 3 of the License, or | |
# (at your option) any later version. | |
# |