Review: AOC F22 (22 inch widescreen monitor)

A month ago, I finally decided to switch to an LCD display, having been using CRT all this while. After looking around for a good but not too expensive monitor, I finally bought AOC's recently released F22.

The F22 is a 21.5 inch widescreen monitor with a native resolution of 1920x1080, which means you can watch 1080p high definition video at 16:9 aspect ratio rather than the 16:10 available in most widescreen monitors.

So far I've been mostly satisfied with the monitor, and it is especially useful when I'm coding. Being able to use NetBeans with all that screen real estate feels great. This screenshot should give you an idea.



Apart from NetBeans, Photoshop is perhaps the only application I run in a maximized window. I'm not much of a designer, and I've only used it for minor tasks like slicing and resizing images, so I'm not really qualified to say whether or not it's good for Photoshop work, but it's definitely a huge step up from the two LCD monitors I've used at work (LG L1742S and Acer x153w) or my old CRT monitor.

Has it changed the way I use my desktop for browsing? I think so. I no longer run Firefox in a maximized window. Most websites out there aren't really meant to look good at this resolution (including this blog) and some of them look outright hideous.

The only feature I can really use in a maximized window is the side-by-side multiple inboxes in gmail, but I stopped using that because I had to constantly switch it back because it looks terrible in the 1280x768 monitor I use at work. Now I'm resigned to using a window around 1280px wide so that the browser window looks the same as the one I have at work.

One category in which AOC definitely beats all competition is when it comes to the design and looks. The F22 monitor doesn't have a conventional base like other monitors and instead has a base inspired by a photo frame with an adjustable single post stand that allows adjustment of the tilt angle. (see image below) This definitely has to be one of the best looking monitors I've seen.



When it comes to watching videos on this one, I'm happy with the colors and contrast. I played a high definition video to check what it would look like, and it exceeded my expectations in that regard. The clarity and the level of detail was stunning.

However, the brightness dips drastically at wider angles, and videos are almost unwatchable if I'm lying on my bed which is right next to my desk. I don't really take the manufacturer's viewing angle specs of 170/160 at face value, but unless I've really messed up the trigonometry calculations here, the viewing angle wouldn't be more that 120-130 degrees at a 6ft distance from the desk. That for me is the major disappointment with this monitor. But then, I'm used to the CRT monitor's viewing angle and that's probably why I'm so harsh on this point.

Another drawback is that the pixels per inch is on the higher side at 102 PPI, (24" displays have 91) which means fonts look smaller, but then that's a trade off you have to make when you choose a 22" monitor with 1080p resolution. This doesn't normally bother me much, but when I visit websites that use smaller font sizes, I have to zoom in to be able to read comfortably.

AOC claims a dynamic contrast ratio (DCR) of 30,000:1 for this monitor, but in case of these specs, seeing is believing. (There are monitors claiming DCR of 1,000,000:1) There is a DCR mode in the luminance options of the OSD, but I would recommend wearing sunglasses to avoid being blinded by the extremely high brightness levels. I might be wrong here, but isn't DCR all about reducing the illumination for the dark pixels rather than increasing it for the brighter pixels?

There are VGA and DVI inputs for the dislpay. Strangely enough, there is no HDMI port, which is fairly standard these days on monitors with this resolution. However, I don't have any complaints ther as I only use it with my desktop. Also, it does not feature any USB ports, which are also standard on monitors these days.

Despite all that grumbling in the previous 2-3 paragraphs, I'm kind of happy with my choice of monitor. The viewing angle is the only thing that irks me about the display. The large screen area obviously helps a lot when I'm working, and it's nice watching videos on it, even though I have to stay within a narrow viewing angle to enjoy it fully.

My rating: 8/10
[Read more...]

Setting up Ruby on Rails development environment with NetBeans on Windows

I've set up NetBeans for Ruby on Rails with NetBeans twice today -- first at work for a friend who is moving to RoR development from PHP, and then at home where a dying hard disk forced me to get a new hard disk and install all the software I require all over again.

I realized that setting up a Rails environment might seem a daunting task for a newbie. Here's a list of steps to get Ruby on Rails working on a windows machine. I use NetBeans with MySQL because I found the least trouble to set up.

  1. Go to www.ruby-lang.org and download the ruby one-click installer for Windows.

  2. Install ruby using the one-click installer, and remember to select RubyGems when asked what components you want installed.

  3. Download and install MySQL from http://dev.mysql.com/downloads/.

  4. You will need java to run NetBeans, so download java from http://www.java.com/en/ and install.

  5. Download the latest version (6.7 at the moment) of NetBeans from http://www.netbeans.org/. You might choose the complete NetBeans package or the Ruby only version. Either of them will do.

  6. Install rails for your ruby installation by using this command in the command line:

    gem install rails

  7. You will also need the ruby MySQL driver to be installed to be able to use MySQL databases. For this, install the mysql gem by this command:

    gem install mysql

  8. When I started NetBeans and created a new rails project, NetBeans asked me to update ruby gems from 1.3.1 to 1.3.2. Unfortunately, the one click installer is available only for Ruby 1.8.6 and contains gem version 1.3.1, so you'll have to update rubygems using the command line:

    gem update --system


That's it... you can now use NetBeans as a rails development environment. I know that was a very long list of steps to get a rails IDE working, but it's worth the trouble. Using ruby on rails as your development environment will make up for the effort required to set up the IDE.

What IDE do you use for rails development? When you were new to rails development, did you have trouble setting up a development environment? And in case you're a newbie rails developer, is that how you got here?
[Read more...]

First impressions: Ruby Encoder for ruby source code encryption

About a week ago at work, I was asked to evaluate Ruby Encoder, an application to encrypt the source code of your ruby application.

Normally, you wouldn't want to encrypt the source code of your ruby applications. The code resides on your server and there's no way anyone else can access it. However, if you are going to allow others to host your code on their own servers, you might want to obfuscate your code so that nobody can see it.

I signed up for the free trial of Ruby Encoder and so far I've been impressed with how easy it is to set it up for use with the ruby on rails application I'm working on. It took me less than ten minutes to encrypt all the ruby files and run the project on the development machine.

Ruby Encoder works by encrypting the ruby source into bytecode and then decrypts this encrypted code using a loader (which is an compiled ruby module) and sends it to the interpreter. This way, all anyone will get to see in your .rb files will be a lot of gibberish and a call to the loader function.

I haven't really had the time to check it out thoroughly and I don't know how well it will work in production, but right now it looks like the best option (and probably the only option?) for what I am trying to accomplish.

I was discussing Ruby Encoder with a friend and one very valid argument that came up was about how far such software could help if someone really wanted to clone our application. If someone wanted to steal our code, they most likely would be capable of coding the application by themselves by looking at the views of the application. So is it really worth the trouble to use an application like Ruby Encoder just to make things a little bit more difficult for them?

What do you think of ruby source code encryption? Have you ever used Ruby Encoder or similar products for any of your projects? If so, how well has it worked for you? Do you think using such an application is a good idea?

What method would you employ if you had to ensure that your ruby code remained closed source?
[Read more...]

Rails: "500 - Internal server error" caused by error in application.rb

Today, while working on my Ruby on Rails project, I got a "500 - Internal server error" page soon after I tried to run the project after running a migration. There was nothing else on the screen except for that one line.

I tried a few things, like restarting NetBeans, and opening another project to see if the problem was with my Ruby installation. (Other projects were running fine, so the problem wasn't with Ruby.) I even tried running the project from another desktop, getting the same 500 error.

Finally, I did the one thing that I should have done first - checking the development log file. There I found that the problem was a tiny bit of buggy code in the application.rb file that was stopping the project from initializing properly. And because the application failed to initialize, I wasn't getting those detailed error messages that I'm so familiar with.

Have you done something so stupid while developing an application? Forgetting to look at the first place where you could have spotted the problem and instead wasting an hour theorizing about what could be causing the problem?
[Read more...]

IE6 No More - Let's Kill IE6

Microsoft recently made an announcement saying that they will continue to support IE6 until August 8, 2014. That's another 5 years. Can you imagine that? Another 5 years of supporting IE6 when HTML5 and CSS3 are just around the corner.

If you are a web developer, you probably hate IE6 as much as I do (or even more, if that much hate is ever possible). And like me, you are waiting for the day when the damn thing disappears off the face of the internet.

When I started this blog, I had planned to make it completely inaccessible to IE6 users, and instead display a message asking them to switch to some other browser. But then I realized that it's too much effort to hack the template for the sake of spreading the message to the 1% of visitors of this blog who still use IE6.

Instead, I chose to leave all the IE6 bugs unfixed (this template looks awful on IE6) and added the banner from the IE6 No More campaign. "IE6 No More" is a campaign by a group of startups that are fed up with the ancient browser and want it to disappear. Do take a look at their website where they make a very good case against IE6.

However, there's hope for us yet. Digg has restricted access to some of its features on IE6, Facebook is asking IE6 users to upgrade and YouTube will drop IE6 support very soon. If more big websites will also take steps in this direction, we won't have to wait till 2014 for IE6's death.


What browser do you use? Do you think all website should follow Facebook's lead and ask users to upgrade?

If you are a developer, how much of you time is wasted fixing all those IE6 bugs? Have you worked on any website recently where you didn't need to make it compatible with IE6?

PS. If you are a Firefox person and have your own website, why don't you help spread the word about Firefox? The more IE6 users we convert, the better! ;-)
[Read more...]

How to create a simple datepicker using jQuery

jQuery allows you to easily create a datepicker and customize it according to your requirements. Here's a quick look at how you can get started with using the jQuery datepicker.

The jQuery website has a nice application called Themeroller that lets you customize the interface for jQuery UI widgets. There are also plenty of themes available in the gallery that you can download and use directly. Copy the stylesheet, images, the jQuery file and the jQuery-UI files into the appropriate directories and link them in the header of your HTML file.

Now let's create a simple form that contains the text field that you want to convert into a datepicker.

<form action="index" method="get">
  <input id="date-pick" name="date-pick" type="text" value="" />
  <input id="date-submit" name="date-submit" type="submit" value="Go!" />
</form>

To convert the input field with the id date-pick into a datepicker, write the following jQuery code in the head section of your HTML.

$(function(){
  $("#date-pick").datepicker();
});


That's it! The input field that you created now works as a popup datepicker. A calendar showing the current month appears whenever you focus on the #date-pick field and the date you click on appears as text in the field.

There are tons of options to customize the datepicker, such as changing the date format sent to the server or using a different language for the calendar. You can explore these options in the jQuery UI documentation for the datepicker.
[Read more...]

jQuery: Avoiding conflict with other libraries using jQuery.noconflict()

Recently, when using jQuery in my Ruby on Rails project, the jQuery calendar plugin I was using suddenly refused to work in one of the views. The plugin was working fine everywhere else, but it just wouldn't work here.

The problem was that there was a conflict with a rails prototype helper (observe_field) that I was using in the view. Using jQuery along with other javascript frameworks such as prototype or mootools causes a namespace clash as they all use the $ alias.

jQuery provides a noconflict method to avoid this clash, which lets you rename the jQuery function ($) as something else.

In the code below, the noconflict method is called to replace the $ alias with the function name jQuery and release $ to other frameworks.

<script src="jquery.js"></script>
<script>
  jQuery.noConflict();
  jQuery(document).ready(function(){
    // your code goes here.
  });
</script>

However, you can also use some other name instead of jquery by assigning jQuery.noconflict() to another variable. In the code below, I have use $jq as the new alias for the jQuery function. Now you must use this new alias where you would otherwise have used the $ shorthand.

<script src="jquery.js"></script>
<script>
  var $jq = jQuery.noConflict();
  $jq(document).ready(function(){
    // your code goes here.
  });
</script>

Using this form of the noconflict method allows you to avoid namespace conflicts while at the same time giving you the ability to use a short alias ($jq above) for jQuery.

If you want to globally disable the $ alias for jQuery, call the noconflict method from the last line of the jQuery file.

Make sure you call this function before using the conflicting library, otherwise it may still clash. However, you may include the other library without causing any conflict.
[Read more...]