Stupid Sabbam, paying for listening to the radio?

August 15th, 2009

Am I the only one who finds this utterly stupid?

(For those who don’t understand dutch. In Belgium companies who have the radio turned on inside their companies (to make it a bit more pleasant for their employees) will have to pay.)

I still don’t fuly understand how this all fits together. Sabbam stated that if you play music in public you have to pay. So if my friends and family come over for a nice barbeque, I’ll have to pay them? If you will are carpooling, will you have to pay?

How does radio fit in here? If we will have to pay for everything we want to listen to. Why would I even listen to the radio then? I can find enought content under a opensource license. At the moment I hardly listen to the radio anymore, when I’m driving to work I always listen to my podcasts. The music business is a very strange thing if you think about it. They idea is that they want to sell as much as possible, right? They use the radio stations as advertising their media, face it if radio didn’t exist the music industrie would be much smaller. But now they even want you to pay for the advertising they do???? This is uterly insane, I know some of these things are also true for TV but … I find that employees and employers should do something about this, let’s all just stop buying music for 2 months, stop listening to the radio for 2 months, stop going to concerts,… just stop everything that gives the music industrie and sabbam money. Anybody with me?

Grails + JQuery

August 9th, 2009

Today I had a bit of time to do some further grails fooling around. I already had a working application old school (so everything you do was a page refresh.). I wanted to do some small Ajax stuff (getting a product using it’s id and then prefilling the price fields with that value.)

In my domain I have the following object

class Product {

String name
String description
double buyInPrice
double unitPrice
double vatPerc

static hasMany = ['productPricings':ProductPricingHistory]

String toString(){
return “${description} ${unitPrice}”
}
}

In my controller I have to following

import grails.converters.JSON

class ProductController {

def scaffold = Product

def showjson = {
def product = Product.get(params.id)
render product as JSON
}

}

In my gsp I have to following snippit

$(document).ready(function(){
$("#product\\.id").change( function() {
setPrice($(this).val());
});
$("#units").change(function(){
calculatePrice();
});
});
function setPrice(productId){
$.ajax({
url:"../product/showjson/"+productId,
dataType:"json",
success:function(json){initProduct(json);},
error:function(xhr){
alert("Failed to save patient!: " +
xhr.status + ", " + xhr.statusText );
}

});
}

function calculatePrice(){
var unitprice = $("#unitprice").val();
var units = $("#units").val();
$("#priceExcl").val((unitprice * units));
}

function initProduct(json){
$("#unitprice").val(json.unitPrice);
}

As you can see it is really nice. Okay with Java + DWR this is also very simple, but here I have it in my controller and just say render … as JSON and grails does the rest. Actually I still have to look if Spring has some kinde of build in JSON renderer. Probably somebody already created this. But hey now I save and run (no need for start stop of my application server :D ) and in the end it’s still bytecode I’m using.

I still have to do some grails testing where I generate my backend in JPA and include it in a jar. However the grails/groovy part should still be reloadable, right? Anybody tried this yet?

maven + netbeans + Java

August 7th, 2009

Today I wanted to build on of our projects with maven. (As I just deleted my .m2 repo it had to download everything and it took a while.) It went very fast until I started up netbeans that also had this project included. It seems that if you do builds command line and also have netbeans accessing the project this sometimes performs very strangly. You see netbeans keeps scanning the project and maven stopping regularly.
After killing netbeans maven again went blazing fast. After the first build from command finished I restarted netbeans and everything went fine. Pretty bizar if you ask me (however I don’t know the internals of netbeans and maven, maybe there are file conflicts??) Als rememeber that this is on my computer @ work, it’s a windows box with a virus scanner, so everytime you access a file it checks if there is a virus there, this could also have an impact off course.

Grails new site

August 2nd, 2009

Today I had to download the grails binary. I went over to http://www.grails.org. It seems they restyled their website, I have to say I’m impressed. I hope the default template that’s shipped with grails also got a restyling. For you guys who like nice designs have a look.

JavaFX + Oracle

July 30th, 2009

A while ago the javaposse opened up a system where we could post questions. A couple of episodes ago they started going through these items. Unfortunately my question didn’t get raised. Reason being that my question got more negative votes then positive votes.

If I look back now, it actually deserved this. My question went something like : “Why did Sun created JavaFX, Flex already plays nicely with Java, why not invent a Java to ActionScript compiler.” (somewhat like gwt but then ActionScript output). Now that Sun got bought by Oracle I’m pretty sure, JavaFX will succeed. At least if Oracle will put their money where their mought is. (Larry Ellison publicly announced his support for JavaFX). Why do I think this will have a big impact on the success of JavaFX. Well pretty simple, take a look at JSF. Oracle was one of the driving forces behind this. There still is room for improvement (isn’t there always). But it’s already a nice framework for building data centric applications.
If you now take a look at the new version ADF 11 and their JSF comonents. Well I haven’t seen many JFS components that are better. I have to admit, I myself am more in favor of none component based frameworks (they tend to be more flexible).
To come back to JavaFX. Currently we still don’t have a DataGrid or something. This is still a big issue, I feel somewhat like when Microsoft first released Silverlight 1. It was nice but not yet usefull. However in the near future I foresee that Oracle will finalize the basic JavaFX components and publish a nice basic DataGrid that will be on par with the Flex Grid(s).

And if all goes well, we should finally see a real Java(FX) component market happening. That’s something I still don’t understand. Flex was way ahead of Silverlight with their framework and wigdets. I recently wanted to compare them again. What struck me was the component market for Silverlight. I already have big players providing very datacentric and rich gui widgets for sale. For Flex I only found Ilog as big player there. I’m still looking for a DataGrid with very powerfull sorting,grouping,… basic stuff. In Silverlight these are already in production (have a look at http://silverlight.componentart.com/#Welcome) For Flex I’m still searching.

As Java is a much more programming driven environment I think these components will show up much faster and probably also in the opensource world. This in my opinion is the big problem of Flex. The framework and language is good enough to do this, but the most guys who know Actionscript have a design background and not a background in enterprise/component development. I really hope Oracle/Sun will release there version 2 really soon so we can see this happening. I’m actually really looking forward to the next couple of years in the Java eco system. We already have a wealth of opensource tools for doing enterprise development (starting from IDE’s,building systems,continuous integaration,testing environmonts,…) if we then would also get a good framework for doing rich gui’s that work perfectly on all platforms (even Linux, still my prefered one) … What does a developer want more?

laptop with serial port

July 14th, 2009

I recently bought a remote power bar. To configure it you need to connect to it with a serial connection. However I checked all my laptops and it seems no laptop has a serial connection. I also tried looking for one online, but I can’t find one. Does anybody knows a vendor that still includes this port? If I’m not mistaken there still are a lot of routers and other hardware that still have to be configured over a serial connection. Luckily I still have a computer who has a serial port.

Grails XFire + Flex (flex xfire Error #2032: Streamfout.)

July 9th, 2009

I’m building a small application for myself. It will manage my orders and invoices. Reason I’m doing this is mainly to try out new stuff. I thought I’ld try out a Grails soap backend with a Flex frontend. Doesn’t sound to difficult, right? Well I ran into a problem and it took me some time before I found a solution.

I had created a simple webservice that would return all my orders. Something like this piece of code

class PurchaseOrderWebService {

boolean transactional = true
static expose=['xfire']

PurchaseOrder findById(Long id){
return PurchaseOrder.get(id)
}

PurchaseOrder[] findAll(){
println(’listing all’)
return PurchaseOrder.list() as PurchaseOrder[]
}

PurchaseOrder save(PurchaseOrder order){
return order.save()
}
}

Pretty simple don’t ya think. This is now accessable as a soap webservice. In Flex I used the generator to generate all my stubs. The Flex code would look something like this

public function loadData():void
{
Alert.show(”test5″);
var service:generated.webservices.PurchaseOrderWeb = new generated.webservices.PurchaseOrderWeb();
service.addEventListener(FaultEvent.FAULT,errorHandler);
service.addfindAllEventListener(findAllListener);
service.findAll();
}

public function findAllListener(e:generated.webservices.FindAllResultEvent):void
{
this.orderDG.dataProvider = e.result;
}

Here I show the alert so I’m sure I’m not using a cached version of the SWF. However doing this returns a Error #2032. Why? Well I don’t know. I tried using the soap service from another programming language (c#) and it worked fine. After much googling I finally found the answer. For some reason Flex doesn’t like it when you don’t supply an argument to the soap call. The piece of code that finally did the trick looks like this

Grails

class PurchaseOrderWebService {

boolean transactional = true
static expose=['xfire']

PurchaseOrder findById(Long id){
return PurchaseOrder.get(id)
}

PurchaseOrder[] findAll(String dummy){
println(’listing all’)
return PurchaseOrder.list() as PurchaseOrder[]
}

PurchaseOrder save(PurchaseOrder order){
return order.save()
}

}

Flex

public function loadData():void
{
Alert.show(”test6″);
var service:generated.webservices.PurchaseOrderWeb = new generated.webservices.PurchaseOrderWeb();
service.addEventListener(FaultEvent.FAULT,errorHandler);
service.addfindAllEventListener(findAllListener);
service.findAll(”test”);
}

public function findAllListener(e:generated.webservices.FindAllResultEvent):void
{
this.orderDG.dataProvider = e.result;
}

Strange bug if you ask me. I hope this get’s indexed and it will help other people facing this problem.

mount within gnome access it using terminal?

July 3rd, 2009

I sometimes have to connect to a windows share from my linux box. I do this using samba (ff course). However when I start a gnome terminal and I want to go on that mounted share, I don’t see it. If I use the commandline smbmount I can access it. Does anybody know how you can achieve this? I find it strange that I have to mount it twice, once from inside gnome and once from inside my gnome terminal. Should be a solution no?

Flex + Grails

May 8th, 2009

At the moment I’m working on a publishing thing. The frontend is build in Flex and the backend is build in Grails. I have to say this is a super combination. I can leverage all my Java skills in the backend, I can use the advanced graphs that come default with Flex and best of all. If I don’t need to stop start my application server. I change my code, save F5 and voila my new code is running. Reminds of when I did a lot of php development (still do some, but not that frequent). Okay some of you may argue that Flash is not opensource, but Flex and grails are opensource.

If you need to have graphs in your application, you should really check out Flex. The Flex builder app is not free but there are opensource things (ant build files) that let you generate applications from your Flex code. I’m getting more and more convinced that Flex is the way to go if you do enterprise development. Some may argue that we should use domain driven development, but what prohibits you from doing this with Flex??

But like always choose the right tool for the right job.

Upgrade Ubuntu 9.04

May 1st, 2009

A couple of days ago I upgrade my ubuntu to the latest release (9.04). Like always I had trouble afterwards. After upgrading everything seemed to work fine. I opened firefox and didn’t see any flash … strange. I checked with dpkg and there it said flash-non-free installed. Hmmm very odd suddenly my 2 screens (dual desktop) fell out and came back, even more strange. A couple of seconds later they again fell out and I was back at the gdm login screen. What the f**** I logged back in and started investigating my flash problem. Suddenly my computer hang. I didn’t have the time to investigate so I rebooted and went to bed.

The next day I came back from work and the system was still up and running. My first guess was that the crash had something to do with the X system. I logged in from a remote system and started tailing almost all the log files. I tried to reproduce the system and suddenly again it crashed. I checked the logs but nothing came up after rebooting and rechecking the logs still nothing. As a last resort I downgraded my proprietary nvidia driver and after this my system was stable again. Anybody having/had the same problems? What fixed it for you?