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

<channel>
	<title>Jason B Herald &#187; Code</title>
	<atom:link href="http://jasonbherald.com/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasonbherald.com</link>
	<description>x = sin x</description>
	<lastBuildDate>Mon, 06 Sep 2010 23:09:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Flickr Flash Player</title>
		<link>http://jasonbherald.com/2008/12/28/flickr-flash-player/</link>
		<comments>http://jasonbherald.com/2008/12/28/flickr-flash-player/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 01:04:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Coolness]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/?p=133</guid>
		<description><![CDATA[I added a flickr flash player to the site under photos to replace the old flickrRSS feed reader which rarely worked. FYI If you want to do this to your site just use the following code and replace the user_id with yours (obtained here): < iframe align=center src=http://www.flickr.com/slideShow/index.gne?user_id=12345678@N00&#038;tags=foo frameBorder=0 width=500 scrolling=no height=500 > < /iframe [...]]]></description>
			<content:encoded><![CDATA[<p>I added a flickr flash player to the site under photos to replace the old flickrRSS feed reader which rarely worked.  FYI If you want to do this to your site just use the following code and replace the user_id with yours (obtained <a href="http://idgettr.com/">here</a>):</p>
<blockquote><pre><code>
< iframe align=center
   src=http://www.flickr.com/slideShow/index.gne?user_id=12345678@N00&#038;tags=foo frameBorder=0
   width=500 scrolling=no height=500 >
< /iframe >
</code></pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/12/28/flickr-flash-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uptime</title>
		<link>http://jasonbherald.com/2008/12/13/uptime/</link>
		<comments>http://jasonbherald.com/2008/12/13/uptime/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 00:15:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Coolness]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/2008/12/13/uptime/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/jasonherald/3106137342/"></a></p>
<p><a href="http://www.flickr.com/photos/jasonherald/3106137342/"><img src="http://farm4.static.flickr.com/3126/3106137342_0e0ba71e21_m.jpg" border="0" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/12/13/uptime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aop</title>
		<link>http://jasonbherald.com/2008/09/27/aop-2/</link>
		<comments>http://jasonbherald.com/2008/09/27/aop-2/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 01:40:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AOP]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/?p=81</guid>
		<description><![CDATA[K so I was going to have an entire AOP example finished tonight but the family ended up stopping by to see the new baby &#60;excuses, excuses&#62; which means the example will have to come tomorrow.  However here is a great synopsis on aspectj to tide you over till then (I want my AOP!): Part [...]]]></description>
			<content:encoded><![CDATA[<p>K so I was going to have an entire AOP example finished tonight but the family ended up stopping by to see the new baby &lt;excuses, excuses&gt; which means the example will have to come tomorrow.  However here is a great synopsis on aspectj to tide you over till then (I want my AOP!):</p>
<ul>
<li><a href="http://www.javaworld.com/javaworld/jw-01-2002/jw-0118-aspect.html">Part 1. Separate software concerns with aspect-oriented programming</a></li>
<li><a href="http://www.javaworld.com/javaworld/jw-03-2002/jw-0301-aspect2.html">Part 2. Learn AspectJ to better understand aspect-oriented programming</a></li>
<li><a href="http://www.javaworld.com/javaworld/jw-04-2002/jw-0412-aspect3.html">Part 3. Use AspectJ to modularize crosscutting concerns in real-world problems</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/09/27/aop-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java, Struts and Outputing an Excel File</title>
		<link>http://jasonbherald.com/2008/09/14/java-struts-and-outputing-an-excel-file/</link>
		<comments>http://jasonbherald.com/2008/09/14/java-struts-and-outputing-an-excel-file/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 14:59:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/?p=71</guid>
		<description><![CDATA[In a project I was working on last night I needed to output sets of data on demand in excel.  I found various ways to do this however this was the most simplistic and worked every time on all my computers. (Mac, Linux, XP). response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition","inline" ); Those 2 lines make the instant translation of [...]]]></description>
			<content:encoded><![CDATA[<p>In a project I was working on last night I needed to output sets of data on demand in excel.  I found various ways to do this however this was the most simplistic and worked every time on all my computers. (Mac, Linux, XP).</p>
<blockquote>
<pre>response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","inline" );
</pre>
</blockquote>
<p>Those 2 lines make the instant translation of the HTML I put in the page go to excel.  Now something massive to remember here: The formatting is pretty unpredictable if you use css or any fruity styles.  Luckally in my case I didn't need to use either; just output the data.</p>
<p>In either case you simply draw the HTML as you would to output a basic page with the response lines telling your browser that excel owns the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/09/14/java-struts-and-outputing-an-excel-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Reflection</title>
		<link>http://jasonbherald.com/2008/05/13/java-reflection/</link>
		<comments>http://jasonbherald.com/2008/05/13/java-reflection/#comments</comments>
		<pubDate>Wed, 14 May 2008 01:54:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/?p=33</guid>
		<description><![CDATA[In a project I was confronted with a reason to use Java Reflection. What I found was a way to dynamically scale a class to find out its variables, methods, etc. During this process fortunately we changed gears and moved away from the design which was forcing this way of thinking. I have, ever since, [...]]]></description>
			<content:encoded><![CDATA[<p>In a project I was confronted with a reason to use Java Reflection.  What I found was a way to dynamically scale a class to find out its variables, methods, etc.  During this process fortunately we changed gears and moved away from the design which was forcing this way of thinking.  I have, ever since, been looking into it more and more and trying to discover why it isn't more commonly used.  Aside from the inherent complexity and detracting from readability I found a list of "draw backs" to using reflection which I will paste below: </p>
<p><a href="http://java.sun.com/docs/books/tutorial/reflect/" target="_blank">http://java.sun.com/docs/books/tutorial/reflect/</a></p>
<hr /><strong>Drawbacks of Reflection</strong></p>
<p> </p>
<p>Reflection is powerful, but should not be used indiscriminately. If it is possible to perform an operation without using reflection, then it is preferable to avoid using it. The following concerns should be kept in mind when accessing code via reflection.</p>
<dl>
<dt><strong>Performance Overhead</strong></dt>
<dd>Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not be performed. Consequently, reflective operations have slower performance than their non-reflective counterparts, and should be avoided in sections of code which are called frequently in performance-sensitive applications.</dd>
<dt><strong>Security Restrictions</strong></dt>
<dd>Reflection requires a runtime permission which may not be present when running under a security manager. This is in an important consideration for code which has to run in a restricted security context, such as in an Applet.</dd>
<dt><strong>Exposure of Internals</strong></dt>
<dd>Since reflection allows code to perform operations that would be illegal in non-reflective code, such as accessing <code>private</code> fields and methods, the use of reflection can result in unexpected side-effects, which may render code dysfunctional and may destroy portability. Reflective code breaks abstractions and therefore may change behavior with upgrades of the platform.</dd>
</dl>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/05/13/java-reflection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annotations</title>
		<link>http://jasonbherald.com/2008/05/12/annotations/</link>
		<comments>http://jasonbherald.com/2008/05/12/annotations/#comments</comments>
		<pubDate>Tue, 13 May 2008 02:35:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[EJB]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[JPA]]></category>

		<guid isPermaLink="false">http://jasonbherald.com/?p=28</guid>
		<description><![CDATA[After starting my new job I have been working alot with Java Annotations (EJB) so below is a quick reference of the 4 Common Data ones.  This information has been taken partly from the Java Documentation and from my own Experience using both JPA and Hibernate.  Each of the examples below deals with 2 Classes [...]]]></description>
			<content:encoded><![CDATA[<p>After starting my new job I have been working alot with Java Annotations (EJB) so below is a quick reference of the 4 Common Data ones.  This information has been taken partly from the Java Documentation and from my own Experience using both JPA and Hibernate.  Each of the examples below deals with 2 Classes which we will call class_1 and class_2 affectionately.  </p>
<p><strong>@OneToMany -&gt; @ManyToOne</strong><br />
A class_1 can have many class_2</p>
<blockquote><p>@OneToMany(targetEntity=com.class_2.class, cascade=ALL, fetch=FetchType.EAGER)<br />
@JoinColumn(name="class_2_id")<br />
private Set&lt;class_2&gt; c2s = new HashSet();</p>
<p>&lt;flip side&gt;</p>
<p>@ManyToOne(targetEntity=com.class_1.class, cascade=ALL, fetch=FetchType.EAGER)<br />
@JoinColumn(name="class_2_id", updatable=false, insertable=false)<br />
private class_1 c1; </p></blockquote>
<p><strong>@OneToOne</strong><br />
A class_1 can have one class_2</p>
<blockquote><p>private class_2 c2;</p>
<p>&lt;flip side&gt;</p>
<p>@OneToOne (targetEntity=struts.hibernate.model.class_1.class, fetch=FetchType.EAGER, mappedBy="c2")<br />
private class_1 c1; </p></blockquote>
<p><strong>@ManyToMany</strong><br />
A class_1 can have many class_2 and a class_2 can have many class_1<br />
*Note - This configuration uses a join table</p>
<blockquote><p>@ManyToMany<br />
@JoinTable(name="class_1_to_class_2"<br />
 joinColumns=<br />
@JoinColumn(name="class_1_id", referencedColumnName="ID"),<br />
inverseJoinColumns=<br />
@JoinColumn(name="class_2_id", referencedColumnName="ID"))<br />
private Set&lt;class_2&gt; c2s = new HashSet();</p>
<p>&lt;flip side&gt;</p>
<p> </p>
<p>@ManyToMany<br />
@JoinTable(name="class_1_to_class_2"<br />
 joinColumns=<br />
@JoinColumn(name="class_2_id", referencedColumnName="ID"),<br />
inverseJoinColumns=<br />
@JoinColumn(name="class_1_id", referencedColumnName="ID"))<br />
private Set&lt;class_1&gt; c1s = new HashSet();</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jasonbherald.com/2008/05/12/annotations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
