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 function that converts a PostGIS query into a GeoJSON object. | |
* Copyright (C) 2012 Samuel Giles <sam@sam-giles.co.uk> | |
* | |
* This program is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* This program is distributed in the hope that it will be useful, |
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
var config = module.exports; | |
config["The Tests"] = { | |
env: "browser", | |
rootPath: ".", | |
tests:[ | |
"*-test.js" | |
] | |
}; |
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 <pthread.h> | |
#include <stdlib.h> | |
#include <time.h> | |
void count3s_thread(int id); | |
int* array; | |
int length = 100000; | |
int t = 2; |
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
#!/bin/sh | |
curl "http://forecast.io/forecast?q=51.4957,-0.2149&satellites" -H "If-None-Match: \"-852332961\"" -H "Accept-Encoding: application/json" -H "Host: forecast.io" -H "Accept-Language: en-US,en;q=0.8" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" -H "Accept: */*" -H "Referer: http://forecast.io/" -H "X-Requested-With: XMLHttpRequest" -H "Cookie: _gauges_unique_hour=1; _gauges_unique_day=1; _gauges_unique_month=1; _gauges_unique_year=1; _gauges_unique=1; __utma=188038335.1999350163.1370437973.1370437973.1370437973.1; __utmb=188038335.2.10.1370437973; __utmc=188038335; __utmz=188038335.1370437973.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)" -H "Connection: keep-alive" -H "Cache-Control: max-age=0" | awk -F"[,:]" '{for(i=1;i<=NF;i++){if($i~/time\042/){ print system("date -j -r" $(i+1) " +%d/%m:%H:%M")} if ($i~/summary\042/){print $(i+1)}} }' | egrep -v '^0$' | less |
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
def _malloc_signed(initial_value): | |
SIGNEDP = lltype.Array(lltype.Signed) | |
value = lltype.malloc(SIGNEDP, 1, flavor="raw") | |
value[0] = initial_value | |
return value | |
----------------------------------------------------------------------------------------------- | |
[translation:info] assert not signature.has_kwarg() # XXX should not happen? | |
[translation:ERROR] AssertionError | |
[translation:ERROR] Processing block: |
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
make wlvlang-jit PYPYPATH=~path/to/pypy | |
# This should pass | |
make test_all_jit | |
# Unfortunately the path to the script needs to be relative! (I should fix that) | |
bin/wlvlang-jit tests/benchmarks/thread-ring.wl 10 10 | |
# This should cause a segfault or: | |
# |
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
void test_vec(double* restrict a, double* restrict b) { | |
int i; | |
double *x = __builtin_assume_aligned(a, 16); | |
double *y = __builtin_assume_aligned(b, 16); | |
for(i = 0; i < SIZE; i++) { | |
x[i] = x[i] + y[i]; | |
} | |
} |
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
import sys | |
import os | |
def pythonpath(): | |
# Remove filter if you don't care about cases such as: ':/path::', where members of the path are | |
# empty. It would be slightly faster to complete this operation if the filter was not run but the size of the | |
# input is likely to be small | |
os.pathsep.join(filter(lambda path: len(path) > 0, sys.path)) |
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 "course.module" | |
PROC producer(VAL INT start, step, CHAN OF INT c!) | |
INT count: | |
SEQ | |
count := start | |
WHILE TRUE | |
SEQ | |
c ! count | |
count := count + step |
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 "course.module" | |
PROTOCOL CONTROL | |
CASE | |
poison | |
: | |
PROTOCOL TAGGED.INT | |
CASE | |
normal; INT |
OlderNewer