Skip to main content

Protecting your website's content from deep linking, when using the Drupal CMS

Posted in

Let's assume you operate a blog on your Drupal website. Let's further assume, you regularly write blog posts, containing things like zip archives or graphics. In that case, you have two problems. The first being, that Drupal throws all file attachments into the same directory, which occasionally leads to undesired automatic renames. The second and more annoying one is, that sooner or later someone will directly link to your files from a social media website. Such deep links will cost you bandwidth, without giving you the chance to convert those visitors into readers.

Java application does not start on Microsoft Windows

Posted in

Instructions for fixing broken file bindings for Java under Microsoft Windows.

Problem description: Java application (single .JAR file) does not start, when double clicked / Clicking the JAR file just opens a directory view, in which no executable file can be found.

Tip: Finding out, where an AdSense flash banner links to without violating the TOS

Posted in

Over the last few months, I noticed a steady decline in AdSense earnings. Checking the statistics revealed, that this was neither due to decreasing traffic nor a lower clickrate. Both, traffic and clickrate, have been fairly stable. What went down instead, was the earnings per click.

After looking through my website, I came across a couple of well-visited pages, featuring ads for free smiley downloads. Ok, culprit found. Someone, who offers things for free cannot afford to pay a lot per click.

Parsing email addresses in Java (without having the JavaMail API available)

Posted in

Today in the "can't be that hard to code" category: parsing email addresses.

Boss comes in and tells you, that some Java project will now allow the user to submit an email address. It is your task to write the sanity checks, rejecting anything, that is not compliant with the address specification found in RFC 2822. Oh, and by the way, the customer does not have the JavaMail API installed and cannot be brought to do so. Meaning, you have to re-invent the wheel.

How to recover an email account and password from the evolution mail client

Posted in

Ever wondered, where GMOME's mailclient "Evolution" stores the passwords for mailaccounts? Me neither. At least not until today, when I learned, that the credentials for a certain account were only known to a certain Linux box. This computer had some kind of hard disk related hiccup, which trashed a few things, vital to evolution. This little incident pretty much required setting up the mail client from scratch again. Only problem here: For that, username and passwords were required, which were now inaccessible.

Java GUI building with the GridBagLayout manager, made easy

Posted in

Update: The utility, described in this blog post has moved to it's own project page.

Every Desktop application pretty much needs a GUI. No problem so far. The trouble starts however, when components have to be arranged visually in a container. The preferred method for doing this is in Java, is to use a layoutmanager instead of specifying absolute pixel coordinates for component placement.

Writing modular Java applications (a suggestion for a simple, but versatile plugin architecture)

Posted in

Some things sound trivial to do, but on closer look turn out to be a formidable brainteaser. One of them is writing modular Java programs, where the core program can be extended using plugins. Such a design might be desirable, when extra program functionality is either to be licensed separately, to be contributed by third party, or generally "to be decided later".

Saving preferences for JToolBar location and window geometry

Posted in

Have you ever played the desktop puzzle? The goal of the game is to move around and resize the windows of all the applications you are currently using, to best fit the limited space available on the screen. A lot of people spend (or rather waste) a lot of time doing this and worst of all, they have to do it over and over again, as most programs forget their geometry setting after being shut down.

An introduction to compiler construction using flex and yacc

Posted in

Ever wondered, how compilers work or wanted to build one yourself, but just didn't know where to start? Seen the tools commonly used for compiler construction, but just couldn't wrap your head around on how to use them? Well, you have come to the right place then. In today's blogpost, I'd like to give an introduction on how to use flex and yacc, by showing how to implement a toy programming language, as well as a virtual machine able to run the compiled code of programs written in this language.

Drupal not showing javascript (e.g. AdSense) in nodes or blocks?

Ok, you have a shiny new website, you have Drupal as a CMS and you have an AdSense account. The only thing you don't have is a clue about why banners are not showing up on your website, even though you copied the AdSense code verbatim into your nodes/blocks.

Syndicate content