- Write simple HTTP server in various languages
- Learn Lisp
- Learn LLVM
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
a: AM/PM | |
A: 0~86399999 (Millisecond of Day) | |
c/cc: 1~7 (Day of Week) | |
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
d: 1~31 (0 padded Day of Month) | |
D: 1~366 (0 padded Day of Year) | |
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
# this should be ran in the /home directory | |
# create "public_html/report" folder under their home dir if not exists | |
for u in *; | |
do mkdir -p "$u""/public_html"; | |
mkdir -p "$u""/public_html/report"; | |
chown -R $u:combo "$u""/public_html"; | |
chmod -R u+wrx,go+rx "$u""/public_html"; | |
done; |
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
do { | |
waiting[i] = true; | |
key = true; | |
while (waiting[i] && key) Swap(&key, &lock); | |
// critical tasks | |
j = (i + 1) % n; | |
while (i != j && !waiting[j]) j = (i + 1) % n; |
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 RECEIPT { | |
// a) | |
int receiptInt; | |
String tableStr; | |
// b) | |
private ArrayList<Item> orderedItemList; | |
public getItemList() { return orderedItemList; } | |
public setItemList(ArrayList<Item> list) { orderedItemList = list; } |
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
$(function(argument) { | |
// set target=_blank for all external links | |
// credit: http://stackoverflow.com/questions/2910946/test-if-links-are-external-with-jquery-javascript | |
var nodes = document.getElementsByTagName("a"), i = nodes.length; | |
var regExp = new RegExp("//" + location.host + "($|/)"); | |
while (i--) { | |
var href = nodes[i].href; | |
var isLocal = (href.substring(0,4) === "http") ? regExp.test(href) : true; | |
if (!isLocal) | |
nodes[i].target = "_blank"; |
When memory scares
- Memory ballooning will ask the virtual machine to select it's idle memory pages to be swapped.
- Memory swapping will brutally picks pages at random from the virtual machine.
So memory swapping often occurs when memory ballooning cannot effective free the memory, it will impacts the performance more.
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 <stdio.h> | |
#define INFINITE 18446744073709551615 | |
typedef unsigned long long ull; | |
int n; | |
ull flow[21]; | |
ull cost[21]; | |
ull minimal_cost; |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
int main() { | |
int case_n; | |
scanf("%d", &case_n); | |
while (case_n--) { | |
int v_a, v_b; |