Skip to content

Instantly share code, notes, and snippets.

View XanClic's full-sized avatar

Hanna Czenczek XanClic

View GitHub Profile
#ifndef ALIGN_ALLOCATOR_HPP
#define ALIGN_ALLOCATOR_HPP
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <stdexcept>
#include <vector>
use16
org 0x7c00
cli
jmp far 0x0000:_start
gdtd:
dw gdt_end - gdt - 1
dd gdt
use16
org 0x7c00
cli
jmp far 0x0000:_start
gdtd:
dw gdt_end - gdt - 1
dd gdt
#!/usr/bin/env ruby
# coding: utf-8
require 'shellwords'
def die(msg)
$stderr.puts(msg)
exit 1
end
#!/usr/bin/env ruby
# coding: utf-8
require 'shellwords'
PARALLEL_COPY = '~/bin/parallel-ssh-copy.rb'
def die(msg)
$stderr.puts(msg)
#!/usr/bin/env ruby
# coding: utf-8
require 'shellwords'
PARALLEL_COPY = '~/bin/parallel-ssh-copy.rb'
def die(msg)
$stderr.puts(msg)
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
#include <cstdio>
class Foo {
public:
Foo(int x): v(x) {}
Foo(const Foo &f) = delete;
Foo &operator>> (int x) { v >>= x; return *this; }
Foo &operator>>=(int x) { v >>= x; return *this; }
#!/usr/bin/env ruby
# coding: utf-8
MORSE_DICT = {
'a' => '.-',
'b' => '-...',
'c' => '-.-.',
'd' => '-..',
'e' => '.',
'f' => '..-.',
f(x)
= (1/(σ sqrt(2π)) e^(-1/2 x^2/σ^2))''
= (1/(σ sqrt(2π)) (e^(-1/2 x^2/σ^2) · -x/σ^2))'
= 1/(σ sqrt(2π)) (e^(-1/2 x^2/σ^2) · -x/σ^2 · -x/σ^2 + e^(-1/2 x^2/σ^2) · -1/σ^2)
= 1/(σ sqrt(2π)) (e^(-1/2 x^2/σ^2) · x^2/σ^2 + e^(-1/2 x^2/σ^2) · -1/σ^2)
f(σ) = 1/(σ sqrt(2π)) (e^(-1/2) · 1 + e^(-1/2) · -1)
= 1/(σ sqrt(2π)) (e^(-1/2) - e^(-1/2))
= 0