thejavajar

Tag: Java

Alright, So What Now?

by RJ Salicco on Feb.01, 2010, under Commentary

Yeah, Sun Microsystems is gone. My Sun Microsystems stock (JAVA) has been turned into cash assets and I thought about buying some Oracle stock (ORCL). Why you ask? Well, maybe they know what they are doing. Maybe they can make some money with Java. As a developer should I care? I believe in what Java (the language) is/was and I believe in the Java platform. I believe in SpringSource, Apache, JBoss, Google and all the other incredible 3rd party organizations who are writing tools/solutions for the Java platform. So what now? What’s the score here? One side of me says, “…Boo hoo, I am going to miss Sun…”, while the other side of me says, “…I sometimes forgot they were even here…”. Maybe this is the fresh start Java needs?

Leave a Comment :, , more...

Java on Google App Engine

by RJ Salicco on Aug.24, 2009, under Presentations

Google App Engine’s support of Java was a long awaited, highly demanded feature of the service back when I first started messing around with original, Python version a little over a year ago. The excitement that App Engine brought to developers was echoed by the overwhelming request for Java support. Over the past 10 days I have created a few sample applications locally to give it a test. I went the App Engine Eclipse plugin route to get things started. It is a really nice plugin that delivers what you would expect from Google. Once installed, you can create a project and have it running in under a minute.

Once I got familiar with what I was working with, I decided to turn this sample application into a simple Spring Web Flow 2 demo. That is where development stopped. Unfortunately, there are a lot of JVM features/classes that are not accessible on App Engine that Web Flow 2 (and 3rd party libraries) needs for binding and flow execution support. Nothing against Google or SpringSource, I just did not get what I wanted.

Fortunately, I created a new sample app that is based on Groovy’s Groovlet technology and things were moving forward again. Just configure the GroovyServlet in your web.xml file and away you go. My next experiment will be to work with Grails on App Engine via the Grails App Engine plugin.

Overall, App Engine is great. It is really easy to use and the application dashboard features are amazing. Access to application and admin log files in a nice HTML based presentation. Quota detail that explains bandwidth, CPU and datastore utilization along with access to different versions of your application.  You can even grant access to other developers for collaboration efforts. All features you normally do not get from your company’s “Enterprise” admin group.

On a side note, Vladimir Vivien and I will be discussing Google App Engine at the Tampa JUG on August 25th, 2009.

Leave a Comment :, , , , more...

Are You Learning Java? Why?

by RJ Salicco on May.28, 2009, under Commentary

The other day, I began thinking about how to learn to become a programmer/software developer. Then I began thinking about learning C, C++, Java, Groovy, Ruby, Scala, PHP, Coldfusion, Perl, Python JavaScript and so on. I started thinking about beginning programmers because my youngest brother has started learning C in school. He has started with the standard:

#include<stdio.h>
main()
{
    printf("Hello World");
}

I started programming in a similar fashion and then I would eventually begin to learn PHP then Coldfusion, Java, Groovy, Ruby, Python…I was wondering what sparked my interest to learn other languages. My biggest effort or concentration has been learning Java, that is what I do 9-5 and I even became a SCJP, why you ask? Good question. What if I was a COBOL programmer or RPG programmer, why would I start to learn Java? Here are some reasons I came up with:

* I am in school/fresh out of school and I want to learn Java because:

  • I took an intro to programming class and the professor/other students were talking about Java.
  • I have a few friends that are working for big companies that are learning Java.
  • I see a lot of Java jobs advertised on the job sites.
  • I have been working with Web scripting languages but I would like to see the Java approach.

* I am a COBOL, RPG or legacy programmer and I want to learn Java because:

  • My company is re-platforming legacy applications and moving to Java.
  • I see a lot of Java jobs advertised on the job sites.
  • Java developers at my company make more money.
  • I want to be able to put Java on my resume and become more marketable.

Maybe you have some other reasons to learn Java?

6 Comments : more...

Groovy Prime Numbers

by RJ Salicco on May.11, 2009, under Development

The other day I wanted to prove the power of Groovy to a few more core Java developers. I sat down and played with a little script that I think proves the power, or ease of use, of Groovy while having fun with number theory. My goal was to have a Collection that contains Prime Numbers calculated from a given range of numbers x to y, or in Groovy syntax x..y. I am taking a few things for granted with this script. For example, I know that 2 is the lowest Prime Number (it helps simplify the algorithm) and that 1 is not a Prime Number. So here’s the script:

def t = 1..100
def v = []

t.each { n ->
    (2..n).each { d ->
        if(n % d == 0 && n != d)
            v.add(n)
    }
}

println t - v - 1

We have our range of numbers t and we are capturing the non-Prime numbers and adding them to our Collection v. The final line of the script is doing a lot of groovy work for us that would take a few more lines of code with plain Java syntax. What is it doing for us? It is taking our range of numbers t and subtracting (removing) our non-Prime numbers collected in v. This line is also removing the number 1 because we know that 1 is not a Prime Number. Finally, it is printing the result like so:

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

Very cool stuff. Now, I know that many of us are rarely building a Collection of Prime Numbers and I know this script does not do things in a timely manner with a range like 1..10000 (it took a couple of minutes), but I am sure this feature of Collections in Groovy can be utilized in many ways in my development.

14 Comments :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!