Friday, April 23, 2010

Whose Fish?

I solved this puzzle today - Whose Fish?

There are five houses in a row in different colors. In each house lives a person with a different nationality. The five owners drink a different drink, smoke a different brand of cigar and keep a different pet, one of which is a Walleye Pike.

Hints:
1. The Brit lives in the red house.
2. The Swede keeps dogs as pets.
3. The Dane drinks tea.
4. The green house is on the left of the white house.
5. The green house owner drinks coffee.
6. The person who smokes Pall Malls keeps birds.
7. The owner of the yellow house smokes Dunhills.
8. The man living in the house right in the center drinks milk.
9. The man who smokes Blends lives next to the one who keeps cats.
10. The Norwegian lives in the first house.
11. The man who keeps horses lives next to the one who smokes Dunhills.
12. The owner who smokes Bluemasters drinks beer.
13. The German smokes Princes.
14. The Norwegian lives next to the blue house.
15. The man who smokes Blends has a neighbor who drinks water.

The question is-- who owns the fish?

Reportedly, this one is from Einstein.

Thursday, January 08, 2009

Finding Swift code of a bank

Swift code of bank is required when wire-transfer needs to be done across international accounts.

http://www.swift.com/bsl/index.faces will give the needed swift code for your bank.

Thursday, December 11, 2008

Building Firefox on Windows with Visual Studio .NET 2008

As I wanted some feature modification in Firefox, I started off with building it first. I tried to follow steps given in Build-Documentation, but I ran into few problems. I realized that the build environment I have got on my box is different from what Firefox Build-Scripts were expecting. I wondered why there isn't any sln file that would work straight away.

I have both Visual-Studio 2005 (VS8) and Visual Studio 2008 (VS9) installed on my machine and got SDK6.1, and .NET 2.0 and 3.5. Well, I thought I should be able to build it easily but I was wrong.

Browsing my windows SDK installation directories, I could see versions 5.0, 6.0A, and 6.1 on my box, but none of these were expected by firefox scripts. Finally, I had to hack these scripts little to make them work for me.

Here is the sequence of steps I did to create custom built firefox installer. Most of these steps are same as build-and-install guidelines and I only added about the problems I encountered.
  1. Downloaded source code from here. Let's call this source-root.
  2. Downloaded mozilla-setup-1.3.exe and installed it. Let this be called build-root.
  3. Created mozconfig-custom config file in my source-root similar to FireFox's default release configuration. You can find such configuration here.
  4. Exported MOZCONFIG envrionment variable with value set to config file created in step above.
  5. I used objdir as suggested by the configuration guidelines.
  6. I ran start-msvc9.bat inside build-root and got an error saying 'unexpected version 5 at this time'.
  7. start-msvc9.bat internally uses guess-msvc.bat which guesses the installed VC and SDK versions. As I told earlier, there is a mismatch in expectation and script wanted v6.0 for SDK, but I have got 6.0A and 6.1. It surely failed to guess this time.
  8. So, I edited guess-msvc.bat so that it will search for v6.1.
  9. Run start-msvc9.bat again, and got another error 'Framework32\v2.0.50727 unexpected'.
  10. start-msvc9.bat calls vcvars32.bat of VS9 installation and vcvars32 is screwing up PATH variable.
  11. It seems that VS9 installation did not correctly prepare vcvars32.bat. So, I modified vcvars32.bat file to correctly prepare PATH variable. This file prepares VC environment and adds required directories in PATH. It had
    • SET FrameworkDir=Framework32
    • SET FrameworkVersion=v2.0.50727
    • something similar to SET PATH=%PATH%;%FrameworkDir%\%FrameworkVersion%;
  12. I modified these three statements and corrected PATH.
  13. Run start-msvc9.bat again
  14. I got a bash shell (I quickly set my favorite aliases).
  15. Run 'make -f client.mk build'
  16. It asked me to run 'dos2unix.py' and convert all files to have unix style endings. Fine, ran it, failed, ran again, failed, ran again. Succeeded finally.
  17. Run 'make -f client.mk build'.
  18. It ran for a while and then bailed out saying 'No rule to make xyz.html0000664'.
  19. For some strange reason, 0000664 was appended to several files and MakeFile.in has got a rule for xyz.html only. So, I renamed these files back to 'xyz.html'.
  20. Run make command again.
  21. Voila, Successful build.
  22. I ran the executable inside my 'objdir\dist', and it worked like a charm. It used all my original bookmarks too.
  23. Now, I want to make an installer as given in the pages.
  24. Run 'make -C objdir/browser/installer installer'
  25. OOOHHH HHHOOO. I got it inside my 'objdir/dist/install/sea'.

Sure, it would really be wonderful if there is a single sln file and we just open and click Build-NOW. We just love it, wont we? But we dont get things for free, we have to make it ourselves.

Monday, December 01, 2008

Deleting hiberfil.sys in windows

I noticed that free space on my C drive is not as much as it should be. If I count all displayable entities through explorer I get 14.x GB, add to it another 1.8 GB of current free space which makes it around 16 GB. But my drive is of 20 GB. So where is the rest?

Thinking a bit, it hit me that windows will be using some for paging. Ok, lets find out.
I did "dir /AS C: " and it gave me two files.

PageFile.sys 2 GB+
Hiberfil.sys 2 GB

Hmm, Hibernation feature is enabled on my desktop and it is using 2 GB (equal to RAM size) of my drive space.

How do I remove this file? I figured out that turning off hibernation is the only way. Fine. I don't want a feature that I never used till now to occupy 10% of my drive space.

"powercfg.exe /hibernate off" did the trick.

Alternatively,
ControlPanel -> Power Options -> Hibernate tab -> Enable/Disable will also do.

It is best to turnoff 'hibernate' feature before you defragment your system drive.

Wednesday, February 21, 2007

HitchHiker's Guide to the Galaxy

An excellent book to read. Absolute pleasure to read and discuss among friends.

Douglas Adams showed his creativity in both science and electronics.

There are books-as-gadgets, poetry-appreciation-chairs, babel-fishes, doors-with-life, speaking-computers and the list goes on and on...

As per Hitchhiker's Guide, What is Earth?

Earth

Mostly Harmless.
Maybe...
Located in ZZ9 Plural Z Alpha.

Although the primitive ape-descended denizens of this planet did not realize it, the Earth was designed by a supercomputer called Deep Thought, and was built by the Magratheans. Slartibartfast won an award for his fjords on the coast of Norway.

The Earth was actually a computer so vast that organic life became part of it's matrix.

It was destroyed by the Vogons five minutes before the completion of its program.


Some more excerpts...

Improbability Drive
The Infinite Improbability Drive simultaneously places a starship at every conceivable point in the universe, thereby eliminating all that tedious mucking about in hyperspace. It uses vast amounts of improbability, and many silly things happen in its wake.

Logic behind Improbability Drive
The principle of generating small amounts of finite improbability by simply hooking the logic circuits is well understood. But scientists claim that it is virtually imposible to produce a machine that could generate the infinite improbability field that could flip a spaceship across the mind-paralysing distances between the furthest stars.

If such a machine is a virtual impossibility, then it must logically be a finite improbability. So all we need to do in order to make one is to work out exactly how improbable it is, feed that figure into the finite improbability generator, give it a fresh cup of really hot tea... and turn it on!

Bethselamin
A fabulously beautiful planet, Bethselamin is now so worried about the cumulative eroision by ten billion visiting tourists a year that any net imbalance between the amount you eat and the amount you excrete whilst on the planet is surgically removed from your bodyweight when you leave: so every time you go to the lavatory there it is vitally important to get a receipt.

Thumb, The
A short squat black rod, smooth and matte with a couple of flat switches and dials at one end. The Thumb is used by Hitchhikers throughout the Galaxy to flag down passing starships. Half the electronic engineers in the galaxy are constantly trying to find fresh ways of jamming the signals generated by the Thumb, while the other half are constantly trying to find fresh ways of jamming the jamming signals.

Babel Fish

The Babel Fish is small, yellow and leech-like, and probably the oddest thing in the Universe. It feeds on brainwave energy not from its carrier, but from those around it. It absorbs all unconscious mental frequencies from this brainwave energy to nourish itself with. It then excretes into the mind of its carrier a telepathic matrix formed by combining the conscious thought frequencies with nerve signals picked up from the speech centres of the brain which has supplied them. The practical upshot of all this is that if you stick a Babel fish in your ear you can instantly understand anything said to you in any form of language. The speech patterns you actually hear decode the brainwave matrix which has been fed into your mind by your Babel fish.

The Babel fish, by effectively removing all barriers to communication between different races and cultures, has caused more and bloodier wars than anything else in the history of creation.

Magrathea
Magrathea is a myth, a faery story! It's what parents tell their children about at night when they want them to grow up to become economists!

People in Magrathea are sleeping and they will continue to do that till galaxy's economy reaches a stage that they would like. So, their computers are linked to galaxy's stock prices.


Happy Hitchhiking :)

Read more at
http://hitchhikersguidetothegalaxy.blogspot.com/
http://hhgproject.org/index.html

...