Tuesday, September 21, 2010

Circular Google: Useless Top Search Results

Circular Google: http://ubuntuforums.org/showthread.php?t=401339

I google a lot.  Google is my public library.  If I have a question, I google for the answer.  I also happen to think that I am in the majority.  (Note: In the rant that follows, I am not blaming Google.  Google is great!)

Sometimes, not too rarely, the number one Google hit contains a forum question similar or identical to mine followed by an rude and unhelpful jerk responding, "Google it!"  This annoys me so much.  The reason why this annoys me so much is because the forum response will not only be seen by the person posing the question but also by others with the same question.  Eventually, this forum thread might become the number one search result, an useless top search result.

Thus, please if you are going to bother responding to someone on a forum, don't respond "Google it!"  I did!!!  Check out the Circular Google image above to see a perfect example of a useless top search result.

Saturday, September 4, 2010

Installing Ubuntu 10.4 on HP Pavilion tx2000

Ubuntu 10.4 on HP Pavilion tx2000: Monitor 1
Ubuntu 10.4 on HP Pavilion tx2000: Monitor2
In a previous post, I described how easy it was to install Windows 7 on my HP Pavilion tx2000.  It worked almost perfectly out of the box.

Though, I am beginning to like Windows again thanks to Windows 7, I installed Ubuntu because I do Linux programming.

Wireless, tablet screen, and multiple monitors worked without having to hack anything.  Ubuntu supports them.

Things that don't work:
  • HP Quick Launch Buttons around the screen border
    • DVD, QuickPlay, Settings, and Rotation
  • Mute button doesn't turn red when muted but the volume buttons do work.
As you have read, the list of things that didn't work using the standard Ubuntu 10.4 desktop installation were very few.  They are also identical to things to didn't work after installing Windows 7.  HP drivers are needed.  I don't think that I will bother for now.

I must also say that the start up and shutdown times are amazing! The picture above demonstrates my Ubuntu desktop.  I, of course, applied a dark theme to the controls and the window borders.  It looks and feels great.  I hope that this helps somebody trying do the same thing or something similar.

Friday, September 3, 2010

Soundness and Completeness

Universe


Here is a loose definition of soundness and completeness.

An argument is sound if everything that can be derived from it is true; no false positives.
An argument is complete if everything that is true can be derived from it; no false negatives.

Referring to Universe figure above,
  • A is sound.
  • B is sound and complete.
  • C is complete.
  • D is neither.
 B is the kind of argument, reasoning, and systems you want to be dealing with.

Friday, August 20, 2010

Installing the MySQL RubyGem on Ubuntu

I have successfully installed the MySQL driver for Ruby on Windows and Mac OS X but I had not installed it on Ubuntu until today.

I am assuming that you have already installed the MySQL server.  I am using MySQL 5.1.
$ sudo apt-get install mysql-server

Install the MySQL database client library.  I am not certain of this but I believe that the number '15' in 'libmysqlclient15-dev' indicates the version.  This is apparently the most current one and the default version on Ubuntu 10.4 as of today.
$ sudo apt-get install libmysqlclient15-dev

Install RubyGems if you have not done so already.  I am using Ruby 1.9.1.
 $ sudo apt-get install rubygems1.9

If everything was successfuly, then you should be able to use the mysql RubyGem in  your Ruby scripts.

Installing Windows 7 Professional on HP Pavilion tx2000

Yesterday, I did a clean install of Windows 7 (32-bit) on my HP Pavilion tx2000 computer. I was very surprised and glad that I did not need to install much in order to get the computer to work.  I feared that I would need to install many more drivers, for instance, the tablet driver.



Additional drivers installed from the HP support website:
Things that do not work:
  • DVD Quick Play button on the border of the screen
    • I am not going to fix this.  I thought it was annoying anyways.  I kept on pressing it accidentally.
Observed benefits over the HP factory installation of Windows Vista.

  • Startup time is now 57 seconds.
    • From being powered off to displaying the google homepage.
  • Shutdown time is now 10 seconds
  • With Vista it would literally get too hot for your lap.  Now it always stays cool.  I would dare to say that it stays cooler than my 13" Macbook.

I hope this helps somebody somehow.

    Thursday, August 12, 2010

    Formatting Hex Strings in Ruby

    This method converts a 1 or 2 character string representing a hex number into a 2 character string representing a hex number.

    Usage examples:

    irb(main):001:0>format("a")
    => "0A"
    irb(main):002:0>format("2D")
    => "2D"


    Implementation:

    def format_hex_string(byte)
        byte.upcase
        byte.to_i(16) >= 16 ? byte : "0" + byte
    end

    Cartesian Product in Lisp

    One of the things I do quite often is calculate the Cartesian product of two lists.  Here is my solution to problem in Lisp.

    Usage Example:
    > (product '() '())
    NIL
    > (product '(1 2) '(1 2 3))
    ((1 1) (1 2) (1 3) (2 1) (2 2) (2 3))


    Implementation:
    (defun product (list1 list2)
        (let (templist '())
            ;;iterate through the first list
            (dolist (item1 list1)
                ;;iterate through the second list
                (dolist (item2 list2)
                    ;;create a list from the current items and push it onto the temporary list;;
                    (push (list item1 item2) templist)
                )
            )
            ;;reverse the temporary list to display it correctly

            (nreverse templist)
        )
    )