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
class CrazyBuffer(object): | |
def __init__(self): | |
self._buffer = StringIO() | |
def write(self, data): | |
self._buffer.write(data) | |
def close(self): | |
pass | |
def get_value(self): | |
return self._buffer.getvalue() | |
def reset(self): |
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 | |
class ParseError(ValueError): | |
pass | |
class Regex(object): | |
def __init__(self, tree): | |
self.tree = tree |
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 from_sqlalchemy(self, obj) | |
from sqlalchemy.orm import class_mapper, ColumnProperty | |
columns = [prop.key for prop in class_mapper(obj.__class__).iterate_properties | |
if isinstance(prop, ColumnProperty)] | |
for column in columns: | |
if column in self: | |
self[column].data = getattr(obj, column) |
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
" Remove trailing whitespace | |
fun! StripTrailingSpaces() | |
if (&ft=='markdown') | |
finish | |
endif | |
normal ms | |
%s/\s\+$//e | |
call histdel("/", -1) | |
normal `s | |
endfun |
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
Uint8Array.prototype.indexOfMulti = function(searchElements, fromIndex) { | |
fromIndex = fromIndex || 0; | |
var index = Array.prototype.indexOf.call(this, searchElements[0], fromIndex); | |
if(searchElements.length === 1 || index === -1) { | |
// Not found or no other elements to check | |
return index; | |
} | |
for(var i = index, j = 0; j < searchElements.length && i < this.length; i++, j++) { |
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
1. Was zeichnet Data Mining gegenüber Mustererkennung aus? !!! | |
DM ist die Analyse von großen Datenbeständen nach neuem, nützlichen Wissen. | |
2. Abgrenzung DM / Information Retrieval | |
- "Googlesuche nach Stichwort": IR | |
- "Gruppierung der Resultate nach Sprache": DM | |
- Klickpfadanalyse: DM | |
- Bildersuche in Personendatenbank: IR |
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
* Due to Oracle no longer providing the distro-friendly DLJ bundles, the package | |
* has become fetch restricted again. Alternatives are switching to | |
* dev-java/icedtea-bin:6 or the source-based dev-java/icedtea:6 | |
* | |
* Oracle requires you to download the needed files manually after | |
* accepting their license through a javascript capable web browser. | |
* | |
* Downlod the following files: | |
* jdk-6u38-linux-x64.bin | |
* at 'http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html' |
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
"use strict"; | |
var request = require('request'), | |
cheerio = require('cheerio'); | |
function loginSEOpenID(email, password, callback) { | |
console.log('SE OpenID: Loading login form'); | |
request.get({ | |
url: 'https://openid.stackexchange.com/account/login' | |
}, function(error, response, body) { |
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 | |
tmux new-session -d | |
WIN=$(tmux new-window -dP) | |
tmux select-layout -t "$WIN" tiled |
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
local avatar = ARGV[1] | |
local user_events = redis.call('ZRANGE', 'user_events:'..avatar, 0, -1) | |
local res = {} | |
for i, event in ipairs(user_events) do | |
res[event] = redis.call('SMEMBERS', 'user_event_roles:'..avatar..':'..event) | |
end | |
return cjson.encode(res) |