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
#!/usr/bin/env python | |
import sys | |
import json | |
import base64 | |
try: | |
import WebKit | |
view = WebKit.WebView.alloc().init() | |
wso = view.windowScriptObject() |
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> | |
#include <stdlib.h> | |
#define NUM_VERTEX 10 | |
struct Vertex { | |
char name; | |
int mark; | |
struct Node* list; |
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> | |
#include <stdlib.h> | |
int main() { | |
int num, i, j, current, *data; | |
FILE* fp = fopen("input.txt", "r"); | |
num = 0; | |
while (fscanf(fp, "%d", ¤t) == 1) { | |
num ++; | |
} | |
data = (int*)malloc(num * sizeof(int)); |
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
<?php | |
$task = $argv[1]; | |
$num = intval($argv[2]); | |
$code = escapeshellarg($argv[3]); | |
@unlink ('/tmp/ao'); | |
$cc = 'gcc'; | |
`$cc -lm $code -o /tmp/ao`; |
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
<?php | |
function processPage($pdf, $page) { | |
$pdf->addPage (); | |
processSection ($pdf, $page['left'], 0); | |
processSection ($pdf, $page['right'], 147.5); | |
} | |
foreach (preparePapers(41) as $paper) { | |
processPage ($pdf, $paper['back']); |
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
// find links to convert | |
if (strstr($msg, 'http://')) | |
{ | |
$links = array(); | |
foreach (explode(' ', $msg) as $w) |
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
Array | |
( | |
[0] => Array | |
( | |
[index] => 1 | |
[name] => BATT | |
[level] => Futurist | |
) | |
[1] => Array |
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
<?php | |
$q = $_SERVER['QUERY_STRING']; | |
$o = array(); | |
if (preg_match_all('~longUrl=([^&]+)~', $q, $m)) { | |
foreach ($m[1] as $v) { | |
$url = urldecode($v); | |
if (substr($url, 0, 14) != 'http://lnw.me/' && !isset($o[$url])) { | |
$o[$url] = array( | |
'shortUrl' => file_get_contents('http://lnw.me/s/short.php?url=' |
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
function load() { | |
var prefix = 'http://tw.dt.in.th/thaiWitter/'; | |
if (window.location.href.substr(0, prefix.length) == prefix) { | |
// do some required work here | |
} | |
var mediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] | |
.getService(Components.interfaces.nsIWindowMediator); | |
var windows = mediator.getEnumerator(null); |
OlderNewer