A few weeks ago I was given the opportunity to learn iOS programming. My boss decided that I was more of a ‘computer scientist’ rather than a developer, and this meant that I could apply my knowledge to developing an iPad application or two - all I’d need to do was to learn Objective-C and the iOS SDK: after all, how hard can it be?
Check out our new .NET Code Geeks site! Latest Articles: Why you need to make your tests fail and Developer productivity tools and Visual Studio extensions.
Wednesday, 29 February 2012
Spring MVC and JQuery for Ajax Form Validation
In this tutorial, we will see how to validate a form on server side using Ajax with Spring MVC and JQuery. Spring MVC provides a very convenient process for adoption of Ajax with annotation driven configuration. We will use this annotation driven configuration to send Ajax response in form of JSON data. The response will contain state of the form validation and error messages in any error exist in form data.
Labels:
Ajax,
Enterprise Java,
jQuery,
Spring,
Spring MVC
Spring and Quartz: Multi-Job Scheduling Service
Job Scheduling is so important requirement for the applications. Especially in large-scale projects, working with a lot of jobs can be a problem. Spring and Quartz have brought significant benefits for the solution of this problem. This article shows how to schedule multi jobs easily by using Spring and Quartz.
Used Technologies :
JDK 1.6.0_21
Spring 3.1.1
Quartz 1.8.5
Maven 3.0.2
Used Technologies :
JDK 1.6.0_21
Spring 3.1.1
Quartz 1.8.5
Maven 3.0.2
Labels:
Enterprise Java,
Quartz,
Spring
Customized Internationalization (i18n) in Java
Internationalization (i18n) is very important in our software projects. It brings mainly these benefits:
- Externalizing UI strings into external files other than code files and so easy-to-manage UI content.
- Supporting multiple languages.
Labels:
Core Java,
Internationalization
Tuesday, 28 February 2012
Client-side server monitoring with Jolokia and JMX
The choice of Java monitoring tools is tremendous (random selection and order powered by Google):
Labels:
Enterprise Java,
JMX,
Jolokia
Maven Archetype Creation Tips
I recently needed to create some Maven Archetypes for the Turmeric SOA project. A Maven Archetype for those that don’t know is a way to generate a project based off some pre-canned project templates. In the case of the current Turmeric SOA archetype, it will create a multi-module maven project, that contains the Interface, and Service projects, along with a basic WSDL, and the POMs configured appropriately.
Labels:
Enterprise Java,
Maven
Best Of The Week - 2012 - W08
Hello guys,
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* Java.next: In this presentation, the argument that Java is still the best programming language for the JVM (if simplified idioms are used along with proper tooling) is posed. Also see The Most Powerful JVM Language Available and Hate Java? You’re fighting the wrong battle.
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* Java.next: In this presentation, the argument that Java is still the best programming language for the JVM (if simplified idioms are used along with proper tooling) is posed. Also see The Most Powerful JVM Language Available and Hate Java? You’re fighting the wrong battle.
Labels:
Best Of The Week
Java 7: WatchService
Of all the new features in Java 7, one of the more interesting is the WatchService, adding the capability to watch a directory for changes. The WatchService maps directly to the native file event notification mechanism, if available.If a native event notification mechanism is not available, then the default implementation will use polling. As a result, the responsiveness, ordering of events and details available are implementation specific. (NOTE: There is a companion post on using the Guava EventBus to process WatchService events)
Monday, 27 February 2012
Is Java's String Class a God Object?
In October I wrote a blog entitled Top Trumps in God Objects where I talked about the discovery of an object I’d found with 167 disparate methods that linked this object with all other parts of the application and, as you’d expect, followed the general criteria for a God or Monster Object. It was recently pointed out to me that method count alone isn’t an indication that an object is a God Object, which is quite true. The comment also went on to site the String class as an object that isn’t a God Object, but has a large number of methods.
Ajax with Spring MVC 3 using Annotations and JQuery
Its always been fun for me to work with Ajax! Is not it ? I will make it easy for you to use Ajax with Spring MVC 3 and JQuery. This post will illustrate you how to use Ajax in real life practices of industrial coding. As usual, we will take an practical example of Ajax in Spring MVC 3 framework and will implement it and I will make the implementation easy by make you understand the topic.
Labels:
Enterprise Java,
jQuery,
Spring,
Spring MVC
Student Questions about Scala, Part 1
Preface
I’m currently teaching a course on Applied Text Analysis and am using Scala as the programming language taught and used in the course. Rather than creating more tutorials, I figured I’d take a page from Brian Dunning’s playbook on his Skeptoid podcast (highly recommended) when he takes student questions. So, I had the students in the course submit questions about Scala that they had, based on the readings and assignments thus far. This post covers over half of them — the rest will be covered in a follow up post.
I start with some of the more basic questions, and the questions and/or answers progressively get into more intermediate level topics. Suggestions and comments to improve any of the answers are very welcome!
I’m currently teaching a course on Applied Text Analysis and am using Scala as the programming language taught and used in the course. Rather than creating more tutorials, I figured I’d take a page from Brian Dunning’s playbook on his Skeptoid podcast (highly recommended) when he takes student questions. So, I had the students in the course submit questions about Scala that they had, based on the readings and assignments thus far. This post covers over half of them — the rest will be covered in a follow up post.
I start with some of the more basic questions, and the questions and/or answers progressively get into more intermediate level topics. Suggestions and comments to improve any of the answers are very welcome!
Labels:
Scala
Flavor of the month - Neo4j and Heroku
Neo4j launched a challenge earlier this year called "Seed the Cloud" to get folks to create templates or demo applications on Heroku using the Neo4j add-on. After much internal debate, I decided to enter, only to be thrown into despair for lack of an idea. The idea came to me while I was doing nothing in particular- to build a simple app that would help one find ingredients whose flavors complement one another.
Labels:
Enterprise Java,
Heroku,
Neo4j
Friday, 24 February 2012
Investigating the HashDoS issue
Nearly one month ago I have written some thoughts on how the HashDoS problem presented at the 28C3 or other code defects could perhaps be fixed temporarily without interaction of vendors.
State Does Not Belong In The Code
What is “state” in your web application? It’s the data that gets stored (regardless of the destination – memory, database, file-system). The application itself must not store any state in the code. This means your classes should only have fields with objects that are also stateless. In other words – you should not store anything in your services, DAOs or controllers during the program flow. This is a complete “must” for your service layer. Why?
Labels:
Enterprise Java
Spring Thread Pool Services
Thread Pools are very important to execute synchronous & asynchronous processes. This article shows how to develop and monitor Thread Pool Services by using Spring. Creating Thread Pool has been explained via two alternative methods.
Labels:
Concurrency,
Enterprise Java,
Spring
Apache Camel - A little Scala DSL example
So we have a Scala DSL in Apache Camel for many years now, and I guess its about time I wrote a little blog entry about this (has been on my todo list for a while).
Thursday, 23 February 2012
Tomcat & IntelliJ - Deploy war files outside webapps folder
At present I am working on developing an Android application that needs to be supported by a slew of REST services hosted in the cloud. I chose Google App Engine based on its support for Java, Groovy and most importantly Spring. I developed a Spring MVC based REST application and used ContentNegotiatingViewResolver to negotiate content based on request URL extensions. For example, an XML response will be returned if the request URL ends with .xml, a JSON response for .json and an HTML response if he URL doesn’t have any extension. Don’t get me started on Accept Header versus URL extension based content negotiation. That is a rant for another day.
Labels:
Enterprise Java,
IntelliJ IDEA,
Tomcat
Google Appengine Staging Server Howto
Out of the box, Google’s App Engine supports versioned deployments. You can switch back and forth between revisions very easily, which is a great feature for properly testing an application before going live. There is one major problem: All versions of the application share the same datastore. So if you’re migrating your data you run a serious risk of influencing your current production application. Hence the need for a proper staging environment.
Labels:
App Engine,
Enterprise Java
Spring MVC - Flash Attributes
Latest Spring Framework incarnation (3.1) brought interesting feature called Flash Attributes. It is remedy for the problem mentioned a long time ago, in one of my posts: Spring MVC - Session Attributes handling. This problem can be described in few words: if we want to pass the attributes via redirect between two controllers, we cannot use request attributes (they will not survive the redirect), and we cannot use Spring's @SessionAttributes (because of the way Spring handles it), only ordinary HttpSession can be used, which is not very convenient.
Labels:
Enterprise Java,
Spring,
Spring MVC
Set up a Java EE 6 development environment
This tutorial explains in short how to set-up a typical environment to develop Java EE 6 based applications. There is no prerequesite to this tutorial other then a working Windows XP client with sufficient CPU power and memory. During the tutorial we will need to install the following components:
- Java 6 JDK Update 26
- Eclipse IDE for Java EE Developers 3.6.2 (Helios)
- Maven 3.0.3
- Glassfish 3.1
Labels:
Enterprise Java,
Java EE6
Wednesday, 22 February 2012
Manipulating Java Class Files with ASM 4 - Part Two: Tree API
What is ASM tree API: ASM Tree API is the part of ASM that lets you create/modify the class in memory. The class is viewed as a tree of information. Like the whole class is an instance of ClassNode, which contain a list of FieldNode objects, a list of MethodNode objects etc. This article assumes that the reader has already read the first part here.
Android - Read file from Assets
Description:
First of all, let me give you a link: AssetManager, through this class we can easily access any files lying inside the Assets directory of android application. (or any sub-folders inside the Assets directory).
First of all, let me give you a link: AssetManager, through this class we can easily access any files lying inside the Assets directory of android application. (or any sub-folders inside the Assets directory).
Labels:
Android
Implementing Active Record Pattern with Spring AOP
During class design we should take decisions about the assignment of responsibilities that will have every class. If we have chosen well, systems tend to be easier to understand, maintain and extend.
Labels:
AOP,
Aspect Oriented Programming,
AspectJ,
DTO,
Enterprise Java,
JAXB,
Spring
Free Copies of Android books Giveaway Roundup
Hello fellow Java Geeks!
Our first giveaway of Packt Publishing's best selling books on Android has ended.
The Prize Winners
The 3 lucky winners that will receive the ebook prizes are (names are as appeared on their emails) :
Each one of the 3 winners will recieve 2 copies (one of each ebook) of the following ebooks on Android programming for free :
The Prizes
1. Android 3.0 Animations: Beginner’s Guide
Read more about this book and download free Sample Chapter
2. Android NDK Beginner’s Guide
Read more about this book and download free Sample Chapter
Discount coupon
For the rest of our readers, Packt Publishing has provided us with a discount coupon regarding the Android 3.0 Animations: Beginner’s Guide book.
Codeword : Java15
15% discount on Print version. If ebook is purchased along with its corresponding print copy using the discount code provided above, the ebook is available at 85% off.
Duration : 20th February 2012 up to 5th March 2012 (expiration)
Happy reading/coding!
The Java Code Geeks team
Our first giveaway of Packt Publishing's best selling books on Android has ended.
The Prize Winners
The 3 lucky winners that will receive the ebook prizes are (names are as appeared on their emails) :
- Nir M
- Cihad Emre
- Mark Lambert
Each one of the 3 winners will recieve 2 copies (one of each ebook) of the following ebooks on Android programming for free :
The Prizes
1. Android 3.0 Animations: Beginner’s Guide
- The first and only book dedicated to creating animations for Android apps.
- Covers all of the commonly used animation techniques for Android 3.0 and lower versions.
- A step-by-step guide for learning animation by building fun example applications and games.
Read more about this book and download free Sample Chapter
2. Android NDK Beginner’s Guide
- Create high performance applications with C/C++ and integrate with Java
- Exploit advanced Android features such as graphics, sound, input and sensing
- Port and reuse your own or third-party libraries from the prolific C/C++ ecosystem
Read more about this book and download free Sample Chapter
Discount coupon
For the rest of our readers, Packt Publishing has provided us with a discount coupon regarding the Android 3.0 Animations: Beginner’s Guide book.
Codeword : Java15
15% discount on Print version. If ebook is purchased along with its corresponding print copy using the discount code provided above, the ebook is available at 85% off.
Duration : 20th February 2012 up to 5th March 2012 (expiration)
Happy reading/coding!
The Java Code Geeks team
Labels:
Android,
Android Games,
Competition,
Giveaway,
Packt
Introduction to Strong Cryptography
One thing that amazes me is that the most developers are not familiar with strong cryptography. In my career, I’ve seen all sort of mistakes that lead to leaked data, guessable passwords, unfortunate disclosures, and worse. The nice thing is, you don’t have to understand the ridiculously complex math behind the algorithms, you only have to know the rules for using them correctly. By the end of this series, my goal is to de-mystify the magic, so you can start using the primitives in your code right away!
Labels:
Cryptography,
Security,
Software Development
Tuesday, 21 February 2012
JBoss Drools - Getting started
This post will be about me getting to grips with JBoss Drools. The reasoning behind it is: SAP bought out my company's current rules engine and Drools is one alternative we will be looking into as soon as someone has the skills to get a proof of concept up.
Labels:
Drools,
Enterprise Java
Manipulating Java Class Files with ASM 4 - Part One : Hello World!
What is ASM: ASM is an open source java library for manipulating java byte code. So it has the same purpose as Apache BCEL. As this article assumes that the reader has some knowledge of java class file format, it is advisable to read about it in here. So how is it different from BCEL? Well firstly it allows for an event driven way to manipulate byte code eliminating the need to load the whole class in the memory just to make a small addition. Secondly, it does not have a separate class for every single instruction. Instead, it handles opcodes directly and only has constants representing each. This reduces the size of the library to a great extent. So, ASM is simply lighter and smarter. However, ASM also has a mechanism to deal with class files by loading the whole class into the memory just in case the operation is too complex to be handled through event based processing.
Best Of The Week - 2012 - W07
Hello guys,
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* NetBeans IDE 7.1: Unlocking the Java EE 6 Platform: Java EE 6 specification is deeply integrated into NetBeans IDE 7.1 and this article helps you to map its various parts to the related tools provided by the IDE. JPA 2.0, EJB 3.1, JSF 2.0, Servlets 3.0, CDI 1.0 and JAX-RS 1.1 are discussed. Don't forget to also check From Spring to Java EE 6.
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* NetBeans IDE 7.1: Unlocking the Java EE 6 Platform: Java EE 6 specification is deeply integrated into NetBeans IDE 7.1 and this article helps you to map its various parts to the related tools provided by the IDE. JPA 2.0, EJB 3.1, JSF 2.0, Servlets 3.0, CDI 1.0 and JAX-RS 1.1 are discussed. Don't forget to also check From Spring to Java EE 6.
Labels:
Best Of The Week
Redmine Installation & Getting Started Guide
Redmine is a free and open source, flexible web-based project management and bug-tracking tool, written using the Ruby on Rails framework.
Redmine supports multiple projects, with its own wiki, forum, time tracker and issues management.
Redmine supports multiple projects, with its own wiki, forum, time tracker and issues management.
Labels:
Redmine,
Software Development
Monday, 20 February 2012
Virtualizing Your Java Applications: Best Practices (JavaOne 2011)
Justin Murray started his presentation ["Virtualizing Your Java Applications: Best Practices" (21860)] about five minutes early and began by saying that virtualization has arrived at the point where people no longer need to be concerned about taking advantage of virtualization. He said his presentation is about a year old and is the work of a team of people.
Labels:
Core Java,
Virtualization
Concurrency Pattern: Producer and Consumer
In my career spanning 15 years, the problem of Producer and Consumer is one that I have come across only a few times. In most programming cases, what we are doing is performing functions in a synchronous fashion where the JVM or the web container handles the complexities of multi-threading on its own. However, when writing certain kinds of use cases where we need this. Last week, I came across one such use case that sent me 3 years back when I last did it. However, the way it was done last time was very different.
Labels:
Concurrency,
Design Pattern,
Enterprise Java
Set up a Spring 3 development environment
This tutorial explains in short how to set-up a typical environment to develop Spring based applications. There is no prerequesite to this tutorial other then a working Windows XP client with sufficient CPU power and memory. During the tutorial we will need to install the following components:
- Java 6 JDK Update 26
- Eclipse IDE for Java EE Developers 3.6.2 (Helios)
- Maven 3.0.3
- Tomcat 7.0.14
Labels:
Enterprise Java,
Spring
JBoss AS 7.1.0.Final "Thunder" released - Java EE 6 Full Profile certified!
After just about more than a year of development on JBoss AS7, we have now released 7.1.0.Final "Thunder"! The download is available at the usual place here. This is a really big achievement for the JBoss AS7 team and we are really proud about this release.
Labels:
Enterprise Java,
JBoss
Friday, 17 February 2012
Variations for computing results from sequences in Scala
Introduction
A common question from students who are new to Scala is: What is the difference between using the map function on lists, using for expressions and foreach loops? One of the major sources of confusion with regard to this question is that a for expression in Scala in not the equivalent of for loops in languages like Python and Java — instead, the equivalent of for loops is foreach in Scala. This distinction highlights the importance of understanding what it means to return values versus relying on side-effects to perform certain computations. It also helps reinforce some points about fixed versus reassignable variables and immutable versus mutable data structures.
Labels:
Scala
Covering your tests with Cobertura, JUnit, HSQLDB, JPA
Hello, how are you?
Let us talk today about a very useful tool named “Cobertura”. This framework has the same functions of the Emma framework that we saw in another post.
Let us talk today about a very useful tool named “Cobertura”. This framework has the same functions of the Emma framework that we saw in another post.
Labels:
Cobertura,
Enterprise Java,
HSQLDB,
JPA,
JUnit
JavaFX 2.0 and Scala, Like Milk and Cookies
JavaFX 2.0 and Scala are both great technologies individually, but work even better when used together. JavaFX 2.0 is a powerful rich client technology with advanced graphics, animation, and media capabilities. Scala is a simple, yet powerful language with advanced language features for writing domain-specific languages (DSLs). Add a little Scala UI DSL to your JavaFX 2.0 project and you will be in cookie and cream heaven!
Labels:
Desktop Java,
JavaFX
Spring 3 MVC Exception Handlers
The majority of the Spring 3 error handling sample code that I’ve come across only ever seems to give the simplest overview of its usage, yet how we handle errors is, some would say, more important than how the normal code works. This was borne out the other day when I came across a simple ‘GOTCHA’ in a Spring (2) error handler that brought a whole website down and almost killed the server, but more on that later.
Labels:
Enterprise Java,
Spring,
Spring MVC
Thursday, 16 February 2012
21 books for Engineering Managers / Development Managers that guided me in 2011
As an Engineering Manager / Development Manager aspiring to be a good software craftsman I want to promote good engineering practices, clean code, scalable solutions, all driven by self-org teams that continuously improve their abilities and skills.
Labels:
Books,
Software Development
Technical Debt - How much is it Really Costing you?
The idea behind the technical debt metaphor is that there is a cost to taking short cuts (intentional technical debt) or making mistakes (unintentional technical debt) and that the cost of not dealing with these short cuts and mistakes will increase over time.
Labels:
Software Development
Patching Java at runtime
This article will slightly highlight how to fix issues with third party libs that
- can't be circumvented
- are difficult to exclude/bypass/replaced
- simply provide no bugfix
Labels:
Core Java,
Instrumentation,
JVM
Apache Mahout: Getting started
Recently I have got an interesting problem to solve: how to classify text from different sources using automation? Some time ago I read about a project which does this as well as many other text analysis stuff - Apache Mahout. Though it's not a very mature one (current version is 0.4), it's very powerful and scalable. Build on top of another excellent project, Apache Hadoop, it's capable to analyze huge data sets.
Labels:
Enterprise Java,
Mahout
Wednesday, 15 February 2012
MyBatis 3 - Spring integration tutorial
As a first step of this tutorial, Spring MVC 3 CRUD example with MyBatis 3, we will define a MyBatis service that will help us to perform CRUD operation on database.
We have a domain class for User and a database table to store the User information on database. We will use xml configuration model for our example to define SQL commands that will perform CRUD operation.
We have a domain class for User and a database table to store the User information on database. We will use xml configuration model for our example to define SQL commands that will perform CRUD operation.
Labels:
Enterprise Java,
MyBatis,
Spring
JavaFX 2.0 Bar and Scatter Charts (and JavaFX 2.1 StackedBarCharts)
JavaFX 2.0 provides built-in capabilities for generating charts, a capability found within the javafx.scene.chart package. In this post, I look at creating bar charts and a scatter chart in using JavaFX 2.0. During the course of this post, I use Guava and some Java 7 features along the way.
Labels:
Desktop Java,
JavaFX
Play framework on the cloud made easy: Openshift module
Just a couple of years ago finding an afordable hosting solution for a java web application was a hard task, and looking for a free one was an impossible mission. Not to mention that even thinking about things like auto-scaling, one-command deploy, continuos integration, and that sort of stuff was plain science fiction.
This last year has witnessed a cloud revolution, and nowdays there’s a really appalling amount of alternatives to choose from. It seemed like every medium-to-large size IT player had to come out with their own Platform as a Service (PaaS) cloud offering.
This last year has witnessed a cloud revolution, and nowdays there’s a really appalling amount of alternatives to choose from. It seemed like every medium-to-large size IT player had to come out with their own Platform as a Service (PaaS) cloud offering.
Labels:
Enterprise Java,
Openshift,
Play Framework
Agile’s Customer Problem
Agile methods like Scrum and XP both rely on a close and collaborative relationship and continual interaction with the customer – the people who are paying for the software and who are going to use the system. Rather than writing and reviewing detailed specifications and working through sign-offs and committees, the team works with someone who represents the interests of the customer to define business features and to decide what work needs to be done and when. One of the key problems in adopting these approaches is finding the right person to play the important role of the Customer (XP) or Product Owner (Scrum). I’ll use both terms interchangeably.
Labels:
Agile
Tuesday, 14 February 2012
Apache Commons Lang StringUtils
So, thought it'd be good to talk about another Java library that I like. It's been around for a while and is not perhaps the most exciting library, but it is very very useful. I probably make use of it daily.
org.apache.commons.lang.StringUtils
org.apache.commons.lang.StringUtils
Labels:
Apache Commons,
Core Java
Essential Attack Surface Management
To attack your system, to steal something or do something else nasty, the bad guys need to find a way in, and usually a way out as well. This is what Attack Surface Analysis is all about: mapping the ways in and out of your system, looking at the system from an attacker’s perspective, understanding what parts of the system are most vulnerable, where you need to focus testing and reviews. It’s part of design and it’s also part of risk management.
Labels:
Security,
Software Development
Best Of The Week - 2012 - W06
Hello guys,
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* You need a code review: This article praises the merits of code reviews and discusses its benefits such as creating code quality, preventing bugs and mistakes, transferring knowledge, teaching less experienced developers and more. Also check out Code reviews in the 21st Century and Not doing Code Reviews? What's your excuse?.
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* You need a code review: This article praises the merits of code reviews and discusses its benefits such as creating code quality, preventing bugs and mistakes, transferring knowledge, teaching less experienced developers and more. Also check out Code reviews in the 21st Century and Not doing Code Reviews? What's your excuse?.
Labels:
Best Of The Week
Win Free Copies of Android books
Fellow Java geeks,
We are pleased to announce that we have teamed up with Packt Publishing and we are organizing a Giveaway for you!
3 lucky winners stand a chance to win 2 copies of Packt's best-selling books on Android (ebook format) each.
Keep reading to find out how you can be one of the lucky winners...
The Prizes
1. Android 3.0 Animations: Beginner’s Guide
Read more about this book and download free Sample Chapter
2. Android NDK Beginner’s Guide
Read more about this book and download free Sample Chapter
How to Enter?
Just send an email here using as subject "Packt Android Giveaway". An empty email will do, It’s that simple!
Deadline
The contest will close on Monday 20 February 2012 PT. Winners will be contacted by email, so be sure to use your real email address!
Important Notes...
Please spread the news! The larger the number of participants the more people will be eligible for getting discounts on best-selling Packt's books!
Providing comments about what interests you the most about these books will be highly appreciated.
Good Luck!
The Java Code Geeks Team
We are pleased to announce that we have teamed up with Packt Publishing and we are organizing a Giveaway for you!
3 lucky winners stand a chance to win 2 copies of Packt's best-selling books on Android (ebook format) each.
Keep reading to find out how you can be one of the lucky winners...
The Prizes
1. Android 3.0 Animations: Beginner’s Guide
- The first and only book dedicated to creating animations for Android apps.
- Covers all of the commonly used animation techniques for Android 3.0 and lower versions.
- A step-by-step guide for learning animation by building fun example applications and games.
Read more about this book and download free Sample Chapter
2. Android NDK Beginner’s Guide
- Create high performance applications with C/C++ and integrate with Java
- Exploit advanced Android features such as graphics, sound, input and sensing
- Port and reuse your own or third-party libraries from the prolific C/C++ ecosystem
Read more about this book and download free Sample Chapter
How to Enter?
Just send an email here using as subject "Packt Android Giveaway". An empty email will do, It’s that simple!
Deadline
The contest will close on Monday 20 February 2012 PT. Winners will be contacted by email, so be sure to use your real email address!
Important Notes...
Please spread the news! The larger the number of participants the more people will be eligible for getting discounts on best-selling Packt's books!
Providing comments about what interests you the most about these books will be highly appreciated.
Good Luck!
The Java Code Geeks Team
Labels:
Android,
Android Games,
Competition,
Giveaway,
Packt
Building Games Using the MVC Pattern - Tutorial and Introduction
One useful architecture pattern in game development is the MVC (model-view-controller) pattern.
Labels:
Desktop Java,
Game Design
Monday, 13 February 2012
Play! Framework + Google Guice
In the project I’m currently working, we started to use Google Guice. For those who don’t know, Google Guice is a dependency injection framework. The basic idea behind dependency injection is to provide a class it’s dependencies, instead of making the dependent class responsible of instantiating the objects on which it depends.
Labels:
Enterprise Java,
Play Framework
JSON web service with Java and Axis2
I have recently met a client who asking me to rebuild their legacy product using Java web service.
They want it modular and easy to use. The first thing crossed my mind is using restful approach.
They want it modular and easy to use. The first thing crossed my mind is using restful approach.
Labels:
Axis2,
Enterprise Java,
JSON,
Web Service
Implicit Conversions in Scala
Following on from the previous post on operator overloading I'm going to be looking at Implicit Conversions, and how we can combine them to with operator overloading to do some really neat things, including one way of creating a multi-parameter conversion.
Labels:
Scala
High performance libraries in Java
There is an increasing number of libraries which are described as high performance and have benchmarks to back that claim up. Here is a selection that I am aware of.
Disruptor library - http://code.google.com/p/disruptor/
Disruptor library - http://code.google.com/p/disruptor/
Labels:
Core Java,
Performance and Scalability
Saturday, 11 February 2012
Big Data analytics with Hive and iReport
Each J.J. Abrams' TV series Person of Interest episode starts with the following narration from Mr. Finch one of the leading characters: “You are being watched. The government has a secret system--a machine that spies on you every hour of every day. I know because...I built it.” Of course us technical people know better. It would take a huge team of electrical and software engineers many years to build such a high performing machine and the budget would be unimaginable... or wouldn't be? Wait a second we have Hadoop! Now everyone of us can be Mr. Finch for a modest budget thanks to Hadoop.
Labels:
Analytics,
Big Data,
Enterprise Java,
Hadoop,
Hive,
iReport,
JasperReports,
MapReduce
Friday, 10 February 2012
Embedded Jetty, Vaadin and Weld
When I develop web applications I like to be able to quickly start them from Eclipse without having to rely on all kinds of heavy-weight tomcat or glassfish plugins. So what I often do is just create a simple Java based Jetty launcher I can run directly from Eclipse. This launcher starts up within a couple of seconds so this makes developing a lot more pleasant.
Labels:
Enterprise Java,
Jetty,
Vaadin,
Weld
Problems with ORMs Part 2 – Queries
In my previous post on Object-Relational Mapping tools (ORMs), I discussed various issues that I’ve faced dealing with the common ORMs out there today, including Hibernate. This included issues related to generating a schema from POJOs, real-world performance and maintenance problems that crop up. Essentially, the conclusion is that ORMs get you most of the way there, but a balanced approach is needed, and sometimes you just want to avoid using your ORM’s toolset, so you should be able to bypass it when desired.
Labels:
Enterprise Java,
Hibernate
What's Cooking in Java 8 - Project Lambda
What is project lambda: Project lambda is the project to enable lambda expressions in java language syntax. Lambda expressions are major syntax in functional programming languages like lisp. Groovy would be the closest relative of java that has support for lambda expressions, also known as closures.
Growing hairy software, guided by tests
Software grows organically. One line at a time, one change at a time. These changes soon add up. In an ideal world, they add up to a coherent architecture with an intention revealing design. But sometimes software just grows hairy – full of little details that obscure the underlying logic. What makes software hairy and how can we stop it?
Labels:
Software Development,
Testing
Thursday, 9 February 2012
Apache Camel 2.9 Released - Top 10 Changes
On the last day of 2011 the Apache Camel artifacts just managed to be pushed to the central maven repo, just shy 1.5 hours before champagne bottles was cracked and we entered 2012.
Labels:
Camel,
Enterprise Java
Properties with Spring
Spring has always tried to be as transparent as possible when it comes to working with properties. Before Spring 3.1 however, the mechanism of both adding new sources of properties into Spring as well as actually using the properties wasn’t as flexible and as robust as it could be.
Labels:
Enterprise Java,
Spring
What is behind System.nanoTime()?
In java world there is a very good perception about System.nanoTime(). There is always some guys who says that it is fast, reliable and, whenever possible, should be used for timings instead of System.currentTimemillis(). In overall he is absolutely lying, it is not bad at all, but there are some drawback which developer should be aware about. Also, although they have a lot in common, these drawbacks are usually platform-specific.
PopupMenu in JavaFX 2
Creating Popup Menus
To create a Popupmenu in JavaFX you can use the ContextMenu class.
You add MenuItems to it and can also create visual separators using SeparatorMenuItem.
To create a Popupmenu in JavaFX you can use the ContextMenu class.
You add MenuItems to it and can also create visual separators using SeparatorMenuItem.
Labels:
Desktop Java,
JavaFX
Wednesday, 8 February 2012
Java 7: A complete invokedynamic example
Another blog entry in my current Java 7 series. This time it's dealing with invokedynamic, a new bytecode instruction on the JVM for method invocation. The invokedynamic instruction allows dynamic linkage between a call site and the receiver of the call.
Simple Security Rules
Wow!
Citi really messed up their online security. They included account information as part of the URL. You could alter the URL and access someone else's account information. Yikes o rama, that's a bad design.
Citi really messed up their online security. They included account information as part of the URL. You could alter the URL and access someone else's account information. Yikes o rama, that's a bad design.
Labels:
Security,
Software Development
Java Swing Tic-Tac-Toe
Hello people! Wow its been a while since I posted something here…! I must say I really miss writing stuff and I promise I wont get into a ‘writer’s block’ again. Hopefully
.. A helluva lot of things happened in the last two months and I’ve got loads to say. But in this post Im just gonna publish a small application that I wrote sometime ago. Its a TicTacToe game application. There’s not much to be learnt from this particular program but I really want to get outta this impasse and hence Im posting this today.
Labels:
Desktop Java,
Swing
Tuesday, 7 February 2012
Regular Expressions in Java - Soft Introduction
A regular expression is a kind of pattern that can be applied to text (String, in Java). Java provides the java.util.regex package for pattern matching with regular expressions. Java regular expressions are very similar to the Perl programming language and very easy to learn.
Labels:
Core Java,
Regular Expressions
Some Interview Questions to Hire a Java EE Developer
The Internet is full of interview questions for Java developers. The main problem of those questions is that they only prove that the candidate has a good memory, remembering all that syntax, structures, constants, etc. There is not real evaluation of his/her logical reasoning.
Labels:
Enterprise Java,
Interview questions
Automatically generating WADL in Spring MVC REST application
Last time we have learnt the basics of WADL. The language itself is not as interesting to write a separate article about it, but the title of this article reveals why we needed that knowledge.
Labels:
Enterprise Java,
RESTful Web Service,
Spring MVC,
WADL
Source Code is an Asset, Not a Liability
Some people have tried to argue that source code is a liability, not an asset. Apparently this “is now widely accepted”
and
and
“this is a very strong idea that has a lot of impact across the IT industry and in the way developers view and perform their day-to-day work”.Really?
Labels:
Software Development
Monday, 6 February 2012
14 Golden Eggs of Good UI Design
As I discussed, I have been to “Rules for Good UI Design” by Joe Nuxoll (@joeracer) at Devoxx 2011. In this talk, he was giving 14 “Golden Eggs” for designing a user interface (UI).
The “Golden Eggs” have been written down from Joe’s slides – I hope without big mistakes. The comments are my summaries from his talk.
The full version of Joe’s talk will be available at Parleys soon.
The “Golden Eggs” have been written down from Joe’s slides – I hope without big mistakes. The comments are my summaries from his talk.
The full version of Joe’s talk will be available at Parleys soon.
Labels:
Software Development
Best Of The Week - 2012 - W05
Hello guys,
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* 11 Most Influential Books Every Programmer / Developer Must Read: A list of the most influential and "must-read" books for software developers, including classics such as Code Complete, The Mythical Man-Month and Clean Code. For Java, check out Top 10 Java Books you don't want to miss and Java Developer Most Useful Books.
Time for the "Best Of The Week" links for the week that just passed. Here are some links that drew Java Code Geeks attention:
* 11 Most Influential Books Every Programmer / Developer Must Read: A list of the most influential and "must-read" books for software developers, including classics such as Code Complete, The Mythical Man-Month and Clean Code. For Java, check out Top 10 Java Books you don't want to miss and Java Developer Most Useful Books.
Labels:
Best Of The Week
Book Review: JBoss AS 7: Configuration, Deployment, and Administration
I eagerly accepted Packt Publishing's invitation to review JBoss AS 7: Configuration, Deployment, and Administration because it has been several years since I last used JBoss and I was curious to learn more about JBoss AS 7. I have already written about my First Impressions of Book 'JBoss AS 7 Configuration, Deployment and Administration' and in this post I review the book in greater detail while attempting to minimize how much I repeat from that post. My review is based on an electronic (PDF) copy of JBoss AS 7: Configuration, Deployment, and Administration.
Labels:
Books,
Enterprise Java,
JBoss
Choosing Between Vaadin and JSF
With the recent release of Primefaces 3.0, JSF finally reaches an unprecedent level of maturity and utility that puts it face to face with other popular Rich Internet Applications (RIA) options, such as Google Web Toolkit (GWT), ExtJS, Vaadin, Flex and others. This open source project also proved to be very active and in constant growing path.
Labels:
Enterprise Java,
JSF,
Vaadin
Friday, 3 February 2012
20 Database Design Best Practices
- Use well defined and consistent names for tables and columns (e.g. School, StudentCourse, CourseID ...).
- Use singular for table names (i.e. use StudentCourse instead of StudentCourses). Table represents a collection of entities, there is no need for plural names.
- Don’t use spaces for table names. Otherwise you will have to use ‘{‘, ‘[‘, ‘“’ etc. characters to define tables (i.e. for accesing table Student Course you'll write “Student Course”. StudentCourse is much better).
Labels:
Software Development
Another aspect of coupling in Object Oriented paradigm
I had previously written a post related to coupling and cohesion here and that was more of a basic definition of both the terms.
Labels:
Software Development
Spring 3, Spring Web Services 2 & LDAP Security
This year started on a good note, another one of those "the deadline won't change" / "skip all the red tape" / "Wild West" type of projects in which I got to figure out and implement some functionality using some relatively new libraries and tech for a change, well Spring 3 ain't new but in the Java 5, weblogic 10(.01), Spring 2.5.6 slow corporate kind of world it is all relative.
Labels:
Enterprise Java,
LDAP,
Security,
Spring,
Web Service
Scala: Working with Predicates
I love me some Scala. Actually, since it’s now my day job, I love it all the time. It combines the short, expressiveness that I prized in Python with a rich library base (thanks Java) and the compiler checking that I have come to depend upon in a statically typed language. I don’t care what some people say. I recognize that the language is not without it’s flaws. One could say that there’s a bit of missing language extentions, particularly with predicates.
Labels:
Scala
Thursday, 2 February 2012
Launching and Debugging Tomcat from Eclipse without complex plugins
Modern IDEs like Eclipse provide various Plugins to ease web developement. However, I believe that starting Tomcat as "normal" Java application still provides the best debugging experience. Most of the time, this is because these tools launch Tomcat or any other servlet container as external process and then attach a remote debugger on it. While you're still able to set breakpoints and inspect variables, other features like hot code replacement don't work that well.
Labels:
Eclipse,
Enterprise Java,
Tomcat
Hibernate cache levels tutorial
One of the common problems of people that start using Hibernate is performance, if you don't have much experience in Hibernate you will find how quickly your application becomes slow. If you enable sql traces, you would see how many queries are sent to database that can be avoided with little Hibernate knowledge. In current post I am going to explain how to use Hibernate Query Cache to avoid amount of traffic between your application and database.
Labels:
Cache,
Enterprise Java,
Hibernate
GWT MVP made simple
GWT Model-View-Presenter is a design pattern for large scale application development. Being derived from MVC, it divides between view and logic and helps to create well-structured, easily testable code. To help lazy developers like me, I investigate how to reduce the amount of classes and interfaces to write when using declarative UIs.
Labels:
Design Pattern,
Enterprise Java,
GWT,
MVP
Code reviews in the 21st Century
There's an old adage that goes something like: 'Do not talk about religion or politics'. Why? Because these subjects are full of strong opinions but are thin on objective answers. One person's certainty is another person's skepticism; someone else's common sense just appears as an a prior bias to those who see matters differently. Sadly, conversing these controversial subjects can generate more heat than light.
Labels:
Code Reviews,
Software Development
Wednesday, 1 February 2012
Java 7: Copy and Move Files and Directories
This post is a continuation of my series on the Java 7 java.nio.file package, this time covering the copying and moving of files and complete directory trees. If you have ever been frustrated by Java’s lack of copy and move methods, then read on, for relief is at hand. Included in the coverage is the very useful Files.walkFileTree method. Before we dive into the main content however, some background information is needed.
Sneak peak at Java EE 7 - Multitenant Examples with EclipseLink
The Aquarium is a great source of inspiration and most recent information about Java EE progress across all relevant specifications and reference implementations. They picked up a presentation by Oracle's Shaun Smith (blog/twitter) about the status and future of EclipseLink as an open source project. He covers all the new features which are going to be in EclipseLink 2.4 which will be availabke along with the June Eclipse Juno Release. In detail these are REST, NoSQL and Multitenancy. (details refer to the complete slide-deck (PDF) from the marsjug event.)
Labels:
EclipseLink,
Enterprise Java,
Java EE 7
Graphics Tutorial
As we all know that we can make games with the help of java libraries that provide us with the graphics needed for making them. So today I will be starting a very new section on Java Graphics. I had earlier made posts on How to make an income tax calculator.
Labels:
Desktop Java,
Swing
Solving the EULA problem
Everyone recognizes the situation. Some piece of software has released an update, or you are installing it for the first time, and you’re asked to accept a new EULA. The EULA is typically 5-15 pages of dense legal text. Almost everyone just tries their best to find the “accept” button as quickly as possible, sometimes giving a sigh as they realize you first have to scroll down before you can hit the accept button.
Labels:
Software Development
Subscribe to:
Posts (Atom)




