Currently browsing category

Java

Command-line progress bar

[================> ] 33% I frequently need a progress bar for applications, in order to visualize what is going on in the application. Below is a Java implementation of one. private static int lastPercent; public static void updatePercentageBar(float progress) { int percent = (int) Math.round(progress * 100); if (Math.abs(percent – lastPercent) …

Data Source Handling with Tomcat 7.0

The “new” J2EE6 standard allows for setting up of datasources in the web.xml of a web application. If the webserver is compliant- this feature will enable defining your database resources in the web.xml like the example below. web.xml config MySQL Datasource example jdbc/mkyongdb javax.sql.DataSource Container Thanks to resource injection, the …

Keeping JAVA code out of .jsps

Lets face it, scriptlets were a great way to make a page dynamic back when javascript was still a baby. However, anyone who has experienced jsp code in the past few years, especially within an enterprise, has seen some pretty horrible atrocities. So to clean things up a bit, here …

Tech: Google gson

It has come to my attention that some of my readers would prefer to know upfront if a post I am making is technical in nature or not. Thus the reason for the prefix to this post’s title. I will quickly discuss Google’s json library for Java, code-named gson. I like the …

Apache Wicket Initial Thoughts

So I looked into Apache Wicket last week. Here are my views on the project. First the good: It separates the controller and the view cleanly It is easy to pick up It enables reusable components easier than other frameworks It does not break html viewers and designers during development You can split the …

fallout.hacking

Fallout 3 Hacking Utility

I was playing Fallout 3 last night. I got to the second terminal that I had to hack, I am still in the very beginning, and I hated the effort that needed to be put in to the mini-game. I thought that the computation could be done faster on a …