Skip to content

Instantly share code, notes, and snippets.

View hlian's full-sized avatar
🦫
beaver

Hao Lian hlian

🦫
beaver
View GitHub Profile
@hlian
hlian / gist:963981
Created May 10, 2011 06:01
playerless
# Report 5 - Session 4 - Time Profile of game
SharkProfileViewer
# Generated from the visible portion of the outline view
+ 98.5%, start, game
| + 98.5%, main, game
| | + 90.0%, GLUTMainLoop(), game
| | | + 90.0%, glutMainLoop, GLUT
| | | | + 90.0%, -[GLUTApplication run], GLUT
| | | | | + 89.8%, __glutProcessWorkEvents, GLUT
| | | | | | + 89.8%, processWindowWorkList, GLUT
@hlian
hlian / gist:963973
Created May 10, 2011 05:56
regular play
# Report 3 - Session 3 - Time Profile of game
SharkProfileViewer
# Generated from the visible portion of the outline view
+ 96.9%, start, game
| + 96.9%, main, game
| | + 88.0%, GLUTMainLoop(), game
| | | + 88.0%, glutMainLoop, GLUT
| | | | + 88.0%, -[GLUTApplication run], GLUT
| | | | | + 87.1%, __glutProcessWorkEvents, GLUT
| | | | | | + 87.1%, processWindowWorkList, GLUT
@hlian
hlian / gist:961634
Created May 8, 2011 19:43
cos 426 video game profile report from shark
# Report 3 - Session 2 - Time Profile of game
SharkProfileViewer
# Generated from the visible portion of the outline view
+ 98.4%, start, game
| + 98.4%, main, game
| | + 91.9%, GLUTMainLoop(), game
| | | + 91.9%, glutMainLoop, GLUT
| | | | + 91.9%, -[GLUTApplication run], GLUT
| | | | | + 91.1%, __glutProcessWorkEvents, GLUT
| | | | | | + 91.1%, processWindowWorkList, GLUT
.data
NL: .asciiz "\n"
.text
main:
addi $sp, $sp, -4 # $sp := $sp+-4
sw $ra, 0($sp) # [$sp+0] := $ra
li $a0, 32000 # $a0 := 32000
li $v0, 9 # $v0 := 9
syscall
sw $v0, 0($gp) # [$gp+0] := $v0
[0x004000a4] 0x00165821 addu $11, $0, $22 ; 43: move $t3, $s6 # $t3 := $s6
(spim)
[0x004000a8] 0x00176021 addu $12, $0, $23 ; 44: move $t4, $s7 # $t4 := $s7
(spim)
[0x004000ac] 0x00041021 addu $2, $0, $4 ; 45: move $v0, $a0 # $v0 := $a0
(spim)
[0x004000b0] 0x34020005 ori $2, $0, 5 ; 46: li $v0, 5 # $v0 := 5
(spim)
[0x004000b4] 0x34040003 ori $4, $0, 3 ; 47: li $a0, 3 # $a0 := 3
(spim)
@hlian
hlian / echoservermultsocketserver.py
Created March 1, 2011 18:56
echoservermult.py implemented with SocketServer
#!/usr/bin/env python
from sys import argv, exit
import threading
import SocketServer
HOST = 'localhost'
#-----------------------------------------------------------------------
#!/usr/bin/env python
import random
import sys
print(1000)
def randfloat(a, b):
return random.random() * (b - a) + a
\documentclass[oneside, article, twocolumn]{memoir}
\usepackage{amsmath, microtype}
\usepackage[margin=0.5in]{geometry}
\usepackage[charter]{mathdesign}
% Line spacing.
\linespread{1.1}
% Vector norm notation.
\newcommand{\vectornorm}[1]{\left|\left|#1\right|\right|}
% arg max operator.
(defun tex-view ()
"Preview the last `.dvi' file made by running TeX under Emacs.
This means, made using \\[tex-region], \\[tex-buffer] or \\[tex-file].
The variable `tex-dvi-view-command' specifies the shell command for preview.
You must set that variable yourself before using this command,
because there is no standard value that would generally work."
(interactive)
(or tex-dvi-view-command
(error "You must set `tex-dvi-view-command'"))
;; Restart the TeX shell if necessary.
alert("hello!");