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 | |
# Knuth-Morris-Pratt demonstration | |
# Kyle Gorman <[email protected]> | |
# | |
# A naive Python implementation of a function that returns the (first) index of | |
# a sequence in a supersequence is the following: | |
def subsequence(needle, haystack): | |
""" | |
Naive subsequence indexer; None if not found |
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 | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import time | |
import email | |
import poplib | |
import imaplib | |
import cStringIO |
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
// created by zhanglei http://www.love4026.org at 2011-2-23 | |
var img=document.getElementsByTagName('img');function getElementsByClassName(strClassName){var arrElements=document.all?document.all:document.getElementsByTagName('*');var arrReturnElements=new Array();strClassName=strClassName.replace(/\-/g,"\\-");var oRegExp=new RegExp("(^|\\s)"+strClassName+"(\\s|$)");for(var i=0;i<arrElements.length;i++){if(oRegExp.test(arrElements[i].className)){arrReturnElements.push(arrElements[i]);}}return(arrReturnElements)}function getFloat(el){if(!window.getComputedStyle||!document.defaultView){if(el.getAttribute('align')=='left'||el.getAttribute('align')=='right')var y=el.getAttribute('align');else var y=el.currentStyle['styleFloat'];}else var y=document.defaultView.getComputedStyle(el,null).getPropertyValue('float');return y;}for(var i=0;i<img.length;i++){if(img[i].height>100&&img[i].width>100){var innerhtml=document.createElement('div');innerhtml.innerHTML='<span>Get a Quote</span>';innerhtml.className="imgHoverBtn";va |
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 SocketServer | |
from threading import Thread | |
class service(SocketServer.BaseRequestHandler): | |
def handle(self): | |
data = 'dummy' | |
print "Client connected with ", self.client_address |
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 | |
# -*- coding: utf-8 -*- | |
# Code is built by Ray. QQ: 75504026 E-mail:[email protected] | |
# Development environment: win7 64bit, python 2.7.8 | |
from SocketServer import TCPServer, ThreadingMixIn, StreamRequestHandler | |
import datetime | |
import time | |
import socket | |
import threading |
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 | |
# -*- coding: utf-8 -*- | |
# Code is built by Ray. QQ: 75504026 E-mail:[email protected] | |
# Development environment: win7 64bit, python 2.7.8 | |
import socket | |
import datetime | |
from time import sleep | |
import time | |
HOST = '192.168.1.170' # Symbolic name meaning the local host |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2013 Yannick Albert <http://yckart.com> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 | |
""" | |
ListeningSocketHandler | |
====================== | |
A python logging handler. | |
logging.handlers.SocketHandler is a TCP Socket client that sends log | |
records to a tcp server. | |
This class is the opposite. |
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
def sanitize_at_name(name, decode = False): | |
""" Sanitize achternaam, optionally decodes | |
to unicode string from AT input """ | |
if decode: | |
name = unicode(name, 'iso-8859-15') | |
tussenvoegsels = [ | |
"af", | |
"aan", |
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
# http://linux-bash.googlecode.com/files/damnp-actgod.sh | |
function check_install { | |
if [ -z "`which "$1" 2>/dev/null`" ] | |
then | |
executable=$1 | |
shift | |
while [ -n "$1" ] | |
do | |
DEBIAN_FRONTEND=noninteractive apt-get -q -y --force-yes install "$1" |