在沒有使用書籤習慣的時代,腦袋裡大概記了近百個網頁的URL吧!再多,記不住了。在Google當道的時代,腦袋改存可以找到網頁的關鍵字。自從使用線上書籤之後,腦袋又換了儲存方式,多記了想要的資訊是否曾被加入書籤。我目前使用的書籤是HEMiDEMi。

Forth 發表在 痞客邦 留言(0) 人氣()

為了神秘用途裝squid太麻煩了,直接用現成的Apache簡單方便。
ProxyRequests On
<Proxy *>
Order Deny,Allow
Deny from all
# 限制用戶IP位址
Allow from 10.1.1.11
# 驗證帳號
AuthType Basic
AuthName "Proxy Server"
AuthUserFile /usr/local/etc/apache22/passwd
Require valid-user
</Proxy>
CacheRoot /usr/local/www/apache22/cache
CacheEnable disk /

Forth 發表在 痞客邦 留言(0) 人氣()

售票機的作業系統是Windows。
你的手指按來按去都是網頁。
Web server的作業系統是FC3。
Web server是用WebLogic。

Forth 發表在 痞客邦 留言(0) 人氣()

個人對PostgreSQL的訊息翻譯工作,最初從PgAccess開始,接著是JDBC driver,然後是各執行檔和伺服器本身,除了伺服器部份的完成度極低,其它部份只需要偶爾維護即可。曾有人說要主導整個翻譯工作,也號召了有志者數 人,不過後來就沒下文了,記憶所及,也只有JiaYun曾經真的幫過忙。目前翻譯工作處於停擺狀態,翻譯完成度也隨著PostgreSQL的發展而愈來愈低,極需要熱血青年繼續下去,因為,我老了。

Forth 發表在 痞客邦 留言(0) 人氣()

在OPCafé看到zonble示範玩了GridWars,覺得這小遊戲真是適合用來打發時間。剛開始玩時,總是一、兩千分就game over,玩了十來次後,才進步到一萬多分。目前最高記錄是花了半個小時玩到兩百多萬分,離zonble的九百多萬分記錄還真遙遠。

Forth 發表在 痞客邦 留言(0) 人氣()

12月8日,星期五。下班後,晚上9點20分左右從新竹出發,約於10點50分到達南投名間交流道,在7-11停留20分鐘隨便吃點食物當晚餐,接著就延臺16線、臺21線新中橫公路往山上走,一點多到達觀峰停車場,在一陣東摸摸、西瞧瞧後,兩點多才上車昏迷。
12月9日。早上五點多醒來,看看別人都還沒動靜,就繼續掛在車上休息,大家都醒來後,喝了些熱飲,六點多才離開觀峰停車場,往玉山方向走。在到夫 妻樹前的一處地方,有許多人、車聚集在路邊,似乎在等日出,於是我們也在路邊停車,跟著湊熱鬧。根據一旁解說員的說明,太陽會在7點14分從玉山後面出 現,不過,天上蓋著黑壓壓的一層雲,所以,賞日出失敗。到了夫妻樹,當然還是要停留了一下,照些沒有藍天、沒有自己(泣)的照片。大約在八點十分到達鹿林 山登山口,花了點時間分散食物和水到大家的背包後,開始主要的行程。在往鹿林山莊途中,一處佈滿紅葉的地方,讓大伙把相機都拿了出來,在這玩耍了好一陣 子。終於,在九點半晃到了鹿林山莊,在這吃早餐。10點44分到鹿林山。13點25分到麟趾山。14點04分到玉山登山口,完成踏青行程。
真相在這裡。

Forth 發表在 痞客邦 留言(0) 人氣()


下午三點出發,經內灣、尖石,過宇老後左轉玉峰道路,在玉峰道路這一段,滿怕被落 石砸到的,走到底向右迴轉,往巴陵方向前進,之後時速大約30~60公里,一路很小心的衝,走到底,台七甲左轉,這段就放心的一路時速60公里,到泰雅大 橋右轉,接上台七丙後左轉,一直走到羅東,慢慢路過羅東夜市後上北宜高速公路,接下來就一路70~80公里,到南港接上國道三號往芎林,晚上九點到家。這 一趟三百多公里。
開車碰到的狀況:
在北橫時,大客車不會自動讓路,討厭!
雪山隧道裡,開70會當領隊,寬容值到80,那就不客氣啦!
那些時速90、100的車,你們「停」在內側車道做什麼啊!中、外側車道那麼空曠,快滾出去吧!一直害人違背良心從外側超車很討厭耶!

Forth 發表在 痞客邦 留言(0) 人氣()

設計網頁的時候,配色總是好痛苦,以後可以用Adobe的kuler偷個懶了。

Forth 發表在 痞客邦 留言(0) 人氣()


Flickr and WEBIMAGER
Flickr Explorer
Flickr Backup
Flickr.rb
Bart's PE Builder
SimpleViewer
JXplorer - Java LDAP Browser
Zaval Java Resource Editor
MyAB我的記帳簿
Synergy
SyncBackSE
Jetico Personal Firewall

Forth 發表在 痞客邦 留言(0) 人氣()

require 'uuid'
module ActiveRecord
module UseUuid #:nodoc:
def self.append_features(base)
super
base.extend(ClassMethods)
end
module ClassMethods
def use_uuid(options = {})
class_eval do
set_primary_key options[:column] if options[:column]
def after_initialize
self.id ||= UUID.getUUID
end
end
end
end
end
end
ActiveRecord::Base.class_eval do
include ActiveRecord::UseUuid
end

Forth 發表在 痞客邦 留言(0) 人氣()

# Using the algorithm from Hibernate to generate UUID
require 'socket'
require 'thread'
class UUID
@@instance = nil
@@mutex = Mutex.new
def initialize
@IP = 0
ipStr = IPSocket.getaddress(Socket.gethostname)
ipStr.split('.').collect {|a| a.to_i}.pack('C*').each_byte {|a| @IP = (@IP << 8) - 128 + a}
@counter = -1
@JVM = (currentTimeMillis >> 8) & 0xffffffff
end
def currentTimeMillis
(Time.new.to_f * 1000).to_i
end
def getJVM
@JVM
end
def getCount
@@mutex.synchronize do
@counter = (@counter + 1) % 32768
end
end
def getIP
@IP
end
def getHiTime
currentTimeMillis >> 32
end
def getLoTime
currentTimeMillis & 0xffffffff
end
def generate
sprintf(’%08x-%08x-%04x-%08x-%04x’, getIP, getJVM, getHiTime, getLoTime, getCount)
end
def UUID.getInstance
@@mutex.synchronize do
@@instance = new unless @@instance
end
@@instance
end
def UUID.getUUID
getInstance.generate
end
end

Forth 發表在 痞客邦 留言(0) 人氣()

#!/usr/local/bin/ruby
require "dbi"
require "parsedate"
db_plog_dsn = "dbi:Mysql:plogdb:localhost"
db_wp_dsn = "dbi:Mysql:wptest:localhost"
db_username = ARGV[0]
db_password = ARGV[1]
Category = Struct.new(:id, :name, :description)
Post = Struct.new(:id, :category, :title, :content, :createDateTime, :modifyDateTime, :status)
wp_cats = Hash.new(nil)
wp_posts = Hash.new(nil)
plog_cats = Hash.new(nil)
plog_posts = Hash.new(nil)
wp_conn = DBI.connect(db_wp_dsn, db_username, db_password)
plog_conn = DBI.connect(db_plog_dsn, db_username, db_password)
# initialize wp_cats
wp_conn.select_all("SELECT * FROM wp_categories") do |row|
wp_cats[row["cat_name"]] = Category.new(row["cat_ID"], row["cat_name"], row["category_description"])
end
# initialize plog_cats
plog_conn.select_all("SELECT * FROM plog_articles_categories") do |row|
plog_cats[row["name"]] = Category.new(row["id"], row["name"], row["description"])
end
# initialize wp_posts
wp_conn.select_all("SELECT wp_posts.ID id, wp_categories.cat_name catetory, wp_posts.post_date create_date_time, wp_posts.post_modified modify_date_time, wp_posts.post_title title, wp_posts.post_content content, wp_posts.post_status status FROM wp_post2cat JOIN wp_categories ON wp_post2cat.category_id=wp_categories.cat_ID JOIN wp_posts ON wp_post2cat.post_id=wp_posts.ID") do |row|
wp_posts[row["title"]] = Post.new(
row["id"], row["category"], row["title"],
row["content"], row["create_date_time"],
row["modify_date_time"], row["status"])
end
# initialize plog_posts
plog_conn.select_all("SELECT plog_articles.id id, plog_articles_categories.name category, plog_articles.`date` create_date_time, plog_articles.modification_date modify_date_time, plog_articles_text.normalized_topic title, plog_articles_text.`text` content, plog_articles.status status FROM plog_article_categories_link JOIN plog_articles_categories ON plog_article_categories_link.category_id=plog_articles_categories.id JOIN plog_articles ON plog_article_categories_link.article_id=plog_articles.id JOIN plog_articles_text ON plog_article_categories_link.article_id=plog_articles_text.article_id") do |row|
plog_posts[row["title"]] = Post.new(
row["id"], row["category"], row["title"],
row["content"].gsub(/\[@more@\]/, ''),
row["create_date_time"],
row["modify_date_time"], row["status"])
end
# create category
plog_cats.each_key do |key|
if false == wp_cats.has_key?(key)
puts "Create category \"#{key}\""
plog_cat = plog_cats[key]
wp_conn.prepare("INSERT INTO wp_categories (cat_name, category_nicename, category_description) VALUES (?, ?, ?)") do |pstmt|
pstmt.execute(plog_cat.name, plog_cat.name, plog_cat.description)
end
# put created category into hash
id = wp_conn.select_one("SELECT last_insert_id()")
wp_cat = Category.new(id, plog_cat.name, plog_cat.description)
wp_cats[wp_cat.name] = wp_cat
end
end
# create post
(plog_posts.keys - wp_posts.keys).each do |post_title|
plog_post = plog_posts[post_title]
puts "Import #{plog_post.title}"
createGmtDateTime = Time.local(*ParseDate.parsedate(plog_post.createDateTime)).gmtime.strftime("%Y-%m-%d %H:%M:%S")
modifyDateTime = plog_post.modifyDateTime
if modifyDateTime == "0000-00-00 00:00:00"
modifyDateTime = plog_post.createDateTime
end
modifyGmtDateTime = plog_post.modifyDateTime
if modifyGmtDateTime == "0000-00-00 00:00:00"
modifyGmtDateTime = createGmtDateTime
else
modifyGmtDateTime = Time.local(*ParseDate.parsedate(modifyGmtDateTime)).gmtime.strftime("%Y-%m-%d %H:%M:%S")
end
status = plog_post.status
if status == 1
status = "publish"
else
status = "draft"
end
wp_conn.prepare("INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_status, post_modified, post_modified_gmt) VALUES (?, ?, ?, ?, ?, ?, ?, ?)") do |pstmt|
pstmt.execute(1, plog_post.createDateTime, createGmtDateTime, plog_post.content, plog_post.title, status, modifyDateTime, modifyGmtDateTime)
end
post_id = wp_conn.select_one("SELECT last_insert_id()")
wp_conn.prepare("INSERT INTO wp_post2cat (post_id, category_id) VALUES (?, ?)") do |pstmt|
pstmt.execute(post_id, wp_cats[plog_post.category].id)
end
end
wp_conn.disconnect
plog_conn.disconnect

Forth 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。