Martin @ Blog

software development and life.

Flower

Archive for the ‘Webdevelopment’ Category

Improving weblog

As I mentioned in my last post, I have a little comment spam problem. This problem resulted in over 30.000 spam comments on my weblog (most of them are deleted now, but still some 2000 remain). The problem is that there are actually some non-spam comments on my webliog (yes, it seems strange, but it is true 🙂 ). Because most spam comments are on only a few posts, it would be helpful to ‘mass edit’ the comments of one post. In current versions of WordPress, this is not possible. So, I created a patch which enables this (it was pretty easy). During the creation of this patch, I noticed that the source of the admin part (I didn’t look at the other parts) of WordPress is a bit of a mess. Different kind of block separators are used (both brackets and ‘endif’s) and the commenthandling should be abstracted to some classes (it is now in a very long php-file without any functions). I expected the WordPress code to be cleaner than this. Even some ‘low profile’ php projects have cleaner source code. The ‘comment management’ code is duplicated in at least two files…

I also installed some anti-spam plugins on my weblog. I hope these will block most of the spam. I am also tracking some visitor statistics, for which I’ve created a plugin (not available yet for the public, because it is not finished yet).
I also discovered that my current archive goes back to the beginning of 2005. However, I’m already blogging since early 2004. I thought I lost most of these posts during a harddisk crash, back in 2004. In a recent cleanup of my harddisks, I found a very old databasedump of my weblog, with posts from the start of my weblog until the beginning of august 2004. I’m planning to import these posts in the current archive. This is not very straightforward, because the database id’s overlap with the current posts, and also the categories are different than now.

Website update

I decided to update my weblog a little bit. Combined with the upgrade to the latest version of WordPress, I have introduced a new design of my weblog. I also cleaned up the content of the site a little bit and added some additional information.
The last few months I did not updated this site very regularly, which caused a massive amount of spam in the comments. I cleaned up most of it, but there is still a huge number of spam comments to be removed. Because there are some ‘real’ comments, it is not simply a matter of deleting everything from my comment table… I have to figure out a long-term solution for this problem, because sorting out 30.000 spam comments is not fun.

The new design of my site is implemented as a WordPress theme. I used the default WordPress theme as a starting point, and modified it according to my design. It turned out pretty easy to modify WordPress this way. In the past I had the intention to write my own weblog software, but due to experience, I learned that it take too much time to write a fully functional package myself. It is also not very smart, but it is way faster to modify existing software in order to include all the features you wish. I only need to find a good software package for publishing my photo’s on my website. Something which is easy to modify and is stable. I wrote in the past something which could work, but it will take a very great amount of time to finish it, and I don’t think I have the time for that (I can spend the time I save this way on improving other software).

Mugshot

Red Hat has introduced a new social community site called ‘Mugshot’. It’s not entirely clear to me what the goal of this project is, but I have got the feeling that it could be useful. Currently, it contains a thing called ‘Music radar’, which enables people to publish information about songs on their weblog or website.. I’m not sure what is new about this. Another feature is called Link Swarn, which enables people to discuss about weblinks. This is quite interesting I think. During my exploration of Mugshot, I came across this. I hope that this will not be the process a user has to go through in the final version, because it will be a nightmare for helpdesks and system administrators, because not any non-technical user will understand this behaviour. On the other hand, if it will be the case, there is a clear oportunity for other OS’ses like Mac OS X and Linux because the usability will be so much better, that even stupid users will see it (I hope).

Tomcat and Eclipse integration

For my graduation project, I’m working on a J2EE-application. Because I didn’t have any experience with J2EE, I had to learn all this from scratch. Installing Tomcat (which was the application server used for the project) turned out to be very straight forward. Until this week I only installed the already available program, which worked for the largest part. However, I have to improve this program and some parts weren’t working. So, I did some research about developing on J2EE applications. I decided to use Eclipse as my IDE, because I used this environment before for simple Java-applications.
Because Eclipse is positioned as a high-end development environment supported by large corporations such as IBM and others, I figured out that there had to be a way to integrate Tomcat development in Eclipse.
It turned out that this is actually very easy. The thing is that you have to know where to find the appropriate software and documentation. Using Google I found some webpages (Javaboutique and IBM Developerworks) where is explained very clearly how to integrate Tomcat development in Eclipse.
First you have to install Tomcat (see the Tomcat site for instructions on this), then you have to install Eclipse (see the Eclipse site for instructions on this part, which is really very easy). After these two steps, you have to download the Sysdeo Tomcat-plugin for Eclipse from their site. The zipfile in which this plugin is distributed should be unzipped into your Eclipse plugin-directory (ECLIPSE_HOME/plugins). After that you have to enable the new menu-options in Eclipse which are introduced by this plugin, which can be done in Eclipse by going to the Window-menu and selecting ‘Customize perspective…’.

For detailed information, I can recommend the two links above. While these tutorials sometimes use older versions of the software, the global steps are similar and it will work (I’ve tried it). I always thought that setting up a J2EE development environment was a cumbersome process, but it is way less complicated than it may seem at first. The benefits are great, because it is very easy to create JSP-files and by two clicks they are deployed on your Tomcat-server. It may take some time at first, but then the development process is maybe easier than with PHP or even developing using Microsoft Visual Studio projects (ugh 😛 ). Maybe the most powerfull feature is the possibility to use the Eclipse Java debugger for Servlets. While I didn’t try that part yet, I’m sure this will be very usefull…

By the way, according to Google, Eclipse and Tomcat are part of Fedora Core 4, which makes the setup of the environment even easier. An added bonus is that in that case you only use open source software. On Ubuntu this is also possible, but requires some additional effort, because Eclipse is a little buggy (i.e. no syntax highlighting for Java-files) and there is no Tomcat available, so you have to install that one yourself. I think it is even possible to do it all on Windows and Mac OS X (maybe a nice thing to try when I’m at home.. I wonder how fast this all is on my Mac mini (because it is not very fast on Linux on my laptop).

Webdevelopment on Mac OS X

Today I did some work on a new design for my weblog, mainly HTML and CSS coding. First, I’m still searching for a decent HTML editor for Mac OS X. There are several freeware texteditors and even HTML editors, but these don’t even come close to the editors which are freely available for Linux, especially Gnome. Using Gnome, I normally use Bluefish or just Gedit for editting PHP and HTML files. Fortunately, it is possible to use Bluefish on Mac OS X, using Fink, however, this isn’t as integrated as for example Inkscape or The Gimp for Mac OS X. Maybe I should fix that when I have some spare time left.
My new design is mainly a new CSS file for the default Kubrich design which is used by WordPress. It turned out to be very simple to change the layout when you’ve become familiar with the CSS file. I also tried to get the design working on Internet Explorer 6. This turned out to be a little more difficult than expected. The Kubrick-theme for WordPress isn’t already working flawlessly on IE 6. This is caused by the crappy CSS implementation on CSS. Looking for a solution for my problem, I learned about ‘quircks’-mode and the lack of support for some CSS attributes on IE. Especially the missing min-width and max-width on IE is very annoying. Unfortunately, there doesn’t seems to be an easy solution for fixing this bug.

E4X in Firefox 1.5

Unfortunately, Firefox 1.5 is not yet integrated in Ubuntu Breezy Badger, and according to messages from developers on the Ubuntu Forums it will probably never be backported to Breeze Badger because of the large number of dependencies for Firefox. The next version of Ubuntu, however, will ship with Firefox 1.5 and the development version should be equiped with the new version of the browser.
Today, I read about E4X which is an XML extension to JavaScript (officially ECMAscript) and enables webdevelopers to directly use XML in Javascript. I think this is pretty cool. An example on the weblog of Jamin Philip Gray shows that it is possible to put XML in an ordinary variable and then access the data in the XML easily using standard JavaScript operators.
I think this behaviour should be implemented in other languages as well, because it simplifies working with XML. Java and PHP developers should look at this 🙂

You are currently browsing the archives for the Webdevelopment category.