formats

Decent games on the Mac, Can it be?

Published on May 20, 2012 by in Gaming

Without getting too deep into the debate let me just state, I’m a Mac not a PC. I have owned several macs from the spunky little white plastic MacBook to my current quad code Macbook Pro. There are many things to love about working on OSX/Mac, but one thing that has always been missing has been decent games. If I was an avid gamer I would just buy a second windows gaming rig but as a casual gamer that is not really an option. That is why I am loving the mac store and especially Feral and Aspyr and the great games they are porting, and how well they are porting them. This article covers some of my favorite games on the Mac store because apple makes it really hard to separate the high budget games from among the Angry Birds and cut the rope chaff.

Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Maven:Deploying multiple artifacts from one build

Published on May 6, 2012 by in Maven

For a recent project I had to deploy a self-executing jar to the nexus repository as well as the standard jar and I wanted to make this process as stream lined as possible. I used the assembly plugin (Details) to create the jar but the default deploy plugin would not upload this artifact to sonatype. While I could do this manually I wanted to make this a default part of the deploy goal. To do this we need to add an extra deploy plugin invocation in our pom.
Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Jackson Optimization, Using Non-Default for fun and profit

Published on March 10, 2012 by in Programming

We use Jackson JSON processor extensively for serializing/deserializing objects to for storage in backing storage service as well as to send responses between client and server. One thing we noted was that despite our best efforts a lot of objects had fields that we were either null or set to default values. For example our We store all the virtual goods owned by a user. For a lot of new users this list is empty as the have not bought anything yet. However we still incur the overhead of sending and storing an empty list. This translates to both a performance cost and dollar cost as we use Amazon Ec2 which charges us for bandwith and and DynamoDB which charges us for read/write capacity used. Luckily we can use a nice little feature of jackson called Non-Default get around this issue.

Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Really Really Async AWS SDK

Published on February 15, 2012 by in Programming

Like much of the world I use Amazon services and the Aws SDK (Java in our case) to support our scalable web service. In an effort to maximize the number of users we could support per machine we use a asynchronous request processing architecture using jetty continuations. In such a setup we needed an asynchronous AWS SDK. Now you might say the AWS SDK already provides asynchronous an API, and you would be right. However, the asynchronous AWS still return a future and require the calling code to poll the future and look at responses once it is done. We wanted a really really asynchronous API which we could say “Hey do X, and when you are done do Y if there is an error Z but no matter what happens don’t bother me again”. Since there was no such API we decided to implement it ourselves and you can find it here.

Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
Tags: , ,
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Erlang: List Manipulation using comprehensions

Published on February 11, 2012 by in Programming

I have recently started working in Erlang and there are many things to like about the language, the data isolation, the functional paradigm and the raw speed. However, one thing that no one loves about erlang is its syntax. Even after a weeks of working on the language you will still be searching through the manual to decipher what the hell does this symbol do. Since its a symbol its really hard to google the right answer unless you already know what you are looking for.
Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Java Optimizaiton, Why is my application so slow?

Published on February 3, 2012 by in Programming

I am currently working on a rest service to support a new game the Electronic Arts is going to be launching. Our mandate is to support 50K-100K concurrent users at launch. After several months of work we had all the features finished and fairly stable but now the time came to measure and optimize performance. I like to think that I am a half decent Java programmer and server engineer so I can read some code and figure out what the performance bottle necks are. However, with any large project the code is too large for manual optimization especially if there is no structural problems for easy wins. How do you find those small bugs that are so easy to miss but make all the difference. There are many articles telling you what structures and architectures work best but very few that tell you what to do if your architecture is fine but the system is still to slow. This article covers how to go about finding what is actually wrong with your server.
Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Regular Expressions in Elipse Find

Published on January 17, 2012 by in Programming

This one is from the D’oh category, How many times have you realized you made a simple mistake in many many places. Sometimes a simple find and replace would suffice but often the matches are ever so slightly different. For example, in one of my projects we had code that had the following code and replacement (Obfuscated). Unfortunately foo and bar could be lots of different values so search and replace was useless. This is where regex replacement comes to the rescue.

Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
Tags: ,
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Capturing Java Stack Strace Using JStack

Published on January 16, 2012 by in Java, Programming

Recently I needed to profile a large distributed web app that was having performance problems. Although I had success using YourKit, it requires us to capture more specific details but it requires restarting a client with profiling enabled. The profiling adds its own overhead to the application and makes it harder to diagnose performance problems. This is where the JStack tool comes in, given the process id (PID) of any java process we can run jstack to capture a stack traces for all threads. An example of the output of the command is shown below.
Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Creating executable jars with Maven

Published on December 17, 2011 by in Programming

One really useful task that one of my junior devs recently asked my help with was to create an executable jar from a maven project. He had mostly figured it out on his own but I still think this is a useful topic to cover. To achieve this we will be using the Maven Assembly plug-in running in Maven 3.

Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
Tags: , , ,
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
formats

Custom PMD Rule for Private Injected fields

Published on December 4, 2011 by in Programming

In my current project I am making extensive use of dependency injection using Guice. More specifically I am using member injection to inject objects into the member variables of a class. In java member variables should usually be private, but this is even more important when using injection as the whole purpose of injecting members is to remove explicit dependencies and make code more modular. However, try as I might I cannot remember to change all my protected injected variables to private. Therefore I ended up just creating a PMD rule to the same effect.
Read more…

profile for Usman Ismail on Stack Exchange, a network of free, community-driven Q&A sites
 
Tags: , , ,
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 
© Usman Ismail 2012
credit