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
// see http://stackoverflow.com/questions/5180382/convert-json-data-to-a-html-table | |
// Builds the HTML Table out of myList. | |
function buildHtmlTable(myList) { | |
var res = '<table>'; | |
var columns = []; | |
var headerTr$ = $('<tr/>'); | |
for (var i = 0; i < myList.length; i++) { | |
var rowHash = myList[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
def count_words(s, n): | |
"""Return the n most frequently occuring words in s ordered by number | |
of ocurrences and alfabetically.""" | |
ws = {} | |
for w in s.split(): | |
if w in ws.keys(): | |
ws[w]+=1 | |
else: | |
ws[w]=1 |
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 bson | |
bs = open('filename.bson').read() | |
b = bson.BSON(bs) | |
for line in bson.decode_all(b): | |
# do stuff | |
#del(line['_id']) |
NewerOlder