Archive for the ‘Computer Science’ Category

How the gym and Japanese made me a better developer

Posted on August 18th, 2011 in Computer Science, Opinion, Programming, tips | 2 Comments »

For the past ten years or so, even before I graduated from college, a large chunk of my spare time has been dedicated to studying. More specifically, it’s been dedicated to studying technology. Everything from programming languages I’ve wanted to use to new frameworks that look shiny and new to electronics and Arduinos and everything in between. I’ve spent lots of time and money reading up on anything tech. It’s really my passion. That’s why I got into Computer Science to begin with. I love this.

But after all those years, I’ve been getting burned out doing this. There’s just a lot of little things that lead to me feeling this way. The biggest reason, however, is the following: I’ve read and studied about a lot of cool things that I never got to do at my current day job, making it impossible to retain anything long-term and making me eventually lose interest. This would then spiral into me feeling guilty on spending so much time on something and not use it. To compensate, I would jump to some other tech-related book or project that excited me, only to have the same thing happen again. It was a vicious cycle that I hated and was desperate to get out of. But I didn’t want to dump tech at all. I love this stuff.

Finally, I decided to just hold back on all the new learning. I stopped buying books and trying to jump on the bandwagon of the latest hotness out on the streets. But that made me even more miserable. I felt like I was getting left behind. Like a drug junkie, I yearned to get my fix, even though I knew it was slowly killing me inside. So I had to focus on something else, far away from the things I’ve been doing for the past ten years. And oddly enough, shifting my focus away from tech was just what I needed to get my focus back on tech.

First off, I finally decided to go to a gym. Before last year, I had never stepped into a gym before in my life. Outside of walking around town or visiting a new park from time to time, I never really made an attempt to make physical activity a part of my routine. So at age 29, my electronic scale at home read 298.8 pounds, and a recent blood test showed my cholesterol levels a bit on the high side. I knew I had to do something. Since my current office is located right next door, literally, to a gym, I signed up and started going.

Going to the gym and exercising regularly has been by far the best decision I’ve ever made in my life. Outside of weight loss and other physiological benefits, I never really believed the mental benefits of exercising, but they’re very, very true. I feel much more alert during the day, up to the point where I don’t need a caffeine boost during the day. I also got much better at retaining new things I’ve learned. Work seems to come out effortlessly, and I think the quality of my code has gone noticeably up in the last couple of months, since I’ve been going to the gym more often. Finally, I’ve noticed myself in a much better mood every single day, with rarely any “bad hair days”, as I used to have periodically. Seeing the benefits of the hard work put at the gym helps with that a lot: Yesterday I weighed myself using the same scale that mockingly showed 298.8 over a year ago, and now it ready ’258.8′. Suck it, electronic scale.

Besides the gym, I wanted something else to focus on, but nothing related to technology. So I decided to take up learning a new language – a natural language, in particular, Japanese. I’m already fluent in English and Spanish, so I wanted to take something that was totally different, something not a Germanic or Romance language. I thought that Japanese was one of the most difficult languages outside of those groups, so I signed up for a class to feel challenged by something new. I’m about to finish my introductory class next week, and I loved it so much that I’m planning to stay at the language school for at least a full year, and then I’ll be taking a few weeks to actually visit Japan.

The thing is, since I’ve been spending a noticeable chunk of time with the gym and learning Japanese, I’ve noticed a surprising side-effect – I’ve been doing much better in the tech department. Taking time to study Japanese clears my mind and really energizes me, so when I go back to coding I put in a much better effort than I did before. And the physical and mental energy boost that the gym has given me helps me be able to learn and retain more than I ever did. It’s an awesome feeling, and I’m loving studying all over again.

As developers and engineers, our passion leads us to spend too much time on technology, but in the long haul that’s not sustainable. I’ve heard the phrase “sometimes we need to step back to be able to move forward” many, many times before. It’s totally true. Believe it.

My Quick Recap of MongoSF 2011

Posted on May 25th, 2011 in Computer Science, Conferences, Open Source, Opinion, Programming | No Comments »

Now that I live on the West Coast, I’ve been able to attend many of the wonderful tech conferences that are hosted in the Bay Area. Yesterday, I attended MongoSF in beautiful San Francisco. I’ve been using MongoDB for a while now, mostly for personal projects. I’ve written some projects on GitHub that uses MongoDB as the primary data store, and I have also migrated some existing MySQL tables in other projects to use MongoDB instead. Having read MongoDB: The Definitive Guide from front to back, and spending quite some time on the MongoDB docs, I feel like I have a good grasp on the tool. So I was pretty excited to go to this conference and discover some more things about my one of favorite pieces of tech.

There were multiple tracks in this conference, and unfortunately I still can’t clone myself in this day and age, so I’ll just briefly touch on those sessions that I was able to attend.

Monitoring & Queuing MongoDB: This talk, given by David Mytton from Server Density touched on some of the integrated monitoring tools and commands that MongoDB has baked in. He also showed a bit of Server Density’s MongoDB monitoring system, which looks to be incredibly useful. Overall, the talk was decent, but anyone who has MongoDB running in production should know most of this stuff already.

Evolving from relational to document store: Graham Tackley, lead for the web development team over at the U.K.’s Guardian news site, gave an interesting talk on how the site has evolved over time since the mid-90s (Lots of Perl / CGI goodness). Currently they are in the process of moving certain parts of the site to use MongoDB. Besides the history lesson on the site, he also mentioned how they are dealing with possible future changes in architecture, notably by building APIs around the site functionality. This talk got my gears running about some of my own projects, and how I might build any new projects I have in my mind.

MongoDB Profiling and Tuning: This talk was given by Kenny Gorman, who works as a data architect at Shutterfly. Kenny went through some of the steps used to profile MongoDB, like using explain() on your queries, and how to make things faster, not only on the software side, but also on hardware. He brought up Facebook’s Flashcache, and how it makes MongoDB speed up. I particularly enjoyed hearing the hardware side of things, as I feel like hardware is mostly overlooked by developers.

MongoDB’s New Aggregation Features – A Sneak Peek: Chris Westin is a core MongoDB contributor, and he gave us a sneak peek at a new framework for aggregating records in MongoDB. This framework is really not meant to replace Map/Reduce, which will still serve very well for massive data. But for people like me, who need to aggregate smaller amounts of data (thousands of documents instead of millions), this will be much easier and faster to deal with. Very cool stuff, and I can’t wait to use it.

Lessons Learned from Migrating 2+ Billion Documents at Craigslist: Former Yahoo! and current Craigslist employee Jeremy Zawodny spoke about how Craigslist is using MongoDB for their posting archive, and the lessons learned along the way, like the usage of replica sets even in development, document encoding, and how important data types are when migrating collections. He had a similar talk at MongoSV a few months ago, so I didn’t feel like there wasn’t much new information here. Still, a good talk about migrating a large amount of data from MySQL to MongoDB – it can be done.

Practical Scaling and Sharding: Eliot Horowitz is one of the main MongoDB contributors, and the CTO of the company that backs MongoDB, 10gen. He went through the features and usage of Replica Sets and Sharding, with a few use cases and live examples. This seemed more like an introductory talk more than anything else, so there was nothing groundbreaking here.

MongoDB at Foursquare: This talk was given by Jorge Ortiz, an engineer at Foursquare, who proceeded to mention briefly how MongoDB was being used at Foursquare, some of the lessons they’ve learned throughout the years with MongoDB, and talked about their Scala library for querying MongoDB called Rogue. Frankly, I was disappointed with this talk, as Jorge didn’t give much insight outside of a few numbers and oft-repeated tips. I was expecting a more informative talk here.

Indexing & Query Optimization: Alvin Richards, a West Coast 10gen employee, gave an in-depth talk about indexes in MongoDB. He went through everything, from basic indexes, to indexing order, to new indexing options in MongoDB 1.8 (sparse indexes and covered indexes), to even showing representations of the internal B-Tree implementation. Very informative.

Lightning Talks: This was divided in three shorter talks. First up was Michael Goff, who spoke about how his company, Cocoafish uses MongoDB to serve up data to mobile apps. Next was Chris Carrier (Is he on Twitter? I couldn’t find an account to link here) from Zuberance, speaking about how to create a reporting backend using MongoDB. Last, but not least, was Chad Arimura, who went through SimpleWorker, a cloud-based job scheduling service that uses MongoDB. These talks were short – which you might have figured out with ‘Lightning’ in the title – and seemed to be mostly about the speakers’ particular sites more than anything else.

At the end, Eliot Horowitz gave a quick rundown on the upcoming features for MongoDB 2.0, like TTL collections, online data compaction, faster Map/Reduce, etc. Surprisingly, this 2.0 release is scheduled for June 2011, as in next month. Seems like they’re going to be doing quicker iterations and getting new stuff out there as soon as possible, which can only lead to good stuff for users. There was an after-party, but when I swung by the place there was a massive line outside to get in, so I decided to head home instead. Unfortunately, this is the third time in as many conference after-parties that I’ve had to do this, so it seems like these after-parties don’t scale well.

Overall, while the conference was pretty good, and everything was organized very well, most of the times I felt like I was out of place or at the wrong talk. Judging from the few people I spoke to, and those that I overheard, it seems like most people at the conference hadn’t used MongoDB much (or at all), and many talked I went to touched on what I consider some of the basics of MongoDB. Even if they weren’t basic topics, like Replica Sets or Sharding, if you have read a recent MongoDB book, you knew what most of the speakers were talking about. Also, there was plenty of repeating of the same tips over and over again in a lot of the talks. For example, in the nine talks I went to, the speaker mentioned the “always keep indexes in memory” rule of thumb in at least five of those talks. Truth be told, MongoDB isn’t really a super-deep technology (even the aforementioned O’Reilly book clocks in at a bit north of 200 pages), so this can be the reason why. But I wanted to know more on the upcoming features in MongoDB (I only really saw one talk in the schedule like this, which was the new aggregation framework), and some more in-depth views of how companies are leveraging MongoDB in their technology stack instead of just pointing out how awesome MongoDB is – which we already know.

In any case, I had tons of fun, learned some new tips and tricks, and got some fresh inspiration to use in my own work soon. The best thing about these conferences is knowing that what you’re learning and using is valuable not just to you, but to many out there, and it just gives you motivation to keep on using those tools in familiar and new ways. Much props go out to 10gen for making this conference go smoothly, and hopefully there’s another one of these sometime next year.

No Rest For The Unemployed

Posted on January 26th, 2010 in Books, Computer Science, Databases, Linux, Mac, Open Source, Opinion, Programming, Ruby, Ruby On Rails, tips | 2 Comments »

After two years, yesterday was my final day of being a developer for BarterQuest. As anyone living in expensive New York City in the same situation, I have been focusing part of my energy looking for a new gig. I’m pretty confident, despite the current economy, that I will land on my feet sooner rather than later. I have a few leads, with one in particular that I am really hoping will come through.

In the meantime, I’m not just throwing my resumé in the face of companies everywhere in the U.S. I have also decided that since now that I have quite a few extra hours in my days, I should really do productive things instead of sitting on my couch and re-watching all previous seasons of 24 (believe me, I would watch all 7 seasons in a row if I could) or jamming away to Guitar Hero. This is a perfect chance to do lots of technical things I’ve been wanting to do for months, but just never got the time to do so. Here’s a short list of some goals I’d like to get started on.

Learning new stuff

For the past two years, I’ve been exclusively using Ruby and Ruby on Rails at my day job. I’ve always wanted to broaden my skills by doing other types of programming, but when you take into consideration that I would usually be at work more between 9-10 hours per day, plus a commute that would sap an additional two hours, there wasn’t much time for me to be able to do personal things, let along learn new stuff. Now that I’m finally free, I can now spend more time with those things I’ve wanted to experiment with.

I’ve always wanted to learn iPhone application development. I know the basics of Objective-C, and have the book iPhone SDK Development by Bill Dudney, but I was never able to sit down and code something up. I have a few ideas for apps, so even if I can make a simple app that’s accepted to Apple’s App Store will be an achievement for me.

I’ve been very interested in implementing Push technology to web apps, like Comet or Web Sockets, using nginx’s Push Module and Orbited.

Although I’ve never had the opportunity to work with extremely large data sets, I’ve always been curious about frameworks like