<?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>Snippet IT</title>
	<atom:link href="https://www.snippetit.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.snippetit.com</link>
	<description>IT News, Programming, Internet and Blogging</description>
	<lastBuildDate>Wed, 05 Jul 2017 10:53:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
<site xmlns="com-wordpress:feed-additions:1">56773776</site>	<item>
		<title>MD5 and SHA1 Checksum Using Windows</title>
		<link>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-windows/</link>
					<comments>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-windows/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Wed, 05 Jul 2017 10:53:05 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows command]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=766</guid>

					<description><![CDATA[To calculate a MD5 or SHA-1 checksum of a file in Linux, you can use either md5sum or sha1sum, but what about Windows especially when you copy a file from Windows to Linux and want to compare the checksum of both source and destination files. To calculate a MD5 checksum of any file, enter the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>To calculate a <a href="http://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-linux/">MD5 or SHA-1 checksum of a file in Linux</a>, you can use either md5sum or sha1sum, but what about Windows especially when you copy a file from Windows to Linux and want to compare the checksum of both source and destination files.</p>
<p>To calculate a MD5 checksum of any file, enter the following command at the Windows command prompt:<br />
<code>certUtil -hashfile &lt;file_to_check&gt; MD5</code></p>
<p>To calculate a SHA-1 checksum of any file, enter the following command at the Windows command prompt:<br />
<code>certUtil -hashfile &lt;file_to_check&gt; SHA1</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">766</post-id>	</item>
		<item>
		<title>MD5 and SHA1 Checksum Using Linux</title>
		<link>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-linux/</link>
					<comments>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-linux/#comments</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Wed, 05 Jul 2017 10:37:33 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux command]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=764</guid>

					<description><![CDATA[A file checksum is useful when you want to verify the content of a file are same as the content you copied or downloaded somewhere. Basically it calculate and summarise every bits of the file into a small integer value. To verify content of the file are same as the source, simply do a checksum [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A file checksum is useful when you want to verify the content of a file are same as the content you copied or downloaded somewhere. Basically it calculate and summarise every bits of the file into a small integer value. To verify content of the file are same as the source, simply do a checksum of the source and destination file, and compare the checksum value.</p>
<p>To calculate a MD5 checksum of any file, enter the following command at the Linux prompt:<br />
<code>md5sum &lt;file_to_check&gt;</code></p>
<p>To calculate a SHA-1 checksum of any file, enter the following command at the Linux prompt:<br />
<code>sha1sum &lt;file_to_check&gt;</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2017/07/md5-and-sha1-checksum-using-linux/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">764</post-id>	</item>
		<item>
		<title>Java: Unlimited Strength Jurisdiction Policy</title>
		<link>https://www.snippetit.com/2015/09/java-unlimited-strength-jurisdiction-policy/</link>
					<comments>https://www.snippetit.com/2015/09/java-unlimited-strength-jurisdiction-policy/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Mon, 28 Sep 2015 11:20:25 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Exception]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=639</guid>

					<description><![CDATA[You are writing a Java program to encrypt or de-crypt some data with strong encryption keys but you got an error saying InvalidKeyException: Illegal key size or default parameters. You double checked and triple checked your code and everything seems to be correct but you still get the same exception every time you run your program. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://www.snippetit.com/wp-content/uploads/2015/09/Java.jpg"><img fetchpriority="high" decoding="async" class="alignleft wp-image-611 size-medium" src="http://www.snippetit.com/wp-content/uploads/2015/09/Java-300x225.jpg" alt="Java" width="300" height="225" srcset="https://www.snippetit.com/wp-content/uploads/2015/09/Java-300x225.jpg 300w, https://www.snippetit.com/wp-content/uploads/2015/09/Java.jpg 1024w" sizes="(max-width: 300px) 100vw, 300px" /></a><br />
You are writing a Java program to encrypt or de-crypt some data with strong encryption keys but you got an error saying <code>InvalidKeyException: Illegal key size or default parameters</code>. You double checked and triple checked your code and everything seems to be correct but you still get the same exception every time you run your program.</p>
<p>You are probably doing nothing wrong but hit an arbitrary restriction imposed by JDK with default settings. The restriction turns out that the cryptography classes in Java will not allow encryption with a key size of more than 128 bits. The main reason for the restriction is that some countries have restrictions on the permitted key strength of imported encryption software. So, it is the user&#8217;s responsibility to verify that this action is permissible under local regulations.</p>
<h2>Download JCE Unlimited Strength Jurisdiction Policy Files</h2>
<p>If you really need to override the restriction (for example you need to use AES with 256-bit keys), you need download the JCE Unlimited Strength Jurisdiction Policy Files from Java and install the files into your JDK/JRE folder.</p>
<ul>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html" target="_blank">JCE Unlimited Strength Jurisdiction Policy Files for Java 6</a></li>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html" target="_blank">JCE Unlimited Strength Jurisdiction Policy Files for Java 7</a></li>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html" target="_blank">JCE Unlimited Strength Jurisdiction Policy Files for Java 8</a></li>
</ul>
<h2>Steps to install the JCE Unlimited Strength Jurisdiction Policy Files</h2>
<ol>
<li>Backup the files in <code>${java.home}/jre/lib/security/</code> in case the downloaded file does not work.</li>
<li>Download the JCE Unlimited Strength Jurisdiction Policy according to you Java version.</li>
<li>Decompress the zip file.</li>
<li>Replace all the files in <code>${java.home}/jre/lib/security/</code> with the new decompressed files.</li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2015/09/java-unlimited-strength-jurisdiction-policy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">639</post-id>	</item>
		<item>
		<title>WordPress: How To Change Admin Username</title>
		<link>https://www.snippetit.com/2015/09/wordpress-how-to-change-admin-username/</link>
					<comments>https://www.snippetit.com/2015/09/wordpress-how-to-change-admin-username/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Wed, 23 Sep 2015 15:53:22 +0000</pubDate>
				<category><![CDATA[New and Happening]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=626</guid>

					<description><![CDATA[By changing the default administrator username of your WordPress login can be a great security measure to help prevent unauthorized access to your WordPress admin dashboard. Your WordPress site is at risk if you are still using the default username admin. Attackers, either a human being or a robot can use the username to attempt [&#8230;]]]></description>
										<content:encoded><![CDATA[<figure id="attachment_628" aria-describedby="caption-attachment-628" style="width: 346px" class="wp-caption alignleft"><a href="http://www.snippetit.com/wp-content/uploads/2015/09/Wordpress_Login.png"><img decoding="async" class="size-full wp-image-628" src="http://www.snippetit.com/wp-content/uploads/2015/09/Wordpress_Login.png" alt="Wordpress Login" width="346" height="391" srcset="https://www.snippetit.com/wp-content/uploads/2015/09/Wordpress_Login.png 346w, https://www.snippetit.com/wp-content/uploads/2015/09/Wordpress_Login-265x300.png 265w" sizes="(max-width: 346px) 100vw, 346px" /></a><figcaption id="caption-attachment-628" class="wp-caption-text">WordPress Login</figcaption></figure>
<p>By changing the default administrator username of your WordPress login can be a great security measure to help prevent unauthorized access to your WordPress admin dashboard. Your WordPress site is at risk if you are still using the default username <code>admin</code>. Attackers, either a human being or a robot can use the username to attempt log into your WordPress dashboard.</p>
<p>It is always good practice to use an username that is meaningful but difficult to be guessed by the other. You should always avoid using usernames like <code>admin</code>, <code>administrator</code> or using username from your domain name directly.</p>
<p>The old WordPress installation used the username <code>admin</code> by default. WordPress sites upgraded from older version should change the default administrator username. While the new WordPress installation will prompt user to enter a new username for the administrator. So be wise to choose a good username.</p>
<p>The following steps show how to change your username without installing any plugin or needing of access to the database:</p>
<ol>
<li>Login to your WordPress site using your current administrator account.</li>
<li>Hover over the &#8220;Users&#8221; link on the menu on the left, then click &#8220;Your Profile&#8221;.</li>
<li>Change your email address to other email address (any will do). Save changes by clicking the &#8220;Update Profile&#8221; button. This step is <span style="color: #ff0000;">important</span> if you want to reuse your email address for your new administrator account.</li>
<li>Hover over the &#8220;Users&#8221; link on the menu on the left, then click &#8220;Add New&#8221;.</li>
<li>Key in all the required field. You can use the email previously set for the current Administrator.</li>
<li>Be sure to choose &#8220;Administrator&#8221; for the role.</li>
<li>Click &#8220;Add New User&#8221; to save the changes.</li>
<li>Logout current user and login into the new user you have created just now.</li>
<li>Hover over the &#8220;Users&#8221; link on the menu on the left, then click &#8220;All Users&#8221;.</li>
<li>Hover over the old <code>admin</code> user, then click &#8220;Delete&#8221;. Make sure you select your new admin user from the &#8220;Attribute all posts&#8221; drop-down, and click on &#8220;Confirm Deletion&#8221; (<span style="color: #ff0000;">Important!</span>).</li>
<li>Done.</li>
</ol>
<p>Your WordPress site is now better protected against common brute force attempts.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2015/09/wordpress-how-to-change-admin-username/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">626</post-id>	</item>
		<item>
		<title>Linux: How To Compress And Decompress Folders And Files</title>
		<link>https://www.snippetit.com/2015/09/linux-how-to-compress-and-decompress-folders-and-files/</link>
					<comments>https://www.snippetit.com/2015/09/linux-how-to-compress-and-decompress-folders-and-files/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Tue, 15 Sep 2015 16:29:03 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=613</guid>

					<description><![CDATA[Sometime, you may want to compress all files in a folder (or folders) in Linux into a single file to save space and so that you can back up the file to other media. In Linux, you can use the tar utilities which is installed in most Linux distribution by default. GNU &#8216;tar&#8217; saves many [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" class="aligncenter wp-image-610 size-full" src="http://www.snippetit.com/wp-content/uploads/2015/09/Linux-1.jpg" alt="Linux" width="750" height="870" srcset="https://www.snippetit.com/wp-content/uploads/2015/09/Linux-1.jpg 750w, https://www.snippetit.com/wp-content/uploads/2015/09/Linux-1-259x300.jpg 259w" sizes="(max-width: 750px) 100vw, 750px" /></p>
<p>Sometime, you may want to compress all files in a folder (or folders) in Linux into a single file to save space and so that you can back up the file to other media. In Linux, you can use the <code>tar</code> utilities which is installed in most Linux distribution by default.</p>
<blockquote><p>GNU &#8216;tar&#8217; saves many files together into a single tape or disk archive, and can restore individual files from the archive.</p></blockquote>
<p>What the utility does is actually it creates an archive of the specified files and then compress the archive. Creating an archive of files is like dumping all the files content into a single file and some dictionary data (name and size of each file) so that you can extract files from the archive later on.</p>
<h2>How to compress files and folders</h2>
<p>To compress files and folders into a single file:</p>
<p>[bash title=&#8221;Syntax:&#8221;]tar -czvf output-file input-folders-or-files[/bash]</p>
<p>where</p>
<ul>
<li>c &#8211; create a new archive</li>
<li>z &#8211; <span class="s1">filter the archive through g</span><span class="s2">z</span><span class="s1">ip</span></li>
<li>v &#8211; verbosely list files processed</li>
<li>f &#8211; use archive file</li>
<li><em>output-file</em> &#8211; the output file</li>
<li><em>input-folders-or-file</em> &#8211; multiple input folders or files</li>
</ul>
<p>For example, to create a compressed archive file from the /home/user1 and /home/user2 folder:</p>
<p>[bash title=&#8221;Example:&#8221;]tar -czvf backup.tar.gz&amp;nbsp;/home/user1 /home/user2[/bash]</p>
<p>It is a good practice to put the output file name with tar.gz extension so that we know that the file is created from the <code>tar</code> utility and it is compressed.</p>
<h2>How to decompress and extract files and folders from a compressed tar archive</h2>
<p>To decompress files and folders from a compressed tar archive:</p>
<p>[bash title=&#8221;Syntax:&#8221;]tar -xzvf input-file[/bash]</p>
<p>where</p>
<ul>
<li>x &#8211; extract files from an archive</li>
<li>z &#8211; filter the archive through gzip</li>
<li>v &#8211; verbosely list files processed</li>
<li>f &#8211; use archive file</li>
<li><em>input-file</em> &#8211; the compressed archive file</li>
</ul>
<p>For example, to decompress and extract files from an compressed archive file:</p>
<p>[bash title=&#8221;Example:&#8221;]tar -xzvf backup.tar.gz /home/user1 /home/user2[/bash]</p>
<p><code>tar</code> has many other options and uses as well. Do reading through its man page for more options.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2015/09/linux-how-to-compress-and-decompress-folders-and-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">613</post-id>	</item>
		<item>
		<title>eGenting Programming Competion 2015 And Tips</title>
		<link>https://www.snippetit.com/2015/09/egenting-programming-competion-2015-and-tips/</link>
					<comments>https://www.snippetit.com/2015/09/egenting-programming-competion-2015-and-tips/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Tue, 08 Sep 2015 11:26:06 +0000</pubDate>
				<category><![CDATA[New and Happening]]></category>
		<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[EGPC]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=542</guid>

					<description><![CDATA[eGenting Programming Competition 2015 is coming this November and it is now open for registration. The layout or the format of the competition is remain unchanged except that eGenting Sdn Bhd is also having another competition &#8211; eGenting Bug Hunt &#8211; on next day of the eGenting Programming Competition. What is eGenting Programming Competition The [&#8230;]]]></description>
										<content:encoded><![CDATA[<figure id="attachment_541" aria-describedby="caption-attachment-541" style="width: 720px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="size-full wp-image-541" src="http://www.snippetit.com/wp-content/uploads/2015/09/EGPC2015.jpg" alt="E-Genting Programming Competition 2015" width="720" height="193" srcset="https://www.snippetit.com/wp-content/uploads/2015/09/EGPC2015.jpg 720w, https://www.snippetit.com/wp-content/uploads/2015/09/EGPC2015-300x80.jpg 300w" sizes="auto, (max-width: 720px) 100vw, 720px" /><figcaption id="caption-attachment-541" class="wp-caption-text">eGenting Programming Competition 2015</figcaption></figure>
<p>eGenting Programming Competition 2015 is coming this November and it is now open for registration. The layout or the format of the competition is remain unchanged except that eGenting Sdn Bhd is also having another competition &#8211; <a href="http://www.snippetit.com/2015/09/egenting-bug-hunt-2015-and-tips/">eGenting Bug Hunt</a> &#8211; on next day of the eGenting Programming Competition.</p>
<h2>What is eGenting Programming Competition</h2>
<blockquote><p>The E-Genting Programming Competition is an annual programming competition organised by E-Genting to hire programming talent for its Systems Research &amp; Development department, which maintains the backbone system used by Genting casinos all over the world.</p></blockquote>
<h2>Tips for eGenting Programming Competition 2015</h2>
<p>No tips on the questions but these are the basic things you should know:</p>
<ul>
<li>Get familiar with at least two programming languages.</li>
<li>Get familiar with SQL and DBMS, be it embedded or not.</li>
<li>Get a deep understanding in data structure and algorithms like array, queue, set, stack, map, trees, object, sorting, searching and data parsing.</li>
<li>Only bring the book you really need and you may consider to share books with your friends.</li>
<li>Plan your time and code. Try modularize your code, it may help you save time on rewriting same portion of code at different places.</li>
<li>Bring your jacket. The competition hall is cold.</li>
<li>Do check back and try out <a href="http://egpc.genting.com.my/Events.aspx" target="_blank">past year questions</a>.</li>
</ul>
<h2>Details of eGenting Programming Competition 2015</h2>
<h3>Date And Time Of The Competition</h3>
<ul>
<li>Date: 14 November 2015 (Saturday)</li>
<li>Time: 10:00 AM to 6:00 PM</li>
</ul>
<h3>Contact</h3>
<ul>
<li>Tel: +603 2333 3276</li>
<li>Email: <a class="email" href="mailto:cheeleng.tan@rwgenting.com">cheeleng.tan@rwgenting.com</a></li>
</ul>
<h3>Address</h3>
<blockquote><p>Auditorium, 25th Floor Wisma Genting, Jalan Sultan Ismail, 50250 Kuala Lumpur, Malaysia.</p></blockquote>
<h3>Map Location</h3>
<p><iframe loading="lazy" style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d7967.576659068354!2d101.710843!3d3.150461!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x5efd37db95d107fb!2sWisma+Genting!5e0!3m2!1sen!2smy!4v1440070324430" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<h3>Competition Style</h3>
<blockquote><p>The competition is an open-book hand-written programming competition. You will be given a question paper with four different specifications. You are required to design and write a program to ensure that it satisfies the requirements or to solve the problems described in the specification. You are not required to answer all the questions.</p></blockquote>
<h3>Meals</h3>
<blockquote><p>Breakfast, lunch and tea break will be provided during the competition.</p></blockquote>
<h3>Prizes</h3>
<ul>
<li>First prize &#8211; RM6,000 + *Job Offer</li>
<li>Second prize &#8211; RM3,000 + *Job Offer</li>
<li>Third prize &#8211; RM2,000 + *Job Offer</li>
<li>Distinction &#8211; RM500 + *Job Offer (Multiple prizes)</li>
<li>Merit &#8211; RM200 + *Job Offer (Multiple prizes)</li>
</ul>
<p>* Subject to terms and conditions</p>
<h3>Registration</h3>
<p><a href="http://egpc.genting.com.my/Registration.aspx" target="_blank">http://egpc.genting.com.my/Registration.aspx</a></p>
<h3>Terms and Conditions</h3>
<p><a href="http://egpc.genting.com.my/Terms.aspx" target="_blank">http://egpc.genting.com.my/Terms.aspx</a></p>
<h3>eGenting Bug Hunt Facebook Page</h3>
<p><a href="https://www.facebook.com/egentingpc" target="_blank">https://www.facebook.com/egentingpc</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2015/09/egenting-programming-competion-2015-and-tips/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">542</post-id>	</item>
		<item>
		<title>eGenting Bug Hunt 2015 And Tips</title>
		<link>https://www.snippetit.com/2015/09/egenting-bug-hunt-2015-and-tips/</link>
					<comments>https://www.snippetit.com/2015/09/egenting-bug-hunt-2015-and-tips/#comments</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Thu, 03 Sep 2015 10:17:27 +0000</pubDate>
				<category><![CDATA[New and Happening]]></category>
		<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[EGBH]]></category>
		<category><![CDATA[software testing]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=524</guid>

					<description><![CDATA[eGenting Bug Hunt 2015 is coming this November and the registration is now open.  This will be the third year the company organizing the annual event and it will be different from the past few years. What is eGenting Bug Hunt? The eGENTING Bug Hunt is an annual software testing competition organized by eGenting Sdn [&#8230;]]]></description>
										<content:encoded><![CDATA[<figure id="attachment_534" aria-describedby="caption-attachment-534" style="width: 900px" class="wp-caption aligncenter"><img loading="lazy" decoding="async" class="wp-image-534 size-full" src="http://www.snippetit.com/wp-content/uploads/2015/08/EGBH2015.jpg" alt="E-Genting Bug Hunt 2015" width="900" height="316" srcset="https://www.snippetit.com/wp-content/uploads/2015/08/EGBH2015.jpg 900w, https://www.snippetit.com/wp-content/uploads/2015/08/EGBH2015-300x105.jpg 300w" sizes="auto, (max-width: 900px) 100vw, 900px" /><figcaption id="caption-attachment-534" class="wp-caption-text">E-Genting Bug Hunt 2015</figcaption></figure>
<p>eGenting Bug Hunt 2015 is coming this November and the registration is now open.  This will be the third year the company organizing the annual event and it will be different from the past few years.</p>
<p><span id="more-524"></span></p>
<h1>What is eGenting Bug Hunt?</h1>
<p>The eGENTING Bug Hunt is an annual software testing competition organized by eGenting Sdn Bhd to hire the best software quality assurance engineers. Contestants will be given a software specification and a software source code that theoretically confirms to the specification. Contestants are required to return a test procedures that can be used to test the software given and to detect potential bugs at the end of the competition.</p>
<h2>How this year&#8217;s competition different from the past?</h2>
<p>In the past competitions, there were two round of tests. In the first round, contestants are given a specification and a software program source code that theoretically conforms to the specification. Contestants are required to return a test procedures, a test results and optionally the corrected source code within 3 days via email. Contestants that return credible answer will be selected into second round. In the second round, contestants are invited to run the similar test at Wisma Genting with a computer provided.</p>
<p>eGenting Bug Hunt 2015 will be different. It is a full day, single round single shot competition. The competition will start at 10am in the morning and end 6pm in the evening. In line with the eGenting Programming Competition, it is a hand-writing and open books competition, therefore no computer will be provided. No electronic device is allowed during the competition. The competition will be held at the Wisma Genting&#8217;s auditorium.</p>
<h2>Tips for eGenting Bug Hunt 2015?</h2>
<p>Ok, you want some tips. These are some that I could think of:</p>
<ol>
<li>Read the specification a few time. Just ask if you have any doubt.</li>
<li>Plan your time. Do not spend too much time on fixing the bug. Focus on preparing a quality test plans.</li>
<li>Get yourself familiar with the following programming languages:
<ul>
<li>SQL</li>
<li>C/C++</li>
<li>Java</li>
</ul>
</li>
<li>Your test procedures should contain test cases that cover the given specification as much as possible.</li>
<li>Testing methods that are important:
<ul>
<li>White box</li>
<li>Black box</li>
</ul>
</li>
<li>Don&#8217;t bring a trolley to carry your books. Believe me, you may not have much time to study in the hall. Two to three of reference books should be more than enough. You can consider to share books with your friends too.</li>
<li>Bring your jacket. Your brain may not function optimally if it is too cold in the hall.</li>
<li>Read more tips from the <a href="http://egbh.rwgenting.com/2015/WorkshopSlides2015.ppsx" target="_blank">eGenting Bug Hunt Workshoup</a> held in Wisma Genting on 19th August 2015.</li>
</ol>
<h2>Details of eGenting Bug Hunt 2015</h2>
<h3>Date And Time Of The Competition</h3>
<ul>
<li>Date: 15 November 2015 (Sunday)</li>
<li>Time: 10:00 AM to 6:00 PM</li>
</ul>
<h3>Contact</h3>
<ul>
<li>Tel: +603 2333 3276</li>
<li>Email: <a class="email" href="mailto:cheeleng.tan@rwgenting.com">cheeleng.tan@rwgenting.com</a></li>
</ul>
<h3>Address</h3>
<blockquote><p>Auditorium, 25th Floor Wisma Genting, Jalan Sultan Ismail, 50250 Kuala Lumpur, Malaysia.</p></blockquote>
<h3>Map Location</h3>
<p><iframe loading="lazy" style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d7967.576659068354!2d101.710843!3d3.150461!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x5efd37db95d107fb!2sWisma+Genting!5e0!3m2!1sen!2smy!4v1440070324430" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<h3>Competition Style</h3>
<blockquote><p>The competition is an open-book hand-written testing procedure design competition. You will be given a specification and C++/Java source code for a program that theoretically conforms to the specification. You are required to design and document testing procedures that verify the program to ensure that it satisfies the requirements described in the specification.</p></blockquote>
<h3>Meals</h3>
<blockquote><p>Breakfast, lunch and tea break will be provided during the competition.</p></blockquote>
<h3>Prizes</h3>
<ul>
<li>First prize &#8211; RM6,000 + *Job Offer</li>
<li>Second prize &#8211; RM3,000 + *Job Offer</li>
<li>Third prize &#8211; RM2,000 + *Job Offer</li>
<li>Distinction &#8211; RM500 (Multiple prizes)</li>
<li>Merit &#8211; RM200 (Multiple prizes)</li>
</ul>
<p>* Subject to terms and conditions</p>
<h3>Registration</h3>
<p><a href="http://egbh.rwgenting.com/Registration.aspx" target="_blank">http://egbh.rwgenting.com/Registration.aspx</a></p>
<h3>Terms and Conditions</h3>
<p><a href="http://egbh.rwgenting.com/Terms.aspx" target="_blank">http://egbh.rwgenting.com/Terms.aspx</a></p>
<h3>eGenting Bug Hunt Facebook Page</h3>
<p><a href="https://www.facebook.com/egentingbh" target="_blank">https://www.facebook.com/egentingbh</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2015/09/egenting-bug-hunt-2015-and-tips/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">524</post-id>	</item>
		<item>
		<title>eGenting Programming Competition 2014 &#8211; Presentation Of Prizes And Awards</title>
		<link>https://www.snippetit.com/2014/12/egenting-programming-competition-2014-presentation-of-prizes-and-awards/</link>
					<comments>https://www.snippetit.com/2014/12/egenting-programming-competition-2014-presentation-of-prizes-and-awards/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Fri, 26 Dec 2014 04:28:40 +0000</pubDate>
				<category><![CDATA[New and Happening]]></category>
		<category><![CDATA[bug hunt]]></category>
		<category><![CDATA[EGBH]]></category>
		<category><![CDATA[EGPC]]></category>
		<category><![CDATA[programming competition]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=519</guid>

					<description><![CDATA[eGenting Programming Competition 2014 is over and the result is out!. It is time to have the presentation of prizes and awards. This year, two events are held together &#8211; eGenting Programming Competition Prize Presentation and eGenting Bug Hunt Prize Presentation. All contestants are cordially invited to EGPC and EGBH Prize Presentation Date: Saturday, 31 January 2015 Venue: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>eGenting Programming Competition 2014 is over and the result is out!. It is time to have the presentation of prizes and awards. This year, two events are held together &#8211; eGenting Programming Competition Prize Presentation and eGenting Bug Hunt Prize Presentation.</p>
<p><img loading="lazy" decoding="async" class=" aligncenter" src="https://farm9.staticflickr.com/8592/16106064351_f2d915d6db_z.jpg" alt="EGPC2014" width="640" height="360" /></p>
<p>All contestants are cordially invited to EGPC and EGBH Prize Presentation</p>
<blockquote><p>Date: Saturday, 31 January 2015<br />
Venue: Hard Rock Café, Ground Floor, Wisma Concorde, No 2 Jalan Sultan Ismail, 50250 Kuala Lumpur<br />
Time: 11.15am – 3.00pm</p></blockquote>
<ul>
<li>11.15am Arrival of guests</li>
<li>12.00noon Welcome Speech &amp; Competition Debriefing</li>
<li>12.30pm Lunch</li>
<li>1.30pm Presentation of Prizes and Awards</li>
<li>3.00pm End</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2014/12/egenting-programming-competition-2014-presentation-of-prizes-and-awards/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">519</post-id>	</item>
		<item>
		<title>Java: Static Initializer (Static Constructor)</title>
		<link>https://www.snippetit.com/2014/02/java-static-initializer-static-constructor/</link>
					<comments>https://www.snippetit.com/2014/02/java-static-initializer-static-constructor/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Mon, 10 Feb 2014 10:44:18 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[static constructor]]></category>
		<category><![CDATA[static initializer]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=494</guid>

					<description><![CDATA[Many Java programmers, including my self, might have mistaken that the portion of code that initializes the static variables of a class called the static constructor. Why Not A Java Static Constructor? It is actually not a constructor that initializes the static variables&#8217; value. This is because static variables do not need to and can [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Many Java programmers, including <a title="Java Static Constructor" href="http://www.snippetit.com/2009/05/java-static-variables-static-methods-and-static-constructor/">my self</a>, might have mistaken that the portion of code that initializes the static variables of a class called the <strong>static constructor</strong>.</p>
<h2>Why Not A Java Static Constructor?</h2>
<p>It is actually not a constructor that initializes the static variables&#8217; value. This is because static variables do not need to and can not be constructed as they are being shared among the instances (object) of the class. The static variables just need to be initialized when the class is first accessed by any code by the Java runtime.</p>
<h2>What Is Static Initialization Block?</h2>
<p>In Java, it is called &#8220;static initialization block&#8221;:</p>
<blockquote><p>A static initialization block is a normal block of code enclosed in braces, { }, and preceded by the static keyword. A class can have any number of static initialization blocks, and they can appear anywhere in the class body. The runtime system guarantees that static initialization blocks are called in the order that they appear in the source code.</p></blockquote>
<p>Alternatively, you can write a private static method that return values to the static variables. The advantage of private static methods is that they can be reused later if you need to reinitialize the class variable.</p>
<h2>Things To Take Note</h2>
<p>Static initialization blocks are called in the order that they appear in the source code. You must be careful not to access to the variables that have not been initialized in the static initialization blocks. If you do so, you may encounter a <code>NullPointerException</code> during runtime. It is always painful and time wasting to trace this kind of exception.</p>
<p>[java]public class Example1 {<br />
  static Obj obj1;<br />
  static Obj obj2;<br />
  static Obj obj3;<br />
  static {<br />
    // First call<br />
    obj1 = new Obj();</p>
<p>    obj2.something() // This will throw NullPointerException<br />
  }<br />
  static {<br />
    // Second call<br />
    obj2 = new Obj();<br />
  }<br />
  static {<br />
    // Third call<br />
    obj3 = new Obj();<br />
  }<br />
}[/java]</p>
<p>Secondly, the alternative to static blocks, the private static method, are called in the sequence of the static variables being written in the source code.</p>
<p>[java]public class Example2 {<br />
  static Obj obj1 = initObj1();<br />
  static Obj obj2 = initObj2();<br />
  static Obj obj3 = initObj3();;<br />
  private static Obj initObj3() {<br />
    // Third call<br />
  }<br />
  private static Obj initObj2() {<br />
    // Second call<br />
  }<br />
  private static Obj initObj1() {<br />
    // First call<br />
  }<br />
}[/java]</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2014/02/java-static-initializer-static-constructor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">494</post-id>	</item>
		<item>
		<title>Java: How To Select Top N Objects From A List</title>
		<link>https://www.snippetit.com/2014/02/java-how-to-select-top-n-objects-from-a-list/</link>
					<comments>https://www.snippetit.com/2014/02/java-how-to-select-top-n-objects-from-a-list/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Wed, 05 Feb 2014 16:48:04 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[performance]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=476</guid>

					<description><![CDATA[There are several ways to select top N objects from A list in the order of multiple data members of an object. For example, you may select top 10 players (top scores) from a list ordered by the players&#8217; score_1, score_2 and then score_3. The Simplest Way But Ineffective The simplest way to pick the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>There are several ways to select top N objects from A list in the order of multiple data members of an object. For example, you may select top 10 players (top scores) from a list ordered by the players&#8217; score_1, score_2 and then score_3.</p>
<h1>The Simplest Way But Ineffective</h1>
<p>The simplest way to pick the top N elements is to sort the whole list and get the top N elements. This method is easy to understand and implement but the overhead is too high. It might take a lot of memory or temporary disk resource if the list is big (especially if you need to load all the data from a file or you simple cannot use the normal SQL sorting method to sort the data) and it will takes lot of comparison during sorting. When the list size goes big, the side effect on performance becomes greater too.</p>
<h1>The More Effective Way</h1>
<p>The more effective way does not necessary always complicated. You can simply use the fixed-size <a href="http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html" target="_blank"><code>PriorityQueue</code></a> in <code>java.util</code> package to achieve the same result but with much better performance. <code>PriorityQueue</code> is based on priority heap and the elements in <code>PriorityQueue</code> are ordered according to their natural ordering.</p>
<p><code>PriorityQueue</code> provides <code>O(log(n))</code> time for the enqueing and dequeing methods. To make the elements ordered in natural ordering, you need to make sure the element&#8217;s class implements the <code>Comparable</code> interface or provide a appropriate  <code>Comparator</code> instance for the elements.</p>
<p>Below is an example on how to use <code>PriorityQueue</code> to get Top N objects from a list (either loaded from file or database):</p>
<pre>public class TopList {
  private T[] tlArray;
  private Comparator tlComparator;
  private PriorityQueue tlHeapSort;

  public TopList(T[] array, Comparator comparator) {
    tlArray = array;
    tlComparator = comparator;
    tlHeapSort = new PriorityQueue(array.length, comparator);
  }

  public void put(T item) {
    if (tlHeapSort.size() &lt; tlArray.length) {
      tlHeapSort.add(item);
    }
    else if (tlComparator.compare(tlHeapSort.peek(), item) &lt; 0) {
      tlHeapSort.poll();
      tlHeapSort.add(item);
    }
  }

  public void finish() {
    int                 i;              // Index

    for (i = tlHeapSort.size() - 1; i &gt;=0 ; i--) {
      tlArray[i] = tlHeapSort.poll();
    }
  }
}

public class Player {
  int score_1;
  int score_2;
  int score_3;
  String name;
}

public static void main (String args[]) {
  Comparator comparator;
  Player[] topPlayers;
  TopList topList;
  Player p;

  topPlayers = new Player[10];
  comparator = new Comparator() {
    @Override
    public int compare(Player o1, Player o2) {
      int diff1, diff2, diff3;

      diff1 = o1.score_1 - o2.score_1;
      if (diff1 != 0) return diff1;
      diff2 = o1.score_2 - o2.score_2;
      if (diff2 != 0) return diff2;
      diff3 = o1.score_3 - o2.score_3;
      if (diff3 != 0) return diff3;
      return 0;
    }
  }
  topList = new TopList(topPlayers, comparator);

  // Load from files or database
  while (/* has records */) {
    p = /* Load a player instance */;
    topList.put(p);
  }
  topList.finish();

  // Print the top winners
  System.out.printf ("TOP PLAYERS\n");
  for (int i = 0; i &lt; topPlayers.length; i++) {
    p = topPlayers[i];
    if (p == null) break;
    System.out.printf ("%d %s (%d, %d, %d)\n", 
      i + 1, p.name, p.score_1, p.score_2, p.score_3);
  }
}</pre>
<p>With this implementation, it will not burden your memory and CPU usage, even you have to select only 10 elements out of millions data.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2014/02/java-how-to-select-top-n-objects-from-a-list/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">476</post-id>	</item>
		<item>
		<title>WordPress: Transfer Your Blogs To Another Hosting With Minimum Downtime</title>
		<link>https://www.snippetit.com/2014/02/wordpress-transfer-your-blogs-to-another-hosting-with-minimum-downtime/</link>
					<comments>https://www.snippetit.com/2014/02/wordpress-transfer-your-blogs-to-another-hosting-with-minimum-downtime/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Mon, 03 Feb 2014 14:38:58 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=471</guid>

					<description><![CDATA[I have recently moved all my websites, including WordPress blogs, to a new VPS hosting, a SSD Cloud Hosting at DigitalOcean. It is important to keep my blogs up all the time as they are the money cows that keep generating incomes. If there are down for a few days due to the process transferring, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I have recently moved all my websites, including WordPress blogs, to a new VPS hosting, a <a href="http://www.szehau.com/archives/2013/08/new-ssd-cloud-hosting-digitalocean/" target="_blank">SSD Cloud Hosting</a> at <a href="http://goo.gl/pu2hYL">DigitalOcean</a>. It is important to keep my blogs up all the time as they are the money cows that keep generating incomes. If there are down for a few days due to the process transferring, I may have lost some earning as well as search engine crawlers might think my sites are no longer active.</p>
<p>To prevent that from happen, I have made up a plan before I transfer all my websites from my previous hosting to <a href="http://goo.gl/pu2hYL">DigitalOcean</a>.</p>
<h1>Get New Hosting Account Ready</h1>
<p>Before moving your websites to another web hosting, register and get the new hosting account ready. The new account need to be ready a few weeks before your previous web hosting&#8217;s contract end. Login in to your new hosting account and try to setup a new website and check the accessibility.</p>
<p>Make sure the new hosting computer has all the software you need to run your websites. If you are using a VPS or dedicated hosting, make sure you have install the latest software supported by the WordPress (if you are running WordPress blogs).</p>
<p>Setup all the user accounts, emails, and database as they were in the old hosting computer.</p>
<h1>Transfer Your Websites Files</h1>
<p>Backup your websites, including the database backup. Restore websites and database backup at new hosting. You need to do this before changing the name server of your domain name. Test your websites using IP address at your new hosting computer. Make sure they are working properly. Click on links on your page to make sure your websites load correctly.</p>
<h1>Install Web Analytics</h1>
<p>Install a web analytics on your websites at both old and new hosting, <a href="http://www.google.com/analytics/" target="_blank">Google Analytics</a> or <a href="http://statcounter.com/" target="_blank">Statcounter</a> are pretty good. Optionally you can use the web analytics that comes with your hosting package. This is to track whether your visitors are visiting your old or new websites.</p>
<h1>Change Name Server</h1>
<p>Change the name server of your domain name at your domain name registrar. Changing a name server  can typically take 0 to 24 hours to take effect but it may take days to go into full effect.</p>
<h1>Monitor</h1>
<p>Try access to your websites using domain name after the name server has been resolved. Use the &#8220;ping&#8221; utility on your computer to ping to the domain name to check that you are on the right server.</p>
<p>Monitor the web analytic. Since you are now having websites running at both old and new hosting computer, your visitors will slowly moving from your old hosting to the new hosting. The transition might take days or weeks. Until you don&#8217;t receive any traffic from your old hosting company, that means your name server is fully resolved. And now you can terminate your old hosting service.</p>
<p>Now you will have minimum down time as the old hosting and new hosting are serving your visitors during this transition period.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2014/02/wordpress-transfer-your-blogs-to-another-hosting-with-minimum-downtime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">471</post-id>	</item>
		<item>
		<title>Java: How To Implement ungetc in Java</title>
		<link>https://www.snippetit.com/2013/12/java-how-to-implement-ungetc-in-java/</link>
					<comments>https://www.snippetit.com/2013/12/java-how-to-implement-ungetc-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Tue, 17 Dec 2013 16:58:50 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[ungetc]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=465</guid>

					<description><![CDATA[If you are a C or C++ programmer, you may familiar withe ungetc function in C. ungetc function is a very simple but useful function especially when your program need to read characters from a FILE stream for data parsing. You may encounter cases where you need to unread the character so that you can [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you are a C or C++ programmer, you may familiar withe <code>ungetc</code> function in C. ungetc function is a very simple but useful function especially when your program need to read characters from a <code>FILE</code> stream for data parsing. You may encounter cases where you need to unread the character so that you can use that character when you pass in the <code>FILE</code> reference into another function.</p>
<p>From C manual for <code>ungetc</code>:</p>
<blockquote><p>A character is virtually put back into an input stream, decreasing its internal file position as if a previous getc operation was undone.</p>
<p>This character may or may not be the one read from the stream in the preceding input operation. In any case, the next character retrieved from stream is the character passed to this function, independently of the original one.</p>
<p>Notice though, that this only affects further input operations on that stream, and not the content of the physical file associated with it, which is not modified by any calls to this function.</p></blockquote>
<p><span id="more-465"></span></p>
<p>This is my simple version of <code>ungetc</code> in Java, <code>UInputStream</code>. I use an InputStream as the base class so that you can work with other input stream object like <code>FileInputStream</code>. <code>UInputStream</code> will override the <code>read()</code> function from <code>InputStream</code> and an additional function to undone the read.</p>
<pre>import java.io.IOException;
import java.io.InputStream;

public class UInputStream extends InputStream {
    private InputStream uIn;
    private boolean uPushedBack;
    private int uPushedBackVal;

    public UInputStream(InputStream in) {
        uIn = in;
        uPushedBack = false;
        uPushedBackVal = -1;
    }

    @Override
    public int read() throws IOException {
        if (uPushedBack) {
            uPushedBack = false;
            return uPushedBackVal;
        }
        return uPushedBackVal = uIn.read();
    }

    public void unread() {
        if (uPushedBack)
            throw new IllegalStateException("Already pushed back a byte");
        uPushedBack = true;
    }
}</pre>
<p>Here is how you use the <code>UInputStream</code></p>
<pre>InputStream in = new UInputStream(/*other stream object*/);
int c;
while ((c = in.read()) != -1) {
    if (c == 'A') {
        in.unread()
        doSomethingStartsWithA(in);
    }
}</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2013/12/java-how-to-implement-ungetc-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">465</post-id>	</item>
		<item>
		<title>eGenting Programming Competition 2013</title>
		<link>https://www.snippetit.com/2013/09/egenting-programming-competition-2013/</link>
					<comments>https://www.snippetit.com/2013/09/egenting-programming-competition-2013/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Tue, 24 Sep 2013 10:53:04 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[EGPC]]></category>
		<category><![CDATA[programming]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=461</guid>

					<description><![CDATA[Another competition year has come! Get your programming skills polished and take the challenge! There are more prizes this year. Come eat for free (breakfast, lunch, tea break include) and registration is free. Remember to bring your weapons, books I meant 🙂 Below are the details of the event: Competition date: 9 November 2013 (Saturday) [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Another competition year has come! Get your programming skills polished and take the challenge! There are more prizes this year. Come eat for free (breakfast, lunch, tea break include) and registration is free. Remember to bring your weapons, books I meant <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p><a title="e-Genting Programming Competition. by szehau, on Flickr" href="http://www.flickr.com/photos/szehau/9913715883/"><img loading="lazy" decoding="async" class="aligncenter" alt="e-Genting Programming Competition." src="http://farm3.staticflickr.com/2806/9913715883_62a58031fa.jpg" width="500" height="135" /></a></p>
<p><span id="more-461"></span></p>
<p>Below are the details of the event:</p>
<ul>
<li>Competition date: 9 November 2013 (Saturday)</li>
<li>Time: 10.00 am to 6.00 pm</li>
<li>Venue: Auditorium, 25th Floor Wisma Genting, Jalan Sultan Ismail, 50250 Kuala Lumpur</li>
<li>Nature: Open-book handwritten programming task</li>
</ul>
<p>The prizes:</p>
<ul>
<li>1st Prize &#8211; RM6,000</li>
<li>2nd Prize &#8211; RM3,000</li>
<li>3rd Prize &#8211; RM2,000</li>
</ul>
<p>For registration and question, please email cheeleng.tan@rwgenting.com for more information.</p>
<p>EGPC Website: http://egpc.genting.com.my</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2013/09/egenting-programming-competition-2013/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">461</post-id>	</item>
		<item>
		<title>SQL: How To Select Data With Same Values On Columns</title>
		<link>https://www.snippetit.com/2013/09/sql-how-to-select-data-with-same-values-on-columns/</link>
					<comments>https://www.snippetit.com/2013/09/sql-how-to-select-data-with-same-values-on-columns/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Thu, 19 Sep 2013 09:57:47 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=454</guid>

					<description><![CDATA[Let say you have the following data in you database table t1 and you want to select the IDs for the row record that have the same value on COL1 and COL2. ID   COL1   COL2   COL3 ====================== 1    100    200    300 2    200    300    400 3    100    200    500 4    300    300    300 5    200    [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Let say you have the following data in you database table t1 and you want to select the IDs for the row record that have the same value on COL1 and COL2.<br />
<code></code></p>
<pre>ID   COL1   COL2   COL3
======================
1    100    200    300
2    200    300    400
3    100    200    500
4    300    300    300
5    200    300    400</pre>
<p><code></code><br />
And the expected result is ID = 1,2,3,5. The SQL to achive the result is:<br />
<code></code></p>
<pre>select 
    left.ID
from
    t1 left inner join t1 right
on
    left.COL1 = right.COL1 and
    left.COL2 = right.COL2 and
    left.ID &lt;&gt; right.ID</pre>
<p><code></code><br />
You can also use &#8220;group by&#8221; then &#8220;count(*)&#8221; method but it is a bit more complicated and slow.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2013/09/sql-how-to-select-data-with-same-values-on-columns/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">454</post-id>	</item>
		<item>
		<title>Linux: How To Add Swap on CentOS</title>
		<link>https://www.snippetit.com/2013/09/linux-how-to-add-swap-on-centos/</link>
					<comments>https://www.snippetit.com/2013/09/linux-how-to-add-swap-on-centos/#respond</comments>
		
		<dc:creator><![CDATA[Sze Hau]]></dc:creator>
		<pubDate>Wed, 18 Sep 2013 11:27:16 +0000</pubDate>
				<category><![CDATA[Programming and Scripting]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[swap]]></category>
		<guid isPermaLink="false">http://www.snippetit.com/?p=452</guid>

					<description><![CDATA[Linux divides its physical memory (or the RAM, random access memory) into chucks of memory called pages. When a program require more memory and there isn&#8217;t enough physical memory, Linux will starts moving out inactive pages and store them on hard disk. The process of moving out the pages for physical memory to disk is [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Linux divides its physical memory (or the RAM, random access memory) into chucks of memory called pages. When a program require more memory and there isn&#8217;t enough physical memory, Linux will starts moving out inactive pages and store them on hard disk.</p>
<p>The process of moving out the pages for physical memory to disk is called swapping. The size of &#8220;memory on disk&#8221; is depending on the swap file size. The combination of physical memory and the &#8220;memory on disk&#8221; is called virtual memory. Therefore, you can have virtually unlimited memory.</p>
<p>Swapping has it disadvantage &#8211; it is slow when Linux need to keep swapping in and out of memory pages. It is slow because of the disk speed limitation. But if you have a <a href="http://goo.gl/pu2hYL" target="_blank">server running with SSD disk</a> (solid-state disk), you may not feel the pain. However, the process is required to make sure the operating system can works under memory pressure.<br />
<span id="more-452"></span></p>
<p><strong>Check for Existing Swap File</strong><br />
Execute the following command to check for the existing swap space:<br />
<code>swapon -s</code></p>
<p><strong>Check for Available Disk Space</strong><br />
Execute the following command to check for disk space availability.<br />
<code>df -h</code></p>
<p><strong>Create Swap File</strong><br />
Execute the following command to create a swap file of size 1Gb. The following command will write zero values with block size 1024 bytes 1024k times to file &#8220;swapfile&#8221;.<br />
<code>sudo dd if=/dev/zero of=/swapfile bs=1024 count=1024k</code></p>
<p><strong>Enable Swap File</strong><br />
Execute the following command to make the file a swap space.<br />
<code>sudo mkswap /swapfile</code></p>
<p><strong>Start Using Swap File</strong><br />
Execute the following command to let the operating system know the swap file is now ready to use.<br />
<code>sudo swapon /swapfile</code></p>
<p><strong>Set Swap File Permission</strong><br />
Execute the following commands to ensure the swap file has the correct file permission:<br />
<code>chown root:root /swapfile<br />
chmod 0600 /swapfile</code></p>
<p><strong>Done</strong><br />
Execute <code>swapon -s</code> to ensure the swap file is being used.</p>
<p><strong>Enable Swap File Durinn Boot Up</strong><br />
When the machine reboot, operating system will not use the swap file again. You can ensure that the swap is permanently loaded by adding it to the fstab file. Edit the file &#8220;/etc/ftab&#8221; and add the following line:<br />
<code>/swapfile swap swap defaults 0 0</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.snippetit.com/2013/09/linux-how-to-add-swap-on-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">452</post-id>	</item>
	</channel>
</rss>
