Search

9/24/2008

魔鬼甄與天使嘉 - 《食記》無招牌無菜單御殿屋

魔鬼甄與天使嘉 - 《食記》無招牌無菜單御殿屋

※御殿屋日式家庭料理※
地址:台北市松山區南京東路5段255號2樓(清心樓上)
電話:(02)27605615
時間:18:00~22:00(例假日公休)

应用: text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 实现了溢出文本显示省略号效果

应用: text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 实现了溢出文本显示省略号效果 - 設定 text-overflow:ellipsis之前要先有overflow:hidden,不然內文一樣會溢出,text-overflow:ellipsis FF2不支援,ie6支援(!!),chrom/webkit支援。使用text-overflow:ellipsis的另外一個好處是不會有字從一半cut調的情形。

  语法:
  text-overflow : clip | ellipsis

  参数:
  clip :  不显示省略标记(...),而是简单的裁切
  (clip这个参数是不常用的!)
  ellipsis :  当对象内文本溢出时显示省略标记(...)

http://chunghe.googlecode.com/svn/trunk/experiment/text-overflow.htm

9/18/2008

REST, I just don't get it

RESTful best practices
REST, I just don't get it

Read the comments for some excellent practical reasons to care about REST, including cache management (PUT and DELETE can expire the cache entries for the corresponding GET), the ability to add or move parts of the server API without redeploying client libraries and the idempotency of GET / PUT / DELETE and HEAD (repeated POST operations may have side-effects).

IMG·2·JSON — An image meta–data to JSON web application

IMG·2·JSON — An image meta–data to JSON web application

http://img2json.appspot.com/go/?callback=myCallbackMethod&url=http://www.exif.org/samples/fujifilm-mx1700.jpg

json-tinyurl

json-tinyurl
http://tinyurl.com/api-create.php?url=http://json-tinyurl.appspot.com/

Because sometimes you want to be able to create a shorter version of a URL directly from JavaScript without hosting your own server-side proxy.

Design Elements - V8 JavaScript Engine - Google Code

Design Elements - V8 JavaScript Engine - Google Code

High level design details of Google’s V8 JavaScript engine, including how it uses “hidden classes” to optimise object property lookups and a bit of information on the machine code generation and garbage collection.

Google's undocumented favicon to png convertor

Google's undocumented favicon to png convertor - http://www.google.com/s2/favicons?domain=www.wretch.cc

Showing the favicon of a domain next to a link is a really nice trick, but it’s slightly tricky to achieve as IE won’t display a .ico file if you link to it from an img element, so you need to convert the images server-side. This undocumented Google API does that for you, meaning it’s much easier to add favicons as a feature to your site.

9/16/2008

10 Principles of the CSS Masters - NETTUTS

10 Principles of the CSS Masters - NETTUTS
2. Keep CSS declarations in one line - Jonathan Snook -
2800852816_b417cc7fe6_b
4. Allow block elements to fill space naturally - Jonathan Snook

My rule of thumb is, if I set a width, I don't set margin or padding. Likewise, if I'm setting a margin or padding, I don't set a width. Dealing with the box model can be such a pain, especially if you're dealing with percentages. Therefore, I set the width on the containers and then set margin and padding on the elements within them. Everything usually turns out swimmingly.

Downshift Your Code » Yahoo! User Interface Blog

Downshift Your Code » Yahoo! User Interface Blog
As a concrete example, consider the resize event. In most browsers, the resize event fires after the user has finished resizing the window, meaning that the event is fired once for each window resize. Internet Explorer, on the other hand, fires the resize event continuously as the user is resizing the browser. If you have anything more than some simple calculations being applied during onresize, it’s possible to end up confusing IE by having too much going on (especially if the event handler does any UI manipulations). The solution is to throttle your code so that a method is called a maximum number of times per second. This can be achieved using timeouts and a little bit of indirection. The basic pattern is as follows:


YAHOO.namespace("example");

YAHOO.example.MyObject = {

_timeoutId : 0,
_process : function () {
//processing code goes here
},

process : function () {
clearTimeout(this._timeoutId);
var me = this;
this._timeoutId = setTimeout(function(){
me._process();
}, 250);
}
};

Writing Efficient CSS - MDC

Writing Efficient CSS - MDC
Avoid Universal Rules!
Don't qualify ID-categorized rules with tag names or classes
If you have a style rule that has an ID selector as its key selector, don't bother also adding the tag name to the rule. IDs are unique, so you're slowing down the matching for no real reason.


* BAD - button#backButton { }
* BAD - .menu-left#newMenuIcon { }
* GOOD - #backButton { }
* GOOD - #newMenuIcon { }

Don't qualify class-categorized rules with tag names

Similar to the rule above, all of our classes will be unique. The convention you should use is to include the tag name in the class name.

* BAD - treecell.indented { }
* GOOD - .treecell-indented { }

Try to put rules into the most specific category you can!
The single biggest cause of slowdown in our system is that we have too many rules in the tag category. By adding classes to our elements, we can further subdivide these rules into class categories, and then we no longer waste time trying to match as many rules for a given tag.

* BAD - treeitem[mailfolder="true"] > treerow > treecell { }
* GOOD - .treecell-mailfolder { }

Rely on inheritance!
Learn which properties inherit, and allow them to do so! We have explicitly set up XUL widgetry so that you can put list-style-image (just one example) or font rules on the parent tag, and it will filter in to the anonymous content. You don't have to waste time writing a rule that talks directly to the anonymous content.

* BAD - #bookmarkMenuItem > .menu-left { list-style-image: url(blah); }
* GOOD - #bookmarkMenuItem { list-style-image: url(blah); }

High Performance Ajax Applications

High Performance Ajax Applications

If you have control over where your code is going to be inserted in the page, write your init code in a <script> block located right before the closing </body> tag.
Otherwise, use the YUI Event utility’s onDOMReady method
Memoization:
Module pattern


var fn = (function () {
var b = false, v;
return function () {
if (!b) {
v = ...;
b = true;
}
return v;
};
})();

Store value in function object

function fn () {
if (!fn.b) {
fn.v = ...;
fn.b = true;
}
return fn.v;
}

Lazy function definition

var fn = function () {
var v = ...;
return (fn = function () {
return v;
})();
};

Running CPU Intensive JavaScript Computations in a Web Browser
demo
Julien Lecomte’s Blog » The Problem With innerHTML

YAHOO.util.Dom.setInnerHTML = function (el, html) {
el = YAHOO.util.Dom.get(el);
if (!el || typeof html !== 'string') {
return null;
}

// Break circular references.
(function (o) {

var a = o.attributes, i, l, n, c;
if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
n = a[i].name;
if (typeof o[n] === 'function') {
o[n] = null;
}
}
}

a = o.childNodes;

if (a) {
l = a.length;
for (i = 0; i < l; i += 1) {
c = o.childNodes[i];

// Purge child nodes.
arguments.callee(c);

// Removes all listeners attached to the element via YUI's addListener.
YAHOO.util.Event.purgeElement(c);
}
}

})(el);

// Remove scripts from HTML string, and set innerHTML property
el.innerHTML = html.replace(/]*>[\S\s]*?<\/script[^>]*>/ig, "");

// Return a reference to the first child
return el.firstChild;
};

Document tree modification Using cloneNode

var i, j, el, table, tbody, row, cell;
el = document.createElement("div");
document.body.appendChild(el);
table = document.createElement("table");
el.appendChild(table);
tbody = document.createElement("tbody");
table.appendChild(tbody);
for (i = 0; i < 1000; i++) {
row = document.createElement("tr");
for (j = 0; j < 5; j++) {
cell = document.createElement("td");
row.appendChild(cell);
}
tbody.appendChild(row);
}


var i, el, table, tbody, template, row, cell;
el = document.createElement("div");
document.body.appendChild(el);
table = document.createElement("table");
el.appendChild(table);
tbody = document.createElement("tbody");
table.appendChild(tbody);
template = document.createElement("tr");
for (i = 0; i < 5; i++) {
cell = document.createElement("td");
template.appendChild(cell);
}
for (i = 0; i < 1000; i++) {
row = template.cloneNode(true);
tbody.appendChild(row);
}

tag: performance

9/15/2008

raid1

Taiwan.CNET.com > 數位生活 > 硬派技術 > SATA RAID備援功能大檢測

我們同樣將其中一條排線拔除,來模擬單顆硬碟毀損的狀況。重新開機後,在RAID BIOS載入畫面中,陣列的狀態亮起了黃燈,「Degraded」表示陣列中有成員硬碟損毀或遺失,因此「效能降低」而必須進行RAID重建的動作。


缺少一顆硬碟的RAID 1,狀態顯示為「效能降低」


如果不理會這樣的訊息,系統依然可以正常開機,進入Windows後也可以正常存取所有資料,絲毫不受單顆硬碟毀損的影響,這便是RAID備援功能的作用之一。
RAID系統的重建,在RAID BIOS或作業系統中都可以進行設定,但實際的重建動作都要在作業系統裡面進行。以RAID BIOS中的操作為例,當我們換上另一顆硬碟並重新開機後,系統就可以抓到新硬碟並建議進行重建。

RAID系統的重建,在RAID BIOS或作業系統中都可以進行設定,但實際的重建動作都要在作業系統裡面進行。以RAID BIOS中的操作為例,當我們換上另一顆硬碟並重新開機後,系統就可以抓到新硬碟並建議進行重建。

選擇用來重建RAID的硬碟

注意此時RAID的狀態標示已經由「Degraded」變為「Rebuild」,表示RAID正處於「重建中」的狀態。整個重建過程其實也沒什麼必須設定的,開機後系統就會將資料鏡射到新硬碟中,重建工作是在背景中執行,並不會干擾正常的作業。

RAID狀態顯示為「重建中」

9/09/2008

推薦好喝又可協助生產者的公平貿易咖啡

各位同學,

我們每天多多少少都會飲用咖啡, 不論你對咖啡的要求有多高, 都必需知道一杯咖啡可以改變多少事. 咖啡是僅次於石油的國際第二大貿易商品,但是一個咖啡農一天的所得卻買不起你手上的一杯咖啡。所以推廣公平貿易的產品, 目的是不依靠捐款者的援助,卻能提供農夫、工人與他們的家庭一種永續的方法來改善他們的生計。

我個人推薦生態綠咖啡豆. 他們採用高品質的中南美洲咖啡豆, 在訂購的當天進行烘焙, 非常新鮮. 同時取得國際公平貿易標籤組織正式授權與認證,以高於市場的價格向咖啡農收購,並回饋營收的固定比例支持第三世界國家發展、協助生產者以友善環境的方式種植,讓你在喝咖啡的同時,就能幫助貧窮生產者與他們的家人改善生活、接受基礎醫療照顧與教育,同時還為我們的地球涵養一片森林。

附件為他們的目錄和價格. 詳細目錄可上他們的網站查詢, 有需要可直接連絡. 他們也推出掛耳包, 可以用沖泡的方式, 輕鬆享受優質咖啡的芬芳.

生態綠的網址為 http://www.okogreen.com.tw/
連絡電話是 02-23222225
地址是台北市杭州南路一段14巷16號1樓 (近仁愛路)

各位若需要團購, 我也非常願意為各位服務.

9/08/2008

10 Promising JavaScript Frameworks - Six Revisions

10 Promising JavaScript Frameworks - Six Revisions

JavaScriptMVC is a featured-packed JavaScript framework. JSMVC applies the Model-View-Controller (MVC) architectural pattern to JavaScript, separating business logic from the presentation layer - resulting in increased modularity and ease-of-modification for either one of the components. It has a built-in automated testing unit (because "JavaScript testing sucks") and even emails you when a user encounters an error.

9/05/2008

PCDVD數位科技討論區 - 新版 Verbatim 16X (北美版面) 日本太誘代工 ,已上市!

PCDVD數位科技討論區 - 新版 Verbatim 16X (北美版面) 日本太誘代工 ,已上市!

拜託給我老婆婆的光華地址~小弟需要這樣誠信的賣家
(國際電子廣場B2) 台北市新生南路一段6號 B2 之 16B 光碟百分百

9/02/2008

Google 自己的瀏覽器:Chrome at Gea-Suan Lin’s BLOG

Google 自己的瀏覽器:Chrome at Gea-Suan Lin’s BLOG
Google瀏覽器Chrome即將現身 | vgod’s blog

* Chrome內含新一代的Javascript引擎: V8,這是為了讓網頁上的應用程式能夠執行得更快更好,而不只是瀏覽頁面而已
* Chrome的每一個tab都是獨立的應用程式,也就是說一個tab當掉不會影響到其他tab
* Chrome架構在Apple Webkit和Firefox之上,可跨Windows、Mac OS X、Linux三大平台
*
* Chrome是open source的

George Lee's blog: 巴基斯坦救股市奇招

George Lee's blog: 巴基斯坦救股市奇招 - 這個類似洋蔥電影的笑點居然在現實生活中發生了!

話說巴基斯坦政府禮拜三收盤之後公佈,要替股票訂下一個「交易下限」(price floor)。交易下限是什麼意思?就是股票價格不准低於 27 日的收盤價。如果股票價格低於 27 日的收盤價,是無法成交的!

換句話說,股票准漲不准跌。就算日後要跌,也不准跌低於 27 號收盤價。這是政府規定的「低點」!

大有為的巴基斯坦政府,執行力非常驚人,展現了世界其他國家無法望其項背的魄力和決心。不過既然這樣,幹嘛不乾脆把交易所關掉算了?0_o

石頭閒語:正體中文與簡體中文之網頁泛用字型設定 - 樂多日誌

石頭閒語:正體中文與簡體中文之網頁泛用字型設定 - 樂多日誌

在網頁中使用中文字型時,最大的困擾在於瀏覽器辯識字型名稱的方式不一致。此因中文字型往往具有兩個字型名稱,一為中文名稱,一為英文名稱。例如「標楷體」即為一例,其另有英文名稱「DFKai-sb」。仍以標楷體為例,若在 Windows 2k/XP 之「地區及語言選項」設定為「中文(台灣)」時, IE 只認字型的中文名稱「標楷體」;但若地區不是「中文(台灣)」時, IE 只認英文名稱「DFKai-sb」。故我們必須同時寫出字型的兩個名稱才行。

狼圖騰的科技世界:關於 CSS 設定 font-family 研究 - 樂多日誌
* 微軟正黑體 : Microsoft JhengHei
* 新細明體 : PMingLiU
* 細明體 : MingLiU
* 標楷體 : DFKai-sb

HttpFox :: Firefox Add-ons

HttpFox :: Firefox Add-ons - An HTTP analyzer addon for Firefox