2007-12-27
Amarok and last.fm
Amarok is a great piece of software, although it takes a little getting used to. Here's a screenshot:
Last.fm is quite nice as well. Here's my music profile, which shows tracks I've recently listened to, as well as top artists and that sort of thing.
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.
For more thorough documentation of Amarok, see the Amarok Handbook at docs.kde.org.
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.
2007-12-18
Shure E2c earphones
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.
The Shures are excellent at sound isolation. In a loud room like the school cafeteria,
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.
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.
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.
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.
Update 2007-12-20 2:20am: 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 much 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.
2007-12-02
Backing up Gmail
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."
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.
I found getmail (available through the getmail4 package on Ubuntu) and installed it. Here's how I configured it:
First, I set up the getmail configuration directory and the Maildir structure where the mails would go:
cd ~
mkdir .getmail/
mkdir gmail-inbox/
mkdir gmail-inbox/cur/
mkdir gmail-inbox/new/
mkdir gmail-inbox/tmp/
Then I created the file ~/.getmail/.getmailrc-gmail with the following contents:
[retriever]
type = SimplePOP3SSLRetriever
server = pop.gmail.com
port = 995
username = ankurdave@gmail.com
password = my password
[destination]
type = Maildir
path = /home/ankur/gmail-inbox/
[options]
delete = false
Finally, I launched getmail to fetch the emails:
getmail --rcfile='.getmailrc-gmail'
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.)
Since getmail uses the Maildir format to store its emails, I could read the emails as they were being downloaded. I ran mutt with mutt -f ~/gmail-inbox/ to point it to the mail directory.
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)."
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.
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 zip, they take up 282 MB—still pretty big, but a little more manageable.
2007-11-21
Shared hosting with GoDaddy is annoying
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!
2007-11-04
Daylight saving time...
I just looked at it again and now it says "Sun Nov 4, 1:07:37 AM".
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.
2007-10-27
Linux power consumption, touchpad features
- 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)
- the current power consumption of the system in watts (this is only available when you're running on batteries)
- the processes, drivers, and devices that are interrupting the system from sleep the most frequently
- relevant tips on how to decrease power consumption for your system
I also tweaked my touchpad's settings using the synaptics driver for Xorg. The synaptics 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.
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.
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.
2007-10-07
DNS with BIND9
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:
_[wireless: laptops]
/_[wired: DNS/WWW/SMB/SVN/SSH/Squid server]
/_[wired: printer]
/_[wired: VoIP modem]
/
[WAN] --- [WCG200 gateway]
\ _[wired: TiVo, Xbox 360]
\ /
\_ [wireless: WRT54G repeater]
\_[wireless: laptops]
(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.
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?
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.
2007-09-27
Halo 3
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...
2007-09-13
Robotics
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.
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).
We could implement bounce detection on the joysticks so things wouldn't be so jerky.
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.
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).
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).
2007-09-08
GridMove
2007-09-02
New Facebook account
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?
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.
2007-08-29
Summer homework
<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>
Update, 2007-08-31 03:15: I just finished A Hero of Our Time, 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 online version of the book that, as far as I can tell, is the same translation as we have. You can't grep dead trees.
Update, 2007-08-31 04:07: Here is my copy of the book, 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.
Update, 2007-08-31 04:44: 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, and 4).
2007-08-28
Last day at work
Everyone who asks me about my job is always impressed by how much money I make, but honestly, to me that's just a bonus — working there was worth so much more to me than just money.
2007-08-21
Update
2007-08-15
Dual booting, multiple monitors, desktop compositing
Now that dual monitor setup works, my Ubuntu install has almost all the features that my Vista install does: wireless networking, hardware acceleration for graphics, fancy Aero-like effects with Beryl, and multiple monitors. An extra convenience for dual-booting is that, because of GRUB, I can hibernate both OSes at the same time, allowing me to switch between them very quickly.
I haven't tried setting up Bluetooth on Ubuntu yet, so that'll be my next challenge.
2007-08-14
xkcd: Compiling
2007-08-12
SQL injection attack in the UN
For example, if you request:
http://www.un.org/apps/news/infocus/sgspeeches/statments_full.asp?statID=105;drop table sysobjects
then their server will actually execute the query "drop table sysobjects" against their database. Of course, the query won't succeed, since sysobjects is a protected table, but the potential for damage is incredible. The main issue is that they still haven't done anything about it.
2007-07-31
Geeky comics
Title: there's only like three doors on the first floor, and everyone on the third floor just gives you the runaround and sends you somewhere else. on the forth floor everything's your fault, and everyone on the fifth floor is a screwup. comedy!
Alt-text: ROOM 406 IS A MESS. 204 IS EMPTY. THERE ARE SEVERAL DOORS LABELED "300". WHY ARE YOU NOT LAUGHING.
Dinosaur Comics is great, second only to xkcd.
2007-07-25
My contact info
Milda mentioned she doesn't have my MSN address, so I'll just get it all done here:
- E-mail: ankurdave@gmail.com
- MSN (also an email address, but I never check it, so don't bother): ankur_dave@msn.com
- Phone: on second thought, I won't give that out arbitrarily.
- Website (this is effectively down currently, but might be up at the end of the summer. No guarantees)
- Slashdot
- Wikipedia
- Bookmarks
- Sourceforge (that's a programming website, btw)
Luckily for me, I can post these without fear of spam; Gmail's spam filter is the best I've ever seen: I've only gotten 2 spam emails in my Inbox since I started using it over 2 years ago.
2007-07-22
IM
Over time I think these kids will learn that in the real world where you're trying to get work done, IM is annoying as hell. It's like having someone call you on the phone every few seconds. No thanks.
E-mail, web forums, and other "delayed" forms of communication are so much better for almost everything.
IM is really only a substitute for the phone. And then only when it makes sense, like to save money on long distance or when you need to be quiet.
2007-07-21
Harry Potter 7
We also watched the movie (#5) starting at 9:00PM yesterday, and although others have criticized it, I was glad that it didn't try and fail to be like the book; rather, it deviated completely, allowing it to be enjoyable in its own right rather than always under the shadow of the book.
I'm not sleepy or tired at all after having not slept, but it's slightly hard to type because I keep making mistakes like typing "becoming" as "becomeing."
2007-07-18
Subversion and coding style
Windows permissions/account management
Gaah! OK...trying to calm down...
2007-07-12
2007-07-11
Dual monitors
I use the first one (my laptop's built in screen, 1920x1200, 17") for primary development (that is, actually writing code) and the second one (1280x1024, 17") for debugging/testing and reading documentation. Maybe I can get a third monitor* for reading Slashdot! :) Maybe I'll post a picture of my office.
*A third one probably wouldn't actually work because my laptop only has one graphics card. So unless I can get my hands on one of those external monitor-joining boxes, I'm limited to two.
AP tests
2007-07-10
Gravitating away from UI programming
2007-07-09
I get paid a lot!
2007-07-07
Vacation: IIT conference in Santa Clara, CA
2007-07-05
Per-process permissions
Hey, it's time for me to bring out my rant against current Unix/Windows permissions systems! Whee.
OK, here's the short version: it's good that files on modern OS have access restricted to certain users, but that's not nearly enough. Instead access to files should be further restricted by process so that eg. Firefox only has permission to read/write to its cache, bookmarks, and download folders and that's it. If you need to upload, it should be forced to use a common API to beg the user for permission to even view uploadable files. Why? Well, exactly to stop this sort of exploit where a trojan promises to do something useful, but actually searches (using fancy new Spotlight and Windows Search, no less!) for files called "my CC#s" to send back to the mothership.
In other words, I think we should Sandbox Everything.
Apparently, SE Linux is trying to do something like this, but OS vendors need to find a way to make this whole process seamless and easy, so that I can right click on an application, go to permissions, and say, "This program I will allow to read my home directory, but only write to its own directories; that one I will let write anywhere, but read only itself" and so on.
It will be really hard to implement this in a user friendly way, but it is clearly the necessary next step in computer security. Apple, Microsoft, and (consumer oriented) Linux devs should start working on this now.
2007-07-03
IIT 2007 Conference
2007-07-02
School schedule
Class | Teacher | Room |
---|---|---|
Math::Calculus::HL | Andrews | 2703 |
English::Junior | Calvert | 2608 |
Health/ToK | Perez/Becker | 1801/2704 |
ITGS | Cooney | 1808 |
Science::Physics | O'Byrne | 1708 |
History::America | Oliveira | 2705 |
French::4 | Collomb | 1628 |
2007-06-29
Programming fatigue
2007-06-28
Fourth day
There are lots of meetings on Mondays apparently, but almost none the rest of the week. Also, I'm legally required to take a 15-minute break every two hours since I'm a teen worker, so Nigel (my manager) keeps (half-jokingly) bugging me to take a break.
I've asked around and if I want to, I can switch to doing server-side programming in Ruby anytime I want to. I might do that after a month, so that I'll have spent half my time with the Flash frontend and half with the Ruby backend.
So yeah, it's pretty fun now, and I get paid to program!
2007-06-26
Second day
Seems like ActionScript is a blend of Java and Visual Basic. Java is a relatively OK language, but Visual Basic — ugh! For example, instead of declaring variables with the type first, then the name ("int foo"), ActionScript displays its braindeadness by using this: "var foo:int". Doesn't seem too bad, right? Well it is if you have to do it a lot.
Another area where ActionScript is almost as bad as a language like J# is documentation. There is a real lack of documentation available online, especially things like community discussions on how to do a certain task. This is probably either because most Flash developers are artists and so don't use ActionScript much, or because the whole Flash platform is proprietary.
Anyway, hopefully I'll start to like Flex more after I read some of the books I got on it. Unfortunately, struggling with Flex for 8 hours a day doesn't leave me too eager to read books on it after I come home.
2007-06-25
First day at work
Not much time to blog, but I'll give you a brief summary of my first day at work. SchoolSoft's codebase is really big and hard to understand. The inheritance hierarchy is very complex, almost nothing is formally documented, and it doesn't help that the Flex IDE is rather poor. On the positive side, I like version control (they use SVN). I exceeded expectations and made two tools.
So overall, I'm finding working in a real job environment to be mostly fun, although there is considerably more bureaucracy and "red tape" than solo coding or even what we did in Hunt the Wumpus.
2007-06-24
School's over
But anyway, I also have some projects that I'd like to do over the summer in my spare time:
- Set up our old computer downstairs as a dedicated server and not mess with it. Unfortunately, I probably won't be allowed to run Linux on it, so it'll have to be a Windows Vista server (ugh). And about not messing with it: just set it up and code. Don't try to optimize and tweak things — that was how I brought my other server down.
- Make an XML-based document format that I can use for all my documents: school assignments, notes, etc. Also make a way to transform that XML into lots of presentation formats: XHTML, LaTeX, plain text, maybe even Word 2007.