Installing SciPy on Mac

Install MacPorts
http://www.macports.org/install.php

vkatkade-mac:opt vkatkade$ sudo /opt/local/bin/port install subversion
vkatkade-mac:opt vkatkade$ sudo port -v selfupdate

Install Xcode from the Apple Dev Store: https://developer.apple.com/xcode/
In Xcode Preferences, under Downloads, also install the Command Line Tools.

Install Homebrew

vkatkade-mac:opt vkatkade$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Couple of other packages

vkatkade-mac:opt vkatkade$ easy_install pip
vkatkade-mac:opt vkatkade$ brew install gfortran

Then run this:

vkatkade-mac:opt vkatkade$ sudo port install py27-numpy py27-scipy py27-matplotlib py27-ipython +notebook py27-pandas py27-sympy py27-nose

Also, pip is the easiest way to install matplotlib

vkatkade-mac:~ vkatkade$ sudo pip install matplotlib
Advertisements

Cisco India office

I happened to be visiting the Cisco India office to catch up on some leftover work on my India vacation. Having spent a major chunk of my life growing up and studying in Mumbai and around but never really having had a chance to actually work in Mumbai, I’ve always wondered about what corporate environments in the city are like. And hence, it was interesting to get some first impressions at the Cisco India office. This happens to be on the 2nd and 6th floors of ILFS building in Bandra-Kurla complex which is an area in central-suburban Mumbai which has got a string of major corporate and government office spaces. The building by itself, as all other buildings in the are quite grand from the outside ….
ILFS Outside
… but just wait till you get inside the building after passing through the metal detector and X-ray scanners and walk into the lobby, the arches are 2-3 storeys high and the interior is a huge 8-9 storey high open space right till the roof with offices of the periphery. It really gives a great roomy feeling and the lobby seating area is a great place to have a cup of coffee or discussion. And the whole place is built top to bottom corner to corner out of granite and I noticed over half a dozen staff occupying themselves full time with keeping every nook and corner shiny and sparkling at all times. The whole place is lit by plenty of natural light from the roof, and the top 2 floors have open seating as well.
ILFS Inside
ILFS roof
Walk up to the 6th floor, and its interesting another IT heavyweight vendor right across your door.
Office entrance
As you enter into the office you’ll notice there’s no virtual office assistant business here, as opposed to elsewhere in san jose buildings. In fact, there is a whole crew consisting of lobby admins, security and associate staff to take care of all your logistic needs. And the personnel are stationed round the clock throughout the week. They will make you unlimited free express coffee delivered right at your work desk or anywhere else, and a selection of sandwiches is also available for about 60 cents a plate. The omlette sandwich I had was very well done. Speaking of which, Cisco India has also taken the “no-free soda” policy very seriously indeed. There are soda cans in a cooler available for purchase at also about 60 cents a can. To ensure that the policy is strictly followed, the cooler is secured with a solid steel lock.
Office inside
The office balcony has an open view stretching out about 10km, which is a HUGE deal in Mumbai. Its really airy with the strong afternoon seabreeze providing much needed temperature moderation and air circulation to the city’s otherwise hot and toxic air. You can notice the residential high rises in background which is the Bandra skyline, reflecting on the city’s construction boom. And just adjacent, like everywhere else in Mumbai, lies in a stark contrast, the other grim realities of India.
BalconyView1
BalconyView2
I had quite a productive day at work. I personally don’t mind (in fact, sometimes prefer) collaborative workspaces which is what they have in Mumbai, and got settled quite comfortably. I would have sure had a more productive day if the internet connection was 5x faster, but cant complain with what was available. I didn’t have to muck around with any of my credentials or network settings and everything just worked. It was great to interact with the sales teams dealing with the products I work on and share insights with them. And I had a great way to finish off the workday consisting of 3 rickshaw and 2 train commutes on Mumbai summer day with a cool refreshing glass of freshly squeezed sugarcane juice !!uus

100 millionth eyewitness

100millionth Eyewitness

Just downloaded and got Firefox4 up and running on my laptop, and in the process was lucky to be eyewitness to the 100 millionth Firefox4 download on the web. My first impressions of the new browser are very positive. It definitely feels like there is more screen room for the pages with the new menubar style and the tabs look very Chrome-like. I tried opening a few HTML5 pages, including one which spots geolocation, and the browser was right there spotting me down to a 10-mile vicinity. I’ve been a Firefox user for a good part of the last decade, momentarily switching to Chrome when it first launched. But then I switched back to Firefox when I learned about Google’s conflict of interest with Firefox, and shifting its backing from the Mozilla foundation to Chrome. The browser wars are storming up like never before and Firefox is right in the fray. Go download your Firefox4 today and Go Orange !

Trampolines and Polymorphism

We use this sort of a “trampoline” technique all over our codebase, which is a heavy proponent of the Object Oriented Programming methodology. The below is a hypothetical example of how such a scheme may be used to implement polymorphism and trampoline classes together. Polymorphism is a quite well known concept and hence I don’t need to say much about it. However, I can tell you a bit about trampoline classes. In the example below, “ConcreteClassOne” and “ConcreteClassTwo” are the actual objects which do real work and represent a certain real world object and they may need to receive notifications from other objects. The interfaces for the notifications are represented as “BaseClass” and every concrete object has a member which is a “DerivedClass” which inherits the “BaseClass”. This “DerivedClass” is just a trampoline class which does not do much, it just calls its owner “ConcreteClass” which does all the real work.

The advantage of using a trampoline classes is that you can use it to convert cases where you may have required multiple inheritance into just single inheritance. How? In the example below, lets say you had another “BaseClassTypeTwo” and “ConcreteClassOne” needed to inherit methods of “BaseClassTypeTwo” as well. Without trampoline classes, “ConcreteClassOne” would end up inheriting “BaseClass” and “BaseClassTypeTwo”. However, with trampoline classes, you can just create a new trampoline member for “ConcreteClassOne”, say “DerivedOneTypeTwo”, which singly inherits “BaseClassTypeTwo”, thereby eliminating the need for “ConcreteClassOne” to inherit multiple base classes.

#include <iostream> class BaseClass; class DerivedOne; class DerivedTwo; class ConcreteClassOne; class ConcreteClassTwo; class BaseClass { public: BaseClass() {} virtual void functionOne() {} }; class DerivedOne : public BaseClass { public: DerivedOne( ConcreteClassOne * me ) { me_ = me; } ~DerivedOne() { me_ = 0; } void functionOne(); private: ConcreteClassOne * me_; }; class DerivedTwo : public BaseClass { public: DerivedTwo( ConcreteClassTwo * me ) { me_ = me; } ~DerivedTwo() { me_ = 0; } void functionOne(); private: ConcreteClassTwo * me_; }; class ConcreteClassOne { public: ConcreteClassOne() { trampolineObj_ = new DerivedOne( this ); } ~ConcreteClassOne() { delete trampolineObj_; } DerivedOne * trampoline() { return trampolineObj_; } private: friend class DerivedOne; DerivedOne * trampolineObj_; void functionOne(); }; class ConcreteClassTwo { public: ConcreteClassTwo() { trampolineObj_ = new DerivedTwo( this ); } ~ConcreteClassTwo() { delete trampolineObj_; } DerivedTwo * trampoline() { return trampolineObj_; } private: friend class DerivedTwo; DerivedTwo * trampolineObj_; void functionOne(); }; using namespace std; int main() { BaseClass * pBaseClass = 0; ConcreteClassOne * pConClassOne = new ConcreteClassOne(); ConcreteClassTwo * pConClassTwo = new ConcreteClassTwo(); pBaseClass = pConClassOne->trampoline(); pBaseClass->functionOne(); pBaseClass = pConClassTwo->trampoline(); pBaseClass->functionOne(); return 0; } void DerivedOne::functionOne() { me_->functionOne(); } void DerivedTwo::functionOne() { me_->functionOne(); } void ConcreteClassOne::functionOne() { cout << "This is ConcreteClassOne" << endl; } void ConcreteClassTwo::functionOne() { cout << "This is ConcreteClassTwo" << endl; }

Boxy

This is the view from my apartment balcony. Just took some pictures to highlight the “rectangularness” of everything in my little suburban neighborhood apartment complexes. Which actually got me thinking that rectangularness has become such an inescapable and pervasive part of my life that its like right in my face. Almost seems like I’m living a Box and everywhere I look around is just rectangular. From the endless arrays of evenly sized identically replicated cubes at workplace, which along with perfectly rectangular conference rooms of varying dimensions are fitted neatly into rectangular buildings, which are also identically replicated over a hundred acres – an work of art in rectangular symmetry for the corporate campus vertical.

Alviso run

Just back from a 7 mile run at the Alviso Slough in Milpitas today evening.  Google map

This has got to be one of the best running trails I have run in the bay area. A colleague of mine had referred me this trail and I’ve been wanting to try it out for a while. Finally made it today and I cant wait to for the next run here. I started on the latter side at about 5:45 and the sun had set by 6:30, hence I had to push for completing the run sooner than later since the place was bound to get pitch dark. Next time, I’ll definitely take my camera and stop for some pictures to capture the magnificent views from this place. The loop is supposed to be 9 miles, and there can be a few different routes you could take here. I happened to veer off in a direction which I hadn’t intended or had planned for and hence it turned out to be a 7-miler run as it was already getting quite dark at 3.6 miles.

Its a very secluded trail and there is absolutely no kind of human presence or structures once you are out there, besides the AMTRAK railway line which runs though it. Its just pure nature – the open bay and you on the trail, with sprawling views of the south bay and the mountains. Since it was evening time, there were quite a few flocks of seagulls and cranes returning to their resting spots on little mounds in the middle of the bay, and I also sighted a lone waterfowl. This is a great trail for beginners too since its a mud trail which is quite soft on the shins and your legs in general. Just be careful to plan your run in advance and familiarize yourself with the trail on maps since the trail is totally unmarked and it could get tricky to get an orientation once you are out there since there are really no particular landmarks.

Awesome new wallpaper

mydesktopWoo hoo I have an awesome new desktop wallpaper for my work computer – here’s a pic of it that I took, sorry for the poor quality, I took it using my cellphone camera, which is not the iphone4 hence the low fidelity picture. I run ubuntu on my laptop and also use an external monitor with a docking station. Ubuntu isnt smart enough to figure that if an external monitor is connected, the user user want to duplicate his wallpaper from the main screen onto the external monitor. Hence, the only options you are left with are either have a wallpaper with a size large enough to cover both the screens and set it as center aligned, or, if you set the alignment as stretch, the wallpaper from the main screen is stretched to span the dimensions of the main an external monitor combined, and you end up with a pretty distorted wallpaper. The lesser evil approach in my experience is to use a wallpaper which is large enough to cover both monitors and set it to center align, although it will look cropped¬† if you do not have an external monitor. Once you do that, what you need is a nice high definition wallpaper which is large enough to cover your desktops. One such website is http://www.multimonitorgroup.com/ from where I picked up the above wallpaper and did some processing in GIMP to suit my taste, and voila! Also notice the transparency with the terminal – i find that really cool – just a little transparency ! Hell, I even want switch to VI as my primary editor instead of emacs just so I can leverage the transparency while I’m editing – though that would mean a serious hit to productivity while I get used to the shortcuts – but I think I’m finally gonna make the jump.