<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Howtos &#187; IT</title>
	<atom:link href="http://howto.isgoodness.com/category/it/feed/" rel="self" type="application/rss+xml" />
	<link>http://howto.isgoodness.com</link>
	<description>Stuffs that are worth to mention and worth to know</description>
	<lastBuildDate>Sun, 27 Feb 2011 16:19:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JQuery Datatable</title>
		<link>http://howto.isgoodness.com/2011/02/jquery-datatable/</link>
		<comments>http://howto.isgoodness.com/2011/02/jquery-datatable/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 16:09:02 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[datatable]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=584</guid>
		<description><![CDATA[I use to play my faceboook app Chinese poker on my Iphone on my way home from work. My connection is not fast enough and it made the game less interest. . I felt also a litle bit frustrated. I need to do something about it and out comes JQuery Datatable. JQuery Datatable generates a [...]]]></description>
			<content:encoded><![CDATA[<p>I use to play my faceboook app <a href="http://apps.facebook.com/xap-xam">Chinese poker</a> on my Iphone on my way home from work. My connection is not fast enough and it made the game less interest. . I felt also a litle bit frustrated. I need to do something about it and out comes JQuery Datatable.</p>
<p>JQuery Datatable generates  a table based on a set of json data. You can provide callback for formatting the content in each td cell, parse attributes to the table, th and td element. You can also add listeners to do more thing on the rendered table. The good thing of this is that I just save 40% bandwidth. The bad thing is that I am still using table.</p>
<p>JQuery Datatable is available at <a href="http://facebook.chinesepoker.isgoodness.com/js/jdatatable.js">http://facebook.chinesepoker.isgoodness.com/js/jdatatable.js</a></p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2011/02/jquery-datatable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JQuery history</title>
		<link>http://howto.isgoodness.com/2011/02/jquery-history/</link>
		<comments>http://howto.isgoodness.com/2011/02/jquery-history/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 12:59:09 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[hash url]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[pushState]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=501</guid>
		<description><![CDATA[Was curious on how window.history.pushState works and since I have been used jQuery history plugin on my Facebook application for years (Thanks to Taku Sano, Takayuki Miwa, Lincoln Cooper!) and still ran on an old version I decided to add support for new feature in HTML5 and rewrite it a litle bit. How does pushState [...]]]></description>
			<content:encoded><![CDATA[<p>Was curious on how window.history.pushState works and since I have been used jQuery history plugin on <a href="http://apps.facebook.com/xap-xam/">my Facebook application</a> for years (Thanks to Taku Sano, Takayuki Miwa, Lincoln Cooper!) and still ran on an old version I decided to add support for new feature in HTML5 and rewrite it a litle bit. How does pushState work? shortly it replaces the entire url with a new url in the url bar without causing the browser to load the actual page. It seems to work great with my application since there is a context switch, no change needs to be done. However, I wonder how much job need to be done (to handle url-sharing or when user push on refresh-button) if the content corresponding to the hash does not have a full page version.</p>
<p>Anyway, here it is. Feel free to use and the usage is simple. There are 2 public methods that you can make call</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span> callback <span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> options<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
   initiate history object
<span style="color: #339933;">@</span>param callback <span style="color: #339933;">&lt;</span>Function<span style="color: #339933;">&gt;</span>
  <span style="color: #000066; font-weight: bold;">This</span> <span style="color: #003366; font-weight: bold;">function</span> vill be called <span style="color: #000066; font-weight: bold;">with</span> the hash <span style="color: #000066; font-weight: bold;">as</span> argument when the hash <span style="color: #000066; font-weight: bold;">is</span> updated
<span style="color: #339933;">@</span>param options <span style="color: #339933;">&lt;</span>Object<span style="color: #339933;">&gt;</span> 
   Possible properties 
   <span style="color: #009900;">&#123;</span>noHash<span style="color: #339933;">:</span> Boolean<span style="color: #339933;">,</span> dynamic<span style="color: #339933;">:</span> Boolean<span style="color: #339933;">,</span> initReload<span style="color: #339933;">:</span> Boolean<span style="color: #339933;">,</span> shorten<span style="color: #339933;">:</span> Boolean<span style="color: #009900;">&#125;</span>
   <span style="color: #000066; font-weight: bold;">If</span> noHash <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #003366; font-weight: bold;">true</span> pushState will be used <span style="color: #000066; font-weight: bold;">if</span> it <span style="color: #000066; font-weight: bold;">is</span> available.
   <span style="color: #000066; font-weight: bold;">If</span> dynamic <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #003366; font-weight: bold;">true</span> a callback <span style="color: #000066; font-weight: bold;">is</span> always made even <span style="color: #000066; font-weight: bold;">if</span> it <span style="color: #000066; font-weight: bold;">is</span> the same hash
   <span style="color: #000066; font-weight: bold;">if</span> initReload <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #003366; font-weight: bold;">true</span> the full page will be reload <span style="color: #000066; font-weight: bold;">if</span> the user 
   enters the page <span style="color: #000066; font-weight: bold;">with</span> a hash 
   <span style="color: #000066; font-weight: bold;">If</span> shorten <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #003366; font-weight: bold;">true</span> scheme and host will be removed from the hash.
   <span style="color: #000066; font-weight: bold;">This</span> <span style="color: #000066; font-weight: bold;">is</span> useful when using load directly on href
   <span style="color: #003366; font-weight: bold;">Default</span> <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #003366; font-weight: bold;">true</span> <span style="color: #000066; font-weight: bold;">for</span> all.
&nbsp;
<span style="color: #000066; font-weight: bold;">void</span> load <span style="color: #009900;">&#40;</span> hash <span style="color: #009900;">&#91;</span><span style="color: #339933;">,</span> title<span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #339933;">@</span>param hash <span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span>  <span style="color: #339933;">-</span>  <span style="color: #003366; font-weight: bold;">New</span> hash to update
<span style="color: #339933;">@</span>param title <span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> <span style="color: #339933;">-</span>  Title to set to the document</pre></div></div>

<p>If your application needs the hash state to complete the page you must set noHash and initReload to false. The iframe solution is not well tested since I don&#8217;t have plattform to test but I think it should function as the original one. I have only tested it on win7, IE8 running in mode IE7.  If you have a chance please test it!</p>
<p><strong>Issues</strong><br />
<lo>	</p>
<li>Chrome seems to break script-tag from serverfbml-tag (script-tag contains fbml-tag which is required in serverfbml-tag). This hapens when listening on popstate-event. Possible workaround is to initiate the history object when first used if there is fbml code.</li>
<p></lo></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/*
 * jQuery history plugin
 * 
 * sample page: http://www.serpere.info/jquery-history-plugin/samples/
 *
 * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari)
 * Copyright (c) 2010 Takayuki Miwa
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Modified by Lincoln Cooper to add Safari support 
 * and only call the callback once during initialization
 * for msie when no initial hash supplied.
 * 
 * Modified by Van Nhu Nguyen (2011);
 * redesign
 * use hash token #!
 * delay of iframe creation
 * support popstate and hashchange (html5)
 * always load page if dynamic content
 * shorten the hash if it is a full url
 * reload full page using the hash if enter the page with a hash
 * reload the page when user uses back-button 
 * and navigate to the &quot;entered&quot; page if this does not contain a hash 
 */</span>
&nbsp;
<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">history</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003366; font-weight: bold;">var</span> appState <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> appCallback <span style="color: #339933;">=</span> undefined<span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> usePushState <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> dynamic <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> hashHandler <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> interval <span style="color: #339933;">=</span> <span style="color: #CC0000;">100</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> support <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> reloadIfInitHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortenHashPattern <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;^&quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">protocol</span>
				<span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;<span style="color: #000099; font-weight: bold;">\/</span><span style="color: #000099; font-weight: bold;">\/</span>&quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">location</span>.<span style="color: #660066;">host</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;i&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> shortenHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> encodeHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		support.<span style="color: #660066;">needIframe</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">8</span> <span style="color: #339933;">||</span> document.<span style="color: #660066;">documentMode</span> <span style="color: #339933;">&lt;</span> <span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		support.<span style="color: #660066;">pushState</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">history</span> <span style="color: #339933;">&amp;&amp;</span> window.<span style="color: #660066;">history</span>.<span style="color: #660066;">pushState</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		support.<span style="color: #660066;">hashChange</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;onhashchange&quot;</span> <span style="color: #000066; font-weight: bold;">in</span> window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003366; font-weight: bold;">var</span> hashHandlers <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		hashHandlers.<span style="color: #660066;">pushState</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
			init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				appState <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>reloadIfInitHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #003366; font-weight: bold;">var</span> hash <span style="color: #339933;">=</span> getHash<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						window.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> hash<span style="color: #339933;">;</span>
						<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
				$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;popstate&quot;</span><span style="color: #339933;">,</span> detectHashChange<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			detect <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				appState <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				appCallback<span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			set <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				window.<span style="color: #660066;">history</span>.<span style="color: #660066;">pushState</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> title <span style="color: #339933;">?</span> title <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #339933;">,</span> hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			get <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">return</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		hashHandlers.<span style="color: #660066;">hashChange</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
			init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>appState <span style="color: #339933;">=</span> getHash<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>reloadIfInitHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						window.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> appState<span style="color: #339933;">;</span>
						<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					appCallback<span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>support.<span style="color: #660066;">hashChange</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">bind</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hashchange&quot;</span><span style="color: #339933;">,</span> detectHashChange<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
					setInterval<span style="color: #009900;">&#40;</span>detectHashChange<span style="color: #339933;">,</span> interval<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			detect <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003366; font-weight: bold;">var</span> currentHash <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentHash <span style="color: #339933;">!=</span> appState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						appState <span style="color: #339933;">=</span> currentHash<span style="color: #339933;">;</span>
						appCallback<span style="color: #009900;">&#40;</span>currentHash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					currentHash <span style="color: #339933;">=</span> cleanHash<span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					appState <span style="color: #339933;">=</span> currentHash<span style="color: #339933;">;</span>
					appCallback<span style="color: #009900;">&#40;</span>currentHash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			set <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				setHash<span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					document.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> title<span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			get <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">return</span> getHash<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		hashHandlers.<span style="color: #660066;">iframe</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;__jQuery_history&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #003366; font-weight: bold;">var</span> getIframeDocument <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003366; font-weight: bold;">var</span> doc <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span> <span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">contentWindow</span>.<span style="color: #660066;">document</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					doc.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					doc.<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #000066; font-weight: bold;">return</span> doc<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
				init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #003366; font-weight: bold;">var</span> self <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>appState <span style="color: #339933;">=</span> getHash<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>reloadIfInitHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							window.<span style="color: #660066;">location</span> <span style="color: #339933;">=</span> appState<span style="color: #339933;">;</span>
							<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
						self <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #009966; font-style: italic;">/* delay call in case this method called before dom ready */</span>
					$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #003366; font-weight: bold;">var</span> html <span style="color: #339933;">=</span> <span style="color: #3366CC;">'&lt;iframe id=&quot;'</span>
							<span style="color: #339933;">+</span> id
							<span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot; style=&quot;display:none&quot; src=&quot;javascript:false;&quot; /&gt;'</span><span style="color: #339933;">;</span>
						$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prepend</span><span style="color: #009900;">&#40;</span>html<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						setInterval<span style="color: #009900;">&#40;</span>detectHashChange<span style="color: #339933;">,</span> interval<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
							appCallback<span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							self.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span>
					<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
				detect <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #003366; font-weight: bold;">var</span> currentHash <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #003366; font-weight: bold;">var</span> windowHash <span style="color: #339933;">=</span> getHash<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentHash <span style="color: #339933;">!=</span> appState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						appState <span style="color: #339933;">=</span> currentHash<span style="color: #339933;">;</span>
						setHash<span style="color: #009900;">&#40;</span>appState<span style="color: #339933;">,</span> window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						appCallback<span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>currentHash <span style="color: #339933;">!=</span> windowHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						appState <span style="color: #339933;">=</span> windowHash<span style="color: #339933;">;</span>
						setHash<span style="color: #009900;">&#40;</span>appState<span style="color: #339933;">,</span> getIframeDocument<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						appCallback<span style="color: #009900;">&#40;</span>appState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
				set <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					setHash<span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> getIframeDocument<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					setHash<span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> window<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						document.<span style="color: #660066;">title</span> <span style="color: #339933;">=</span> title<span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
				get <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">return</span> getHash<span style="color: #009900;">&#40;</span>getIframeDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> setHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> win<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			win.<span style="color: #660066;">location</span>.<span style="color: #660066;">hash</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;!&quot;</span>
					<span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>encodeHash <span style="color: #339933;">?</span> encodeURIComponent<span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> getHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>win<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003366; font-weight: bold;">var</span> hash <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>win.<span style="color: #660066;">location</span>.<span style="color: #660066;">hash</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^#!/</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">return</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">mozilla</span> <span style="color: #339933;">?</span> hash
					<span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span>encodeHash <span style="color: #339933;">?</span> decodeURIComponent<span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> cleanHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>shortenHash<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				hash <span style="color: #339933;">=</span> hash.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span>shortenHashPattern<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">return</span> hash<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> getHashHandler <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>support.<span style="color: #660066;">needIframe</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">return</span> hashHandlers.<span style="color: #660066;">iframe</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>support.<span style="color: #660066;">pushState</span> <span style="color: #339933;">&amp;&amp;</span> usePushState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">return</span> hashHandlers.<span style="color: #660066;">pushState</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000066; font-weight: bold;">return</span> hashHandlers.<span style="color: #660066;">hashChange</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> detectHashChange <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			hashHandler.<span style="color: #660066;">detect</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
			init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>callback<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>$.<span style="color: #660066;">isFunction</span><span style="color: #009900;">&#40;</span>callback<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">throw</span> <span style="color: #003366; font-weight: bold;">new</span> Error<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;callback must be a function&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				appCallback <span style="color: #339933;">=</span> callback<span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> options.<span style="color: #660066;">noHash</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						usePushState <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Boolean<span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">noHash</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> options.<span style="color: #660066;">dynamic</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						dynamic <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Boolean<span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">dynamic</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> options.<span style="color: #660066;">initReload</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						reloadIfInitHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Boolean<span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">initReload</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span> options.<span style="color: #660066;">shorten</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'undefined'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						shortenHash <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Boolean<span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">shorten</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
				hashHandler <span style="color: #339933;">=</span> getHashHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				hashHandler.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
			load <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				hash <span style="color: #339933;">=</span> cleanHash<span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>dynamic <span style="color: #339933;">||</span> hash <span style="color: #339933;">!=</span> appState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					hashHandler.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span>hash<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					appState <span style="color: #339933;">=</span> hash<span style="color: #339933;">;</span>
					appCallback<span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2011/02/jquery-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs selected command, config and practice</title>
		<link>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/</link>
		<comments>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 21:09:26 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=470</guid>
		<description><![CDATA[This is a collection of things I found usefull regarding emacs. It will grow &#8230; .emacs Add those bellow in the file ~/.emacs ;; do not make backup files (setq make-backup-files nil) ;; php syntax color (load &#8220;php-mode&#8221;) (add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.php[34]?\\&#8217;\\&#124;\\.phtml\\&#8217;&#8221; . php-mode)) X forwarding with ssh ssh -X your.ssh.domain.com ~$emacs somefile will start an [...]]]></description>
			<content:encoded><![CDATA[<p>This is a collection of things I found usefull regarding emacs. It will grow &#8230;</p>
<p><strong>.emacs</strong><br />
Add those bellow in the file ~/.emacs<br />
;; do not make backup files<br />
(setq make-backup-files nil)</p>
<p>;; php syntax color<br />
(load &#8220;php-mode&#8221;)<br />
(add-to-list &#8216;auto-mode-alist<br />
     	     &#8216;(&#8220;\\.php[34]?\\&#8217;\\|\\.phtml\\&#8217;&#8221; . php-mode))</p>
<p><strong>X forwarding with ssh</strong><br />
ssh -X your.ssh.domain.com<br />
~$emacs somefile<br />
will start an gui emacs on your local computer. You can also set ForwardX11 to yes for enable X forwarding. This property can be found at /etc/ssh/ssh_config</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2010/08/emacs-selected-command-config-and-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReferenceError #1065: can not create property 0 on &#8230; (and #1069)</title>
		<link>http://howto.isgoodness.com/2010/02/referenceerror-1065-can-not-create-property-0-on-and-1069/</link>
		<comments>http://howto.isgoodness.com/2010/02/referenceerror-1065-can-not-create-property-0-on-and-1069/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 13:20:44 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[dynamic class]]></category>
		<category><![CDATA[reference error]]></category>
		<category><![CDATA[shuffle]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=422</guid>
		<description><![CDATA[Last week, I was trying to create a shuffle function on my array class which extends the native Array class. I got the ReferenceError when running the code bellow. The reason is that Array is a dynamic class and my is not. Since Array is dynamic, it will try to create new property when you [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I was trying to create a <a href="http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">shuffle </a>function on my array class which extends  the native Array class. I got the ReferenceError when running the code bellow. The reason is that Array is a dynamic class and my is not.  Since Array is dynamic, it will try to create new property when you try to assign some value to a nonexistent instance variable but MyArray prevents this. If you try this you will see that reference error #1065 is occurred when the array is constructed. If you remove the constructor you will get reference error #1069 instead and it hapens when you try to swap the elements in shuffle method (trying to access a nonexistent instance variable). So make sure that you declare dynamic if you extend a dynamic class or better if editor or compiler gives a warning if you forget &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span> vnmedia.common.lang
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> vnmedia.common.lang.math.Random;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MyArray extends <span style="color: #004993;">Array</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MyArray<span style="color: #000000;">&#40;</span>...<span style="color: #004993;">parameters</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">parameters</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> shuffle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> a<span style="color: #000000; font-weight: bold;">:*</span>, k<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>, i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>, r<span style="color: #000000; font-weight: bold;">:</span>Random = <span style="color: #0033ff; font-weight: bold;">new</span> Random<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>i = <span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">length</span>; i <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1</span>; i<span style="color: #000000; font-weight: bold;">--</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				<span style="color: #009900;">// 0 &lt;= k &lt;= i - 1</span>
				k = r.nextInt<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span>;
				a = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>k<span style="color: #000000;">&#93;</span>;
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>k<span style="color: #000000;">&#93;</span> = <span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
				<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span> = a;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>However, I think the best way to provide a shuffle function for arrays is  to define a static ArrayUtil.shuffle as bellow</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> vnmedia.common.lang
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> vnmedia.common.lang.math.Random;
&nbsp;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> ArrayUtil
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> ArrayUtil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> static <span style="color: #339966; font-weight: bold;">function</span> shuffle<span style="color: #000000;">&#40;</span>arr<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> a<span style="color: #000000; font-weight: bold;">:*</span>, k<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>, i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>, r<span style="color: #000000; font-weight: bold;">:</span>Random = <span style="color: #0033ff; font-weight: bold;">new</span> Random<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>i = arr.<span style="color: #004993;">length</span>; i <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight:bold;">1</span>; i<span style="color: #000000; font-weight: bold;">--</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
				k = r.nextInt<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span>;
				a = arr<span style="color: #000000;">&#91;</span>k<span style="color: #000000;">&#93;</span>;
				arr<span style="color: #000000;">&#91;</span>k<span style="color: #000000;">&#93;</span> = arr<span style="color: #000000;">&#91;</span>i<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span>;
				arr<span style="color: #000000;">&#91;</span>i<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span> = a;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2010/02/referenceerror-1065-can-not-create-property-0-on-and-1069/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit access with firewall ufw</title>
		<link>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/</link>
		<comments>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 08:35:24 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[limit access]]></category>
		<category><![CDATA[ufw]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=408</guid>
		<description><![CDATA[Here is some links on how you can reject requests using firewall ufw. http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html http://www.ubuntu-unleashed.com/2008/05/howto-take-use-setup-and-advantage-of.html]]></description>
			<content:encoded><![CDATA[<p>Here is some links on how you can reject requests using firewall ufw.</p>
<p>http://manpages.ubuntu.com/manpages/jaunty/en/man8/ufw.8.html</p>
<p>http://www.ubuntu-unleashed.com/2008/05/howto-take-use-setup-and-advantage-of.html</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2010/02/limit-access-with-firewall-ufw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit http methods</title>
		<link>http://howto.isgoodness.com/2009/12/limit-http-methods/</link>
		<comments>http://howto.isgoodness.com/2009/12/limit-http-methods/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 21:50:46 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[http methods]]></category>
		<category><![CDATA[limit access]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=398</guid>
		<description><![CDATA[I you have an apache server which you only use GET and POST methods I think it is better that you limit the access. Since there are many methods it is more convinient to use the opposite functions, limitExcept. Bellow is an example how it would look like. The limitExcept directive allows only GET and [...]]]></description>
			<content:encoded><![CDATA[<p>I you have an apache server which you only use GET and POST methods I think it is better that you <a href="http://httpd.apache.org/docs/2.0/mod/core.html#limit" target="_blank">limit</a> the access. Since there are many methods it is more convinient to use the opposite functions, <a href="http://httpd.apache.org/docs/2.0/mod/core.html#limitexcept" target="_blank">limitExcept</a>. Bellow is an example how it would look like. The limitExcept directive allows only GET and POST. All other request methods will be rejected.</p>

<div class="wp_syntax"><div class="code"><pre class="init" style="font-family:monospace;">NameVirtualHost xxx.xxx.xxx:80
&lt;VirtualHost xxx.xxx.xxx:80&gt;
        ServerName example.com
&nbsp;
        DocumentRoot /path/to/doc/root
        &lt;Directory /path/to/doc/root/&gt;
                &lt;LimitExcept POST GET&gt;
                         Require valid-user
                &lt;/LimitExcept&gt; 
                Options Indexes MultiViews FollowSymLinks
                Order Allow,Deny
                Allow from all
        &lt;/Directory&gt;
...
&lt;/VirtualHost&gt;</pre></div></div>

<p>If you want to deny from the access you can use &#8220;Deny from all&#8221; instead of &#8220;Require valid-user&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/12/limit-http-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deny requests from specific ips, configured in virtual host</title>
		<link>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/</link>
		<comments>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 20:32:40 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[proxy abuse]]></category>
		<category><![CDATA[virtual host]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=382</guid>
		<description><![CDATA[Bad thing has hapened to me this holliday. The server has been attacked from serveral ips or more precis they used my server as proxy for attacking other targets. Lucky for me that my server is not configured for this kind of attacks. However, they kept request my server and I wanted that apache would [...]]]></description>
			<content:encoded><![CDATA[<p>Bad thing has hapened to me this holliday. The server has been attacked from serveral ips or more precis they used my server as proxy for attacking other targets. Lucky for me that my server is not configured for this kind of attacks. However, they kept request my server and I wanted that apache would deny all requests from those ips. This one is really tricky. I have configured for denying all except some ips, such as local, but never configured for denying some ips and allow the rest. I started reading apache docs and tried to understand. The result is as following:</p>

<div class="wp_syntax"><div class="code"><pre class="init" style="font-family:monospace;">NameVirtualHost xxx.xxx.xxx:80
&lt;VirtualHost xxx.xxx.xxx:80&gt;
        ServerName example.com
&nbsp;
        DocumentRoot /path/to/doc/root
        &lt;Directory /path/to/doc/root/&gt;
                Options Indexes MultiViews FollowSymLinks
                Order Deny,Allow
                Deny from xx.xxx.xxx.xxx
                Deny from xxx.xxx.xxx.xxx
                Deny from ...
                # ips that not matched deny list will be permitted
        &lt;/Directory&gt;
...
&lt;/VirtualHost&gt;</pre></div></div>

<p>Be aware that you can not use &#8220;Allow from all&#8221; in the end since apache deny a request only if it does not match an allow condition. So we have a deny list to match against. Ips that are not matched ips in this list will be permitted.</p>
<p>It says that there are no good way to protect against this kind of attacks. I hope that I can get in touch with those ip-owners and hopefully they can help me.</p>
<p>Some good pages</p>
<p>http://wiki.apache.org/httpd/ProxyAbuse</p>
<p>http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/12/deny-requests-from-specific-ips-configured-in-virtual-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get/kill process in ubuntu</title>
		<link>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/</link>
		<comments>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 15:19:10 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=369</guid>
		<description><![CDATA[For example if process name is php, you can get a list of jobs by using the command bellow ps aux &#124; grep php Result root 7749 0.0 0.1 3236 796 pts/2 S+ 16:09 0:00 grep php root 19292 1.8 5.6 90624 28528 ? S 01:36 16:09 php test.php To kill a process you can [...]]]></description>
			<content:encoded><![CDATA[<p>For example if process name is php, you can get a list of jobs by using the command bellow</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">ps aux | grep php</pre></div></div>

<p>Result</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">root      7749  0.0  0.1   3236   796 pts/2    S+   16:09   0:00 grep php
root     19292  1.8  5.6  90624 28528 ?        S    01:36  16:09 php test.php</pre></div></div>

<p>To kill a process you can use kill with a specific pid, for instance 19292  above</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">kill 19292</pre></div></div>

<p>And kill all php process</p>

<div class="wp_syntax"><div class="code"><pre class="cmd" style="font-family:monospace;">killall -9 php</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/how-to-getkill-process-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Howto enable ssl and create self-signed ssl certificate</title>
		<link>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/</link>
		<comments>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 14:51:18 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=345</guid>
		<description><![CDATA[Enable ssl In my case it was simple. I just ran this line a2enmod ssl Generate self-signed ssl certificate Solution: http://www.akadia.com/services/ssh_test_certificate.html Just follow instruction carefully. Make sure that i step 2 you need to enter a correct &#8220;Common Name&#8221;, ie your domain. Step 5 and 6 also different for different distributions and installation &#8230; Summary [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Enable ssl</strong><br />
In my case it was simple. I just ran this line</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">a2enmod ssl</pre></div></div>

<p><strong>Generate self-signed ssl certificate</strong><br />
Solution: http://www.akadia.com/services/ssh_test_certificate.html</p>
<p>Just follow instruction carefully. Make sure that i step 2 you need to enter a correct &#8220;Common Name&#8221;, ie your domain. Step 5 and 6 also different for different distributions and installation &#8230;</p>
<p>Summary in case link above is not available anymore:<br />
Step 1: Generate a Private Key</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl genrsa -des3 -out server.key <span style="">1024</span></pre></div></div>

<p>Step 2: Generate a CSR (Certificate Signing Request)</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl req -new -key server.key -out server.csr</pre></div></div>

<p>Step 3: Remove Passphrase from Key</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">cp server.key server.key.org
openssl rsa -in server.key.org -out server.key</pre></div></div>

<p>Step 4: Generating a Self-Signed Certificate</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">openssl x509 -req -days <span style="">365</span> -in server.csr -signkey server.key -out server.crt</pre></div></div>

<p>Step 5: Installing the Private Key and Certificate<br />
  (or the location you want to store)</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">cp server.crt /usr/local/apache/conf/ssl.crt
cp server.key /usr/local/apache/conf/ssl.key</pre></div></div>

<p>Step 6: Configuring SSL Enabled Virtual Hosts</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">SSLEngine on
SSLCertificateFile /usr/local/apache/conf/ssl.crt
SSLCertificateKeyFile /usr/local/apache/conf/ssl.key
SetEnvIf User-Agent <span style="color: #933;">&quot;.*MSIE.*&quot;</span> nokeepalive ssl-unclean-shutdown</pre></div></div>

<p>Step 7: Restart Apache and Test</p>
<p><strong>New problem:</strong><br />
ssl_error_ssl2_disabled<br />
Solution in ssl.conf:<br />
# enable only secure protocols: SSLv3 and TLSv1, but not SSLv2<br />
## disabled this one<br />
#SSLProtocol all -SSLv2<br />
## use this instead<br />
SSLProtocol all</p>
<p>See also <a href="http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html" target="_blank">http://httpd.apache.org/docs/2.0/ssl/ssl_howto.html</a></p>
<p><strong>New problem:</strong><br />
sec_error_untrusted_issuer due to self-signed SSL Certificate<br />
But it is no problem for me since this is for my own usage and test&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/howto-enable-ssl-and-create-self-signed-ssl-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set default OS in boot.ini</title>
		<link>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/</link>
		<comments>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:31:42 +0000</pubDate>
		<dc:creator>Van Nhu</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://howto.isgoodness.com/?p=335</guid>
		<description><![CDATA[This is a boot setup for Microsoft Windows XP Professional and Ubuntu (wubi) where we have Windows XP as default and will be preselected on start of computer. This content can be found in c:\boot.ini (be aware this is a hidden system file). &#91;boot loader&#93; timeout=15 default=multi&#40;0&#41;disk&#40;0&#41;rdisk&#40;0&#41;partition&#40;1&#41;\WINDOWS &#160; &#91;operating systems&#93; multi&#40;0&#41;disk&#40;0&#41;rdisk&#40;0&#41;partition&#40;1&#41;\WINDOWS=&#34;Microsoft Windows XP Professional&#34; /fastdetect [...]]]></description>
			<content:encoded><![CDATA[<p>This is a boot setup for Microsoft Windows XP Professional and Ubuntu (<a href="http://en.wikipedia.org/wiki/Wubi_%28Ubuntu_installer%29" target="_blank">wubi</a>) where we have Windows XP as default and will be preselected on start of computer. This content can be found in c:\boot.ini (be aware this is a hidden system file).</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>boot loader<span style="">&#93;</span></span>
<span style="color: #000099;">timeout</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">15</span>
<span style="color: #000099;">default</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>operating systems<span style="">&#93;</span></span>
multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Microsoft Windows XP Professional&quot;</span> /fastdetect /NoExecute<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">OptIn</span>
c:\wubildr.mbr<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Ubuntu&quot;</span></pre></div></div>

<p>If we wish to start with Ubuntu instead we change default operative system as following</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>boot loader<span style="">&#93;</span></span>
<span style="color: #000099;">timeout</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">15</span>
<span style="color: #000099;">default</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">c:\wubildr.mbr</span>
&nbsp;
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>operating systems<span style="">&#93;</span></span>
multi<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>disk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>rdisk<span style="">&#40;</span><span style="">0</span><span style="">&#41;</span>partition<span style="">&#40;</span><span style="">1</span><span style="">&#41;</span>\WINDOWS<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Microsoft Windows XP Professional&quot;</span> /fastdetect /NoExecute<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">OptIn</span>
c:\wubildr.mbr<span style="color: #000066; font-weight:bold;">=</span><span style="color: #933;">&quot;Ubuntu&quot;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://howto.isgoodness.com/2009/11/how-to-set-default-os-in-boot-ini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

