Archive for the ‘Java’ Category

I like CFLint for its ability to assist me in writing better code. But some of the rules implemented in the “standard” version strike me as arbitrary (“standard” meaning the version without any additions). If there is some kind of master rulebook for writing CFML or CFScript, then there is no reference to that in the CFLint source code, nor on its website.

I find that CFLint conflicts with some of the code style rules that I have been applying for over a decade. Code styles are always somewhat arbitrary, of course. They depend on the experience and knowledge of its author(s), on the frameworks and code libraries used, on the styles used in other programming languages at the same company, on the quality assurance rules applied, and more.

That is why I struggle with some of the rules currently fixed in CFLint. Here’s an example. When I write scope names like “APPLICATION” and “ARGUMENTS” the “VariableNameChecker” rule in CFLint complains, telling me that scope names should never be written in capital letters. My reasoning for doing that nevertheless is simple: the names of these scopes have been reserved and fixed by Adobe, so you cannot use them for anything else. So going “allcaps” on them neatly sets them apart from variable and function names. With the current situation I have to disable the rule completely.

I would like to see this checker adapted so that I can specify whether I want scope names “allcaps” or “nocaps” (or even “camelCase” of “PascalCase”) in the CFLint configuration file. That way I could easily check whether I applied my own rule correctly, by adapting the config as needed, regardless of the default set by the CFLint developers. The same approach could be worthwhile for variable names, component names, and function names, of course.

There are probably a few more situations like that in CFLint. If I find the time I may have a look at the Java code, to see how this might be implemented (don’t hold your breath, though).




Read Full Post »

A good month ago, I had to switch from Grive2 to Jdrivesync on my little Xubuntu machine, because Google doesn’t like the former software. Unfortunately, Jdrivesync is not without problems.

The biggest issue is that Jdrivesync is not capable of updating an existing file in de Google Drive with a fresher version from my machine. And it turns out that I’m not the only one (nor the first) one to experience this error, as detailed in this Github error report called “Error if updating a remote file“.

I’m the first one to admit that software without bugs is very, very, very rare ;-)

But a bug report without response in more than 20 months is a clear sign of abandoned software. So I’m looking for another solution – suggestions are more than welcome (I’m not in a position to start learning the ins and outs of the Drive API to see if I can find the cause of the problem).

Read Full Post »

I appreciate the fun one can have at building programs and tools that do something thought to be impossible. Running Java code on a Commodore C64 is such a project.

Back to the Future Java (b2fJ) aims at bringing the power of Java to 8-bit home computers of the ’80s. This project provides a toolchain to cross-compile Java programs under Windows.

You’ll find everything about “b2fJ – Back to Future Java” on Github.

Read Full Post »

The language isn’t new: Kotlin was created more than 5 years ago by JetBrains engineers. A preview version was released in 2011. Kotlin is a statically typed programming language for the Java Virtual Machine (JVM). Being crude, you could say that it’s “just another” enhancement of the Java language, just like Groovy or Scala. Nice, but hardly indispensable.

But Kotlin made a name for itself in May 2017, when Google announced “that it is making Kotlin […] a first-class language for writing Android apps” (in the words of Frederic Lardinois on TechCrunch). The Wired website has a bit more info on why the language was developed and why it is so “hot” these days. And the article concludes:

And its applications extend well beyond Google’s platform. Like Java, it can be used to write apps that run on desktops and servers as well. Plus, JetBrains has released tools for translating Kotlin code into code that can run on iOS or even in web browsers. All of which is to say, you can expect to find yourself using apps written in Kotlin more and more often in the coming months and years.

I have not yet written a line of Kotlin, but perhaps I should try that sooner rather than later. Since I’m also looking at Apple’s Swift language, the combination of learning both could be beneficial… or problematic, since someone asserts that both are quite similar (but not the same, of course): see “Swift is like Kotlin” for details.

I still would like to know how the name “Kotlin” was chosen…

Read Full Post »

The InterWikiLinksPlugin, my small addition to JSPWiki is part of the JSPWiki source tree (or at least it was somewhere in 2009). But Pikacode managed to lose the version I installed there, so I am storing it for posterity on this site as well ;-)

Click the image to download the PDF

Click the image to download the PDF

I had to package it as a PDF file here in WordPress.com, but just copying the text content of the file and saving it as a Java file in the JSPWiki Plugins source directory should suffice for a successful compilation.

Read Full Post »

At work, I tried to upgrade PasswordSafeSWT, our password manager tool, to version 0.8.1. Installing the tool went well, but opening and updating our current password safe file generated errors with the message “Illegal pattern character ‘Y'”. The error occurs on many entries when using the password safe from the previous version “as is”. The project has recorded a bug report on the subject; no solution has been offered, however, even though many months have gone by. The bug report is rather limited, but I can confirm that the problem is very real on Windows XP SP3.

I first thought that the problem was related to our ‘old’ safe, so I tried exporting the data to a new safe and update that. To no avail, since even then the error message appears on every new update… And exporting the data to a new safe isn’t really an option, since that would destroy all log data about changes and accesses.

So for the moment we stay with version 0.8!

Read Full Post »

This is news in the category “Just because it can be done“.

Wired: Running a web server on an Apple Newton: not bad for last century hardware. But how about a Java enterprise application server on a smartphone? Well, it’s possible – you just have tot install Ubuntu Touch first, says Mike Croft in “A Smartphone as a JEE Server: Glassfish 4 on Ubuntu Touch” (via DZone).

Just remember: you’ll need a lot of Nexus smartphones in a cluster to support some serious application traffic!

Read Full Post »

JSPWiki is (finally) almost ready to become a first-class citizen in the Apache universe. That’s good news, of course, and it proves that JSPWiki is indeed a stable and worthwhile open source product, that deserves global recognition as such. Of course, an official Apache release of JSPWIki also requires official documentation. The ‘old’ site already had new branches for several releases, and I guess the same approach will be used for the upcoming 2.9 release, albeit in the official Apache infrastructure.

The JSPWiki crew plans a move of the current ‘www.jspwiki.org‘ content to the Apache infrastrucure – and what I read about this on the Apache issue tracker is somewhat worrying. Yes, the current content is not really very up to date, but still: it may contain useful information for those of us still running older releases of JSPWiki. There’s the list of not all too official plugins, there are comments all over the place that may be useful – or not, etc.

Rather than throwing everything away, wouldn’t it be possible to keep a read-only copy alive, for example under the name ‘old.jspwiki.org‘ or so?

Read Full Post »

Talk about a thorough comparison: Play vs. Grails Smackdown at ÜberConf.

Play and Grails have been hyped as the most productive JVM Web Frameworks for the last couple of years. […] That’s why James Ward and I decided to do a presentation at ÜberConf comparing the two.

Matt Raible and James Ward built the same application with both frameworks, and put the end result as open source software on Github. Their presentation is not just pretty (thank you, Reveal.js) but above all very thorough.

My conclusion? Both frameworks, like a few others no doubt, allow you to build serious, performant applications. The devil, as always, is in the details – that’s where a good app distinguishes itself, and in many cases the quality of the app is determined more by the quality of the developer than by the quality of the framework used. So why don’t you try a few frameworks, and see what “feels” best? Not having to fight a framework (or a programming language!) to achieve the desired result may well be the best recipe for successful development.

Read Full Post »

Just a quick notice, to speed up my future use of this command: if you want to set another default Java version in Ubuntu, use the update-java-alternatives command. For more details, see Ask Ubuntu, knowing that this command (probably) works in multiple version of Ubuntu – I’m on 12.04 and it worked fine for me.

Read Full Post »

Am I an Apple G5 owner feeling a little left out by Apple? Well, yes, actually: no hardware upgrades possible, and no serious OSX upgrades… Do I have a very expensive and capable piece of hardware which can still be valuable? Yes indeed! Do I run applications based on Java and feel left behind with just Java 1.5? Absolutely!

Unfortunately, John Yeary’s Blog is just a partial help. I had already downloaded a PowerPC version of OpenJDK 7 (build ‘build 1.7.0-internal-landonf_2009_12_16_12_54-b00’ to be exact), but I need it to run Routeconverter, preferably through Webstart. But that isn’t currently possible, at least not in a way that is integrated with OS X – or so I understand from this message by Mike Swingler.

I’ll have to download Routeconverter and write a small run script for this app, I suppose.

Read Full Post »

Remember the OS X trojan I wrote about on April 4th? Kaspersky Labs has created a tool to remove the Flashback trojan, should you have been infected. And don’t hold your breath, but rumor has it that even Apple Inc. is working on a similar program…

Read Full Post »

A long time ago, I dabbled with Basic, Lisp and Python on my trusted Palm PDA’s. Yes, even a decade ago you could install interpreters for such programming languages on a small computer. I won’t pretend that such environments were destined for the construction of gazillions of enterprise apps, but as a challenge for geeks/developers they could be a lot of fun.

Times do change, however, and today small computers are more powerful than ever. I have mentioned this on Google+ a week ago, and now a Dr.Dobb’s blogger confirms the validity of the approach: you can indeed write applications for Android on Android, using the AIDE.

I’m not saying it will be fun to try and type on the 3 inch screen of your smartphone – but it can be done, and considering the flood of powerful Android tablets that is said to be coming to the market, this way of developing may well be more than just a short-lived fad. As blogger Mike Riley notes: “The PC is the new mainframe, and the tablet is the new PC“. Strong words, but very likely true, even if it takes a few more years for this dictum to be 100% true…

Read Full Post »

We’re having a bit of trouble with our ColdFusion applications (intranet apps, to be specific): at seemingly random intervals, the response of the application that is most used “degrades significantly”, to put it mildly. I don’t have a definitive and complete explanation at this time, but I’m certain that there’s a mix of multiple causes at play:

  • the number of users has grown during the last few years;
  • the infrastructure has become more complex;
  • the quality and structure of the code isn’t ideal for its current purpose.

All that means that we may well have hit a limit in the default ColdFusion 8 configuration parameters. And then there are the “bugs” as well, of course: superfluous code, duplicated method calls, inefficient database queries, etc.

I have been reading up a bit about CF and JVM configuration and debugging, and I certainly want to remember and (re)read the following items:

In 2009, I attended an excellent lecture by Grant Straker on the subject of CF performance tuning; unfortunately his book on the subject (at www.cfperformance.com) was rather specific on the CFMX family and is no longer available online – too bad ;-)

Of course, I’ll gladly accept references to other worthwhile material on this subject!

Read Full Post »

Last week, I had to get a few web applications running on my Ubuntu netbook. That shouldn’t have been too difficult: after all, I have installed Tomcat on many servers (mostly Windows-servers, admittedly, but on OSX too), and getting a web app like JSPWiki to run on Tomcat is something I have done many times.

Off I went, with a sudo apt-get install tomcat7. After that, I just had to unzip and configure my JSPWiki – or so I thought… When I tried to run the app, all I got were error messages, and none of them were very specific. Puzzled, I verified even the simplest thing: but yes, I did have a Java runtime (java-6-openjdk).

So I tried my hand at Jetty, although that package is (was) unfamiliar to me. It took me a while, but at least in the end the error message that Jetty spat at me was clear: it couldn’t find the Java compiler to handle the JSP-files in JSPWiki. That took me by surprise: doesn’t java-6-openjdk include the JDK ?

The correct answer, of course, is NO. If you want a JDK, you have to install it explicitly, using sudo apt-get install openjdk-6-jdk (or sudo apt-get install openjdk-7-jdk if you’re into working with Java 7). Simple, indeed – too bad the name “openjdk” put me on the wrong foot and made me lose a few hours. But at least I learned something during that time!

Read Full Post »

Older Posts »