Tuesday, April 28, 2009

Ubuntu hibernate suspend

Some commands to hibernate/suspend, tested on Ubuntu Hardy (8.04). Note that the effects of these command on laptop and desktop may be different with the same version of Ubuntu.


pmi action hibernate

pmi action suspend


pm-hibernate

pm-suspend


/etc/acpi/sleep.sh

/etc/acpi/hibernate.sh


/usr/lib/hal/scripts/linux/hal-system-power-hibernate-linux

/usr/lib/hal/scripts/linux/hal-system-power-suspend-linux



BONUS:

gnome-screensaver-command --lock

sudo apt-get install uswsusp && sudo s2ram --force

sudo apt-get install uswsusp && sudo s2disk

Sunday, April 19, 2009

Oracle and Sun

A big acquisition !

XPath quick notes

The most useful path expressions to select nodes:


Expression Description
nodename Selects all child nodes of the named node
/ Selects from the root node
// Selects nodes in the document from the current node that match the selection no matter where they are
. Selects the current node
.. Selects the parent of the current node
@ Selects attributes


XPath wildcards to select unknown XML elements.


Wildcard Description
* Matches any element node
@* Matches any attribute node
node() Matches any node of any kind


XPath axes defines a node-sets relative to the current node.


AxisName Result
ancestor Selects all ancestors (parent, grandparent, etc.) of the current node
ancestor-or-self Selects all ancestors (parent, grandparent, etc.) of the current node and the current node itself
attribute Selects all attributes of the current node
child Selects all children of the current node
descendant Selects all descendants (children, grandchildren, etc.) of the current node
descendant-or-self Selects all descendants (children, grandchildren, etc.) of the current node and the current node itself
following Selects everything in the document after the closing tag of the current node
following-sibling Selects all siblings after the current node
namespace Selects all namespace nodes of the current node
parent Selects the parent of the current node
preceding Selects everything in the document that is before the start tag of the current node
preceding-sibling Selects all siblings before the current node
self Selects the current node

Tuesday, April 07, 2009

Monday, April 06, 2009

English Talking Practice

Sau bài về cách luyện kỹ năng nghe thì có một số bạn hỏi tôi có tips nào tương tự như thế để luyện nói hay không .

Dĩ nhiên là có rồi :-)

Nhưng nên nhớ có nhiều phương pháp học tiếng Anh và bạn có thể áp dụng vài cách trong số đó miễn là bạn cảm thấy phù hợp với mình và có hiệu quả.
Điều quan trọng là không nên áp dụng TẤT CẢ quy tắc hoặc cách học của người khác. Khi học theo một cách nào đó, nên thử chỉ 1 cách đó hoặc tối đa là 2, 3 cách; đừng dại dột mà thử nhiều cách mới cùng lúc, bởi khi đó bạn sẽ khó nhận thấy kết quả.


Sau đây là một số quy tắc quan trọng để học tiếng Anh, chủ yếu giúp cải thiện khả năng Talking, mà bản thân tôi cảm thấy rất hiệu quả. Nếu bạn đã có căn bản về ngữ pháp tiếng Anh thì áp dụng những cách này sẽ giúp bạn cải thiện việc giao tiếp với người nước ngoài trong thời gian ngắn !


1/ Từ vựng: học theo CỤM TỪ (câu ngắn cũng có thể xem là 1 cụm từ)
REASON:


2/ Gặp người nước ngoài: đừng bận tâm ngữ pháp
REASON:


3/ Trong lớp học: chỉ dùng tiếng Anh (các địa điểm như English Club cũng vậy)
REASON:


4/ Nghiền ngẫm: nghe lặp đi lặp lại để hiểu (ko dùng thiết bị thì tự mình đọc)
REASON:


5/ Ngữ pháp: nắm vững cơ bản (Simple Past, Simple Present, Present Perfect, Simple Future) qua các đoạn kể.
REASON:


6/ Cập nhật: học từ vựng thực tế, hiện đại qua các bản tin và Internet sites.
REASON:


7/ Phản xạ với tiếng Anh: bằng các đoạn Hỏi Đáp đơn giản thực tế
REASON:



Have fun ! and Good Luck !

Sunday, March 29, 2009

XMLHttpRequest quick notes


interface XMLHttpRequest {
// STATE
attribute int readyState; // readonly
attribute EventListener onreadystatechange;

const unsigned short UNSENT = 0; // innerHTML == "uninitialized"
const unsigned short OPENED = 1; // innerHTML == "loading"
const unsigned short HEADERS_RECEIVED = 2; // innerHTML == "loaded"
const unsigned short LOADING = 3; // innerHTML == "interactive"
const unsigned short DONE = 4; // innerHTML == "complete"

// REQUEST
void open(DOMString method, DOMString url, boolean async);
void open(DOMString method, DOMString url, boolean async, DOMString user, DOMString password);

void setRequestHeader(DOMString header, DOMString value);

void send(in DOMString data);
void send(in Document data);

void abort();

// RESPONSE readonly
attribute Document responseXML;
attribute DOMString responseText;
attribute int status;
attribute DOMString statusText;

DOMString getAllResponseHeaders();
DOMString getResponseHeader(in DOMString header);
};

Saturday, March 28, 2009

BarCamp Hanoi 2009

BarCamp Hanoi 2009 registration is now open

Register here: http://www.barcamphanoi.org/?page_id=10&lang=en



What:


BarCamp is a user-generated event — open, participatory workshop-events, whose content is provided by participants.


There is no audience, only participants. Attendees must give lead a discussion, give a demo, or help with one, or otherwise volunteer / contribute in some way to support the event. All sessions are scheduled the day they happen. The people present at the event will select the demos or presentations they want to see.


Attendance is free of charge.

Topics may include, but are not limited to: online services, social media, startups, UI design, entrepreneurship, VC, Web 2.0 technologies, online marketing, online advertising, online payment, e-commerce, open source software, hardware hacking, robotics, mobile computing, bioinformatics, programming languages, even the future of technology or global issues.

Learn more about BarCamp: http://www.barcamphanoi.org/?page_id=2&lang=en
Want to sponsor us: http://www.barcamphanoi.org/?page_id=12&lang=en

When:

April 19, 2009
8.30 AM to 5.00 PM

Where:

RMIT International University, Hanoi Campus
2/2C Van Phuc Compound, Kim Ma Street, Hanoi.

View the map here: http://www.barcamphanoi.org/?page_id=9&lang=en

------------------------------

Mở đăng ký tham dự Barcamp Hanoi 2009



Đăng ký tại đây: http://www.barcamphanoi.org/?page_id=10

Thursday, March 19, 2009

Why Eclipse IDE

( 56kbps modem warning ! )

A PICTURE IS WORTH A THOUSAND WORDS !


Debug Java ( //www.ibm.com/developerworks/opensource/library/os-eclipse-platform )




Customize perspective, views, hotkey... ( //www.ibm.com/developerworks/opensource/library/os-eclipse-master1/ )








Customize formatting ( //www.ibm.com/developerworks/opensource/library/os-eclipse-master3/ )




Refactoring 2003 ( //www.ibm.com/developerworks/library/os-ecref/ ) :




Integrate SVN/CVS ( //www.ibm.com/developerworks/opensource/library/os-ecl-subversion/ )




Debug PHP ( //www.ibm.com/developerworks/opensource/library/os-ecbug/ )




Debug C/C++ ( //www.ibm.com/developerworks/library/os-eclipse-cdt-debug2 )




Debug Python ( //www.ibm.com/developerworks/opensource/library/os-ecant/ )




Debug ActionScript ( //swingchen.bokee.com/6028838.html )




Debug ColdFusion ( //www.ibm.com/developerworks/opensource/library/os-eclipse-cfeclipse/ )




And Ruby ( //www.ibm.com/developerworks/opensource/library/os-eclipse-rdt/ )




even .NET ! ( //www.ibm.com/developerworks/opensource/library/os-eclipse-migratenetvs/ )




and more... ( //www.ibm.com/developerworks/opensource/library/os-eclipse-iphone/ )




Rocks solid on multi-OS : ( //www.ibm.com/developerworks/opensource/library/os-eclipse-osxjava/ )







Other IDEs which turn out to use Eclipse codebase :

FlexBuilder (Adobe)
Websphere Studio Application Developer (IBM)

JDeveloper (Oracle)
JBuilder 2007+ (Borland)
WebLogic workshop (BEA)
ZendStudio (Zend)
Aptana (Aptana)
PowerDesigner (Sybase)
MyEclipse (Genuitec)
Rational XYZ (IBM)
Parasoft XYZ (Parasoft)
. . .


...

Tuesday, March 10, 2009

Collaboration online services

Lúc này tớ chuyển sang các dịch vụ online cho nó đồng nhất, tiết kiệm được khối thời gian khi phải làm việc trên nhiều máy khác nhau: lappy, deskies (@home, @work, etc)


Bookmarks
http://foxmark.com


Technical notes
http://pastebin.org


To-Do list
http://tadalist.com


IRC gossips:
http://mibbit.com


Compilers:
http://codepad.org


and more...