<?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>Experimental Coding, Photography, Blog and Art of Aryo Pinandito / A-Works, Inc &#187; Tutorial</title>
	<atom:link href="http://aryo.info/blog/tag/tutorial/feed" rel="self" type="application/rss+xml" />
	<link>http://aryo.info/blog</link>
	<description>Aryo Pinandito&#039;s Experimental Coding, Photography, Blog, and Art - A-Works, Inc</description>
	<lastBuildDate>Tue, 10 Aug 2010 02:06:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tutorial: MySQL Multiple Update Using Single SQL Query</title>
		<link>http://aryo.info/blog/2010/06/tutorial-mysql-multiple-update-using-single-sql-query.html</link>
		<comments>http://aryo.info/blog/2010/06/tutorial-mysql-multiple-update-using-single-sql-query.html#comments</comments>
		<pubDate>Tue, 15 Jun 2010 07:03:38 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/2010/06/tutorial-mysql-multiple-update-using-single-sql-query.html</guid>
		<description><![CDATA[Ever wanted to do some update on multiple row with different value or on different condition in a single SQL query? With MySQL sure you can do it.
For example, I have the following table:
 
mysql&#62; SELECT * FROM status;
+---------+--------+
&#124; name    &#124; active &#124;
+---------+--------+
&#124; Wendy   &#124; y      &#124;
&#124; Riky    &#124; n      &#124;
&#124; Julia   &#124; n      &#124;
&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to do some update on multiple row with different value or on different condition in a single SQL query? With MySQL sure you can do it.</p>
<p><span id="more-581"></span>For example, I have the following table:</p>
<p><code> </code></p>
<pre>mysql&gt; SELECT * FROM status;
+---------+--------+
| name    | active |
+---------+--------+
| Wendy   | y      |
| Riky    | n      |
| Julia   | n      |
| Andy    | n      |
| Leandra | n      |
+---------+--------+
5 rows in set (0.00 sec)</pre>
<p>In this example, I would like to change the active status of person named ‘Andy’ to ‘y’ and change the rest to ‘n’. By using usual UPDATE clause we could do the above case by using two queries.</p>
<p>&#8211; Update active value to ‘n’ on row which have active value ‘y’<br />
<code>UPDATE status SET active = 'n' WHERE active = 'y'</code></p>
<p>&#8211; Update active value to ‘y’ on row which have name value ‘Andy’<br />
<code>UPDATE status SET active = 'y' WHERE name = 'Andy'</code></p>
<p>We can do the above case by using a single SQL query with CASE clause:</p>
<p><code>UPDATE status SET active = CASE<br />
WHEN name LIKE 'Andy' THEN 'y'<br />
ELSE 'n'<br />
END;</code></p>
<p>By using the above SQL, you will get:</p>
<p><code>mysql&gt; SELECT * FROM status;<br />
+---------+--------+<br />
| name    | active |<br />
+---------+--------+<br />
| Wendy   | n      |<br />
| Riky    | n      |<br />
| Julia   | n      |<br />
| Andy    | y      |<br />
| Leandra | n      |<br />
+---------+--------+<br />
5 rows in set (0.00 sec)</code></p>
<p>Well, that’s it! You can modify the SQL code to suit your needs. Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2010/06/tutorial-mysql-multiple-update-using-single-sql-query.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Easy &#8220;Spoiler&#8221; Show/Hide Element using Javascript</title>
		<link>http://aryo.info/blog/2010/04/tutorial-easy-spoiler-show-hide-element-using-prototypejs.html</link>
		<comments>http://aryo.info/blog/2010/04/tutorial-easy-spoiler-show-hide-element-using-prototypejs.html#comments</comments>
		<pubDate>Wed, 14 Apr 2010 03:12:57 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/?p=571</guid>
		<description><![CDATA[Sometimes we want to hide some content at first page load to reduce bandwidth transferred to the user. Usually when we just want to show the thumbnails of the image and then the original (big) sized image hidden next to it.
We could hide some element by using CSS display property set to &#8220;none&#8221; initially. In [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we want to hide some content at first page load to reduce bandwidth transferred to the user. Usually when we just want to show the thumbnails of the image and then the original (big) sized image hidden next to it.</p>
<p><span id="more-571"></span>We could hide some element by using CSS display property set to &#8220;<code>none</code>&#8221; initially. In the example below, the element &#8220;<code>spoiler</code>&#8221; and it&#8217;s content won&#8217;t shows up on the browser:</p>
<pre>&lt;div id="spoiler" style="display:none"&gt;
  &lt;img src="some-image.jpg" alt="One Big Image" /&gt; Big Image!
&lt;/div&gt;
</pre>
<p>To easily show/hide the element and it&#8217;s content can be done, by executing the following javascript function:</p>
<pre>&lt;script type="text/javascript"&gt;
var show = function() {
  document.getElementById("spoiler").style.display = "block";
}
var hide = function() {
  document.getElementById("spoiler").style.display = "none";
}
&lt;/script&gt;</pre>
<p>To call the javascript function use the following anchor tag:</p>
<pre>&lt;a href="#" onclick="show()"&gt;Show!&lt;/a&gt;
&lt;a href="#" onclick="hide()"&gt;Hide!&lt;/a&gt;
</pre>
<p>Good try!</p>
<p>PS:</p>
<p>Below is the complete html file to test it. Just copy and paste the code to a HTML file.</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
var show = function() {
  document.getElementById("spoiler").style.display = "block";
}
var hide = function() {
  document.getElementById("spoiler").style.display = "none";
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="spoiler" style="display:none"&gt;
 Show me and hide me test!
&lt;/div&gt;
&lt;a href="#" onclick="show()"&gt;Show!&lt;/a&gt; &amp;bull;
&lt;a href="#" onclick="hide()"&gt;Hide!&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2010/04/tutorial-easy-spoiler-show-hide-element-using-prototypejs.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Remove Uneeded Windows Explorer Context Menu Item</title>
		<link>http://aryo.info/blog/2010/02/remove-uneeded-windows-explorer-context-menu-item.html</link>
		<comments>http://aryo.info/blog/2010/02/remove-uneeded-windows-explorer-context-menu-item.html#comments</comments>
		<pubDate>Sun, 14 Feb 2010 14:14:09 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/?p=565</guid>
		<description><![CDATA[Do you recently installing/uninstalling a new program and noticed that the program add some link/shortcut on Explorer context menu that you don&#8217;t like? If the program doesn&#8217;t have a preferences option to remove the context menu, you can remove it manually using Windows registry editor (regedit.exe).

First, make sure you login as an administrator or you [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_499" class="wp-caption alignleft" style="width: 90px"><a href="http://aryo.info/wp-content/uploads/2009/02/windows-logo.jpg"><img class="size-thumbnail wp-image-499" title="windows-logo" src="http://aryo.info/wp-content/uploads/2009/02/windows-logo-150x150.jpg" alt="Windows Logo" width="80" height="80" /></a><p class="wp-caption-text">Windows Logo</p></div>
<p>Do you recently installing/uninstalling a new program and noticed that the program add some link/shortcut on Explorer context menu that you don&#8217;t like? If the program doesn&#8217;t have a preferences option to remove the context menu, you can remove it manually using Windows registry editor (regedit.exe).</p>
<p><span id="more-565"></span></p>
<p>First, make sure you login as an administrator or you have Administrative access to run Windows registry editor (regedit.exe).</p>
<ul>
<li>Start Windows registry editor (regedit.exe) from Start Menu | Run&#8230; and type regedit.exe</li>
<li>Point the registry to:<br />
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers</li>
<li>For example, I would like to remove WinZip from Windows Explorer context menu, right click on WinZip key and choose Delete.<br />
<a href="http://aryo.info/wp-content/uploads/2010/02/Delete-WinZip.gif"><img class="alignnone size-full wp-image-566" title="Delete-WinZip" src="http://aryo.info/wp-content/uploads/2010/02/Delete-WinZip.gif" alt="Delete-WinZip" width="330" height="547" /></a></li>
<li>Confirm it and voila! the WinZip context menu is now disappear from Windows Explorer context menu.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2010/02/remove-uneeded-windows-explorer-context-menu-item.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving DownThemAll File Access Error on Windows 7</title>
		<link>http://aryo.info/blog/2009/10/solving-downthemall-file-access-error-on-windows-7.html</link>
		<comments>http://aryo.info/blog/2009/10/solving-downthemall-file-access-error-on-windows-7.html#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:20:55 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/?p=555</guid>
		<description><![CDATA[If you are using Mozilla Firefox browser on the latest of Microsoft Windows OS, Windows 7, you may encounter File Access Error while downloading files using DownThemAll plugin. I am using Mozilla Firefox v3.5.4 with DownThemAll v1.1.7.

This is not a DownThemAll bug. This problem occur because of User Access Control in Windows 7 that prevent [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://aryo.info/wp-content/uploads/2009/10/firefox_icon2.png"><img class="alignleft size-full wp-image-558" style="padding:0px 10px 10px 0px;" title="Mozilla Firefox" src="http://aryo.info/wp-content/uploads/2009/10/firefox_icon2.png" alt="Mozilla Firefox" width="128" height="128" /></a>If you are using Mozilla Firefox browser on the latest of Microsoft Windows OS, Windows 7, you may encounter File Access Error while downloading files using DownThemAll plugin. I am using Mozilla Firefox v3.5.4 with DownThemAll v1.1.7.</p>
<p><a href="http://aryo.info/wp-content/uploads/2009/10/vbxfaerr.gif"><span id="more-555"></span><img class="alignnone size-full wp-image-562" title="File Access Error" src="http://aryo.info/wp-content/uploads/2009/10/vbxfaerr.gif" alt="File Access Error" width="530" height="92" /></a></p>
<p>This is not a DownThemAll bug. This problem occur because of User Access Control in Windows 7 that prevent creating and/or modifying files (including newly created downloaded files) on some directory without Administrator access.</p>
<p><a href="http://aryo.info/wp-content/uploads/2009/10/ffrunasadmin.gif"><img class="alignleft size-full wp-image-559" style="padding-right:10px;" title="Run Mozilla Firefox as administrator" src="http://aryo.info/wp-content/uploads/2009/10/ffrunasadmin.gif" alt="Run Mozilla Firefox as administrator" width="326" height="228" /></a></p>
<p>To solve this problem, you either need to start the Mozilla Firefox browser as Administrator or disable Microsoft Windows 7 User Access Control (UAC) completely. I prefer the first option, because it is only affect to the browser, not to the entire running application.</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2009/10/solving-downthemall-file-access-error-on-windows-7.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Open With Notepad++ Context Menu on Windows 7</title>
		<link>http://aryo.info/blog/2009/10/open-with-notepad-context-menu.html</link>
		<comments>http://aryo.info/blog/2009/10/open-with-notepad-context-menu.html#comments</comments>
		<pubDate>Tue, 27 Oct 2009 01:48:50 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/?p=550</guid>
		<description><![CDATA[I just installed a fresh copy of Windows 7, and almost all of my  previously installed program on Windows Vista is working perfectly. One of them is Notepad++.
But there&#8217;s one thing missed: there is no Open with Notepad++ option on Windows Explorer context menu when I try to right-clicking on text files. I guess this [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed a fresh copy of Windows 7, and almost all of my  previously installed program on Windows Vista is working perfectly. One of them is Notepad++.</p>
<p>But there&#8217;s one thing missed: there is no Open with Notepad++ option on Windows Explorer context menu when I try to right-clicking on text files. I guess this is a bug from Notepad++. I am using Notepad++ v5.5.1 Unicode.</p>
<p><span id="more-550"></span></p>
<p>Try Googling about this problem and I found one working solution using Registry patch. Just copy and paste the following code to Notepad, save it as patch.reg file, and execute it. Voila!</p>
<p><code>Windows Registry Editor Version 5.00<br />
[HKEY_CLASSES_ROOT\*\shell\Open with Notepad++\command]<br />
@="\"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%1\""</code></p>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2009/10/open-with-notepad-context-menu.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Greedy and Non-Greedy Matching using Perl Regular Expression</title>
		<link>http://aryo.info/blog/2009/06/greedy-and-non-greedy-matching-using-perl-regex.html</link>
		<comments>http://aryo.info/blog/2009/06/greedy-and-non-greedy-matching-using-perl-regex.html#comments</comments>
		<pubDate>Mon, 29 Jun 2009 07:17:40 +0000</pubDate>
		<dc:creator>Aryo Pinandito</dc:creator>
				<category><![CDATA[Experimental]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://aryo.info/blog/?p=547</guid>
		<description><![CDATA[In this article I will show the difference between the default greedy (.+ and .*) and non-greedy matching using Perl-compatible regular expression.
For example, I have a string in a line:
$line= "Seq[03] Command : CREATE("A") Seq[04] Command : CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A") Seq[05] error: 5006 ";
And I could capture [...]]]></description>
			<content:encoded><![CDATA[<p>In this article I will show the difference between the default greedy (.+ and .*) and non-greedy matching using Perl-compatible regular expression.</p>
<p><span id="more-547"></span>For example, I have a string in a line:</p>
<pre>$line= "Seq[03] Command : CREATE("A") Seq[04] Command : CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A") Seq[05] error: 5006 ";</pre>
<p>And I could capture all the Command without the error code using the following regular expression:</p>
<pre>m/Seq\[[0-9]{2}\].+Command.+\(.+\)/gi</pre>
<p>and the Perl code to show all string matching string:</p>
<pre>while( $line =~  m/Seq\[[0-9]{2}\].+Command.+\(.+\)/gi ) {
       print $&amp; . "\n";
}</pre>
<p>But it doesn&#8217;t work as I expected because of the &#8220;greediness&#8221; of .+ and/or .*. The above code will match:</p>
<pre>Seq[03] Command : CREATE("A") Seq[04] Command :
CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A")</pre>
<p>I expect the following output:</p>
<pre>Seq[03] Command : CREATE("A")
Seq[03] Command : CREATE("B")
Seq[03] Command : DELETE("A")</pre>
<p>To get the matching output as I expected, I need to modify the greedines the regular expression to a non-greedy one. How? After .+ and/or .* you need to add a question mark ? so the regular expression is now become:</p>
<pre>m/Seq\[[0-9]{2}\].+?Command.+?\(.+?\)/gi</pre>
<p>The following code is the full Perl code:</p>
<pre>#!/bin/perl
$line= "Seq[03] Command : CREATE("A") Seq[04] Command : CREATE("B") Seq[04] error: 5006 Seq[03] error: 5006 Seq[05] Command : DELETE("A") Seq[05] error: 5006 ";
while( $line =~  m/Seq\[[0-9]{2}\].+?Command.+?\(.+?\)/gi ) {
       print $&amp; . "\n";
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://aryo.info/blog/2009/06/greedy-and-non-greedy-matching-using-perl-regex.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
