<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. https://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="https://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:java_dev</id>
  <title>Java developers</title>
  <subtitle>Java developers</subtitle>
  <author>
    <name>Java developers</name>
  </author>
  <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/"/>
  <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom"/>
  <updated>2014-06-09T19:20:44Z</updated>
  <lj:journal userid="183947" username="java_dev" type="community"/>
  <link rel="service.feed" type="application/x.atom+xml" href="https://java-dev.livejournal.com/data/atom" title="Java developers"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:404446</id>
    <author>
      <name>underscorer</name>
    </author>
    <lj:poster user="underscorer" userid="71173562"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/404446.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=404446"/>
    <title>Need help again </title>
    <published>2014-06-09T19:20:44Z</published>
    <updated>2014-06-09T19:20:44Z</updated>
    <content type="html">I'm following this tutorial on the netbeans website for a simpleEE7App. I followed the instructions precisely but got an exception need help. :/&lt;br /&gt;&lt;br /&gt;&lt;a target='_blank' href='https://netbeans.org/kb/docs/javaee/javaee-gettingstarted.html' rel='nofollow'&gt;https://netbeans.org/kb/docs/javaee/javaee-gettingstarted.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://ic.pics.livejournal.com/underscorer/71173562/280/280_900.png" alt="Screenshot (35)" title="Screenshot (35)" fetchpriority="high"&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:403744</id>
    <author>
      <name>underscorer</name>
    </author>
    <lj:poster user="underscorer" userid="71173562"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/403744.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=403744"/>
    <title>i need help</title>
    <published>2014-06-07T02:29:11Z</published>
    <updated>2014-06-07T02:29:11Z</updated>
    <content type="html">anyone here?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:403660</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/403660.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=403660"/>
    <title>Always something new to learn</title>
    <published>2014-04-04T13:50:00Z</published>
    <updated>2014-04-04T13:50:00Z</updated>
    <content type="html">It seems that you can override a concrete method and make it abstract. I actually came across some code that did this, so I had to check how it worked. Consider the following: &lt;pre&gt;abstract class Grandfather
{
   protected String speak ()
   {
      return ( "I'm old" );
   }
}

abstract class Father
   extends Grandfather
{
   @Override
   protected abstract String speak ();
}

public class Child
   extends Father
{
   @Override
   protected String speak ()
   {
      return ( "I'm young" );
   }

   public static void main ( final String [] args )
   {
      System.out.println ( new Child ().speak () );
   }
}&lt;/pre&gt; It prints "I'm young" (unsurprisingly) but the interesting part is that despite &lt;code&gt;Grandfather&lt;/code&gt; defining a &lt;code&gt;speak&lt;/code&gt; method, &lt;code&gt;Father&lt;/code&gt; is forcing &lt;code&gt;Child&lt;/code&gt; to re-implement it. &lt;code&gt;Grandfather&lt;/code&gt;'s &lt;code&gt;speak&lt;/code&gt; method can't be called by &lt;code&gt;Child&lt;/code&gt; because &lt;code&gt;Father&lt;/code&gt; has made it abstract. I had to test that this worked by commenting out some of the &lt;code&gt;speak&lt;/code&gt; methods. It really is the case that &lt;code&gt;Grandfather&lt;/code&gt; has an implementation but &lt;code&gt;Father&lt;/code&gt; doesn't.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:403240</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/403240.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=403240"/>
    <title>Heads up for people who write webstart or applets</title>
    <published>2013-10-21T15:50:12Z</published>
    <updated>2013-10-21T15:52:13Z</updated>
    <content type="html">&lt;a target='_blank' href='http://stackoverflow.com/questions/19481826/java-7u51-will-not-accept-jnlp-with-self-signed-certificate' rel='nofollow'&gt;http://stackoverflow.com/questions/19481826/java-7u51-will-not-accept-jnlp-with-self-signed-certificate&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You used to be able to sign your code with a self-signed certificate. It's close to not signing it at all, but the user could then agree to trust you for ever more. I have a few webstart apps publicly available, and more at work. Soon they will stop working. My choices will be: &lt;ul&gt;&lt;li&gt;pay hundreds of dollars for a proper certificate (extremely unlikely)&lt;/li&gt;&lt;li&gt;persuade the users to install "Deployment Rule Sets" to allow my stuff to run (almost as unlikely)&lt;/li&gt;&lt;li&gt;get the users to run the code locally without webstart (completely insecure, and I'll probably need to make an installer)&lt;/li&gt;&lt;/ul&gt; I don't see who wins here.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:403022</id>
    <author>
      <name>Aardvarks anonymous</name>
    </author>
    <lj:poster user="n5iln" userid="4644"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/403022.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=403022"/>
    <title>Random Question</title>
    <published>2013-07-12T16:45:19Z</published>
    <updated>2013-07-12T16:45:19Z</updated>
    <content type="html">Okay, Geek Trust. I posed this on my personal LJ, but this seems like a good place to mirror the question, so I'll ask here too.&lt;br /&gt;&lt;br /&gt;The opinion has come across my screen that most programmers don't utilize more than 40% of a given language's capabilities. Is that estimate low, high, or pretty much spot-on?&lt;br /&gt;&lt;br /&gt;Discuss.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:398590</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/398590.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=398590"/>
    <title>WebStart/JNLP question</title>
    <published>2012-07-17T15:50:10Z</published>
    <updated>2012-11-05T10:48:48Z</updated>
    <content type="html">I have set up some WebStart apps which work fine except for one thing: they never check for updates, despite me setting the relevant options (as far as I can tell).&lt;br /&gt;&lt;br /&gt;The shortcuts that are installed for the user have the option &lt;tt&gt;-localfile&lt;/tt&gt;. This isn't documented anywhere I can find, but it seems specifically to prevent WebStart from checking for updates. If I remove this, there's an update check every time.&lt;br /&gt;&lt;br /&gt;Any suggestions?&lt;br /&gt;&lt;br /&gt;I'm reading JNLP docs here: &lt;a target='_blank' href='http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html' rel='nofollow'&gt;http://docs.oracle.com/javase/6/docs/technotes/guides/javaws/developersguide/syntax.html&lt;/a&gt;&lt;br /&gt;An example JNLP file is here: &lt;a target='_blank' href='http://j_banana.users.sourceforge.net/ws/retest/retest.jnlp' rel='nofollow'&gt;http://j_banana.users.sourceforge.net/ws/retest/retest.jnlp&lt;/a&gt; - right click and save to prevent the app installing and starting up.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Edit:&lt;/b&gt; I think I found the problem. Looks like &lt;code&gt;&amp;lt;shortcut online='false'&amp;gt;&lt;/code&gt; causes &lt;tt&gt;-localfile&lt;/tt&gt; and &lt;code&gt;&amp;lt;shortcut online='true'&amp;gt;&lt;/code&gt; doesn't. I was assuming that that attribute meant "only run on line", but looks like it doesn't. The JNLP docs linked above doesn't seem very clear on this.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:398245</id>
    <author>
      <name>ruik-ruik! röhh-röhh!</name>
    </author>
    <lj:poster user="raydac" userid="11465707"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/398245.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=398245"/>
    <title>a MindMap to tune the Java Performance</title>
    <published>2012-07-08T22:26:30Z</published>
    <updated>2012-07-08T22:26:30Z</updated>
    <category term="java performance"/>
    <content type="html">It is presented as a big PNG file (1 Mb), based on presentations of engineers of Oracle&amp;#39;s SPb (Russia) branch and some information from the internet&lt;br /&gt;&lt;a href="http://igormaznitsa.com/mindmaps/JavaPerformanceMindMap.png" target="_blank" rel="nofollow"&gt;http://igormaznitsa.com/mindmaps/JavaPerformanceMindMap.png&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:397974</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/397974.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=397974"/>
    <title>Looping backwards</title>
    <published>2012-06-01T19:35:10Z</published>
    <updated>2013-07-01T13:54:43Z</updated>
    <content type="html">I just came across a nice syntactic trick for looping backwards over an array:&lt;br /&gt;&lt;pre&gt;public class Decr {
   public static void main( String[] args ) {
      char[] array = { 'a', 'b', 'c' };

      // Traditional way
      for ( int i = array.length - 1; i &amp;gt;= 0; i-- ) {
         System.out.println( array[ i ] );
      }

      // "Start at the end, i goes to zero"
      for ( int i = array.length; i --&amp;gt; 0;  ) {
         System.out.println( array[ i ] );
      }
   }
}&lt;/pre&gt; It might look as if I invented an operator, but &lt;code&gt;i --&amp;gt; 0&lt;/code&gt; would normally be written as &lt;code&gt;i-- &amp;gt; 0&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;BTW, what happened to &lt;span  class="ljuser  i-ljuser  i-ljuser-type-C     "  data-ljuser="java_dev" lj:user="java_dev" &gt;&lt;a href="https://java-dev.livejournal.com/profile/"  target="_self"  class="i-ljuser-profile" &gt;&lt;img  class="i-ljuser-userhead"  src="https://l-stat.livejournal.net/img/community.png?v=556&amp;v=924" /&gt;&lt;/a&gt;&lt;a href="https://java-dev.livejournal.com/" class="i-ljuser-username"   target="_self"   &gt;&lt;b&gt;java_dev&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;? It used to be lively here, but no one posts any more. Did all the Java developers leave LJ?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:397732</id>
    <author>
      <name>ruik-ruik! röhh-röhh!</name>
    </author>
    <lj:poster user="raydac" userid="11465707"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/397732.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=397732"/>
    <title>Multi-pass Java Preprocessor with ANT and Maven support </title>
    <published>2011-12-04T20:42:16Z</published>
    <updated>2011-12-04T20:42:16Z</updated>
    <category term="jcp"/>
    <content type="html">Helllo all, I am glad to notify you that I have published the new very deep refactored version of my old JCP preprocessor for Java, nowadays it supports ANT&amp;nbsp; and Maven but also can be called&amp;nbsp; through CLI. I have used the product for dozens of projects as a code generator when I was involved in mobile development. It is a multi-pass preprocessor with loop support, it saves its directives in comment lines so you can use it with any popular IDE. It is an open source project.&lt;br /&gt;&lt;a target='_blank' href='http://code.google.com/p/java-comment-preprocessor/' rel='nofollow'&gt;http://code.google.com/p/java-comment-preprocessor/&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:397429</id>
    <author>
      <name>ska-o</name>
    </author>
    <lj:poster user="ska_o" userid="503677"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/397429.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=397429"/>
    <title>PNG metadata</title>
    <published>2011-11-30T08:49:52Z</published>
    <updated>2011-11-30T20:59:15Z</updated>
    <content type="html">Does anyone know of a way (hopefully a simple way) to add metadata, especially non-standard tags, to a PNG file? I'm working on a project that involves using a lot of high-bit-depth B&amp;W images from a microscope, and the best format so far seems to be PNG. The camera produces uncompressed TIFF.&lt;br /&gt;&lt;br /&gt;I've mostly been working with ImageJ for this project but had to use a little workaround to convert to PNG correctly.&lt;br /&gt;&lt;br /&gt;Anything with lossy compression, such a JPEG, will not work. PNG is very convenient but I haven't figured out the support for metadata.&lt;br /&gt;&lt;br /&gt;Compressed TIFF may also work, although compression is probably worse, and I'm not totally sure it's going to be easy to write the non-standard tags.&lt;br /&gt;&lt;br /&gt;Any advice?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:397270</id>
    <author>
      <name>ska-o</name>
    </author>
    <lj:poster user="ska_o" userid="503677"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/397270.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=397270"/>
    <title>stack overflow crash</title>
    <published>2011-08-25T09:58:46Z</published>
    <updated>2011-08-25T09:58:46Z</updated>
    <content type="html">Hi all,&lt;br /&gt;&lt;br /&gt;Can anyone suggest a way to dump the stack trace just when the JVM crashes due to stack overflow error?&lt;br /&gt;&lt;br /&gt;I know it's possible and I've done it before, but it's been a while. It could have been with a third-party tool like YourKit, or maybe there are some well-hidden JVM options for that? Can't find anything right now.&lt;br /&gt;&lt;br /&gt;I could create an error handler that would try to dump the stack trace for every thread; not sure if that would work.&lt;br /&gt;&lt;br /&gt;The code that's crashing is not mine and it's pretty complicated, and while the basic reason for this error is pretty obvious, it won't be easy to find without the stack trace. It runs for a few hours before it gets the error, and at least in the beginning the stack looks OK.&lt;br /&gt;&lt;br /&gt;Hopefully, there is a simple way to get it at the moment of the crash.&lt;br /&gt;&lt;br /&gt;Any ideas will be appreciated.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:396862</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/396862.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=396862"/>
    <title>Snippet of the day</title>
    <published>2011-06-10T15:51:34Z</published>
    <updated>2011-06-10T15:51:34Z</updated>
    <content type="html">Just came across this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;"FS".toUpperCase()&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Yes, that should make doubly sure it's in upper case.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:396730</id>
    <author>
      <name>Gay But Not Narrow</name>
    </author>
    <lj:poster user="ruakh" userid="526523"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/396730.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=396730"/>
    <title>The ternary operator.</title>
    <published>2011-06-06T00:09:14Z</published>
    <updated>2011-06-06T00:55:15Z</updated>
    <content type="html">I'm helping a new co-worker, fresh out of college, become familiar with our products. For one of the tasks he's been assigned, I was showing him how I would go about it, and part of my sample code used the ternary (conditional) operator &amp;mdash; the &lt;tt&gt;&lt;var&gt;b&lt;/var&gt; ? &lt;var&gt;e1&lt;/var&gt; : &lt;var&gt;e2&lt;/var&gt;&lt;/tt&gt; notation. As it turns out, he had never encountered that notation before, and I had to explain it to him. I'm wondering &amp;mdash; is that normal? He's a smart guy, and he had no problem understanding the notation once I explained it, but I was surprised that he wasn't already familiar with it.&lt;br /&gt;&lt;br /&gt;I know that the ternary operator is sometimes considered bad style, but this case really seemed to be crying out for it &amp;mdash; two versions of a large SQL statement, with only one small difference in the middle. This seemed the clearest and most readable way to code it. But if I can't expect people to be familiar with that operator, then I can't expect that code to be clear to them!&lt;br /&gt;&lt;br /&gt;What do y'all think? &lt;b&gt;Would you expect the typical Java programmer to be familiar and comfortable with it?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;(With normal simple cases, I mean, like &lt;tt&gt;(b ? "string_literal_1" : "string_literal_2")&lt;/tt&gt; and whatnot. Obviously I wouldn't expect people to be comfortable with crazy edge cases, like when autoboxing or implicit widening conversions are involved.)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:396032</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/396032.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=396032"/>
    <title>Spring object pooling woes</title>
    <published>2011-04-05T09:37:14Z</published>
    <updated>2011-04-05T09:40:17Z</updated>
    <content type="html">Spring's AOP support says that it includes object pooling. If you're using Spring and you have some object that is expensive to create, you can make a pool of some re-usable instances, and &lt;a href="http://static.springsource.org/spring/docs/2.5.x/reference/aop-api.html#aop-ts-pool" target="_blank" rel="nofollow"&gt;the documentation has an example of how to create a pool&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But according to my testing, the pool returns the same instance every time. Oops.&lt;br /&gt;&lt;br /&gt;I found an old (2004) &lt;a href="http://www.jroller.com/RickHigh/entry/working_with_spring_object_pools" target="_blank" rel="nofollow"&gt;blog entry about this problem&lt;/a&gt; which included the a suggestion about making it work: &lt;pre style="font-size:80%;overflow:auto"&gt;&amp;lt;bean id="businessObject"
      class="org.springframework.aop.framework.ProxyFactoryBean"&amp;gt;
  &amp;lt;property name="targetSource" ref="poolTargetSource" /&amp;gt;
  &lt;b&gt;&amp;lt;!-- Added the following line --&amp;gt;&lt;/b&gt;
  &lt;b&gt;&amp;lt;property name="singleton" value="false" /&amp;gt;&lt;/b&gt;
&amp;lt;/bean&amp;gt;&lt;/pre&gt; This does indeed make the pool return different instances. But it doesn't explain how instances get returned to the pool. I was hoping that some Spring magic would occur to make this happen, but no. What seems to happen is that eventually the pool hands out an instance that has been used before, and it doesn't take many concurrent threads until your app gets into trouble because the same instance is used twice at once. Ouch.&lt;br /&gt;&lt;br /&gt;So, Spring object pooling appears broken, unless you know better...</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:395936</id>
    <author>
      <name>crazylikefox</name>
    </author>
    <lj:poster user="crazylikefox" userid="1674914"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/395936.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=395936"/>
    <title>Introduction &amp; Questions</title>
    <published>2011-01-13T03:17:15Z</published>
    <updated>2011-01-13T03:17:15Z</updated>
    <content type="html">Hello :)&lt;br /&gt;&lt;br /&gt;I have recently started adventuring into the Java sphere.&amp;nbsp; I am a n00blet.&amp;nbsp; I enjoy firearms, belly dancing, and linguistics.&amp;nbsp; When it comes to the geek arts I am still a novice.&amp;nbsp; That being said, I am working on learning more, and currently am on hour ten of &amp;quot;Sams Teach Yourself Java in 24 Hours&amp;quot;.&amp;nbsp; It has to do with creating objects.&amp;nbsp; Hour 9 was very intense with multidimensional arrays.&amp;nbsp; I still have questions on those.&lt;br /&gt;&lt;br /&gt;They say to be a good programmer you have to be good with logic puzzles.&amp;nbsp; So here is a puzzle I would like help with, if you guys have the time.&lt;br /&gt;&lt;br /&gt;Here is the original code from hour 7, which is using conditional tests to make decisions:&lt;br /&gt;&lt;br /&gt;&lt;a target='_blank' href='http://workbench.cadenhead.org/book/java-6-24-hours/source/chapter7/NoteGrade1.java' rel='nofollow'&gt;http://workbench.cadenhead.org/book/java-6-24-hours/source/chapter7/NoteGrade1.java&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What I am trying to do is modify it a little here:&lt;br /&gt;&lt;br /&gt;package Java24;&lt;br /&gt;import java.util.Scanner;&lt;br /&gt;&lt;br /&gt;class Grade {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scanner langi = new Scanner(System.in);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int grade = 24242424;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (grade &amp;gt; 89)&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;You got an A. Great job!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (grade &amp;gt; 79) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;You got a B. Good work!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (grade &amp;gt; 69) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;You got a C. You'll never get into a good college!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (grade &amp;lt;= 101) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;You are a fool.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;You got an F. You'll do well in Congress!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Two things I am trying to do:&lt;br /&gt;&lt;br /&gt;1.&amp;nbsp; I am trying to get the program to ask me what my number grade was instead of putting a number directly into the code with int grade = 24242424.&amp;nbsp; Haven't been successful yet.&lt;br /&gt;&lt;br /&gt;2.&amp;nbsp; I am trying to have the program output &amp;quot;You are a fool.&amp;quot; if you put in a score higher than 100.&amp;nbsp; Right now it is just seeing that the score is higher than 89 and prints the line and that is the end of it.&lt;br /&gt;&lt;br /&gt;Any help would be greatly appreciated!&lt;br /&gt;&lt;br /&gt;Thanks :)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:395086</id>
    <author>
      <name>mrflash818</name>
    </author>
    <lj:poster user="mrflash818" userid="14542216"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/395086.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=395086"/>
    <title>Debian Lenny and Eclipse v3.2 bugfix</title>
    <published>2010-10-02T16:55:54Z</published>
    <updated>2010-10-02T16:55:54Z</updated>
    <category term="eclipse"/>
    <category term="debian"/>
    <category term="bugfix"/>
    <category term="lenny"/>
    <content type="html">Fired up eclipse v3.2 in Debian lenny stable, ...and received error messages! oh no!&lt;br /&gt;&lt;br /&gt;&amp;quot;robert@pip:~$ eclipse&lt;br /&gt;searching for compatible vm...&lt;br /&gt;&amp;nbsp; testing /usr/lib/jvm/java-6-openjdk...not found&lt;br /&gt;&amp;nbsp; testing /usr/lib/jvm/java-gcj...found&lt;br /&gt;/usr/lib/jvm/java-gcj/bin/java: symbol lookup error: /home/robert/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/bundles/149/1/.cp/libswt-mozilla-gtk-3236.so: undefined symbol: _ZN4nsID5ParseEPKc&amp;quot;&lt;br /&gt;&lt;br /&gt;Okay, then did a quick google search on the phrase &amp;quot;libswt-mozilla-gtk-3236.so: undefined symbol&amp;quot;&lt;br /&gt;&lt;br /&gt;Which led me to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511713&lt;br /&gt;&amp;quot;install&lt;br /&gt;&lt;pre class=""&gt;
  xulrunner-dev 

and eclipse 3.2.2-6.1 should start under lenny.&amp;quot;
&lt;/pre&gt;So I then did robert@pip:~$ sudo aptitude install xulrunner-dev&lt;br /&gt;&lt;br /&gt;Now eclipse v3.2 fires up fine in my Debian Lenny stable workstation.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:394970</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/394970.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=394970"/>
    <title>Incomprehensibility</title>
    <published>2010-07-26T13:52:56Z</published>
    <updated>2010-07-26T13:52:56Z</updated>
    <category term="rant"/>
    <content type="html">Today I was trying to run a web app written elsewhere. Everything came pre-built, and Tomcat was included. Should be a piece of cake, eh? &lt;blockquote&gt;SEVERE: Error filterStart&lt;/blockquote&gt; Googling that found a lot of people with this problem, each with a different resolution.&lt;br /&gt;&lt;br /&gt;The real problem is that the error message &lt;em&gt;means nothing&lt;/em&gt;. Sadly, this is normal. Everything that requires XML configuration (Tomcat, JBoss, Swing, Struts, etc. etc. etc.) will fail if you don't know all its arcane configuration rules, and give you an error that doesn't tell you what the problem is so you can't fix it.&lt;br /&gt;&lt;br /&gt;When your software goes wrong, &lt;em&gt;tell me what the problem is&lt;/em&gt;. Don't join the useless, time wasting, exasperating tidal wave of incomprehensible dross.&lt;br /&gt;&lt;br /&gt;So, the upshot of this is that I shall never find out if &lt;a href="http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/products/hammurapi/index.html" target="_blank" rel="nofollow"&gt;Hammurapi&lt;/a&gt; is any use.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:394227</id>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/394227.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=394227"/>
    <title>Quiz of the day</title>
    <published>2010-05-06T10:51:51Z</published>
    <updated>2010-05-06T10:51:51Z</updated>
    <content type="html">What is the output?&lt;br /&gt;&lt;pre&gt;public class SystemExit{
   public static void main(String... args){
      Runtime.getRuntime().addShutdownHook(new Thread(){
         public void run(){
            System.out.println("Message 2");
         }
      });
      try{
         System.exit(99);
      }finally{
         System.out.println("Message 1");
      }
   }
}&lt;/pre&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:393807</id>
    <author>
      <name>anna_mryglo</name>
    </author>
    <lj:poster user="anna_mryglo" userid="25748949"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/393807.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=393807"/>
    <title>Looking for java/j2ee developer in Kiev</title>
    <published>2010-04-27T13:23:53Z</published>
    <updated>2010-04-27T13:23:53Z</updated>
    <content type="html">&lt;a target='_blank' href='http://anna-mryglo.livejournal.com/1507.html'&gt;http://anna-mryglo.livejournal.com/1507.html&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:393083</id>
    <author>
      <name>Sabrina</name>
    </author>
    <lj:poster user="sophiaserpentia" userid="608169"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/393083.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=393083"/>
    <title>starting a server and client using ant</title>
    <published>2010-04-11T03:38:58Z</published>
    <updated>2010-04-11T03:38:58Z</updated>
    <content type="html">What I want to do is to run a JUnit test on a class that uses a socket connection to a server, from within an Ant build.xml.  Naturally, to test the client socket, it first has to open a serverSocket that waits for input from a client.  What's happening is that Ant opens the serverSocket, and then hangs along with the server waiting for input from a client.  It doesn't move on to the next task, which is to run the JUnit test.&lt;br /&gt;&lt;br /&gt;I thought perhaps that adding 'fork="true"' should do the trick, since (so I understand) it should start both server and client classes in different instances of the JVM.  That isn't working, though.&lt;br /&gt;&lt;br /&gt;This seems like it should be a pretty routine thing.  It works if I open the server manually and then run the JUnit tests.  But not from within Ant.&lt;br /&gt;&lt;br /&gt;Thanks in advance for any assistance!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:392872</id>
    <author>
      <name>Мишка</name>
    </author>
    <lj:poster user="tarlog" userid="1875303"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/392872.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=392872"/>
    <title>Hibernate Coding Guidelines</title>
    <published>2010-03-25T11:32:56Z</published>
    <updated>2010-03-25T11:32:56Z</updated>
    <content type="html">Dear Java developers,&lt;br /&gt;Especially these of you who are using Hibernate. I have recently posted to my blog some coding guidelines for the beginners, who start using Hibernate. I would really like as many people as possible to review these guidelines and leave me comments if the guidelines make sense, and what guidelines you use in your organization when working with Hibernate.&lt;br /&gt;&lt;br /&gt;You will find the link to the actual post under the lj-cut. I put it there, since I do not want anyone to click on it accidentally and then blaming me for an implicit advertisement. Go there only if you are really want to :-)&lt;br /&gt;&lt;br /&gt;&lt;a href="http://tarlogonjava.blogspot.com/2010/03/hibernatejpa-best-practices.html" target="_blank" rel="nofollow"&gt;Hibernate Coding Guidelines&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You are welcome to provide any feedback either here or directly in my blog - Livejournal's OpenID can be used, if you don't have a user in Blogger.&lt;br /&gt;&lt;a name='cutid1-end'&gt;&lt;/a&gt;&lt;br /&gt;Thank you!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:392660</id>
    <author>
      <name>Бова Николай (Мик) Петрович (Chanting Wolf)</name>
    </author>
    <lj:poster user="main_framer" userid="13059296"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/392660.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=392660"/>
    <title>Looking for a job. java team lead / system architect</title>
    <published>2010-03-13T09:53:18Z</published>
    <updated>2010-03-13T09:53:18Z</updated>
    <content type="html">Hi! &lt;br /&gt;&lt;br /&gt;At the moment I am looking for a job of java team lead / system architect. &lt;br /&gt;CV &lt;br /&gt;&lt;a target='_blank' href='http://www.chantingwolf.narod.ru/cv8en.doc' rel='nofollow'&gt;http://www.chantingwolf.narod.ru/cv8en.doc&lt;/a&gt; &lt;br /&gt;LinkedIN profile &lt;br /&gt;&lt;a target='_blank' href='http://www.linkedin.com/in/mykbova' rel='nofollow'&gt;http://www.linkedin.com/in/mykbova&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;-Mykola</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:392374</id>
    <author>
      <name>-</name>
    </author>
    <lj:poster user="simbab" userid="11155375"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/392374.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=392374"/>
    <title>Writing to a file from multiple threads</title>
    <published>2010-02-20T15:16:44Z</published>
    <updated>2010-02-20T18:35:35Z</updated>
    <content type="html">So I have this assignment for my Java class, which is to write to a (single)&amp;nbsp;file from multiple threads: the main thread and then multiple copies of a MyThread class. I spent an hour last night apparently way overcomplicating things, thinking that I would have to marshal the output somehow to prevent contention issues, but then a classmate comes along on Instant Messenger saying that he'd gotten it to work by just appending to the file. It was his initial IM&amp;nbsp;that signalled to me I might need to work on this before too long, as it might be harder than the last few. Then again, he has said things &amp;quot;work&amp;quot; in the past without them actually working right, so I remain suspicious that this is correct. However, I&amp;nbsp;cannot see how it is not behaving as specified.&lt;br /&gt;&lt;br /&gt;The assignment specification is located &lt;a href="https://people.sunyit.edu/~barra/hw3.pdf" target="_blank" rel="nofollow"&gt;here&lt;/a&gt;.  Basically, what I'm doing right now, because it seems to work, not because it makes perfect sense that this is what I should be doing, is not particularly taking any care about the multithreaded aspect of the assignment and just writing to the file as we were taught in class. That is:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;BufferedWriter bw = new BufferedWriter(new FileWriter(&amp;quot;file.log&amp;quot;,true));&lt;br /&gt;bw.write(&amp;quot;This is a line.&amp;quot;);&lt;br /&gt;bw.newLine();&lt;br /&gt;bw.flush();&lt;br /&gt;bw.close();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;etc. and so forth, both from the main thread and the secondary threads. The reason my initial attempt wasn't working, apparently, is because &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileWriter.html" target="_blank" rel="nofollow"&gt;FileWriter&lt;/a&gt; needs that &lt;tt&gt;true&lt;/tt&gt; flag at the end, for append. But given that, it seems to not care that the file is being touched from multiple threads, and it behaves correctly and consistently.&lt;br /&gt;&lt;br /&gt;Am I thinking too much about this?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:391688</id>
    <author>
      <name>ska-o</name>
    </author>
    <lj:poster user="ska_o" userid="503677"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/391688.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=391688"/>
    <title>Shell script on Mac OS X</title>
    <published>2009-09-14T07:53:03Z</published>
    <updated>2009-09-14T07:53:03Z</updated>
    <content type="html">Hi,&lt;br /&gt;&lt;br /&gt;I'm having a problem with starting a Java Swing app from a shell script on Mac OS X. I'm not very familiar with Macs. &lt;br /&gt;&lt;br /&gt;I'm able to start the program from a terminal window by typing "java -classpath &lt;classpath&gt; &lt;options&gt; &lt;class&gt;".  But if I put the same command in a shell script and run the script, I get a NoClassDefFoundError from the class loader. It complains about my main class. However, if I pass -h argument to the class in the script (again, this is a Swing app but it does take command-line arguments and prints some messages to stdout), it works, i.e. it prints the usage information, as it should, so somehow it is able to load the class. &lt;br /&gt;&lt;br /&gt;Can anyone explain why this may be happening?&lt;br /&gt;&lt;br /&gt;Thanks in advance.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:java_dev:391458</id>
    <author>
      <name>S. A. Bonasi</name>
    </author>
    <lj:poster user="sabonasi" userid="1230769"/>
    <link rel="alternate" type="text/html" href="https://java-dev.livejournal.com/391458.html"/>
    <link rel="self" type="text/xml" href="https://java-dev.livejournal.com/data/atom/?itemid=391458"/>
    <title>Putting Jave Applets on a Website</title>
    <published>2009-08-10T13:55:42Z</published>
    <updated>2009-08-10T13:55:42Z</updated>
    <content type="html">I am in the process of writing a computer game using Java Applets and wish to put it on my website so that the game can be played by anyone on the internet.  Can someone walk me through how to do this?</content>
  </entry>
</feed>
