[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
http://wrapbootstrap.com/preview/WB00U99JJ
or use http://html5boilerplate.com/
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 11 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 11 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 11 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink
[ add comment ] ( 9 views ) | [ 0 trackbacks ] | permalink
With Python, there is no shortage of options for concurrency, the standard library includes support for threading, processes, and asynchronous I/O. In many cases Python has removed much of the difficulty in using these various methods of concurrency by creating high-level modules such as asynchronous, threading, and subprocess. Outside of the standard library, there are third solutions such as twisted, stackless, and the processing module, to name a few. This article focuses exclusively on threading in Python, using practicle examples. There are many great resources online that document the threading API, but this article attempts to provide practicle examples of common threading usage patterns.
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink | related link
#!/usr/local/bin/python
import re
import sys
account_all = []
account_uniq = []
account_info = re.compile('.* ([\d]+\.[\d]+\.[\d]+\.[\d]+).*CONNECT ([^ ]*).* xxx.*')
file_name = "/var/log/clc/2013-04-03/files/xxx.log"
len = len(open(file_name).readlines())
file = open(file_name, "r")
print "please wait..."
count = 0
for line in file:
count += 1.0
res = account_info.search(line)
if res is not None:
sys.stdout.write("\r parsing data %d%% (%d/%d)" % ( (count / ( len / 100 ) ), count, len ) )
sys.stdout.flush()
account_all.append(res.groups())
sys.stdout.write("\n")
print "please wait..."
account_uniq = list(set(account_all))
for ip, dest in account_uniq:
print "%s %s" % (ip, dest)
[ add comment ] ( 10 views ) | [ 0 trackbacks ] | permalink