<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9420660</id><updated>2024-08-30T01:45:13.057+08:00</updated><category term="linux"/><category term="java"/><category term="python"/><category term="oracle"/><category term="cygwin"/><category term="gentoo"/><category term="iphone"/><category term="thoughts"/><category term="vim"/><category term="CLI"/><category term="blogger"/><category term="google"/><category term="web2.0"/><category term="EXIF"/><category term="Hardware"/><category term="IPTC"/><category term="JPEG"/><category term="Lightroom"/><category term="Metadata"/><category term="Photography"/><category term="RDF"/><category term="Summary"/><category term="TIFF"/><category term="XMP"/><category term="cvs"/><category term="debian"/><category term="django"/><category term="eclipse"/><category term="exiftool"/><category term="firefox"/><category term="gwt"/><category term="html5"/><category term="interesting"/><category term="mac"/><category term="mac java"/><category term="mac tips"/><category term="qnap"/><category term="webgl"/><category term="websocket"/><category term="xmlrpc"/><category term="yaml"/><title type='text'>Zarick&#39;s Blog | Incipio</title><subtitle type='html'>pure tech stuff which matters~</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Zarick Lau</name><uri>http://www.blogger.com/profile/02107973016104258074</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9420660.post-4852404751195225873</id><published>2016-05-02T19:33:00.000+08:00</published><updated>2016-05-02T22:06:44.445+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CLI"/><category scheme="http://www.blogger.com/atom/ns#" term="EXIF"/><category scheme="http://www.blogger.com/atom/ns#" term="exiftool"/><category scheme="http://www.blogger.com/atom/ns#" term="IPTC"/><category scheme="http://www.blogger.com/atom/ns#" term="JPEG"/><category scheme="http://www.blogger.com/atom/ns#" term="Lightroom"/><category scheme="http://www.blogger.com/atom/ns#" term="Metadata"/><category scheme="http://www.blogger.com/atom/ns#" term="Photography"/><category scheme="http://www.blogger.com/atom/ns#" term="RDF"/><category scheme="http://www.blogger.com/atom/ns#" term="Summary"/><category scheme="http://www.blogger.com/atom/ns#" term="TIFF"/><category scheme="http://www.blogger.com/atom/ns#" term="XMP"/><title type='text'>Concise guide for technical mind on image metadata (EXIF, IPTC, XMP, etc)</title><content type='html'>Almost everyone realize the importance of media metadata when you have a non trivial amount of files to manage. However, various standards come into play whenever one try to dig deeper and to understand how all these thing fit together.&lt;br /&gt;
&lt;br /&gt;
In an attempt to migrate my iPhoto library to Lightroom, I found this topic is interesting yet messy. All image metadata, file format, schema are well maintain and published as some kind of standard, but there seems no easier way to make sense these topics easily. Consider the target is just to ensure I can migrate and manage the metadata in a rational and sensible way, it does not make sense to go through all the information with days of effort.&lt;br /&gt;
&lt;br /&gt;
Hence, I try to summarize this information in a concise manner (hope this can be digested within 1 hour for people with technical background). If you are technical person but just new to image metadata, and you want to have a sound foundational knowledge, you should benefit from this article (at least this is my goal).&lt;br /&gt;
&lt;br /&gt;
This article will first go through various kind of Metadata, following technical details on how this metadata embedded in the image file. Finally, the document will illustrate how to use &lt;a href=&quot;http://www.sno.phy.queensu.ca/~phil/exiftool/&quot;&gt;exiftool&lt;/a&gt; tools to better understand the data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Types of Metadata&lt;/h3&gt;
&lt;a href=&quot;http://www.cipa.jp/std/documents/e/DC-008-2012_E.pdf&quot;&gt;EXIF&lt;/a&gt; is probably the earliest types of data. It primarily focus is technical information (here technical in the sense of photography). Sample information include capturing time, capture location (GPS), exposure setting (aperture,ISO,shutter), camera/lens maker and model. The standard defined the tag schema (what is the meaning for each tag) as well as on binary level how EXIF meta data can be represented.&lt;br /&gt;
&lt;br /&gt;
IPTC is a metadata schema originated by news/media agency. &amp;nbsp;The focus on IPTC is support annotation and organization (for example Keywords). &amp;nbsp;There are two generation of IPTC, &lt;a href=&quot;https://iptc.org/standards/iim/&quot;&gt;IPTC IIM&lt;/a&gt; (Information Interchange Model) and IPTC4XMP. Usually when people refers IPTC tags, it refers to IPTC IIM. (We will come back to IPTC4XMP later on when we discuss XMP). IPTC IIM also define the both the logical schema and binary representation.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.adobe.com/devnet/xmp.html&quot;&gt;XMP&lt;/a&gt; define a logical schema for representing media metadata. Very general in nature. The serialization format is XML/RDS. It defines how the standard can be extended to cover different vocabulary (via namespace). The standard consists of 3 parts, the &lt;a href=&quot;http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart1.pdf&quot;&gt;first part&lt;/a&gt; different some serialization details (for example how to represent scalar values and tuples/lists. &lt;a href=&quot;http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2014-12/XMPSpecificationPart3.pdf&quot;&gt;Part 3&lt;/a&gt; define some details on how to represent the XMP data in binary files. This also define how XMP can exists as a sidecar file.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://iptc.org/standards/photo-metadata/iptc-standard/&quot;&gt;IPTC4XMP&lt;/a&gt; bring the vocabulary of IPTC under the XMP standard. It consists of &lt;a href=&quot;http://www.iptc.org/std/photometadata/specification/IPTC-PhotoMetadata-201007.pdf&quot;&gt;IPTC-Core&lt;/a&gt; and IPTC-Extension. In additions to IPTC/XMP, XMP also include dulin core (XMP-DC namespace), Dublin Core are general XML schema for metadata. It originated for librarian purpose.&lt;br /&gt;
&lt;br /&gt;
There are some overlap between IPTC and Dublin Core (given both try to solve the problem for information organization). A few field are defined as &lt;a href=&quot;http://www.photometadata.org/META-Resources-metadata-types-standards-Dublin-Core&quot;&gt;inter-changeable&lt;/a&gt; between two schema. The most important one probably is: IPTC:Keywords vs DC:Subject).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Image File Format for Embedding Metadata&lt;/h3&gt;
&lt;a href=&quot;https://en.wikipedia.org/wiki/JPEG#JPEG_files&quot;&gt;JPEG file consists of &#39;segment&#39;&lt;/a&gt;, each segment starts with 2 bytes to denote the type of segment. For example, 0xFF0xD8 refers to Start of Image, 0xFF0xE1 refers to APP1 segment, 0xFF0xEC refers to APP13 segment. The &#39;App&#39; segment is generic mechanism for application extension. Usually App segment also follow with additional application tag. The 0xFF0xE1 App1 segment is followed with EXIF to denote the segment is an EXIF block. The block content will then be encoded according to EXIF.&lt;br /&gt;
&lt;br /&gt;
Similarly, 0xFF0xEC refers to App3 which is used by IPTC IIM, while 0xFF0xE1 with a &amp;nbsp;segment header &quot;http://ns.adobe.com/xap/1.0/\x00&quot; denote a &lt;a href=&quot;https://en.wikipedia.org/wiki/Extensible_Metadata_Platform#Location_in_file_types&quot;&gt;&#39;XMP&#39; segment&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
A typical JPEG pictures will both embedded with EXIF segment, IPTC-IIM segment and XMP segment. While the XMP segment will include IPTC core elements, Dublin Core elements as well as application specific extension like XMP:LR namespace will contains Lightroom specific extension under XMP format. XMP is serialized as XMP hence you can see an XML text embedded in the JPEG file if you open it with a hex or text editor.&lt;br /&gt;
&lt;br /&gt;
Different metadata schema have some overlap, application usually will synchronize the meta when saving the information. In Lightroom, when an external tools update the Subject tag (part of XMP:DR), LR can be instructed to read this, when LR save the metadata, it will populate the value into both IPTC-IIM:Keyword and XMP-DC:Subject, as well as XMP-LR:HierarchicalSubject.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TIFF have similar mechanism, and most all RAW format is &lt;a href=&quot;https://en.wikipedia.org/wiki/Raw_image_format#File_contents&quot;&gt;derived&lt;/a&gt; from TIFF (include CR2, ARW, and DNG). While RAW files have extension mechanism for embedding metadata, however, Lightroom allow metadata to be written as a sidecar file (all metadata, include post processing settings, are serialized in XMP format, as a separate file seat aside the original file).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Playing with Metadata&lt;/h3&gt;
EXIFTool is a friendly CLI tools to manipulate image metadata. You can use it inspect file in details or update the metadata (hence you can write simple script and batch update a particular tag)&lt;br /&gt;
&lt;br /&gt;
To read the tags, simple dump&lt;br /&gt;
exiftool myPhoto.jpg&lt;br /&gt;
&lt;br /&gt;
Each tag is prefixed with the group (ie: whether it is EXIF, IPTC, XMP, etc)&lt;br /&gt;
exiftool -G myPhoto.jpg&lt;br /&gt;
&lt;br /&gt;
To print all meta data in XMP&lt;br /&gt;
exiftool -X myPhoto.jpg&lt;br /&gt;
&lt;br /&gt;
To update a particular tag&lt;br /&gt;
exiftool -Subject=&#39;OuterSpace&#39; Photos/IMG_4882.jpg&lt;br /&gt;
&lt;br /&gt;
To make Lightroom recognize meta data is updated, &lt;a href=&quot;http://photo.stackexchange.com/questions/14461/how-do-i-use-exiftool-to-update-lightrooms-hierarchical-subject&quot;&gt;need to update IPTC Digest tag&lt;/a&gt;&lt;br /&gt;
exiftool -Subject=&#39;OuterSpace&#39; -IPTCDigest=new Photos/IMG_4882.jpg&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Further References&lt;/h3&gt;
&lt;div&gt;
In additions to reference provided within the text above, some other sites provide very indepth information:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_JPEG_files&quot;&gt;EXIV2 - A C++ library, the website have indepth technical notes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://lclevy.free.fr/cr2/&quot;&gt;Technical notes on CR2 format&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/&quot;&gt;Technical notes from EXIFTOOL&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.photometadata.org/META-101-metadata-types&quot;&gt;A brief intro to different metadata standards&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/4852404751195225873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/4852404751195225873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4852404751195225873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4852404751195225873'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2016/05/concise-guide-for-technical-mind-on.html' title='Concise guide for technical mind on image metadata (EXIF, IPTC, XMP, etc)'/><author><name>Zarick Lau</name><uri>http://www.blogger.com/profile/02107973016104258074</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-6009614538209961584</id><published>2014-05-11T22:12:00.001+08:00</published><updated>2014-05-11T22:12:18.146+08:00</updated><title type='text'>Linux goes mainstream on Desktop</title><content type='html'>Linux goes mainstream on Desktop!&lt;br /&gt;
&lt;br /&gt;
Well, this is a statement I read almost every year on Internet. But I never really think it is going to be the case (even I&#39;m paid to work on it). Yet my thoughts changed recently. Not because the state of Linux is getting significantly better than its rivals. Rather it is caused by the dynamics happens on the industry.&lt;br /&gt;
&lt;br /&gt;
Think about what had happened over last few years. The web is advanced so much. More and more device comes to the market with great success. People is now reading books, surfing, listening music, chat, watching movie on tablet / iPad / or even with just a smartphone. In their home, new TV have a OS there which you can do a lot of thing. Anticipating the advance on web based platform, IoT and wearable computing, I imagine in near future, general users don&#39;t need a PC anymore.&lt;br /&gt;
&lt;br /&gt;
When general users don&#39;t need a PC, who needed it? What kind of users still need a PC? Users who need powerful computing like developers, video editing, scientists will be the key user of PC. In this situation, which platform is most suited the needs? I think it is OSX and Linux, obvious Linux will be choice for developers, IT specialists, scientists.&lt;br /&gt;
&lt;br /&gt;
No one know what the future will looks like, this is just my wild guess. Let&#39;s put this article aside, come back and revisit after 5 years!</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/6009614538209961584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/6009614538209961584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6009614538209961584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6009614538209961584'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2014/05/linux-goes-mainstream-on-desktop.html' title='Linux goes mainstream on Desktop'/><author><name>Zarick Lau</name><uri>http://www.blogger.com/profile/02107973016104258074</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-1358408462783451303</id><published>2011-03-20T19:36:00.006+08:00</published><updated>2011-08-11T22:56:43.488+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Tips for improving Eclipse Performance</title><content type='html'>&lt;div class=&quot;entry-section&quot;&gt;
Eclipse is a great development platform. However it may seems getting slower and slower over time. While I believe real solution to performance problem only comes after correctly identify the actual root cause, doing an objective measurement, however, will take some time. Before actually spent time on perform serious profiling, I gathered some &quot;Tips&quot; through googling. The tips are re-organized and presented below.
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div class=&quot;entry-section&quot;&gt;
&lt;h4&gt;
 Tuning the Environment&lt;/h4&gt;
Tools only perform well if you put it on a properly configured environment. Tips below suggest different means to ensure the environment is properly tuned for development purpose. These tips are general enough to applicable on different development platforms.&lt;br /&gt;
&lt;h5&gt;
Disable anti-virus on demand scanning&lt;/h5&gt;
During clean, build, running test, and launching application application, lots of file is being read, class files are created (temporary) and a lot of library (jar) is being loaded as well.
Turning off On-demand scanning is the most important tips. &lt;br /&gt;
&lt;h5&gt;
Disable file index (for example: Win7/Vista file indexing)&lt;/h5&gt;
Eclipse will create a lot of output files, which have no sense to be indexed. Exclude these files from indexing.&lt;br /&gt;
&lt;h5&gt;
Putting JVM, and Eclipse install on RAM Disk&lt;/h5&gt;
By putting Eclipse and JDK on RAM Disk, Eclipse and JDK tools can be loaded more quickly.
&lt;br /&gt;
&lt;h5&gt;
Use the latest JDK and Eclipse&lt;/h5&gt;
Traditional wisdom. Always stay on the latest stable!
&lt;/div&gt;
&lt;div class=&quot;entry-section&quot;&gt;
&lt;h4&gt;
Eclipse Startup Configuration&lt;/h4&gt;
Another kind of tips involve fine tuning the Eclipse start up configuration. To a certain extents, this is a matter of arts, as the correct configuration may vary from case to case and requires in-depth knowledge on how JVM work.
&lt;br /&gt;
&lt;h5&gt;
Explicitly define the version of JDK to use, and point directly to the DLL instead of a Java Home directory.&lt;/h5&gt;
In the configuration, use the &quot;-vm&quot; parameter to points to the jvm.dll directly:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;-vm
C:/Program Files/Java/jdk1.6.0_24/jre/bin/server/jvm.dll
&lt;/pre&gt;
This brings the following advantages:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Splash screen coming up sooner.&lt;/li&gt;
&lt;li&gt;Eclipse.exe in the process list instead of java.exe.&lt;/li&gt;
&lt;li&gt;Firewalls: Eclipse wants access to the Internet instead of java.&lt;/li&gt;
&lt;li&gt;Window management branding issues, especially on Windows and Mac.&lt;/li&gt;
&lt;/ul&gt;
This tips can be found on various StackOverflow post, and one of the &lt;a href=&quot;https://bugs.eclipse.org/bugs/show_bug.cgi?id=188968&quot;&gt;Bugzilla entry on Eclipse&lt;/a&gt;
&lt;br /&gt;
&lt;h5&gt;
Tuning the Heap size and GC parameters&lt;/h5&gt;
Depending on the size of the workspace, Eclipse should be given sufficient heap space. When large heap space is required, we also need to ensure a good GC and configuration is used.
&lt;br /&gt;
The following is a proposed &lt;a href=&quot;http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse&quot;&gt;solution&lt;/a&gt; by &lt;strong&gt;VonC&lt;/strong&gt; on StackOverflow:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;entry-section&quot;&gt;
&lt;h4&gt;
Eclipse User Preference &lt;/h4&gt;
In Eclipse user preference, some functions may not be useful in every situation. As a result, the following options may worth spending time to fine tuned.
&lt;br /&gt;
&lt;h5&gt;
Disable unused options on Eclipse&lt;/h5&gt;
Following options may have little use, consider turning it off
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Label Decoration&lt;/li&gt;
&lt;li&gt;Validators (Some validator may have nothing to do with the project you are working on)&lt;/li&gt;
&lt;li&gt;UI fancy stuff&lt;/li&gt;
&lt;li&gt;Disable unused content assists (For example, disable SWT proposal if you are not working on SWT based project)&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
Avoid too many local history&lt;/h5&gt;
If version control system is deployed and used properly, a short local history is sufficient is most case.
&lt;br /&gt;
&lt;h5&gt;
Close unused View and use correct perspective&lt;/h5&gt;
Unused perspective take some memory, unused view will take sometime to refresh without any added-value.
&lt;br /&gt;
&lt;h5&gt;
Disable unused plugins&lt;/h5&gt;
This is controversial, as some people reported that, Eclipse load plugin lazily, so disable it doesn&#39;t bring too much benefits.
&lt;/div&gt;
&lt;div class=&quot;entry-section&quot;&gt;
&lt;h4&gt;
Misc Tips&lt;/h4&gt;
Apart from the three categories of tips, one more tips looks useful as well:
&lt;br /&gt;
&lt;h5&gt;
Keep Eclipse clean without out-dated or broken meta-data&lt;/h5&gt;
Start eclipse with the parameter:
&lt;br /&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;eclipse -clean
&lt;/pre&gt;
The details for this parameter is can be found &lt;a href=&quot;http://wiki.eclipse.org/Eclipse.ini&quot;&gt;Eclipse Wiki&lt;/a&gt;, and further explained at &lt;a href=&quot;http://www.eclipsezone.com/eclipse/forums/t61566.html&quot;&gt;EclipseZone&lt;/a&gt;.
&lt;/div&gt;
&lt;div class=&quot;entry-section&quot;&gt;
&lt;h4&gt;
Reference&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://wiki.eclipse.org/Eclipse.ini&quot;&gt;Eclipse.ini&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html&quot;&gt;Eclipse Runtime Options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse&quot;&gt;StackOverflow - What are the best JVM settings for Eclipse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/316265/tricks-to-speed-up-eclipse&quot;&gt;StackOverflow - Tricks to speed up Eclipse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.pakkatechies.com/2011/07/making-eclipse-ide-faster.html&quot;&gt;Making Eclipse IDE Faster&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.eclipsezone.com/eclipse/forums/t61566.html&quot;&gt;Keeping Eclipse Running Clean&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;h4&gt;
Disclaimer&lt;/h4&gt;
Tips in this post are merely an recap from other peoples. I personally haven&#39;t tested all of the tips above (when I try it out latter, I&#39;ll keep posting update if the tips is not correct.).
As a result, take it at your own risk.
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/1358408462783451303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/1358408462783451303' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1358408462783451303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1358408462783451303'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2011/03/tips-for-improving-eclipse-performance.html' title='Tips for improving Eclipse Performance'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-265667976478211268</id><published>2010-12-18T17:25:00.000+08:00</published><updated>2010-12-18T17:25:02.458+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CLI"/><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>The best CLI tools all the time</title><content type='html'>&lt;div&gt;
Every December, each geeky website will prepare &quot;Best Windows/Mac Software of 20xx&quot;.
Why there is not a &quot;Best CLI Tools All the Time&quot; article?
&lt;/div&gt;

&lt;div&gt;
Why not &quot;Best CLI Tools of 20xx&quot;? Sorry, there would not be too useful to have such a list every year. As good CLI goods all survive throughout years. Ever since I know the use of ssh, it keeps to top on my list. What software allow you to forward whatever port you like and execute commands on different hosts?
&lt;/div&gt;

&lt;div&gt;
While &quot;Best CLI Tools All the TIme&quot; comes to be head, I googled an interesting site:
&lt;a href=&quot;http://www.commandlinefu.com/&quot;&gt;http://www.commandlinefu.com/&lt;/a&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/265667976478211268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/265667976478211268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/265667976478211268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/265667976478211268'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/12/best-cli-tools-all-time.html' title='The best CLI tools all the time'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-7438593198128422392</id><published>2010-12-11T22:52:00.001+08:00</published><updated>2011-02-12T02:59:44.563+08:00</updated><title type='text'>Does Dynamic Programming Languages more Productive for Web Development?</title><content type='html'>&lt;div&gt;
While Dynamic Programming Languages like Python and Groovy are hot topics in recent years.
Surprisingly, there is not a clear definition for &quot;Dynamic Programming
Language&quot;. So, what &quot;Dynamic Programming Language&quot; refers to and does it really
helps to spped your next web application?
&lt;/div&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;div&gt;
  &lt;h4&gt;Dynamic Programming Language&lt;/h4&gt;

  &lt;p&gt;
  In general, dynamic programming language refers to the languages which exhibits the following nature:
  &lt;ul&gt;
    &lt;li&gt;Dynamical Typing support&lt;/li&gt;
    &lt;li&gt;Meta-programming support&lt;/li&gt;
    &lt;li&gt;Support for functional-programming&lt;/li&gt;
    &lt;li&gt;Support for aspect-orient features&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/p&gt;

  &lt;p&gt;
  And most likely, all the three dynamic languages mentioned above have the following natures:
  &lt;ul&gt;
    &lt;li&gt;Intrepreted&lt;/li&gt;
    &lt;li&gt;Web Application Framework support rapid application development, usually emphasis convention over configuration&lt;/li&gt;
  &lt;/ul&gt;
  &lt;/p&gt;

  &lt;p&gt;
  How does these features is considered a good thing?
  Below, I&#39;ll use Groovy, Python as the examples to demostrate the capability of these language on traditional / mainstream language like Java.
  &lt;/p&gt;


&lt;/div&gt;

&lt;div&gt;
  &lt;h4&gt;Dynamic Typing Support&lt;/h4&gt;

  &lt;p&gt;
  Through automatic type coercion, dynamic languages like Groovy free you statically defining type.
  &lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;
  &lt;h4&gt;Metaprogramming Support&lt;/h4&gt;

  &lt;p&gt;
  Metaprogramming is the foundation for all kinds of fancy features in this new language.
  For example, we can easily use Metaprogramming to implement dynamic proxy or implement mixin,
  all these are traditionally hard to implements.
  &lt;/p&gt;

&lt;/div&gt;


&lt;div&gt;
  &lt;h4&gt;Functional Programming&lt;/h4&gt;

  &lt;p&gt;
  Groovy provide closure. While in Python, lamba, map and reduce is built-in functionI, in additionsl
  and method is just another object in Python. All this allow programmer easily define template
  and as well as implementing some logic in functional style.
  &lt;/p&gt;
&lt;/div&gt;

&lt;div&gt;
  &lt;h4&gt;Aspect Oriented Programming&lt;/h4&gt;

  &lt;p&gt;
  Usually through the support of the meta-programming facility, implementing AOP in dynamic language
  is relatively much easily.
  For example, in Groovy, Meta Object Protocol provide tonless means to injecting / intercepting
  method join, which is one of most commonly use case of AOP.
  In Python, new style class and decorator provides similar kind of foundation for injecting extra functions.
  &lt;/p&gt;
&lt;/div&gt;


&lt;div&gt;
  &lt;h4&gt;Intrepret Language&lt;/h4&gt;

  &lt;p&gt;
  Intrepret nature, in other words, new code can be compiled at runtime can greatly save the development time
  and improving the turn around for each cycle.
  This seems a by-product of the dynamic language. Contrary to tradional language which rely on compiling linking,
  dynamic language usuing resolve the method at runtime, it also allow each file can individually updated, without
  re-compiling the whole package / module.
  &lt;/p&gt;
&lt;/div&gt;


&lt;div&gt;
  &lt;h4&gt;Frameowkr which favors Convention over Configuration&lt;/h4&gt;

  &lt;p&gt;
  Interesting, all these new language also accompanied with new web application framework which emphais convention over configuration.
  For example, there is Grails (on Groovy) and Django (on Python).
  These framework allow developers create new function without paying too much tax on the configuration.
  &lt;/p&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/7438593198128422392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/7438593198128422392' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/7438593198128422392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/7438593198128422392'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/12/does-dynamic-programming-languages-more.html' title='Does Dynamic Programming Languages more Productive for Web Development?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-2343946590773572326</id><published>2010-12-11T22:16:00.001+08:00</published><updated>2011-02-12T02:58:46.776+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>StAX - Streaming API for XML</title><content type='html'>&lt;div&gt;
StAX, is a Java processing XML API which allow software to processing XML stream 
in a push streaming style. In certain scenario, StAX will be the most efficient 
approach for prcoessing XML stream. This article aims to provide an overview on 
this API as well as comparison with two other commonly used APIs: DOM and SAX.
&lt;/div&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;div&gt;
  &lt;h4&gt;Background&lt;/h4&gt;

  &lt;p&gt;
  &lt;a href=&quot;http://en.wikipedia.org/wiki/StAX&quot;&gt;StAX&lt;/a&gt;, is defined by 
  &lt;a href=&quot;http://jcp.org/en/jsr/detail?id=173&quot;&gt;JSR 173&lt;/a&gt;. The API is initially 
  provided by some industry vendor including Oracle, and BEA and finally becomes a JSR.
  Starting from JDK 6, it is already 
  &lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/features-141434.html&quot;&gt;included 
  in JDK&lt;/a&gt; as a part of the standard Java XML processing API (JAXP).
  &lt;/p&gt;

  &lt;p&gt;
  With the advent of all kind of XML API, high level (and developer friendly) tools like 
  &lt;a href=&quot;http://jaxb.java.net/&quot;&gt;JAXB&lt;/a&gt; and 
  &lt;a href=&quot;http://xstream.codehaus.org/&quot;&gt;XStream&lt;/a&gt; can be very handy for 
  XML writing / reading. In certain situation, however, it would be desirable 
  to implement the processing logic with lower level XML processing API.
  For example, consider implementing a XML message router, there is no need 
  to process the whole message in order to perform the routing.
  Unmarshalling a XML message with JAXB or XStream, or even DOM 
  will not be an efficient approach. In contrary, the best handling may be only process
  the header, decide the routing and dispatch the message without 
  processing the whole XML message.
  &lt;/p&gt;

&lt;/div&gt;



&lt;div&gt;
  &lt;h4&gt;Push Streaming XML Processing&lt;/h4&gt;

  So StAX is a &quot;Push&quot; and &quot;Streaming&quot; API for XML processing. What does it actually means.
  Example below can help to illustrate these two idea.
  Let&#39;s say there is simple XML message looks like this:

  &lt;pre class=&quot;brush: xml&quot;&gt;
  &amp;lt;words a=&amp;quot;123&amp;quot;&amp;gt;
    &amp;lt;word/&amp;gt;
    &amp;lt;word&amp;gt;Apple&amp;amp;amp;Orange&amp;lt;/word&amp;gt;
    &amp;lt;!-- comment --&amp;gt;
  &amp;lt;/words&amp;gt;
  &lt;/pre&gt;

  And below is a simple code snipplet demostrate how StAX API can be used:
  &lt;pre class=&quot;brush: java&quot;&gt;
  XMLEventReader reader = XMLInputFactory.newFactory().createXMLEventReader(inputStream);
  while (reader.hasNext()) {
   XMLEvent e = reader.nextEvent();
   String eventType = &amp;quot;N/A&amp;quot;;
   switch (e.getEventType()) {
    case XMLEvent.START_DOCUMENT:
     eventType = &amp;quot;START_DOCUMENT&amp;quot;;
     break;
    case XMLEvent.END_DOCUMENT:
     eventType = &amp;quot;END_DOCUMENT&amp;quot;;
     break;
    case XMLEvent.START_ELEMENT:
     eventType = &amp;quot;START_ELEMENT&amp;quot;;
     break;
    case XMLEvent.END_ELEMENT:
     eventType = &amp;quot;END_ELEMENT&amp;quot;;
     break;
    case XMLEvent.CHARACTERS:
     eventType = &amp;quot;CHARACTERS&amp;quot;;
     break;
    case XMLEvent.COMMENT:
     eventType = &amp;quot;COMMENT&amp;quot;;
     break;
   }
   System.out.println(eventType + &amp;quot;:&amp;quot; + e.toString());
  }
  &lt;/pre&gt;

  Executing the sniplet above will generate be following output below:
  &lt;pre class=&quot;brush: plain&quot;&gt;
  START_DOCUMENT:&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&#39;null&#39; standalone=&#39;no&#39;?&amp;gt;
  START_ELEMENT:&amp;lt;words a=&#39;123&#39;&amp;gt;
  CHARACTERS:
    
  START_ELEMENT:&amp;lt;word&amp;gt;
  END_ELEMENT:&amp;lt;/word&amp;gt;
  CHARACTERS:
    
  START_ELEMENT:&amp;lt;word&amp;gt;
  CHARACTERS:Apple
  CHARACTERS:&amp;amp;
  CHARACTERS:Orange
  END_ELEMENT:&amp;lt;/word&amp;gt;
  CHARACTERS:
    
  COMMENT:&amp;lt;!-- comment --&amp;gt;
  CHARACTERS:

  END_ELEMENT:&amp;lt;/words&amp;gt;
  END_DOCUMENT:ENDDOCUMENT

  &lt;/pre&gt;

  &lt;p&gt;
  In this example, XmlEventReader, one of primary interface in StAX is used. XmlEventReader provides the
  &lt;strong&gt;nextNext()&lt;/strong&gt; and &lt;strong&gt;next()&lt;/strong&gt; method.
  XMLEventReader can be viewed as a reader, which will parse the XML stream.
  XMLEventReader will parse and returnn an XMLEventReader upon each &lt;strong&gt;next()&lt;/strong&gt; call.
  The API is similar to the Java collections API. However, in StAX, what is being iterate is not a collection of items,
  but a series of XML processing Event.
  &lt;/p&gt;

  &lt;p&gt;
  XMLEvent in StAX refers to the various event when a parser is paring a XML stream.
  When the XML parser start parsing an XML document, it will return an Event to represent the start of document (START_DOCUMENT).
  When it proceed parsing, it will encounter the start of an XML element (START_ELEMENT), that is the &lt;strong&gt;&amp;lt;words&amp;gt;&lt;/strong&gt; node.
  Similarlly, when the parser encounters some TEXT data (including whitespace and new line between two XML tag), it will report it as a Character event.
  When it recognize an end of tag (like &lt;strong&gt;&amp;lt;/words&amp;gt;&lt;/strong&gt; it will report it as an end of element event (END_ELEMENT).
  And finally, when it found that the parsing is finished, it will report an End of Document event (END_DOCUMENT).
  &lt;/p&gt;

  &lt;p&gt;
  In other words, in StAX, application will handle the stream of XML event. In additions, with StAX, application will proactively control the parsing.
  XMLEventReader will not do the parsing unless the &quot;next()&quot; is called. Everything &quot;next()&quot; is called, the XML parsing continue and stop when XML event
  is created and the event will then returned to the application.
  Application using StAX can decide whether it should read up the whole document, or pause after traversing the beginging portion of the XML stream.
  &lt;/p&gt;

&lt;/div&gt;


&lt;div&gt;
  &lt;h4&gt;XMLStreamReader and XMLEventReader&lt;/h4&gt;

  In StAX, two interface is provided: XMLStreamReader and XMLEventReader. The conceptual use of this two are basically the same.
  Software will use the &quot;hasNext()&quot; and &quot;next()&quot; to control the parsing. The main key difference is, with XMLEventReader
  each next() will return an event which encapsulate the XML parsing event.
  With XMLStreamReader, next() call will return the event type.
  To access the details (like the XML element name and attribute contents), we need to use various accessor methods
  on the XMLStreamReader to retrieve the information.

  The sample code below will try to parse an XML message and return a Message object to represent the message.
  The code below will demostrate how XMLEventReader and XMLStreamReader can be used to implements MessageReader interface.
  
  Consider the XML message below:
  &lt;pre class=&quot;brush: xml&quot;&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
  &amp;lt;mf:message xmlns:mf=&amp;quot;http://www.nixstyle.net/lab/xml/message-router&amp;quot;&amp;gt;
    &amp;lt;mf:header&amp;gt;
      &amp;lt;mf:source&amp;gt;z33220011z&amp;amp;amp;gmail.com&amp;lt;/mf:source&amp;gt;
      &amp;lt;mf:destination&amp;gt;a77662233a&amp;amp;amp;gmail.com&amp;lt;/mf:destination&amp;gt;
    &amp;lt;/mf:header&amp;gt;
    &amp;lt;mf:content&amp;gt;
      &amp;lt;xyz:message xmlns:xyz=&amp;quot;http://www.nixstyle.net/lab/xml/message-sample&amp;quot;&amp;gt;Yo!&amp;lt;/xyz:message&amp;gt;
    &amp;lt;/mf:content&amp;gt;
  &amp;lt;/mf:message&amp;gt;
  &lt;/pre&gt;

  Below is a MessageReader interface
  &lt;pre class=&quot;brush: java&quot;&gt;
  public interface MessageReader {
  &amp;nbsp;&amp;nbsp;Message next() throws XMLStreamException;
  }
  &lt;/pre&gt;
  
  Below is an implementation of MessageReader using XMLEventReader
  &lt;pre class=&quot;brush: java&quot;&gt;
  &amp;nbsp;&amp;nbsp;public Message next() throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XMLEvent event = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expectStartOfElement(event, &amp;quot;message&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return parseMessage();
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private Message parseMessage() throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message message = new Message();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XMLEvent event = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parseMessageHeader(event, message);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;event = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parseMessageContent(event, message);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return message;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void parseMessageContent(XMLEvent event, Message message) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expectStartOfElement(event, &amp;quot;content&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (!isEndOfElement(event, &amp;quot;content&amp;quot;)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;event = reader.nextEvent();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void parseMessageHeader(XMLEvent event, Message message) throws XMLStreamException {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String source = null;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String destination = null;

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expectStartOfElement(event, &amp;quot;header&amp;quot;);

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (source == null || destination == null) {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XMLEvent nextTag = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (nextTag.isStartElement()) {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;source&amp;quot;.equals(nextTag.asStartElement().getName().getLocalPart())) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;source = reader.getElementText();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;destination&amp;quot;.equals(nextTag.asStartElement().getName().getLocalPart())) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination = reader.getElementText();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message.setSource(source);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message.setDestination(destination);

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;XMLEvent next = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveToNextEndElement(next, &amp;quot;header&amp;quot;);

  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void moveToNextEndElement(XMLEvent event, String elementName) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (!isEndOfElement(event, elementName)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.hasNext()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;event = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;private void expectStartOfElement(XMLEvent event, String elementName) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!isStartOfElement(event, elementName)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;private boolean isStartOfElement(XMLEvent event, String elementName) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (event.isStartElement()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return event.asStartElement().getName().getLocalPart().equals(elementName);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private boolean isEndOfElement(XMLEvent event, String elementName) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (event.isEndElement()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return event.asEndElement().getName().getLocalPart().equals(elementName);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;
  &amp;nbsp;&amp;nbsp;}
  &lt;/pre&gt;

  Below is an implementation of MessageReader using XMLStreamReader
  &lt;pre class=&quot;brush: java&quot;&gt;
  &amp;nbsp;&amp;nbsp;public Message next() throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message message = null;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (reader.hasNext()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int eventCode = reader.next();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (eventCode == XMLStreamConstants.START_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String elementName = reader.getLocalName();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;message&amp;quot;.equals(elementName)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message = parseMessage();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return message;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private Message parseMessage() throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message message = new Message();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int nextTag = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (nextTag == XMLStreamConstants.START_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;header&amp;quot;.equals(reader.getLocalName()) == false) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parseMessageHeader(message);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextTag = reader.nextTag();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (nextTag == XMLStreamConstants.START_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;content&amp;quot;.equals(reader.getLocalName()) == false) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parseMessageContent(message);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return message;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void parseMessageContent(Message message) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.getLocalName().equals(&amp;quot;content&amp;quot;) == false) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (!isEndOfElement(&amp;quot;content&amp;quot;)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reader.next();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void parseMessageHeader(Message message) throws XMLStreamException {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String source = null;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String destination = null;

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;expectStartOfElement(&amp;quot;header&amp;quot;);

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (source == null || destination == null) {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int nextTag = reader.nextTag();

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (nextTag == XMLStreamConstants.START_ELEMENT) {

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;source&amp;quot;.equals(reader.getLocalName())) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;source = extractText();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveToNextEndElement(&amp;quot;source&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (&amp;quot;destination&amp;quot;.equals(reader.getLocalName())) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination = extractText();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveToNextEndElement(&amp;quot;destination&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.nextTag() != XMLStreamConstants.END_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message.setSource(source);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;message.setDestination(destination);

  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveToNextEndElement(&amp;quot;header&amp;quot;);

  &amp;nbsp;&amp;nbsp;}


  &amp;nbsp;&amp;nbsp;private String extractText() throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (!isStartOfText()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reader.next();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return reader.getText();
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void moveToNextEndElement(String elementName) throws XMLStreamException {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while (!isEndOfElement(elementName)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.hasNext()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reader.next();
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private void expectStartOfElement(String elementName) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!isStartOfElement(elementName)) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;throw new RuntimeException(&amp;quot;Unexpected stream&amp;quot;);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private boolean isStartOfElement(String elementName) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.getEventType() == XMLStreamConstants.START_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return reader.getLocalName().equals(elementName);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private boolean isEndOfElement(String elementName) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (reader.getEventType() == XMLStreamConstants.END_ELEMENT) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return reader.getLocalName().equals(elementName);
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;
  &amp;nbsp;&amp;nbsp;}

  &amp;nbsp;&amp;nbsp;private boolean isStartOfText() {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;switch (reader.getEventType()) {
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case XMLStreamConstants.CDATA:
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case XMLStreamConstants.CHARACTERS:
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return true;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false;
  &amp;nbsp;&amp;nbsp;}
  &lt;/pre&gt;

  &lt;p&gt;
  In the sniplets shown above, XMLEventReader and XMLStreamReader is both used.
  The key difference is, XMLEventReader return an XMLEvent which provide a little bit
  Object oriented interface for accessing the XML event details. With XMLStreamReader, 
  the accessor method like &lt;strong&gt;getText()&lt;/strong&gt; and &lt;strong&gt;getLocalName()&lt;/strong&gt;
  is only available on the XMLStreamReader interface.
  As a result, XMLEventReader is usually the preferred approach.
  &lt;/p&gt;

&lt;/div&gt;

&lt;div&gt;
  &lt;h4&gt;Compare with SAX and DOM&lt;/h4&gt;

&lt;p&gt;
  When comparing StAX with SAX, the most notable difference will be the control of the parsing.
  With SAX, the application can only provide a callback to handle the event.
  Once the parsing is started, parser will continue parsing the whole stream.
  The application will have no control on the parsing, for example, terminte the parsing after
  processing a message header.
&lt;/p&gt;

&lt;p&gt;
  When compare with DOM, the difference is more significant. When processing XML using DOM,
  the object model representing the whole XML structure will be constructed. 
  When the XML message size is huge, it may be inefficient for building the whole DOM tree.
  Especially, most of the time, application will convert an XML into some kind of POJO.
  In contrary, using streaming API like StAX can eliminate the needs to building the
  DOM tree in memory.
&lt;/p&gt;

&lt;p&gt;
  On the other hand, if all the application need is performing some analysis on the 
  XML stream, only building a DOM and manipulate with DOM tree will make more sense.
&lt;/p&gt;

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/2343946590773572326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/2343946590773572326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/2343946590773572326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/2343946590773572326'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/12/stax-streaming-api-for-xml.html' title='StAX - Streaming API for XML'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-6713924729954209058</id><published>2010-12-07T23:43:00.002+08:00</published><updated>2011-02-12T03:00:41.486+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="yaml"/><title type='text'>YAML - YAML Ain&#39;t Markup Language</title><content type='html'>&lt;div&gt;
&lt;a href=&quot;http://www.yaml.org/&quot;&gt;YAML&lt;/a&gt;, which stands for &quot;YAML Ain&#39;t Markup Languge&quot;, is a
&lt;a href=&quot;http://en.wikipedia.org/wiki/Data_serialization&quot;&gt;data serialization format&lt;/a&gt;,
which can be used to represent data or message.
&lt;/div&gt;

&lt;div&gt;
This article provide a background on YAML as well as a comparison between YAML and XML using the Maven POM as a example.
&lt;/div&gt;

&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

&lt;div&gt;
&lt;h4&gt;What is YAML?&lt;/h4&gt;
&lt;div&gt;
While there are &lt;a href=&quot;http://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats&quot;&gt;
many of data serialization format&lt;/a&gt;, the strengths of YAML is the focus on human
readability and still provide rich constructs for representing different data structure.
&lt;/div&gt;

&lt;div&gt;
In YAML, each data stream can consists of multiple YAML data, each data is separated by the &#39;---&#39;
marker. And &#39;...&#39; can be used to signal an end of stream. Hash prompt &#39;#&#39; is used to start an
comments which ended by the end-of-line. Data in YAML can be represented in three different ways:
Scalar, Associative Array and Sequence.
&lt;/div&gt;

&lt;div&gt;
For associative array (aka Map), it can be represented in this way:
&lt;pre class=&quot;brush: plain&quot;&gt;
  name: Xyz Conference
  maxParticipants: 20
  startTime: 2010-10-14 08:30:00.00
  breakfastProvided: yes
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
Alternatively, associative array can also model with JSON style (as a short form):
&lt;pre class=&quot;brush: plain&quot;&gt;
  [ name: Xyz Conference, maxParticipants: 20, startTime: 2010-10-14 08:30:00.00,  breakfastProvided: yes]
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
For sequence, it can be represented in this way
&lt;pre class=&quot;brush: plain&quot;&gt;
  - Java
  - Python
  - Ruby
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
Alternatively, sequence can also model in JSON style (as a short form):
&lt;pre class=&quot;brush: plain&quot;&gt;
  [ Java, Python, Ruby ]
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
The short form syntax in YAML also imply that, JSON document is compliant with YAML.
&lt;/div&gt;

&lt;/div&gt;


&lt;div&gt;To get a taste of YAML, below is a personal organizer modeled using YAML:&lt;/div&gt;
&lt;div&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
---
# Document which representing my personal organizer

# Tasks
tasks:
 - 
   summary:     Prepare project proposal
   tags:        [School, Urgent]
   update time: 2010-10-14 18:59:23.17
   completed:   true
 - 
   summary:     Arrange a gathering
   tags:        [Friend, Someday]
   update time: 2010-10-14 18:59:23.17
   completed:   false

# Memos
memos:
 - 
   content:     &gt;
                Precedence of UrlMappings for status code is defined by lexical order.
                While regex based URL mapping is defined by the precedence rules.
   update time: 2010-10-14 18:59:23.17
   archived:    false
 - 
   content:     &gt;
                Pattern-Oriented Software Architecture Volumn 2
                http://www.cs.wustl.edu/~schmidt/POSA/POSA2/
   update time: 2010-10-10 18:59:23.17
   archived:    true

...
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
From the example above, it is extremely easy to comprehend the content. It consists of two tasks and two memos. The structure of each task and memo is also readily understandable. In this example, several strengths of YAML is demostrated.
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Richer information model used in YAML.&lt;/h5&gt;

&lt;div&gt;
Compare with XML which each documents consists of element node.&amp;nbsp;YAML document consists of four types of node, which are sequence, scalar, mapping and alias.&amp;nbsp;While you can certainly model sequence or key to value pair in XML, it is more clumsy when compare to the one modeled in YAML.
&lt;/div&gt;

&lt;div&gt;
In YAML, indentation is used to to present the hierarchy structure of data. Child elements will have more indentation then it&#39;s parent node.&amp;nbsp;However, only whitespace character (ascii x20) is used for indentation, tab character (ascii x09) is not allowed.
&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Readily defined type&lt;/h5&gt;

&lt;div&gt;
In YAML, some commonly used data types are already defined, which include String, Time, Boolean, Integer Number and Floating Point Number.
&lt;/div&gt;

&lt;div&gt;
While in XML, you can use DTD or Schema to defined the data types for each of element, for this typing is offered from YAML, any YAML document will be benefits with this offering.
&lt;/div&gt;

&lt;div&gt;
A full reference of the data supported in YAML can be found here.
&lt;/div&gt;
&lt;/div&gt;


&lt;div&gt;
&lt;h5&gt;Flexibility on encoding String&lt;/h5&gt;

&lt;div&gt;In YAML, string can be encode without any quote. In additions, you will find that, the use of tag in YAML is minimized. It make it perfert to encoding messages block in a YAML documents. For example, we can easily put a HTML or XML block, or some code fragments in the YAML document without resorting escape the characters in the text.&lt;/div&gt;

&lt;div&gt;In XML, if you want to encode a HTML fragment, or a Math&amp;nbsp;formula, or a code fragment, you will need escape some reserved characters with escape sequence.&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Space efficiency&lt;/h5&gt;

&lt;div&gt;As YAML do not rely on balanced mark up (like XML) to represent the data structure, most of the document payload is representing the data itself, instead. Compare with XML, each tag must have a balanced closing tag, the size used for representation a piece of data in YAML is usually lesser than XML. Below, a direct XML and YAML comparison will&amp;nbsp;demonstrate&amp;nbsp;this points&lt;/div&gt;

&lt;div&gt;Well, YAML is full of&amp;nbsp;strengths, but it don&#39;t means it will be a&amp;nbsp;perfect&amp;nbsp;choice for representing all kind of data or messages. As always, no one tools can serve all purpose and YAML is no exception. YAML does have some weakness, below are some key issues:&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Lack of schema definition&lt;/h5&gt;
&lt;div&gt;YAML doesn&#39;t provide any facility to define the schema and the semantics of the Document.&lt;/div&gt;

&lt;div&gt;If different parties are going to interchange a YAML document, the exact specification of the document must be specified with somewhere else.&lt;/div&gt;

&lt;div&gt;Compare with XML, in which the schema can be defined clearly with XML Schema or Relax NG, YAML just doesn&#39;t provide this kind of feature.&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Lack of supporting technology&lt;/h5&gt;
&lt;div&gt;YAML doesn&#39;t provide any &quot;query language&quot; (like XQuery, XPath in XML) to support querying YAML.&lt;/div&gt;
&lt;/div&gt;


&lt;div&gt;
&lt;h5&gt;Lack of namespace support&lt;/h5&gt;
&lt;div&gt;YAML does not provide any namespace mechanism. Without a namespace concept, it also imply there is not possible to unambiously weaving different YAML documents.&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h5&gt;Comparing with XML directly&lt;/h5&gt;

&lt;div&gt;While XML are the most commonly used data format, there are some problem. One frequently heard complaint on XML is the space efficiency.&lt;/div&gt;

&lt;div&gt;The following is a &lt;a href=&quot;http://maven.apache.org/guides/introduction/introduction-to-the-pom.html&quot;&gt;sample Maven POM file&lt;/a&gt; which describe a project / module build configuration&lt;/div&gt;


&lt;div&gt;
&lt;pre name=&quot;code&quot; class=&quot;brush: xml&quot;&gt;
&amp;lt;project&amp;gt;
  &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;
  &amp;lt;name&amp;gt;Maven Default Project&amp;lt;/name&amp;gt;

  &amp;lt;repositories&amp;gt;
    &amp;lt;repository&amp;gt;
      &amp;lt;id&amp;gt;central&amp;lt;/id&amp;gt;
      &amp;lt;name&amp;gt;Maven Repository Switchboard&amp;lt;/name&amp;gt;
      &amp;lt;layout&amp;gt;default&amp;lt;/layout&amp;gt;
      &amp;lt;url&amp;gt;http://repo1.maven.org/maven2&amp;lt;/url&amp;gt;
      &amp;lt;snapshots&amp;gt;
        &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
      &amp;lt;/snapshots&amp;gt;
    &amp;lt;/repository&amp;gt;
  &amp;lt;/repositories&amp;gt;

  &amp;lt;pluginRepositories&amp;gt;
    &amp;lt;pluginRepository&amp;gt;
      &amp;lt;id&amp;gt;central&amp;lt;/id&amp;gt;
      &amp;lt;name&amp;gt;Maven Plugin Repository&amp;lt;/name&amp;gt;
      &amp;lt;url&amp;gt;http://repo1.maven.org/maven2&amp;lt;/url&amp;gt;
      &amp;lt;layout&amp;gt;default&amp;lt;/layout&amp;gt;
      &amp;lt;snapshots&amp;gt;
        &amp;lt;enabled&amp;gt;false&amp;lt;/enabled&amp;gt;
      &amp;lt;/snapshots&amp;gt;
      &amp;lt;releases&amp;gt;
        &amp;lt;updatePolicy&amp;gt;never&amp;lt;/updatePolicy&amp;gt;
      &amp;lt;/releases&amp;gt;
    &amp;lt;/pluginRepository&amp;gt;
  &amp;lt;/pluginRepositories&amp;gt;

  &amp;lt;build&amp;gt;
    &amp;lt;directory&amp;gt;target&amp;lt;/directory&amp;gt;
    &amp;lt;outputDirectory&amp;gt;target/classes&amp;lt;/outputDirectory&amp;gt;
    &amp;lt;finalName&amp;gt;${artifactId}-${version}&amp;lt;/finalName&amp;gt;
    &amp;lt;testOutputDirectory&amp;gt;target/test-classes&amp;lt;/testOutputDirectory&amp;gt;
    &amp;lt;sourceDirectory&amp;gt;src/main/java&amp;lt;/sourceDirectory&amp;gt;
    &amp;lt;scriptSourceDirectory&amp;gt;src/main/scripts&amp;lt;/scriptSourceDirectory&amp;gt;
    &amp;lt;testSourceDirectory&amp;gt;src/test/java&amp;lt;/testSourceDirectory&amp;gt;
    &amp;lt;resources&amp;gt;
      &amp;lt;resource&amp;gt;
        &amp;lt;directory&amp;gt;src/main/resources&amp;lt;/directory&amp;gt;
      &amp;lt;/resource&amp;gt;
    &amp;lt;/resources&amp;gt;
    &amp;lt;testResources&amp;gt;
      &amp;lt;testResource&amp;gt;
        &amp;lt;directory&amp;gt;src/test/resources&amp;lt;/directory&amp;gt;
      &amp;lt;/testResource&amp;gt;
    &amp;lt;/testResources&amp;gt;
  &amp;lt;/build&amp;gt;

  &amp;lt;reporting&amp;gt;
    &amp;lt;outputDirectory&amp;gt;target/site&amp;lt;/outputDirectory&amp;gt;
  &amp;lt;/reporting&amp;gt;

  &amp;lt;profiles&amp;gt;
    &amp;lt;profile&amp;gt;
      &amp;lt;id&amp;gt;release-profile&amp;lt;/id&amp;gt;

      &amp;lt;activation&amp;gt;
        &amp;lt;property&amp;gt;
          &amp;lt;name&amp;gt;performRelease&amp;lt;/name&amp;gt;
        &amp;lt;/property&amp;gt;
      &amp;lt;/activation&amp;gt;

      &amp;lt;build&amp;gt;
        &amp;lt;plugins&amp;gt;
          &amp;lt;plugin&amp;gt;
            &amp;lt;inherited&amp;gt;true&amp;lt;/inherited&amp;gt;
            &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;maven-source-plugin&amp;lt;/artifactId&amp;gt;

            &amp;lt;executions&amp;gt;
              &amp;lt;execution&amp;gt;
                &amp;lt;id&amp;gt;attach-sources&amp;lt;/id&amp;gt;
                &amp;lt;goals&amp;gt;
                  &amp;lt;goal&amp;gt;jar&amp;lt;/goal&amp;gt;
                &amp;lt;/goals&amp;gt;
              &amp;lt;/execution&amp;gt;
            &amp;lt;/executions&amp;gt;
          &amp;lt;/plugin&amp;gt;
          &amp;lt;plugin&amp;gt;
            &amp;lt;inherited&amp;gt;true&amp;lt;/inherited&amp;gt;
            &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;maven-javadoc-plugin&amp;lt;/artifactId&amp;gt;

            &amp;lt;executions&amp;gt;
              &amp;lt;execution&amp;gt;
                &amp;lt;id&amp;gt;attach-javadocs&amp;lt;/id&amp;gt;
                &amp;lt;goals&amp;gt;
                  &amp;lt;goal&amp;gt;jar&amp;lt;/goal&amp;gt;
                &amp;lt;/goals&amp;gt;
              &amp;lt;/execution&amp;gt;
            &amp;lt;/executions&amp;gt;
          &amp;lt;/plugin&amp;gt;
          &amp;lt;plugin&amp;gt;
            &amp;lt;inherited&amp;gt;true&amp;lt;/inherited&amp;gt;
            &amp;lt;groupId&amp;gt;org.apache.maven.plugins&amp;lt;/groupId&amp;gt;
            &amp;lt;artifactId&amp;gt;maven-deploy-plugin&amp;lt;/artifactId&amp;gt;

            &amp;lt;configuration&amp;gt;
              &amp;lt;updateReleaseInfo&amp;gt;true&amp;lt;/updateReleaseInfo&amp;gt;
            &amp;lt;/configuration&amp;gt;
          &amp;lt;/plugin&amp;gt;
        &amp;lt;/plugins&amp;gt;
      &amp;lt;/build&amp;gt;
    &amp;lt;/profile&amp;gt;
  &amp;lt;/profiles&amp;gt;

&amp;lt;/project&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;If it is modeled with YAML, it will looks something like this:&lt;/div&gt;

&lt;div&gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
project:
  modelVersion: 4.0.0
  name: Maven Default Project

  repositories: 
    - id: central
      name: Maven Repository Switchboard
      layout: default
      url: http://repo1.maven.org/maven2
      snapshots: 
        enabled: false

  pluginRepositories: 
    - id: central
      name: Maven Plugin Repository
      url: http://repo1.maven.org/maven2
      layout: default
      snapshots: 
        enabled: false
      releases: 
        updatePolicy: never
      
  build: 
    directory: target
    outputDirectory: target/classes
    finalName: ${artifactId}-${version}
    testOutputDirectory: target/test-classes
    sourceDirectory: src/main/java
    scriptSourceDirectory: src/main/scripts
    testSourceDirectory: src/test/java
    resources: 
      - directory: src/main/resources
    testResources: 
      - directory: src/test/resources

  reporting: 
    outputDirectory: target/site

  profiles: 
    - id: release-profile

      activation: 
        property: 
          name: performRelease

      build: 
        plugins: 
          - inherited: true
            groupId: org.apache.maven.plugins
            artifactId: maven-source-plugin
            executions: 
              - id: attach-sources
                goals: 
                  goal: jar

          - inherited: true
            groupId: org.apache.maven.plugins
            artifactId: maven-javadoc-plugin
            executions: 
              - id: attach-javadocs
                goals: 
                  goal: jar
                
          - inherited: true
            groupId: org.apache.maven.plugins
            artifactId: maven-deploy-plugin
            configuration: 
              updateReleaseInfo: true
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;One notable difference amongst these two document is, the YAML one is more readable. When looks into details, the total size for the XML version is 2941 bytes while the size for the YAML is only 1714 bytes, which is effectively 42% reduction in size. In additions, the number of lines in the XML version is 110 lines, while the YAML version is only 68 lines, which is 38% reduction.&lt;/div&gt;

&lt;div&gt;The difference is mainly due to the fact that, YAML doesn&#39;t requires a balance end tag. In additions, YAML natively providing constructs to support sequence and maps as top level elements. For example, two model lists of repository in XML, we need two tags (repositories and repository) to module a list, and two extra lines for putting the end tags. In YAML the end tag is never needed.&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;div&gt;Considering both the pros and cons, YAML has great advantage on the human friendiness and clarity, while the lack of schema / namespace support will prevent it from being employed on large scale or complex environment.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/6713924729954209058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/6713924729954209058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6713924729954209058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6713924729954209058'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/12/yaml-yaml-aint-markup-language.html' title='YAML - YAML Ain&#39;t Markup Language'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-1755612243534636474</id><published>2010-12-05T17:43:00.002+08:00</published><updated>2010-12-05T18:21:48.988+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><title type='text'>Using SyntaxHighlighter at Blogspot</title><content type='html'>&lt;div&gt;
Blogspot doesn&#39;t support syntax highlight by default. What a shame, considering that all decent Wiki engine are providing certain level of support for this already. While Blogspot isn&#39;t a wiki, but without syntax highlighting, I just keep have a feel that, Blogspot is not a place for technical post. Anyway, &lt;a href=&quot;http://alexgorbatchev.com/SyntaxHighlighter/&quot;&gt;SyntaxHighlighter&lt;/a&gt; is a solution for this.
&lt;/div&gt;

&lt;div&gt;
The official installation instruction require you to upload the script and link the scripts from your blogspot template. Castillo has &lt;a href=&quot;http://urenjoy.blogspot.com/2008/10/publish-source-code-in-blogger.html&quot;&gt;post&lt;/a&gt; a workaround on how to use this lovely tools on Blogspot without having a hosting space. The post seems out-dated. It isn&#39;t too hard to figure out the way, below are the up-to-date procedure.
&lt;/div&gt;

&lt;div&gt;
1. Update the Blogspot template and add following in the &amp;lt;head&amp;gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
  &amp;lt;script language=&#39;javascript&#39;   
    src=&#39;http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/XRegExp.js&#39;/&amp;gt;
  &amp;lt;script language=&#39;javascript&#39; 
    src=&#39;http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shCore.js&#39;/&amp;gt;
  &amp;lt;script language=&#39;javascript&#39; 
    src=&#39;http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shAutoloader.js&#39;/&amp;gt;

  &amp;lt;link rel=&#39;stylesheet&#39; type=&#39;text/css&#39;
    href=&#39;http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/styles/shCoreDefault.css&#39; /&amp;gt;

&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
2. Apply the following snipplets near the end of &amp;lt;body&amp;gt;
&lt;pre class=&quot;brush: plain&quot;&gt;
&amp;lt;script language=&#39;javascript&#39;&amp;gt;
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.autoloader(
  &#39;xml  http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shBrushXml.js&#39;,
  &#39;css  http://bitbucket.org/alexg/syntaxhighlighter/raw/b7578b438a69/scripts/shBrushCss.js&#39;
);
SyntaxHighlighter.all();
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
3. In the post, use &amp;lt;pre&amp;gt; with the class attribute to define the corresponding syntax
&lt;pre class=&quot;brush: xml&quot;&gt;
&amp;lt;pre class=&amp;quot;brush: xml&amp;gt;
  &amp;lt;echo&amp;gt;Hi SyntaxHighlighter!&amp;lt;/echo&amp;gt;
&amp;lt;/pre&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
SyntaxHighlighter support different kind of syntax, all you need to do is just to define it in the &quot;autoloader&quot; call. The full list of supported syntax can be found &lt;a href=&quot;http://bitbucket.org/alexg/syntaxhighlighter/src/b7578b438a69/scripts/&quot;&gt;here&lt;/a&gt;. 
SyntaxHighlighter also provided a few different theme which can be configure by importing different javascript, the full list can be found in &lt;a href=&quot;http://bitbucket.org/alexg/syntaxhighlighter/src/b7578b438a69/styles/&quot;&gt;here&lt;/a&gt;.
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/1755612243534636474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/1755612243534636474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1755612243534636474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1755612243534636474'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/12/using-syntaxhighlighter-at-blogspot.html' title='Using SyntaxHighlighter at Blogspot'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-5926968830919797052</id><published>2010-09-25T01:50:00.000+08:00</published><updated>2010-09-25T01:50:41.696+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>SLAX - Beautiful Live CD and Live USB</title><content type='html'>SLAX is simple Live CD / Live USB distribution. It allows easily to web interface for creating tailored made build.&lt;br /&gt;
&lt;br /&gt;
In additions to the modules available on the official website, it is extremely easy to create modules. To illustrate how easy it is, the following is a steps by steps:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
 1. Download a vanilla SLAX ISO
 2. Boot-up the image with a spare machine or Virtual Machine
 3. After image boots up, login as root
 4. Create a directory
    $ mkdir /tmp/rootcopy
 5. Put some files under this directory
 6. Create the module file
    $ cd /tmp
    $ dir2lsm rootcopy mymodule.lzm
 7. Put this module file under /slax/modules
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/5926968830919797052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/5926968830919797052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5926968830919797052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5926968830919797052'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/09/slax-beautiful-live-cd-and-live-usb.html' title='SLAX - Beautiful Live CD and Live USB'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-7437056419974883771</id><published>2010-09-25T00:26:00.000+08:00</published><updated>2010-09-25T00:26:34.008+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><title type='text'>Fixing the Cygwin ACL Problem</title><content type='html'>Cygwin is always one of the best tools for me. It provide an emulated *nix like environment include a shell environment, POSIX path, etc. Of all the emulation provided, however, the POSIX-like permission is the only thing I am not appreciated.&lt;br /&gt;
&lt;br /&gt;
The purpose of permission and ACL is for controlling access of files under a multi-user environment. Whilst it will be useful for running network services, it is pointless for most development use cases. Files are mostly accessed by only one user, that is me!&lt;br /&gt;
&lt;br /&gt;
When Cygwin is emulating POSIX permission using Windows ACL, it can easily caused undesirable trouble when one is trying to access the files from both Cygwin environment and ordinary Windows based tools.&amp;nbsp;To get rid of this, Cygwin provided means for disabling this.&amp;nbsp;Unfortunately, the mechanism is different between 1.5.x and 1.7x. And this can even more frustrating when you are trying to upgrade from 1.5.x to 1.7.x.&lt;br /&gt;
&lt;br /&gt;
All the details below can be found on Cygwin &lt;a href=&quot;http://www.cygwin.com/cygwin-ug-net/ntsec.html&quot;&gt;manual&lt;/a&gt;. But it may take sometimes to dig it out even with the help of google. So, here we go!&lt;br /&gt;
&lt;br /&gt;
For version prior to 1.7, the method is setting the following environment variable:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;    CYGWIN=nontsec&lt;/pre&gt;
&lt;br /&gt;
Since 1.7, the method is setting &#39;noacl&#39; as part of the mount point options in fstab. You should have a line like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;    none /cygdrive cygdrive noacl,binary,posix=0,user 0 0
&lt;/pre&gt;
&lt;br /&gt;
Note that, no extra entries should present for all mount point which can be mount up automatically.&lt;br /&gt;
&lt;br /&gt;
For upgrading from 1.5 to 1.7, you should also clean up the mount point defined in the registry. From Cygwin 1.7, registry is &lt;a href=&quot;http://www.cygwin.com/faq/faq.setup.html#faq.setup.registry&quot;&gt;only used for defining the installation directory&lt;/a&gt; of Cygwin itself.&lt;br /&gt;
When in doubt, use &lt;em&gt;&lt;a href=&quot;http://www.cygwin.com/cygwin-ug-net/using-utils.html&quot;&gt;cygcheck&lt;/a&gt;&lt;/em&gt; to have a look, which can shows the mount point configuration inherited from registry.</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/7437056419974883771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/7437056419974883771' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/7437056419974883771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/7437056419974883771'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/09/fixing-cygwin-acl-problem.html' title='Fixing the Cygwin ACL Problem'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-9117884790413149372</id><published>2010-05-02T04:11:00.002+08:00</published><updated>2011-02-12T03:01:44.581+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>Huawei B970b (Smartone Vodafone Wifi Router)</title><content type='html'>Before I subscribe the Smartone Vodafone Home Broadband service, I&#39;ve serviously try to seek some official answer the following questions:&lt;br /&gt;
1. Will the router get a public IP address?&lt;br /&gt;
2. Does the bundled WIFI router allow me to configure port forwarding?&lt;br /&gt;
&lt;br /&gt;
And the official answer is NO!&lt;br /&gt;
&lt;br /&gt;
But the fact is, YES! The router is Huawei B970b, as there is not much information on the Net at this moment, I&#39;d share information gathered so far.&amp;nbsp;Before is a summary followed with command line output capture (Yes, I can get the shell &amp;nbsp;access on the router easily)!&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
Below is summary of import points&lt;br /&gt;
1. I do get a public IP!&lt;br /&gt;
2. The default router admin software (web-based) allow you to configure port forward&lt;br /&gt;
3. In addition, you can also configure DMZ server, MAC filter, DynDNS setting.&lt;br /&gt;
4. Telnet port (23) is opened by default (login with the admin account and you get a busybox)&lt;br /&gt;
5. It use dnsmasq and iptables&lt;br /&gt;
&lt;br /&gt;
The following is the information I gathered after I gain root access:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;# cat /proc/version&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Linux version 2.4.20 (bcm@localhost.localdomain) (gcc version 3.2.3 with Broadcom modifications) #2 Tue Feb 2 18:23:23 CST 2010&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;# mount&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;rootfs on / type rootfs (rw)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;/dev/root on / type squashfs (ro)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;none on /dev type devfs (rw)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;proc on /proc type proc (rw)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;ramfs on /tmp type ramfs (rw)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;/dev/mtdblock/3 on /tmp/var/custom type squashfs (ro)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;# free&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;total &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; used &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; free &amp;nbsp; &amp;nbsp; &amp;nbsp; shared &amp;nbsp; &amp;nbsp; &amp;nbsp;buffers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;Mem: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30520 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13552 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16968 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1520&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;Swap: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Total: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30520 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;13552 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;16968&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;# cat /proc/kmsg&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Kernel addr reboot flag = 0xa1fff000, reboot_number = 0xa1fff004&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Kernel physical_mem =0x2000000 reboot flag = 0x12345678, reboot_number = 0x0&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;CPU ProcId is: 0x00029029, options: 0x0000014d&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Primary instruction cache 16kb, linesize 16 bytes (4 ways)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Primary data cache 16kb, linesize 16 bytes (2 ways)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Linux version 2.4.20 (bcm@localhost.localdomain) (gcc version 3.2.3 with Broadcom modifications) #2 Tue Feb 2 18:23:23 CST 2010&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Setting the PFC to its default value&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Determined physical RAM map:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt; memory: 01fff000 @ 00000000 (usable)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;On node 0 totalpages: 8191&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;zone(0): 8191 pages.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;zone(1): 0 pages.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;zone(2): 0 pages.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Kernel command line: root=/dev/mtdblock2 noinitrd console=ttyS0,115200&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;CPU: BCM5354 rev 3 at 240 MHz&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Calibrating delay loop... 239.20 BogoMIPS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;6&amp;gt;Memory: 30452k/32764k available (1563k kernel code, 2312k reserved, 112k data, 68k init, 0k highmem)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;6&amp;gt;Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;6&amp;gt;Inode cache hash table entries: 2048 (order: 2, 16384 bytes)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Mount-cache hash table entries: 512 (order: 0, 4096 bytes)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;lt;4&amp;gt;Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;dev: &amp;nbsp; &amp;nbsp;size &amp;nbsp; erasesize &amp;nbsp;name&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd0: 00040000 00010000 &quot;cfe&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd1: 00340000 00010000 &quot;linux&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd2: 00282970 00010000 &quot;rootfs&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd3: 00060000 00010000 &quot;resource&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd4: 00010000 00010000 &quot;factory&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;mtd5: 00010000 00002000 &quot;nvram&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/9117884790413149372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/9117884790413149372' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/9117884790413149372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/9117884790413149372'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/05/huawei-b970b-smartone-vodafone-wifi.html' title='Huawei B970b (Smartone Vodafone Wifi Router)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-4469925619016643173</id><published>2010-04-02T20:44:00.003+08:00</published><updated>2010-04-02T20:48:06.608+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="gwt"/><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="webgl"/><category scheme="http://www.blogger.com/atom/ns#" term="websocket"/><title type='text'>HTML5 port of Quake II</title><content type='html'>I can imagine the this kind of things will be implemented in near future, but it is just appear sooner than I expect. I rarely play game these days, but this demo is appealing to me!&lt;br /&gt;
&lt;br /&gt;
&lt;object height=&quot;270&quot; width=&quot;448&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/XhMN0wlITLk&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1&quot;&gt;
&lt;/param&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;
&lt;/param&gt;
&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;&gt;
&lt;/param&gt;
&lt;embed src=&quot;http://www.youtube.com/v/XhMN0wlITLk&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en_US&amp;feature=player_embedded&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowfullscreen=&quot;true&quot; allowScriptAccess=&quot;always&quot; width=&quot;448&quot; height=&quot;270&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/4469925619016643173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/4469925619016643173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4469925619016643173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4469925619016643173'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/04/html5-port-of-quake-ii.html' title='HTML5 port of Quake II'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-5589263068324193813</id><published>2010-03-20T17:56:00.000+08:00</published><updated>2010-03-20T17:56:00.318+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac java"/><title type='text'>Broken Java Preference in OS X Leopard</title><content type='html'>I use&amp;nbsp;&lt;a href=&quot;http://www.ppshk.com/&quot;&gt;PPS&lt;/a&gt;&amp;nbsp;frequently but it is broken since the last upgrade. The Login Page is a Java Applet and the problem SHOULD be solved by changing setting in Java Preference.&lt;br /&gt;
&lt;br /&gt;
According to the PPS instruction, enable SSLv3 and TLSv1 in Java Preference can solve it.&amp;nbsp;If you try to enable these in Java Preference, the applet is still not work. The problem is due a bug in Java Preference, when you enable TLSv1, the corresponding property is not actually saved.&lt;br /&gt;
&lt;br /&gt;
To workaround this problem:&lt;br /&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;cd&amp;nbsp;~/Library/Caches/Java/&lt;/div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;echo deployment.security.TLSv1=true &amp;gt;&amp;gt; deployment.properties&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This step should be redo again every time setting is changed from Java Preference.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This information is found in a forum post:&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;http://discussions.apple.com/message.jspa?messageID=10859921&lt;br /&gt;&lt;br /&gt;
By the way, why Apple not fixed?&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/5589263068324193813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/5589263068324193813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5589263068324193813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5589263068324193813'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/03/broken-java-preference-in-os-x-leopard.html' title='Broken Java Preference in OS X Leopard'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-5942772237589600999</id><published>2010-01-03T20:27:00.001+08:00</published><updated>2010-01-03T20:28:14.059+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="mac tips"/><title type='text'>Restore application from the Dock</title><content type='html'>In OS X, you can minimize a application with &#39;Cmd-M&#39;.&lt;br /&gt;
&lt;br /&gt;
To restore it there is no hot key to do so, but one tricks is to use spotlight.

Just type the application name in spotlight and the application will be restored.&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/5942772237589600999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/5942772237589600999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5942772237589600999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/5942772237589600999'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2010/01/restore-application-from-dock.html' title='Restore application from the Dock'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-1022715817211634976</id><published>2009-10-31T12:25:00.003+08:00</published><updated>2009-10-31T12:33:07.923+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Filter file content in Vim</title><content type='html'>&lt;p&gt;The following is a simple method to do a &#39;grep&#39; in the Vim buffer, without do it in the shell.&lt;/p&gt;

&lt;p&gt;Consider the following file content:
&lt;pre&gt;
  public class SomeThing {
    // some constant
    final static public String CONSTANT_A = &quot;a&quot;;
    // another constant
    final static public String CONSTANT_B = &quot;b&quot;;
    // yet another constant
    final static public String CONSTANT_C = &quot;c&quot;;
  }
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;To filter out the constant definition lines (&#39;final static public ...&#39;), you can use a &#39;g&#39; command in Vim to filter lines by regex and &lt;i&gt;append&lt;/i&gt; to a register &#39;x&#39;.&lt;/p&gt;
&lt;pre&gt;
:g/final static public/normal &quot;Xyy
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Then, paste the register in somewhere you need it. For example, to put it in new buffer.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/1022715817211634976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/1022715817211634976' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1022715817211634976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1022715817211634976'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/10/filter-file-content-in-vim.html' title='Filter file content in Vim'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-4069394219816856550</id><published>2009-10-31T12:23:00.000+08:00</published><updated>2009-10-31T12:23:32.958+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Vim command line editing</title><content type='html'>&lt;p&gt;Paste the contents of register into the command line is very useful, for example, you can edit a non-trivial command in normal vim buffer, or you can copy some text from the file. There are at least two way to do it:&lt;/p&gt;

&lt;p&gt;The &#39;CTRL_R&#39;, in command mode, can be used for this [:help c_CTRL-R]
&lt;ol&gt;
&lt;li&gt;Assume you saved some text in register &#39;a&#39;&lt;/li&gt;
&lt;li&gt;Under command mode, press &#39;Ctrl-R a&#39;&lt;/li&gt;
&lt;li&gt;The text in register &#39;a&#39; will pasted in the command line&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;One powerful alternative is the command window [:help q:]
&lt;ol&gt;
&lt;li&gt;Under normal mode, use &#39;q:&#39; to enter command window&lt;/li&gt;
&lt;li&gt;Editing the command&lt;/li&gt;
&lt;li&gt;Press &#39;Enter&#39; to execute, or &#39;Ctrl-C&#39; to quit this mode&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;This two method is provided by Tim on the &lt;a href=&quot;http://www.nabble.com/copy-paste-in-command-line-td18628494.html&quot;&gt;thread&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/4069394219816856550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/4069394219816856550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4069394219816856550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4069394219816856550'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/10/vim-command-line-editing.html' title='Vim command line editing'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-1928605441110565715</id><published>2009-10-31T11:27:00.004+08:00</published><updated>2009-10-31T12:11:19.765+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="cvs"/><category scheme="http://www.blogger.com/atom/ns#" term="cygwin"/><title type='text'>CVS client in Cygwin and CVSNT doesn&#39;t play with each other!</title><content type='html'>&lt;p&gt;I have puzzled by the strange CVS error for a few weeks and finally I sit down and dig out the real problem. If you need to use CVS on Windows and you are a Cygwin user, read on!&lt;/p&gt;

&lt;p&gt;If you checkout the source using CVSNT client, and try to use Cygwin client to do other CVS operation, you will found CVS client will quickly failed with the error: &quot;Repository not found&quot;.&lt;/p&gt;

&lt;p&gt;If you try to checkout the source using Cygwin client and try to use CVSNT client to do other CVS operation, the CVSNT client will have strange result too.&lt;/p&gt;

&lt;p&gt;The real reason is the silly line-ending issue. CVSNT will always convert sources from Unix line ending to DOS line ending, including the CVS specific files (CVS/Root for example). If you don&#39;t enable the line-ending conversion in Cygwin (I never do this), Cygwin client will never read the CVS file correctly, and no CVS operation can be performed properly.&lt;/p&gt;

&lt;p&gt;On the other hand, if you checkout the source using Cygwin client, all source files and CVS specific files will be in Unix line-ending. CVSNT client cannot handle this properly too! There is a setting in CVSNT client to treat the work copy in Unix line ending, but it just seems doesn&#39;t work for me.&lt;/p&gt;

&lt;p&gt;The solution? Stick with only one tools. I choose to stick with Cygwin client as it is the more natural for me. In additions, I found Eclipse and NetBeans can handle the source checked out via Cygwin client and CVSNT client. Hence, I haven&#39;t yet got any functionality miss out in Cygwin client + Eclipse/NetBeans combination.&lt;/p&gt;

&lt;p&gt;There is a entry in Cygwin FAQ to enable the DOS/Unix line ending conversion mode in Cygwin, I haven&#39;t try this as I believe this mode may cause some problems on other programs / tools in Cygwin.&lt;/p&gt;

&lt;p&gt;If you need a more details on this issue, the following places may helps:
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.tortoisecvs.org/faq.html#brokenlineendings&quot;&gt;Line Ending discussion in TotroiseCVS FAQ&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://cygwin.com/faq/faq-nochunks.html#faq.api.cr-lf&quot;&gt;Line Ending discussion in Cygwin FAQ&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://cygwin.com/cygwin-ug-net/using-textbinary.html&quot;&gt;Cygwin User Guide on the Line-Ending issue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/1928605441110565715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/1928605441110565715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1928605441110565715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1928605441110565715'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/10/cvs-client-in-cygwin-and-cvsnt-doesnt.html' title='CVS client in Cygwin and CVSNT doesn&#39;t play with each other!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-8898971251875269488</id><published>2009-10-31T01:08:00.001+08:00</published><updated>2009-10-31T12:11:40.742+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="debian"/><category scheme="http://www.blogger.com/atom/ns#" term="qnap"/><title type='text'>Rescue Debian on QNAP TS-209</title><content type='html'>&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;I&#39;ve a QNAP TS-209 serve sitting on my home network and serving as file server, web server, etc. Thanks to the &lt;a href=&quot;http://www.cyrius.com/debian/orion/qnap/ts-209/&quot;&gt;work of Martin&lt;/a&gt;, Debian can run on my box with only trivial effort. 

Just like most of the NAS, however, you can only access it via ssh/telnet unless you have serial access. If you made some silly mistake and it won&#39;t booting up properly, you will need some rescue methods. As it doesn&#39;t won&#39;t support to boot from CD/floppy, and there is no easy way to have console access, Live CD or old floppy bootdisk just doesn&#39;t help.

Fortunately, the boot loader of QNAP (uBoot) support &lt;a href=&quot;http://wiki.qnap.com/wiki/System_Recovery_Mode&quot;&gt;recovery mode&lt;/a&gt;, which will fetch a image and flash memory. This mechanism is very useful, and can be used to recover the Debian without reinstalling everything.

Recovery mode is basically using tftp to download a binary image, hence, in order to use this, you must backup the correct image once you have installed the Debian. The image can be backup with the following command:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;[debian-in-qnap] $ cat /dev/mtd1 /dev/mtd2 /dev/mtd3 &amp;gt; qnapimg.bin

Once you made the image, backup it, it is the only file needed to recover the system. Note that the image is actually the linux kernel and initrd image, hence, you should redo the backup every time you upgrade kernel on the system.

Now, when you need to recover the system, following the steps:
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;&lt;ul&gt;
&lt;li&gt;Setup tftp on the local network with IP address: 192.168.0.11&lt;/li&gt;
&lt;li&gt;Put the &lt;u&gt;qnapimg.bin&lt;/u&gt; under root directory of tftp&lt;/li&gt;
&lt;li&gt;Start the QNAP in recocovery (shutdown, press and hold reset button, and start the system, release the reset until you hear two short beap sound&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: small;&quot;&gt;&lt;span style=&quot;font-size: 11px;&quot;&gt;&lt;span style=&quot;font-family: monospace; font-size: 12px; line-height: 15px; white-space: pre-wrap;&quot;&gt;After some minutes, you system will restart using your recovery image.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/8898971251875269488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/8898971251875269488' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/8898971251875269488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/8898971251875269488'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/10/rescue-debian-on-qnap-ts-209.html' title='Rescue Debian on QNAP TS-209'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-2392651524444500249</id><published>2009-05-01T15:50:00.000+08:00</published><updated>2009-05-01T15:50:05.102+08:00</updated><title type='text'>Vim subsitute with expression expansion</title><content type='html'>&lt;p&gt;Just read a really interesting Vim tips and tricks post on Vim substitute with expression. In a nutshell, Vim substitute command allow you to use Vim expression, whose used in Vim script. For example, the following command will change all &#39;CONFIG&#39; to &#39;config&#39;.&lt;/p&gt;

&lt;pre&gt;
:%s,CONFIG,\=tolower(submatch(0)),
&lt;/pre&gt;

&lt;p&gt;In this example, the key is &#39;\=&#39; notation, which is a switch to enter expression evaluation mode. The function submatch(0) refers to the full match of the substitute command, and both tolower() and submatch() is normal Vim functions only.&lt;/p&gt;

&lt;p&gt;Read the &lt;a href=&quot;http://www.thegeekstuff.com/2009/04/vi-vim-editor-search-and-replace-examples/&quot;&gt;Vi and Vim Editor: 12 Powerful Find and Replace Examples&lt;/a&gt; for more examples.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/2392651524444500249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/2392651524444500249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/2392651524444500249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/2392651524444500249'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/05/vim-subsitute-with-expression-expansion.html' title='Vim subsitute with expression expansion'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-6313525186511706398</id><published>2009-02-28T00:20:00.001+08:00</published><updated>2009-02-28T00:21:53.775+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hardware"/><title type='text'>5 watt Linux server in a Power Plug</title><content type='html'>&lt;p&gt;Marvell has announced a extremely low power consumption SoC device.&lt;/p&gt;

&lt;p&gt;This is a really cool device, think you can have a box running web application, dhcp, dns proxy with just a power plug sized device.&lt;/p&gt;

&lt;p&gt;When attached with an external disk, this will become an ultra low cost NAS and running media streaming, file sharing service&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/6313525186511706398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/6313525186511706398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6313525186511706398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/6313525186511706398'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/02/5-watt-linux-server-in-power-plug.html' title='5 watt Linux server in a Power Plug'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-4467764585150799033</id><published>2009-01-21T00:56:00.000+08:00</published><updated>2009-01-21T01:11:59.488+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><title type='text'>Oracle slow initial connection (default installation on Windows)</title><content type='html'>Recently, I&#39;m managed to create a few Oracle DBs on various Windows box for development purpose.&lt;br /&gt;
 &lt;br /&gt;
As all are aimed for development purpose and no special configuration is planned. However, with default DB configuration on Windows, you will experience very slow initial connection lag time. To solve this problem, you need to disable NTS authentication.&lt;br /&gt;
&lt;br /&gt;
To do this, edit sqlnet.or &lt;br /&gt;
&lt;em&gt;SQLNET&lt;/em&gt;.&lt;em&gt;AUTHENTICATION_SERVICES&lt;/em&gt;=(&lt;em&gt;NONE&lt;/em&gt;)&lt;br /&gt;
&lt;br /&gt;
Note that, you should see the original setting is NTS (which is native authentication method on Windows platform).</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/4467764585150799033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/4467764585150799033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4467764585150799033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4467764585150799033'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2009/01/oracle-slow-initial-connection-default.html' title='Oracle slow initial connection (default installation on Windows)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-8358950486954994766</id><published>2008-11-09T17:05:00.003+08:00</published><updated>2008-11-09T17:20:24.681+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>Great profiling tools VisualVM bundled with JDK6</title><content type='html'>&lt;p&gt;Whenever encounter memory leak or performance problem, profiler will be your great friend.&lt;/p&gt;

&lt;p&gt;Sometimes before, I have used some well known profiling tools like YourKit or hprof, jmap, tools, but recently, I discover JDK 6 has bundled with a new tools called VisualVM.&lt;/p&gt;

&lt;p&gt;Indeed, the VisualVM is itself a self contained &lt;a href=&quot;&quot;&gt;project&lt;/a&gt;, it provides some common monitoring features like thread/heap monitoring, as well as cpu / memory profiling features. It also allows you taking snapshots and compare memory snapshot.&lt;/p&gt;

&lt;p&gt;IMO, it should deserve much more attention than its currently have. And it is really a perfect tools for most performance monitoring / tunning needs.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/8358950486954994766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/8358950486954994766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/8358950486954994766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/8358950486954994766'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2008/11/great-profiling-tools-visualvm-bundled.html' title='Great profiling tools VisualVM bundled with JDK6'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-4821701717191507442</id><published>2008-09-27T23:43:00.005+08:00</published><updated>2009-10-31T12:11:59.364+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oracle"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Happy Vimming again!</title><content type='html'>&lt;p&gt;
Vim has been my favorite editor for years. However, for Java related development I&#39;ve switched to Eclipse. Vim is then only been used for general text editing (writing notes, scripts, etc).
&lt;/p&gt;

&lt;p&gt;
Recently, I have to do fairly amount of coding in PL/SQL. After struggling for weeks to writing code in SQLDeveloper, I remember the lovely Vim.
&lt;/p&gt;

&lt;p&gt;
Vim already bundled the syntax file for PLSQL and Oracle SQL,.
However, Vim doesn&#39;t bundled with a good PL/SQL indentation setup, which can be found in &lt;a href=&quot;http://plnet.org/files/vim/indent&quot;&gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Another important setup is connecting sqlplus and vim and it is can be done by adding the line below into glogin.sql (sqlplus init file):
&lt;/p&gt;&lt;pre&gt;
 DEFINE _EDITOR=&#39;vim -c &quot;set filetype=plsql&quot;&#39;
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;

&lt;p&gt;
Finally, to make the sqlplus usable, it is better to use &lt;a href=&quot;http://utopia.knoware.nl/%7Ehlub/rlwrap/&quot;&gt;rlwrap&lt;/a&gt; (which bring basic readline features like command history and hot key to the sqlplus).
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/4821701717191507442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/4821701717191507442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4821701717191507442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/4821701717191507442'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2008/09/happy-vimming-again.html' title='Happy Vimming again!'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-1591209112343333321</id><published>2008-08-09T20:02:00.003+08:00</published><updated>2008-08-09T21:24:53.362+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="thoughts"/><title type='text'>Olympic, China, Microsoft</title><content type='html'>&lt;p&gt;I&#39;m originally going to blog about the amazing opening ceremony of the 2008 Olympic games on last night. But I just changed my mind as my good feeling is substituted with big anger!&lt;/p&gt;

&lt;p&gt;Today is the second day of the Olympic games, I&#39;m just going to checkout for the official means on watching the games via Internet. After all, I found that, i-cable is the only authorized company to provide the Olympic video online in Hong Kong. Hence, I visit the site and well, fail to watch any video clips.&lt;/p&gt;

&lt;p&gt;The site shown that, Microsoft Windows Media Player 9 is required. Currently, I&#39;m using Mac OSX as my primary desktop and I&#39;m already installed the official WMV codec from MS website. And the sad fact is that, clearly MS Windows is prerequisite for watching the games. But hey, Olympic is the event of anyone on the earth, it seems now, Olympic is game for Microsoft users.&lt;/p&gt;

&lt;p&gt;Nowadays, we can watch TV and listen to radio as long as you have working TV set or radio. But on the Internet, you must pay to one vendor: MS. Sorry I believe there is something wrong, what do you think?&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/1591209112343333321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/1591209112343333321' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1591209112343333321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/1591209112343333321'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2008/08/olympic-china-microsoft.html' title='Olympic, China, Microsoft'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9420660.post-713270842914459227</id><published>2008-08-06T18:19:00.001+08:00</published><updated>2008-08-06T18:43:18.656+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>What happens during power outage</title><content type='html'>&lt;p&gt;Just skimming through Slashdot and enjoyed an well-written &lt;a href=&quot;http://www.halfgaar.net/why-power-failures-are-bad-for-your-data&quot;&gt;article&lt;/a&gt; by Halfgaar.&lt;/p&gt;

&lt;p&gt;
What&#39;s make me think interesting is the following two points:
&lt;ul&gt;
&lt;li&gt;Different components on the system response slightly different during power outage&lt;/li&gt;
&lt;li&gt;Another point is how aged disk will died after power failure&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://zarick.blogspot.com/feeds/713270842914459227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/9420660/713270842914459227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/713270842914459227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9420660/posts/default/713270842914459227'/><link rel='alternate' type='text/html' href='http://zarick.blogspot.com/2008/08/what-happens-during-power-outage.html' title='What happens during power outage'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>