<?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>Computer Cranium &#187; Snippets</title>
	<atom:link href="http://computercranium.com/category/programming/snippets/feed" rel="self" type="application/rss+xml" />
	<link>http://computercranium.com</link>
	<description>Your Computer Science Resource</description>
	<lastBuildDate>Fri, 23 Jul 2010 01:15:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HOW-TO: Center a JFrame On The Screen</title>
		<link>http://computercranium.com/programming/java/howto-center-a-jframe-on-the-screen</link>
		<comments>http://computercranium.com/programming/java/howto-center-a-jframe-on-the-screen#comments</comments>
		<pubDate>Wed, 10 Jun 2009 01:52:41 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[GUI]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[jframe]]></category>
		<category><![CDATA[screen]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=298</guid>
		<description><![CDATA[If you want to add a nice touch to your GUI application, have your JFrame automatically center on the user&#8217;s screen.  Not only does this looks much better than having it start up in the default (0, 0) location, but it takes very little coding effort to make this happen.  There are two [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-center-a-jframe-on-the-screen/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Java Gradient Backgrounds</title>
		<link>http://computercranium.com/programming/java/how-to-java-gradient-backgrounds</link>
		<comments>http://computercranium.com/programming/java/how-to-java-gradient-backgrounds#comments</comments>
		<pubDate>Tue, 09 Jun 2009 00:40:14 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[gradient]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=353</guid>
		<description><![CDATA[Nowadays, if you are developing a GUI application, it looks more &#8220;professional&#8221; if your window&#8217;s background is gradient (i.e. the background fades from light to dark, or dark to light).  This gives your application a more polished look and can greatly improve the interface without much effort. Here&#8217;s how to do it&#8230;

The Code
Add the [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/how-to-java-gradient-backgrounds/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Retrieve a File&#8217;s extension in Java</title>
		<link>http://computercranium.com/programming/java/how-to-retrieve-a-files-extension-in-java</link>
		<comments>http://computercranium.com/programming/java/how-to-retrieve-a-files-extension-in-java#comments</comments>
		<pubDate>Mon, 01 Jun 2009 14:13:24 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[file]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=348</guid>
		<description><![CDATA[For some strange reason, there&#8217;s no getFileExtension() or getExtension() method in Java&#8217;s File class (perhaps because Files do not necessarily always have extensions in every platform?).  Nevertheless, that doesn&#8217;t mean we can&#8217;t do it on our own.  All it takes is one line of code!

Suppose you have a File named file.  We [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/how-to-retrieve-a-files-extension-in-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Evaluate a Mathematical String Using ScriptEngine</title>
		<link>http://computercranium.com/programming/java/howto-evaluate-a-mathematical-string-using-scriptengine</link>
		<comments>http://computercranium.com/programming/java/howto-evaluate-a-mathematical-string-using-scriptengine#comments</comments>
		<pubDate>Mon, 12 Jan 2009 22:05:42 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[calculate]]></category>
		<category><![CDATA[calculation]]></category>
		<category><![CDATA[evaluate]]></category>
		<category><![CDATA[mathematical string]]></category>
		<category><![CDATA[ScriptEngine]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=284</guid>
		<description><![CDATA[Suppose you have a String containing some mathematical operation(s). For example, we need to perform the following calculation, but for various reasons, the data type is a String: (10*(34+92)-23)/4.  Rather than figuring out ways to parse it (e.g. split or some fancy regex), we can use Java&#8217;s ScriptEngine to evaluate the function as is.

Introduction
Java&#8217;s [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-evaluate-a-mathematical-string-using-scriptengine/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Read a Text File Using BufferedReader</title>
		<link>http://computercranium.com/programming/java/howto-read-a-text-file-using-bufferedreader</link>
		<comments>http://computercranium.com/programming/java/howto-read-a-text-file-using-bufferedreader#comments</comments>
		<pubDate>Sat, 10 Jan 2009 21:03:55 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[CS 101]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[BufferedReader]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[text file]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=270</guid>
		<description><![CDATA[As simple as this may seem to experienced Java programmers, I still see many posts in the Java Forums from beginners asking this very question: How do you read a text file line-by-line using a BufferedReader? Let&#8217;s find out.

Suppose we have a text file called input.txt. This text file contains an arbitrary length of lines [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-read-a-text-file-using-bufferedreader/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Save a BufferedImage to Disk</title>
		<link>http://computercranium.com/programming/java/howto-save-a-bufferedimage-to-disk</link>
		<comments>http://computercranium.com/programming/java/howto-save-a-bufferedimage-to-disk#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:33:40 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[BufferedImage]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[save]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=228</guid>
		<description><![CDATA[Recently, I showed you how to take a screenshot and display it in a JFrame using Java&#8217;s Robot class. What if you wanted to save the image to the disk as a GIF, JPG, or PNG? It&#8217;s actually really easy. Let&#8217;s find out how!

Suppose we have our image or screenshot saved in a BufferedImage named [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-save-a-bufferedimage-to-disk/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MD5 and SHA-1 Encryption in Java</title>
		<link>http://computercranium.com/programming/java/md5-and-sha-1-encryption-in-java</link>
		<comments>http://computercranium.com/programming/java/md5-and-sha-1-encryption-in-java#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:27:04 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[checksum]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[md5]]></category>
		<category><![CDATA[sha-1]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=161</guid>
		<description><![CDATA[Java has a built-in MessageDigest class which makes it easy to implement an MD5 or SHA-1 hash (among others). Both of these algorithms produce one-way hashes (they cannot be changed back to their original form), and they are usually used for encryption and for checking the integrity of files (checksum). Although they are probably deemed [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/md5-and-sha-1-encryption-in-java/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOW-TO: Screen Capture Using Java&#8217;s Robot Class</title>
		<link>http://computercranium.com/programming/java/howto-screen-capture-using-javas-robot-class</link>
		<comments>http://computercranium.com/programming/java/howto-screen-capture-using-javas-robot-class#comments</comments>
		<pubDate>Sat, 27 Dec 2008 17:44:00 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[print screen]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[screen capture]]></category>
		<category><![CDATA[screenshot]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=73</guid>
		<description><![CDATA[At some point or another, you may come across a time when you need to capture the user&#8217;s screen and save it as an image. Maybe you&#8217;re making your own &#8220;print screen&#8221; program, or doing some other image analysis.  Regardless, there is a really simple way to capture the user&#8217;s screen, and here it [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-screen-capture-using-javas-robot-class/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HOW-TO:  Extract Text from .DOCX file (Word 2007)</title>
		<link>http://computercranium.com/programming/java/howto-extract-text-from-docx-file-word-2007</link>
		<comments>http://computercranium.com/programming/java/howto-extract-text-from-docx-file-word-2007#comments</comments>
		<pubDate>Thu, 07 Aug 2008 17:53:25 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[docx]]></category>
		<category><![CDATA[Microsoft Word 2007]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://computercranium.com/?p=11</guid>
		<description><![CDATA[I recently had to figure out a way to extract all of the text from a .DOCX file (Word 2007 document) in Java for a project I&#8217;m working on.  Surprisingly, it&#8217;s even easier than extracting text from a regular .DOC file.

A .DOCX file is really a ZIP package of XML documents.  To see for yourself, [...]]]></description>
		<wfw:commentRss>http://computercranium.com/programming/java/howto-extract-text-from-docx-file-word-2007/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
