Opening Greatnews links in non-default browser

October 4, 2006

I use Greatnews as my desktop aggregator & Firefox as by browser. I have not setup Firefox as my default browser for various reasons (that’s not the point here!). The problem I was facing was that all links from Greatnews would open in IE & with the way I read there would be a zillion IE windows. So to force Greatnews to open the link in firefox was to make it my default browser (which for me is not an option). Heres a little bit of config file addition which will get this done without going through all those changes.

[Advanced]
ExternalBrowser=C:\Program Files\Mozilla Firefox\firefox.exe

Note: I had originally done this at my work PC from a Greatnews forum posting, too lazy to find it now.

Performancing for Firefox

Implement “Search results” using Hibernate

September 29, 2006

Hibernate Criteria API: Multi-Criteria Search Made Easy

Powerful, Elegant and Definitely Worth a Try,

that’s what the article says & it’s mighty true. Have seen quiet some people constructing these kind of queries using StringBuffer & stuff, but this is waaaay more elegant πŸ™‚

..
Criteria criteria
= session.createCriteria(Accommodation.class);
if (startDate != null) {
criteria.add(Expression.ge("availabilityDate",
startDate);
}
if (endDate != null) {
criteria.add(Expression.le("availabilityDate",
endDate);
}

This beats

if (startDate != null) {
queryBuf.append(firstClause ? " where ": " and ");
queryBuf.append("a.availabiliyDate >=:startDate");
parameters.put("startDate",startDate);
firstClause = false;
}

any time !!

Must never do Antipatterns – Exception Handling

September 28, 2006

From java.net: Exception-Handling Antipatterns

Antipatterns
Log and Throw

Example:

catch (NoSuchMethodException e) {
LOG.error(“Blah”, e);
throw e;
}

or

catch (NoSuchMethodException e) {
LOG.error(“Blah”, e);
throw new MyServiceException(“Blah”, e);
}

or

catch (NoSuchMethodException e) {
e.printStackTrace();
throw new MyServiceException(“Blah”, e);
}

All of the above examples are equally wrong. This is one of the most annoying error-handling antipatterns. Either log the exception, or throw it, but never do both. Logging and throwing results in multiple log messages for a single problem in the code, and makes life hell for the support engineer who is trying to dig through the logs.

I see this in so many “commercial” products that I want my money back !!; makes debugging a pain the neck. Seeing the same trace logged from every tier again & again is not pretty.

Hidden variables in DisplayTag

September 27, 2006

If you are using DisplayTag and need to have hidden variables like I do (I’m using Struts) then this is a nice way

…setting the ‘s class and headerClass attributes to hidden, which is a CSS style whose display property is none. This is a simple but effective method for keeping data available in the request scope without having to display it to the user.

Code snip :

<display:column property=”id” title=”ID” class=”hidden” headerClass=”hidden” media=”html” />

Source : Creating Highly Functional Tables in JSP Using DisplayTag and JavaScript

How do you interview?

July 14, 2006

Nice points over at Fiat Developmentum Β» The Technical Interview Secret Sauce, but maybe a tad bit informal to be comfortable for everybody.

I have been on both sides of the table & my thoughts; first get the guy who will be working with the candidate have a very technical conversation followed by the person who will be mentoring the
candidate (personally I don’t like the word “lead”) on things like problem solving, aptitude etc. apart from the technical things. Have a last round to weed out the not so obvious anti-socials & the covert serial killers. Long interviews I don’t mind but I don’t like the many numerous rounds that some companies have, but that’s just me.

But most importantly have the guys who really care about who they work with participate. This is more important in bigger companiesthan in smaller shops where everything is more tightly knit. You know the guy you approve of will end up working with you.

Re: Subscribe buttons on WordPress

July 14, 2006

I had blogged about the “Show Image” thingy you need to do to show the images in the links over at the right side.

Wakao ! Β» Blog Archive Β» Subscribe buttons on WordPress

That option is not there anymore. Now you have to use the Text Widget thingy to get it done. I was looking all over for the “Show Image” option :(. Google doesn’t show anything up in it’s top results so the ‘ol Google-fu didn’t help much. Finally found it after mucking arounf in the forums. Not that I’m complaining, I think the Widget way is much better

OT: Check out http://clustrmaps.com. I am really interested in knowing which part of the world actually looks in here πŸ˜‰ not the actual numbers!

See how fast you can type!

July 13, 2006

Check out how fast you can type!! My score is too embarassing to disclose πŸ˜‰

Check it out here

Now this, I like!!

July 13, 2006

Now I would really like this !! I don’t care if it’s not sleek like an iPod I still still still like this πŸ™‚ What’s next ?

Real Programmers

July 12, 2006

From http://en.wikiquote.org/wiki/Programming

Something fun !!

Real Programmers

  • “Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25” – Andrew Rutherford

  • “Real Programmers don’t need abstract concepts to get their jobs
    done, they are perfectly happy with a keypunch, a compiler, and a beer”

  • “Real Programmers aren’t afraid to use GOTOs.”

  • “Real Programmers can write five page long DO loops without getting confused.”

  • “Real Programmers like Arithmetic IF statements– they make the code more interesting.”

  • “Real Programmers write self-modifying code, especially if they can save 20 nanoseconds in the middle of a tight loop.”

  • “Real Programmers don’t need comments– the code is obvious.”

  • “Real Programmers can read core dumps.”

  • “Real Programmers remember phone numbers in binary.”

  • “Real Programmers work for Los Alamos National Laboratory, writing atomic bomb simulations to run on Cray I supercomputers.”

  • “Real Programmers work for the National Security Agency, decoding Russian transmissions.”

  • “Real Programmers are at work for Boeing designing the operation systems for cruise missiles.”

  • “At a party, the Real Programmers are the ones in the corner talking about operating system security and how to get around it.”

  • “At a football game, the Real Programmer is the one comparing the plays against his simulations printed on 11 by 14 fanfold paper.”

  • “At the beach, the Real Programmer is the one drawing flowcharts in the sand.”

  • “At a funeral, the Real Programmer is the one saying “Poor George. And he almost had the sort routine working before the coronary.”

  • “In a grocery store, the Real Programmer is the one who insists on running the cans past the laser checkout scanner himself, because he never could trust keypunch operators to get it right the first time.”

  • “Real Programmers write programs, not documentation.”

  • “Real Programmers don’t wear neckties.”

  • “Real Programmers don’t wear high heeled shoes.”

  • “Real Programmers arrive at work in time for lunch.”

  • “A Real Programmer might or might not know his wife’s name. He does, however, know the entire ASCII (or EBCDIC) code table.”

  • “Real Programmers don’t know how to cook. Grocery stores aren’t open at three in the morning. Real Programmers survive on Twinkies and coffee.”

  • “Real Programmers don’t write specs — users should consider themselves lucky to get any programs at all, and take what they get.”

  • “Real Programmers don’t comment their code. If it was hard to write, it should be hard to understand.”

  • “Real Programmers don’t write application programs, they program right down on the bare metal. Application programming is for feebs who can’t do system programming.”
    • Alternatively: “Real Programmers don’t write application programs, they write tools to write application programs.”

  • “Real Programmers don’t eat quiche. They eat Twinkies. And Szechwan food. (Do not go to eat Szechwan food with a group of Real Programmers unless you are prepared to argue bitterly over the last spring roll.)”

  • “Real Programmers aren’t scared of GOTOs… but they really prefer branches to absolute locations.”

  • “Real Programmers don’t write COBOL. COBOL is for wimpy application programmers.”

  • “Real Programmers’ programs never work right the first time. But if you throw them on the machine they can be patched into working in “only a few” 30-hour debugging sessions.”

  • “Real Programmers don’t write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies.”

  • “Real Programmers never work 9 to 5. If they are around at 9 AM, it’s because they were up all night.”

  • “Real Programmers don’t write in BASIC. Actually, no programmers write in BASIC… after age twelve.”

  • “Real Programmers can take the scissors off the phone cord.”

  • “Real Programmers don’t write in PL/I. PL/I is for programmers who can’t decide whether to write in COBOL or FORTRAN.”
    • Alternatively: “Real Programmers don’t write in PL/1. PL/1 is for
      insecure anal-retentives who can’t choose between COBOL and FORTRAN.”

  • “Real Programmers don’t play tennis, or any other sport which requires you to change clothes. Mountain climbing is OK, and Real Programmers wear their climbing boots to work in case a mountain should suddenly spring up in the middle of the computer room.”

  • “Real Programmers don’t do documentation. Documentation is for simps who can’t figure out the listing.”

  • “Real Programmers don’t write in PASCAL, or BLISS, or ADA, or any of those pinko computer science languages. Strong typing is for people with weak memories.”

  • “Real Programmers don’t draw flowcharts. Flowcharts are the illiterate’s form of documentation. Cavemen drew flowcharts; look at how much good it did for them.”

  • “Real Programmers don’t read manuals. Reliance on a reference manual is the hallmark of the novice and the coward.”

  • “Real Programmers don’t write in RPG. RPG is for gum-chewing dimwits who maintain ancient payroll programs.”

  • “Real Programmers don’t write in COBOL. COBOL is for COmmon Business-Oriented Laymen who can’t run a business, much less write a real program.”

  • “Real Programmers don’t write in FORTRAN. FORTRAN is for wimp engineers who wear white socks. They get excited over finite state analysis and nuclear reactor simulation.”

  • “Real Programmers don’t write in APL, unless the whole program can be written on one line.”

  • “Real Programmers don’t write in LISP. Only idiots’ programs contain more parenthesis than actual code.”

  • “Real Programmers disdain structured programming. Structured programming is for compulsive neurotics who were prematurely toilet trained. They wear neckties and carefully line up sharp pencils on an otherwise clear desk.”

  • “Real Programmers don’t like the team programming concept. Unless, of course they are the chief programmer.”

  • “Real Programmers never write memos on paper. They send memos via computer mail networks.”

  • “Real Programmers have no use for managers. Managers are a necessary evil. They exist only to deal with personnel bozos, bean counters, senior planners, and other mental defectives.”

  • “Real Programmers scorn floating point arithmetic. The decimal point was invented for pansy bedwetters who are unable to “think big.””

  • “Real Programmers don’t drive clapped-out Mavericks. They prefer BMWs, Lincolns, or pick up trucks with floor shifts. Fast motorcycles are highly regarded.”

  • “Real Programmers don’t believe in schedules. Planners make up schedules. Managers “firm up” schedules. Frightened coders strive to meet schedules. Real Programmers ignore schedules.”

This way please …

May 28, 2006

Found this over at Randy's & got my own !

wakao-view.jpg

Get your's at http://www.streetsigngenerator.com/