Monday, September 18, 2006

Is this a bug of RoR

if i use
@actitivies_pages, @activities = paginate :activities, conditions => ["B.tag_id = ?",tag], :joins => "as A inner join relations as B on A.id = B.activity_id
i found it will use B.id as @activities.id since both Activity and Relation has a column called "id"

Luckily, i found the solution: to use ":include" instead of join, or can use ":select" to choose columns. any way, the problem should be fixed in the later version of RoR.

Thursday, September 14, 2006

A Mass

These days, i am reading some book about Machine Understanding. Still a mass in practice.

Tuesday, September 05, 2006

How can Baidu do this

When i search "www.shujip.com" at Baidu, i will get "www.mymuw.com". but i am sure i have not relationship with it at all. What the algrithm does Baidu use?

Monday, September 04, 2006

Organizing Issue of CSS

With the help of CSS, we can just use div in html file. easy change, easy control.
The problem is how to organize the CSSes, to create flexible css CLASS.
In practice, many duplicate codes are written in CSS, such as font-size, padding, etc. In fact, they can be devided into several category, some is response for font, some is for layout, others may be for link. in this way, if we write html like
<div class="control background">
<div class="control layout">
<div class="control font">
</div>
</div>
this is just an example. some similar setting can be used manytimes. May be the layout is similar in many block. Of course it is better then the way without CSS, since we must write same style for many times. In another way, it can help us to control the page in a higher level, which means we can decide which blocks may be in similar style but with difference in little feature.
However, it does not have to be done in this way. anyway, it is up to the design by you.