Testing Windows 7 on a MacBook Pro

Posted on June 13th, 2009 in Guide, Reviews, Software, Windows | Comments

I had some time to spare during the weekend, so I decided to have some fun with my MacBook Pro. Now, I’ve been more or less full-time Mac user for the past year (I use Ubuntu Linux from time to time, though) ever since I could afford getting a Mac. Yes, Macs are expensive, but totally worth every dollar, in my humble opinion. But I digress.

In any case, I also stopped using Windows because of all the issues surrounding Vista. While there have been people who say that there’s nothing wrong with the operating system, in the time I’ve used it I found it extremely slow on a computer with more-than-decent hardware and experienced constant lock-ups and crashes. It might work fine for some people, but it never was the case for me.

Lately, I’ve been hearing more and more about Microsoft’s next operating system release, dubbed Windows 7. In a totally welcome change of pace for the company, Microsoft has allowed any user, not just developers or OEMs, to be able to download and test beta versions of the operating system. Everywhere I go on the Internet, people have only great things to say about it – essentially that it’s faster and more stable, even in its pre-release state.

As always, the curiosity is killing me, so I decided to take the latest release for a spin. I have plenty of free space on my MacBook Pro, so I decided to use Apple Bootcamp to test this out. Here’s an outline of the steps I took to successfully install Windows 7:

1) You can start off my downloading WIndows 7. At the time of this writing, Microsoft is offering users to test out the first Release Candidate for Windows 7 (stated for official release on October, 2009). When downloading, you have the opportunity to choose to download Windows for 32-bit architectures or 64-bit architectures. Since this post is for installing Windows 7 on a MacBook Pro, I chose to download the 64-bit version, although the 32-bit version should work just fine. Keep in mind that you’ll need a high-speed connection and a DVD burner, since the DVD image is approximately 3.05 GB.

By the way, when you download the DVD image, there will be a product key for Windows 7. Write this down, because you’ll be asked to enter it to activate Windows during the final steps of the installation process. Don’t worry if you forget – You’ll still be able to install Windows properly and activate it at a later date. But it’s just easier to do it from the beginning. Also, make sure you have your Mac OS X Installation Disc on hand. When Windows is installed, you’ll need to install the proper drivers for your hardware, and the Mac installation disc has them readily available.

2) Once you get the image downloaded and burned onto a blank DVD, you’ll need to partition your hard drive and create some space for Windows. I explained this in an earlier post, but I’ll just post it here since it’s slightly different. If you have Mac OS X 10.5 (Leopard) installed, you can use the Boot Camp Assistant to create a partition. Unfortunately, at this time, you won’t be able to use Boot Camp if your Mac is running Mac OS X 10.4 or an older version.

When starting the Boot Camp Assistant, you will be asked to specify the size for your new partition. For the 64-bit version of Windows 7, the minimum requirements are to have at least 20 GB of free hard drive space. I recomment using at least 30 GB of free hard drive space, since you’ll most likely want to install and test out some Windows software. Once the partitioning is completed, the Boot Camp Assistant will ask if you would like to restart to begin installing your new operating system. Before clicking on the ‘Start Installation’ button, insert your newly-burned DVD of Windows 7. Once the DVD has been detected on your Mac (the DVD icon of the mounted drive should appear on your desktop), click on the ‘Start Installation’ button. The Mac will restart, and will boot from the DVD and start the installation process.

3) Installation is a fairly easy process. Over the years, Windows has streamlined the installation process of their operating systems, and it seems Windows 7 is the easiest one yet. The only small issue you need to look out for is that while the hard drive was partitioned properly, it wasn’t formatted for Windows 7 (specifically, NTFS). It’s fairly easy to correct this, though.

When you get to the section where all your computer’s drives are displayed, you’ll notice one labeled ‘BOOTCAMP’. This is the one the Boot Camp Assistant conveniently created for you. When you click on this drive, you’ll notice a message saying that Windows can’t be installed on that drive, before of the aforementioned issue. To correct this, click on ‘Drive Options’ after selecting the partition. There will be multiple options for you. Simply click on ‘Format’ to format the disk properly. Once this step is done, you can click ‘Next’ to install the operating system to the partition.

4) Please note that during the Windows installation process, your computer will be rebooted a few times. When your computer reboots, it won’t boot back to Windows automatically. Instead, it will boot back into Mac OS X. To be able to choose which partition you want to boot from, you need to press and hold the Option key before the Apple boot screen appears. This will them display all bootable partitions on your Mac. You should have one for your Mac OS X installation, and another for WIndows. Choose the Windows partition and hit the ‘Return’ key to boot back into Windows. Remember to keep an eye out while Windows is installing, or else you’ll find yourself rebooting from Mac OS X constantly.

5) Once Windows is installed, you’ll notice that the resolution is pretty crappy. This is because you have to install the drivers for the video card and other hardware in your Mac. This is where the Mac OS X installation disc comes in handy. Eject the Windows 7 DVD from your drive. In my MacBook Pro, I couldn’t get the DVD to eject by pressing on the Eject button on the keyboard. I was able to eject the disc by going to ‘Computer’ from the Windows menu, clicking once on the DVD, and then selecting ‘Eject’ from the toolbar.

Insert the Mac OS X installation disc into your computer. You should get a message asking to auto-run the setup program from the disc. Do not run this, as it will install the 32-bit drivers. Instead, go to the Windows menu, select ‘Run’, and enter D:\Boot Camp\Apple in the field and click ‘OK’. There should be an executable file called Bootcamp64.msi in the directory. Double-click this file, and the drivers installation process should start automatically. After they’re installed and your computer reboots, you’ll have a fully-functional Windows 7 installation on your MacBook Pro!

This might seem to be a long process, but I think I’m just being too verbose in writing. It really is a short, straight-forward process. As I mentioned above, the installation process is fairly easy. Although I’m guessing that most Windows users won’t go through this process, as they’ll most likely already have it installed on any new computers they purchase. But for those who actually have some fun doing the whole installation thing, it really couldn’t get easier than the Windows 7 installation.

As far as the actual operating system goes, it does seem faster and much more stable than its predecessor. In the couple of hours I spent today using the operating system (and typing this blog post, as well), I didn’t encounter a single problem. I also installed quite a lot of software, and they all ran without a hitch. So far, so good.

I don’t have any official numbers here, but I’m willing to bet that while Microsoft still has the dominant share of the operating system market, it has lost more than a few percentage points. Although that didn’t happen solely because of Vista, I know more than a fair share of people who have dumped Vista for alternatives, with many more downgrading to Windows XP. Windows 7 feels like it’s a step in the right direction for Microsoft. I just wonder if Apple will be able to continue to run those snarky ads for long.

Installing Ubuntu 9.04 on a Mac Mini

Posted on May 25th, 2009 in Linux, Mac, Open Source, Software | Comments

Ever since I bought my MacBook Pro a few months ago, my poor ol’ Mac Mini has been alone and lonely. I really didn’t have much use for it, since I transferred all important work files to my new laptop. So what would I do with it? That’s when Ubuntu 9.04 was released. Back when I was in Puerto Rico, I would always get excited when a new release of my favorite Linux distributions (Fedora, Debian, Slackware and Ubuntu) was announced. It had been a while since I gave one of these new releases a test drive. It would also give me a chance to use my Mac Mini as a server, where I can test some new software that I’ve been wanting to check out for a while.

The Mac Mini seems like a good, cheap alternative for a server if you have one lying around unused. These machines are pretty quiet, consume low amounts of energy and are fast enough for most server tasks. Here were the steps I took to get a fully-functional Ubuntu Server installation on my Mac Mini. As a side-note, my Mac Mini is a Mac Mini Core 2 (1.83 GHz) with 1 GB of RAM and an 80 GB hard drive.

1) Download the Ubuntu Server disc image and burn it to a CD. I chose downloading via BitTorrent. Also, I downloaded the 64-bit version (torrent filename: ubuntu-9.04-server-amd64.iso.torrent), although the 32-bit version should work just fine. Make sure you seed for a while after you download your disc image!

2) You will need to partition your Mac Mini hard drive, to create some space for the Ubuntu installation. If your Mac Mini has Mac OS X 10.5 (Leopard), you can use the Boot Camp Assistant to create a partition. Unfortunately, you won’t be able to use Boot Camp if your Mac Mini is running Mac OS X 10.4 or an older version. When starting the Boot Camp Assistant, you will be asked to specify the size for your new partition. You’ll need at least 10 GB of free space in your hard drive to do this. Depending on how much hard drive space you have available, create a partition. Once completed, the Boot Camp Assistant will ask if you would like to restart to begin installing your new operating system. Don’t do this just yet. Quit the Boot Camp Assistant.

Note: I was having problems creating a partition, even though I had plenty of free space on my hard drive. The reason was because my hard drive was apparently too fragmented, and there were some files that couldn’t be moved to create the new partition. Since I have a 500 GB external drive and use Time Machine to back everything up, I decided it would be best to just do a clean install of Mac OS X 10.5. Once Leopard was installed, I created the new partition using Boot Camp Assistant without any problems.

3) Before restarting your Mac Mini, you will need to install a boot manager called rEFIt. rEFIt will help install Ubuntu easily, and makes selecting between Mac OS X and Linux after installation a breeze. To install rEFIt, download the Mac disk image (.dmg) file. Once the image is mounted, install the boot manager by executing the rEFIt.mpkg file. After installation, to make sure the boot manager was properly installed, there should be a directory named /efi in the root directory of your system. Open the Terminal application on your Mac Mini, and execute the following commands to properly install the boot manager (You will be prompted for your password):


cd /efi/refit
./enable-always.sh

4) After rEFIt is installed, insert the Ubuntu Server CD you created and restart your Mac Mini. When rebooting, you’ll immediately notice the rEFIt boot manager screen. This boot manager should recognize the Ubuntu Server CD (marking it with the ubiquitous Linux penguin logo). Select this option, and the Ubuntu installation process should begin.

5) Installing Ubuntu is beyond the scope of this post, but it’s pretty easy to install if you have never done it before. Don’t be intimidated by the command-line look of the installation process! Just following the instructions and everything should be installed in no time. There were a few things I had to do differently in my case:

  • When the Ubuntu partitioner starts, it will show all available partitions in the hard drive, including the partition for Mac OS X. You’ll recognize the difference between the Mac OS X partition and the one you created using the Boot Camp Assistant by looking at the format of the partition (Mac OS X uses the HFS format, while the one you created is using the FAT32 format). Since I wanted to use a different format for this partition (ext3), I selected the FAT32 partition and deleted it. Once deleted, you’ll see ‘Free Space’ where your partition used to be. Select the free space, and the partitioner should ask if you want to let it create the necessary partitions. This is the easiest way to set up your new partition for Ubuntu.
  • After installing the operating system, the Ubuntu installer will ask where you want to install its boot manager, GRUB. Since we don’t want to over-write rEFIt that’s install on the drive’s Master Boot Record, we need to install the GRUB boot manager in the boot record of the new partition. So where the installer prompts you to write the location where GRUB should be installed, write hd(0,2), which is the location of the new partition (provided you only have the Mac OS X partition and the new Linux partition).

6) If everything went smoothly, your Mac Mini will eject the CD and reboot. rEFIt will be on display once again, this time letting you choose to boot Mac OS X or Linux. Select Linux, and after all of Ubuntu’s processes start, you’ll be presented with a prompt. Congratulations, you have Ubuntu 9.04 installed in your Mac Mini!

I’m sure that installing any other Linux distribution will be more or less the same. Keep in mind that since I installed the server edition of Ubuntu (command-line only), I have no idea if video, sound, wireless connectivity (I connected my Mac Mini to my router using a Cat-6 cable) or other things will work properly in a Mac Mini. I’m sure the Ubuntu community (and the Linux community in general) have solved most common issues by now. If I install a different Linux distribution using a GUI, I’ll write about it and let everybody know.

Take The Risk – It’s Totally Worth It

Posted on March 11th, 2009 in Opinion | Comments

The following post is something I sent a friend who’s still works at my former workplace. She was feeling a bit down due to the circumstances that have been happening there (and that I know all too well), so I offered her this piece of advice. This really isn’t technology related or anything, but it’s something I wanted to post to keep on my blog, to remind myself whenever I feel stuck in my life.

You’ve been there much longer than I was, and you know better than I that nothing will ever change. When I left, I was obviously happy, but I still felt a bit bad for those who stayed behind. But as I think about it, the people who have stayed are usually because of their own choice. It might sound cruel, and it’s not my intention to make it sound like I’m a heartless bastard, but usually people are in negative situations because of themselves, because they don’t do anything about it.

I spent the better part of 2007 doing everything I could to find a new job – I would learn new things related to my field, I would scour job sites, looking for jobs that sounded better than my current situation at the time, I would send resumes all over the place. It takes a while, and you get pretty damn frustrated when you get interviewed by companies and never hear back from them. But I’m a firm believer that if you want something and you work for it, eventually everything falls into place.

I want you to take a moment and honestly assess yourself. Have you done anything to improve your current work situation? If not, why haven’t you done anything? Are those situations really impeding your ability to move on to something better, or are they just excuses for procrastinating? On the same note, if you are doing something to try to make things better, are you giving it your all? You’ll need to really want something to have a good chance at getting it.

I tell you these things because for a while I was pissed off because things didn’t get better. In reality, they weren’t getting better because while I thought I was trying to make things better, I really wasn’t doing much to improve anything. Sometimes you need to take a good, long, hard look at yourself to find what’s wrong. Only then can you begin to take steps to cure everything.

Hopefully you don’t take this message the wrong way. I got nothing but love for you, and I’m truly happier when someone is doing awesome than when I do well myself. I want to see my friends succeed even more than I do. So I hope you’ll be able to do so. And if you need help, then what the hell am I here for?

The above post truly reflected my life a few years back. I was miserable, feeling stuck in a job with no opportunity to shine or do anything worthwhile. But I realized I really wasn’t doing anything to help my situation. So it was pretty stupid of me to be angry at the world when it was really my fault. Once I realized that and got my ass back on track, things started falling into place.

This whole mindset I sent my friend was due to a book that was recommended to me, called The Ultimate Secret to Getting Absolutely Everything You Want. I admit, I’m pretty skeptical about these types of books, but Mike Hernacki (the author) kept this secret as simple as possible. It all boils down to one thing: If you want something, you must be willing to do whatever it takes to accomplish it. That’s it. Simple, isn’t it? And it’s so true. People are so afraid to take risks, that opportunities pass them by when they could’ve reached out and taken control of what they wanted.

I’m pretty happy at this moment in my life. But if the need ever arises to find change, I know what to do. I hope my friend does too.

What Have I Been Up To?

Posted on March 6th, 2009 in Books, Databases, Mac, Open Source, Opinion, Programming, Ruby On Rails | Comments

It’s been quite a while since I last updated this blog. I should seriously start writing more often. So, what have I been up to? With the cold weather here in New York City, it gets difficult sometimes to go out and have fun in the city. As usual, most of my time is spent on technology, software development, stuff like that. Here’s a brief recap of what I’ve been working on:

Got a new MacBook Pro, and I love it – I finally gave in and bought myself a shiny new MacBook Pro. I’m having a blast with it. For the open-source developer in me, this has everything I could ever want. It’s a beautiful and sleek machine that has gotten me highly motivated to start expanding my knowledge in different directions. While I still consider these laptops to be pricey, they’re really great.

Learning Objective-C for Mac and iPhone development – Since I got a nice Mac, I figured I should start learning Objective-C, then eventually get into Cocoa and the iPhone SDK. I’ve always been impressed by some nicely-done open-source Mac applications, and iPhone apps have always seemed to be so creative, so I wanted to learn how to build some myself. Since I’ve been working for so many years on dynamically typed languages (like PHP and Ruby), it’s kind of a total change of pace to go back to a somewhat-statically typed language like Objective-C. It’s been a bit of a challenge, since I last used a C-based language back in my college days. But it’s going along well so far.

I’ve compiled quite a few resources for learning all of these things. I recently purchased a book called Programming In Objective-C, which seems like the de-facto book on Objective-C, as it’s pretty extensive..And there are a few good screencasts – PeepCode developed a screencast dubbed Objective-C for Rubyists, and The Pragmatic Programmers have a screencast series by Bill Dudney called Coding in Objective-C. Of course, Apple has done a fine job with their Objective-C documentation. All of these resources should get you coding in Objective-C in no time.

The iPhone development part is mostly being learned because at my day job we would like to create a nice iPhone app for users of our site. I truly think that a mobile interface will expand our user base easily, even if people say they don’t really use mobile interfaces for a lot of things. I find myself using Facebook and Amazon’s iPhone apps more than I visit their sites.

BarterQuest is getting better and better – It’s been a wild ride on BarterQuest since we launched. We’ve been featured all over the place, from blogs to television shows, and we’re getting more and more users visiting, registering and trading on our site every single day. I’ve even traded twice already, and everything has gone as smoothly as it possibly could. It’s a great way to get the stuff you want by getting rid of the stuff you don’t want.

If you haven’t checked out our site yet, or haven’t done so in a while, I highly recommend you visit us soon. We’re going to be adding support for Real Estate in a few weeks, so our range of tradable items will greatly expand. And stay up to date with all that we’re doing by following us on Twitter.

Learning (and liking) CouchDB – My curiosity with CouchDB started when people were mentioning it quite a bit, and some Rails libraries like CouchRest were gaining some attention. So I checked it out for the first time, and I had no freakin’ clue why someone would use document-oriented databases, when relational databases did just fine.

Then a week I was working on a side project, and when trying to design my classes, I noticed that I would either have to denormalize my database tables, or be strict with normalization, but have a rather messy database schema. Then it just hit me – I finally knew the reason why CouchDB would rock in this scenario, where the data I was storing wouldn’t always follow the same structure. So I got into it, and I’m really liking it a whole lot. It’s something different, yet really useful in some situations. Seeing that there’s a market for databases like these, like Amazon SimpleDB, it seems like CouchDB (and document-oriented databases in general) will gain much popularity in the foreseeable future.

These are just a few things I’m playing along with. It seems like there are a lot of fun times ahead in software development and computing in general. I’m just happy to be able to ride the wave.

Goodbye, Digg and Reddit – Hello, Hacker News

Posted on January 27th, 2009 in Opinion, Sites | Comments

For the past few years, I’ve more or less kept the same RSS feeds in my reader for all that time – TechCrunch, Signal Vs. Noise, Seth Godin’s Blog and Penny Arcade. I also have a lot of smaller, niche blogs that either don’t provide me with much information anymore (sorry, Slashdot) or that are rarely updated (just like this one!), but those don’t stay too long. The ones I mentioned here are feeds that will stay with me until the day I die. Or until something much better than RSS feeds are created, whichever comes first.

Two other sites which I considered staples of my feed reader were Digg and Reddit. I was seriously addicted to these two sites a few years ago. I would go home after work and just read post after post of their front pages, without skipping a single one. If you have followed these sites, you know that over the course of 12 hours, a lot of news can appear on these sites. However, these past couple of months, I noticed I was just skimming the articles on these sites, and sometimes even just marking them all as read. It got to the point that it was just easier to delete these two RSS feeds from my reader, after around three years with them. So, why did I have to part with my beloved RSS feeds?

Well, both Digg and Reddit display user-generated content, meaning that anyone submits an article, people vote it up, and if it gets enough votes it’ll show on their main page, with thousands and thousands of people viewing it. At first, this was pretty damn cool – A lot of neat news and sites were introduced to me via these sites. However, with great popularity, it starts to attract a lot of new users. Apparently, a lot of these new users are prepubescent teens who don’t provide much content to begin with. It just started to become asinine post after asinine post, most of it which left me scratching my head and thinking “How the hell did this get voted up?”

Both Digg and Reddit had different ’straws’ that broke the proverbial camel’s back. For Digg, my issue became the posts that were being voted up on the main page. As of right now, Digg’s front page has links ranging from lame pictures to videos of basketball players head kissing to ‘Tips on surviving the World’s Weirdest Mexican Restaurant’. If I were 15 years old, I would be click on the ‘digg it’ button all day long! Nowadays, I don’t find it amusing at all. I also tried subscribing to other sub-categories of Digg, like Technology, but most of the posts didn’t grab my interest either.

For Reddit, the same issue happened when I subscribed to their front page. However, I thought I had found bliss when I subscribed to their Programming section. The posted linked were usually good. However, what turned me off about this service were the actual users. Or rather, their comments that were posted for each link. In most cases, it seems like everyone wants to be a comedian, and the norm of posting comments was just limited to one-liners. Not quite what I expected out of a group with programming and technology topics. It even made me not want to contribute to any discussion or submitting links.

Thankfully, I discovered Hacker News. This is just what I was looking for – an awesome news site, with the topics that interest programmers, with actual intelligent discussion between its users! The topics that are promoted on their main page are not the failed attempts to be funny like Digg’s links, and the comments are very thought-provoking and encourage discussion. I’ve made more comments in Hacker News in the past two weeks than I did in Digg and Reddit in the past year, perhaps even longer than that.

If you’re developer like me, who’s yearning to be educated and talk it over with like-minded people like yourself, you’ll be doing yourself a favor by heading over to Hacker News and joining in.

Check out my other blog – RubyEveryday.com

Posted on January 13th, 2009 in Announcements, Ruby, Ruby On Rails | Comments

Note: Unfortunately, due to some lack of time, plus a large amount of spam comments being targeted at that site, I decided to take it down. Hopefully in the near future I’ll be able to continue this small side-project.

I recently deployed a small Rails app I built in a weekend, called RubyEveryday. In it, I’m posting one article a day about any Ruby-related news, whether it be current news or some code snippets of work I’ve done. My goal is to have it updated every single day, so it should be relatively fresh. Go check it out now, and follow the site’s updates on Twitter. Oh, and don’t forget to follow me on Twitter, too.

Don’t worry, I’m not shutting this blog yet. This will continue to be my main writing source for whatever is on my mind in the techology world, so keep an eye out for new stuff coming your way soon.

Fatten Up Those Error Pages For Internet Explorer 6.0

Posted on December 5th, 2008 in Programming, Web Development, tips | Comments

One of the not-so-joyous moments of being a web developer is the fact that we still need to support browsers that are ancient (by technological standards). Specifically, I’m talking about Internet Explorer 6.0. A quick look at the site statistics of one of the major websites I’m currently working on says that 16.9% of users visited our site using Internet Explorer 6.0. That’s obviously not the majority – Internet Explorer 7.0 takes that honor with 38.4%, followed by Firefox 3.0 with 19.8%. But it’s still a large enough number for the higher-ups to decide not to ignore it.

Since I never, ever use Internet Explorer 6.0 for any regular browsing (and you shouldn’t, either – read why on sites like Browse Happy), this past week I decided to give the site a test run with Internet Explorer 6.0 (using IEs 4 Linux). Besides the frustration of finding some incompatibilities with standard CSS on this browser, everything else seemed to work well. I then triggered an error on purpose, just to make sure our error handling would be handled properly (display our custom 404 error page instead of a nasty -yet customized – 500 error page). To my surprise, Internet Explorer 6.0 decided to render its own friendly error page instead of our custom one.

Thinking one of my colleagues removed it for whatever reason, I fired up Firefox and triggered the same error. The custom 404 page appeared correctly. Heading over to a Windows laptop, I had the custom error page on all browsers, including Internet Explorer 7.0. This left me scratching my head for a while. Although I’m already used to Internet Explorer 6.0 to act in different ways, standards be damned, this act seemed to be stupefying.

I was about to give up, thinking that Internet Explorer 6.0 used to hijack everyone’s custom error page just to hawk their own, I did a search on 404 error pages. Lo and behold, Wikipedia came through with a response that I would have never guessed:

Internet Explorer (before Internet Explorer 7), however, will not display custom pages unless they are larger than 512 bytes, opting to instead display a “friendly” error page.

Wow. Who knew that size mattered? On a custom error page, of course.

Our custom 404 was basically just a regular HTML with the standard tags, and one image and it weighed less than 300 bytes. I couldn’t modify the design or anything, so I just padded the error page with a long, boring and senseless comment, explaining why said comment was there. After ‘fattening up’ the file to more than 512 bytes, the error page started appearing on Internet Explorer 6.0.

It turns out that older versions of Internet Explorer had a threshold value in the registry which decided whether to display their own error page or a custom one. Why? I have no idea. Thankfully that was fixed for recent versions. But for all of the unlucky ones who still have to support ancient technology, this is another special Internet Explorer 6.0 quirk that needs to be taken into consideration.

For more information, including the default size limitations for other error pages, read this site (aptly named ‘404-error-pages.com’) has all the information you need.

Don’t Waste Your Time On Me – Worry About Yourself

Posted on November 8th, 2008 in Funny Stuff, Opinion | Comments

Yesterday morning, someone posted a comment on a post I wrote at the blog of the company I work for. This person, named ‘Tom’, said that our site was filled with lies, and that we had false advertising all over the place. Of course, I don’t get angry about negative feedback, and you shouldn’t either. I politely reply to the comment on the blog, letting this person know that we apologized for any misunderstanding, that what we claim on our site is true, and provided our support E-Mail address in case he has any questions or inquiries. We’re more than happy to listen to what people have to say. Well, Tom replies a while later saying that it’s “not my job to make sure your advertising is true.” Well, obviously he doesn’t want to open any sort of dialog with us.

I show this to my boss, and we started looking around. Obviously, we look into our site, using the IP address from where the blog comments originated from. We notice that there’s a user who registered to our site, named ‘Lucy’, registered with an E-Mail address different to the one used to leave the blog comment. It was a free Gmail address, and of course, the IP address could be the gateway address for a larger company. But we decide to continue looking on, with the E-Mail address of the registered user in hand.

Upon further sleuthing, we notice this person has left comments on blogs and newsgroups, under different names but mostly using one name, Mark, more than the others. He was also touting a particular site in all of his other posts. When searching for the name we found, it turns the perpetrator who left the negative comment on our site: the co-founder – and now VP of marketing – of a competing site. We decided to leave it there, since it’s obvious by his comments left on our blog that this person is trying to hurt us. Plus, it’s hilarious that our sleuthing was sort of akin to a South Park episode, where the boys discover some criminals by searching all major Web 2.0 sites.

I can’t help but laugh at this turn of events. I mean, here you have a co-founder of a competitor, and instead of focusing on how to actually make his product better than ours, he decides to take a stab at others who are competing with him, apparently in hopes of inflicting some damage. To make matters worse, he does it under different guises. To be honest, if this person came forward from the get-go and told us he was from that competing site, and that he thought our site was misleading in any way, I would’ve been happy to open the lines of communication towards him. I’m sure we both would’ve gotten something positive out of it.

I’m not saying that you should be totally oblivious to your competition. Like the saying goes: Keep your friends close, and your enemies closer. You need to know what others are doing, so you can get a leg up on them, do things they’re not doing and make yourself better. That’s the point of having and running a business. But to spend actual time making baseless comments to the competition leads nowhere. Even worse, it makes you seem afraid and desperate to even consider attempting such stunts. And we’re not even close to mentioning something called “professionalism”, which this person seems to be seriously lacking.

I can offer some bits of advice from all of this. Make sure you know who you’re competing against, but don’t spend your time on them. Spend your time where it matters the most: your product. If you’re sure of yourself and the work you’re doing, then you shouldn’t worry at all about someone else. And even if someone is doing better than you, instead of wasting time and energy worrying about someone else, take it and make yourself better. Like I’ve heard before, “A dog in desperation will leap over a wall.”

Want To Learn About Rails 2.2? Get The Envycast and PDF

Posted on November 2nd, 2008 in Programming, Reviews, Ruby On Rails | Comments

A couple of weeks ago, I wrote a short post about the first Envycast released by the guys over at Rails Envy. I really enjoyed their first foray in the world of screencasting, so I was looking forward to see what else they would offer us in the future.

With the imminent release of Rails 2.2 (Release Candidate 1 was announced last week), it makes complete sense that the new Envycast would focus on Rails 2.2. In the Ruby on Rails 2.2 Screencast, Gregg Pollack and Jason Seifer talk about all the goodies that have been included in Rails for our use. Even if you’re currently subscribed to Ryan Daigle’s blog and follow the Rails commit history, it’s still nice to have everything in one easily accessible place. While an Envycast in itself should be awesome, they decided to also have a PDF available, detailing all of these changes.

Screencast

Clocking in at 44 minutes, this screencast takes you through the changes in Rails, divided by component (ActiveRecord, ActiveSupport, ActionPack, ActionController, Railties) and specific topics (Internationalization and Performance). Like the first Envycast, all the action (well, as much ‘action’ as you can get in a Rails screencast) is done in front of a green screen, with either Gregg or Jason explaining what’s on the screen. As I mentioned previously, this gives the screencast a nice, personal feel, making the learning (and retaining the information) experience enjoyable and much easier – at least to me – than other screencasts. The infused humor also helps a lot with the learning process, making you feel comfortable and in a relaxed setting, which is key for learning new stuff.

Considering all the changes that have occurred in the six months between Rails 2.1 and Rails 2.2, this screencast does a good job in explaining all the new stuff. Although it doesn’t go too much into detail with some new features (thankfully so – I prefer short and simple, just like my Ruby and my Rails), my major gripe with this screencast is the lack of more detailed explanation on one major feature I (and I’m sure hordes of other Rails developers) was looking forward to: Internationalization. While I do understand this would need sufficient time to explain this new feature properly, I thought this was too big of a feature to just briefly touch on. They do encourage viewers who want to learn more to download and play with the Internationalization Demo App that was created just for this purpose.

Besides that, Gregg and Jason do an awesome job with this screencast. They explain these new features really well, make good use of the green screen (well, besides dodging pigeons and running away from Godzilla – trust me, you’ll see when you get this screencast) There were many “Whoa, I’m so going to use that in my next project!” moments for me, which for some reason didn’t happen when I read about these changes in Ryan Daigle’s blog.

After my short review of the first Envycast and liking it a lot, I was anxious to see if the Rails Envy crew would continue along these lines. I’m glad to see that they still produced a great screencast that’s easy to learn from and fun to watch.

PDF

Like I mentioned, they not only released a screencast on Rails 2.2, they also released a PDF to complement the screencast. The Ruby on Rails 2.2 PDF was written by Carlos Brando, a Portuguese Rails Core contributor who also wrote a similar (and excellent) e-book on Rails 2.1.

While the screencast goes over the new features in Rails 2.2 briefly, the PDF goes more into detail, with explanations and code examples throughout the book. There’s even an entire chapter on Internationalization, compensating for the lack of explanation in the screencast. At 118 pages (of which 86 are in-depth explanations of the Rails 2.2 features, 9 pages detailing the bug fixes in this release and 14 pages of the entire changelogs by component), it gives you all the new details in Rails 2.2, perhaps much more than what you need.

While the content is rock-solid, the formatting of the guide wasn’t too much to my liking. The PDF is in landscape orientation, which usually isn’t a big deal for me. However, the author didn’t seem to take advantage of this fact, as I think it could’ve been printed in portrait orientation without much formatting changes. Also, the PDF is just straight text (well, not counting the cover page, for those who like to nit-pick). There are no diagrams or anything similar – just explanations and code samples. Some diagrams or other illustrations wouldn’t have hurt to be included.

As a matter of example, if you see any of the Peepcode PDF’s (like the one on Unobtrusive Prototype.js), you’ll see they took advantage of the page sizes, filling it up without making the pages feel too loaded. These make reading less boring, while still keeping the core information there. It’s a nice combination.

Aside from some very minor gripes, these are quality products that will further your knowledge of everything Rails. I definitely recommend them to any Rails developer who is interested in keeping up to date with the rapidly-changing Rails world. Kudos to the Rails Envy crew for putting up another great product. I’ll be looking forward with what they come up next.

Difference between validates_presence_of and validates_length_of

Posted on October 22nd, 2008 in Programming, Ruby On Rails, tips | Comments

Today I had a pretty frustrating moment. I made some new changes in the morning, which included the addition of a new column in the database. This field wasn’t required, but I needed to limit the amount of characters a user could enter in that string. So I did the proper thing and set this in my model:

validates_length_of :locations, :maximum => 200

I did a quick test, and the validations worked great. So I promptly committed the code to our repository. A few minutes later, our Continuous Integration system sent me a nasty E-Mail: I broke the build.

I frantically searched the errors in the test, and it seemed that the tests were expecting that field I just added to have something. I was stumped, thinking that unless you specify validates_presence_of, set a range of characters in the validates_length_of or perhaps some regular expression validations in the model, that would be the only time a model would require the field to be there. I hadn’t done any of these.

Frustrated, I added a simple string to the fixtures and the test code for this field, and the tests passed. Not content in just making something work, I needed to know what was up. So I started digging around, and found something that now seems obvious, but I totally ignored before.

Whenever you submit a form for a model in Rails to insert a new record in an ActiveRecord model, all the fields you have set in the view are passed in the POST request. However, if you didn’t enter anything in a field, the parameters for that field would simply be sent blank. In this case, validates_length_of doesn’t bitch about the missing field, because it’s there. As long as the number of characters – in this case, zero – isn’t more than what I specified in the model, it’s all good. However, the tests were failing because since I hadn’t specified that new field in the fixtures, the parameters were sending that field as nil, which caused the previously mentioned validation to scream out.

So just as a quick review:

  • validates_length_of – Verifies if the field is within the amount of characters specified in the validation code. If no minimum is set, it won’t mind blank fields, but it will mind nil fields.
  • validates_presence_of – Verifies if the field is nil or blank.

Like I said, it’s obvious now, but not so much when I was getting alerts that the build failed for some silly reason.