Struts

Struts, the famous Java MVC web framework of the late 90’s and early 00’s that pioneered well structured server side web logic. Many Java based enterprise applications developed during this era (a metric s#!t ton) still make heavy use of Struts 1.x today. Apache Struts 1 is a discontinued open-source web application framework for developing Java EE web applications. It complements the Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. ...

March 17, 2016 · 16 min

DIY Computer Part 2 The ALU

A continuation of my participation in the amazing Nand2Tetris course, by Noam Nisan and Shimon Schocken, now running on Coursera. In this course you will build a modern computer system, from the ground up. We’ll take you from constructing elementary logic gates all the way through creating a fully functioning general purpose computer. In the process, you will learn how really computers work, and how they are designed. If interested, see prior related post [DIY Computer Part 1 The NAND Gate]({% post_url 2016-03-06-diy-computer-nands %}). ...

March 12, 2016 · 5 min

DIY Computer Part 1 The NAND Gate

I love computers. When I recently discovered that the Nand2Tetris guys, Noam Nisan and Shimon Schocken, had just packaged their famous course into a neat 12 week Coursera package, I couldn’t resist studying it any longer. In this course you will build a modern computer system, from the ground up. We’ll take you from constructing elementary logic gates all the way through creating a fully functioning general purpose computer. In the process, you will learn how really computers work, and how they are designed. ...

March 6, 2016 · 7 min

wsimport

Thrown into a large, legacy EE code base, I needed to create new SOAP web services, and update some existing ones. To make life interesting, there lacked a repeatable process (e.g. via Ant or Maven) for processing WSDL’s and generating the associated JAXWS and JAXB source code artifacts in a consistent manner. First things first, a repeatable and scriptable procedure. wsimport to the rescue. wsimport has been around so long now, the com.sun.tools.ws.ant.WsImport Ant task is guarenteed to be kicking around in your environment. It’s also a best practice to use the vendor specific wrapper to wsimport, in my case WebSphere. ...

March 2, 2016 · 10 min

awk

After recently getting my hands dirty with the wonderful [sed]({% post_url 2015-09-15-sed %}), the time has come for me to step it up with awk. Incepted in 1977 at Bell Labs, AWK is an interpreted programming language designed for text processing, and is a defacto part of most nix based distributions. The original version of UNIX awk was designed and implemented by Alfred Aho, Peter Weinberger, and Brian Kernighan (notice the first letter of their surnames together) of Bell Laboratories. Brian Kernighan continues to maintain and enhance it. Paul Rubin and Jay Fenlason, of the Free Software Foundation, wrote gawk, to be compatible with the original version of awk distributed in Seventh Edition UNIX. ...

January 17, 2016 · 10 min

Java Prepared Statement Overflow

On the hunt for an sporadic DB2 SQL Error -805, I took a dive into some logs. It had been rearing its ugly head for weeks now, and starting to impact our business area. The call stack pointed straight to the bad patch of code, the Java EE solution contains a programmatic TimerService, responsible for shuffling data from one database to other; a rudimentary replication solution in other words. The specific source database in this case happened to be DB2 running on AIX. No big deal. Except that the code has proven to be flakey under load. That is, the code was transferring ~500,000 records daily, but was choking for ~100,000 records, the lions share of the load and failures seemed to pertain to BLOB data. ...

January 12, 2016 · 4 min

IntelliJ Bad Font Rendering on Linux

Font rendering in IntelliJ on Linux looks horrid. Any Java based application does for that matter. I can’t take it anymore. I just burnt 30 minutes looking into solutions. Fastest option, run it on the Linux optimised JVM tuxjdk. tuxjdk is a series of patched to OpenJDK to enhance user experience with Java-based and Swing-based tools (NetBeans, Idea, Android Studio, etc) Instructions (for me) next time this happens: Download tuxjdk and unpack it in /usr/lib/jvm, e.g. /usr/lib/jvm/jdk-8u25-tuxjdk-b01 Run IntelliJ like this; export IDEA_JDK=/usr/lib/jvm/jdk-8u25-tuxjdk-b01/ & ./idea.sh ...

December 5, 2015 · 1 min

GNU Stream Editor (sed)

sed has rocked my world. sed (stream editor) isn’t an interactive text editor. Instead, it is used to filter text, i.e., it takes text input, performs some operation (or set of operations) on it, and outputs the modified text. sed is typically used for extracting part of a file using pattern matching or substituting multiple occurrences of a string within a file. Contents Basic Syntax How sed works Substitution Append, Insert and Delete Multiple expressions Remote with ssh Substitution grouping Numerical grouping Executing Commands sed with Vim Commands Basic syntax sed ' [RANGE] COMMANDS ' [INPUTFILE] If no INPUTFILE is specified, sed filters the contents of standard input. ...

September 15, 2015 · 18 min

Eclipse brain damage

In my current project we use IBM’s version of Eclipse. On a Windows 7 VM. The VM crashes weekly. Not only has this made me paranoid about loosing my work (I stash my changes in version control like a demon), it seems to corrupt my RAD/Eclipse instance. Starting RAD produces the useful “An error has occured” error message: !SESSION 2015-09-02 10:53:50.331 ----------------------------------------------- eclipse.buildId=unknown java.fullversion=JRE 1.7.0 IBM J9 2.6 Windows 7 amd64-64 Compressed References 20140313_192258 (JIT enabled, AOT enabled) J9VM - R26_Java726_SR6_20140313_1318_B192258 JIT - r11.b05_20131003_47443.02 GC - R26_Java726_SR6_20140313_1318_B192258_CMPRSS J9CL - 20140313_192258 BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_AU Framework arguments: -product com.ibm.rational.rad.product.v80.ide Command-line arguments: -os win32 -ws win32 -arch x86_64 -product com.ibm.rational.rad.product.v80.ide !ENTRY org.eclipse.equinox.app 0 0 2015-09-02 10:53:52.658 !MESSAGE Product com.ibm.rational.rad.product.v80.ide could not be found. !ENTRY org.eclipse.osgi 4 0 2015-09-02 10:53:54.131 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: No application id has been found. at org.eclipse.equinox.internal.app.EclipseAppContainer.startDefaultApp(EclipseAppContainer.java:242) at org.eclipse.equinox.internal.app.MainApplicationLauncher.run(MainApplicationLauncher.java:29) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:88) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414) The error log isn’t much help. Something somewhere is corrupt. Asking Eclipse to clean itself seems to fix things: ...

September 2, 2015 · 1 min

JAX-WS SOAP Logger

Hot tip, logging helps understand how a piece of software works, long after it has left the cosy confines of the debugger. Logging SOAP message bodies can be really handy, when the thing that is interacting with your software is out of your control (i.e. a vendor or trading partner). And if you’re using web services, the likehood of this is high. Running JAX-WS web services in our servlet container, needed a quick and easy way to acheive this. Welcome to the wonderful world of SOAPHandler’s. ...

September 1, 2015 · 4 min