This file contains hidden or 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
-- Old table with types that are too big | |
create table forecast_base_0 ( | |
key_id bigint not null, | |
time timestamp without timezone not null, | |
value double precision, | |
primary key (key_id, time) | |
); | |
-- New table with smaller types | |
create table forecast_base_1 ( |
This file contains hidden or 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
// Inspired by https://www.reddit.com/r/programming/comments/400wpy/andrei_alexandrescus_amazing_150_minutes_course/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/resource.h> | |
#include <sys/times.h> | |
#include <time.h> | |
#define NUM_POWERS 19 |
This file contains hidden or 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
build: " git 2016-01-03 00:51" | |
mods: | |
- xcom1 | |
time: | |
year: 1999 | |
minute: 6 | |
weekday: 5 | |
month: 1 | |
hour: 16 | |
day: 21 |
This file contains hidden or 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
Uint32 MESSAGE_EVENT = SDL_RegisterEvents(1); | |
/* In a thread dealing with network stuff */ | |
while () { | |
shared_ptr<Message> message = read_message_from_network(); | |
SDL_Event evt; | |
evt.type = MESSAGE_EVENT; | |
evt.user.data1 = // what? |
This file contains hidden or 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
// TO COMPILE: gcc -o test colour_key_conversion_test.c -lSDL2 | |
// AND RUN: ./test | |
#include <stdio.h> | |
#include <SDL2/SDL.h> | |
// smiley face image with transparency | |
unsigned short pixel_data[] = { | |
0xB54A, 0xB54A, 0xB54A, 0xB54A, 0xB54A, |
This file contains hidden or 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
EC10FC27 // mov 10000,$r12 | |
E402F400 // mov 2,$r4 | |
364C // slt $r4,$r12,$r6 | |
D602 // br $r6,L6 | |
C01D // jmp main$exit | |
E102F100 // mov 2,$r1 | |
3714 // slt $r1,$r4,$r7 | |
D70B // br $r7,L10 | |
1341 // sub $r4,$r1,$r3 | |
D304 // br $r3,L21 |
This file contains hidden or 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
main:: | |
mov 10000, $r12 | |
mov 2, $r4 | |
L26: | |
slt $r4, $r12, $r6 | |
br $r6, L6 | |
L5: | |
jmp main$exit | |
L6: | |
mov 2, $r1 |
This file contains hidden or 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 <stdio.h> | |
void main() { | |
int max; | |
max = 10000; | |
int candidate; | |
candidate = 2; | |
while (candidate < max) { |
This file contains hidden or 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
__ | |
| __ |__| __| | |
|__ |__| | | |__| | |
__ __ | |
|__ |__| | | | |
| | | | |__ | | |
__ __ | |
| |__| | | |
This file contains hidden or 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
step(0, []). | |
step(1,[1]). | |
step(2,[2]). | |
step(3,[3]). | |
step(N,[H|T]) :- | |
N > 0, | |
member(H, [1,2,3]), | |
Remaining is N - H, | |
Remaining > 0, |