http://yblog.org/archive/index.php/9324
Ubuntu版本的命名規則是根據正式版發行的年月來命名的,Ubuntu 8.10顧名思義就是2008年10月發行的Ubuntu,其代號為Intrepid Ibex,是「無畏的野山羊」,為基於Debian開發的Linux發行版,Debian的開發代號來源於電影《玩具總動員》,而Ubuntu歷來幾個版本都是以形容詞加上動物名稱來命名的,而且兩個字當中第一個字母一定是一樣的。比方說:
Ubuntu 4.10 - Warty Warthog(長疣的疣豬)
Ubuntu 5.04 - Hoary Hedgehog(灰白的刺蝟)
Ubuntu 5.10 - Breezy Badger(活潑的獾)
Ubuntu 6.06 - Dapper Drake(整潔的公鴨)
Ubuntu 6.10 - Edgy Eft(急躁的水蜥)
Ubuntu 7.04 - Feisty Fawn(勇敢的小花鹿)
Ubuntu 7.10 - Gutsy Gibbon(有種的長臂猿)
Ubuntu 8.04 - Hardy Heron(堅忍的蒼鷺)
Ubuntu 8.10 - Intrepid Ibex (無畏的野山羊)
Ubuntu 9.04 - Jaunty Jackalope (快活的鹿角兔)

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

https://help.ubuntu.com/community/FreeNX

vim /etc/apt/sources.list
Adding
deb http://ppa.launchpad.net/freenx-team/ubuntu intrepid main
deb-src http://ppa.launchpad.net/freenx-team/ubuntu intrepid main
to the end of the file [plz refer to Ubuntu 的命名 about "intrepid"]

apt-get update
apt-get upgrade
aptitude install freenx

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

Source: http://www.perlmonks.org/?node_id=287647

open FILEHANDLE, 'somefile.txt' or die $!;
my $string = do { local $/; <FILEHANDLE> };

How it works
The first piece of this code is the do "function", which returns the value of the last expression executed in it's block. In this case, that last expression is simply <FILEHANDLE>.

The expression <FILEHANDLE> will either return the next line from the filehandle if it is called in scalar context, or it will return the entire contents from the filehandle as a list if called in list context:

my $scalar = <FILEHANDLE>;    # one line
my @array  = <FILEHANDLE>;    # whole file

The reason why <FILEHANDLE> only returns one line is because by default, the built-in Perl variable $/ is set to one newline. $/ is the input record seperator, and it can be used to modify the behavior of how many records are read in when you use the diamond operators (<FILEHANDLE>). The docs explain that if $/ is set to undef, then accessing <FILEHANDLE> in scalar context will grab everything until the end of the file:

undef $/;
my $scalar = <FILEHANDLE>;   # whole file

However, changing Perl's built-in variables can be dangerous. Imagine you wrote a module that others use. Inside this module you set $/ to undef, thinking that everywhere else $/ will be the default value. Well, wrong. You just changed $/ for everyone that uses your module. This is one of those few places where local is the right choice.

Which brings us to the FIRST expression in our do block:

local $/;

This is the same thing as explicitly assigning $/ to undef:

local $/ = undef;

But not the same as:

$/ = undef;           # Danger Will Robinson! Danger!

Because we are inside a do block when we use local, the value of $/ is temporarily changed, and we can rest assured that it will not affect code outside of our block (or scope). If we were not inside another block or scope, local $/ will only affect the package it was encountered in, but it's better to contain local $/ inside a temporay scope, unless you enjoy debugging hard to find bugs. 

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

http://www.perlmonks.org/?node_id=517176

$array = \(); doesn't create a reference to an empty array. You probably want $array = [];

\() creates individual references to each entity inside of the ().

Since there is no entity inside of your (), no reference is created.

[] is the anonymous array constructor. That's what you're looking for.

$array = [];

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

http://code.activestate.com/recipes/499314/

import re
starts = [match.start() for match in re.finditer(re.escape(S), T)]

finditer() won't find overlapping strings. The regular expression methods, including finditer(), find non-overlapping matches. To find overlapping matches you need a loop.

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

http://www.perl.com/pub/a/2004/06/18/variables.html

The Field Record Separators

Next, we'll look at $/ and $\ which are the input and output record separators respectively.

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

  1. Facebook Cookbook: Build Your Facebook Empire
    1. ISBN : 059651817X
    2. Author : Jay Goldman http://jaygoldman.com/
  2. FBML Essentials
    1. ISBN : 0596519184
    2. Author : Jesse Stay http://staynalive.com/
  1. facebook DEVELOPERS
    1. http://developers.facebook.com/
  2. An Introduction to FBML
    1. http://20bits.com/2007/06/04/an-introduction-to-fbml/

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

Get Vista and Samba to work
http://www.builderau.com.au/blogs/codemonkeybusiness/viewblogpost.htm?p=339270746&feed=rss

當您修改安全性設定和使用者權限指派時,可能會發生用戶端、服務和程式不相容的情形
http://support.microsoft.com/kb/823659

安全性設定 → 本機原則 → 安全性選項 列表內的 網路安全性:LAN Manager 驗證層級
http://delphi.ktop.com.tw/board.php?cid=165&fid=900&tid=89482

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

Jul. 16 2340 華航(CI 32) Taipei to Vancouver Jul.16 1925:10h45m

YVR - Vancouver International Airport [照片上是Vancouver Time]
我是由溫哥華再轉機到多倫多




流水前的圓木裝飾 [Taiwan Time]
這是一面正對著入境大廳的牆壁,圓木後面有流水。圓木上的雕刻人像好可愛歐 ~


入境大廳 [Taiwan Time]
溫哥華機場的入境大廳,正對著是一對圖騰


楓葉圖案的玻璃 [Taiwan Time]
加拿大是楓之國,所以到處見的到以楓葉圖案做裝飾的物品


飛行器原型 [Vancouver Time]
回國搭機時還看到有人在清理上面的蜘蛛絲,維護得很乾淨


校正時間用 [Vancouver Time]
溫哥華比台北慢15個小時



Jul. 16 2300 加拿大西方(WS 702) Vancouver to Toronto Jul. 17 0622:4h22m


出 Toronto Pearson Airport 就看到一位帥哥警察對著一輛BMW休旅車開罰單 :D [Toronto Time]
多倫多比台北慢12小時 (也就是日夜顛倒,我們到的第一天check-in後從中午睡到晚上七點,完全處於時差-jet lag-中)
我們去程因為不了解路程,所以直接定了旅館的 pick-up service (45CA for at most 4 people,但我們 3 個人,15CA per person).
但,我回程才知道(在Quebec City 的 Hostel 內遇到兩個台灣大男孩得知。我也蠻佩服這兩位大男生的,他們是高中同學,
剛從不同大學畢業,等待兵役的期間。來加東待兩個月。),其實從多倫多搭 Subway(Metro) 的綠線 (我有在 Spadina STN橘線轉綠線)
Kipling STN (2.5CA) 出地鐵站 (我沒有仔細找 transfer 的機器,我就直接出站轉公車,司機也沒有檢查任何東西)
後轉 192 路公車就可以到機場 (Pearson Terminal 3),也就是我拍這張照片的位置了。



Toronto
 


St. Lawrence Market (聖羅倫斯市場) [個人極為推薦! 除了便宜的肉品外,許多好吃又便宜-相對於加拿大的物價-的食品]
 

http://www.stlawrencemarket.com/shopping/locsouth.html [唉呀~ 要是出國前有好好做功課的話...就會吃得更多]
http://chuanyu-hu.spaces.live.com/blog/cns!4EAB8DD5E401427A!585.entry?_c=BlogPart 知名的傳統市場&香噴噴的麵包和超過三百種以上的起士
http://www.backpackers.com.tw/forum/showthread.php?t=12550 #14 它是一個市集,專賣肉類、風乾火腿、芝士、歐風雜貨等。對烹飪有興趣的會喜歡

South Market in Front St. E.


South Maket in The Esplanade


Open Time


首先,一樓有許多生鮮與起司可供選購或觀賞
但我忘了照海鮮部分,因為當時人還很少,靠近攤位時,販賣人員會以為我要買,不好意思


肉品攤位


好多各式各樣的香腸與加工肉製品


許多種類的Cheese


也有販賣醃製小菜


這家店賣的是廚房用具(#29 PLACEWARES),一堆小東西超級吸引我的啦 ~


各種款式的餅乾模具 ~


好可愛的茶壺 ~


城堡造型的麵包模具 ~
做出來的蛋糕給小孩子過生日一定會很高興


進入地下樓後,一定要去嚐嚐看的 Italian Sandwich (#B34 Mustachio's)
我還發現人多時,#B11 Eve's Temptations 的工作人員也會過來幫忙,是一家人經營兩家店吧?
櫃檯內上層擺放麵包,下層Veal(牛), Chiecken(雞), and Eggplant(茄子) 都是一大片炸的


也有 Salad,但是我沒有試


我點了一個 Veal(小牛肉) & Eggplant(茄子) $7CA
會直接幫你先剖半,但是真的太大了,我只吃了一半,另一半帶到機場當晚餐
放個加幣 quarter(約台幣 10 元大小) 作比較 [真笨,明明包包內有台幣,應該拿台幣當比較的]


剛做好的時候,紅紅的那層肉醬是熱的,好吃耶~


Eggplant(茄子),好吃 ~


再來是賣著許多好吃的水果Strudel(餡餅) (#B31 Stonemill Bakehouse)
我本來打算吃一個 Apple Strudel 當甜點而已,但是吃完後,又再跑去買了 Apple Strudel & Raspberry(覆盆莓) Twist (1.56/ea)
帶到機場去當晚餐的甜點,真是大滿足!! 極力推薦






另外 #42 Carousel Bakery, #B11 Eve's Temptations, #B35 Intitaita Impressions 也是個人觀察後覺得應該是值得一逛的店

#42 Carousel Bakery 好像有很多組合,可能得先問一下才知道怎麼點


#B11 Eve's Temptations 有賣許多巧克力產品


#B35 Intitaita Impressions
好多好可愛的小孩衣服



CN Tower

In Front St. W.


In Harbourfront Centre



BCE

In front of St. Lawrence Market



Berczy Park

多倫多到處可見一些小公園,之所以拍這個公園是因為他的旁邊有一棟建築物有著很好玩的視覺畫作




就是這個,乍看之下以為建築物的牆面是真的裝飾成這樣。
其實只有中間那行窗戶是真的,其他都是畫出來以假亂真的。
A realistic looking painted wall




Toronto City Hall

因為只是剛好經過,所以沒有進去逛,聽說可以免費參觀。


Old City Hall


我在 Niagara Falls 也看到紀念士兵的紀念碑。



Casa Loma

看到這張照片和舊市政廳(Old City Hall),真想花錢買 Tokina 116 了...
我已經嚐試跑到圍牆外去照了,但是還是沒有辦法取到全景,殘念...






這是從停車場的方線拍的側面照,但是太陽被一堆雲遮住了,
等了好就都不散。且那幾天有下雨,以為要下雨了就收一收離開,沒想到後來的行程又出大太陽...





Spadina Mesusm

因為在 Casa Loma 旁,所以比較少訪客


重點裝飾之一



Toronto Zoo

先說,別問我為啥要到 Zoo,因為我們後來也覺得...
真的覺得木柵動物園又便宜又好看,動物一大堆。

生態解說員,帥哥一枚


大概只有Woody比較爽吧,可以和遊園車(Zoomobile)的解說美女照相


還有,就是這群 超辣且年輕 "孕婦" 們,真是服了他們了 ~
一開始還看到穿粉紅色的這位準母親還舔著冰棒,另一手還拿著兩根。
可惜後面那位穿著白色 Bikini 最漂亮的媽媽被擋住了。(沒辦法,我可是冒著生命危險在拍的!! 因為,他們的老公就在他們左邊聊天,每個都粗壯的狠...)


好吧,就以 China Town 當 Toronto 結尾吧~


只有在中國城附近可看到翻譯的路名


而且,我只有在這附近看到小7 耶~



Niagara Falls


Maid of The Mist (霧中少女號)

來到尼加拉瀑布一定要來坐這船,到 Niagara Falls 前晃一圈啦 ~
買完票通過這裡到搭船前還有一大段路要走,且得搭一次電梯,而因為遊客很多,真的快曬暈了...
還會在上船前幫你照張相,可以於坐完船後購買。


14.5CA per Adult person


每個人都要穿上雨衣,且有大人小孩之分
(後來才知道這件雨衣可以帶走,不用還啦! 應該帶出來做紀念的,因為前面有印上 Maid of The Mist 的字樣)
但是搞到後來我還是 "濕" 了,因為,我很神勇地拿出我的 DV 一路拍到瀑布前,直到整台 DV 都在滴水了才收起來.
結果,後來使用 DV 時,顏色還有點怪怪的呢。但,乾了後又好像正常了. 哈哈~~~真是賺到.


SkyWheel
沒有坐上去。因為,連美麗華或夢時代我都沒有坐了。


哈哈,鐘樓怪人都來賣漢堡了


信不信由你(Believe it or not)
很有趣的裝飾


有沒有像,有時看電影時某片商會有一隻獅子出來吼一下呀~



加拿大瀑布 (Canadian Falls)

水氣直衝上天


更靠近一點時,整個根本就像是下著小雨。



FREE Fall Fireworks Above Canadian Falls
整年的 Friday & Sunday 會有煙火,大約 10 mins 從 10 pm 開始

一開始加拿大瀑布這面會有雷射秀






放完煙火後,換美國瀑布(American Falls)這邊有雷射秀


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

#!/usr/bin/perl -w

use warnings;
use strict;


main();
exit(0);

sub main {
 my @aAry = ( 1, 2, 3 );
 print( "Before calling subroutine1...\n" );
 print( "Array in main:" );
 foreach my $iPiece ( @aAry ) {
  print( "\t$iPiece" );
 }
 print( "\n" );
 
 &_subroutine1( \@aAry );
 
 print( "After calling subroutine1 and Before calling subroutine2...\n" );
 print( "Array in main:" );
 foreach my $iPiece ( @aAry ) {
  print( "\t$iPiece" );
 }
 print( "\n" );
 
 &_subroutine2( \@aAry );
 
 print( "After calling subroutine2...\n" );
 print( "Array in main:" );
 foreach my $iPiece ( @aAry ) {
  print( "\t$iPiece" );
 }
 print( "\n" );
 
}

sub _subroutine1 {
 my @aAry = @{shift @_};
 
 @aAry = reverse @aAry;
 
 print( "Array in subroutine1:" );
 foreach my $iPiece ( @aAry ) {
  print( "\t$iPiece" );
 }
 print( "\n" );
}

sub _subroutine2 {
 my $raAry = shift;
 
 @{$raAry} = reverse @{$raAry};
 
 print( "Array in subroutine2:" );
 foreach my $iPiece ( @{$raAry} ) {
  print( "\t$iPiece" );
 }
 print( "\n" );
}

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

Static: 所有由同一個 class 所產生的 objects 共用同一記憶體位置
Single-Colon (:): 用來初始化 class 中被宣告為 const 的 data members

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

http://dev.mysql.com/doc/refman/5.0/en/blob.html

10.4.3. The BLOB and TEXT Types
A BLOB is a binary large object that can hold a variable amount of data. The four BLOB types are TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB. These differ only in the maximum length of the values they can hold.

BLOB columns are treated as binary strings (byte strings). TEXT columns are treated as non-binary strings (character strings). BLOB columns have no character set, and sorting and comparison are based on the numeric values of the bytes in column values. TEXT columns have a character set, and values are sorted and compared based on the collation of the character set.

http://www.icewalkers.com/Perl/5.8.0/lib/DBI/FAQ.html#5.2%20How%20do%20I%20handle%20BLOB%20data%20with%20DBI%3f 

5.2 How do I handle BLOB data with DBI?
XX

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

Problems occurred after upgrading from 7.10 to 8.04

Q: locate: can not open '/var/lib/mlocate/mlocate.db': No such file or directory
A: sudo updatedb [https://bugs.launchpad.net/ubuntu/+source/mlocate/+bug/204357]

Q: Using perl script to connect mysql: Can't connect to MySQL server on 'mysql_server_ip' (111) at DBI.pl line X
A: comment out ''bind-address = 127.0.0.1'' in /etc/mysql/my.cnf [https://bugs.launchpad.net/ubuntu/+source/mysql-admin/+bug/155274], and then /etc/init.d/mysql restart (restart mysql)

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

E.g.,
By using repeat operator 'x', you could initialize multiple variables at one time.

my ( $iX, $iY, $iZ ) = (1) x 3;

my ($sX, $sY, $sZ ) = (undef) x 3; or
my ($sX, $sY, $sZ ) = "test" x 3;

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

http://www.itworld.com/nl/perl/09202001/

Repeating Yourself: The X Operator
Andrew Johnson

The x operator can return repeated lists if used in list context and if the left operand is a literal list (i.e., wrapped in parentheses):

my @array = (1,2,3) x 2;
print "@array" # prints: 1 2 3 1 2 3

You need to be careful to put the left operand in parentheses for list repetition --- using a plain array will not behave as desired:

my @array = (1,12,42);
@array = @array x 2; print "@array\n"; # prints: 33

In this case, because the left operand is not in parentheses it is evaluated as a scalar, and an array in scalar context returns the number of elements in the array --- in this case 3 --- thus the x operator has returned the string '3' repeated twice.

Is this operator practical? Consider a case where you want to define a ten-element array and initialize each element to 1:

my @array = (1) x 10; # my @array = (1,1,1,1,1,1,1,1,1,1);

Another useful case is initializing a hash when we've read in (or otherwise obtained) a list of keys we wish to initialize to 1:

my @keys = qw(a b c d);
my %hash; @hash{@keys} = (1) x @keys;

Lastly, a minor cautionary note --- remember that 'x' is not the multiplication operator:

my $value = 15 x 2 / 3;
print "$value\n"; # prints: 505

Here the number 15 is treated as a string and repeated twice to get 1515 which is then treated as a number and divided by 3 to get 505 (rather than the result of 10 you might have wanted). This is one case where Perl's natural conversion between numbers and strings without warning can mean that a simple typo ('x' instead of '*') can lead to strange results and is difficult to track down. So, if you have calculations in your code and you are getting bizarre results you might want to check for this particular typo.

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