Posts

Java TroubleShooting Tools

I have been working with a lot (when i mean a lot ~50++) of threads. It is necessary for our applications because we deal with a lot (~millions of records). Why is it necessary to multi-thread ? Let's say you have 1,000,000 records to process and each records is processes roughly about 5 seconds (really intense processing e.g. calling web services, writing xml, uploading via ftp). It will take you roughly 57 days, 20 hours, 53 minutes, 20 seconds to process all of the records ( 5,000,000 seconds ). Since you are dependent on other systems (e.g. like web services to process the records) you can't really ask the publisher of the service to speed things up (unless you have are willing to throw in time and effort into the service before you process your records). So, enter multi threading. Multi Threading - enables you to leverage the multiple processors (common to most enterprise server level boxes) to process records in parallel. BUT- multi threaded programs are really hard t

Node.js - lightweight and efficient

Using Node.js you can write a web server in as little as six lines of code. Here is a variation for the sample from the Node.js  (Node.js Synopsis) //Imports the http library var = require(http); http.createServer(function(request, response){     response.writeHead(200,{'Content-Type':'text/plain'});     response.end('Hello World\n'); }).listen(8124); console.log('Server running at http://127.0.0.1:8124/'); I was asking myself why would i want a server side javascript (which is the whole idea of Node.js) ? Besides that it uses a non-blocking I/O model (this means that other processing can continue if it does not depend fro an I/O to complete, kind of like an asynchronous call to perform the I/O) . One use case that i can think of is that  I can wrap other services (e.g. other source of data like json/xml)  specially ones that are exposed as web service APIs (e.g. Google APIs).

Looking into the Future

The Future When dealing with concurrent processing, starting Java 1.5 the 'Future' looks bright. In java 1.5 it is now easier to collect results from asynchronous processes by getting the future. Here are the objects that you are going to need to process concurrently and collect results from those concurrent processes: //Please refer the the Java API documentation on how to properly instantiate the objects below //This is just to give an overview on how they are used together and relate to each other. //A ThreadPoolExecutor is basically a pool of threads that you configure that will asynchronously //perform the tasks that you provide it ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(); //A completion service is the object that collects the results of the task that the ThreadPoolExecutor //completes. That is why when you instantiate it you need to pass it a ThreadPoolExecutor. CompletionService completionService = new ExecutorCompletionService (th

New IPhone App from PetaByte!

Image
MyGeekBall iPhone App Here is the latest myGeekBall app. It is a simple app that i created to learn the ins and outs of creating an iPhone app. Did you know that all applications are reviewed by Apple ? Their reason is to protect consumers from malicious app.  Please download and enjoy the new App!

Software Design - Cohesion

The term "software engineering" was coined 42 years ago. Software Engineering is defined as the systematic approach to development, operation, maintenance, and retirement of software (IEEE). Another definition is the practical application of scientific (systematized body of) knowledge and construction of computer programs and associated documentation required to develop, operate and maintain them (Boehm) One of the areas of software engineering that foster quality to a software product is design. Software design is the place where we can access models, diagrams of a logical product for quality. Adhering to industry accepted design practices is a must in order to produce quality software products. It is good to adhere to sound software design guides like cohesion.  Software engineers who wanted to write quality software uses proven principles for software design. The idea of cohesion and coupling in software design has been around for decades. It has been measured as a q

Google+

Image
Trying out Google+, so far i like the 'Circles' Thanks to Kathryn Mcconnachie  of IT Web (South Africa) 

http://repo1.maven.org/maven2 Connection Refused in STS

Image
Spring Source Tool Suite  Using STS inside the companies firewall Go to Window > Preference > Maven > User Settings Take note of the location of settings.xml If it does not exists, create a new one Add the element below in the file (Use the proxy that your company uses) Change the host and port to the details that is particular to your company's proxy setting Make sure to add user name and password if you need to aunthenticate.