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
while (runMainLoop) { | |
while (SDL_PollEvent(&event)) { | |
if (event.type == SDL_QUIT) { | |
runMainLoop = false; | |
} | |
} | |
keystate = SDL_GetKeyState(NULL); | |
buttonstate = SDL_GetMouseState(&mousex, &mousey); | |
cont->mouseMove(mousex, mousey); |
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
From 1f17ce8262b1c5194e061819af8fe1e9a2bb15b6 Mon Sep 17 00:00:00 2001 | |
From: aib <aibok42@gmail.com> | |
Date: Mon, 30 Jul 2012 04:00:34 +0300 | |
Subject: [PATCH] Added mod source directories to their corresponding Eclipse projects. | |
--- | |
eclipse/Client/.classpath | 2 ++ | |
eclipse/Client/.project | 10 ++++++++++ | |
eclipse/Server/.classpath | 2 ++ | |
eclipse/Server/.project | 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
(loop [last-tick-time (Sys/getTime)] | |
(let [current-time (Sys/getTime) | |
delta-seconds (- current-time last-tick-time)] | |
;tick game | |
(Display/update) | |
(if (not (should-quit?)) | |
(recur current-time)))) |
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
(defn coll-eq | |
"Recursively applies a binary predicate to two colls (of colls etc.) and returns the AND of the result." | |
[eq-fn x y] | |
(let [all (partial every? identity) | |
all-eq (comp all (partial map (partial coll-eq eq-fn)))] | |
(if (and (coll? x) (coll? y)) | |
(all-eq x y) | |
(eq-fn x y)))) | |
(def vec== (partial coll-eq ==)) |
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
.global someHash | |
.set someHashL, 0x04030201 | |
.set someHashH, 0x08070605 | |
someHash: .long someHashL, someHashH | |
-- | |
extern uint64_t someHash __asm__("someHash"); |
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> | |
#include <time.h> | |
void reshape(int width, int height) | |
{ | |
double aspect; | |
if (height == 0) height = 1; | |
aspect = width / height; |
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
http://divisiblezero.github.com/functionPainter/?red=127.5+%2B+127.5*%28sin%28%28x^y%29+%2B+t%2F67*1.5%29%29&blue=127.5+%2B+127.5*%28sin%28%28x^y%29+%2B+t%2F61*1.5%29%29&green=127.5+%2B+127.5*%28sin%28%28x^y%29+%2B+t%2F71*1.5%29%29 |
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
//My notes on doing XML stuff in Java, as simply as possible | |
//not production quality, obviously | |
//XML parsing | |
DocumentBuilder db = null; | |
try { | |
db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); | |
} catch (ParserConfigurationException e) { | |
} |
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
let a0 = 2^38 | |
let a1 = "lost in my ghci history" | |
let a2 = simpleHTTP (getRequest "http://www.pythonchallenge.com/pc/def/ocr.html") >>= getResponseBody >>= return . filter isAlpha | |
let a3 = simpleHTTP (getRequest "http://www.pythonchallenge.com/pc/def/equality.html") >>= getResponseBody >>= return . concatMap (!!1) . ((=~ "[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]") :: String -> [[String]]) | |
let a4_a = let dorq x = simpleHTTP (getRequest ("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" ++ x)) >>= getResponseBody in iterateUntilM (\x -> Debug.Trace.trace (show x) (not (x =~ "next nothing is")::Bool)) (dorq . last . words) "next nothing is 12345" | |
let a4_b = let dorq x = simpleHTTP (getRequest ("http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=" ++ x)) >>= getResponseBody in iterateUntilM (\x -> Debug.Trace.trace (show x) (not (x =~ "next nothing is")::Bool)) (dorq . last . words) "next nothing is 8022" |
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
-- | |
-- Table structure for table "site_cities" | |
-- | |
DROP TABLE IF EXISTS "site_cities" CASCADE; | |
CREATE TABLE "site_cities" ( | |
"city_id" serial NOT NULL, | |
"city_name" varchar(20) NOT NULL, | |
"plate_code" smallint NOT NULL, | |
"area_code" smallint NOT NULL, | |
"lat" decimal(20,8) NOT NULL, |
OlderNewer