2 monitors on Karmic Koala 64

February 4th, 2010 No comments

In December I bought this brand new laptop and had the perfect excuse to upgrade to Ubuntu 9.10. Like I mentioned in this post, the video drivers were the only issue I had.

Nvidia released new drivers for Linux 64 (v. 190.53) so I took the chance to update and plug an old 19” monitor to my laptop. To enable TwinView I muddled through some documentation but finally made it work.

Here’s the code from xorg.conf that enables TwinView:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection
 
Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option	    "TwinView"
    Option	    "ConnectedMonitor" "DFP-0, CRT-0"
    Option	    "MetaModes" "DFP-0: nvidia-auto-select, CRT-0: nvidia-auto-select"
    Option	    "CustomEDID" "DFP-0:/path/edid/monitor1.bin; CRT-0:/path/edid/monitor2.bin"
    Option	    "TwinViewXineramaInfoOrder" "DFP-0,CRT-0"
    Option	    "TwinViewOrientation" "DFP-0 LeftOf CRT-0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

I had to add the binary EDID files because the X server was unable to identify the correct resolution for my laptop: 1366×768. The second monitor is 1280×1024… now I’m really seduced by a 27” monitor.

Masters of Doom

January 28th, 2010 No comments

I have just a few posts per month but also have a lot of drafts waiting to be completed. A few of these drafts are almost complete and most are just short notes about subjects I want to write about in the future. I wish I could post more often, but not only is my schedule too tight, also writing clearly is just plain hard for me. It takes me precious time. Not to mention that English is not my mother tongue.

However, I have one more motivation to keep writing. Besides my beloved wife who has the burden of proof reading my posts I have a reader. Yes, that is right. One reader. Hallo Rafa! Thanks for all the support buddy.

Now, back to the topic of this post. I was checking the draft list and noticed that I didn’t add Masters of Doom to the Books category on this blog. I read this book many years ago but ended up reading it again this past December. Great source of inspiration.

In case you’ve been living under a rock, Masters of Doom is about John Carmack, John Romero, Id Software, Commander Keen, Wolfeinstein, Doom…

If you didn’t read it just do yourself a favor and order a copy of it!

A matter of guidance

December 9th, 2009 No comments

LasVegas Cloudy days are perfect for productive leisure, so in March before moving to the US I spent a lazy-cloudy-Sunday afternoon packing. Moving is always exciting and a good chance to get rid of everything that is not necessary in your life anymore. You can even leave bad vibes behind if you are spiritual. We tend to gather too much junk. Keep it simple.

The cleanup included my bookshelf. My mission was to dispose of as many books as possible. Boy, books are heavy to carry and physics does not apply when it is part of your luggage.

While running through the titles I started to compare dates of purchase against subjects. I have had this habit since I was a teen, every time I buy a book I sign and date it.

Anyway, my small library was another lead to an obvious issue: my quest to become a programmer is a mess.

Here’s one good example. I wanted to code games when I was a teen. After some research I concluded that C++ and DirectX were the right tools for the job. I decided to start with C++ and ordered “C++ How to Program” by Deitel. Back then, a small number of web pages would advise: “You have to learn C”. My mind discarded that advice as fast as I could read it. Why would I learn C? Isn’t C++ not only C but PLUS PLUS! It is the future. Yeah, I know you are laughing at me.

I read and tried all the examples from “C++ How to Program” before reading or writing any line of pure C code and felt ready to dive into some DirectX books and code the best tic-tac-toe ever!

Turns out my ambitious plan needed a detour. You have to go through some Windows programming before you can dive into DirectX (I don’t know how it works now a days). Gosh, 70 lines of C code just to print Hello World in the Win32 API world.

I can’t just copy and paste code so I ordered “Programming Windows” by Petzold to become familiar with Windows programming. BTW, Programming Windows is a great book — and I found a minor mistake in the text! (Erratum #5).

I read the book, tried the examples and the fact is: Win32 API is C Code.

Because of that I finally ordered the classic “The C programming language” book to fill this awful gap in my skill set. Comparing the dates of purchase I realized that I bought the C book 2 years after the C++ one. Sad.

I now remember that after going back and forth I finally achieved my goal. The best tic-tac-toe game ever written did compile and run without crashing. The euphoria lasted for almost 5 seconds!

Before writing my first line of code I was already humble and comfortable with the idea that it takes a lifetime to be a great developer. BUT, it took me a long time to have a better overview of the skills set you need to build in order to be a software developer.

It’s a matter of proper guidance.

It doesn’t matter if it’s a CS degree or guru souls willing to show you the way.

Ubuntu 9.10

December 2nd, 2009 No comments

Sony Vaio VPCCWI was planning to skip Karmic Koala. Jaunty was running just fine but since I replaced my notebook I had an opportunity to try it.

I bought another Sony Vaio but this time without a stupid keyboard. I opted for the VPCCW model because it offered an NVIDIA (GEFORCE 230M) graphics card. I was interested in the SR series but because of my bad experience in the past I didn’t want to deal with ATI.

And that is the irony. Installed Karmic and even wireless worked out of the box. Surprise! After enabling NVIDIA proprietary drivers (190.42) and rebooting my screen was black. Frustration.

After some time googling and reading NVIDIA documents I found out that I had to set xorg.conf to use a custom EDID.

Option "ConnectedMonitor" "DFP-0"
Option "CustomEDID" "DFP-0:/path/to/bin/edid/SNY05FA.bin"

Everything is running smoothly now but I can’t stop thinking that this kind of problem is what makes linux desktop adoption harder. It’s just a matter of time though.

Meanwhile, at the PHP world

November 22nd, 2009 No comments

fireplaceIn order to accomplish my goal of keeping this blog updated and grant me some good memories in the future, let me write down about what is going on in my small PHP world:

CakePHP

In my daily job we deal with tons of code written in the pre-framework era but I had a chance to experiment with CakePHP in the past months. I had a good time being involved in three side projects using the framework.

The documentation is good and written like a tutorial but some times you still need need to dive into the framework’s source code to get specific details about classes and methods.

Emacs PHP mode improved

I replaced php-mode for php-mode-improved. The improved version has fixed some bugs in from the previous version but it is sad to read:

;; This has been submitted to the php-mode maintainer, but I've not yet had a
;; response.

The (probably) most popular php-mode is abandoned.

Xdebug

I occasionally read Chromium’s tools written in Python and - as the newbie for life that I am  - I wasted a significant amount of time adding print and exit statements to the code.

It was time to learn how to use a Python debugger and make life easier. Enters pdb.

It didn’t take long to look for a similar tool for PHP: xdebug.

I just wonder why I didn’t try to learn these tools earlier.

PHPUnit

This was something I was excited to do. To move all the crude test scripts to a test framework as dictates industry’s best practices.

Some tests were written using SimpleTest but after a few grep and sed commands they all work with PHPUnit now.

PHPUnit’s documentation is better and development is active. SimpleTest is stuck in version 1.0.1 since April 2008.