David R. Heffelfinger
PDF Unlock Utility Tutorials in Youtube
Lately I've been noticing some referrals from YouTube in my server logs. Curious about it, I looked into it and turns out there is not one, but two video tutorials explaining how to use my free online PDF unlock utility, both of them in Spanish.
Posted at 08:36PM Oct 08, 2009 by David R. Heffelfinger in General |
Ogling Android Phones
I'm a long time BlackBerry user, however for a while I've been tempted by the Android platform. The openness of the platform seems very attractive to me.
The other day I went to the T-Mobile store to try the MyTouch 3G, unfortunately I wasn't very impressed with it. The problem I had was with the virtual keyboard, the wrong letters would show up when I pressed most keys. I looked around online to see if this was a common complaint about the device, and couldn't find much about it. Maybe the unit I tried at the T-Mobile store was defective. Nevertheless, I figured the MyTouch's virtual keyboard would be a recipe for frustration, so I stuck to my BlackBerry Bold for the time being.
Browsing around the web I learned that Sprint will get two new Android phones soon. The HTC Hero, which got a glowing review from ZDNet is coming out this Sunday, October 1st. Based on the review I got really tempted to get one.
While doing some more research I also found out that another Android phone, the Samsung Moment will be released on November 1st, three weeks after the Hero.
I've been researching both devices and at this moment I think I would prefer the Samsung, since it has a much faster processor (800 Mhz, vs 528 Mhz for the Hero) and a physical keyboard. It also seems to come with a more "Standard" Android OS, which I think would make it easier to upgrade the device with future versions of Android.
The Hero comes with "value added" software from HTC, which, although it may be very nice, it may make it harder to upgrade the OS in the device, if nothing else for fear of losing the HTC specific software. Other advantages of the Hero include slightly more memory (288 MB vs the 256 MB that the Moment has), and a 5 megapixel camera (vs the 3.2 megapixel that the Moment has). On the flip side, the Moment's camera has a flash but the Hero's doesn't.
Both seem like very nice devices, but the much faster processor and the physical keyboard of the Samsung Moment, plus the apparent ease of upgradability of the Hero tilt the scale in favor of the Samsung device, at least in my book.
I also looked at Sprint's plans and they seem to have some good ones. I like AT&T's rollover minutes which Sprint lacks, however Sprint's data plan includes GPS functionality, which AT&T charges extra for; and live streaming video through Sprint TV, which as far as I know AT&T lacks. Also, with Sprint I can make and receive any domestic cell phone number from any carrier. Most of the calls I make and receive are to/from mobile phones anyway, so this is a big plus for me.
I'll be dropping by my local Sprint store in about three weeks to test the Samsung Moment out.
Posted at 05:54PM Oct 08, 2009 by David R. Heffelfinger in General | Comments[1]
Preventing Trackback Spam in Apache Roller
This morning I woke up to find 150+ comments in one of my blog entries. I have email notification of comments set up in Roller, so the 150 emails notifying me of comments in my blog indicated that something was obviously not right.
I logged in to my blog to see what is going on, and sure enough, I had over 150 bogus trackbacks in one of my blog entries.
I googled around, and found a way to prevent trackback spam in Apache roller, going to "Main Menu", then clicking on "Server Administration", then checking "Enable verification of trackback links?" and "Enable referrer linkback extraction?" seems to have taken care of the problem.
Roller should really have those two settings checked by default.
Also, I noticed all the bogus trackbacks were coming from the same IP address (83.233.30.32). I googled around, and it looks like many others are having problems with spam from that IP address as well. Just to make extra sure, I dropped any incoming traffic from that IP by configuring IP Tables:
iptables -A INPUT -s 83.233.30.32 -j DROP
iptables-save > /etc/sysconfig/iptables
Hopefully the problem is taken care of for good.
Posted at 10:39AM Apr 12, 2009 by David R. Heffelfinger in General |
How do kids these days get started in programming?
Back in the 80's, when I was growing up, all personal computers would come with a BASIC interpreter which you could use to write your own software. As a matter of fact, it was expected for end users to write their own applications.
My very first personal computer was an Atari 800, I was in my early teens when I got it, it was a hand me down from my uncle, who had gotten himself a shiny new IBM PC.

During that time, computer magazines came with games and applications in source code form that you had to type into your computer in order to "install" them. A lot of us didn't know exactly what all these lines of code meant, but we wanted the game or application so we typed away, unfortunately typos were an issue, since we were just blindly copying what seemed like greek into our BASIC prompt. Fortunately BASIC was interpreted, so it would catch syntax errors immediately, but many times the syntax was correct, but there was still a typo in the line, making the program not run as expected. It could be frustrating at times, but it was very satisfying to finally get the code to work exactly right. You could also experiment and make little changes here and there to see if you could change the behavior of the software. I remember eagerly waiting for the next issue of A.N.A.L.O.G magazine to arrive in the mail every month to see what goodies it would bring.
It is worth mentioning that at this time there wasn't yet a dominant computer architecture for personal computers. Some of us had Ataris (8 bit and/or ST), others had Commodores (PET, Commodore 64 or 128, Amiga), others had IBM PCs, other architectures existed as well. What all of these architectures had in common was that they all came with a BASIC interpreter. As a matter of fact, in most cases, the machine would boot directly into a BASIC prompt. The BASIC versions of the machines were not 100% compatible across one another, since vendors modified them to highlight specific features of their own products, but in general your BASIC skills could be used across architectures.
I remember been amazed at the wonderful things you could make these machines do, it got me really motivated to learn to write my own software, not simply blindly typing code listings from magazines. A lot of software developers from that era got our start that way, at the time, the barrier of entry for software development was very low. I derived a lot of satisfaction in creating software, I would proudly show my creations to my friends and relatives. All of these got me motivated to pursue a career in software development, which is what motivated me to major in computer science when I went to college.
Somewhere in the 90's most of these various architectures disappeared, and the one true personal computer platform emerged, the IBM PC, or what we simply call a PC today. Just like all the platforms of the time, the IBM PC came with a BASIC interpreter, but unlike the others, BASIC wasn't built into the operating system, it was something you had to look for if you wanted to use it. When the PC became the de facto standard, the focus of having end users as programmers started to decline. Magazines stopped coming with BASIC listings for you to type in. When DOS 6.0 came out, PCs even stopped coming with a BASIC interpreter altogether. Now if you wanted to develop software, you had to install a compiler or interpreter yourself, which, sadly, is still the case today.
So I wonder, how do new generations of software developers get their start? It is not as easy to "get your feet wet" these days like it was back in the day. I wonder if they pick computer science without knowing exactly what they are getting into? It's a shame that software development is not as accessible as it once was.
Posted at 08:40AM Mar 15, 2009 by David R. Heffelfinger in General | Comments[53]
OpenOffice.org Document Version Control With Mercurial
I've always wanted to put my documentation under version control, just like I do with my source code. However, word processor files are binaries, therefore not that well suited for version control (track changes aside). Of course, they can be committed, however, being binaries they can't be diffed very easily.
Standard OpenDocument Text (the default format for OpenOffice.org Writer since version 2), are nothing but zipped XML files. I searched around for an easy, automated way to unzip them and zip them "on the fly" as necessary, thinking that i could put the "raw" XML files under version control. However, I couldn't find anything that would help in that regard. Manually zipping and unzipping files seemed like more trouble than it's worth.
OpenOffice.org's word processor, Writer, allows us to save in formats that are text based, such as Docbook XML, Microsoft Word 2003 XML, and OpenDocument Text Flat XML (.fodt). I figured I could try to use one of these formats internally, since they are text based they would be "diffable" by Mercurial (or any other version control tool), then when I needed to distribute the document I could export to Word format, PDF or what have you.
I haven't had the opportunity to work with DocBook in the past, and I admit I've been kind of curious about it, so I tried this option first. Unfortunately it turned out I couldn't use this format since I frequently work with Word templates (even though I work with OpenOffice.org, word templates work fine in Writer) and it doesn't seem like DocBook supports them.
I then turned my attention to the OpenDocument Flat XML (.fodt) format, this format can work with word templates, and it is saved as a plain text (XML) file. It looked like the perfect solution. To test it out, I created a simple document, saved it as OpenOffice Flat XML, and committed it to a Mercurial repository. I then made a simple change to this document, and did an hg diff on it.
To my dismay, this very simple change (I just added a new paragraph with a single sentence on it) resulted in quite a number of diffs between the two versions. Apparently this format contains a bunch of metadata such as creation time, creator, the time the file was saved, etc. This metadata was creating a number of diffs that were irrelevant to the task at hand, which is to find out what change I actually made to the file.
At this point I considered using the Handling OpenDocument Files oodiff trick described in the Mercurial site, however this trick seemed to me more like a hack than a proper solution. When using this approach, files are checked in as binary, then when diffing, a tool called odt2txt to convert the document to plain text "on the fly" then diff the plain text version. The problem with this approach is that the files are still commited to version control as binary, and most version control tools are not very efficient in storing binary files.
At this point started using the above trick, however recently I found the color extension for Mercurial, which allows diffs to be color coded. After I installed this extension, I gave the .fodt format a try again, and I started to notice patterns of what to look for when looking for diffs. For example, paragraphs are nested inside a <text:p> tag, this makes it easy to find text changes. Images are stored inside a <draw:image> tag, which makes it straightforward to see if an image was added, deleted or moved. Tables use the <table:table>, <table:column> and <table:cell> tags, making it fairly easy to identify them. This seemed like a good solution, however after a while I noticed that sometimes making a simple change in the document (for example, adding a heading somewhere in the middle), created a bunch of diffs on the document again, for example, lines that were now farther down in the document were being reported as deleted from one place and added in another, which is inaccurate.
For now, I went back to the oodiff trick, even though it bothers me a bit that I am checking in binary files to the repository, however this approach results in sane diffs that actually allow me to track what was changed in the document.
Posted at 11:29AM Mar 08, 2009 by David R. Heffelfinger in General | Comments[2]
NetBeans Book Now Available From Amazon
It has come to my attention that my newly released NetBeans Book is now available through Amazon.

Java EE 5 Development With NetBeans 6
It is also available directly from Packt Publishing.
Posted at 11:22AM Nov 02, 2008 by David R. Heffelfinger in General |
Blocking External Domains Pointed to Your IP Address
Last night I realized some bozo decided to point his domain name to my site. I don't know exactly what he was thinking, or what benefit he could possibly get from doing so. The only thing I could think would happen is that all my content would have an exact duplicate in Google, and we all know Google doesn't like duplicate content.
I contacted eApps,my hosting company, they contacted the owner of the intruding domain, and he refused to remove his domain name from my IP address. Tech support suggested I could set up an Apache rule to serve only my domains from my IP address.
I googled around to see how to go about this, but came out blank. Most issues I found were about preventing specific hosts to link to my site, which is not what I was trying to do. Once again I asked eApps support, and they came up with a solution.
I needed to add some rules to the Apache .htaccess file that would result in only my domains being served from my IP address:
SetEnvIfNoCase Host "mysite1\.com" local_sites SetEnvIfNoCase Host "mysite2\.com" local_sites Order Allow,Deny Allow from env=local_sites
Adding the above lines to .htaccess did the trick. The bozo is no longer serving my content from his domain.
Posted at 06:12PM Oct 07, 2008 by David R. Heffelfinger in General |
I can't fix your corrupted PDF
Just like I can't fix corrupted Excel spreadsheets, I neither can fix corrupted PDF files. By the way, if your PDF requires a password just to be read, I can't help you crack it. However, if you can't copy and paste or print your PDF (but you can read it), I wrote an utility you can use to remove those restrictions: http://www.ensode.net/pdf-crack.jsf.
Posted at 04:48PM Oct 06, 2008 by David R. Heffelfinger in General |
I can't fix your corrupted Excel Spreadsheet
Since a while back I wrote a utility that can , every now and then I receive emails from random people asking me to fix their corrupted excel files.
Well, sorry, I am unable to do that, good luck.
Posted at 04:45PM Oct 06, 2008 by David R. Heffelfinger in General |




