Friday, November 6, 2009

Netflix on PS3

The Netflix PS3 blue-ray CD arrived today.  The first time it ran on PS3, it gave authentication code to be put on my Netflix account from PC.  After the authentication was done, it came up with nice menu to navigate online videos available from my account's queue.  When I played some of the movies, the quality of the pictures were really beyond my expectation.  I was expecting the quality was about the same as standard TV, but what I got was almost-bluray/HDTV quality!

Bravo to both Sony & Netflix to provide with this excellent access. Now we can watch hundreds, or even thousands of movies available at Netflix on our LCD TV.

Sunday, November 1, 2009

Battery for Toyota Sienna XLE 2005

I was looking for an auto-battery replacement of my Sienna XLE 2005  at Costco.  When I asked the salesperson, he pointed me to a Costco battery for about $70 + tax (and there is no charge for returning the old one to them).  It's number 3 and the group size is 35, but when I tried to install it, it wouldn't fit as the size was smaller and the anode (positive terminal) and the cathode (negative terminal) were at the opposite side, unlike the original one,.  I went back to Costco to exchange, but unfortunately they didn' carry the one I wanted (interestingly, the reference book they had really showed  group size 35 was indeed the only group size for my car, not group size 24 as written on the original battery).

I ended up returning the battery and went to Kragen.  Luckily, they have this type, as well as the 35 (strangely, their computer initially showed group size 35 as well, but the salesperson said they carried also the group size 24).  It costed me about $80 with 84 months limited warranty (but 36 months full warranty).

Went back home in rush to install the battery, and now it works flawlessly, at least for now.

U-Verse Speed

U-Verse 6 Mbps:

http://www.speedtest.net][IMG]http://www.speedtest.net/result/609346355.png

Wednesday, October 28, 2009

PS3 is gaining market!

A few days ago there was a news telling Netflix will be available on Sony PS3.  This a good news for PS3 folks who have been inquiring Netflix when they are going to support PS3, besides XBox 360 which has been available for quite some time.

With more and more features added into PS3, not to count the price has also come down, it is now a good time to have a PS3 console as your center of home entertainment.  For a cost of $299+tax, we can get a powerful station capable of playing Bluray discs, playing games (in hi quality plus in 1080p), playing music CDs or MP3, it can also become a multimedia center to access the internet (browsing, emailing) and now to watch video streaming online.  That's all will cost us $$ more if we buy individual units.

Oh, don't forget to get that Sony Bluetooh remote control.  Nothing can be easier now!

Monday, October 12, 2009

Bresenham Algorithm

#include <stdlib.h>
#include <stdio.h>

//extern int plot(int x, int y);

int plot(int x, int y, int color)
{
    printf("plot(%d, %d, %d)\n", x, y, color);

}


void swap(int *a, int *b)
{
    int tmp;

    tmp = *a;
    *a = *b;
    *b = tmp;
    printf("swap %d with %d\n", a, b);

}



int line(int x1, int y1, int x2, int y2, int color)
{
    int steep;
    int deltax, deltay;
    int e, x, y, y_step;

    steep = (abs(y2 - y1) > (x2 - x1));

    if (steep) {
        swap(&x1, &y1);
        swap(&x2, &y2);
    }
    if (x1 > x2) {
        swap(&x1, &x2);
        swap(&y1, &y2);
    }
    deltax = x2 - x1;
    deltay = abs(y2 - y1);
    e = x1;
    y = y1;
    if (y1 < y2) {
        y_step = 1;
    } else
        y_step = -1;
    for (x = x1; x <= x2; x++) {
        if (steep)
            plot(y, x, color);
        else
            plot(x, y, color);
        e += deltay;
        if (2 * e >= deltax) {
            y += y_step;
            e -= deltax;
        }
    }
    return 0;
}


int main()
{
    int x1, x2, y1, y2, color;

    x1 = 0;
    y1 = 0;
    x2 = 50;
    y2 = 65;
    color = 1;

    line(x1, y1, x2, y2, color);
}
~
~

Sunday, September 27, 2009

Fixing choppy screen on Ubuntu Jaunty

According to a site I googled, XWindow in Ubuntu Jaunty 9.04 has some issue in accessing videocard's memory region.  My video card is NVidia GeForce 8500  GT with native driver from Nvidia.  Kernel is 2.6.30.5 (compiled from source).

I fix this by doing the following:

1) do lspci -v, find "VGA compatible controller" section.

Mine shows as:

04:00.0 VGA compatible controller: nVidia Corporation GeForce 8500 GT (rev a1) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 034f
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at fa000000 (64-bit, non-prefetchable) [size=32M]
        I/O ports at ec00 [size=128]
        [virtual] Expansion ROM at febe0000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nvidia, nvidiafb

2) Calculate the accessable memory region (in KB, not MB) by substracting non-prefetchable part  from prefetchable (pick the lower region one).  For example, as above we should compute 256M - 16M, or use Google.  For example, 256 MB = 2^18 KB and 16 MB = 2^14 KB, so (2^18) - (2^14) = 245760 KB

2) as root, edit /etc/X11/xorg.conf.  Find `Section "Device"`
3) Add `VideoRam #`, where # = the result from point 2
For example, mine should now show like below:

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    VideoRam       245760
EndSection


4) Restart XWindow
5) Test with mplayer.  Now the screen changes smoothly with no flicks.

According to some sources, this issue will be fixed in next Ubuntu Jaunty updates.