Archive for July, 2007

Ariejan.net – What’s next?

July 16th, 2007

Vote now! What’s Next for Ariejan.net? Your opinion counts!

After a few days (or were it weeks?) of silence, an update on Ariejan.net. What’s been happening?

First of all, I recently graduated and am now officially a Bachelor of ICT. Since my current employer didn’t have the same views regarding my future as I did, I decided to go “shopping” for a new job.

I found that new job with a small business named Kabisa ICT. The people at Kabisa and I found common ground very quickly with Ruby on Rails and Agile Development. This, to my surprise, resulted in a job offer very quickly… and I accepted.

The next two weeks I’ve got a holiday planned to the French Alps with Laura. We hope to get some rest there while enjoying the beautiful scenery.

When I get back from France, I start my new job at Kabisa. I hope to learn a lot of new stuff while working there. Hopefully I’ll be able to share that experience with your here, at Ariejan.net, which leads me to the following question.

What’s Next?

What’s next for Ariejan.net? Since all the Web 2.0 buzz is all about communities and all that, I want your opinion on what to do with Ariejan.net.

Please vote in the poll below and let me know what your thoughts are. When I get back from my (well earned) vacation, I’ll check back here and see what you, my guests, really want.

You have the option of adding new stuff. Use it wisely, please!

{democracy:1}

Clear DNS Cache on your router

July 7th, 2007

I currently have a Linksys router at home that has the DD-WRT Firmware on it. I’ve been using it for quite some time now, and I’m very happy with it.

In my previous post I mentioned there was some trouble with DNS for Ariejan.net. I’ve changed nameservers and there’s always something that goes wrong.

Anyway, my router runs DNSMasq, a caching nameserver for my local network. (What this does is, it stores DNS queries and when the same request is made later on, the response is already here (on my network), and my ISP’s nameservers don’t have to be queried. This makes for a great speed optimalization!)

The problem was, that my router was caching parts from the old and parts from the new nameservers for Ariejan.net. I could have waited 24-48 hours to let DNSMasq figure it all out by itself, but I’m not that patient. What I needed to was reset the cache DNSMasq had built.

Some DNS problems with Ariejan.net

July 6th, 2007

This is just a quick note to let you know there are currently some issues with DNS for Ariejan.net. This basically means that Trac and SVN are currently not available. I’ve made the appropriate changes and things should be working again in a few hours.

I’m very sorry for the inconvenience.

How to write a Rails Plugin (for controllers)

July 6th, 2007

A few days back I posted my very first Rails plugin, Acts As Exportable. Although writing a plugin is rather easy, you must know a few tricks on how to get things going.

This article will show you how to develop a plugin that adds functionality to a controller (other plugins, e.g. for models) will follow later. In fact, I’ll explain to you how I developed my Acts As Exportable plugin.

Let’s take a basic Rails application for starters. You have setup a model with some attributes and a scaffolded controller that allows you to CRUD your items. In this tutorial I’ll be working with books. The model is named ‘Book’ and the controller ‘BooksController’. Start your web server now and add some random data to play with.

Before you dive into writing a plugin for the controller to export data to XML you should have some basic functionality in your controller first. I’ve found it easier to develop my code in the controller first, and then port it to a plugin.

How to resolve Subversion Conflicts

July 4th, 2007

If there’s more than one person working on a project, chances are (although slim) that at some point two developers work on the same piece of code and check it in. To clarify, let me give you an example.

The repository is currently at revision 5 and contains a file named ‘README’. Revision 5 of that file contains a single line: ‘This is a README file’.

Now, both you and your colleague check out r5 and edit README. Your colleague changes the line to ‘This is a documentation file’ and commits it back to the repository, which is bumped to revision 6.

You’re an island, and have no clue about the new revision being created. You just happily write away and change the README file to: ‘This is fun stuff!’.

When you commit your changes, you’ll get an error message:

c47786c06c6dec692b953b9107fed6fe013

How to create and apply a patch with Subversion

July 3rd, 2007

It’s been a while since I posted something new on the use of Subversion. I’ve been working with the tool a lot, and I’ve found that patches are a great way to communicate code changes.

For those of you who are still learning, let me first explain what a patch is. A patch is a text file that contains the alteration that were made to a specific file. It includes the lines that have been removed and the lines that have been added. In short, if you have a ruby script and edited it, you could create a patch file, containing the changes you’ve made.

Why is this useful? You could check in your changes to your repository directly. True, but there are cases that you don’t have write access to the repository. For example, if you wanted to contribute code changes to Acts As Exportable, you should create a new ticket and attach a patch file. I will then review your changes before I apply them to the code and commit them to the repository.

So, how do you go about creating a patch file and how do you later apply it to your source?

Got updates?

July 3rd, 2007

Do you want to stay up-to-date about what’s happening at Ariejan.net? That’s real easy!

You can subscribe to my RSS Feed and receive updates as they happen in your favourite RSS reader.

If you don’t have an RSS reader (or don’t want one), you can subscribe to my e-mail service. This service will gather up all the posts of the previous day (if any) and send them to you between 7am and 9am (CET).

How to force data to be downloaded as a file from your Rails app

July 2nd, 2007

In the essence of every application is data. One way or another your application manages data and at some point, you need to get that data out. Either you want to synchronize the data with another application or device. Or you want to move your data to another system all together. Either way, you’ll need to gather your data and send it from your application to the client… as a file.

Downloading files is not the hardest thing around. But the problem is that some formats, like XML, are automatically parsed by the browser and this makes it harder for users to download files like that.

So, what you want to do is, ignore the browser and offer your data (in XML or whatever format you want) as a file that can be downloaded directly. The solution is rather easy, as always with Rails.

ActiveScaffold + acts_as_taggable + Auto Complete

July 1st, 2007

I’ve talked before on how to use ActiveScaffold with acts_as_taggable_on_steroids.

The problem with that solution was that, although the checkboxes for every tag are very nice, you couldn’t easily add new tags. For some people, this may be fine, for others, it is not.

Together with a colleague (who wishes not to be named), I found a solution that is quite elegant. Instead of using check boxes, and creating all kinds of subforms in ActiveScaffold, we opted for an auto_completing, comma-separated list of tags.

This article descripes the solution we found. I think you’ll like it very much!