Groovy and Grails

During my vacation I did a bit of development in Grails. I have to say I’m pretty pleased with the result. I did a small app for creating offers,orders and generating an invoice from these. I migrated my old postgresql data to the new mysql schema.

I know there are already opensource tools out there who do this. But I wanted to try this technology to build something. Why not something I could use myself.

Grails uses the same ideas as rails but uses the Groovy language. This language leans more towards Java (and actually is just an extra layer on top of Java). I have to say that once you get the hang of it you’re actually more productive using this technology. But off course there is a downside. If you have an existing database with data you could have problems mapping these things using Grails. Grails uses Hibernate underneath but some things are not straight forward, e.g. if you want to use the scaffolding feature make sure your domain class has an id property otherwise you could get into trouble. This looks straightforward but some of my classes had an invoiceId instead of id property.

For the next stuff I’m going to build a Flex frontend. I already did some appz using Flex but there’s still plenty of stuff to learn and the opensource components are growing every day so …

Anybody know these kind of child friendly organisations?

Today I recieved a phone call. A woman called me asking if I would like to support their organisation, this was a one time only offer. They were helping young children who had a special disease and who couldn’t afford the medicine. She had prepared a whole text that she was rambling like an idiot. In the end she asked me if I would like to sponsor them. I replied “No” … Why you may ask, well this exact same lady called me a couple of months ago with exactly the same text, exactly the same offer but only for another organisation. At that time I asked here to send me all the data by mail and I would read it and she could call me back. It struck me when I saw the mail, the sender was something callcentre antwerp.

I started thinking, well if you have a callcentre and are in financial troubles. You could always start an organisation for helping children (who doesn’t want to give some money to children in need?!) You then start calling people (bussines people who can deduct the costs) and ask them to support your ideas. With all the money you raised you deduct your costs and some profit and the rest you give to a real organisation who helps the children. Sounds like a way you could easily start a bussines and even make a big profit.

The first time I gave them money. That time it was for children who had cancer and they wanted to grant them one wish. As my father died from cancer 4 years ago, this touched me and I gave them some money. But when she called me today I was rather angry. If these organisations really work like I suspect them to work, how can you do bussines like this. I explained here the story and told here that she talked to me for another organisation and instead of handing here the money, I would rather give it to an organisation I know. Or sponsor somebody I really know and care about and who has an expensive illness. Almost everybody knows somebody in need so …

Does anybody out there know these kinds of organisations? Can you inform me if they really work like this or if this is just my imagination going wild?

new home, back to linux :)

With the birth of our baby girl, my girlfriend and I decided to move back home until we found a real house. We didn’t want to raise our children in an appartment. After a couple of months we finally found something we liked. In the mean time we already bought it and are living in it. There is still plenty of things to be done, but we can live in it, be it somewhat messy but still beats living at home 🙂

The requirement was that I also had my own room to put my computer stuff. Luckily for me this point is checked 🙂 I managed to setup my linux computers again. Finally I can get back to working on a Linux desktop. You might tell me, use it at work or on your laptop. Well actually at work we are obliged to use their windows systems. It is managed by there sysadmins and they do a good job so I won’t bother them. I can do my daily tasks (be it somewhat slower then on a linux machine). So I figured I buy a new system where I could install a fresh ubuntu on. The only requirement there was that it was kick ass laptop (high res,7200 rpm disk,17″ screen + keypad). So I bought a Dell XPS. I got it delivered with windows XP on it. I tried booting into the ubuntu live cd, no go, tried installing fedora, no go … Still have to try Suse but I haven’t got my hopes up. I should have known that this was too exotic hardware to work out of the box. For now I’ll use my macbook at work and use the Dell with win XP as is. As soon as the next releases come out, I’ll give them a try until they finally boot.

Hmm, I’m drifting a bit 🙂 I just wanted to let you know I’m back using Linux on my machines and boy have I missed it. All the applications you need freely available and if needed customizable at your very own needs! hmmm

Tomcat non SSL behind Apache SSL

First let me explain our setup. In front we have a Apache 2.2 with SSL. Our users can access the site using http. A certain URL is mapped to a Tomcat running in the background. This mapping was done using mod_proxy. In the beginning I had to enable the preserverhost option. Otherwise the request.getRequestURL() is the request Apache made to the Tomcat.

Today I had to install a SSL certificate (signed by Verizon). The configuration was actually straightforward and after a restart I checked the main page and everything was working. Then I tried loging in and suddenly I was back to plain http. Hmmm strange, so I checked my code. After login I did a redirect (using Spring MVC “redirect:/”). After some googling I found a setting that would help RequestHeader set Front-End-Https “On”

(Don’t forget to include the headers module!) After a restart it still didn’t work, after fiddling around with my settings I found the solution. It seems if you combine the RequestHeader setting with the ProxyPreserveHost this doesn’t work. If you disable the ProxyPreserveHost setting but leave the RequestHeader enabled everything is working fine. The problem now is that your request.getRequestURL() is not the URL your customer is using. Luckily I could solve this by doing request.getHeader(“referer”) note that this probably won’t work in every situation (but in our case it does). Hopes this helps some people who are searching for the same solution.

Amazed by the speed of 3G

I’m writting this on a laptop with a 3G modem. I’m actually amazed by the speed. I had to get some files from an FTP server. The speed was about 150 Kilobytes / second. I sometimes even have trouble getting that with my adsl account. I had read about the theoretical speeds but had never seen it in action.  Still have to check how fast it goes if I use my iphone as wireless router, should get the same speed IMHO. Anybody tried it yet?

Devoxx Thank you Stephan Janssen

I would just like to say thank you to Stephan Janssen. The first talks of Devoxx (Javapolis) are already online. I bought a ticket this year, but because of the death of a relative I really didn’t feel like going. It’s nice to be able to still watch some sessions. Ok, It’s not the same as being there, but I still get the information I would get if I had attended. Keep up the good work.

@Stephan If you read this, any idea when we will be able to see a glimpse of the JavaFX and Silverlight version. I’m really curious what the results will be.

I myself actually don’t believe in JavaFX. I have to admit they have the strength of Java but they still lack a lot of things. One of the reasons I’m so interested in Flex is the fact they already have lot of standard components. Strong set of graphs,calendar,datagrid,… in the beginning Silverlight was also missing these features and almost nobody wanted to use it. With Flex you are even starting to see community efforts for making custom widgets. I for one have already used the CustomDataGrid where you have a builtin search functionality. You just give the grid a couple of 100 lines and you can make the searchable,customizable columns,… Don’t you just love the widget/component based frameworks 🙂

z-push imap + Iphone

Like I mentioned in my last post I bought myself an IPhone. Before my IPhone I had my blackberry and I got used to being notified when I got new mail. On the IPhone however IMAP only has 15minutes updates, so you have to wait and it’s not really 15 minutes …

The nice people from zarafa created z-push. An opensource php application that mimics active-sync. I installed on my server and made some small changes. Now it works on my imap account and I get notified of new mails in my inbox.

I did however have to do some minor changes in the php code.

In config.php changed backend to imap

$BACKEND_PROVIDER = “BackendIMAP”;

in backend/imap.php changed to retrieval to only retrieve the INBOX to check for changes (I have +100 folders)

$list = @imap_getmailboxes($this->_mbox, $this->_server, “%”);

in backend/diffbackend.php I changed the default cutoffdate (this showed up 0 in the logging)

function getCutOffDate($restrict) {
$restrict = SYNC_FILTERTYPE_3DAYS;

Now my automatic notify works 🙂

Like they mention in the forums, it does drain your battery life on the IPhone. So be carefull when you turn it on!

thank you Iphone

This morning there was a strike in Belgium. The nice people forgot to mention that they would also do road blocks. It took me 4 hours and 30 minutes to drive to work. Normally it takes me 1 hour and 10 minutes. (I leave at 5.30) so this morning I arrived at 10 o’clock.

2 weeks ago I received my Iphone. I used TubeTV to download some videos from the google channel (e.g. the html5 stuff) they got converted to Iphone format and I had uploaded it. So during my +4 hour drive I watched some episodes of hak5 and also the html5 google video . I can tell you one thing, I am glad I bought the IPhone. There are still some pieces that could be better (sending text messages amongst others) but having a multimedia device in your pocket is really nice (If only nokia had given the linux tablet a phone, I would have bought it a long time ago but I’m really not going to stuff a mobile phone and pda in my pants!)

I know openmoko is going pretty well but from what I understood, making a phone call isn’t always without problems so that’s really not an option as primary phone!

Zarafa – ms exchange replacement

As I’m always looking for a product that can compare ms exchange I found a nice post in my rss reader. It talked about the Zarafa product. It’s not opensource but at least it runs on Linux. The company behind is also contributing to openmapi .

I think I’m gonna test the development version. Maybe you can even use the exchange sync feature many phones have these days. At the moment I have a blackberry I like the fact that all my mail gets send on my device, but I miss the feature that my contact,tasks,… are synced

Anybody have any experience with this product ?