2010年9月29日 星期三

User Heat-「訪問者關注網頁的哪個段落」和「哪些區域被點擊」的系統

這個工具是調查「訪問者關注網頁的哪個段落」和「哪些區域被點擊」的系統,並且在系統上共享調查結果。

只要在網站上設置這工具後,就能免費查詢其他訪客如何閱覽您的網頁,透過熱影像圖來將結果可視化。 結果圖像會覆蓋於您的網頁顯示。 這個結果也公開於您網站的其他訪客。

官方網站:http://userheat.com/

2010年9月23日 星期四

[Tool]線上預覽javascript framework作用 - jsFiddle

之前常常到黑暗執行緒大大的網站吸收新知,有時候看到一些很神奇的jQuery功能,
就會跑去黑大的Mini jQuery Lab試驗看看sample code,動手改改看sample code。
既不用下載東西,也不用擔心環境。


後來,在某個Group裡,發現有人推薦了一個網站,叫做 jsFiddle,
一開始還以為是像Fiddler之類工具,用來trace javascript的。
結果才發現,根本就是黑大的Mini jQuery Lab擴充版。

jsFiddle裡面提供了高達10種javascript framework的lab,且各個framework也提供了相當多版本供測試使用。

裡面的framework包括了:
Mootools
Mootools Core 1.1.2
Mootools Core 1.2.3
Mootools Core 1.2.4
Mootools Core 1.3 (nightly)
jQuery
jQuery 1.2.6
jQuery 1.3.2
jQuery 1.4 (nightly)
jQuery 1.4.2
Prototype
Prototype 1.6.1.0
YUI
YUI 2.7.0
YUI 2.8.0r4
YUI 3 (min)
Glow
Glow Core 1.7.0
Vanilla
Vanilla JS
Dojo
Dojo 1.3
Dojo 1.4
Processing.js
Processing.js 0.6
ExtJS
ExtJS Core 3.0.0
ExtJS Core 3.1.0
RaphaelJS
RaphaelJS 1.3.1

可選擇的項目請見下圖:


選好你要測試的framework後,就可以開始將HTML、CSS以及要測試的javascript寫上去,


TidyUp可以幫忙排版,點了Run之後,就可以看到執行的結果。
而Save as new,jsFiddle則會提供一個網址,例如:http://jsfiddle.net/gtyvv/
並且會提供一個Embed on your page的


如果有需要修改,則可以點Update的按鈕,jsFiddle會將新的版本記下來,並且透過RESTful的機制,幫您記錄下來歷次更新的code喔!

第二次修改的範例:


這個功能,我自己覺得超級棒的!
因為很常在分享或使用sample code時,我們都會做一些調整。
或是當自己分享的版本,有更好的寫法時,其他高手可以直接在上面Update,並告知是分享在哪一版本,這樣的方式可以避免一樣的東西得重新複製貼上到另一份jsFiddle上。

個人覺得這網站真是佛心來的啊,希望分享出來,可以讓大家在技術交流上,在練習多版本或各個不同的javascript framework更加便利!!

摘自:http://www.dotblogs.com.tw/hatelove/archive/2010/03/28/jsfiddle.aspx

2010年9月16日 星期四

Yet Another JavaScript Testing Framework

Did you notice that there are a lot of JavaScript testing frameworks out there? Why has the JavaScript community not consolidated on a single JavaScript framework the way Java has on JUnit. My feeling is that all of these frameworks are good at something but none solve the complete package. Here is what I want out of JavaScript unit-test framework:

I want to edit my JavaScript code in my favorite IDE, and when I hit Ctrl-S, I want all of the tests to execute across all browsers and return the results immediately.

I don’t know of any JavaScript framework out there which will let me do what I want. In order to achieve my goal I need a JavaScript framework with these three features:

Command Line Control

Most JavaScript test runners consist of JavaScript application which runs completely in the browser. What this means in practice is that I have to go to the browser and refresh the page to get my results. But browsers need an HTML file to display, which means that I have to write HTML file which loads all of my production code and my tests before I can run my tests. Now since browsers are sandboxes, the JavaScript tests runner can only report the result of the test run inside the browser window for human consumption only. This implies that 1) I cannot trigger running of the tests by hitting Ctrl-S in my IDE, I have to Alt-tab to Browser, hit refresh and Alt-tab back to the IDE and 2) I cannot display my test result in my IDE, the results are in the browser in human readable form only.

On my continuous build machine I need to be able to run the same tests and somehow get the failures out of the browser and on to the status page. Most JavaScript test runners have a very poor story here, which makes integrating them into a continuous build very difficult.

What we need, is the ability to control test execution from command line so that I can trigger it from my IDE, or my continuous build machine. And I need test failures to be reported on the command line (not inside the browser where they are unreachable) so that I can display them in IDE or in continuous build status page.

Parallel Execution

Since most JavaScript test runners run fully in the browser I can only run my test on one browser at a time during my development process. In practice this means that you don’t find out about failures in other browser until you have checked in the code to your continuous build machine (if you were able to set it up) and your code executes on all browsers. By that point you have completely forgotten about what you have written and debugging becomes a pain. When I run my test I want to run them on all browser platforms in parallel.

Instant Feedback in IDE

After I hit Ctrl-S on my IDE, my patience for test results is about two seconds before I start to get annoyed. What this means in practice is that you can not wait until the browser launches and runs the tests. The browser needs to be already running. Hitting refresh on your browser manually is very expensive since the browser needs to reload all of the JavaScript code an re-parse it. If you have one HTML file for each TestCase and you have hundred of these TestCases, The browser may be busy for several minutes until it reloads and re-parses the same exact production code once for each TestCase. There is no way you can fit that into the patience of average developer after hitting Ctrl-S.

Introducing JsTestDriver

Jeremie Lenfant-engelmann and I have set out to build a JavaScript test runner which solves exactly these issues so that Ctrl-S causes all of my JavaScript tests to execute in under a second on all browsers. Here is how Jeremie has made this seemingly impossible dream a reality. On startup JsTestDriver captures any number of browsers from any number of platforms and turns them into slaves. As slave the browser has your production code loaded along with all of your test code. As you edit your code and hit Ctrl-S the JsTestDriver reloads only the files which you have modified into the captured browsers slaves, this greatly reduces the amount of network traffic and amount of JavaScript re-parsing which the browser has to do and therefore greatly improves the test execution time. The JsTestDriver than runs all of your test in parallel on all captured browsers. Because JavaScript APIs are non-blocking it is almost impossible for your tests to run slow, since there is nothing to block on, no network traffic and no re-parsing of the JavaScript code. As a result JsTestDriver can easily run hundreds of TestCases per second. Once the tests execute the results are sent over the network to the command which executed the tests either on the command line ready to be show in you IDE or in your continuous build.

摘自:http://misko.hevery.com/2009/05/22/yet-another-javascript-testing-framework/

2010年9月13日 星期一

[小技巧] Mac OS X 內建輸入法碼查找及自建功能

今天小弟無意中發現MAC OS X 於中文輸入狀態下可使用快捷鍵開啟輸入法碼查詢框, 此查詢框可讓使用者即時查詢4種中文輸入法的代碼,包括倉頡、速成、拼音與注音,方法如下:

1.中文輸入狀態下,點選文字框然後同時按下[shift] + [option] + [L] 鍵

2.系統會彈出以下框框,使用者可輸入最多兩個字作查詢

3. 如下圖

另外在同一狀態下同時按下[shift] + [option] + [P] 鍵

即可彈出自創輸入法的教學板面 如下圖:

最後一個設定是小弟自轉用Mac 以後久違已久,一直以為Mac OS 欠逢的功能,就是中文詞語聯想;即輸入一字自動彈出聯想詞。其實使用者於同一狀態下只要同時按下[shift] + [option] + [U] 鍵,再在彈出的設定上勾選show associated words即可,而且功能強大,包括可透過Dictionaries Tab 勾選聯想字來源。

MAC!COOL~


摘自:http://www.macuknow.com/node/6038

2010年9月12日 星期日

[PHP]解決Notice: A session had already been started – ignoring session_start() 問題

將原來的

session_start();

修改為

if (!isset($_SESSION)) {
session_start();
}

2010年9月11日 星期六

超好用的網頁layout規畫工具:Balsamiq Mockups

http://wp.tenz.net/archives/723

Really Simple Color Picker (jQuery)

http://www.web2media.net/laktek/2008/10/27/really-simple-color-picker-in-jquery/

2010年9月10日 星期五

如何將ipod的音樂同步到電腦

相信使用過iPod系列產品的玩家們都應該知道,可以透過iTunes可以將電腦內的檔案同步到iPod內,但是一旦電腦發生狀況,裡面的檔案不見了,想要之前的檔案就必須要把iPod的檔案回復,但我們必須要使用一些軟體來幫助我們回復,如:Senuti...也就是本章節要介紹的軟體。

第一步當你下載完成之後,選擇完複製檔案的位置後,記得按下一步continue!

第二步要注意使用Senuti前,請先開啟iTunes連接iPod,確定iPod管理的部份有勾選啟用磁碟功能,以及手動管理音樂。


接著進入Sunuti視窗內,應該就可以瀏覽iPod內所有的檔案,而在檔案旁邊有小藍點的代表您的電腦中已經有相同檔名的檔案了,無需複製造成資源浪費。PS:小編電腦太乾淨,所以沒有藍點出現...


如果要複製內容的話,請選擇音樂或影片後,按下左上方綠色按鈕的Transfer。

複製完畢之後可以開啟iTunes,在"最近加入"的標籤內可以看到剛剛複製過來的檔案。

摘自:http://www.goapple.com.tw/index.php?pa=guide_view&id=193&kid=

2010年9月5日 星期日

Error log : PHP Notice: Undefined offset solution

use below code
isset($test[4]) ? $test[4] : '';

Raphaël—JavaScript Library

Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.

Raphaël [ˈrafēəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy.

Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+.

官網:http://raphaeljs.com/

2010年9月2日 星期四

[Debug]Apache error.log 出現 load php_exif.dll failed.

用了 The AppServ Open Project - 2.5.10 for Windows 來安裝Web環境,居然在Apache Start就出現這個error(在error.log裡面可以看到).搞了半天才搞懂,原來PHP5 必須先Load php_mbstring.dll才能Load php_exif.dll,把PHP.ini裡extension部分改了順序就OK囉!

The Apache2.2 service is restarting.
The Apache2.2 service has restarted.
pache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Sun Mar 22 14:30:56 2009] [notice] Server built: Jan 18 2008 00:37:19
[Sun Mar 22 14:30:56 2009] [notice] Parent: Created child process 4020
[Sun Mar 22 14:30:56 2009] [notice] Child 4020: Child process is running
[Sun Mar 22 14:30:57 2009] [notice] Child 4020: Acquired the start mutex.
[Sun Mar 22 14:30:57 2009] [notice] Child 4020: Starting 64 worker threads.
[Sun Mar 22 14:30:57 2009] [notice] Child 4020: Starting thread to listen on port 80.
The Apache2.2 service is restarting.
[Sun Mar 22 14:41:22 2009] [notice] Parent: Received restart signal -- Restarting the server.
[Sun Mar 22 14:41:22 2009] [notice] Child 4020: Exit event signaled. Child process is ending.
PHP Warning: PHP Startup: Unable to load dynamic library 'E:/AppServ\\php5\\ext\\php_exif.dll' - \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C\r\n in Unknown on line 0
[Sun Mar 22 14:41:22 2009] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations
[Sun Mar 22 14:41:22 2009] [notice] Server built: Jan 18 2008 00:37:19
[Sun Mar 22 14:41:22 2009] [notice] Parent: Created child process 1312
PHP Warning: PHP Startup: Unable to load dynamic library 'E:/AppServ\\php5\\ext\\php_exif.dll' - \xa7\xe4\xa4\xa3\xa8\xec\xab\xfc\xa9w\xaa\xba\xbc\xd2\xb2\xd5\xa1C\r\n in Unknown on line 0
[Sun Mar 22 14:41:22 2009] [notice] Child 1312: Child process is running
[Sun Mar 22 14:41:23 2009] [notice] Child 4020: Released the start mutex
[Sun Mar 22 14:41:23 2009] [notice] Child 1312: Acquired the start mutex.
[Sun Mar 22 14:41:23 2009] [notice] Child 1312: Starting 64 worker threads.
[Sun Mar 22 14:41:23 2009] [notice] Child 1312: Starting thread to listen on port 80.
[Sun Mar 22 14:41:24 2009] [notice] Child 4020: All worker threads have exited.
[Sun Mar 22 14:41:24 2009] [notice] Child 4020: Child process is exiting

wibiya widget