Skip to main content

Posts

I really want to like Java 8 streams, but...

I really want to like Java 8 streams, but they seem overly verbose for things that seem like they should be simpler.
Recent posts

Standardized Markdown?

Having used Markdown styles at both GitHub and StackOverflow , I really like this idea : I propose that Stack Exchange, GitHub, Meteor, Reddit, and any other company with lots of traffic and a strategic investment in Markdown, all work together to come up with an official Markdown specification, and standard test suites to validate Markdown implementations. We've all been working at cross purposes for too long, accidentally fragmenting Markdown while popularizing it.

Java command line app with Spring and Gradle

Many Java developers have had to build a command line app for one reason or another over the years, and there are many(!) ways to do it.  There are a bevy of command line libraries, some people roll their own when they get to this point (which is one reason why there are so many command line libraries!), and others just pull in the arguments simply and directly, eschewing a library. However, writing a tool, a developer should just focus on the meat of the problem rather than having to worry about the enabling functionality that allows it to work.  The Spring Framework very much supports this approach to development with its inversion of control (IoC) container and a myriad of other features. To support that approach for command line applications, the spring-cmdline library provides a bridge between the Spring framework and the JOpt Simple command line library. This tutorial will show how to leverage the spring-cmdline library to stand up a very simple command line ap...

Groovy Mocks and Java Classes

Trying to convert a Java/EasyMock based JUnit test to Groovy in the last couple days led me to find what I think is a bug in Groovy's MockFor class . The documentation for MockFor says to use the proxyDelegateInstance method when testing Java classes, but unfortunately the delegate proxy obtained using that method is type-incompatible with the Java class you're trying to mock if that class is concrete.  It works for Groovy classes, all abstract classes, and all interfaces, but it appears to fall down when given a plain, concrete Java class.

Groovy and String Comparisons

Though I've recently come to love working with Groovy, I'm deep enough where I'm starting to see some of its warts. The one that hit me nearly right away was the nastiness about groovy.lang.GString not extending java.lang.String .  This is mainly the fault of the latter being final and not extendable, but it mea ns that GString in stances aren't automatically comparable with plain Java strings. In Groovy, string literals can be quoted using both single and double-quotes.  GString appears when you use double-quotes around a string and expand variables into it.  See " Strings and GStrings " for more information.
As much as I like Windows 7 relative to previous versions of Windows, I'm again taking a stab at using Linux as a development desktop OS.  This is complicated by the fact that I still have to work in a shop where the supported IS boxes are all Windows 7. I'm a bit disappointed that open source support for Microsoft Exchange seems to be waning, as Evolution doesn't support newer versions of Exchange . I'm very happy with Linux Mint 11 , as it seems to correctly do a number of things that vanilla Ubuntu 11 doesn't do out of the box. Right now I'm working on getting my development environment functional again.  I've used Component Software Diff on Windows for years, since it's no-nonsense, visually appealing, and usually just works.  Under Linux, I'm trying out Meld and followed a tutorial to get this working with git , though firing up Python just to launch another command-line tool seems a little overkill when this would suffice: #!/bin...

manifest classpath + taglib jars + Tomcat = FAIL

I found an interesting side-effect of using manifest classpaths in our application jar files as it applies to taglib jar dependencies and embedded Tomcat 6. ·          Manifest classpaths do not appear to be expanded in the URLClassLoaders that load the jars with the manifests, so only the jar file referenced directly on the classpath are included in its URLs. The taglib search mechanism in Tomcat 6 (haven't checked Tomcat 7 to see if there's a difference) only walks the classpath looking for URLClassLoaders, looking at the underlying JAR URLs. Thus, if the taglib jar is referenced only as a dependency in the manifest of the main jar file and is not specifically on the classpath, it will not be spotted and use of that taglib by the JSP engine will throw an exception. This problem won’t actually show up in tests as IDE environments and builds generally include all the jar files in the classpath, so this one will bite you at runtime. ...

Difficult time voting in primaries this year

For the primaries this year, I went to our local precinct polling center early in the morning. I discovered that there were some barriers to voting. Specifically, the roads and sidewalks all around the polling place were under active construction. A front-end loader was driving around dumping large loads of dirt right next to the torn-up sidewalks to get inside. The main sidewalk right outside the side door where we were detoured to was fresh enough to look like you shouldn't walk on it. (Posted late as I only recently managed to get this image off my phone.)

World of Warcraft account hacked

I'm upset.  My World of Warcraft account was attacked in the early hours of this morning and I'm unable to figure out why.  The two computers that I use to play WoW have active malware scanners..  I change the password occasionally.  I definitely don't fall for scams that try to get you to send your login information to someone for something in return, and yet someone managed to get in.  I'm stumped how they managed to get in, or why they decided to target my user. They immediately changed the password and recovery information, of course, so I couldn't regain control of the account.  They also stripped bare every character I had on every realm.  I'm assuming this, of course, since I still don't have access to the account, but the evidence is there on WoW Armory: every character I check is missing all sellable gear.  I was notified by one of my guild masters during the day that they had also looted the guild vault, since I had at least one privil...

A Killer Smartphone App

One of the big problems I have using Consumer Reports is that the listings, even if available online, require some pretty significant planning and research before using them.  Specifically, vendors often don't have the exact models that are reviewed, so you have to interpolate other reviews on similar models from that manufacturer.  Also, vendors often have varying stock, so the research you've already done may become obsolete quickly.  Finally, most of the reviews on CR are best used in large-format displays. What I would love to have is a smartphone app where you could enter a make and model of an appliance (or better yet scan something using the camera) right in the store and get quick, easy-to-read summary of the ratings for that product or similar ones, along with recommended prices.  It would make shopping in a store a much more informed process. I would think something like this could make someone a lot of money.
Just watched The Ox-Bow Incident last night and was struck by the message contained in this venerable old movie that so many people seem to have forgotten these days. I'll try not to spoil the movie for those who haven't seen it, so I'll necessarily limit the context and quote only this: Law is a lot more than words you put in a book, or judges or lawyers or sheriffs you hire to carry it out. It's everything people ever have found out about justice and what's right and wrong. It's the very conscience of humanity. Ignoring the law when it's convenient or uncomfortable is breaking trust with our forebears, who act as our conscience today by virtue of the laws that have been laid down over the years. It's a very powerful message that seems to be particularly applicable today.

Netflix

Netflix supports streaming to your TV and your PC , but only the latter if you have Windows or Mac OS, not Linux.  I realize they went for the ones with the largest market share, but it's yet another snub keeping Linux market share down and off vendor's desktop application support list.