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
_strlen: | |
push rcx ; save and clear out counter | |
xor rcx, rcx | |
_strlen_next: | |
cmp [rdi], byte 0 ; null byte yet? | |
jz _strlen_null ; yes, get out |
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 <GL/glut.h> | |
void resize(int width, int height) { | |
// avoid div-by-zero | |
if (height == 0) { | |
height = 1; | |
} | |
// calculate the aspect ratio |
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
x = 10 |
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 <stdlib.h> | |
#include <cairo/cairo.h> | |
#include <gtk/gtk.h> | |
#include <gdk/gdk.h> | |
#define N_VERTS 5 | |
#define WIN_WIDTH 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
; compiled on linux 64 bit using the following | |
; | |
; nasm -f elf32 print.asm -o print.o | |
; gcc -m32 print.o -o print | |
; | |
[bits 32] | |
section .text |
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
; ######################################################################### | |
.386 | |
.model flat, stdcall | |
option casemap :none | |
; ######################################################################### | |
include windows.inc |
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
singleton :: a -> Tree a | |
singleton x = Node x EmptyTree EmptyTree | |
treeInsert :: (Ord a) => a -> Tree a -> Tree a | |
treeInsert x EmptyTree = singleton x | |
treeInsert x (Node a left right) | |
| x == a = Node x left right | |
| x < a = Node a (treeInsert x left) right | |
| x > a = Node a left (treeInsert x right) |
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
-- | Seeds a list of cards with a random value | |
seedCards :: StdGen -> [Card] -> [(Card, Int)] | |
seedCards g [] = [] | |
seedCards g (c:cs) = x:seedCards ng cs | |
where (seed, ng) = randomR(1, 10000) g :: (Int, StdGen) | |
x = (c, seed) | |
-- | Makes an ordered deck of cards | |
makeDeck :: [Card] | |
makeDeck = [Card v s | v <- [Ace .. King], s <- [Heart .. Spade]] |
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
; ######################################################################### | |
.code | |
start: | |
invoke GetModuleHandle, NULL ; provides the instance handle | |
mov hInstance, eax | |
invoke GetCommandLine ; provides the command line address | |
mov szCommandLine, eax |
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 ( | |
"os" | |
"encoding/json" | |
"net/http" | |
"strconv" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/handlers" |
NewerOlder