2010年11月28日 星期日

2010年11月19日 星期五

MochaU - A web applications user interface library

MochaUI is a web applications user interface library built on the Mootools JavaScript framework.

Uses
Web Applications
Web Desktops
Web Sites
Widgets
Standalone Windows and Modal Dialogs

2010年11月17日 星期三

Zenoss Open Source Server and Network Monitoring - Core and Enterprise

Zenoss Enterprise 3.0 is a purpose-built Dynamic Service Assurance
product that improves the delivery of IT service to applications, business
services and supporting infrastructure in the dynamic datacenter. It's one
product that unifies the delivery of IT service across physical, virtual and
hybrid cloud infrastructures.

官網:http://www.zenoss.com/

Ganglia Monitoring System

What is Ganglia?
Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. It leverages widely used technologies such as XML for data representation, XDR for compact, portable data transport, and RRDtool for data storage and visualization. It uses carefully engineered data structures and algorithms to achieve very low per-node overheads and high concurrency. The implementation is robust, has been ported to an extensive set of operating systems and processor architectures, and is currently in use on thousands of clusters around the world. It has been used to link clusters across university campuses and around the world and can scale to handle clusters with 2000 nodes.

Ganglia is a BSD-licensed open-source project that grew out of the University of California, Berkeley Millennium Project which was initially funded in large part by the National Partnership for Advanced Computational Infrastructure (NPACI) and National Science Foundation RI Award EIA-9802069. NPACI is funded by the National Science Foundation and strives to advance science by creating a ubiquitous, continuous, and pervasive national computational infrastructure: the Grid. Current support comes from Planet Lab: an open platform for developing, deploying, and accessing planetary-scale services.

官網:http://ganglia.sourceforge.net/

強大的PHP Logger

Log4php is logging framework for PHP at the Apache Software Foundation (ASF), sponsored by the Apache Logging Services project.

Log4PHP has completed graduation in March 2010.

log4php supports:

Configuration through xml and properties file (same structure as log4j).
File, RollingFile, DailyFile, Echo, Console, Mail, PDO, PHP error, Syslog or NT events and Socket appenders.
Simple, TTCC, Pattern, Html and Xml Layouts.
Nested (NDC) and Mapped (MDC) Diagnostic Contexts.

官網:http://logging.apache.org/log4php/

The virtualization API

libvirt is:
A toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes).
Free software available under the GNU Lesser General Public License.
A long term stable C API
A set of bindings for common languages
A CIM provider for the DMTF virtualization schema
A QMF agent for the AMQP/QPid messaging system
libvirt supports:
The Xen hypervisor on Linux and Solaris hosts.
The QEMU emulator
The KVM Linux hypervisor
The LXC Linux container system
The OpenVZ Linux container system
The User Mode Linux paravirtualized kernel
The VirtualBox hypervisor
The VMware ESX and GSX hypervisors
Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
libvirt provides:
Remote management using TLS encryption and x509 certificates
Remote management authenticating with Kerberos and SASL
Local access control using PolicyKit
Zero-conf discovery using Avahi multicast-DNS
Management of virtual machines, virtual networks and storage
Portable client API for Linux, Solaris and Windows

管網:http://www.libvirt.org/

2010年11月16日 星期二

[Debug]Mac osx INSERT,DELETE,UPDATE statement sqlite got error "SQLSTATE[HY000]: General error: 14 unable to open database file"

solution:
no only .db file have to chmod to 777
the folder of .db file place also have to chmod to 777

2010年11月15日 星期一

Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K

Zepto.js is a minimalist JavaScript framework for mobile WebKit browsers, with a jQuery-compatible syntax.

The goal: a 2k library that handles most basic drudge work with a nice API so you can concentrate on getting stuff done.

2010年11月14日 星期日

[Debug]Apache on Mac OS X couldn't grab the accept mutex

I just ran into a problem where Apache wouldn't start on my Mac OS X laptop (Leopard 10.5.8 although it shouldn't really be relevant as it was working just fine for weeks with that OS version). The following was in the error log:

[Mon Aug 31 12:20:15 2009] [emerg] (13)Permission denied: couldn't grab the accept mutex
[Mon Aug 31 12:20:15 2009] [emerg] (13)Permission denied: couldn't grab the accept mutex
[Mon Aug 31 12:20:15 2009] [emerg] (13)Permission denied: couldn't grab the accept mutex
[Mon Aug 31 12:20:15 2009] [emerg] (13)Permission denied: couldn't grab the accept mutex
[Mon Aug 31 12:20:15 2009] [emerg] (13)Permission denied: couldn't grab the accept mutex
[Mon Aug 31 12:20:16 2009] [alert] Child 1294 returned a Fatal error... Apache is exiting!


The solution is to find the AcceptMutex line in your httpd.conf (add one if you don't have it already) and change it to

AcceptMutex flock

Rock on.

zend studio install aptana plugins

Plugin URL : http://download.aptana.com/tools/studio/plugin/install/studio

From the Help menu, select Install New Software... to open the Install New Software dialog.
Paste the URL for the update site into the Work With text box, and hit the Enter (or Return) key.
In the populated table below, check the box next to the name of the plug-in, and then click the Next button.
Click the Next button to go to the license page.
Choose the option to accept the terms of the license agreement, and click the Finish button.
You may need to restart Eclipse to continue.

2010年11月13日 星期六

SQLite — Dump database

In order to dump a SQLite database you can use the following command:

sqlite database .dump > database.sql

To put the data into a SQLite database from a sql file use:

sqlite database < database.sql

摘自:http://notfaq.wordpress.com/2006/08/20/databasessql-sqlite-dump-database/

2010年11月8日 星期一

HTML5 Websocket

Speaker - Chia-Liang Kao, clkao
http://clkao.vox.com/

Websocket API
http://dev.w3.org/html5/websockets/

Websocket protocol
http://www.whatwg.org/specs/web-socket-protocol/

WebSocket的應用
- plurk
- facebook

Websocket出現前 Server跟Client溝通的技術
- Ajax
- Comet (http://en.wikipedia.org/wiki/Comet_(programming))
(兩個名字來源其實都是美國知名的清潔劑品牌 像魔術靈之類的)

Websocket的URI
ws://XXXhost.com
wss://XXXhost.com (多個s代表用了SSL)

WebSocket目前不support傳送binary data
但即使能support binary , JavaScript如何來處理這些data也是一個問題

另外如果有作多個connection的話 也是要client自己來maintain這些connections
(Multiplexing)

WebSocket Server端的軟體

Web::Hippie:AnyEvent
http://clkao.vox.com/library/post/hippie---getting-started.html

講者自己寫的package

講一下而已 大概沒一個小時就講完了

跨越行動網頁與原生軟體的隔閡 – PhoneGap

隨著行動運算的市場規模成長,許多Web開發者也紛紛的對行動平台感到興。然而,為了能夠在iPhone或Android上推出自己的軟體,就必須得花上不少時間先學會這兩個平台上的相關開發技術,讓許多Web開發者遲遲無法跨入這個領域,選擇用網頁技術開發行動版網頁作為替代,而PhoneGap便是可以解決這個問題的最佳選擇!

8/15更新!
JetPlurk的作者Irvin提供了他們在Coscup上Lightning Talk時展示的範例程式碼,讓有興趣的朋友可以參考。

跨平台間的共同開發環境

除了Android、iPhone兩大陣營之外,國外最大的Blackberry和透過Mameo展開反擊的Nokia也都佔有一定的市場。而每個不同的平台均有不同的開發工具、開發環境,對於行動開發者而言會是很大的負擔。

然而,在這些平台中,其實是有著共同的標準,也就是網頁標準HTML、CSS與JavaSript,且由於HTML的快速發展,一些新的技術像是HTML5或是CSS3的出現,讓網頁可以突破傳統的限制,成為功能完整的應用程式。更重要的是,這些行動網頁的軟體大多都可以幾乎不用修改、或是透過很少的修改便移植到不同的平台。

原生軟體的優點
由於是透過瀏覽器作為軟體的入口,所以仍然與一般的apps有明顯差異。更重要的是,這些網頁軟體沒有辦法像其他原生開發的軟體一般,透過軟體銷售平台獲利,而是必須在行動網頁中自行加入付費的會員機制或是廣告。

這樣的困境便造成了網頁開發者的兩難局面:固然開發行動網頁作為軟體是容易且跨平台的,但最終成品與原生應用仍有明顯的差異,但學習原生的開發卻又必須花費許多時間成本。

PhoneGap


PhoneGap便是為了要解決這個問題而誕生了!

這套開放原始碼的解決方案,便是提供了iPhone、Android、Palm和Blackberry平台的原生包裝軟體(wrapper),讓行動網頁可以被包裝成原生軟體的樣子,而不需透過瀏覽器作為入口。

背後的原理也沒有很複雜,PhotoGap所提供的其實是一個只有瀏覽器的軟體程式碼和幾個已經預設建立好的資料夾,而我們所要做的事情便是將寫好的網頁應用程式,包含HTML、CSS和JavaScript放到指定的資料夾中,便可以完成一隻以假亂真的原生應用軟體了!

以iPhone為例
就讓我們以iPhone平台作為例子,做一個簡單的介紹吧!

PhoneGap的安裝步驟以比較複雜,大概如下:

安裝好iPhone SDK(可以由蘋果的開發網站下載)
下載PhoneGap的最新版本
打開終端機並切換到剛剛下載的資料夾下,進入phonegap-iphone子目錄並且輸入make建立安裝檔
執行剛剛建立出來的安裝檔叫做PhoneGapLibInstaller.pkg進行安裝
接下來我們就可以開始建立第一個PhoneGap軟體了!
打開Xcode並且建立專案,你會發現在側欄中多了PhoneGap的選項,選擇建立一個新的PhoneGap專案後Xcode便會自動生成大多數的檔案。



我們會在專案目錄中看到其中有一個www資料夾,這個資料夾中便可以讓我們放置軟體中所需要用到的HTML以及CSS和圖像等檔案:



在我們加入適當的網頁內容後,另外需要設定BaseSDK以便讓Xcode編譯時可以使用最新版的iOS 4.0 SDK來進行編譯,我們在專案的項目上面按右鍵選擇Get Info:


接下來在選項中找到Base SDK,選擇iPhone Device 4.0即可:


最後則是在Xcode左上角選單中選擇Simulator,然後編譯就可以在模擬器中看到成果囉!


進階玩法
除了基礎的網頁之外,我們可以透過PhoneGap所提供的其他一些JavaScript API來與原生的UI元件做連結,像是加速器、攝影機等等,在官方網站的文件中都有記載相關的使用方式。

結論
這一類的應用程式在App Store中其實有相當不少的案例了,像是JetPlurk這套相當流行的噗浪軟體便是透過PhoneGap所完成的。筆者相信,隨著行動市場的崛起,未來會有越來越多網路業者和開發者投入行動市場,這一類的應用程式框架將會越來越受到重視、功能也將會變得更為完善!

摘自:http://www.inside.com.tw/08/15/phonegap-eliminates-the-gap-between-mobile-web-and-native-apps

2010年11月5日 星期五

Setting a permanent host name in Mac OS X

sudo vi /etc/hostconfig:

HOSTNAME=yourhostname.com

$ sudo scutil --set HostName yourhostname.com

2010年11月4日 星期四

Mac OSX fails with "Operation not permitted"

This is because file system is locked
You can solved this problem by run below command.

$ chflags -R nouchg /path/to/nopermitted

補充:
話說,我不小心下了以下的指令
$ chflags -R /path/to/specific

造成/path/to/specific下的所有檔案Operation not permitted

解決方法:
$ ls -lOAe
發現檔案多了以下的uappnd,nodump,opaque property

$ chflags -R noupappnd /path/to/specific/*
$ chflags -R noopaque /path/to/specific/*
$ chflags -R dump /path/to/specific/*

將property取消即可

2010年11月1日 星期一

Aptana Setting PHPUnit & PHP Debugger

1.Install with PEAR
sudo pear upgrade PEAR
sudo pear channel-discover pear.phpunit.de
sudo pear channel-discover pear.symfony-project.com
sudo pear channel-discover components.ez.no
sudo pear install phpunit/PHPUnit

Try running:
phpunit –version
You should see the following response:

PHPUnit 3.5.0 by Sebastian Bergmann.


2.Install Manual (I used this way ^__^)
Download PHPUnit-3.5.3.tgz from http://pear.phpunit.de/get/ and extract to folder PHPUnit
Download File_Iterator-1.2.3.tgz and extract to folder PHPUnit
Download PHP_CodeCoverage-1.0.2.tgz and extract to folder PHPUnit
Download PHP_Timer-1.0.0.tgz and extract to folder PHPUnit
Download PHP_TokenStream-1.0.1.tgz and extract to folder PHPUnit
Download Text_Template-1.0.0.tgz and extract to folder PHPUnit

Setting PHPUnit as External Tools
Aptana >> External Tools Configurations
Main Tabs as below:
Location:/Applications/XAMPP/xamppfiles/bin/php
Working Directory:${workspace_loc}
Arguments:/Users/jersus/htdocs/PHPUnit/phpunit.php --verbose --stop-on-failure ${resource_loc}

Common Tabs as below:
checked Display in favorites menu > External Tools


Setting Debugger PHPUnit
Run >> Debug Configuration
PHP Script Tabs as below:
PHP Debugger : Zend Debugger
PHP Executable : PHP(/Application/XAMPP/xamppfiles/bin/php-5.3.1)
PHP File : /Applications/XAMPP/xamppfiles/bin/phpunit

PHP Script Arguments Tabs as below:
--verbose ${resource_loc}

Common Tabs as below:
checked Display in favorites menu > Debug
checked Display in favorites menu > Run

wibiya widget