Tuesday, 2 December 2008

distributing mercurial to disconnected locations

Having some issues, teething problems with Mercurial. Here is the story:

Started a tiny mini project, a quick currency conversion web app, as typing the extra 10 characters into google is too cumbersome after a while....

Naturally picked new technology to play with, this time it being Grails and Mercurial. Having already played abit with groovy in my recent
wishlist facebook app, the next step to grails was not too hard. With NetBeans excellent support for groovy and grails, getting up and running was quick.

Having followed the story of Mercurial, Bazaar, git and other DVCSes recently. My adoption of them have only been delayed by being busy and not having a new project to test them out with. But now came the chance, and Mercurial being the one I wanted the most to try out, (wish their push back to SVN became usuable soon). It being integrated into NetBeans already also helped.



But I quickly became a little stuck. Mercurial does have a lot of documentation
(2), and many blogs to cover a large set of situations. But nothing quite described (spoon fed) me the steps I needed. Maybe playing a bit devil's advocate, but...

Basically I would develop this app in two places. I do 99% at home, while I'd also use it at work, thus would do the odd tweak there as well. SSH and web shared repositories is not an option due to work policies. So they are two disconnected locations.

So I create a grails app, do hg init. But then how do I get it to the other location??? I can not do a hg clone a b, because they are in different locations. A public shared repository is not an option.

There is not a guide for how distributed groups get started (without a public shared repository), only that it is a very distributed SCM. :0

OK, so what I will have to do is tar up the project, take it to the other location and clone it. Then email changesets somehow, presume with export or bundle.

Actually I see you can pull other repositories into any repository, so I suppose I can hg init a folder in each location, but still need to tar across an initial copy?

oh well. Guess I can document it next week.

Thursday, 30 October 2008

Doh! Server is down

Bugger, think my server has gone down. Its an Amazon ec2 instance, and been up for awhile. But now it cant be reached, not even within their cloud. Tried to reboot it via elasticfox, no luck.

Never got time to make the disk persistant, with the new Elastic Block Store. Doh! Again.

Havent synced to S3 for a while, probably months. Doh! 3rd time.

Don't think Ive lost much critical stuff. All flurdy.com changes are gone, but google cache may retrieve some of it. All logs is also gone, and any recent changes to application databases...

And my subversion server was on the same server. Doh! 4th.

Wish I could afford to run more than one instance on ec2, so that I could spread load, seperate concerns and not have a single point of failure which kills everything!

Better start to get another server up and reconfigure it. But not sure when Ill get the time. But I also wont receive any email till then as it was also my email server!

Wednesday, 29 October 2008

Not always flurdy

Ive been using the username alias flurdy since probably about 1994-95, when at university I had to start picking a username for different sites in the early years of the internet.

Flurdy, came naturally as I had to pick something unique, and being a Norwegian lost in England, some friends called me flurdy-gurdy, with some references to the Bork-Bork Swedish chef in the Muppets show. (Actually it was the nickname "Fjords!" that stuck, and some friends from uni still call me by that today!)

Flurdy has been a good username as I haven't needed to use flurdy-012 or some random extension to use popular services. So I dont have to remember what username is used for what and where. ( Hackers be aware, there is something called PwdHash, so these are not the accounts you are looking for... I dont use it but hopefully that will disinterest them...)

I become so attached to the username, that it is the alias I use for all my development work, and flurdy.com is my main web site, even though ivar.co.uk would be more natural. So it has become my identity, so much that I even now sell t-shirts with the logo. If I start a business (again) I would probably use flurdy brand more than the eray one I had planned.

However flurdy is not 100% unique, and does not always mean it is me. On some websites, the flurdy user is not actually me. I dont think I have fans, especially not copycat ones. :) But I found some people actually named Flurdy, mostly irish, and there are probably a few that also use that username for some reason or another.

So for instance on del.icio.us, flurdy is not me! Nor is it in Yahoo, eBay, Digg or Stumbleupon.

In del.icio.us I am flurder instead. Actually on Digg and Yahoo, it might be me, I just cant get the password reset!( I never put in my real birthdate and similar, as I dont think they need to know. And never the same spammable email address either...) But definetly in delicious and stumbleupon it is someone else!

I just wonder if people mistakenly assume all flurdys are me, and presume it is my links in del.icio.us for instance. As is turns out that person has similar links to me, so probably doesn't cause any problems! Been weird if it was some tree-hugging artist living in the pacific, but then he probably wouldn't use del.icio.us.

But I shouldn't complain, a google search on flurdy is mostly me for pages, especially if you remove gurdy. But the odd non-me are still on each page...

Wednesday, 15 October 2008

groovy netbeans so far

been hacking away at groovy with netbeans as IDE for the past few weeks. Also using it with spring for a facebook application.

Well, I am still coding the java way... Hard to take the red pill. Groovy is nice, but not sure Ill use it for all coding in future applications. It can certainly be partly used, for often changed code. It may however replace my perl scripts.

As for netbeans and its groovy support. It does not seem finished: Its useable with neat tricks, but still fiddly, and some things just dont work. E.g creating a project from netbeans, then wouldnt let you add groovy classes to groovy folders only java source folders. Creating a project from scratch using maven archetype got working, but new java sources arent' happy then...

As in general use of netbeans it is very good, however a nightmare on a low memory machine, especially with encrypted disks. If I type one word, ill have to wait 10 secs before I can type the next word. Infuriating. So notepad++ is my general editor on that machine.

On a still low spec machine but without an encrypted disk it is better than eclipse. However all popups take 10secs before they finish "scanning", so they are irritating.

As for general development with groovy, it certainly increases developer velocity. However I keep flicking back to Java as certain mixture of architecture and technology is not quite there yet.

One thing that does work well with groovy and spring is spring's new annotation based configuration.

One thing I hope will soon work is dynamic beans, which spring has, but does not as yet work with annotations.

Monday, 6 October 2008

Why waste money with inferior equipment?

Single most expensive element of any project and regular company expenses is the salary of people, ie human resources.

Then why do companies insist on saving money elsewhere which increases the cost of staff? Ie. why so restrictive on hardware and software tools?

I think most managers see the expenses on e.g. new PCs as the only place they can make cuts, and are too blinkered to see the effect. Which is increased salary expenses as people take longer to do their job.

Yes, they should not be frivilous, and people always want new gadgets, which some are unneccassary and cause distraction. But they restrict people far too much which in the end costs them more.



For example (and the reason form my rant):
I am a consultant contracted out to a client. Both from my employer and client I have really inferior PCs. And they fail to see this costs them more than it saves.

( This is not specifically targeted at my current client, which is one of the better ones Ive encountered, but they suffer from the same problem. )

The PC I must use have a really slow single core processor with little memory, so most of my time is spendt waiting for the screen, IDE, explorer to refresh.

And the disks is encrypted, which really causes everything to slow down to a halt, especially due to low memory, that the swap file is used a lot...

I don't help by having weblogic, jetty, 1 or 2 eclipse workspaces and netbeans, and 10+ firefox tabs up at the same time, but the machine should handle this.

I would guess as much as 1/3, minimum 1/5, of my time is wasted waiting for the pc to catch up. If you add that up, for 40 hour week say ~10 hours a week is wasted. That is 10 000kr or £1000 per week of invoicable time.

Sure, some waiting will always happen. Especially with inneffective build scripts, wandering concentration... etc.

So they save an initial £1000-2000 by giving my an old machine. But it costs them e.g. £4000 every month! Blinkered wastefullness.

Not to mention only supplying 1 small screen slows down productivity when Im not waiting....


Why restrict developers? If I had a 4gb+ multicore laptop/desktop, or if running linux/osx server processing access, 2 screens, my productivity would be nearly doubled!

( Yes, slow maven scripts (and little use of jetty etc) means I tend to wander onto digg.com for too long while building, but that is another issue... )


As for my real employer, the direct saving is not so obvious if supplying better hardware, as I am mostly working on client pcs. But there are also consequences of that the one they supply is rubbish.

So doing internal development, evening personal development is more and more difficult, or even absent, as the hardware tools is not there. The one I have from them is even less capable, so it is fast becomming just an email reader.

It is a risk for them, as I ( and I presume the others ) are contacted weekly by recuiters offering gadget budgets, macbook pros etc.


So several articles, research papers have been published to inform managers that salary expenses outweight all other costs so much, then why do they not see to optimise that expense? It is very annoying / tempting when reading / hearing of people being given the right tools to do their job, when you are not. :(

Thursday, 2 October 2008

too much sports!

I do too much sport.

Not that looking at me that would be your first impression, :) but sometimes I think I do.

Clarification: I don't play sports 24/7 anymore. But I am interested in and pursue too many sports. And no, not just as a spectator, but active participant.

As a kid I would play all sports all the time. I would play football (soccer) once or twice a day, I would play ice-hockey all winter, I would ski, swim, etc at any oppertunity etc.

This continued with a lot of football and hockey throughout university. Large quanteties of beer and kebabs at university, followed afterwards with no time due to work, technology and girlfriend meant my physical shape no longer reflected a sporting interest...


But my moan today is that I still do too many different sports, and I enjoy them all, and I do none often enough to get good at any of them. Im not bad at any sport, but not great at most.

Once a week, which in reality works out to twice a month, I still play football, mostly 3-a-side indoors, and now also floorball (innebandy).

Before I changed contract to down the road I used to cycle to work. Now it is only the occational trip at weekends.

Squash, played twice this month. Before that it was two years.

Tennis, got the gear, used to play a few times a year. Last time: two years ago.

Ice hockey - go skating a few times a year, no-one to play with anymore....

Rollerblades - Go 5-10 times in the summer, which are brief in Norway.

Kayak - did beginners course last month. Loved it. Cant imagine Id go more than once or twice a year.

Sailing - still waiting to get round to do my beginners course.

Climbing - ditto

Downhill skiing - More now I live back in Norway. About 4-5 times during winter.

Crosscountry skiing - An option again now Im in Oslo. 3-4 times a year.

Jogging/running - finally a sport I don't enjoy. but get dragged along. about once a week at the moment, hoping to cut down to once a month.

Gym - stopped paying membership when I moved.

Keen on any other sports as they come along: badminton, basketball, (beach) volleyball, surfing, snowboard, you name it.

So in the end its all different sports every time, and a long time between each time I do the same sport, so I don't think Ill make the olympics. :)

Monday, 22 September 2008

groovy maven netbeans jetty facebook spring

Time to rewrite my old wishlist facebook application.

The old one (v3.x) dont work anymore as the web services are gone, I took them offline many months ago. The new application will use the wishlist 4.x web services running on wish.flurdy.com.

Tech stack for this project will be:

Language: groovy.
Build tool: maven.
Web server: jetty (maven plugin).
IDE: netbeans (6.5, with groovy plugin and maven plugin).
Framework: spring (+mvc and WebServices).

So really, only groovy is new compared to the other wishlist projects, but it will be nice to see groovy interact with them.

Already hitting some snags with groovy, maven and netbeans. Seems to be a few posts on how to use netbeans and groovy, or maven and groovy, but not all 3 together.

May at some stage try grails.

Friday, 19 September 2008

groovy spring annotation

Hmmm.

Groovy supports well spring's annotations.
Spring's dynamic language tags are also handy.

But I wish there was some dynamic language annotation!

As in eg, I have a Service written in Groovy such as:

@Service
class PersonService {

@Autowired
PersonRepository

blah blah ...

}

wouldn't be nice if I could:

@Service
@DynamicScript("Groovy")
class PersonService {

@Autowired
PersonRepository

blah blah ...

}

thus enabling it to be a refreshable bean without xml!

Sunday, 14 September 2008

No value specified for parameter when using MySQL with JPA/Hibernate

I came across a problem when swithching database for a project from HSQLDB to MySQL.

I am using memory based HSQL for unit tests.
I am using file based HSQL for development testing.
I have changed my integration tests to using MySQL from file based HSQL.
Final production release will probably use MySQL or Firebird.
(This isn't commercial work, so no Oracle in any stack...)

But when I switched to MySQL, JPA/Hibernate starting complaining about: No value specified for parameter 2. As usual the generic multiple vendor reasons for using JPA/JDBC usually is not true...

Was a bit dumbfounded with this error, but eventually found the solution : http://opensource.atlassian.com/projects/hibernate/browse/HHH-2605.

As it turns out there is a bug in the version of Hibernate that I use.

I depend on
 <dependencies>
 ...
   <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-   entitymanager</artifactId>
    <version>3.3.1.ga</version>
   </dependency>
 ...
 </dependencies>

And this version in the maven repositories was uploaded with wrong transparent dependency to hibernate 3.2.4.ga, which is buggy.

But the quick fix is to change my own dependency management to use version 3.2.6.

Thus this change solved the problem:
 <dependencyManagement>
 ...
   <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate</artifactId>
    <version>3.2.6.ga</version>
   </dependency>
 ...
 </dependencyManagement>

Maven causes problems, but also solves problems...

Friday, 12 September 2008

Copying message to Sent folder?

Problem sending email in Thunderbird?

Encountered this problem a few times, so thought I'd blog my about my last solution to this.

Frequently people when trying to send email with the Thunderbird mail client, are not able to do so, and a popup with the text "Copying message to Sent folder" are forever present on the screen.

There are many causes for this symptom (1,2,3,4,5), and several solutions (1,2,3,4,5,6). It seems it is a problem the Mozilla mail clients have suffered for a long time.

In my last encounter, which was a family "helpdesk" case, so VNC session across the sea. :)

As mentioned the problem was that the "Copying message to Sent folder" message was continuously displayed, so the sender had no indication whether the mail was sent or not. It was. But never copied to the Sent folder. Nor by canceling where they able to save it to the Drafts folder.

What seemed to be the problem was the selection of where the Sent and Drafts folders where. In Tools/Accont Settings and Copies and Folders. They had it set to the default, ie. eg. the "Sent" of each account. This had worked for a long while before.

But by changing this to the custom option, and manually choosing the Sent folder, solved the problem! I also had to create the Sent folder for one account, and a Drafts folder in the local account.

No doubt, Ill re-encounter this in the future, hopefully Ill remember to check my own blog...

Wednesday, 10 September 2008

find cool t-shirts

Ive set up a shop for t-shirts, shirts and jumpers. Its at flurdy.spreadshirt.net.

Most likely myself, friends and family will be the most interested, but the general public may find them funny, so help yourselves!?

There are some longsleeved shirts and hoodies, some tops for woman, but mostly t-shirts. Most are branded with flurdy logos. Prices are in british GBP at the moment.

These are generally shirts I would buy myself, maybe other share my taste... Here is one of my t-shirts:
test

Monday, 8 September 2008

find friends, spam friends, next family

I use facebook to link up with old friends and collegues. Now less and less, as not much happens on it anymore, as most friends I know that are likely to be on are now on it and have found all their likely friends. So now it is quieter than the rush of last year.

The novilty has worn off, people have already caught up with old friends, the funny apps have now worn off, they need another reason to check facebook so they need a big push to keep people checking the site.

The events organiser needs to expand perhaps, as only some people use it. Have it integrate with other tools and calendars (google/Outlook), merge with marketing do's, football fixtures. SMS notifications etc. My other suggestion is upTo soon to be at flurdy.com, an application for people to list what they would like to do. Not explicitly every time, but more "at weekends i am up for a game of football", or "fridays I would agree to go out for a drink". So when you think right I fancy going to a concert this weekend, you can quickly see which of your friends could be interested. A quick poll later and you got your gang.

Linkedin.com is good as well. Other people probably have had more use out it for creating business proposals, but I find it usefull as a career aid and whom to contact regarding certain situations etc.

doostang.com is very slick. More aimed at pure recruiting. More usefull for the american, californian people, however as its run by my old flat mate Mo, I am biased.

Today I found geni.com, very nice. Again a data privacy situation like facebook and linkedin, but I am already pumping in my family tree! Think they will quickly grow their users, as people have to put in family hence spread the network, as opposed to optionally spam friends on other sites.

Friday, 5 September 2008

Snakes and Adders. And what is that?!




Nice adder on the steps upto our summer cabin in Norway a few weeks ago, before going up the stairs! Further delaying us getting into the house. Then it decided to go under the cabin, which really reassured us...
Poisonous, but don't kill you unless you are really unlucky.



However this one might do:


(Not the blue pipe, but the orange snake by the wall.)

This was in Vietnam, on the slopes down from Dalat towards the coast. We had stopped for a break in our cycling trip from Saigon to Hanoi, and I really needed the toilet... We spotted this snake sliding into the men's toilets. A local Vietnamese man inside spotted the snake and ran out. That reassured me as I still needed to go into the toilet...

Since the snake was going and out the holes on one side, I decided to sneak into the cubicles on the other side. But when I checked them out, they were very dark and full of mosquitos. Since this was still far inland, and off the beaten track, I now had a choice between malaria and dengue fever or a snake bite from a snake that the locals seemed to fear...

Better the devil you know, so I put out some centuries and a very quick pit stop on the snake side!

Still wonder what type of snake it is. Brown orange body, 1.5m long. Was not able to identify it by looking up some sites on the net. Probably some expert will tell me it is a harmless grass snake, but as the locals were not chuffed about it, I decided not to cuddle it.

Thursday, 4 September 2008

Off to javazone!

JavaZone is on again next week. Complete geekfest, but I still enjoy it.

Tend to be very excited the first day, attending most presentations and then start missing a few the second day which is the last day. Spending more time in the stands chatting to companies, trying to blag freebies instead. The first evening also has social events in the evening, which Ive avoided before, as it seemed quite geeky and I was new to this country. Also last year clashed with a football match, which I went to my local pub to watch instead. But suppose Im a geek as well, and Ill have a few pints at least, especially if they are free..

Back to work afterwards I am usually very keen to try all the new technologies and methods.
A few days later dissapointed that I wont have to time investigate most of them.
And a week or two later, forgotten most...

But I do usually pick up something, which does improve my abilities, and then usually able to apply it to work. If not immidietly, I usually apply it to some of my hobby projects instead. Which then usually I reuse at work sometime later, when a new project starts. So I think the two days of non invoicing is worth it in the long run.

Excited to hear or even meet people which work you read on the net. People from Springsource, Google and Sun et al. Last year it was good fun to see the JavaPosse people, listen to Matt Raible, who's work always seem to encounter the same issues I have.

Attended several Mule presentation's last year(2007). Including one by Ross Mason himself, although the one by two guys from Atos Origin, Jos Dirksen and Tijs Rademakers, was much more useful. But even though I think it is a great product, I still haven't had the time to implement it anywhere yet.

Wish those damn 36hour days would soon be standard...

Friday, 22 August 2008

Lunatic politicians over Oslo parking permits (beboerparkering)

Oslo Kommune, my local council, have some time ago agreed to launch a parking permits scheme( Beboerparkering). Up till now the residential areas of the city have enjoyed free curb side parking. The scheme may start at the end of the year.

I have lived and visited many places with such schemes, and they have always been exceptionally limiting, and a real nuisance, especially to guests. So I am really annoyed the council have agreed to this.

How can people and politicians be so blinkered?! I keep reading articles, interviews of people on the street, and no one seems to think this is a bad idea, and no one is asking the obvious questions. Will this improve their parking problems? No it wont!

I was surprised most political parties supported this idea, not just the petulant spoilsports of SV and KRF, but all large parties on the left and right. Suppose it is a sneaky way to grow their coffers and ban people from the freedom of cars.


I live on Industrigata in Majorstuen in Oslo, which is part of the initial trial area. It is an area very close to the city centre and has a popular shopping street, Bogstadveien, going straight through it.


The parking situation up till now:
* Free curb side parking.
* During day time, busy but some available parking spaces on every street.
* In the evening, impossible to find a space, average 20-40 minutes search, especially if you work late.


Reasons for permit scheme:
* To stop commuters parking here during office ours and then walking to city centre.
* Allow local residence parking.


Details of scheme:
* Charge for permit. Initially 300kr/year.
* Limited permits, for residence only.
* Need permit between 09-17 weekdays and 09-15 Saturdays.
* Visitors can stay for 2 hours at any time.


So what does that entail?


Positives:
* More free spaces during daytime. Which means unemployed and pensioners can park. Great. Do they need a car?
* Shoppers targeting specific shops will still be able to park.


Negatives:
* No change for the evening. Will still be as chocker full as before.
* We now have to pay for parking. What is to say this charge will not increase?
* General shoppers are now unwelcome, if it is not a brief visit.
* Tourists whom drive are now unwelcome.
* Businesses resident in the area are now unwelcome, even if they get a few permits.
* Visitors are now unwelcome, if it is not a brief visit. Staying over is not an option, even if drinking.
* Will encourage more residents to drive to work, as they may not have permit to park both cars during daytime.
* Commuters will now park in another area, causing more congestion in that area.
* Residents with no permits, or 2nd car owners will have to park in next door area, causing more congestion in that area.


This is what the blinkered people don't realise. They will NOT be able to park any easier as it will still be full in the evening. This is because in the evening it is 99% residents whom are parking. The outsiders is negligible at this time. And there simple is too many resident per car park space. And a scheme will not change that.

The only way that there will be noticeable more spaces in the evening, is if the residents themselves wont get enough permits. And that is not a good solution. That is beating the locals with a stick.


And enforcing commuters to not park in the area, is not a good idea. Yes some misuse the free parking, but others actual work in the area, need to drive due to kids/distance or poor public transport options. Not to forget they usually leave some business behind by popping into shops in the area on the way home. And blocking them out is not needed as there are spaces available during daytime.




And I don't even own a car!