tag:blogger.com,1999:blog-37327017802044491072024-02-10T13:49:56.939-08:00Ankur's blogAnkur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.comBlogger50125tag:blogger.com,1999:blog-3732701780204449107.post-22007369948513532812010-08-24T21:41:00.000-07:002010-08-24T21:43:39.696-07:00"How to write a great research paper"I stumbled across some helpful slides in <a href="http://science-professor.blogspot.com/2010/08/top-loading.html?showComment=1282170195101#c323382353992767015">a comment on FemaleScienceProfessor's blog</a>: <a href="http://research.microsoft.com/en-us/um/people/simonpj/papers/giving-a-talk/writing-a-paper-slides.pdf">"How to write a great research paper"</a> (by <a href="http://research.microsoft.com/en-us/people/simonpj/">Simon Peyton Jones</a>, a researcher at MSR!)Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com8tag:blogger.com,1999:blog-3732701780204449107.post-79201586242380317682010-08-24T15:56:00.000-07:002010-08-24T16:09:22.901-07:00Looking back at my summer with MicrosoftAugust 13th was my last day as a Microsoft intern. Ever since then, I’ve been missing working with great people, reading lots of interesting papers, and contributing to a larger effort in the best way I know -- by writing code :)<br />
<br />
I spent the summer working on the Azure Research Engagement project within the Cloud Computing Futures (CCF) team at Microsoft Research’s eXtreme Computing Group (XCG). My project was to design and build CloudClustering, a scalable clustering algorithm on the Windows Azure platform. CloudClustering is the first step in an effort by CCF to create an open source toolkit of machine learning algorithms for the cloud. My goal within this context was to lay the foundation for our toolkit and to explore how suitable Azure is for data-intensive research.<br />
<br />
Unfortunately, high school ends late and Berkeley starts early, so the internship was compressed into just seven weeks. In the first week, I designed the system from scratch, so I got to control its architecture and scope. I spent the next two weeks building the core clustering algorithm, and three weeks implementing and benchmarking various optimizations, including multicore parallelism, data affinity, efficient blob concatenation, and dynamic scalability.<br />
<br />
I presented my work to XCG in the last week, in a talk entitled <a href="http://ankurdave.com/dl/CloudClustering.pptx">"CloudClustering: Toward a scalable machine learning toolkit for Windows Azure."</a> Here are the <a href="http://ankurdave.com/dl/CloudClustering.pptx">slides in PowerPoint</a> and <a href="http://ankurdave.com/dl/CloudClustering.pdf">PDF</a>, and here’s the video of the talk. On my last day, it was very gratifying to receive a request from the Azure product group to give this talk at a training session for enterprise customers :)<br />
<ul><li>Introduction by <a href="http://research.microsoft.com/en-us/people/barga/">Roger Barga</a>, my manager - <a href="http://www.youtube.com/watch?v=Sy6MyB_w0fs">http://www.youtube.com/watch?v=Sy6MyB_w0fs</a></li>
<li>General introduction - <a href="http://www.youtube.com/watch?v=djkiyhG0e4A">http://www.youtube.com/watch?v=djkiyhG0e4A</a></li>
<li>Technical introduction - <a href="http://www.youtube.com/watch?v=N9BsoXze61Y">http://www.youtube.com/watch?v=N9BsoXze61Y</a></li>
<li>Algorithm and implementation - <a href="http://www.youtube.com/watch?v=MpAGwyFQqHw">http://www.youtube.com/watch?v=MpAGwyFQqHw</a></li>
<li>Optimizations (Part 1) - <a href="http://www.youtube.com/watch?v=bU43KnbCfxs">http://www.youtube.com/watch?v=bU43KnbCfxs</a></li>
<li>Optimizations (Part 2) and Results - <a href="http://www.youtube.com/watch?v=vxucDtIpttI">http://www.youtube.com/watch?v=vxucDtIpttI</a></li>
</ul>These seven weeks were some of the best I've ever had -- and for that I especially want to thank my mentors, <a href="http://research.microsoft.com/en-us/people/barga/">Roger Barga</a> and <a href="http://research.microsoft.com/en-us/people/weilu/">Wei Lu</a>. I'd love to come back and work with them again next year! :)Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com0tag:blogger.com,1999:blog-3732701780204449107.post-7605332382685497962010-07-02T09:38:00.000-07:002010-07-02T11:35:24.327-07:00First week as a Microsoft Research internMy first week as a Microsoft Research intern has been a lot of fun! Here are a few highlights:<br />
<br />
<b>MSR Intern Technology Connections: </b>I attended a fascinating series of talks by the team leaders of Microsoft's various dev tools on Tuesday morning. Some of the best ones:<br />
<ul><li>A behind-the-scenes look at how LINQ works in C# by Eric Lippert.</li>
<li>A demo of some of <span id="goog_1444827303"></span>Visual Studio 2010 Ultimate<span id="goog_1444827304"></span>'s cool features by Justin Marks. (<a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions/ultimate">It costs $11,899</a> :O)</li>
<ul><li>IntelliTrace, a way to step <i>backwards</i> through a program's execution history</li>
<li>Architecture Explorer, a neat visualization of program flow and dependencies.</li>
</ul><ul></ul></ul><b>MSR lectures:</b> Interns can sign up for a stream of invitations to Microsoft Research lunches with notable researchers. In the next two weeks, I'm going to attend "brown-bag" lunches with Dan Reed (the leader of the eXtreme Computing Group) and Leslie Lamport (the creator of LaTeX). <a href="http://www.youtube.com/watch?v=jqLPHrCQr2I">Super cool!</a> :)<br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>What I'll be working on: </b>Building a dynamically scalable, fault-tolerant distributed <a href="http://en.wikipedia.org/wiki/K-means_clustering"><i>k</i>-means</a> algorithm on Windows Azure.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><b>The environment: </b>I'm the only high school intern in XCG, and they don't generally take college interns, so I'm surrounded by PhD interns. It's a great learning opportunity :)</div>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-20991018310354603522010-06-22T22:27:00.000-07:002010-06-22T22:46:21.698-07:00Resources for getting started with Windows AzureMy internship at Microsoft Research's Cloud Computing Futures Group is starting next Monday, and I'm trying to get ramped up on high-performance computing with Windows Azure as quickly as possible so I can start developing real code sooner. Here are two of my favorite resources so far:<ul><li><p>"<a href="http://research.microsoft.com/en-us/events/cloudfutures2010/barga.ppsx">Windows Azure for Research</a>," a presentation from the same group that I'll be working with over the summer. This is a concise summary of Azure's features and possibilities -- and a great way to get excited about the platform!</p></li><li><p><a href="http://www.amazon.com/Programming-Windows-Azure-Microsoft-Cloud/dp/0596801971" style="font-style:italic">Programming Windows Azure</a>, a new book from O'Reilly -- by a member of the Azure product group. This is a well-organized and up-to-date guide, and the author's enthusiasm for the subject comes through :)<br />(Unfortunately, some of the code samples are poorly formatted in terms of indentation and variable naming. Still readable enough, though.)</p></li></ul>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-64146320562988537032010-05-16T10:10:00.000-07:002010-05-16T15:01:39.710-07:00Interning at Microsoft Research over the summerA few months ago, I decided to apply to Microsoft as a summer intern. I recently heard back from them, and I'm looking forward to joining <a href="http://research.microsoft.com/">Microsoft Research</a>'s <a href="http://research.microsoft.com/en-us/groups/ccf/default.aspx">Cloud Computing Futures Group</a>.<br /><br />I'll be working on the <a href="http://research.microsoft.com/en-us/projects/clientcloud/">"Client + Cloud"</a> effort. Currently, researchers need access to their own clusters to do heavy data processing. It would be more efficient to do number crunching in the cloud, where resources can scale along with researchers' needs. But many of researchers' algorithms require very low inter-node latencies, and clouds built of commodity hardware can't guarantee that. Over the summer, I'll be adapting these kinds of algorithms to work with the cloud's relatively high inter-node latencies, specifically using <a href="http://www.microsoft.com/windowsazure/">Windows Azure</a>.<br /><br />In many ways, this is my ideal internship. It provides a nice start in the research field, with the potential for a paper in a year or two. It's in an area of Microsoft that's on the leading edge -- as Steve Ballmer stated, <a href="http://www.microsoft.com/presspass/exec/steve/2010/03-04cloud.mspx">cloud computing is Microsoft's future</a>. And the Cloud Computing Futures Group has strong ties with UC Berkeley, so I'll be able to collaborate even beyond this summer.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-59076583489755842412009-09-06T11:34:00.000-07:002009-09-06T12:01:42.055-07:00More LaTeX document classes: resume and cover-letterI was making a resume and cover letter to apply to some internships recently, and I was trying to use res.cls and letter.cls to make them. But whenever I wanted to tweak something, the complexity and TeX-ness (as opposed to LaTeX-ness) of these standard document classes made things more difficult than I liked.<br /><br />So, since what I wanted was fairly simple, I decided to reinvent the wheel with the resume and cover-letter classes. Here's the source, screenshot and usage for each.<br /><br /><h4><a href="http://ankurdave.com/tex/resume.cls">resume.cls</a></h4><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyPFLsTtOJ1OC6xo22pfOs0BnePP0dfT0bl4md9ZS3yqASwoU6YyCfBKXW1BgSb6nDpsWyegVAXAz6t5-d_NQI1Lm1KaevRJryZUZhh_f-aoA343wCM5hW8OUbp6OLdZ7_Uu8zcfQ4WrU/s1600-h/resume.png"><img style="float: right; width: 40%" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyPFLsTtOJ1OC6xo22pfOs0BnePP0dfT0bl4md9ZS3yqASwoU6YyCfBKXW1BgSb6nDpsWyegVAXAz6t5-d_NQI1Lm1KaevRJryZUZhh_f-aoA343wCM5hW8OUbp6OLdZ7_Uu8zcfQ4WrU/s400/resume.png" border="0" /></a>Usage:<br /><pre>\documentclass{resume}<br /><br />\name{Ankur Dave}<br />\addressone{1234 Abc Road}<br />\addresstwo{San Jose, CA 95101}<br />\phonemobile{555-555-1212}<br />\phonehome{123-456-7890}<br />\email{ankurdave@gmail.com}<br />\website{http://ankurdave.com}<br /><br />\begin{document}<br /><br />\maketitle<br />\thispagestyle{empty}<br /><br />\section{Experience}<br /><br />\employer{Berkman Center for Internet and Society at Harvard University}<br />\location{Cambridge, MA}<br />\jobtitle{Summer Intern}<br />\dates{July---August 2009}<br />\begin{position}<br /> Position description.<br />\end{position}<br /><br />\section{Education}<br /><br />\schoolname{Interlake High School}<br />\dates{September 2006---June 2010}<br />\begin{school}<br /> Description.<br />\end{school}<br /><br />\end{document}</pre><br /><br /><h4><a href="http://ankurdave.com/tex/cover-letter.cls">cover-letter.cls</a></h4><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgccTYDZjG8MhC-6Vj27oX76WDesYQys8vHN7gtRd4H1hsHWKvTdTUVK8JGVx-PCOKMCi1VkWoq6ze99ZTTQtk82vnJ5MCi9XM9t9H_hDCNekGJy9wh5ocqUVTrhtnkrfKwVvJycN0TbmI/s1600-h/cover-letter.png"><img style="float: right; width: 40%" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgccTYDZjG8MhC-6Vj27oX76WDesYQys8vHN7gtRd4H1hsHWKvTdTUVK8JGVx-PCOKMCi1VkWoq6ze99ZTTQtk82vnJ5MCi9XM9t9H_hDCNekGJy9wh5ocqUVTrhtnkrfKwVvJycN0TbmI/s400/cover-letter.png" border="0" /></a>Usage:<br /><pre>\documentclass[12pt]{cover-letter}<br /><br />\address{<br /> Your address and contact info<br />}<br /><br />\recipientaddress{<br /> Recipient's address<br />}<br /><br />\date{\today}<br /><br />\begin{document}<br /><br />\maketitle<br />\thispagestyle{empty}<br /><br />Cover letter body<br /><br />\end{document}<br /></pre>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com3tag:blogger.com,1999:blog-3732701780204449107.post-32773467652610762562009-07-15T16:46:00.000-07:002009-07-15T17:07:38.180-07:00Getting started at the Berkman CenterIt's been a week since I arrived in Cambridge for <a href="http://cyber.law.harvard.edu/getinvolved/internships#summer">my internship with Harvard's Berkman Center for Internet and Society</a>. It's been fun and interesting living on my own and working at the Berkman Center.<br /><br />I'm working in the HerdictWeb team, which runs the <a href="http://herdict.org">Herdict web site</a>. HerdictWeb's goal is to detect Internet censorship around the world through large volumes of reports by a community of volunteers in different countries. It's an effort to use the power of the crowd (also known as "crowdsourcing") to create transparency in governments around the world. The Herdict project is run by Prof. Jonathan Zittrain.<br /><br />My first task in HerdictWeb is to create an alert system similar to <a href="http://www.google.com/alerts">Google Alerts</a> that allows users to sign up for email alerts based on changes in Herdict censorship report data. The alerts would have three parameters:<br /><ul><li>Content (a country or a site) -- a reporter might want updates on reports in Iran, and a site owner might want updates on reports regarding their site.</li><li>Threshold (a number of reports or a percentage change) -- the level of the reports before the alert is triggered. For example, an alert should only happen when 20 reports in Iran happen in a day, or when the number of reports in any country increases by 20% over the previous day.</li><li>Frequency (a time period) -- a cap that prevents alerts from being sent more frequently than specified. For example, an alert may be triggered at maximum once per day.</li></ul><br /><br />Normally, the alert project is at most a week-long project, but it's complicated by the fact that I'm not yet entirely familiar with the HerdictWeb codebase, and in fact neither is anyone else on the team (two others) -- they're new to the project as well. In addition, the previous developers of the project seem not to have checked in a full build configuration to revision control, so even after I was able to get the project to build, a lot of the output was missing. As a result, I've spent the past week setting up the build environment and reading different parts of the project's code.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL9Ni3iRxPX6-dus2PPtHRtcpGOUWUHVsp1nM_6nOZfwY4IidtG-bOmO5dNhKJiV8qpbPSQvoVzAAexOCYK7KW9wnpGDm9mD1C-An1u7YZ3Aep4W1-32HH8kHUaDeI8yk1Vfno_2JJXyY/s1600-h/DSCN2922.JPG"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL9Ni3iRxPX6-dus2PPtHRtcpGOUWUHVsp1nM_6nOZfwY4IidtG-bOmO5dNhKJiV8qpbPSQvoVzAAexOCYK7KW9wnpGDm9mD1C-An1u7YZ3Aep4W1-32HH8kHUaDeI8yk1Vfno_2JJXyY/s320/DSCN2922.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5358842539176498658" /></a><br />More generally, life so far in Cambridge has been pleasant. I'm living in an apartment that I'm renting from my cousin, and my two roommates are nice (if a little messy). I've been cooking my own meals based on instructions my mom wrote for me, which has turned out to be surprisingly easy and tasty. There's a Whole Foods two blocks away and a Trader Joe's not much further, so buying groceries is very easy.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjro6Vd21V_pjtlXZI46SIRB5U_Zv_xr58_MK1rNytL9_M667Sow29VmLBJUeJKaGFvg23qwBMbAvg0HmEVkIBtB-pKZ1t9rCcAOxg34jR5cuJl8FmocWFDgMdWIOMHbQao2uGrupnpT3I/s1600-h/DSCN2923.JPG"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjro6Vd21V_pjtlXZI46SIRB5U_Zv_xr58_MK1rNytL9_M667Sow29VmLBJUeJKaGFvg23qwBMbAvg0HmEVkIBtB-pKZ1t9rCcAOxg34jR5cuJl8FmocWFDgMdWIOMHbQao2uGrupnpT3I/s320/DSCN2923.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5358842869878721970" /></a><br />My uncle, who lives in Syracuse, NY, lent me his bike while I'm here, and that's been really helpful. Even though everything I need to do day-to-day is within a two-mile radius of my apartment, having a bike makes it possible to go back and forth between the Berkman Center's two offices without thinking twice. There are plenty of bike lanes around Cambridge, but most streets are one-way, complicating my routes a little.<br /><br />So overall, Cambridge is better than I expected, and independence is a nice feeling!Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-46855774684750655022009-04-06T15:47:00.000-07:002009-04-30T15:43:56.491-07:00Creating your own LaTeX document classI've been using LaTeX for a few years, and every time I make a new document, I always start by copying a similar document I've made in the past. So over time, the preamble to each document—the header, where formatting and package includes go—has kept getting bigger. And since I frequently create new commands to simplify things while I'm writing a document, those document-specific commands end up in unrelated documents.<br /><br />For example, I wrote my <a href="http://ankurdave.com/ee.html">IB Extended Essay</a> last year, and the formatting I used (1-inch margins, ruled headers and footers with my IB candidate number, 3-point paragraph skips, etc.) became my standard formatting for all IB documents. So whenever I was starting a new IB assignment, I copied my Extended Essay, often neglecting to delete the unnecessary document-specific commands like the following:<br /><pre>\newcommand{\class}[1]{\texttt{#1}}<br />\newcommand{\method}[2]{\texttt{#1.#2}}<br />\newcommand{\note}[1]{\textit{#1}}<br />\newcommand{\coderef}[2]{\ref{#1}, page \pageref{#1:#2}, line \ref{#1:#2}}</pre>So I finally decided to package the common document types I use into custom LaTeX classes, just like the built-in <tt>article.cls</tt> class. So far, I have two classes, <tt>interlake-assignment.cls</tt> and <tt>ib-assignment.cls</tt>. Both of those let you define several fields like <tt>candidatenum</tt> and <tt>wordcount</tt> that then get printed out into an appropriately formatted title section.<br /><br />That makes it possible for me to start a fully-formatted new assignment with just a few lines:<br /><pre>\documentclass{ib-assignment}<br />\title{Modeling the Course of a Viral Illness and Its Treatment}<br />\subtitle{IB Math HL Type II Portfolio}<br />\author{Ankur Dave}<br />\candidatenum{0844-028}<br />\updateheaders % a bit of a kludge to get the title working properly<br /><br />... % document-specific packages and macros<br /><br />\begin{document}<br />\maketitle<br /><br />... % document body<br /><br />\end{document}</pre>Here's the source for the two classes, as well as a screenshot of each one being used:<br /><a href="http://ankurdave.com/tex/ib-assignment.cls">ib-assignment.cls</a><br /><a href="http://ankurdave.com/tex/interlake-assignment.cls">interlake-assignment.cls</a><br />(Update 2009-04-20: I fixed the links; thanks to Lincoln Berkley from New Zealand for pointing out that they were broken.)<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6PaWNtNVWJSw4KYtHgzuN97EPqu2jA4A_ZMJiIVu4Cbp290e_0lFgJXofnqo5Msrs8Ltuqlzy51HZlF0uQHzgpHMGEG7txKsTGekW51kPWZem-UtG0bv7HUWfjxQrIp-tonFee6CCDUE/s1600-h/roles-of-the-president.jpeg"><img style="float: left; cursor: pointer; width: 40%" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6PaWNtNVWJSw4KYtHgzuN97EPqu2jA4A_ZMJiIVu4Cbp290e_0lFgJXofnqo5Msrs8Ltuqlzy51HZlF0uQHzgpHMGEG7txKsTGekW51kPWZem-UtG0bv7HUWfjxQrIp-tonFee6CCDUE/s400/roles-of-the-president.jpeg" alt="" id="BLOGGER_PHOTO_ID_5321723709468969138" border="0" /></a><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-38Qs2RWf46BFzCry5inC0fM2yC-YM9Fzj1BCosrMZWlPfk_Kj4sYQYB42PmCc9djlzf_xqRgay488M6YIuYmR1xRdALmuUIKHenrmTsbpU_b4QtVTaC_xgogYTSYXCu6OysD0pWHLXU/s1600-h/ib-portfolio-2.jpeg"><img style="float: right; cursor: pointer; width: 40%" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-38Qs2RWf46BFzCry5inC0fM2yC-YM9Fzj1BCosrMZWlPfk_Kj4sYQYB42PmCc9djlzf_xqRgay488M6YIuYmR1xRdALmuUIKHenrmTsbpU_b4QtVTaC_xgogYTSYXCu6OysD0pWHLXU/s400/ib-portfolio-2.jpeg" alt="" id="BLOGGER_PHOTO_ID_5321723917381058418" border="0" /></a>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com6tag:blogger.com,1999:blog-3732701780204449107.post-63824583057798345592008-03-22T16:49:00.000-07:002008-04-17T19:05:41.189-07:00Microsoft Seattle regional FIRST robotics competitionI just got back from the competition. Our team, <a href="http://interlakesaintsrobotics.org">Saints Robotics</a>, didn't do so well, mainly because various components of our robot failed throughout the competition. We ended up seeding in 30th place out of 31 teams, and though the top alliance in the finals chose us to be part of their alliance (probably out of pity or impulse), our robot failed again during one of the quarter-final rounds, so we were out of the finals.<br /><br />So we messed up in this year's competition. It's not that big of a deal, but what can we do next year to avoid it happening again? First let's see what went wrong.<br /><br />The most important contributing factor to our failure was that we introduced unnecessary complexity. Our drivetrain, rather than using the known-good tank drive system (each side of wheels runs together) we tried to build a car-like drive system (rear wheels are powered, front wheels turn). We chose this much more complicated system in the hopes of getting more maneuverability. As far as I know we didn't have any hard evidence to back up the claim that the maneuverability justified the extra complexity. So next year we should either just use tank drive, or prototype a different system well in advance so we can really understand whether the new system is worth it.<br /><br />Another problem was robustness. During most of the competition rounds, when our robot was jarred a little too hard, something would go wrong. The problems included a short in the electronics, the battery coming loose, and something bad, the details of which I never figured out, happening to the wheels. This is a hard problem to avoid, but an important countermeasure we can take is stress testing. We need to stop being so protective of the robot, getting scared if it so much as runs into a wall, and instead kick it around a bit. Run it into bricks, kick it, drop stuff on it, and so on. Also, we need to design it to be robust. The main thing we can do to that end is make sure everything is organized and planned out. One important example is the wiring. We should have a map of the electronics layout done ahead of time, with places for wires, so nothing comes loose.<br /><br />Similar to the problem of too much hardware complexity, our software was too complex in similar ways. Because we had so many sensors, most of which weren't worth the complexity they introduced, we had to add lots of sensor code all over the place. Our code wasn't version controlled. This was a major problem that arose mainly because the mentor who knew how to program the sensors didn't want to use version control, instead littering the code with <code>#ifdef</code>'s (for building for FRC or Vex) and <code>#if 0</code>'s (for disabling code). He also didn't communicate well about what changes he was making to the code, so we were constantly confused about whether problems were caused by the software or the hardware. Next year, we will start from scratch, and I will make sure everyone on the development team understands what every part of the code does so that anyone can fix problems and no one treats the code like a magical black box. We will also only attach sensors if we are certain that their benefits will outweigh their complexity and added risk of failure. We'll keep the code under version control, and make sure to have different branches that each work around a missing sensor so we're always prepared for failures.<br /><br />So we did pretty badly this year. But I'm still glad that next year at least we'll have a big list of things <em>not</em> to do <tt>:)</tt><br /><br /><strong>Update 2008-03-22 20:23:</strong> Well let me correct myself—we weren't second to last but rather second because the alliance that chose us finished second. Of course, we only got second because our robot died and got swapped out with a more useful one. Still, it's certainly a good feeling to be second <tt>:D</tt>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-46682251432173695282008-03-09T11:50:00.000-07:002008-03-09T12:05:23.253-07:00Upgrading TiVo's hard drive the second timeWe've had a TiVo for three or four years. It started out as an 80-hour Series 2 model, but two years ago I replaced its 80GB hard drive with a 300GB one using the <a href="http://www.newreleasesvideo.com/hinsdale-how-to/index9.html">Hinsdale guide</a>. That was plenty of space until a few months ago, when we ran into the space limit again.<br /><br />So we bought a 750GB drive. I tried using the same guide to upgrade the 350GB drive to the 750GB one, but the <a href="http://www.newreleasesvideo.com/hinsdale-how-to/MFSLBA48.zip">MFS Tools CD</a> wouldn't even boot this time. I found a newer version, <a href="http://www.mfslive.org/forums/download.php?id=50">MFS Live</a>, and that at least booted. But when trying to run the command to copy the contents of the old drive onto the new one, it gave the error "Backup target not large enough." I decided just to use Linux's <tt>dd</tt> (disk dump) command to do a bit-by-bit copy of the old drive onto the new one, and from there I planned to expand the copied image using the <tt>mfsadd</tt> tool provided.<br /><br />I left the disk copy running overnight, and the next morning I tried to expand the image. When that didn't work (the command said the image was already expanded), I looked around and found out that you can't expand an already-expanded image. Finally, though, I found a tool that advertises that it can: <a href="http://www.mfslive.org/forums/viewforum.php?f=15">WinMFS</a>. Unfortunately, this requires Windows, but luckily I had an install of Vista lying around on my computer. So I used the MFSSuperSize and MFSadd tools on WinMFS, and that worked, resizing the image to the full 750GB.<br /><br />So now we have a TiVo with around 1000 hours of recording space. That should last a few more years :)Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com4tag:blogger.com,1999:blog-3732701780204449107.post-38780301563709645622008-02-27T22:33:00.000-08:002008-02-28T16:55:51.161-08:00Firefox 3I'm trying out Firefox 3 on my laptop running Ubuntu 7.10. It's a huge improvement over Firefox 2 because of three things: it's very fast, it integrates much better with the rest of the desktop in terms of UI, and it has full-page zoom.<br /><br />The speed improvement is really noticeable. Opening a new tab is absolutely instant. Javascript benchmarks show it to be 10 times faster than Internet Explorer 7 (this particular benchmark was <a href="http://slashdot.org/article.pl?sid=08/02/27/2049258">featured on Slashdot</a>).<br /><br />Firefox 3 uses Cairo/GTK2 for rendering all its page elements on Linux. (On Windows and Mac it uses the appropriate toolkits as well.) This means that it looks like any other Gnome application on my computer, and though that may seem like a small thing, it actually benefits the experience tremendously.<br /><br />Full-page zoom, a feature I've always wanted in Firefox, is finally implemented in the browser. (It was implemented in various extensions for Firefox 2 but they did a pretty bad job.) Full-page zoom is where instead of the just the text size increasing, the images and the layout scale as well. It's worth noting that IE7 and Opera already have this feature.<br /><br />To install it on Ubuntu Gutsy, I installed the package <tt>firefox-3.0</tt>. Unfortunately, there is one important flaw in how the Ubuntu people built the Firefox 3 package: it's not built against a version of Cairo that supports detection of the system subpixel font rendering settings. This means that the fonts have ugly color bands around their edges. In theory I could build my own copy of Firefox 3 from source with the <tt>--with-system-cairo</tt> flag, which would fix the problem, but after a few hours of reading bug reports and forums I found out that Firefox 3 requires at least <tt>libcairo</tt> version 1.5.2. The Ubuntu Gutsy repositories only include version before that. Turns out the only repository that has the correct version of Cairo is the Ubuntu Hardy repository, which means that I have to upgrade to Hardy, which is still in development, to get the correct Cairo library to be able to build Firefox 3.<br /><br />I briefly considered upgrading to Hardy but decided it wasn't worth it. But Firefox 3 is good enough that I'm not giving it up just because of that font rendering problem. I'll survive with the poor rendering until Hardy officially comes out in April.<br /><br /><strong>Update 1 minute after I finished writing this:</strong> Screw caution. I'm <a href="http://akso.wordpress.com/2008/02/04/upgrade-ubuntu-gutsy-to-hardy-alpha-4/">upgrading</a> <em>now</em>.<br /><br /><strong>Update 2008-02-28:</strong> The upgrade failed because of package dependencies (something to do with <tt>update-manager-core</tt>) and I tried to roll back but that messed up a lot of the install. So I'll just make a new partition and <a href="http://cdimage.ubuntu.com/releases/hardy/alpha-5/">install Hardy directly</a>. It's only at alpha 5, but I can manage a little instability. Also, I'm going to use the 64-bit version, so for the first time I'll get to use a 64-bit OS on my computer. Interesting how what started as an innocent attempt to try a new browser ended up in me upgrading my OS entirely... :)Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-84888116921108875032008-02-03T12:50:00.000-08:002008-02-03T13:15:19.324-08:00Virtualizing Windows XP with QEMU and KVMFor <a href="http://interlakesaintsrobotics.org">Robotics</a>, to program the robot, we use Microchip's MPLAB IDE with the MPLAB C18 compiler. Unfortunately, those two only run on Windows. So to use them if your primary OS is Linux, there are three choices: boot to Windows, use the WINE compatibility layer, or virtualize a full Windows installation from within Linux.<br /><br />My first choice was to use WINE. Unfortunately, WINE is pretty slow, annoying to use, and unreliable (the MPLAB IDE install failed for me). So I booted to Windows Vista and installed the tools there. They installed after a little fiddling with compatibility options, but booting to Vista every time I want to make a change is a pain, especially considering how slow Vista is to boot.<br /><br />So my last option was to virtualize Windows (here's a <a href="http://www.cmready.com/polyoperable/?p=6">tutorial</a> if you're interested). Luckily, my laptop's CPU supports hardware virtualization extensions (it's an Intel Core 2 Duo T7200) so full virtualization should be pretty fast—around 80% of native performance. I installed the Ubuntu <tt>qemu</tt> and <tt>kvm</tt> packages. Qemu is a basic open-source emulator that can run any x86 OS. It usually runs pretty slowly, at around 10% of native. KVM is the Linux kernel module that takes advantage of the CPU's virtualization extensions to speed things up significantly.<br /><br />Once those two packages were installed, I <tt>modprobe</tt>'d the <tt>kvm</tt> and <tt>kvm_intel</tt> modules and created a 3-gigabyte disk image. I installed Windows XP onto it (we have 3 or 4 copies of XP lying around, and since we either replaced those installations with Ubuntu or Vista, the copies are available for me to use). I backed up the fresh image onto an external drive and installed Office XP (same thing as above, we have a few licenses) and the MPLAB tools onto the image.<br /><br />So now I have a nice virtualized session of Windows XP up that boots in around 15 seconds and is almost as fast as the real thing. Here's a screenshot of the robot code building (successfully!) under the virtual machine:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR5UJXUgCxF_u5jUHEHwKd4GwvuIjZBULEGatUhOr7CFQJBxFqsHIWxZu06hyziELoB79Tanw80kvsCxONF3XGwFYzac_9JsxldvWgKN4O5TTIf4q8DY89m3KBaz0Hl6p187rXx_m8aqk/s1600-h/qemu-mplab.png"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR5UJXUgCxF_u5jUHEHwKd4GwvuIjZBULEGatUhOr7CFQJBxFqsHIWxZu06hyziELoB79Tanw80kvsCxONF3XGwFYzac_9JsxldvWgKN4O5TTIf4q8DY89m3KBaz0Hl6p187rXx_m8aqk/s400/qemu-mplab.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5162864478418978514" /></a>Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-19907407819963754472008-01-09T22:11:00.000-08:002008-01-09T23:02:47.709-08:00Open Source as an IB Extended Essay topicI just came back home from the IB Extended Essay presentation, and the one thing that struck me was how many people presented on the history of their country of origin. I'd estimate that three-fourths of the candidates wrote their EE on history and one-fourth on a literary topic. Probably several discussed an art-related topic, only one person (as far as I know) wrote the EE on technology (ITGS), and nobody did anything on physics or math.<br /><br />Do English and history really interest so many people, or did they choose it mainly for safety in numbers? (Or because O'Byrne discouraged people from doing anything but those subjects?) I searched online for people who had chosen the sciences: math, physics or ITGS (which, since the course focuses on society so much, doesn't seem like a science at first, but at least it's grounded in computer science).<br /><br />Searching with Google for "ib extended essay math" returns two promising results. The first is an <a href="http://www.thestudentroom.co.uk/showthread.php?t=10948&page=3">IB EE topic discussion thread</a>. Posts 43 and 44 (search the page for "#43") discuss math as an EE topic. One of the students was going to use <a href="http://en.wikipedia.org/wiki/Game_theory">game theory</a> as a topic but "my supervisor told me that i couldnt expect the examiner to know anything at all about game theory." So clearly we're very limited by the readers' knowledge—game theory is not an obscure branch of mathematics by any means, so if we do math we'll probably have to either stick to the basics or explain all the more advanced concepts in painstaking detail.<br /><br />The second good result was someone who had published their <a href="http://www.edwardpultar.com/writings/IBExtendedEssay.jsp">math/physics paper on juggling</a> online. The paper seems pretty interesting (I only skimmed it) and the author makes moderate use of equations around the end of the paper, contrary to my expectation that the paper would be almost completely prose. Of course, the paper didn't necessarily get a good score, but at least something like this has been done and the evidence is there for us to see.<br /><br />Finally, I searched around for a topic more in my area of computer science. During the presentations, I was thinking about some topics I could use in the technology area. For example, I liked the idea of doing something about how the open-source development model has influenced corporate software development, or the growing role of open-source software in society (yes, that's vague, but these are only ideas from off the top of my head). So I searched for "ib extended essay itgs open source" and I got only one relevant result: a (seemingly) <a href="http://www.aacps.org/aacps/oldmhs/PDFs/Extended%2520Essay%2520Class%2520of%25202009.pdf">official IB ITGS document</a> that, on page 113, gave a sample prompt ("intended for guidance only"): "How Open Source software has led to improved corporate networking." To clarify, corporate networking is intended in the sense of "LinkedIn," and not in the sense of "enterprise networking with Cisco."<br /><br />So I rephrased the query to "ib extended essay itgs +linux," for which I got a great result: <a href="http://www.ids.org.au/~dan/ib_stuff/ee/eefinal.html">a paper about Free-Libre Open Source Software and its future in K-12 education</a>. This paper is really in-depth and well-researched; it even includes surveys of school sysadmins from around the world.<br /><br />Anyway, I wanted to be sure that not doing an English or history paper for the IB Extended Essay was viable and proven, and it seems like it's does have some precedent. Although even if there was no precedent, I would probably still do something on ITGS, since I just can't bring myself to be passionate about history, and at best I can only be somewhat enthusiastic about English.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com5tag:blogger.com,1999:blog-3732701780204449107.post-33414541420524479782007-12-27T21:50:00.000-08:002007-12-27T22:06:54.489-08:00Amarok and last.fmI recently started using <a href="http://last.fm">last.fm</a>, which if you didn't know is a service that records the songs you listen to, provides statistics and recommendations, finds others with the same music taste, and allows you to sample music and music videos from related artists. I also just switched to Amarok from Rhythmbox because it seemed much more featureful.<br /><br />Amarok is a great piece of software, although it takes a little getting used to. Here's a screenshot:<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBXPaLfZQ0WeiIDQOcXwpQhs26Cu_7XHzFdXO3-BhDWNNYGl02SF-OP5HFzL4gd0x9F6PmjBGB1mnjhleNmGsTFNf52ydZD2-Tw1tB9mrFNem5YBfm8d4iHY_IlpZrXa8btu0_9EW8hks/s1600-h/Screenshot-Amarok+-+The+Hardest+Part+by+Coldplay.png"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBXPaLfZQ0WeiIDQOcXwpQhs26Cu_7XHzFdXO3-BhDWNNYGl02SF-OP5HFzL4gd0x9F6PmjBGB1mnjhleNmGsTFNf52ydZD2-Tw1tB9mrFNem5YBfm8d4iHY_IlpZrXa8btu0_9EW8hks/s320/Screenshot-Amarok+-+The+Hardest+Part+by+Coldplay.png" alt="" id="BLOGGER_PHOTO_ID_5148900711717796658" border="0" /></a><br /><br />Last.fm is quite nice as well. Here's my <a href="http://last.fm/user/ankurdave">music profile</a>, which shows tracks I've recently listened to, as well as top artists and that sort of thing.<br /><br />How the two integrate is pretty neat. When you play a song in Amarok, it gets "scrobbled" (to use last.fm terminology)—that is, sent to last.fm and added to your music profile. Here's how Amarok lets you reap the benefit of sending last.fm your data: Amarok has "dynamic playlists" that provide an automatic playlist of songs based on some criteron, like random selection or most-played tracks. But one setting allows you to put a few songs on your playlist and then enable the "Suggested Songs" dynamic playlist (it's enabled in the screenshot above). This allows Amarok to ask last.fm for suggested songs based on the current playlist and your account information. So you can leave it running and not have to keep refilling the queue with manually selected songs.<br /><br />For more thorough documentation of Amarok, see the <a href="http://docs.kde.org/stable/en/extragear-multimedia/amarok/index.html">Amarok Handbook</a> at docs.kde.org.<br /><br />Note that Amarok is not associated with last.fm in any way except that it provides an open-source implementation of its client. It is the default player included with KDE.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com6tag:blogger.com,1999:blog-3732701780204449107.post-38243281165629951772007-12-18T15:58:00.000-08:002007-12-20T02:16:35.468-08:00Shure E2c earphonesI got the Shure E2c sound-isolating earphones yesterday from Amazon for about $60. Almost all of the major reviews I could find described them as excellent earphones for both their sound-isolating properties and their audio quality. I've only used them for about a day so far, but here's a sort of review of how well they live up to the high standards I started out with.<br /><br />Standard earbuds are disk-like speakers that sit on the outside of your ear, not extending into the ear canal at all. Some earbuds have a little protrusion that goes a little bit into the ear canal, but only a few millimeters. In contrast, sound-isolating earphones go pretty deep into the ear canal, up to about a centimeter. They block background noise passively, like earplugs do: by having a rubber or foam plug that stays in the ear canal. The advantages of this are that they block sound very effectively without requiring batteries like noise-cancelling headphones do, and that they won't come out when you run because they're deep in your ear. The disadvantages are that it can be hard or painful to put them in if you don't know how to do it, they collect earwax pretty easily, and (this is also an advantage) they block outside sound very effectively, so you can hardly hear someone who's standing next to you, even if you're not actively playing music.<br /><br />The Shures are excellent at sound isolation. In a loud room like the school cafeteria,<br />the roar is literally quieter than a whisper with the earphones on. This lets you play music at low volumes and preserve your hearing, since you don't have to drown out any sound.<br /><br />In terms of sound quality, the treble is amazingly crisp, and that really adds to the enjoyment of the music. The bass is very accurate (not artificially high, nor too low) when you're using a decent sound source like a computer or a good MP3 player, but with my poor-quality player, there's very little bass, so that detracts from the experience a little.<br /><br />Finally, comfort. At first, it's very painful to put these earphones in. You try to push but they just don't budge, and when I say it's painful, I really mean it. But what really helps is to wet the tips a little, which makes them go in easily and painlessly as well as making a better sound-isolating seal.<br /><br />So overall, I'd say these earphones are quite good—of course they're a huge step up from standard iPod/Creative earbuds, but their sound quality is actually better than even a pair of $100 non-sound-isolating Bose earphones we have. And their sound isolation just makes it even better.<br /><br /><strong>Update 2007-12-20 2:20am:</strong> Shure provides three kinds of tips for the earphones: clear hard-ish PVC ones, black soft rubber ones, and orange foam ones. I had been using the black rubber ones and I always had to push them uncomfortably deep into my ears to get good isolation and sound quality, but I just tried the orange foam ones, and they're <em>much</em> better. They're very comfortable, I don't have to put them into my ears very far at all, and they provide even better sound isolation. The only problem is that they're not as durable as the others since they're foam, so I'll have to replace them in a few months. Also, they take longer to remove. Overall though, they make the earphones nearly perfect.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-69080169037750251322007-12-02T22:04:00.000-08:002007-12-02T23:07:52.911-08:00Backing up GmailMy Gmail account is pretty important to me—I've been using it since 2004 and it currently holds around 4000 emails (grouped into about 2500 threads, taking up 425 MB). I've been thinking about backing it up for a while, but I finally got around to it and succeeded after only a little frustration.<br /><br />The first thing I did was configure Gmail to accept POP3 connections. I went into the Gmail settings page and, in the "Forwarding and POP/IMAP" tab, chose "Enable POP for all mail."<br /><br />At first I tried fetchmail to get the emails over POP3 from Gmail. I had it all set up and everything until I discovered that it depends on a mailserver running on the local machine so it can get the messages from Gmail and send them to the local mailserver. I didn't want to go through the hassle of installing and securing sendmail or postfix, so I went looking for alternatives that would just dump the mails to a file or directory.<br /><br />I found getmail (available through the <tt>getmail4</tt> package on Ubuntu) and installed it. Here's how I configured it:<br /><br />First, I set up the getmail configuration directory and the Maildir structure where the mails would go:<br /><pre>cd ~<br />mkdir .getmail/<br />mkdir gmail-inbox/<br />mkdir gmail-inbox/cur/<br />mkdir gmail-inbox/new/<br />mkdir gmail-inbox/tmp/</pre><br /><br />Then I created the file <tt>~/.getmail/.getmailrc-gmail</tt> with the following contents:<br /><pre>[retriever]<br />type = SimplePOP3SSLRetriever<br />server = pop.gmail.com<br />port = 995<br />username = ankurdave@gmail.com<br />password = <em>my password</em><br /><br />[destination]<br />type = Maildir<br />path = /home/ankur/gmail-inbox/<br /><br />[options]<br />delete = false</pre><br /><br />Finally, I launched getmail to fetch the emails:<br /><pre>getmail --rcfile='.getmailrc-gmail'</pre><br /><br />I had to run this command several times because Gmail serves up the emails in chunks of 400–600 mails at a time instead of giving all 4000 emails in one go. (This took a while to figure out.)<br /><br />Since getmail uses the Maildir format to store its emails, I could read the emails as they were being downloaded. I ran mutt with <tt>mutt -f ~/gmail-inbox/</tt> to point it to the mail directory.<br /><br />Finally, if you have to start downloading over again for some reason, you have to tell Gmail you're starting over. In its web interface, it shows that you have downloaded up to a certain point in your inbox with the following line (available in Settings->Forwarding and POP/IMAP): "Status: POP is enabled for all mail that has arrived since 12/10/06" where the date is the date of the last message retrieved through POP. The next time you download emails over POP, Gmail only delivers mails after that date to avoid duplicates. You can reset the date by choosing "Enable POP for all mail (even mail that's already been downloaded)."<br /><br />So overall, backing up my Gmail account was fairly easy and clean, and now I can be sure that all that information isn't at the mercy of Google.<br /><br />Update 2007-12-02 11:04:55 PM: I just finished downloading all the email. There are 4235 messages, taking up 434 MB of space. When compressed with <tt>zip</tt>, they take up 282 MB—still pretty big, but a little more manageable.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com5tag:blogger.com,1999:blog-3732701780204449107.post-55569530911567333232007-11-21T23:11:00.000-08:002007-11-21T23:23:32.735-08:00Shared hosting with GoDaddy is annoyingWe bought hosting for Saints Robotics with GoDaddy (it's a "Linux Deluxe" plan). I'm trying to set up a MySQL database for MediaWiki. Our site is hosted on a shared server with lots of other users. All these users share the same Apache, the same MySQL, etc. So when I'm trying to created a new database, I can't name it anything I want—instead, I have to try to find a unique name, since someone else has taken the database name I wanted already. Also, they don't give SSH access because the server is shared. Why don't they just use virtualization? Not having shell access to my server is very annoying. (Although I could just install a PHP terminal...but SSH is so much nicer.)<br /><br />Also, whenever I make a change to the server configuration, for example adding an FTP user, a MySQL database, or changing the PHP version settings, it can take up to 24 hours to apply! That's ridiculous! I can't wait a day each time I make a change!Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-51074639729621331112007-11-04T01:06:00.000-07:002007-11-04T01:09:39.112-08:00Daylight saving time...I looked at the clock about half an hour ago and it said "Sun Nov 4, 1:37:16 AM".<br /><br />I just looked at it again and now it says "Sun Nov 4, 1:07:37 AM".<br /><br />At first I thought I must have read it wrong the first time, or I was so sleepy I was hallucinating (even though I'm not actually sleepy). And then I remembered Daylight Saving Time ends at 2:00 AM on November 4 this year.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-19610650710119248202007-10-27T15:47:00.000-07:002007-10-27T16:21:46.115-07:00Linux power consumption, touchpad featuresI recently upgraded to Ubuntu 7.10 "Gutsy Gibbon," which includes the 2.6.22 version of the Linux kernel. This release features support for Intel's power consumption monitoring tool <a href="http://www.linuxpowertop.org/index.php">PowerTOP</a>. This utility shows the following diagnostic outputs:<br /><ul><li>the percentage of time the CPU is spending in different frequencies (since modern CPUs can change frequency on the fly to save power when the extra speed isn't needed)</li><li>the current power consumption of the system in watts (this is only available when you're running on batteries)</li><li>the processes, drivers, and devices that are interrupting the system from sleep the most frequently</li><li>relevant tips on how to decrease power consumption for your system<br /></li></ul>Using that information, as well as the Linux <tt>laptop-mode</tt> daemon, I was able to reduce my laptop's power consumption noticeably. Unfortunately I didn't have the time to do objective benchmarks, but before, my laptop used to last around two hours on batteries; now it lasts for around two and a half.<br /><br />I also tweaked my touchpad's settings using the <tt>synaptics</tt> driver for Xorg. The <tt>synaptics</tt> driver allows you to set features like two-fingered scrolling (similar to that of the Mac) and circular scrolling. Unfortunately, most touchpads — mine included — don't support multi-touch, so I couldn't get two-fingered scrolling. But I think circular scrolling is even better.<br /><br />With normal touchpad scrolling, you move your finger up and down the right side of the touchpad to scroll. When you reach the bottom of the touchpad, you have to lift your finger and start over at the top. But with circular scrolling, you start your finger at a designated part of the touchpad (I chose the right edge) and then move your finger in a clockwise circle to scroll down, and counterclockwise to scroll up. Basically, the touchpad starts acting like an iPod scroll wheel. To stop scrolling, you lift your finger from the touchpad, and it returns to normal.<br /><br />This allows you to scroll through a long document just as easily as a short document, since you don't have to keep lifting your finger. And since scrolling is measured in radians instead of inches your finger has moved, you can scroll slowly and precisely by making big circles, or quickly by making small circles. It's much more comfortable than even using a mouse scroll wheel.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-2994705091213676832007-10-07T21:45:00.000-07:002007-10-07T22:31:23.145-07:00DNS with BIND9So I set up a DNS server in our house, on the server downstairs that also runs a web server (along with various other network services like Subversion, Samba, SSH, and Squid (believe it or not, the alliteration is just a coincidence)). I used BIND9 and the domain name "davenet.local". It works pretty well, except for a few problems.<br /><br />First of all, for the machines on the network to use that server as their DNS server, the router running the DHCP service needs to be configured to tell them to do so. This would normally not be a problem, if we had a decently configurable router at the edge of the LAN. But we have a Linksys WCG200 (that's a wireless router with a built-in cable modem). It's minimally configurable, not even including the ability to change the DNS servers from the ISP-allocated ones. We also do have a Linksys WRT54G with DD-WRT that acts as a repeater (I highly recommended the WRT54G by the way, and I'm planning on buying a few more because they're so versatile with third-party firmware). DD-WRT does give the ability to set custom DNS servers, but this only takes effect for clients connected to the repeater, not to all clients in the network. To clarify this, here's an ASCII diagram of our network:<br /><br /><pre style="line-height:1em"><br /> _[wireless: laptops]<br /> /_[wired: DNS/WWW/SMB/SVN/SSH/Squid server]<br /> /_[wired: printer]<br /> /_[wired: VoIP modem]<br /> /<br />[WAN] --- [WCG200 gateway]<br /> \ _[wired: TiVo, Xbox 360]<br /> \ /<br /> \_ [wireless: WRT54G repeater]<br /> \_[wireless: laptops]<br /></pre><br /><br />(that took a while to make) So the DNS propagates from the repeater to the repeater's clients, but not from the gateway to the gateway's clients.<br /><br />The second problem is that, for some reason, accessing the SMB server using its DNS name (files.davenet.local) is much, much slower than using its IP address directly. I've only tried this on Windows Vista though, so I don't know if the problem is client-related. Has anyone else seen this problem?<br /><br />But overall, having a DNS server is good: it's not only easier for me to tell people to access the network printer using printer.davenet.local than 192.168.1.10, but it's also just a cool thing to do.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com0tag:blogger.com,1999:blog-3732701780204449107.post-49668542652067077972007-09-27T19:45:00.000-07:002007-09-27T19:55:01.727-07:00Halo 3So I got Halo 3 today (my dad bought it from the Microsoft company store <tt>:)</tt>). I just started the Halo 1 campaign a few weeks ago though, so I'm not going to try Halo 3 campaign until I finish 1 and 2.<br /><br />Anyway, first impressions of it from playing multiplayer: the graphics are of course very good and the new weapons are really fun to play with. But — and I don't know if anyone else has experienced this — my eyes get really tired from trying to play Halo 3, and I'm much more confused and disoriented in battles than if I were playing Halo 1. I have the same problem with Halo 2. This could be because the FOV has decreased since Halo 1, or maybe because the graphics are more complex. Or it could be because I'm just generally tired today. Time will tell...Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com2tag:blogger.com,1999:blog-3732701780204449107.post-15096716678041159522007-09-13T17:20:00.000-07:002007-09-19T17:09:55.513-07:00RoboticsFor the robot this year, we <em>have</em> to use the accelerometers, gyro, and gear tooth sensors, if only for the fun of using them. I was thinking maybe next meeting (2007-09-19) we could add them onto the existing robot experimentally and start programming it a bit.<br /><br />For example, we could add the facility to run in a perfectly straight line at an exactly constant speed as long as a certain button on the joystick is pressed by using the gyro to check and compensate for rotational error, and using the gear tooth sensors to compensate for speed error.<br /><br />Or maybe we could implement collision detection using the accelerometers (this would be pretty hard, since how do you tell what's a collision and what's a quick stop).<br /><br />We could implement bounce detection on the joysticks so things wouldn't be so jerky.<br /><br />Maybe an emergency stop button that uses the accelerometers to compensate for the robot's momentum by canceling it out with force on the motors in the other direction.<br /><br />Maybe a button to do a perfect 90° in-place turn by constantly integrating the gyro data until 90° is reached, while simultaneously using the accelerometers to make sure the robot doesn't move around too much (this last part would probably not work, since the accelerometers would always return some acceleration even if the turn is perfectly stationary).<br /><br />Maybe even something as simple as using the front panel lights as a speedometer (this would of course be collected by integrating the accelerometer data).Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-81921201892263878412007-09-08T21:58:00.001-07:002007-09-08T22:08:51.652-07:00GridMoveI've been using an application called <a href="http://www.donationcoders.com/jgpaiva/gridmove.html">GridMove</a> for a few weeks, and it's pretty good. It's an application that lets you snap windows to a grid, so if you have a very high-resolution monitor like I do, you can have several windows visible at once without having to customize their positions manually. GridMove is really flexible because you can define your own grids. Here's a screenshot of one that I've defined, called "Main, 2 auxiliary":<br /><br /><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIPLWwrL2L3Kdq2Rh1j9IbpzpVqsVIvNj-XbUK_RDFWF4GfK_hgxpEZfipnbDHH63qT69J_Ir172HrLM951Amk1VY_DeGV3VqVUAUAzHj-i2p6qVFgqvm9PtRGnd6_P1xfwDUElC1Oi38/s400/gridmove-in-action.png" />Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com0tag:blogger.com,1999:blog-3732701780204449107.post-9359583234455767242007-09-02T23:09:00.001-07:002007-09-02T23:20:18.599-07:00New Facebook accountSo after a few friends recommended Facebook, I thought I'd give it a try. And now, 15 minutes after I've signed up, my Gmail inbox is filled with "Foo Bar wrote on your wall" and I'm overwhelmed by Facebook's information-rich world.<br /><br />People who otherwise have no online presence are completely free on Facebook. Every action they have made on the site is public to all their friends. It's the sort of openness that I like, but taken to an extreme in one sense (all information is exposed to your friends) while very closed in another (nothing is shown to outsiders). This is exactly the kind of closed group–forming that I don't like...but now that I'm part of the closed group, will it matter so much to me?<br /><br />It's also, unfortunately, even more distracting and time-consuming than IM. I find myself enjoying the slow, convenient nature of blogging. And now I will go to sleep.Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com1tag:blogger.com,1999:blog-3732701780204449107.post-12258309890081488942007-08-29T17:59:00.000-07:002007-08-31T04:47:14.992-07:00Summer homeworkNow that work is over and there's less than a week left of summer vacation, I don't have much of an excuse for not having started on my summer homework. How many of you have done it?<br /><br /><rant>By the way, why is it always English class that assigns summer homework? Do English teachers think they have a monopoly on students' time? (lol) In fact, I dispute the value of summer homework altogether, since almost everyone saves it until school is almost upon them anyway.</rant><br /><br /><b>Update, 2007-08-31 03:15:</b> I just finished <cite>A Hero of Our Time</cite>, and I'd already done Section 1 of the packet, so I'm at the same level as Milda! (Assuming she hasn't done anything since she posted that comment.) Also, to save everyone the trouble of looking for it, here's an <a href="http://www.namdar.dircon.co.uk/aaRussian/Lermon/lermonov.htm">online version of the book</a> that, as far as I can tell, is the same translation as we have. You can't grep dead trees.<br /><br /><b>Update, 2007-08-31 04:07:</b> Here is <a href="http://ankur.homelinux.com/a-hero-of-our-time-text.html">my copy of the book</a>, with the entire thing on one page, as well as normal black-on-white colors. I suggest you save this page onto your own computer; our internet connection is rather flaky.<br /><br /><b>Update, 2007-08-31 04:44:</b> Aha, staying up late has had its benefits: I'm now finished with Section 2 as well. Also, has anyone noticed that the packet has no Section 4? (That's good for me, as now I can claim I've done sections 1, 2, <em>and</em> 4).Ankur Davehttp://www.blogger.com/profile/01209122921424094731noreply@blogger.com3