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
""" | |
Cleaner interaction with class. | |
Make sure to set the run-time path: | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$matlabroot/bin/$arch:$matlabroot/sys/os/$arch | |
""" | |
# import the FFI |
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/bash | |
mkdir old_bundles | |
for dir in $(ls vim/bundle) | |
do | |
url=$(cat vim/bundle/$dir/.git/config | grep url | cut -d= -f2) | |
echo "found $url" | |
mv vim/bundle/$dir old_bundle | |
git submodule add $url vim/bundle/$dir | |
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
How easy is it to publish from VIM? |
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
# coding: utf-8 | |
import xml.dom.minidom as md | |
import sys; sys.path.append('/usr/local/lib/python2.7/dist-packages') | |
import whoosh | |
from whoosh.index import create_in | |
from whoosh.fields import * | |
posts = md.parse('Posts.xml') | |
nontext = [n for n in posts.childNodes[0].childNodes if not isinstance(n, md.Text)] | |
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
# coding: utf-8 | |
import xml.dom.minidom as md | |
import sys; sys.path.append('/usr/local/lib/python2.7/dist-packages') | |
import whoosh | |
from whoosh.index import create_in | |
from whoosh.fields import * | |
posts = md.parse('Posts.xml') | |
nontext = [n for n in posts.childNodes[0].childNodes if not isinstance(n, md.Text)] | |
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 cStringIO | |
import sqlite3 | |
import mailbox | |
def index_mailbox(db, mailbox, tablename): | |
# create table | |
q = "create virtual table %s using fts4(content text);" | |
q %= tablename | |
db.execute(q) |
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
# coding: utf-8 | |
""" | |
tbl_name messages | |
sql CREATE TABLE messages (date text, sender text, subject text, headers text, | |
tags text) | |
tbl_name parts | |
sql CREATE TABLE parts | |
( |
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 cherrypy | |
import StringIO | |
js = """ | |
function image_adder(xhr, out) { | |
return function() { | |
if (xhr.readyState == 4 && xhr.status == 200) { | |
var img = document.createElement('img') | |
img.src = 'data:image/png;base64,' + xhr.responseText; | |
out.insertBefore(img, out.children[0]); |
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 sqlite3 | |
import json | |
def queued(f): | |
return f | |
class TableStore(object): | |
def __init__(self, db, name): | |
self.db = db |
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
<html> | |
<script src="tvbsurf.json"></script> | |
<script src="three.min.js"></script> | |
<script src="threetrackballcontrols.js"></script> | |
<script> | |
function go() { | |
geo = new THREE.Geometry(); | |
var i, vi, fi; | |
for (i=0; i<SURF.vertices.length; i++) { | |
vi = SURF.vertices[i]; |
OlderNewer