Start Cygwin from a folders context menu

My friend had a great little program, which essentially let you right click on any folder and open the command prompt there. The only program is that I never use the command line (CMD.EXE)… I use cygwin. A wonderful program that emulates Linux for windows, but also makes everything complicated!

After a short search on the web, I found a nice little discussion on a newsgroup that explained how to do it for cygwin. I just wanted to note the steps for windows XP, just so I don’t forget (If you really care… you can find steps for other versions on the discussion board).

1. Edit Registry

Start regedit.exe.

HKEY_CLASSES_ROOT\Directory\shell\BashHere="Bash Here"
HKEY_CLASSES_ROOT\Directory\shell\BashHere\command="C:\\WINDOWS\\System32\\CMD.EXE /E:4096 /c C:\\cygwin\\cygwin.bat %1"

Adjust the path to cygwin.bat if necessary.

Finish regedit.

You should now see the entry “Bash Here” in the context menu of a folder. However, when you use it, it will start the shell in your home directory ($HOME).

2. Edit cygwin.bat in c:/cygwin

Insert “set BASHHERE=%1″ before the line with “bash…”. This Environment variable now contains the complete path of the opened folder and is availabile in the bash shell (echo $BASHHERE).

3. Edit profile

Make $BASHHERE the current directory by adding the following line to
/etc/profile or ~/.profile:

if [ "$BASHHERE" != "" ]; then
    cd $( echo $BASHHERE | tr "\134" /)
fi

Vim Tip: Restore cursor’s last position

Here’s a useful vi trick that turned out to be a real time saver. It’s a set of commands you add to your vimrc file (on windows) that will recover the cursor’s last position when the file was last closed. The original tip was found on the vim wikia, which is full of those very useful vim tricks. Give it a try!

" Tell vim to remember certain things when we exit
"  '10 : marks will be remembered for up to 10 previously edited files
"  "100 : will save up to 100 lines for each register
"  :20 : up to 20 lines of command-line history will be remembered
"  % : saves and restores the buffer list
"  n... : where to save the viminfo files
set viminfo='10,\"100,:20,%,n~/.viminfo
 
" when we reload, tell vim to restore the cursor to the saved position
augroup JumpCursorOnEdit
 au!
 autocmd BufReadPost *
 \ if expand("<afile>:p:h") !=? $TEMP |
 \ if line("'\"") > 1 && line("'\"") <= line("$") |
 \ let JumpCursorOnEdit_foo = line("'\"") |
 \ let b:doopenfold = 1 |
 \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
 \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
 \ let b:doopenfold = 2 |
 \ endif |
 \ exe JumpCursorOnEdit_foo |
 \ endif |
 \ endif
 " Need to postpone using "zv" until after reading the modelines.
 autocmd BufWinEnter *
 \ if exists("b:doopenfold") |
 \ exe "normal zv" |
 \ if(b:doopenfold > 1) |
 \ exe "+".1 |
 \ endif |
 \ unlet b:doopenfold |
 \ endif
augroup END

Interviewing at Microsoft: My adventure to Redmond

Let me preface this by saying that my story is not really different than any of the other stories on the web about interviewing at Microsoft. Well… except that it happened to me! Ha ha. In a nutshell, I had just finished my masters in mathematics, I was very excited to heard that they were interested in me and was really hoping to work for the big guy. Well, that’s not entirely true… I actually mainly wanted a job. In fact, I own a Mac at home, I consider myself primarily a mathematician, and am not particularly fond of Microsoft. But nevertheless, the whole experience was very enlighting and exciting, and I am forever grateful to Microsoft for giving the opportunity to visit the legendary campus, and meet some of the most influential people in Computer Science’s history.

On Campus Interviews

Let start where it all started: McGill University, Montréal, September 2006. I had been looking for a job for a while now, and so I decided to visit the McGill career fair to see what’s out there. Trying to find out what is available for kids with a Master’s degree in Mathematics these days. Ones specializing in theory of evolution, of all things! Well, the first step was when I handed my resume to Josh, an international recruiter for Microsoft at the fair. We had a chat and it turned out that the girl he was with was working on IE7, which was a funny coincidence because that’s the product I was most interested in. Anyways, they must have been intrigued by my resume, because they called me the next day to arrange a campus interview. I got to interview with a French Canadian working for Microsoft, Gilles, and the interview was a lot of fun. First off, we discuss some of my projects through university, and the ways I managed to solve hard problems, etc. We also discussed the reasons why I wanted to work for Microsoft, and then we shifted gear and dove in the coding part of the interview. A rather simple graphic-based question. Nice. Then I got to ask questions about his project, a windows version of Adobe Flash, called Silverlight!! Two days later, I got the e-mail. Congratulations! We are flying you to Redmond! I couldn’t believe it, but it was real. Microsoft thought I did well enough in my interview to pay for me to fly to Redmond and see the campus for myself! Yikes!

It took a while to go through all the required things before the trip, but about a month and a half after my initial interview, I was on a plane to Redmond. The whole process is actually very well organized. I couldn’t believe it. I got to my hotel in Bellevue rather late, so no time to study or go out. I went pretty much directly to bed so that I could be in shape for the next day.

On Site Interviews

Inside Building 19 by jschementi, on FlickrI got to building 19, and there was a couple of people also waiting for interviews. Most of them were there for Project Manager positions. I was there for an SDE position, which apparently is not the easiest to get… My first interview was with a recruiter, like everyone else, by the name of Akes. She was very nice and we had a good discussion about my skills and my personal achievements. We talked for about 45 minutes and then I was thrown on the recruiting shuttle to building 119, which to my surprise is home of the Windows Live group. The interview was for the Microsoft Digital Image Suite. The guy interviewing me, a lead developer, was really nice and fun to talk to. I unfortunately felt like I didn’t really do well on this interview. I came up with a solution very quickly (the question was simple enough How to find the MRCA, most recent common ancestor, of two nodes in a tree, but it wasn’t the most efficient. Kind of a bummer seeing as this was my field of expertise.

My next interview was a lunch interview. We went to a restaurant off campus called Pomegranate bistro. The food was delicious and we had a really good conversation. This interview was much more geared towards my resume and my achievements. We also discussed the product he works on, the same photo software as the guy before, and some of the improvements I would want to see. It was a fun interview. I really enjoyed it.

By then, I was off to another building. Interviewing with another group within to the live experience, Live Messenger (the new MSN messenger). This interview was also very good. The interviewer dug deep in my experiences as a Teaching Assistant and in some of my group projects at school. We discussed these a little and then switched to a programming question. This one I had a much better idea of how to solve it. I solved it really well and quickly! Then we discussed the design of a messenger’s program. I had a hard time explaining my thoughts to him.

Concluding Remarks

All in all, the experience was amazing. I would redo it anytime. The people were friendly, and efficient. The conversations were also very interesting. Personally, I don’t think I really fit into the whole Microsoft scene. I had just came back from a long trip, climbing in Thailand, and driving across Australia, and I really didn’t see myself working for Microsoft. From what I have heard, you end up working really long hour, and are constantly stuck to work around proprietary code that has been in Windows for ages. Another thing that struck me when visiting is how geeky and very communal the whole campus is. From there cars with advertisements for IE7 on them, to mailboxes just like the icons in their own OS… Finally, I don’t like the chasing-after-the-other-software-companies attitude Microsoft has these days (live search, live spaces, soapbox, etc). I just wish they could come up with their own thing. I know they can. They have the brains, I’ve met them!

Windows Vista: Finally here.

The world’s biggest software maker announced, earlier this week, the final prices for the new Windows Vista, according to an article from Reuters.

The new operating system has been in the making for about 5 years now. It has seen no less than four new operating systems released by its major competitor, Apple : Puma (September 25, 2001), Jaguar (August 24, 2002), Panther (October 24, 2003), and Tiger (April 29, 2005). A couple of months later and it would have also witnessed the birth of the brand new OS from Apple: Leopard.

Personally, I am pleased to hear the news as it will be nice to get a fresh new look from Windows. I am tired of looking at the (now) boring look of Windows XP these days. So let’s hope that Windows did their homework and hired really good designers to make their product more appealing to all of us. The release of Windows Vista might secure microsoft a couple more years of my business seeing as I was wondering if I should switch to Mac for my next desktop. Only time will tell. But, I don’t think I see a switch anytime soon though, I think having a Powerbook G4 as a laptop and a windows-based desktop machine is the perfect setup in the software developing world.

So, in a nutshell, Microsoft has released the RC1 (Release Candidate 1) edition of the operating system to about 5 million people last week and should be fixing bugs for the next couple months. Chances are that there will be no official release date announced for the next couple of weeks, but I am sure glad to hear about this RC1 release.

© Copyright Bonuel Photography - Theme by Pexeto