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
Index: lib/clyther/tests/test_integer_ops.py | |
=================================================================== | |
--- lib/clyther/tests/test_integer_ops.py (revision 71) | |
+++ lib/clyther/tests/test_integer_ops.py (working copy) | |
@@ -178,6 +178,22 @@ | |
_test_unary_minus.func(a, output) | |
self.failUnlessEqual(clout.item(), output[0]) | |
+ | |
+ def test_mod(self): |
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
// === === === === === === === | |
//CLyther Module | |
struct _array_desc_ { | |
size_t start[3]; | |
size_t stop[3]; | |
size_t step[3]; | |
size_t shape[3]; | |
size_t size; | |
}; |
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
Index: lib/clyther/api/ast/astgen.py | |
=================================================================== | |
--- lib/clyther/api/ast/astgen.py (revision 68) | |
+++ lib/clyther/api/ast/astgen.py (working copy) | |
@@ -584,6 +584,14 @@ | |
return ast.Bitor( cl_nodes, node.lineno ), nd_type | |
+ def visitBitxor(self,node): | |
+ nd, nd_type = self.dispatch(node.nodes[0]) |
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
import clyther | |
import copencl as cl | |
@clyther.kernel | |
def broken(a): | |
b = a << 2 | |
c = a >> 2 | |
if __name__ == '__main__': | |
clyther.init('GPU') |
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 | |
from __future__ import division | |
import nltk | |
nltk.data.path.append('/Users/mike/.nltk_data') | |
inaugural = nltk.corpus.inaugural | |
with open('./sentence_lengths.csv', 'w') as out: | |
for fileid in inaugural.fileids(): |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <OpenCL/opencl.h> | |
const char *KernelSource = "\n" \ | |
"#define DELTA 0x9e3779b9 \n" \ | |
"#define ENC_ROUND(sum)" \ | |
"{ " \ |
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
import sys | |
import mapnik2 | |
import cairo | |
prj = mapnik2.Projection("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") | |
m = mapnik2.Map(1280, 768, prj.params()) | |
m.background = mapnik2.Color('white') | |
district_lyr = mapnik2.Layer('Districts') | |
district_lyr.datasource = mapnik2.PostGIS( |
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
import sys | |
import mapnik2 | |
import cairo | |
prj = mapnik2.Projection("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") | |
m = mapnik2.Map(1280, 768, prj.params()) | |
m.background = mapnik2.Color('white') | |
district_lyr = mapnik2.Layer('Districts') | |
district_lyr.datasource = mapnik2.PostGIS( |
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
# -*- mode: python; -*- | |
def exampleCheck(context): | |
context.Message('Custom check...') | |
return context.Result(True) | |
env = Environment() | |
conf = Configure(env, custom_tests={'ExampleCheck': exampleCheck}) | |
# Always prints 'Custom check...(cached)', even when not cached |
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 logging | |
import pymongo | |
import datetime | |
class MongoHandler(logging.Handler): | |
""" | |
A logging handler that will record messages to a (optionally capped) | |
MongoDB collection. |