Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

The Disco Blog

Imbibing the fluency of Mockito

I recently found myself writing some code to integrate two disparate platforms. One of these systems is Java based and the other, while not written in Java, offers a Java API. I’ll call these systems Foo and Bar, respectively.

Read more ...

 

Swipe gestures in jQuery Mobile apps

I find that swipe gestures for navigating between screens in a mobile app quite nice.

Read more ...

 

Introducing Android migrations

Have you ever worked with Rails’ migrations? They make database changes a breeze, don’t they? While every software release doesn’t necessarily involve a migration, when one does happen to make use of one, I’m always pleased on how easily things work out.

Read more ...

 

MongoDB pro tip: field projections

Did you ever learn that select * from table in RDBMS-land is bad? Of course, you did! If you’re only looking for the email address of a user and not the other 15 columns worth of data, then why ask for that data and incur a penalty? The query select email from user where user_id = 1; is far more efficient for the database and the corresponding application that issued it, because there is less data to fetch and consume.

Read more ...

 

Sampling Redis keys for memory consumption

We run a farm of Redis instances for storing real time analytics. Because Redis stores objects in memory, it happens to be an extremely fast way to retrieve data; thus, most of our charts and graphs pull data from various Redis instances that contain desired data.

Read more ...

 

Mobile for the masses: Words and gestures with Overheard Word

The fourth article in IBM developerWorks’ series Mobile for the Masses has been published! This copasetic article shows you how to take the Overheard Word demo app up a level with a JSON-based word engine and some prebaked, swipe-gesture functionality.

As the article summary states:

Read more ...

 

Android tip: ListView becomes black when scrolling

One of my Android apps recently suffered from a nefariously ugly UI glitch that, embarrassingly, a user reported to me. Strangely, this phenomenon did not surface itself in local testing on either emulators or devices when I first wrote the app; nevertheless, I was able to reproduce the error after the bug report came in. I suspect that recent updates in the Android platform might have exacerbated the issue for my app as I’m fairly certain I never saw it before.



Read more ...

 

MongoDB primary keys are your friend

All documents in a MongoDB collection have a primary key dubbed _id. This field is automatically assigned to a document upon insert, so there’s rarely a need to provide it. What’s interesting about the _id field is that it is time based. That is, the underlying type of _id, which is ObjectId, is a 12-byte BSON type, and 4 of those bytes represent the seconds since Unix epoch.



Read more ...

 

Lickety-split custom validations in Rails

Have a highly specific, yet custom validation for a particular field on one of your Rails model objects? Don’t want to create a ActiveModel::Validator type? Not a problem!

Read more ...

 

Backgrounding tasks in Heroku with Delayed Job

Long running web requests are bad.

Read more ...