All entries for June 2006

June 30, 2006

Bad joke of the day

A famous heart specialist doctor died and everyone was gathered at his funeral. A regular coffin was displayed in front of a huge heart. When the minister finished with the sermon and after everyone said their good-byes, the heart was opened, the coffin rolled inside, and the heart closed.

Just at that moment one of the mourners started laughing. The guy next to him asked: “Why are you laughing?”

“I was thinking about my own funeral” the man replied.

“What’s so funny about that?”

“I’m a gynecologist.”


June 29, 2006

Novell SuSE Linux Enterprise Desktop

Writing about web page http://www.novell.com/products/desktop/preview.html

So I have been a long time Linux fan, not because it is any "better" than Windows (whatever that means) but more because it wasn't windows. Hey, I didn't say I was going to be grown up about this did I :)

Anyways, whlist being a fan, I will freely admit that in terms of getting things done, windows is usually easier…there I have said it :) But that isn't really the point is it? I, along with most people also used Linux because it was so much more difficult than Windows, we wanted to find out what was happening beneath the shiny GUIs, we wanted to understand compiler flags and the funky command line etc. etc.

Anyways, what with other time commitments, my use of Linux has dropped off somewhat, but I have kept my eye on ubuntu and been very impressed with recent versions. Actually, to be more accurate, I have been impressed with debian package management (which ubuntu uses), XGL (a funky new GUI rendering architecture) and cool utils like tomboy (wiki like notetaking utility) and beagle (think google desktop indexing like utility)....but it is still more painful than it needs to be to install it and get it running.

Along comes Novell with their SuSE based Enterprise Desktop 10. They have completely redesigned the interface, replaced the desktop menu and managed to integrate all the "cool" things I mentioned before.

If you follow the link you will find a rather large video demoing their latest and greatest features (link). Well worth a look, but I suggest you turn the sound down as the American (I presume) narrator seems to take himself a bit too serious and gets right on my nerves :)


June 28, 2006

DateFormat is not threadSafe… :(

Writing about web page http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormat.html

So under the assumption that DateFormat was threadsafe, I, and a number of my very experienced colleagues were doing the following:
public class MyClass {
public static final DateFormat DATE_FORMATTER = .....

public void someMethod() {
DATE_FORMATTER...
}
}

and this is wrong wrong wrong :)

The javadoc clearly states that DateFormat and its implementations are not threadSafe and so usages of it need to be threadsafe.

If these had been merely class members instead of static then we probably would have never run into a problem because we have very few classes which are not instantiated once per request, but because these are static they are obviously shared by all instances of the class.

As to why DateFormat is not threadsafe…SimpleDateFormat (at least) stores a member calendar instance which it modifies during parse and format….

Joy.

Lesson is…read the javadoc of classes you think you know and be really sure anything that is static is threadsafe.

This was illustrated BTW by the use of IE7 on a page which used AJAX…. I can only think IE7 was issuing multiple requests at the same time? Who knows. And of course, debugging and stepping through didn't highlight the problem :)


June 27, 2006

Raw code v fast code v readable code

Writing about web page http://hanuska.blogspot.com/2006/03/raw-code-vs-readable-code-vs-fast-code_23.html

link

Nice article.


Pair programming … love it or hate it.

Writing about web page http://hanuska.blogspot.com/2006/06/pair-programming-habits.html

So I am big fan of pair programming, when used correctly, but it can also be a horrendous waste of time and do nothing more than introduce fraction, reduce morale and end up being a simple drain of resource.

Anyways, found these two links, nothing deep or revolutionary, but quite a nice read:

link
link


June 21, 2006

How little I know ;)

Writing about web page http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

I was having a technical chat with Rob Harrop of Interface21 fame and we got talking about java synchronisation and the farce that is double checked locking, both concepts I thought I had a handle on.

Anyways, I decided to do a bit more reading and am astounded at how much I don't know :) Admittedly I don't feel too bad about this because I have never explicitly looked at these in depth, but here are some interesting links:

link
link

I thought I knew quite a bit about java until I spoke to Rob :)


June 10, 2006

I have almost been the victim of fraud!

Writing about web page http://cms.met.police.uk/news/appeals/fraud/criminal_cashback_fraud

So I am selling my ST1100 Pan European and I advertised in a number of internet places.

Anyways, I received the following email from browngroupss@yahoo.ca:

Hi Ya,
I came across your advert during my search for buying these item---“1990 HONDA ST PAN EUROPEAN ST1100,Pls let me know whether is still available for sale and also the price,my name is micheal brown ,am situated in Canada the best country so far.I have a shipper that will be responsible for the shipment,shipment will not be your stress.but before payment, i will want you to make me asure you will be honest and trust worthy with me throught this transaction.Pay will issued by a certified GBP Bank draft.Pls let me know the prise pls.
micheal brown

and then:

Hi Sound Good…i want the pics now…..
I’m ready to proceed with the purchase, I will instruct my UK bank to raise the GBP BANK cheque directly in your name and favour from my account for the sum of £4,500 You’ll allow the cheque to clear for 2-3 days at your Bank. After you might have deducted your payment, the excess fund should be sent to my shipper in the UK, via westernunion moneytransfer. My shipper’ll handle the shipping to Canada, he deals with Quick Time,and fast delivery.I’ll like to pay you £150 for your efforts and the westernunion charges.
Pls send your full datas,so that you’ll recieve the cheque very
soon.NAME…PHYSICAL ADDRESS…PHONE NUMBERS
Hoping to hear from you asap,shipper will come for pickup at your address.
miheal brown

Interesting huh. A bit of googling found: http://cms.met.police.uk/news/appeals/fraud/criminal_cashback_fraud, the exact thing that Micheal is proposing :)

Interesting huh. I have never been the “victim” of fraud AFAIK…and I am still not as this guys approach was so obvious :)


It gets worse….

Writing about web page /colinyates/entry/hsbc_love_them/

Writing about an entry you don't have permission to view

So I have just received the first (hopefully of many) cheque for commission for a book I co-wrote (Expert Spring MVC + Web Flow) from the American publishers Apress.

OK, off to HSBC I trotted (across the electronical wire via the telephone) and enquired as to how much this would translate into when cashed into UK pounds…..and they didn’t know. Eventually their help desk managed to find someone who kinda knew and they informed me it would cost a whopping £28 and six weeks to clear!

They were having a laugh….£28 is ridiculous, as is 6 weeks!

Anyway, off I trotted (via the telephone) to Cahoot to ask them and was told it would still take 6 weeks, but they would only charge £10.

Ok, so maybe 6 weeks is the time it takes the English computer to understand the American computer’s bizarre use of the English language (:)), but why does it cost HSBC almost 3 times as much as it costs Cahoot?

Oh that’s right, it doesn’t. They are rip off merchants.

They suck.


June 08, 2006

Interesting oracle funniness

So I have a table content which has 30500 rows, it has a one to many relationship with content_fetcher, which has 50700 rows.

I have removed a number of rows from content, and I now want to remove the orphaned rows from content_fetcher (cascade delete; ha, who needs it :)).

So, trivially easy SQL to find out the number of orphaned content_fetchers…

select count(id) from content_fetcher where content_id not in (select id from content)

times out :( Why?

Bizarrely, calculating the number of content_fetchers that are not orphaned works:

select count(id) from content_fetcher where content_id in (select id from content)

(30622 rows BTW)

so, we know how many valid content_fetchers there are… well, counting the number of content_fetchers that are not in that set, surely that will hit the same "feature"?:

select count(id) from content_fetcher where id not in (
  select id from content_fetcher where content_id in (select id from content)
);

Nope; it works. 20103 rows.

Go figure….

(deletion took 22 seconds BTW)


June 2006

Mo Tu We Th Fr Sa Su
May |  Today  | Jul
         1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30      

Search this blog

Tags

Galleries

Most recent comments

  • Interesting… While I'm not completely convinced in such microbenchmarks, I'm pretty sure that 1ms … by Alexander Snaps on this entry
  • Hello. I bought the book yesterday. I was trying to find the source code for chapter 11 and chapter … by Suleman on this entry
  • http://woosight.net/account/login?username=demo by live mashup demo on this entry
  • Thanks mate ….. This blog was really helpful. by Maaz Hurzuk on this entry
  • Ty. Not directly helpful for my problem, but pointed me in the right direction. You will also get th… by Mike E. on this entry

Blog archive

Loading…
Not signed in
Sign in

Powered by BlogBuilder
© MMXX