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
VERSION = \"1.0.0\" | |
PREFIX ?= out | |
INCDIR = include | |
SRCDIR = src | |
LANG = c | |
OBJDIR = .obj | |
MODULE ?= binary_name | |
CC ?= gcc |
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
require 'fiddle' | |
SIZEOF_HEAP_PAGE_HEADER_STRUCT = Fiddle::SIZEOF_VOIDP | |
SIZEOF_RVALUE = 40 | |
HEAP_PAGE_ALIGN_LOG = 14 | |
HEAP_PAGE_ALIGN = 1 << HEAP_PAGE_ALIGN_LOG # 2 ^ 14 | |
HEAP_PAGE_ALIGN_MASK = ~(~0 << HEAP_PAGE_ALIGN_LOG) # Mask for getting page address | |
REQUIRED_SIZE_BY_MALLOC = Fiddle::SIZEOF_SIZE_T * 5 # padding needed by malloc | |
HEAP_PAGE_SIZE = HEAP_PAGE_ALIGN - REQUIRED_SIZE_BY_MALLOC # Actual page size |
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 _GNU_SOURCE 1 | |
#include <sched.h> // sched_setaffinity | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <pthread.h> | |
#include <assert.h> | |
#include <sys/time.h> |
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
defmodule Statistik.User do | |
use Statistik.Model | |
schema "users" do | |
field :email, :string | |
field :password, :virtual | |
field :password_confirmation, :virtual | |
field :encrypted_password, :string | |
end |
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
defmodule L do | |
# lc x inlist [0, 1], y inlist [:a, :b], do: {x, y} | |
defmacro do_list(list) do | |
args = 1..length(list) | |
|> Enum.map(fn x -> binary_to_atom(<<?a + x :: utf8>>) end) | |
|> Enum.map(fn x -> {x, [], :Elixir} end) # this creates AST nodes for variables | |
pairs = Enum.zip(args, list) | |
|> Enum.map(fn {v, lst} -> | |
quote do |
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
defmodule P do | |
def product([]) do | |
[] | |
end | |
def product(lists) do | |
product(lists, []) | |
end | |
def product([h|t], args) do |
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 Math;R1=1.0; R2=2.0;K2=5.0 | |
SS=40;K1=SS*K2*3/(8*(R1+R2));def rf(a, b) | |
cosA=cos(a);sinA=sin(a);cosB=cos(b);sinB=sin(b) | |
o=Array.new(SS).fill{Array.new(SS).fill(' ')};b=Array. | |
new(SS).fill{ Array.new(SS).fill(0)}; t=0.0;while t<2*PI | |
cost=cos(t);sint=sin(t);p=0.0;while p<2*PI;cosp=cos(p);sinp= | |
sin(p);cx=R2+R1*cost;cy=R1* sint;x=cx*(cosB*cosp+sinA* | |
sinB*sinp)-cy*cosA*sinB; y=cx*(sinB*cosp-sinA*## | |
cosB*sinp)+cy*cosA*cosB ;z=K2+cosA*cx*sinp+cy* | |
sinA;ooz=1/z;xp=(SS/2+K1* ooz*x).to_i ;yp= (SS/2- |
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
class Babby < PragnentGirl::GetPragnent | |
attr_accessible :name, :mother, :location, :pragnent_girl_id | |
belongs_to :pragnent_girl | |
before_save :destroy_instain_mothers | |
after_save :pary_for_father | |
#How is babby formed? |
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
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger ([email protected]) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |