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 | |
conn = sqlite3.connect('emaildb.sqlite') # create a database is not exist | |
cur = conn.cursor() | |
cur.execute(''' | |
DROP TABLE IF EXISTS Counts''') # three quotes support multiple lines without \n | |
cur.execute(''' | |
CREATE TABLE Counts (org TEXT, count INTEGER)''') |
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
<a class="post-overlay" href="http://carmentang.co/callahan-realty-group/" rel="bookmark" title="Callahan Realty Group"> | |
<p class="view">View →</p> | |
</a> | |
.posts .post .post-overlay, .post-navigation a, .post-navigation a p { | |
-webkit-transition: all 0.4s ease-in-out; | |
-moz-transition: all 0.4s ease-in-out; | |
-ms-transition: all 0.4s ease-in-out; |
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
_ |
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
CREATE VIEW air_a630_g3_latest_compiler_release AS SELECT * FROM air_promote_records WHERE project = 'a630' AND air_group = 3 AND component = 'compiler' AND status_info = 'REL_DONE' AND air_promote_vid > (SELECT MAX(air_promote_vid) FROM air_promote_records WHERE project = 'a630' AND air_group = 3 AND component = 'compiler' AND status_info = 'REL_USED' ) ORDER BY air_promote_vid ASC LIMIT 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
if @env_os == 'windows' | |
@scandir = self.scandir.gsub(/\\/, '/') | |
else | |
@scandir = self.scandir | |
end | |
all_full_rels = Dir["#{@scandir}/*"] | |
all_rels = [] | |
all_full_rels.each do |frel| | |
if is_dir_exist(frel) | |
t_rel = File.basename(frel).gsub(/\/$/, '') |
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
name = raw_input("Enter file:") | |
if len(name) < 1 : name = "mbox-short.txt" | |
handle = open(name) | |
hours = dict() | |
for line in handle.readlines(): | |
if line.startswith('From '): | |
h = line.split(' ')[6].split(':')[0] | |
hours[h] = hours.get(h, 0) + 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
name = raw_input("Enter file:") | |
if len(name) < 1 : name = "mbox-short.txt" | |
handle = open(name) | |
email = dict() | |
for line in handle.readlines(): | |
if line.startswith('From '): | |
addr = line.split(' ')[1] | |
email[addr] = email.get(addr, 0) + 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
fname = raw_input("Enter file name: ") | |
if len(fname) < 1 : fname = "mbox-short.txt" | |
fh = open(fname) | |
count = 0 | |
for line in fh.readlines(): | |
if line.startswith('From '): | |
print line.split(' ')[1] | |
count += 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
test_num = test_list.length | |
group_num = test_num / group_length | |
if test_num % group_length != 0 | |
group_num += 1 | |
end |
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
test_info = Hash.new do |hash, key| | |
hash[key] = Hash.new | |
end |