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
There are two types of interaction between devices and memory: | |
- Passive read | |
- Copy from RAM to device | |
- Copy from device to RAM | |
Passive reads work by "watching" the data/address bus when the CPU (or | |
other device) is writing to the RAM. Could keep sync a device internal | |
memory/buffer respect the changes that happens in these memory | |
block. This is simply implemented, reading the desired RAM block with | |
VComputer.RAM(). If a device does passive read to keep sync his |
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
DCPU-16 Specification | |
Copyright 1985 Mojang | |
Version 1.7 | |
=== SUMMARY ==================================================================== | |
* 16 bit words | |
* 0x10000 words of ram |
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 GL_GLEXT_PROTOTYPES | |
#include <GLFW/glfw3.h> | |
#include <cstdlib> | |
#include <cstdio> | |
#include <cstring> | |
#include <cmath> | |
#include <algorithm> | |
#include <fstream> |
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> | |
using namespace std; | |
template <typename T, typename = typename std::enable_if<std::is_floating_point<T>::value, void>::type> | |
constexpr T pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798; | |
int main() | |
{ | |
float radiusf; |
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
DCPU-16 Specification | |
Copyright 1985 | |
Version 1.7 | |
=== SUMMARY ==================================================================== | |
* 16 bit words | |
* 0x10000 words of ram | |
* 8 registers (A, B, C, X, Y, Z, I, J) | |
* program counter (PC) |
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
# Determine whether, in any state, the expected chosen prize is greater than the maximum prize | |
from itertools import combinations | |
from math import log, exp | |
cases = {1,10,100,1000} | |
maxprize = 200 | |
s = set.union(*[set(combinations(cases, i)) for i in range(1, len(cases)+1)]) | |
ss = sorted(s) |
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
def __make_init(*argnames): | |
def __init__(self, *args): | |
expected = len(argnames) | |
actual = len(args) | |
if expected != actual: | |
s = '' if expected == 1 else 's' | |
raise TypeError("__init__() takes exactly {expected} argument{s} ({actual} given)".format(**locals())) | |
for (arg, argname) in zip(args, argnames): | |
setattr(self, argname, arg) | |
return __init__ |
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
# | |
# ~/.bashrc | |
# | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
alias ls='ls --color=auto' | |
# Play a directory |
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
cat pacman.log | grep ' installed' | cut -d ' ' -f 5 | uniq | wc -l | |
for directory in $(ls -lAFp | grep '/' | sed 's/\///' | cut -f 2 --d ':' | cut -f 2 --delim ' '); do cd $directory; echo -n "$directory "; sudo find | wc -l; cd ..; done | |
find . -name "*.[ch]" | xargs etags -o ~/.tags/TAGS | |
pavucontrol |
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
syntax on | |
nnoremap ; : | |
nnoremap : ; | |
" Sane auto-completion | |
set wildmode=list:longest,longest | |
" Set working directory to the current file automatically | |
set autochdir |
OlderNewer