<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Java DevZone</title>
	<atom:link href="http://itblackbelt.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://itblackbelt.wordpress.com</link>
	<description>"Once a new technology starts rolling, if you're not part of the steamroller, you're part of the road."</description>
	<lastBuildDate>Thu, 08 Dec 2011 05:15:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='itblackbelt.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Java DevZone</title>
		<link>http://itblackbelt.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://itblackbelt.wordpress.com/osd.xml" title="Java DevZone" />
	<atom:link rel='hub' href='http://itblackbelt.wordpress.com/?pushpress=hub'/>
		<item>
		<title>ගෙදරට ඊ-මේල් ආවහම බෙල් ගහන්නේ කවුද?</title>
		<link>http://itblackbelt.wordpress.com/2011/11/09/%e0%b6%9c%e0%b7%99%e0%b6%af%e0%b6%bb%e0%b6%a7-%e0%b6%8a-%e0%b6%b8%e0%b7%9a%e0%b6%bd%e0%b7%8a-%e0%b6%86%e0%b7%80%e0%b7%84%e0%b6%b8-%e0%b6%b6%e0%b7%99%e0%b6%bd%e0%b7%8a-%e0%b6%9c%e0%b7%84%e0%b6%b1/</link>
		<comments>http://itblackbelt.wordpress.com/2011/11/09/%e0%b6%9c%e0%b7%99%e0%b6%af%e0%b6%bb%e0%b6%a7-%e0%b6%8a-%e0%b6%b8%e0%b7%9a%e0%b6%bd%e0%b7%8a-%e0%b6%86%e0%b7%80%e0%b7%84%e0%b6%b8-%e0%b6%b6%e0%b7%99%e0%b6%bd%e0%b7%8a-%e0%b6%9c%e0%b7%84%e0%b6%b1/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 23:14:11 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ඊ-මේල්]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=567</guid>
		<description><![CDATA[ඊමේල් ආවාදැයි දැනගන්නට බෙල් ගහන්නේ කවුදැයි පරිගණක පාඩමක යෙදී සිටි කාන්තාවක් උපදේශකවරයාගෙන් ප‍්‍රශ්න කළාය. ප‍්‍රදේශයේ ප‍්‍රධාන පෙළේ කාර්යාලයක නිලධාරි පිරිසක් වෙනුවෙන් පසුගිය දිනක පරිගණක පාඨමාලාවක් පැවැත්විණි. එක්දිනක මෙම පාඨමාලාවට නිලධරයෝ පිරිසක් සහභාගි වූහ. ඒ අතර වැඩිදෙනා අද හෙට විශ‍්‍රාම යන වයසේ පසුවූවන්ය. ඔවුන් මෙයට සහභාගි වූයේ ප‍්‍රධානියාගේ බලකිරීම නිසා මිස කැමැත්ත ඇතිවද නොවේ. උපදේශක පාඩම [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=567&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ඊමේල් ආවාදැයි දැනගන්නට බෙල් ගහන්නේ කවුදැයි පරිගණක පාඩමක යෙදී සිටි කාන්තාවක් උපදේශකවරයාගෙන් ප‍්‍රශ්න කළාය.</p>
<p>ප‍්‍රදේශයේ ප‍්‍රධාන පෙළේ කාර්යාලයක නිලධාරි පිරිසක් වෙනුවෙන් පසුගිය දිනක පරිගණක පාඨමාලාවක් පැවැත්විණි.</p>
<p>එක්දිනක මෙම පාඨමාලාවට නිලධරයෝ පිරිසක් සහභාගි වූහ. ඒ අතර වැඩිදෙනා අද හෙට විශ‍්‍රාම යන වයසේ පසුවූවන්ය. ඔවුන් මෙයට සහභාගි වූයේ ප‍්‍රධානියාගේ බලකිරීම නිසා මිස කැමැත්ත ඇතිවද නොවේ.</p>
<p>උපදේශක පාඩම ආරම්භ කරමින් පරිගණකයෙන් ගතහැකි ප‍්‍රයෝජන පිළිබඳව එකින් එක කරුණු පැහැදිලි කරන්නට විය. අන්තර්ජාලය ගැන කරුණු කියාදුන් උපදේශක විද්‍යුත් තැපෑල පිළිබඳව දැනුම්වත් කළේය.</p>
<p>නිදිබරව සිටි නිලධාරිනියක් එක්වරම හඬ අවදි කරමින් සර්, ඊමේල් ආවම අපිට ඒ බව දැනගන්නට බෙල් ගහන්නේ කවුදැයි විමසුවාය. මේ ප‍්‍රශ්නයත් සමග උපදේශක අන්ද මන්ද වූයේය.</p>
<p>තැපෑලෙන් එන ලියුම් බෙදාහරින ආකාරයේ හා විද්‍යුත් තැපෑලේ වෙනස පිළිබඳව කරුණු පැහැදිලි කර දීමට උපදේශකට සෑහෙන වේලාවක් ගත විය.</p>
<p>(ලංකාදීප)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/567/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/567/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/567/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=567&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/11/09/%e0%b6%9c%e0%b7%99%e0%b6%af%e0%b6%bb%e0%b6%a7-%e0%b6%8a-%e0%b6%b8%e0%b7%9a%e0%b6%bd%e0%b7%8a-%e0%b6%86%e0%b7%80%e0%b7%84%e0%b6%b8-%e0%b6%b6%e0%b7%99%e0%b6%bd%e0%b7%8a-%e0%b6%9c%e0%b7%84%e0%b6%b1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>The &#8220;Java Life&#8221; Rap Music Video</title>
		<link>http://itblackbelt.wordpress.com/2011/10/05/the-java-life-rap-music-video/</link>
		<comments>http://itblackbelt.wordpress.com/2011/10/05/the-java-life-rap-music-video/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 04:51:25 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java Life]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=563</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=563&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='500' height='312' src='http://www.youtube.com/embed/b-Cr0EWwaTk?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent' frameborder='0'></iframe></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/563/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=563&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/10/05/the-java-life-rap-music-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>Telecom pages hacked: Engineer arrested</title>
		<link>http://itblackbelt.wordpress.com/2011/09/19/telecom-pages-hacked-engineer-arrested/</link>
		<comments>http://itblackbelt.wordpress.com/2011/09/19/telecom-pages-hacked-engineer-arrested/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 06:20:05 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Telecom]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=560</guid>
		<description><![CDATA[A computer engineer has been arrested by CID detectives for hacking Sri Lanka Telecom data. Detectives say he allegedly hacked into data of the Sri Lanka Telecom Rainbow Pages – the directory for advertising. The CID’s cyber crime division had found that he had altered the programme in a manner that a user could type [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=560&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A computer engineer has been arrested by CID detectives for hacking Sri Lanka Telecom data.<br />
Detectives say he allegedly hacked into data of the Sri Lanka Telecom Rainbow Pages – the directory for advertising.</p>
<p>The CID’s cyber crime division had found that he had altered the programme in a manner that a user could type out the telephone number and find out the name and address of the owner. Usually the user could type out a name and find only the phone number. Detectives said they were investigating whether the programme had been made for sale and whether it had already been marketed.</p>
<p>They said that usually the task of finding the owner and address of a given telephone number was carried out by the police or security agencies for investigations.</p>
<p>The arrest of the engineer came after the cyber crime division tracked him down by following an advertisement which he had placed to sell a car. He had used the same name given to the new programme he developed for an advertisement he placed to sell a car on the internet.</p>
<p>Rainbow Pages Chief Executive Officer M. Balapitiya said they had taken precautions after the detection and there was no threat to customers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/560/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=560&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/09/19/telecom-pages-hacked-engineer-arrested/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>One To Many MappedBy</title>
		<link>http://itblackbelt.wordpress.com/2011/07/05/one-to-many-mappedby/</link>
		<comments>http://itblackbelt.wordpress.com/2011/07/05/one-to-many-mappedby/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 22:31:43 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[One To Many MappedBy]]></category>
		<category><![CDATA[One To Many]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=556</guid>
		<description><![CDATA[File: Department.java import java.util.ArrayList; import java.util.Collection; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; @Entity public class Department {     @Id @GeneratedValue(strategy=GenerationType.IDENTITY)     private int id;     private String name;     @OneToMany(mappedBy="department")     private Collection&#60;Professor&#62; employees;     public Department() {         employees = new ArrayList&#60;Professor&#62;();     }          public int getId() {         return id;     }          public void setId(int id) {         this.id = id;     }          public String getName() {         return name;     }          public void setName(String deptName) {         this.name = deptName;     }          public void addProfessor(Professor employee) {         if (!getProfessors().contains(employee)) {             getProfessors().add(employee);             if (employee.getDepartment() != null) {                 employee.getDepartment().getProfessors().remove(employee);             }             employee.setDepartment(this);         }     }          public Collection&#60;Professor&#62; getProfessors() {         return employees;     }     public String toString() {         return "Department id: " + getId() +                 ", name: " + getName();     } } File: Professor.java import javax.persistence.Entity; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=556&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><code><span style="color:#000000;">File: Department.java</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.util.ArrayList;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.util.Collection;</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Entity;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.GeneratedValue;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.GenerationType;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Id;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.OneToMany;</span></p>
<p><span style="color:#000000;">@Entity</span><br />
<span style="color:#7f0055;"><strong>public class </strong></span><span style="color:#000000;">Department </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">@Id @GeneratedValue</span><span style="color:#000000;">(</span><span style="color:#000000;">strategy=GenerationType.IDENTITY</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#000000;">String name;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">@OneToMany</span><span style="color:#000000;">(</span><span style="color:#000000;">mappedBy=</span><span style="color:#2a00ff;">"department"</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#000000;">Collection&lt;Professor&gt; employees;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Department</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">employees = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">ArrayList&lt;Professor&gt;</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">getId</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setId</span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">id</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.id = id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">String getName</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">name;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setName</span><span style="color:#000000;">(</span><span style="color:#000000;">String deptName</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.name = deptName;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">addProfessor</span><span style="color:#000000;">(</span><span style="color:#000000;">Professor employee</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">!getProfessors</span><span style="color:#000000;">()</span><span style="color:#000000;">.contains</span><span style="color:#000000;">(</span><span style="color:#000000;">employee</span><span style="color:#000000;">)) {</span><br />
<span style="color:#ffffff;">            </span><span style="color:#000000;">getProfessors</span><span style="color:#000000;">()</span><span style="color:#000000;">.add</span><span style="color:#000000;">(</span><span style="color:#000000;">employee</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">            </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">employee.getDepartment</span><span style="color:#000000;">() </span><span style="color:#000000;">!= </span><span style="color:#7f0055;"><strong>null</strong></span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">                </span><span style="color:#000000;">employee.getDepartment</span><span style="color:#000000;">()</span><span style="color:#000000;">.getProfessors</span><span style="color:#000000;">()</span><span style="color:#000000;">.remove</span><span style="color:#000000;">(</span><span style="color:#000000;">employee</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">            </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">            </span><span style="color:#000000;">employee.setDepartment</span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Collection&lt;Professor&gt; getProfessors</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">employees;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">String toString</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#2a00ff;">"Department id: " </span><span style="color:#000000;">+ getId</span><span style="color:#000000;">() </span><span style="color:#000000;">+ </span><br />
<span style="color:#ffffff;">               </span><span style="color:#2a00ff;">", name: " </span><span style="color:#000000;">+ getName</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#000000;">}</span></p>
<p><span style="color:#000000;">File: Professor.java</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Entity;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.GeneratedValue;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.GenerationType;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Id;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.ManyToOne;</span></p>
<p><span style="color:#000000;">@Entity</span><br />
<span style="color:#7f0055;"><strong>public class </strong></span><span style="color:#000000;">Professor </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">@Id @GeneratedValue</span><span style="color:#000000;">(</span><span style="color:#000000;">strategy=GenerationType.IDENTITY</span><span style="color:#000000;">)</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#000000;">String name;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#7f0055;"><strong>long </strong></span><span style="color:#000000;">salary;</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">@ManyToOne</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>private </strong></span><span style="color:#000000;">Department department;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">getId</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setId</span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">id</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.id = id;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">String getName</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">name;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setName</span><span style="color:#000000;">(</span><span style="color:#000000;">String name</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.name = name;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>long </strong></span><span style="color:#000000;">getSalary</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">salary;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setSalary</span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>long </strong></span><span style="color:#000000;">salary</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.salary = salary;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Department getDepartment</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">department;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">setDepartment</span><span style="color:#000000;">(</span><span style="color:#000000;">Department department</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.department = department;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">String toString</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#2a00ff;">"Professor id: " </span><span style="color:#000000;">+ getId</span><span style="color:#000000;">() </span><span style="color:#000000;">+ </span><span style="color:#2a00ff;">" name: " </span><span style="color:#000000;">+ getName</span><span style="color:#000000;">() </span><span style="color:#000000;">+ </span><br />
<span style="color:#ffffff;">               </span><span style="color:#2a00ff;">" with " </span><span style="color:#000000;">+ getDepartment</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#000000;">}</span></p>
<p><span style="color:#000000;">File: ProfessorService.java</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.util.Collection;</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.EntityManager;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Query;</span></p>
<p><span style="color:#7f0055;"><strong>public class </strong></span><span style="color:#000000;">ProfessorService </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>protected </strong></span><span style="color:#000000;">EntityManager em;</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">ProfessorService</span><span style="color:#000000;">(</span><span style="color:#000000;">EntityManager em</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>this</strong></span><span style="color:#000000;">.em = em;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Department createDepartment</span><span style="color:#000000;">(</span><span style="color:#000000;">String name</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Department dept = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">Department</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">dept.setName</span><span style="color:#000000;">(</span><span style="color:#000000;">name</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">em.persist</span><span style="color:#000000;">(</span><span style="color:#000000;">dept</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">dept;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Collection&lt;Department&gt; findAllDepartments</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Query query = em.createQuery</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"SELECT d FROM Department d"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">Collection&lt;Department&gt;</span><span style="color:#000000;">) </span><span style="color:#000000;">query.getResultList</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Professor createProfessor</span><span style="color:#000000;">(</span><span style="color:#000000;">String name, </span><span style="color:#7f0055;"><strong>long </strong></span><span style="color:#000000;">salary</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Professor emp = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">Professor</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">emp.setName</span><span style="color:#000000;">(</span><span style="color:#000000;">name</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">emp.setSalary</span><span style="color:#000000;">(</span><span style="color:#000000;">salary</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">em.persist</span><span style="color:#000000;">(</span><span style="color:#000000;">emp</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">emp;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Professor setProfessorDepartment</span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">empId, </span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">deptId</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Professor emp = em.find</span><span style="color:#000000;">(</span><span style="color:#000000;">Professor.class, empId</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Department dept = em.find</span><span style="color:#000000;">(</span><span style="color:#000000;">Department.class, deptId</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">dept.addProfessor</span><span style="color:#000000;">(</span><span style="color:#000000;">emp</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">emp;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">Collection&lt;Professor&gt; findAllProfessors</span><span style="color:#000000;">() {</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Query query = em.createQuery</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"SELECT e FROM Professor e"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>return </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">Collection&lt;Professor&gt;</span><span style="color:#000000;">) </span><span style="color:#000000;">query.getResultList</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span><br />
<span style="color:#000000;">}</span></p>
<p><span style="color:#000000;">File: Main.java</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.util.Collection;</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.EntityManager;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.EntityManagerFactory;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">javax.persistence.Persistence;</span></p>
<p><span style="color:#7f0055;"><strong>public class </strong></span><span style="color:#000000;">Main </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public static </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">main</span><span style="color:#000000;">(</span><span style="color:#000000;">String</span><span style="color:#000000;">[] </span><span style="color:#000000;">a</span><span style="color:#000000;">) </span><span style="color:#7f0055;"><strong>throws </strong></span><span style="color:#000000;">Exception </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">JPAUtil util = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">JPAUtil</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">EntityManagerFactory emf = Persistence.createEntityManagerFactory</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"ProfessorService"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">EntityManager em = emf.createEntityManager</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">ProfessorService service = </span><span style="color:#7f0055;"><strong>new </strong></span><span style="color:#000000;">ProfessorService</span><span style="color:#000000;">(</span><span style="color:#000000;">em</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">em.getTransaction</span><span style="color:#000000;">()</span><span style="color:#000000;">.</span><span style="color:#7f0055;"><strong>begin</strong></span><span style="color:#000000;">()</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">Professor emp = service.createProfessor</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"empName"</span><span style="color:#000000;">,</span><span style="color:#990000;">100</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Department dept = service.createDepartment</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"deptName"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">emp = service.setProfessorDepartment</span><span style="color:#000000;">(</span><span style="color:#000000;">emp.getId</span><span style="color:#000000;">()</span><span style="color:#000000;">,dept.getId</span><span style="color:#000000;">())</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#000000;">emp.getDepartment</span><span style="color:#000000;">() </span><span style="color:#000000;">+ </span><span style="color:#2a00ff;">" with Professors:"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#000000;">emp.getDepartment</span><span style="color:#000000;">()</span><span style="color:#000000;">.getProfessors</span><span style="color:#000000;">())</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">Collection&lt;Professor&gt; emps = service.findAllProfessors</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">emps.isEmpty</span><span style="color:#000000;">()) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"No Professors found "</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">} </span><span style="color:#7f0055;"><strong>else </strong></span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Found Professors:"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>for </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">Professor emp1 : emps</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">            </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#000000;">emp1</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">Collection&lt;Department&gt; depts = service.findAllDepartments</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">depts.isEmpty</span><span style="color:#000000;">()) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"No Departments found "</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">} </span><span style="color:#7f0055;"><strong>else </strong></span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Found Departments:"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>for </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">Department dept1 : depts</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">            </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#000000;">dept1 + </span><span style="color:#2a00ff;">" with " </span><span style="color:#000000;">+ dept1.getProfessors</span><span style="color:#000000;">()</span><span style="color:#000000;">.size</span><span style="color:#000000;">() </span><span style="color:#000000;">+ </span><span style="color:#2a00ff;">" employees"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">util.checkData</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"select * from Professor"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">util.checkData</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"select * from Department"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">em.getTransaction</span><span style="color:#000000;">()</span><span style="color:#000000;">.commit</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">em.close</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">emf.close</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span><br />
<span style="color:#000000;">}</span></p>
<p><span style="color:#000000;">File: JPAUtil.java</span></p>
<p><span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.io.Reader;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.sql.Connection;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.sql.DriverManager;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.sql.ResultSet;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.sql.ResultSetMetaData;</span><br />
<span style="color:#7f0055;"><strong>import </strong></span><span style="color:#000000;">java.sql.Statement;</span></p>
<p><span style="color:#7f0055;"><strong>public class </strong></span><span style="color:#000000;">JPAUtil </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">Statement st;</span><br />
<span style="color:#ffffff;">  </span><br />
<span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#000000;">JPAUtil</span><span style="color:#000000;">() </span><span style="color:#7f0055;"><strong>throws </strong></span><span style="color:#000000;">Exception</span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>Class</strong></span><span style="color:#000000;">.forName</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"org.hsqldb.jdbcDriver"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Driver Loaded."</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">String url = </span><span style="color:#2a00ff;">"jdbc:hsqldb:data/tutorial"</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#000000;">Connection conn = DriverManager.getConnection</span><span style="color:#000000;">(</span><span style="color:#000000;">url, </span><span style="color:#2a00ff;">"sa"</span><span style="color:#000000;">, </span><span style="color:#2a00ff;">""</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"Got Connection."</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">st = conn.createStatement</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">executeSQLCommand</span><span style="color:#000000;">(</span><span style="color:#000000;">String sql</span><span style="color:#000000;">) </span><span style="color:#7f0055;"><strong>throws </strong></span><span style="color:#000000;">Exception </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">st.executeUpdate</span><span style="color:#000000;">(</span><span style="color:#000000;">sql</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">  </span><span style="color:#7f0055;"><strong>public </strong></span><span style="color:#7f0055;"><strong>void </strong></span><span style="color:#000000;">checkData</span><span style="color:#000000;">(</span><span style="color:#000000;">String sql</span><span style="color:#000000;">) </span><span style="color:#7f0055;"><strong>throws </strong></span><span style="color:#000000;">Exception </span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">ResultSet rs = st.executeQuery</span><span style="color:#000000;">(</span><span style="color:#000000;">sql</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">ResultSetMetaData metadata = rs.getMetaData</span><span style="color:#000000;">()</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>for </strong></span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">i = </span><span style="color:#990000;">0</span><span style="color:#000000;">; i &lt; metadata.getColumnCount</span><span style="color:#000000;">()</span><span style="color:#000000;">; i++</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">System.out.print</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"\t"</span><span style="color:#000000;">+ metadata.getColumnLabel</span><span style="color:#000000;">(</span><span style="color:#000000;">i + </span><span style="color:#990000;">1</span><span style="color:#000000;">))</span><span style="color:#000000;">; </span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"\n----------------------------------"</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span></p>
<p><span style="color:#ffffff;">    </span><span style="color:#7f0055;"><strong>while </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">rs.next</span><span style="color:#000000;">()) {</span><br />
<span style="color:#ffffff;">      </span><span style="color:#7f0055;"><strong>for </strong></span><span style="color:#000000;">(</span><span style="color:#7f0055;"><strong>int </strong></span><span style="color:#000000;">i = </span><span style="color:#990000;">0</span><span style="color:#000000;">; i &lt; metadata.getColumnCount</span><span style="color:#000000;">()</span><span style="color:#000000;">; i++</span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">Object value = rs.getObject</span><span style="color:#000000;">(</span><span style="color:#000000;">i + </span><span style="color:#990000;">1</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#7f0055;"><strong>if </strong></span><span style="color:#000000;">(</span><span style="color:#000000;">value == </span><span style="color:#7f0055;"><strong>null</strong></span><span style="color:#000000;">) {</span><br />
<span style="color:#ffffff;">          </span><span style="color:#000000;">System.out.print</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"\t       "</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">} </span><span style="color:#7f0055;"><strong>else </strong></span><span style="color:#000000;">{</span><br />
<span style="color:#ffffff;">          </span><span style="color:#000000;">System.out.print</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">"\t"</span><span style="color:#000000;">+value.toString</span><span style="color:#000000;">()</span><span style="color:#000000;">.trim</span><span style="color:#000000;">())</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">        </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">System.out.println</span><span style="color:#000000;">(</span><span style="color:#2a00ff;">""</span><span style="color:#000000;">)</span><span style="color:#000000;">;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">}</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">}</span><br />
<span style="color:#000000;">}</span></p>
<p><span style="color:#000000;">File: persistence.xml</span></p>
<p><span style="color:#000000;">&lt;persistence xmlns=</span><span style="color:#2a00ff;">"http://java.sun.com/xml/ns/persistence"</span><br />
<span style="color:#ffffff;">             </span><span style="color:#000000;">xmlns:xsi=</span><span style="color:#2a00ff;">"http://www.w3.org/2001/XMLSchema-instance"</span><br />
<span style="color:#ffffff;">             </span><span style="color:#000000;">xsi:schemaLocation=</span><span style="color:#2a00ff;">"http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence" </span><span style="color:#000000;">version=</span><span style="color:#2a00ff;">"1.0"</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">&lt;persistence-unit name=</span><span style="color:#2a00ff;">"JPAService" </span><span style="color:#000000;">transaction-type=</span><span style="color:#2a00ff;">"RESOURCE_LOCAL"</span><span style="color:#000000;">&gt;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">&lt;properties&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.dialect" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">"org.hibernate.dialect.HSQLDialect"</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.hbm2ddl.auto" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">"update"</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.connection.driver_class" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">"org.hsqldb.jdbcDriver"</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.connection.username" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">"sa"</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.connection.password" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">""</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">      </span><span style="color:#000000;">&lt;property name=</span><span style="color:#2a00ff;">"hibernate.connection.url" </span><span style="color:#000000;">value=</span><span style="color:#2a00ff;">"jdbc:hsqldb:data/tutorial"</span><span style="color:#000000;">/&gt;</span><br />
<span style="color:#ffffff;">    </span><span style="color:#000000;">&lt;/properties&gt;</span><br />
<span style="color:#ffffff;">  </span><span style="color:#000000;">&lt;/persistence-unit&gt;</span><br />
<span style="color:#000000;">&lt;/persistence&gt;</span><br />
<span style="color:#ffffff;"><br />
</span></code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/556/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=556&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/07/05/one-to-many-mappedby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>Sample code block for Java Date to Timestamp convertion and rounding Bigdecimal values.</title>
		<link>http://itblackbelt.wordpress.com/2011/07/04/sample-code-blocks-for-java-date-to-timestamp-convertion-and-rounding-bigdecimal-values/</link>
		<comments>http://itblackbelt.wordpress.com/2011/07/04/sample-code-blocks-for-java-date-to-timestamp-convertion-and-rounding-bigdecimal-values/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 10:35:27 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Date to Timestamp convertion]]></category>
		<category><![CDATA[Rounding Bigdecimal values]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=551</guid>
		<description><![CDATA[Sample code blocks for Java Date to Timestamp convertion and rounding Bigdecimal values to display two decimal points. package timestampDeciaml; import java.util.*; import java.text.*; import java.sql.Timestamp; import java.math.BigDecimal; public class DateToTimestamp { public DateToTimestamp() { } public static void main(String[] args) { /*Converting  a java Date to TimeStamp*/ try { String str_date = &#8220;2011-07-02 14:51:26&#8243;; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=551&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Sample code blocks for Java Date to Timestamp convertion and rounding Bigdecimal values to display two decimal points.</strong></p>
<p>package timestampDeciaml;</p>
<p>import java.util.*;<br />
import java.text.*;<br />
import java.sql.Timestamp;</p>
<p>import java.math.BigDecimal;</p>
<p>public class DateToTimestamp {</p>
<p>public DateToTimestamp() {</p>
<p>}</p>
<p>public static void main(String[] args) {</p>
<p>/*Converting  a java Date to TimeStamp*/</p>
<p>try {<br />
String str_date = &#8220;2011-07-02 14:51:26&#8243;;<br />
DateFormat formatter;<br />
Date date;</p>
<p>formatter = new SimpleDateFormat(&#8220;yyyy-MM-dd hh:mm:ss&#8221;);<br />
date = (Date) formatter.parse(str_date);<br />
System.out.println(&#8220;Today is &#8221; + date.toString());</p>
<p>java.sql.Timestamp timeStampDate = new Timestamp(date.getTime());<br />
System.out.println(&#8220;Today is &#8221; + timeStampDate);</p>
<p>} catch (ParseException e) {<br />
System.out.println(&#8220;Exception :&#8221; + e);<br />
}</p>
<p>/*Different implementations of rounding off BigDecimal values<br />
to display Two Decimal places*/</p>
<p>int decimalPlaces = 2;<br />
BigDecimal bd = new BigDecimal(&#8220;123456789.7123456890&#8243;);</p>
<p>bd = bd.setScale(decimalPlaces, BigDecimal.ROUND_DOWN);<br />
String output1 = bd.toString();<br />
System.out.println(&#8220;output1 123456789.0123456890  &#8221; + output1);</p>
<p>BigDecimal bd3 = new BigDecimal(&#8220;123456789.3&#8243;);<br />
bd3 = bd3.setScale(decimalPlaces, BigDecimal.ROUND_DOWN);<br />
String output2 = bd3.toString();<br />
System.out.println(&#8220;output2 123456789.3 &#8221; + output2);</p>
<p>BigDecimal bd2 = new BigDecimal(3.14159);<br />
bd2 = bd2.setScale(2, BigDecimal.ROUND_HALF_UP);<br />
String output3 = bd2.toString();<br />
System.out.println(&#8220;output3 3.14159  &#8221; + output3);</p>
<p>BigDecimal bd4 = new BigDecimal(3.1);<br />
bd4 = bd4.setScale(2, BigDecimal.ROUND_HALF_UP);<br />
String output4 = bd4.toString();<br />
System.out.println(&#8220;output2 3.14159  &#8221; + output4);</p>
<p>}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/551/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/551/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/551/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=551&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/07/04/sample-code-blocks-for-java-date-to-timestamp-convertion-and-rounding-bigdecimal-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>JBOSS RichFaces Refcard</title>
		<link>http://itblackbelt.wordpress.com/2011/07/01/jboss-richfaces-refcard/</link>
		<comments>http://itblackbelt.wordpress.com/2011/07/01/jboss-richfaces-refcard/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 04:23:37 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[RichFaces]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=546</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=546&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<iframe class="scribd_iframe_embed" src="http://www.scribd.com/embeds/13095090/content?start_page=1&view_mode=list&access_key=key-19jkz3rjwtdoe3puo03k" data-auto-height="true" scrolling="no" id="scribd_13095090" width="100%" height="500" frameborder="0"></iframe>
<div style="font-size:10px;text-align:center;width:100%"><a href="http://www.scribd.com/doc/13095090">View this document on Scribd</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/546/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/546/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/546/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=546&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/07/01/jboss-richfaces-refcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>JSF Data tables</title>
		<link>http://itblackbelt.wordpress.com/2011/06/17/jsf-data-tables/</link>
		<comments>http://itblackbelt.wordpress.com/2011/06/17/jsf-data-tables/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 11:32:57 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=540</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=540&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<iframe class="scribd_iframe_embed" src="http://www.scribd.com/embeds/2493370/content?start_page=1&view_mode=list&access_key=key-2a08v6cpu7u2u27ezpbr" data-auto-height="true" scrolling="no" id="scribd_2493370" width="100%" height="500" frameborder="0"></iframe>
<div style="font-size:10px;text-align:center;width:100%"><a href="http://www.scribd.com/doc/2493370">View this document on Scribd</a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/540/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=540&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/06/17/jsf-data-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Alternate RowColor in JSF</title>
		<link>http://itblackbelt.wordpress.com/2011/06/17/how-to-alternate-rowcolor-in-jsf/</link>
		<comments>http://itblackbelt.wordpress.com/2011/06/17/how-to-alternate-rowcolor-in-jsf/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 11:26:01 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JSF]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=538</guid>
		<description><![CDATA[Example of JSP file: &#60;%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %&#62; &#60;%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %&#62; &#60;f:view&#62; &#60;html&#62; &#60;head&#62; &#60;title&#62;Order Table&#60;/title&#62; &#60;link rel="stylesheet" type="text/css" href="&#60;%=request.getContextPath()%&#62;/styles/TableStyles.css"&#62; &#60;/head&#62; &#60;body&#62; &#60;h1&#62;Order Table&#60;/h1&#62; &#60;h:dataTable id="table" var="row" value="#{orderBean}" styleClass="tablebg" headerClass="header" footerClass="footer" columnClasses="text,number,number,number" rowClasses="graybg,whitebg" border="0" cellpadding="5"&#62; To have alternate row color in JSF, define a class in your CSS: body { font-family: Arial; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=538&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Example of JSP file:</p>
<pre>&lt;%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %&gt;
&lt;%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %&gt;

&lt;f:view&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Order Table&lt;/title&gt;
    &lt;link rel="stylesheet" type="text/css"
        href="&lt;%=request.getContextPath()%&gt;/styles/TableStyles.css"&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Order Table&lt;/h1&gt;
    &lt;h:dataTable id="table" var="row" value="#{orderBean}"
            styleClass="tablebg" headerClass="header" footerClass="footer"
            columnClasses="text,number,number,number"
            rowClasses="graybg,whitebg" border="0" cellpadding="5"&gt;</pre>
<p>To have alternate row color in JSF, define a class in your CSS:</p>
<pre>body     { font-family: Arial; }
.tablebg { background-color: #D0D0A0; }
.header  { font-weight: bold; }
.footer  { font-weight: bold; }
.text    { text-align: left; }
.number  { text-align: right; }
.graybg  { background-color: #DDDDDD; }
.whitebg { background-color: #FFFFFF; }
</pre>
<p>That&#8217;s it! If it does not work, do this in your CSS:</p>
<pre>body     { font-family: Arial; }
.tablebg { background-color: #D0D0A0; }
.header  { font-weight: bold; }
.footer  { font-weight: bold; }
.text    { text-align: left; }
.number  { text-align: right; }
tr.graybg td  { background-color: #DDDDDD; }
tr.whitebg td{ background-color: #FFFFFF; }</pre>
<p>Result:</p>
<p><img src="http://www.ibm.com/developerworks/web/library/wa-aj-jsfcss1/TableStyles.jpg" alt="" border="0" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/538/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/538/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/538/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=538&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2011/06/17/how-to-alternate-rowcolor-in-jsf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>

		<media:content url="http://www.ibm.com/developerworks/web/library/wa-aj-jsfcss1/TableStyles.jpg" medium="image" />
	</item>
		<item>
		<title>Women and IT &#8211; Capturing YouTube Videos</title>
		<link>http://itblackbelt.wordpress.com/2010/08/06/women-and-it-capturing-youtube-videos/</link>
		<comments>http://itblackbelt.wordpress.com/2010/08/06/women-and-it-capturing-youtube-videos/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 11:33:10 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[Women and IT - Capturing YouTube Videos]]></category>
		<category><![CDATA[YouTube]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=527</guid>
		<description><![CDATA[You could consider this as an alternative method to captureYouTube Videos.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=527&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://itblackbelt.files.wordpress.com/2010/08/youtube.jpg"><img class="aligncenter size-full wp-image-528" title="YouTube" src="http://itblackbelt.files.wordpress.com/2010/08/youtube.jpg?w=500" alt=""   /></a></p>
<p>You could consider this as an alternative method to captureYouTube Videos.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/527/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=527&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2010/08/06/women-and-it-capturing-youtube-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>

		<media:content url="http://itblackbelt.files.wordpress.com/2010/08/youtube.jpg" medium="image">
			<media:title type="html">YouTube</media:title>
		</media:content>
	</item>
		<item>
		<title>The 25 Best High-Tech Pranks</title>
		<link>http://itblackbelt.wordpress.com/2010/07/22/the-25-best-high-tech-pranks/</link>
		<comments>http://itblackbelt.wordpress.com/2010/07/22/the-25-best-high-tech-pranks/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 06:25:01 +0000</pubDate>
		<dc:creator>lrrp</dc:creator>
				<category><![CDATA[The 25 Best High-Tech Pranks]]></category>
		<category><![CDATA[High-Tech Pranks]]></category>

		<guid isPermaLink="false">http://itblackbelt.wordpress.com/?p=522</guid>
		<description><![CDATA[Everyone loves a good laugh, and in the age of electronics, high-tech hijinks are just waiting to be pulled off. So snuggle up to your screen and get ready to unleash all sorts of shenanigans as we present the 25 best high-tech pranks known to man. Our apologies in advance to your friends and co-workers. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=522&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Everyone loves a good laugh, and in the age of electronics, high-tech  hijinks are just waiting to be pulled off.  So snuggle up to your  screen and get ready to unleash all sorts of shenanigans as we present  the 25 best high-tech pranks known to man.  Our apologies in advance to  your friends and co-workers.</p>
<h2>1. The Restart Remap</h2>
<p>We start with one sure to throw off even the most advanced Windows  user.   Setup is simple and you need only a few seconds alone on  someone’s computer.  When you get a chance, sneak over and right-click  your pal’s icon to Internet Explorer or some other commonly used  program.  Edit the properties and change the target to:   “%windir%\system32\shutdown.exe -r -t 00″  Now, every time your buddy  tries to run IE, his machine will mysteriously restart — and your  laughter will instantly result.</p>
<h2>2. Startup Folder Fun</h2>
<p>While we’re on the topic of system startups, the Windows Startup  folder is a fantastic place for fun.  Create a text file with an amusing  message and throw it in there so your cubicle mate will get a daily  greeting — or, if you really want to get evil, add in the restart  shortcut from above (not recommended unless you just want to get your  ass kicked).</p>
<h2>3. Disappearing Desktop</h2>
<p>A classic computer prank never goes out of style.  The desktop image  trick has been around for a bit, but rest assured: There are plenty of  unsuspecting victims still to be found.  Just head over to an unattended  computer, minimize all the windows, and hit the Print Screen key.   Paste the captured image into any graphic editing program — even  Microsoft Paint will do — then save the file and set it as the desktop  background.  Then, all you have to do is hide the actual icons on the  desktop — put them in a folder somewhere — and your victim will try  endlessly to click the nonexistent icons, which are actually just part  of the background image.  For another variation, leave one program open  when you capture the screen and watch as the person tries to click on  it, type in it, and close it to no avail.</p>
<h2>4. Auto-Insult</h2>
<p>There are few things funnier than forcing a friend to insult himself —  and Microsoft has made it easy to do just that.  Take a moment to edit  the Autocorrect feature in your colleague’s Word or Outlook (it’s in the  Tools menu in both programs).  Add a new entry to replace their name  with “douche,” and watch how much more interesting all their emails and  documents will suddenly become.  A little creativity can take this one  in plenty of different and equally entertaining directions.</p>
<h2>5. Serius Buisness</h2>
<p>While you’re in the Word or Outlook settings, another good place to  tamper is the dictionary.  Replace a few correct words with common  misspellings just for giggles.  Just be sure to let this one play out  and get resolved before your co-worker sends any official memos to the  entire corporation.</p>
<h2>6. Annoying Audio</h2>
<p>A small investment will have a big payoff with the ThinkGeek <a rel="nofollow" href="http://www.thinkgeek.com/gadgets/electronic/8c52/">Annoy-a-Tron</a>.   This little $10 gadget can brighten even the dreariest of offices.  It  looks like a computer part, but when you flip the switch, this fella  sends out annoying beeps and buzzes at random intervals.  You can toggle  between different grating sounds, too.  The thing is magnetic, so you  just slap it on the back of someone’s computer and watch them try to  figure out where that awful noise is coming from (hint: they never  will).</p>
<h2>7. Phantom of the Office</h2>
<p>Taking the Annoy-a-Tron up a notch, the <a rel="nofollow" href="http://www.thinkgeek.com/gadgets/electronic/a11e/">Phantom Keystroker</a> actually plugs into a USB port and then makes random key presses or  mouse movements every few minutes.  You can control the frequency and  the kind of emissions.  For $25, this may be worth every penny —  especially if you can write it off as a business expense.</p>
<h2>8. Manual Control</h2>
<p>If your budget doesn’t have a tab for “pranking gadgets,” you can  always go the manual route and utilize the USB port to attach a second  mouse to a neighboring tower.  This works especially well with a person  across from you, if you can get under your desk and access the back of  their computer.  Plug in, wiggle away, and watch them squirm.  Added  points if you have a wireless mouse.</p>
<h2>9. The Speaker Swap</h2>
<p>Since you’re already under the desk, try out another switcheroo: the  speaker swap.  Just plug their speakers into your computer.  Now start  playing something like a low-frequency heartbeat sound on loop and see  how long they try to stop the nuisance on their computer.  For a more  powerful variation, don’t switch the actual wires, but instead just swap  out one of your speakers — preferably the one without the volume  control — with theirs.  Now they’ll still hear their own system sounds  from the remaining speaker, and as an added bonus, they’ll have no way  to control the volume of your annoying antics.</p>
<h2>10. The Wrath of Rotation</h2>
<p>A simple but quick and always amusing prank is putting the screen  rotation hotkeys to uses Microsoft never intended.  Just run by a  co-worker’s desk, reach over and hit Ctrl-Alt-up or down to rotate their  monitor orientation.  If you have some alone time, you can one-up it by  also going into the Control Panel and setting their mouse to  left-handed.  They’ll spend 10 minutes with their head tilted sideways  trying to figure out what the hell is going on.</p>
<h2>11. Mousing Around</h2>
<p>The laser mouse may have ended the era of mouse-ball stealing, but it  opened up another option.  Stick a few layered pieces of transparent  tape on the bottom side of your friend’s mouse to really mess with its  functionability.  Or, for bonus points, tape a small Post-It note that  says “Why won’t my mouse work?” over the laser.</p>
<h2>12. A Pointer Pointer</h2>
<p>Another great mouse prank awaits you in the Control Panel.  Under the  “Mouse” settings’ “Pointer” tab, change the default mouse pointer to  the hourglass.  Suddenly, the system is always busy working!  What’s  going on?!</p>
<h2>13. Mousing Around</h2>
<p>Spend some more time in the “Mouse” settings and you’ll find more fun  to be had.  Try switching out a pal’s primary and secondary button  functions for full confusion, or move the pointer speed to either  extreme fast or extreme slow to give them some extreme frustration.</p>
<h2>14. Phone Fun</h2>
<p>Let’s shift to the phone for a bit.  First, a service that never gets old: <a href="http://www.prankdial.com/">PrankDial.com</a>.   Just surf over and enter a friend’s phone number.  You can pick from a  bunch of different voices and styles, then enter any message you want,  and it’ll call them and say it aloud.  You can pull three of these  pranks every day at no charge, which ought to leave you plenty of  obnoxious options.</p>
<h2>15. Telephone Twist</h2>
<p>Two other sites bring a different twist to telephone troubles.  <a href="http://www.telespoof.com/">TeleSpoof.com</a> and <a rel="nofollow" href="http://www.telespoof.com/">SpoofCard.com</a> let you call anyone and have whatever number you want show up in  CallerID.  See how confused your girlfriend gets when you call her cell  phone…from her cell phone.  Each service only lets you make three calls  per phone number before they make you pay, but that’s enough to give you  ample amusement.  Oh, and it’s still legal, though that might change —  so get on this while you can.</p>
<h2>16. Bluetooth Blues</h2>
<p>“The Office” popularized our next prank, and man, is it ever a  winner.  Grab your co-worker’s cell phone when they leave it sitting  around and pair your Bluetooth headset up to it.  Now you can take and  make all their calls.  Jim Halpert, you are one wise dude.</p>
<h2>17. Customized Commotion</h2>
<p>Know anyone with the kind of cell phone that displays a customizable  message on the main screen?  This next one’s for them.  When you can, go  into their phone’s settings and change the message to “NO SERVICE.”   Guaranteed reaction upon their return.</p>
<h2>18. Remote Control</h2>
<p>Back to the computer for some more advanced antics.  This one may be  more suited for a close friend or significant other, as you’ll have to  install something, and you could probably get fired for doing it at  work.  Set up a VNC (virtual network computing) server on their system.   You can find free ones like <a rel="nofollow" href="http://www.tightvnc.com/">TightVNC</a> for Windows or <a rel="nofollow" href="http://www.redstonesoftware.com/vnc.html">OSXvnc</a> for Macs.  Once you get through the configuration, you can click, type,  and do anything on their system from your own computer.  Do some subtle  things like occasional keypresses or program launches and see how  perplexed they become.  We don’t recommend keeping this up for long,  though, or you may suffer serious consequences with their anger (and you  may also witness some disturbing pornographic habits as an unintended  side effect).</p>
<h2>19. The Modern-Day Poltergeist</h2>
<p>The less invasive alternative to that idea is a program called <a rel="nofollow" href="http://officepoltergeist.com/">Office Poltergeist</a>, and it’s now available as a simple <a rel="nofollow" href="http://officepoltergeist.com/mozilla.html">Firefox extension</a>.   Once you get this baby installed, you can play annoying sounds, load  new web pages, shake windows around, and send popup messages on someone  else’s computer.  It even has a feature to replace every instance of a  word on a web page with another word of your choosing.  We suggest  swapping “internet” for “intercourse.”</p>
<h2>20. Printing Power</h2>
<p>If you’re network-savvy, jot this next one down.  Do a little  investigative work and figure out where your office’s network printer  folder is located.  Once you have that nugget of info, you’re golden.   Navigate over to that path, select any printer, and click connect.  You  now have the power to print and send random paper messages to other  areas of your office with no explanation.</p>
<h2>21. Screen Scream</h2>
<p>Our next prank comes courtesy of Microsoft, surprisingly enough.  The programmers there released an office <a rel="nofollow" href="http://technet.microsoft.com/en-us/sysinternals/bb897558.aspx">“Blue Screen of Death” simulator</a>.   Install the screensaver on an unsuspecting IT guy’s PC and see the  feared symbol of system error pop up after a few minutes of inactivity.</p>
<h2>22. Bad Vision</h2>
<p>On the subject of screens, the Windows Control Panel provides our  next opportunity for mischief.  Go into the advanced settings and try  shifting the brightness all the way down and the contrast all the way up  if you really want to mess with a visionary’s vision.</p>
<h2>23. Crazy Keys</h2>
<p>Want to drive your friend crazy with his own keyboard?  Visit the  Regional and Language Settings under the Windows Control Panel for some  fun.  An arguably insane guy named <a rel="nofollow" href="http://en.wikipedia.org/wiki/August_Dvorak">August Dvorak</a> created an <a rel="nofollow" href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard">alternate keyboard layout</a> that — big surprise — never took off.  But you can still access it and  make normal typing impossible.  Just go under the Languages tab, click  Details, then Add, and you’ll find the option to <a rel="nofollow" href="http://www.microsoft.com/enable/training/windowsxp/keyboardlayout.aspx">completely remap the keyboard</a>.</p>
<h2>24. Rules of Pranking</h2>
<p>Outlook Rules, as a general rule, can make for great pranks.  Try  setting up one on your co-worker’s computer so that any email from you  causes a festive sound to be played, a hard copy to be printed, and a  copy to be instantly forwarded back to them for extra emphasis.  There  are plenty more variations you can try once that combo gets old.</p>
<h2>25. Hotkey Hell</h2>
<p>Our final prank may be the most tortuous of all.  A little program called <a rel="nofollow" href="http://www.autohotkey.com/">AutoHotKey</a> — quite the handy utility for legitimate purposes — lets you assign all  sorts of macros to key combinations of your choosing.  You don’t even  have to install anything on anyone else’s computer, as you create the  scripts on your own system and can then convert them to executable files  that you simply run on another machine.  With some very basic  scripting, you can cause any string of text to be automatically replaced  with something else, regardless of what program the person is in.  You  can also remap basic hotkeys like Ctrl-P to do anything you want — like  open Outlook and send a message to you letting you know how awesome you  are.  Spend some time with this one and you’ll find enough pranks to  keep your hijinks on high output.</p>
<p>So there you have it: the 25 best high-tech pranks.  Use them well  and use them wisely — and don’t come to us if anyone inflicts physical  harm upon you as a result.</p>
<p>(Tech Cult)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/itblackbelt.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/itblackbelt.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/itblackbelt.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=itblackbelt.wordpress.com&amp;blog=1695753&amp;post=522&amp;subd=itblackbelt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://itblackbelt.wordpress.com/2010/07/22/the-25-best-high-tech-pranks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0b61e6ecbf5c99a5d2660e9259e5d5dd?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lrrp</media:title>
		</media:content>
	</item>
	</channel>
</rss>
