tag:blogger.com,1999:blog-33706238806860517542015-09-16T11:22:01.338-07:00Open Source, Technology and LifeVinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-3370623880686051754.post-17418588408290534762014-12-15T02:20:00.000-08:002014-12-15T02:21:50.503-08:00Mastering Vim By Damian Conway <div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: left;">Being a fan of Vim, I had always tried to learn new tricks whenever I had time. Being able to enhance my skills to use the tool in a more efficient manner (Vim) was always a welcome bonus. Though the skill level to use vim would vary from person to person, the video covers a wide range of topics and I think would have something for everyone. &nbsp;</div><div>The video starts with the help command and introduces how to use the help command in vim. This was informative, since you could learn once concept at a time by using vim help. &nbsp; &nbsp;Then the video continues with the different features of vim ranging from search to visual block mode. It was interesting to learn about the different visual modes and how they differ. There were a wide range of concepts covered in the video and I would say the best way to learn them is do one video/feature at a time.</div><div><br /></div><div>I did expect more of the advanced concepts of Vim like macros, etc - but that wasn't covered . Some of the concepts in the video was very interesting to learn like the undo time machine in Vim. I never knew Vim had such a complex but elegant undo mechanism. &nbsp;I don't know if I will ever use the undo feature though.</div><div><br /></div><div>Overall I was impressed by the video and still learned some concepts even though I use so much of vim everyday. The video describes the usage in a very articulate manner and it was easy to follow along. I am hoping to try to incorporate some of the concepts into my day to day activity and see how it helps. .&nbsp;</div><div>&nbsp;&nbsp;</div></div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-84047786436269425392014-10-22T01:01:00.000-07:002014-12-13T00:18:12.867-08:00<div dir="ltr" style="text-align: left;" trbidi="on"><br /><h2 style="text-align: left;">OSCON 2014 Complete Video Compilation</h2><div><br /></div><div>I always wanted to attend OSCON, but never had a chance since it is usually in Portland. The video compilation provides a complete view of all the action missed, except the social interaction that you get in the conference. This video compilation provides hours of technical entertainment and the scope of topics are pretty wide. The quality of the talks were very good and the video coverage/audio is good.</div><div>Starting with the keynotes, I am going to list the talks that I liked and the ones I wouldn't recommend that much. Since the list of video is pretty extensive, I am sticking to a subset of the list. I will continue to update the list if I find some talks more interesting and worth mentioning.</div><div>The main keynote talk by Tim O'Reilly is very inspirational and well presented. Also the keynote talk by Shadaj Laddad was good - the talk was well presented and probably inspirational for younger kids wanting to program.&nbsp;</div><div>Liked the business keynote talk by Simon Wardley about Introduction to Value chain mapping. The talk is funny and makes sense.</div><div><br /></div><div>The Continuous delivery talk by Neil Ford was very informative and covers a lot of topic. Personally this talk was very useful for me, since I am trying to understand the various deployment models and trying to apply some of the models in my work place. Some of the concepts like feature toggle, etc I have been using all the while. But from a deployment perspective it makes sense on how feature toggle can be useful. Talks about various configuration management system with a focus on Puppet. Talks about Dockers and explain how it is used in deployments.&nbsp;</div><div><br /></div><div>Get started with Openstack a hands on tutorial provides a good introduction on Openstack and getting started with openstack as the title says. Most of the concepts are similar to Amazon EC2 and after working with a lot of EC2 instances and migration recently, this talk just provided me a good overview on how Openstack terminologies match with the way things work in Amazon.&nbsp;</div><div><br /></div><div>Mapbox: Building the future of open mapping by Justin Miller: Talks about various maps and how Mapbox works with opensource. Very good talk if you have worked with open street maps or any of the api like leaflet or anything to do with mapping. Also talks a lot about the book open source <a href="http://producingoss.com/" target="_blank">“Producing open source software by Karl Fogel”</a> and how Map box uses some of the principles from the book. Talks about how github is used for collaboration.&nbsp;</div><div class="p2"><br /></div><div class="p1"></div><div class="p1">How disney built a modern cloud with open source: More generic, less technical. Talks about how to build, etc based on what user wants. I didn’t find it that interesting.</div><div></div><div><div class="p1">No More whiteboard hiring process by Austin Putman.</div><div class="p1">Don’t know how practical the methods are to implement, but provides a good view of how you could hire engineers. But one of the best interviews I had was where I was given a computer and was allowed to search, program on the spot, &nbsp;to solve a particular problem. I do agree that hiring engineers through an intensive data structure/concept understanding drill or through puzzles is not the right approach that is followed by most companies like Google, Facebook, Amazon, etc.&nbsp;</div><div class="p1"><br /></div><div class="p1"><br /></div><div class="p2">How to build your applications to scale in cloud by Steven Pousty</div><div class="p2">Good talk about Microservices and how you will scale from monolithic to micro services. Talks about PAAS and SAAS and why it makes sense to use Microservices on a PAAS model or otherwise and the advantages/disadvantage of a micro service. More high level talk about architecture but would make sense if you are building a new service or trying to break a big monolithic service.</div><div class="p1"><br /></div></div><div>&nbsp;&nbsp;</div><br /></div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-80222410533552696182014-09-04T23:50:00.002-07:002014-09-05T00:00:49.773-07:00Programming JavaScript Applications by Eric Elliott; O'Reilly Media<div dir="ltr" style="text-align: left;" trbidi="on"><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="color: #242424; line-height: 20px;"><span style="font-family: Arial, Helvetica, sans-serif;">I first heard about Eric Elliott from the Kickstarter page where there was a kickstarter project to raise money to teach a course on Javascript. I was very much expecting a lot from this book but I had to stop reading the book after a point when I realized this book was not for me.</span></span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><br /><div class="p1"><span style="font-family: Arial, Helvetica, sans-serif;">The book started with some very basic information like how REST worked including details about HTTP protocol, best practices for programming with functions, etc which is probably useful for novice programmers and I found no use of it. I was hoping to find a more gradual introduction to advanced concepts of Javascript instead of the introduction in this book. I know the book referred to other books to get familiar with the more advanced topic of Javascript and may be my perspective would have been different if I had read those books.&nbsp;</span></div><div class="p2"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><div class="p1"><span style="font-family: Arial, Helvetica, sans-serif;">The code samples often jumped into concepts that was not spoken about, but eventually it got spoken about later. I had basic understanding of some of the advanced concepts of Javascript since I have used libraries like extJS, JQuery, etc. I was hoping this book would have helped me build my foundation to use the libraries better and to be a better javascript programmer, but I guess this was not the right book for that.</span></div><div class="p1"><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div><br /><div class="p2"><span style="font-family: Arial, Helvetica, sans-serif;">I would not recommend this book to anyone who has basic knowledge of Javascript and wants to just grasp the advanced concepts in an easy to understand way. &nbsp;I would try to read this book again after I read some of the other books mentioned in the introduction and probably update my review.</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span><span style="font-family: Arial, Helvetica, sans-serif;">http://shop.oreilly.com/product/0636920033141.do</span><br /><span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div></div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-18639242972328991432011-06-24T16:34:00.000-07:002014-10-22T00:28:09.517-07:00Spam me!<div dir="ltr" style="text-align: left;" trbidi="on">Yeah I want your spam! Spam me at <br />vgopal@abaca.com<br /><br />The more spam I get - the happier I will be. I am not a honeypot, but rather I will look at your spam and read it! Just kidding ;) - i am in search of getting more spam in to my mailbox to see the effectiveness of our spam filter and test other components that I work on!<br /><br />If anyone knows any way of spamming yourself I will be happy to hear about it!</div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-6714892492820715882011-05-09T00:10:00.000-07:002011-05-09T00:12:22.902-07:00Google IO 2011I will be going to Google IO 2011 and I am pretty excited about it!<br /><br /><script src="http://www.google.com/events/io/2011/static/js/iobadge.js" type="text/javascript"></script>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-13608349553131341222008-12-22T00:17:00.000-08:002009-01-11T21:40:42.820-08:00Best wireless router which can be flashed with LinuxTwo years earlier if I had thought about buying a router that can be easily flashed with a Linux distribution (ddwrt, openwrt, etc) - I would have blindly bought Linksys WRT54GL the router of choice for open source enthusiasts and hobbyists. Two years and nothing much has changed.<br />There are a few better versions of WRT54GL but they are hard to find and I would prefer them if I can find them :).<br /><br />There are now more routers and more confusing standards - but none of them seem to have good reviews and the right hardware for flashing it with ddwrt or openwrt. Some of the netgear model claims open source support - but mostly has bad reviews and I stayed away from them. Linksys has so many models to choose from and choosing the right one that can be flashed was a long process. Each model has different versions and only the older versions of the model has more Flash and more RAM which is ideal for ddwrt or anything else - so if you get them (mostly used ones through ebay or elsewhere) - you can build a more powerful wireless router than the WRT 54GL.<br />I also wanted to try out the 300+ N series (300N, 310N, etc, and the 350N with the fastest processor in low end linksys models) but almost all them had bad reviews in most websites mostly with the default firmware - there were one or two reviews with ddwrt and looked good. <a href="http://wiki.openwrt.org/OpenWrtDocs/Hardware/Linksys/WRT300N">OpenWrt description</a> of 300N series was very promising to me with Redboot as the boot loader and seeing your Linux boot from the scratch. I really wanted to check it out. I have worked with Redboot and the Intel XScale processors which has a separate processor for encryption. It is usually useful when you want to use VPN's and leverage the encryption hardware of the XScale. New 300+N routers costed atleast $85 and the advantages were<br /><ol><br /><li>better range</li><li>newer n standard with higher speeds</li><li>more ram and flash memory</li><li>Better processor<br /></li><br /></ol><br />no. 3 and no.4 was the most tempting of all. I am not even sure if no.1 and no.2 are true - some reviews said that the speed was worse than g and range was almost similar or worse. I would wait for some more time for the n standard to take off and the prices to come down. Till then I am happy with 54GL and hoping to see more powerful routers which can run Linux.<br /><br /><br /><br />Source: Wikipedia - (http://en.wikipedia.org/wiki/Linksys_WRT54G_series)Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-60852998575780434252007-11-13T17:28:00.000-08:002007-11-13T18:54:27.318-08:00Using Cosmo (Chandlerserver) as a Git ServerI wanted my local Git to be updated to a server and came up across <a href="http://wiki.dreamhost.com/Git">Git on Dreamhost</a>. A nice link which talks on how Dreamhost with WebDAV can be used as a git remote repository. So any WebDAV server should work. I thought I will use Cosmo to host itself - A really cool idea! I have never used Cosmo for anything other than calendars or address book (which I worked on :) ) and had to dig the documentation to find the way to create a collection. I used Cadaver client to create the collection<br /><pre><br /># sudo port install cadaver<installs><br /></installs></pre><pre><br />#cadaver http://osaf.us/cosmo/dav/vinu<br /><entered><br />dav:/cosmo/dav/vinu> ls<br /><listed>dav:/cosmo/dav/vinu> MKCOL git<br /></listed></entered></pre><br />In Mac OS X Tiger I used finder to connect to the server. I entered the URL as http://osaf.us/cosmo/dav/vinu/git - entered the username, password and it mounted :). But when I tried to put any file on this server it failed :(. After hanging out in IRC for some time I figured out Cosmo (Chandlerserver) does not implement locking yet and Mac OS X Finder expects the server to implement locking :(. I tried searching for a client like finder - but none of them had a way to put a complete folder into the collection.<br /><span style="font-weight: bold;"></span><br />I tried to copy the git repository using a Windows XP desktop I had - I created a web folder with the url http://osaf.us/cosmo/dav/vinu/git. I then copied my bare git repository from my Mac to Windows and from there to the webdav server (Cosmo). It partially failed with a message saying some files could not be copied :(<br /><br /><br /><span style="font-weight: bold;">Links<br /></span><ul><li>http://wiki.dreamhost.com/Git</li><li>https://osaf.us<br /></li></ul>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-13469994468751441462007-11-11T23:46:00.000-08:002007-11-12T00:15:25.873-08:00Interview QuestionsAfter attending a lot of interviews I found that most interviewers are obsessed with Hashmap and like to test your understanding on the algorithm complexity and how hashmap reduces the complexity to O(n). The list problem shown below is an interesting problem.<br /><span style="font-size:130%;"><span style="font-weight: bold;"><br />The List Problem</span></span><br /><br />Its a search problem where you need to find if a small list is contained in a bigger list. The example below shows the goal of the problem.<br />Say you have two lists:<br /><br />smallList = "red", "green";<br />largeList = "red", "green", "blue";<br /><br />smallList is contained in largeList for the above data.<br /><br />If you change the smallList like<br />smallList = "red", "green", "green";<br />smallList is not contained in largeList. The order of the strings does not matter. What is the best way to implement a function which will return a boolean value indicating if the smallList is contained in largeList.<br /><br />Solution 1: worst case implementation<br />for (int i=0; i < smallList.size;i++) {<br /> found = false;<br /> for (int j=0;j < largeList.size;j++) {<br /> if (smallList[i] == largeList[j]) {<br /> largeList.remove(i);<br /> found = true;<br /> // slight improvement would be<br /> // break; here<br /> }<br /> }<br /> if (found == false) {<br /> return false;<br /> }<br />}<br />return true;<br /><br />Complexity is O(n pow 2)<br />memory usage is good - since it just uses a boolean variable called found<br /><br />Solution 2: Similar to solution 1 - if the method largeList.remove is not available<br />largeListMatches = new boolean[largeList.size]; //assume all the values are initialized to false<br /><br />for (int i=0; i < smallList.size;i++) {<br /> found = false;<br /> for (int j=0;j < largeList.size;j++) {<br /> if (smallList[i] == largeList[j]) {<br /> if (largeListMatches[j] == true) {<br /> continue;<br /> }<br /> largeListMatches[j] = true;<br /> found = true;<br /> }<br /> }<br /> if (found == false) {<br /> return false;<br /> }<br />}<br />return true;<br /><br />Complexity will be the same - around O(n pow 2). Memory usage will be more since an array of boolean (of size largeArray) is used. So the memory required will be sizeof LargeArray + sizeof smallArray + 1byte * length of LargeArray + 1 byte for the boolean found variable<br /><br />Solution 3: Use a hash map to hash the large list<br />for (int j=0;j < largeList.size;j++) {<br /> if (value = largeHash.get(largeList[j])) {<br /> largeHash.set(largeList[j], ++value);<br /> } else {<br /> largeHash.set(largeList[j], 1);<br /> }<br />}<br />for (int i=0; i < smallList.size;i++) {<br /> if (value = largeHash.get(smallList[i])) {<br /> if (value == 0) {<br /> return false;<br /> } else {<br /> largeHash.set(largeList[j], --value);<br /> }<br /> } else {<br /> return false;<br /> }<br /> <br />}<br />return false;<br /><br />Complexity will be reduced to O(n) + O(n) which is O(n). Memory usage will be really high. For an array list of high value like 10000, etc this method will be infeasible. This is the most efficient algorithm - but assumes the system has a high amount of memory<br />Memory required is 2*(sizeof LargeList) + sizeof (smallList) + integer array of length largeList<br /><br />Solution 4: Use binary search to find the elements. the largeList has to be sorted first. Any of the sorts like quick sort or merge sort can be used - complexity of O(nlogn). Binary search has a complexity of O(logn) - but it is for each element of small list. O(m*logn)<br />Overall complexity is O(nlogn) + O(m*logn) = O(nlogn)<br />Memory usage is equal to the size of largeList + smallList<br /><br />quicksort(largeList); //or mergesort(largeList);<br />for (int i=0; i < smallList.size;i++) {<br /> if (binarySearch(smallList[i], largeList) == true) {<br /> largeList.remove(smallList[i]);<br /> } else {<br /> return false;<br /> }<br />}<br />return true;<br /><br /><span style="font-size:130%;"><span style="font-weight: bold;">Tree problem </span></span><br /><br />I don't remember the exact question - but here it is:<br />You have a class called Data Node.<br />class DataNode {<br /> int id;<br /> int parentId;<br /> <br /> DataNode parentNode;<br /> DataNode[] childNodes;<br />}<br /><br />Define an efficient method called<br />public DataNode updateTree(DataNode[] dataNodes)<br />which will update all the parentNode and childNodes assuming that the id and parentId of all the nodes are already set. The parentId of the root node is set to zero.<br /><br />Though the question is designed badly asking you to write a method inside a node - it was interesting otherwise. An example will things make more clear<br /><br />Suppose you have a tree like<br /><br /> 18<br /> 5 3<br /><br />The DataNodes array will have<br />18, 0,NULL, NULL<br />5, 18, NULL, NULL<br />3,18, NULL, NULL<br /><br /><br />The goal of the question is to update the references parentNode and childNodes. So instead of NULL you will be able to navigate the tree structure.<br /><br />Solution:<br />The O(n pow 2) solution is easy to design. The other solution is something to do with the thing I said in the top of the article :)Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com1tag:blogger.com,1999:blog-3370623880686051754.post-3000934257416971752007-11-03T03:12:00.000-07:002007-11-03T03:14:46.678-07:00Ubuntu on MacbookWas thinking of installing Linux but seems that Bootcamp beta license is not valid after Oct - so i could not find a link to the beta and all the sites were updated to point to Leapord. The options I had was to either buy Bootcamp or rather upgrade to Leopord. I had no intension to do any of that. I just wanted a OSS operating system and charging to install an OSS is like loosing freedom! The other option was to use rEFit.<br />I had used reFIT before and I thought I will just use rEFit (refit.org) and parted to resize the partition. reFIT is a nice boot manager which shows the list of operating system during boot, includes booting from DVD/CD media. I installed rEFit and downloaded Ubuntu Gutsy Gibbon (the code name for the latest 7.10 version). I had purchased some Kodak CD -R media from Staples and thought I will use them to burn this image. To my surprise I tried it three times and could not verify the burnt image and so gave up for now. I think the CD -R has some issues or there is some compatibility issue between my Mac and CD -R. I suspect that the former one is true - probably some manufacturing defect or something.<br /><br />Still waiting and hoping to find an option to install! Fedora 8 is scheduled to be released on 8th of November. I may rather install Fedora 8 if I don't get a resolution for the CD media issue.Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-48080442218051075452007-10-31T19:22:00.000-07:002007-11-03T03:18:27.715-07:00Git/git-svn on Mac OS X Tiger (Macbook)<span style="font-weight: bold;"></span>Though Git is complex to use I hope it will solve most of my version merge problems. I have used svk (a distributed version tool written in perl built on top of SVN and the SVN perl bindings) before and it is easy to use after creating a basic workflow (which may be slightly hard for a novice svn or CVS user). Unfortunately it dies with complex merge situations. It happens mainly if there is too much reorganization in the main trunk compared to your local branch. For example I worked/work (i try to work whenever I can but always get stupefied by the merge issues.) on an open source project called Cosmo - now renamed as Chandler server - it is actively developed and the trunk undergoes a huge change quite often. The merge interface of svk was really nice and I used it to keep merging changes from the trunk to my local branch. I also had my local branch merged to my own svn sandbox so that if my system crashes I can restore using my svn sandbox :). My entire workflow is documented at<br />http://chandlerproject.org/bin/view/Journal/SvkUsage<br /><br />Now I got my almost new Macbook (repaired using Apple support) without any Linux (as of now) - I thought I will have most of the unix OSS goodies using Macports and Fink :). Git was one of my most wanted tool and I thought of installing it soon to get started with a few projects. As some of the websites pointed git install did not work using fink.<br />I did<br /># fink install git<br />and was greeted with some dependency error messages. I also tried<br />#fink selfupdate<br />asking me a lot of questions and taking a lot of time :(<br /><br />#fink install git<br />again some dependency error message :(.<br /><br />I always heard of Macports and wanted to give it a try. But installing Macports required installing XCode available through ADC, which requires a login. I first installed Macports without installing XCode hoping that it will work, but later realized that Macports needs a compiler as does any port based system. I have used Gentoo port based system and understood that everything is built using source and thus will require a compiler.<br /><br />I downloaded the 3.0 version of XCode, but found that XCode 3.0 does not work with OS X 10.4 Tiger and is meant for leopard. I then downloaded the 2.5 version (around 1 GB download size) and installed it successfully. I could then issue port commands :)<br /><br /># sudo port selfupdate<br /><br />#sudo port install git-core<br /><br />printed lot of stuff like downloading, building, etc taking a lot of time for the compilation<br />and Installation was a success :)<br /><br />Happy with the success I typed<br /># git<br />it showed me the usage<br />I then typed<br />#git-svn<br />It said the command could not be found :(. A google search of git-svn on Mac showed me to use the command:<br />#sudo port install git +svn<br /><br />That fetched a few more files, did some compilations, installations taking lots of time and I got an error that git-core is already installed. Obviously! But I wished the system was smarter and just installed git-svn.<br />I tried<br />#git-svn<br />and was greeted with the same command not found error.<br />I did see that the port system had two entries for git and I had to uninstall all git-core<br /># sudo port uninstall git-core @1.5.3.4_0+doc_svn<br /># sudo port uninstall git-core<br /><br />Then I did a<br />#sudo port install git +svn<br /><br />I tried<br />#git-svn<br />and yes I did see it was installed but the perl module had some missing dependencies. The module called Error.pm. I searched that package in port - but it was of no use and so I tried CPAN.<br /># sudo perl -MCPAN -e 'install Error'<br /><br />It asked me a lot of questions - some missing programs which I installed either using fink or port. Both taking a lot of time and thus patience.<br /># sudo port install lynx<br /># sudo fink install wget<br />The path for port based installations was /opt/local - so I had to specify /opt/local/bin for the path of lynx binary.<br />For fink the path is /sw/ - so I had to specify /sw/bin for the path of wget binary. <br /><br />You could use a single package management system to install the packages. I tried fink thinking that it was more like apt-get - but no it was getting all the deb's but I think they are source debs since I could see the output of configure, make.<br /><br />The other package required by CPAN was ncftpget - both fink and ports did not have those packages :(. I just skipped that step.<br />Then I needed ncftp - ports had the package - So I did a<br /># sudo port install ncftp<br />and the next one<br /># sudo port install gpg-agent<br />But that did not give me the gpg binary and there was no gpg package in the default macports :(. I just skipped all the questions by pressing enter continuously. I got the Error.pm module installed :).<br />I then got an SVN/Core.pm not found error when I tried to run git-svn.<br /><br />I first tried setting the PERL5LIB to my macports version of svn perl library and I got some weird error regarding some core bundler dependency. After struggling a bit I finally removed all git and svn from both Macports and fink. Downloaded git from kernel.org - compiled and installed it the unix way :)<br /># wget http://kernel.org/pub/software/scm/git/git-1.5.3.5.tar.bz2<br /># tar -jxvf git-1.5.3.5.tar.bz2<br /># cd git-1.5.3.5<br /># ./configure --prefix=/usr<br /># make &amp;&amp; sudo make install<br /><br /><br />I followed http://speirs.org/2007/07/22/getting-git-svn-working-on-the-mac/ and downloaded the svn package precompiled with all the language binding. After installing the dmg file, I had to set PERL5LIB to <code>/usr/local/lib/svn-perl.<br /></code><br />I got git-svn working finally :).<br /><br /><br />I still miss the apt-get based installation in Debian systems which just installs the binary and is very fast. Ofcourse port based system has its own benefits like better optimized binary, etc - but it would be really frustrating to wait for 1-2 hours for a program to be installed :(.Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com6tag:blogger.com,1999:blog-3370623880686051754.post-58517094871308561602007-10-31T14:41:00.000-07:002007-11-27T11:12:54.699-08:00Apple supportI recently had some issues with my Macbook and I am impressed with apple support - only disappointment was they had to ship my Macbook to Apple factory and get my Macbook repaired. I had to register for some Geniusbar appointment in Apple website and had to drive to the store. I went to Palo Alto apple store which is the nearest Apple store for me and I was greeted by a good support staff. I found the support guys to be really smart and very crisp compared to any other support I have dealt with. They immediately found out the issue is not resolvable by them and they have to send the Macbook to the factory for repair. I was told that it will take 10 days for the entire process and everything will be covered under waranty :). They replaced my hard drive, RAM and the case which was broken slightly. I handle my Macbook with great care and still the case developed a small hole by itself :(. Thanks to Apple support they replaced my case with a new one and I am happy about that :). They also replaced my Airport network card for some reasons - don't know why - it was working perfectly! Their online tracking system also updates me on the status of the repair and told me when it was shipped overnight.<br />Overall I am happy that my Macbook is working again now :).Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com0tag:blogger.com,1999:blog-3370623880686051754.post-87576267472654536362007-08-26T23:52:00.000-07:002007-09-07T11:34:46.868-07:00My Amazon interview experienceI was surprised to receive a mail from Amazon asking me for an interview. I had just applied to Amazon at the Dice career fair at Linux world and I did not expect a call from them after the initial talk I had with the software development manager at the fair. All excited with the email, I scheduled my interview for the nearest possible date. After some initial confusion I got a surprise call on my mobile - while I was in my friends car and in the middle of a traffic light! I had to reschedule my interview to some other day and again I made the mistake of scheduling it for the nearest possible date. I had no preparation and I was still doing my internship at Verisign. I scheduled my interview for the next day after my last day in Verisign and so I had only one evening to prepare for the interview :(. With so little time I managed to grab a book on Data structures to revise a few data structure fundamentals. After going through a few concepts I was bored and wished for more time! I then thought of revising a few of my Java concepts and grabbed a Java book which I had never touched before. The book was Practical Java and seemed to be really nice. I went through a few concepts like pass by value in Java and a detailed discussion about that including . After saturating myself with a few Java concepts I thought I will do a context switch and listen to some data structure lecture from Berkeley webcast. Unfortunately some of the streams lacked quality audio and I had to skip a few lectures. Then listening to some lecture and just slept off. I woke up at 11 am and was greeted by an engineer from Amazon. He started with some basic Java questions and I was happy that I could answer them...but then I had to deal with questions I did not know or did not remember :(. Here is the complete interview for everyone else searching for a job and preparing for an interview:<br /><br />Question1: What is a final class in Java?<br />Answer: I was delighted to hear this question and gave this answer - A final class<br />cannot be inherited. The final keyword is overloaded in Java - a final class cannot be extended, a final method cannot be overridden and a final variable cannot be changed.<br /><br />Question2: Difference between Abstract class and interface:<br />Answer: I said interface can have only method declaration whereas an abstract class can also have a method definition. The interviewer extended the question and asked me what is the difference between a pure abstract class which cannot have method definitions and an interface - I gave him the generic difference between an interface and class saying that multiple inheritance is possible with interface and not with a class. The interviewer again asked me if there is any other difference. Not able to think well at that time I said I don't know and said that I will prefer interface for my implementation.<br /><br />Quesion 3: Difference between HashMap and Hashtable<br />Answer: I thought about it and said I know both are the same since I have used Properties which is a Hashtable and it is similar to HashMap.<br />After googling I saw that the difference is Hashtable is not synchronized and it supports null for key values.<br /><br />Question 4: Difference between ArrayList and Vector<br />Answer: ArrayList is not thread safe and Vector is thread safe.<br /><br />Question 5: What is the value of i in int i = 5/3<br />I said 1 since it takes the floor in Java and rounds off. He asked me the answer for float i=5/3 and I gave the answer(wrong) as 1.667. The correct answer is 1.0.<br /><br />Question 6: How do you create a thread in Java.<br />Answer: Since I did not revise that section of Java, I could not answer this question well :(. I just said that there are two ways to create a thread. One is by extending the Thread class and the other is implementing the Runnable interface and overriding the run method. The interviewer asked me how do you start the thread? I answered that it can be started using the start method - but said I don't remember it that well since I did not use it recently.<br /><br />Question 7: If you have a really big array - how do you find all the pairs whose sum is 50.<br />Answer: I gave a worst case complexity of adding all the elements in all possible ways to find the sum and see if it is 50. He tried going more in depth - but I declined to answer :(<br /><br />Question 8: This was a tricky question and it took the interviewer some time to explain the question!. Given a number n, How do you find two numbers whose product is one of n+1 or n+2. In case both n+1 and n+2 have multiples - how do you find the multiples whose difference is really less. Eg: Take a number say 5. The two numbers n+1 and n+2 are 6 and 7. 6 has a multiple and 3,2 is the solution to the problem.<br />Take another number say 7. 8 and 9 are the two numbers. 4,2 and 3,3 are the two solutions to the problem. But since 3-3=0 is less - 3,3 is the correct answer to the problem....<br />My Answer:<br />Understanding the question was itself a big exercise for me and I think part of the question was an answer to the problem. But then he asked me how do you find a multiple of a number - I said we could divide it by 2, 4, etc. Then he asked me at what point you stop dividing and I said its n/2. So in case the number 8 - I will divide it by 4, etc. The second part of the question was how do you find the optimal pair (pair whose difference is less) - I had to take a wild guess and say that one way is to see if n has a root. So 9. 16, etc with pairs (3,3), (4, 4) will be the answer for n like 7,8 or 14,15.<br /><br /><br />Question 9: What happens when you type Amazon.com in your web browser?<br />I gave a really long answer on how DNS works. He also wanted the details about the hierarchical nature of DNS. So I explained about the root servers and the caching that happens in between. So the root server responds with the authoritative server for COM and then a DNS query is sent to COM server asking for the authoritative server for AMAZON.com. Finally the Amazon.com nameserver responds with the real ip of the machine hosting Amazon.com. There are some HTTP requests and response between the server and client. A successful response is usually a 200 OK status message followed by the complete HTML body.<br />The client renders the HTML and shows the page to the user. He asked me if there are multiple requests for getting the different images in a page and I said yes ofcourse.Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com4tag:blogger.com,1999:blog-3370623880686051754.post-43163123984600763372007-04-24T12:43:00.000-07:002007-04-25T19:03:01.219-07:00Terracotta on FC6<div style="text-align: justify;"><span style="font-family:verdana;">Terracota makes clustering simpler by providing a shared VM concept, where the application programmer need not worry about any kind of clustering API's and assume that her code will be executed across multiple JVMs. Its a novel approach for clustering any application without the need of changing much code.</span><br /><br /><span style="font-family:verdana;">Its driven by a XML based configuration file called tc-config.xml file which can control the classes you want to share across multiple JVM. By sharing it is not the usual serialized way of sharing, instead Terracotta sends the difference between the objects and thus is more efficient.</span><br /><span style="font-family:verdana;">The sample applications provided with Terracotta are very neat and show the power of Terracotta and it just works out of the box. While I was trying to download Terracotta on my Mac, I did not see any Mac binaries in the download page. I remember seeing the demos in different videos </span><a style="font-family: verdana;" href="http://video.google.com/videoplay?docid=7660457673499305140">[1]</a><span style="font-family:verdana;"> used Mac. Ofcourse it is based on Java and it will work on Mac, but I was annoyed to see only three links when I clicked on the download link. Later I found out that it has been fixed with the new version 2.3-stable1 build which is a generic build and can be used in most unix like platform. Its available as a separate tab in the download page and was hard to notice. I did download the generic 2.3-stable version and got it working without any problems. I had to set my JAVA_HOME to /System/Library/Frameworks/JavaVM.framework/Home/<br /></span><br /><br /><span style="font-family:verdana;">I dual boot Mac and Linux FC6 - unfortunately I have a few issues in Linux (battery, hibernate and sound related) and have to boot in Mac quite often. But being a Linux fan and with Terracotta giving me a reason to boot into my Linux again, I booted in FC6 got all the Linux binaries - the three binaries listed in the download site (DSO, Spring and Session). Untarred them to a terrocotta directory and ran the demos. For a start DSO is good and untarring that alone would be better.</span><br /><br /><span style="font-style: italic;font-family:verdana;" >#bash# cd terracotta/terracotta</span><span style="font-family:verdana;">-2.2.1/dso/bin</span><br /><span style="font-style: italic;font-family:verdana;" >#bash# ./tc-welcome.sh</span><br /><br /><span style="font-family:verdana;">FC6 has some issues with 3d Desktop effects and swing. The swing applications like JTable demo did not show up and it was not because of Terracotta - any swing application in FC6 did not work. I thought it was related to gcj java and I tried to remove all the gcj related packages. While removing gcj, I had to loose almost all the important packages like eclipse and open office which are dependent on libgcj. After loosing all my good applications, I tried running Terracotta again and still saw the same blank JTable frame. Then I had to google to find the solution to the problem and then I discovered that it was the 3d desktop effects (XGL) that was causing the problem. I was using Jdk 1.6 and it seems that the issue has been fixed in a newer jdk. For now I am happy running my swing applications without the 3d desktop! The JTable application and the Shared editor application worked just as shown in the video </span><a style="font-family: verdana;" href="http://video.google.com/videoplay?docid=7660457673499305140"> [1]</a><span style="font-family:verdana;"> and the introductory video at Terracotta.com.</span><br /><br /><span style="font-family:verdana;">Overall I was really impressed by the product. As with any rapidly developed open source (or commercial product) the documentation was really scattered around and there were lot of things to read.</span><br /><br /><span style="font-family:verdana;">[1] </span><a style="font-family: verdana;" href="http://video.google.com/videoplay?docid=7660457673499305140">Google Video - Terracotta presentation</a><br /><br /><br /></div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.comtag:blogger.com,1999:blog-3370623880686051754.post-17006623601608354462007-03-12T03:37:00.000-07:002007-05-05T01:51:31.993-07:00Macbook and Linux<div style="text-align: justify;"><span style="font-size:100%;"><span style="font-family:verdana;">I got the latest Macbook Core 2 duo (Mar 2007) and really liked the new OS with the speed of Intel Core 2 Duo processors. At first I found it hard to use OS X, mainly with the keyboard layout and new shortcuts, but I liked a few things about Mac. Few of the UI things were really mind blowing, but then I was lost trying to find a few things. I am more of a Linux fan, but Mac OS X seems to be a better alternative to the more dominant Windows. I found the Mac experience better compared to Linux, since most of the things work straight out of the box. I know Linux requires a bit more work in that area, but I am sure it will catch up soon.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;">Being a hard core Linux fan, I thought of installing Linux in my Macbook.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;">I had used bootcamp to partition the drive, but unfortunately I pressed OK somewhere and created only a 5GB Linux partition :(. I had also installed reFit for dual booting OS X and Linux.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;">I managed to install Fedora Core 6 64 bit version on this 5GB parition, but I was not able to boot because of some partition synchnozation issues. MacBook uses the new EFI partition. Many of the Linux tools like parted, etc is aware of this partitioning scheme, the Linux installers does not work straight out of the box :(. I had to do a few reboots and do synchronization using reFit.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;">I was impressed by the new effects in FC6. The cube effect and other desktop effects were really cool.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;">The new wireless card is not supported yet (Mar 2007) and I had to use the wired network to browse the internet. I saw Flash 9 was available, but could not have it working because of my 64 bit version. I could use ndiswrapper to make the wifi card work, but it required a 32 bit OS. I also had a 5GB linux partition, which was not enough by any means. I wanted to increase the partition and thought about installing different Linux versions in Macbook. Then I had some issues resizing and I had to completely remove the Linux partition and start from scratch. I did not want to install OS X again, so I had a 40GB OS X partition which I did not touch. I wanted to install various Linux versions and with the new EFI partitioning, there was a limitation of the number of partitions you can have. I wish there was something like extended partition to satisfy my ambitious goal of installing multiple Linux distribution. In my previous IBM thinkpad I had 3 Linux distributions and one other OS. (MS Windows which I rarely used). I found that one way I could achieve that in my Macbook is to use LVM and dynamically resize the partitions and create new partitions for new distributions that I want to install. Unfortunately Ubuntu at that time (or maybe even now) did not have support for LVM and Gentoo live CD did not work that well - X did not start and I tried running some install scripts from command line which failed.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;"> I downloaded FC6 32bit version now and I burned a DVD. I booted using the FC6 DVD and created LVM partitions. So I had four partitions now - two of them were the EFI partition and the MAC hfs+ partition which I did not touch. I had to create a boot partition of 100+MB, since boot partition cannot reside on LVMs. I then created few partitions inside LVM - one of them was the / partition and others were partitions like /home and /opt. /home will be shared with all the distributions once I have more distributions installed.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;"> After installing I got the basic rpm's like mplayer, flash which are not there by default. I was forced to use Yum, though I am not a big fan of Yum. I like apt-get and I am aware of the apt-get port for rpm, but recently I have been using the defaults provided by the distribution. With Ubuntu apt-get is the default since its debian based and I really like that command :). I have used Smart with OpenSuse - which was not bad.</span></span><br /><span style="font-size:100%;"><span style="font-family:verdana;"> I used ndiswrapper with a binary driver for some time and was irritated by the frequent kernel crash. I had no choice but to use this driver or stay near a wired network :(. I was constantly tracking ticket 1001 in madwifi and finally one fine day there was an announcement that support for the card with device id 024 is finally available. I checked out the madwifi branch and everything worked fine with an access point without encryption. But with WEP it did not work and <strike>I am now tracking ticket number 1243 and hoping to have WEP support soon!</strike></span></span> WEP support is finally available (Yay and thanks to all those developers who made this possible) for device id 024 ( the one that comes with Macbook). To compile the madwifi drivers, get the following branch of madwifi:<span style="font-weight: bold; font-style: italic;"><br /><br />#bash#</span> svn co http://svn.madwifi.org/branches/madwifi-hal-0.9.30.13 madwifi-wep<br /><span style="font-weight: bold; font-style: italic;">#bash# </span>cd madwifi-wep<br /><span style="font-weight: bold; font-style: italic;">#bash# </span><span style="font-weight: bold;"></span>make &&amp; make install<br /><span style="font-weight: bold; font-style: italic;">#bash# </span>modprobe ath_pci<br />(also added the following entry in modprobe.conf <br />alias wifi0 ath_pci<br />)<br /><span style="font-weight: bold; font-style: italic;"></span>NetworkManager in Fedora did not detect the card even after restarting it several times. May be it was some issue with uninstalling the previous version of madwifi driver that I had installed. I had to reboot (I have never done that in Linux, except for Kernel upgrades) to find that NetworkManager worked perfectly and I was just able to connect to a WEP based network using this new driver.<br /><br /><span style="font-size:100%;"><span style="font-family:verdana;"> I do have issues with hibernation and suspend. It does suspend or hibernate properly, but after restoring, X behaves strangely. The mouse pointer sometime vanishes or the mouse pointer gets caught in a small area in the top left corner of the screen. I will have to kill X to get a usable desktop.</span></span><br /><span style="font-weight: bold;font-family:verdana;font-size:100%;" > Microphone issues: </span><span style="font-size:100%;"><span style="font-family:verdana;">The soundcard works fine, but the microphone does not work. I discovered that when I was trying to call someone in Skype and the other person was not able to hear anything. I am yet to apply the mactel patches to get the microphone working.</span></span><br /><span style="font-weight: bold;font-family:verdana;font-size:100%;" >Battery Usage</span><span style="font-size:100%;"><span style="font-family:verdana;">: I noticed my battery gets drained very fast in Fedora and so I usually have my power cord connected while using Linux. I tried stopping a few services but that did not help. I think I have to remove some modules and that may increase the battery life.<br /></span></span></div>Vinubalaji Gopalhttp://www.blogger.com/profile/18295251305088526008noreply@blogger.com1