2007年1月31日星期三

昨天今天

是谁遇见谁,是谁爱上谁,又是谁忘记了谁。
都在过去里成长的我们,到底在找寻什么?
生命的脉络似乎已经逐渐展现,我要找寻的人出现了么?是你么?
不明白昆明今年怎么这样的冷,似乎每次的心死都在这样的季节。
我只希望从今年的春天开始
我的每个希冀都能够发芽,让我生命的脉络能给自己读懂。

2007年1月24日星期三

句点

穿过城市狭长的街
冬日暖洋印在你的脸
光影交汇的瞬间
你的背影转身不见

忽然间我模糊了视线
拥挤的人群把我汇入他们中间
脱不开,涌不出的包围圈
可知我的思念已没有句点

ps: 很久没写词一类的东西了,拿着guitar,写几段自娱自乐一下,想想过去想想未来。

2007年1月22日星期一

如夜

十二月初四,新月挂在了高楼一角,这个城市开始在这个时候安静下来,过去总会打开收音机听符合心情的谈心节目,一直听到告别我的年少时代,有过的初恋也在那样的时光里,被渐渐淡忘。
很喜欢“新月”这两个字,源于喜欢《穆斯林的葬礼》中,那个纯洁无暇,天真的女主人翁。乳白色的一笔,好似轻描淡写,又好似精心雕琢,不会像满月般光芒散开,印着大地一片银色。说她的轻描淡写,像是水墨画中画兰花的一撇,两个尖尖的角,柔嫩的肢体,不可轻触一下;说她的精心雕琢,像是工匠的浮雕作品,每条光影暗线不细细琢磨不可琢出一番回味。
关于新月已经深入人心的人物形象,没有再需要说什么的余地,也许只是天星的光明总要耀过新月的清淡吧。
好吧,好吧,我们需要这样的夜,如夜,如夜,开始,开始。

如夜,如夜,
如水的青春滑过指尖
抬头,你已不见
低头,都已成灰
遥望你的脸
被霓虹模糊了我的眼
所有的声音都已经听不见

如夜,如夜
又一轮新月挂在了心间
闭眼,背影浮现
聆听,琴声已润
默念一百遍
被风吹散的誓言
只有轻描淡写的昨天

2007年1月21日星期日

我选择在家里喝着酒

天亮以前,黄昏以后,每个时光的停留总是那么短暂且那么漫长,矛盾里成长着各种感情,像电影里一样的真实或虚幻。
我选择在家里喝着酒,这应该是最安全的人生吧,想失去的也想起曾经错过的,和可能永远得不到的......
好久没有挣扎过了,不管是选择与不选择,继续与放弃,停留与离开,似乎都忘记了,似乎又将全部记起。
想平淡真实平凡而且可能是平庸,好像老妹说的“淡定”吧,我始终离不开这样的挣扎,不知道明天该怎么继续。
美女送了偶本《On The Road》,Jack Kerouac写的,还没拆开,超级喜欢那种老式打字机打出来的东西,且是全白色的一本。对On The Road这样的感觉本身就很有兴趣,更重要的是书壳上有几句话特别吸引人,高调的词语,呵呵

在极度的时尚使人们的
注意力变得支离破碎,敏感性变得迟钝薄弱的时代,
如果说一件真正的艺术品的面世
具有任何重大意义的话
该书的出版就是一个历史事件......

准备找点时间看看,重新把我的文学神经梳理梳理,迎接将要来的一天,纪念过去的一年

2007年1月20日星期六

这里,还是那里

Heute hier,morgen dort,好久没有听Hannes Wader唱的这个歌曲了,好喜欢那种不停留的感觉,今天在这里,明天就会离开。
越来越要一种安定,为那个可能即将遇到的爱情做一个守候,明天?是你,还是谁?相遇还是注定的分离?注定昙花一现还是牵手永远?答案越来越复杂,也越来越感觉有一种恐惧徘徊。
今天是大寒吧,已经不模糊了对过去昆明冬天的样子,隐约记得很冷和干燥,还会有短暂的雪花伴随着初春的寒流袭来。春天也会这样的冷么?
要一个完整的自己,面对林立的高楼,面对每天迎面而来的挫败感。只是知道自己在不停的跑,没有停留。

2007年1月19日星期五

Regular Expression In Ruby Language

Four ways of writing regular expression in ruby:
  1. /something/
  2. Regexp.new("something")
  3. Regexp.compile("something")
  4. %r{something}

Regexp::MULTILINE m
Normally, a regexp matches against a single line of a string. This will cause a regexp to treat line breaks like any other character.

Regexp::IGNORECASE i
Makes matches case-insensitive


Regexp::EXTENDED x
This modifier lets you space out your regular expressions with whitespace and comments, making them more legible.

一篇关于ruby中正则表达式的文章翻译
原文出处: http://www.regular-expressions.info/ruby.html

Ruby中正则表达式的修饰符(译)

在Ruby中使用正则表达式 Ruby支持正则表达式作为其一项语言特性。在Ruby中,正则表达式被写作 /模版/修饰符 的形式,这里的"模版"就是正则表达式本身,而"修饰符"则是一系列不同选项字符的标识,另外,"修饰符"部分是可选的。这个语法特点从Perl借鉴而来。 Ruby支持如下的修饰符: /i 使正则表达式大小写不敏感(正则表达式本身是大小写敏感的) /m 使"."匹配新行。Ruby使用/m,然而Perl和其他很多编程语言使用/s来实现"点(.)匹配新行"。 /o 它将致使任何的 #{...}替换符在一个特殊的正则表达式中仅仅被执行一次,它在第一次会被求值。然而,如果没有用/o,替换符将会每次都执行,并且产生一个Regexp对象。
你能同时使用如上的修饰符象这样: /rgex/is
在Ruby中,^字符号和$符号总是匹配新行的前后。Ruby没有修饰符能够改变这个特点。使用\A 和 \Z 可以匹配在字符串的始端或者末端。 因为正斜杆界定了正则表达式的长度,所以任何出现在正则表达式中的正斜杆都将被除去。例如,在ruby中,正则表达式 1/2 被写做 /1\/2/ (这里隐藏了含义,即反斜杆\,通常被我们成为转义符)

2007年1月14日星期日

2007,昆明,失去的神经

似乎很久没有在纸上写过东西了,我们这样的人在过去都被成为网虫。网络发达的今天,网虫一词逐渐淡去,大家都默认了blog这样的公开日志,而blog也成为无数八卦的重要来源。自己曾在多个blog或space上面写东西,算起来也有些时日,自从搬到google blogger,都疏远了自己那些多少有些神经的灵魂,仿佛快要和那列火车脱轨,还好不是出轨:)
算不上什么文学青年,只是略喜文字一二,目前把每天写各种字符作为生存的饭碗,而且居然能用奇怪的ascii字符拼凑出写所谓的软件,不知是喜是悲。
悲?何来?把吉他拿在手上,已经找不到哪个和弦可以作为我心情的起点,心里的江湖一片乱麻麻,昨天的请柬,明天朋友的小孩,已经印证着偶还住在单身公寓的某一层。近日,心情来的较乱,盛上半杯干红,点上一根香烟,吞云吐雾之间,略微感觉一次惬意,小资了?也许。
买了张SUZANNE VEGA的专辑,只因CD壳子封面有“民谣诗人”四字。“民谣”?“诗人”?高晓松?郁冬?哈哈,一堆关系在脑子里不停的转来转去,又有什么关系呢?买了就买了,好像爱了就是爱了,散了还是散了,忘了就是忘了。
曾经一度假设在某一个梦好了的场景里,我们重逢,相遇,再分离。可终究在2007到来的日子里,我依然在等候,显然的,我开始了绝望,心死。又一年,把上一年留下的枯叶都卷入尘土,都给新来的年累积着思念,累积着财富。财富就是我们有过的每一天,平淡也好,激烈也好,更甚者是平庸也好,都一样是每一秒,每一刻,每一天,每一年,年年岁岁,岁岁年年,我们依旧在成长里和周围的一切相遇、分离、相遇......

2007年1月13日星期六

Case of String


Here,there are methods about case of string in Ruby language.
1.String#upcase
2.String#upcasedowncase
3.String#swapcase
4.String#capitalize
5.String#capitalize_first_letter

All four methods have corresponding methods that modify a string in place rather than creating a new one: upcase!, downcase!, swapcase!, and capitalize!. Assuming you don't need the original string, these methods will save memory, especially if the string is large.



To change the case of specific letters while leaving the rest alone, you can use the TR or TR! methods, which translate one character into another:

'LOWERCASE ALL VOWELS'.tr('AEIOU', 'aeiou')
# => "LoWeRCaSe aLL VoWeLS"


2007年1月10日星期三

Ruby Continue~~


In recipe 1.4, there is a example:
"Three little words".split(/\s+/)
#=>["Three","little","words"]
"Three little words".split(/(\s+)/)
#=>["Three"," ","little"," ","words"]

Here,when I firstly looked at,I confused. But then I think about it carefully,I got way~! In regular expression /(\s+)/, parentheses make spaces stored. Because parentheses in regular expressions, it make the characters of including by parentheses stored in memory,then u can use \1 to reference it after parentheses.



A important tip in recipe 1.5. Special characters are only interpreted in strings delimited by double quotes, or strings created with %{} or %Q{}, but single quotes and %q{} are not.

puts "foo\tbar"
#=>"foo bar"
puts %{foo\tbar}
#=>"foo bar"
puts %Q{foo\tbar}
#=>"foo bar"

puts 'foo\tbar'
#=>"foo\tbar"
puts %q{foo\tbar}
#=>"foo\tbar"




In Recipe 1.6, I got three ways to convert between charactors and values.
1.use ? charactor
?a
#=>97
2.use to access a element of array
'a'.[0]
#=>97
3.from ascii to char,use #chr method
97.chr
#=>"a"

2007年1月9日星期二

Symbol and String


A Symbol is about the most basic Ruby object you can create. It's just a name and an internal ID. Symbols are useful becase a given symbol name refers to the same object throughout a Ruby program.In Rails,we usually use this point,such as ":action=>welcome" and so on. If you wanna get the corresponding symbol of a given string,String.intern will be.

name ="allen"

puts :allen
#=>"allen"
puts name
#=>"allen"

puts :allen.object_id
#=>190498
puts name.intern.object_id
#=>190498
puts name.object_id
#=>21723660




In Rails, we can see the symbol around web application code.Let's think about it!
Hem.......because symbol don't allocate another memory,it doesn't like string.

puts "allen".object_id
#=>21723550
puts "allen".object_id
#=>21723490
puts :allen.object_id
#=>190498
puts :allen.object_id
#=>190498

Substituting variables into an Existing String

From last recipe,we know a way of substituting variables into string. Here, there are some ways again.



1. Printf-style string format
var = 'My name is %s.'
var % 'Allen'
#=> "My name is Allen."
'To 2 decimal places: %.2f' % Math:PI
#=> "To 2 decimal places: 3.14"
'Zero-padded: %.5d' % Math:PI
#=> "Zero-padded: 00003"




2.Use ERB
require 'erb'

template = ERB.new %q{It is <%= var%>!}
var = "here"
# When var is binded to template,just like following
puts template.result(binding)
#=> print "It is here"

2007年1月8日星期一

Purposes of Schedule

From last week to this,I made a plan of our team for project management in 2007.It a hard process,really,I think.You need take care everything about project,such as collabaration,communication,timestamp,customer feedback and so on. And by accident, the chapter 2 is written about schedules.For me, right~!



First,I review the three purposes about schedule:
1.To make commitments about when things will be done.
2.To encourage everyone who's contributing to a project to see her efforts as part of a whole, and invest in making her pieces work with the others.
3.To give the team a tool to track progress and to break work into manageable chunks.




For three purposes, it's very hard to understand when I looked at them firstly.The first, time is focused on. It means we focus on what will happen and what will change,or what will delay.The second,it emphasize function of schedules.It means scheduls inspirit person who is in team,and in another way,it is a forcing functions for project.The last,it's easy to understand as long as whoever have expriences of IT project.

2007年1月7日星期日

About Substituting Variables


Usually,we use such as #{var} for substituting variables into string.
eg.
  var="Allen"
  puts "My name is #{var} ."
  #=>"My name is Allen ."



And if you wanna use string interpolation more complex, you can do just like this:
  %{Here is #{class InstantClass
   def bar
    "some text"
   end
  end
  InstantClass.new.bar
  }.}
  # => "Here is some text."



Here, a way to avoid triggering string interpolation
1.Escape the hash characters
"\#{var}"    # => "\#{var}"
2.Put the string in single quotes
'#{var}'    # => "\#{var}"




Ways of multiline for string
1.Use %{}
2.Use =<< END .. END,here, 'END' is a tag of starting and ending for multiline string.

The Art of Project Management


The Art of Project Management , written by Scott Berkun,who worked for Microsoft. It's a good book I bought last year, but I have no time to read it always.
Hem.......Just read 1st chapter completely.
And now,I will make notes from now on,and written my notes in this blog.
Here,open book,make notes~!



Here, there are three point of key lessons from author's inquiries into the past:
1.Project management and software development are not sacred arts.
2.The simpler your view of what you do, the more power and focus you will have in doing it.
3.Simple doesn't mean easy.




And it present what the role of project management are.It indicates the role of project manager is important to the project management.PM is a person who lead the team in figuring out what the project is(planning,scheduling,and requirements gathering),shepherding the project through design adn development work(communication,decision making, and mid-game strategy),and driving the project through to completion(leadership,crisis management,and end-game strategy).



In the book, the more important points refered - The balancing act of project management:
1.Ego / no-ego
2.Autocrat / delegator
3.Tolerate ambiguity / pursue perfection
4.Oral / written
5.Acknowledge complexity / champion simplicity
6.Impatient / patient
7.Courage / fear
8.Believer / skeptic

Ruby Cookbook

终于狠了心买了《Ruby Cookbook》,电子版本看着太费眼神,纸质的感觉始终留着书香:)决定好好看看Ruby,因为写RoR的时候,感觉Ruby基础太弱,以致于很多概念,包括Plugin的使用都不是很顺手,以后每天都抽出时间看几个Recipe,嘿嘿,Ok,let's
look at it.


Recipse 1.1 Building a String from Parts


hash = {'key1'=>'val1','key2'=>'val2'}
string = ""



# don't code like following,
# because it makes new String object,wastes time and memory
hash.each {|k,v| string << "#{k} is #{v}\n"}



# more efficient way like this:
hash.each {|k,v| string << k << " is " << v << "\n" }



data = ['1','2','3']
data.join('|')
# => 123
# another way to simulate the behavio of Array#join across an iteration
s=""
data.each_with_index {|x,i| s << x; s << "|" if i < data.length-1 }
puts s
# => 123


2007年1月6日星期六

New Year,New Day,New Blogger,New Blog

新的一年开始了,看了《A good year》,喜欢夏日的普罗斯旺盛产的葡萄园,喜欢街边餐厅的咖啡屋。有个愿望就是学好英语和德语还有法语,去趟欧洲。
今天在书店随手翻了本介绍咖啡的书,有一则有趣的文章,提到在荷兰,写有Caffee shop和Café的地方是不一样的,如果去前者喝咖啡,那可以免费的吸二手大麻,后者那才是纯粹的咖啡店。有趣:)
不太明白小资情节为何,不过根据最近的表象来看,偶已经进入此等人物的状态,至少也是预备状态,长此以往,是利是弊?
开个新的blog,不愿忘旧人,勇敢的提起勇敢的面对。如果还能见到你,是怎样的方式呢?
想在这里做一个新的Blogger,写新的article,记录要学习的东西,记录每段音乐路程。
New Year,New Day,New Blogger,New Blog,我想我准备好了。