Wednesday, November 22, 2006

The Dumb Web Programmer is Back!

Wow my last blog post was 6 months ago. I've been dead to the online world for that long!!

Well, I'm back and I will chronicle my battle with the biggest injustice in life known as full time job tyranny. :)


technorati tags:, , , ,

Monday, May 08, 2006

What happened to LiewCF.com?


 

 liewcfweb




That was the old liewcf website. (really old :)) 




liewcf.gif


This is what I saw today (8 may 2006). What happened? The problogger forgot to pay his webhosting charges? Domain name expired?  It's been replaced with some generic page.

Thursday, February 23, 2006

Yahoo supports PHP!



This is the link to http://developer.yahoo.net/php/

You can find useful links to implement PHP calls to Yahoo services!! and then some...

Sunday, February 05, 2006

Ideas in Adsense placement


I visited LiewCF.com and find that his idea for Adsense placement ingenius.

He highlights two of his "hottest" articles and continues it with the Adsense ads.

The effect is that it blends into one big block of text link which has the top half linking to the real contents of LiewCF own site and the other half which is actually Google Ads. It almost fooled me into clicking the other Adsense links thinking it was LiewCF content.

Will implement it in my other websites. I'm sure the click-thru rates are pretty high for ads like this.

Tuesday, November 22, 2005

USD100 notebook


  • Speed: 500MHz
  • OS :a 'light' version of Linux
  • Screen : two-modes color or black-and-white display for
  • view in bright sunlight at four times normal resolution,

  • Power: AC adapter or via a wind-up crank
  • 10-to-1 crank rate- one minute gets ten minutes of power.


    The laptops will be rugged and probably made of rubber.

  • 4 USB ports
  • Wi-Fi
  • cell phone
  • 1GB of memory

    Internet
    Each laptop will act as a node in a mesh peer-to-peer ad hoc network
    allowing internet sharing on a single online connection.

    Man I wish they will make this a reality soon. It will surely close the 'digital divide'. Imagine our kampung kids using USD100 notebooks !!!

    More info from PC World Article and developer MIT Media Labs
  • Thursday, November 17, 2005

    Oracle - List all tables

    Ok I'm using Oracle databases with PHP scripts for the first time. I'll start posting my 'personal notes' on Oracle + PHP.

    List all the tables used in the current database that is open:



    select table_name from user_tables




    Friday, November 11, 2005

    Still using DOS

    Here's one of my DOS batch scripts that I still use to backup my source code

    Can't imagine after all these years I'm still using DOS batch file and DOS Rar to help me with my daily backup.

    useful because it compresses all the files in a folder using RAR and names the compressed file according to the date (yyyy-mm-dd).

    @echo off
    cls
    echo Backing Up RHB Fin files
    echo =============================
    rar a -m5 -r c:\backup\rhbbackup%year%-%month%-%day% c:\www\rhbproj1

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :GetDate yy mm dd
    ::
    :: By: Ritchie Lawrence, 2002-06-15. Version 1.0
    ::
    :: Func: Loads local system date components into args 1 to 3. For NT4/2K/XP
    ::
    :: Args: %1 var to receive year, 4 digits (by ref)
    :: %2 var to receive month, 2 digits, 01 to 12 (by ref)
    :: %3 Var to receive day of month, 2 digits, 01 to 31 (by ref)
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    setlocal ENABLEEXTENSIONS
    set t=2&if "%date%z" LSS "A" set t=1
    for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('echo/^|date') do (
    for /f "tokens=%t%-4 delims=.-/ " %%d in ('date/t') do (
    set %%a=%%d&set %%b=%%e&set %%c=%%f))
    endlocal&set %1=%yy%&set %2=%mm%&set %3=%dd%&goto :EOF
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    Wednesday, November 09, 2005

    Firefox quietl first birthday

    It's PC Mag no. 1 tech product of the year and of course many techies favourite browser.

    I love FireFox!!!

    They celebrated their very first birthday rather quietly.


    Firefox quietly celebrates first birthday

    Ingrid Marson
    ZDNet UK
    November 09, 2005, 12:00 GMT


    'I don't think there will be a big party, as we are all very busy putting the finishing touches to Firefox 1.5,' says the president of Mozilla Europe


    The open source Firefox browser was launched a year ago today, but the celebrations are expected to be low-key.


    Here's a funny conversation I had with one of our company's customer.

    Customer: "Your program got error la in IE".

    Me: "Huh?? You still use IE ah ?? That Spyware magnet??"

    Custommer: "Here in office everybody use IE. Boss don't like to use funny browser like FireFox. IE is defacto browser - industry standard".

    Me: "Ok. Your funeral. Let me fix the error and send back to you .."

    Friday, October 21, 2005

    Dumb Web Programmer under Dumb Project Manager

    I used to write code that is template based
    where programming code is separated from html.
    My favourite templating engine is Smarty.

    Hey that's how web programmers like me keep my sanity.

    Mixing PHP+HTML is ok for small projects but really
    is stupid for a large system we are developing.

    But lately since we got a new project manager that has
    no idea on good software engineering principles (things
    that you learn in first year of a computer course
    whether at diploma or degree level).

    Heck, I'm a DUMB web programmer and even I know that.

    This dumber than dumb project manager just wants things
    fast. We realised even showing him our code one day that he
    doesn't care about code maintainability - either that
    or he is just ignorant of the fact.

    But I don't care now since we are being pushed with tight
    and impossible deadlines to meet. Staying past midnite
    on a Friday night is not my idea of fun.

    So from now onwards I've been writing rojak coding mixing
    PHP with HTML in one file. I don't care.
    And it is effective!! I seem to be churning out code twice
    as fast and my project manager is impressed.

    My project manager don't care as long as deadlines are
    met. Of course the system will be a pain in the ass to
    maintain later on.

    Why do I care?? I will be gone in oh.. say 6 months time.

    LiewCF and Kah Soon, I'll be joining you guys problogging by
    then hopefully.

    Monday, September 26, 2005

    Whatever happened to LiewCF

    It's been a solid 48 hours since the problogger Liew CF posted a blog entry?? Usually he will post a few articles per day.

    Note: I noticed that 10 seconds after posting this I got a spam post on my comments.
    Somebody wrote some API hook to Blogger to spam comments. Sheesh!

    Sunday, September 25, 2005

    Opera Mobile on USB


    By now everybody would have known opera 8 is totally free (no ads).

    This website www.Opera-USB.com tells you how to put Opera into a thumb drive.

    All you need is a thumbdrive min 32Mb - but nowadays tell me where can you find a USB drive LESS than that??.

    Super cool as I can take my personal preferences wherever I go. Oh yeah can throw stupid IE away :)

    Wednesday, September 07, 2005

    PHP is alive!!

    It's so depressing to think that the programming language I specialise in, PHP, is rare and little used in Malaysia.

    However all that changed last week. I got two calls from head hunters looking for PHP programmer.

    I will most probably leave my current job which have banned internet from the office. I don't mind getting any other PHP programming job as long as they give me internet access to do my R&D.

    Thursday, July 28, 2005

    Programming- It's a dog's life

    After being a programmer for several years I really feel old, tired and plain fed up
    with this life.

    Don't get me wrong. I love programming and have a good pay but the company I
    work for is just too money minded. Heh! What am I saying ? Of course companies
    have to money minded to survive in this cut throat business.

    But lately I'm seeing more projects being brought in and me being overburdened. It's
    like a cheap sweatshop here - just like a factory workers - we churn out code after code.

    Finish one project and another comes in. Long briefings on what to do. Tons of documentation to go
    thru. Hundreds of bug-list to fix when the final code is launched for testing.

    Sweatshop

    To add to the burden, all programmers' Internet access has been revoked.

    The bosses and share holders don't care about reputation as they get in more and more new projects
    while the rush for completion results in more errors and bugs in the final production codes.

    All my superhuman efforts in meeting deadlines is not really appreciated. Some of the codes
    that I thought were ingenious just go unnoticed.

    Our present customers are getting angry but they don't care... as long as they can get new customers.

    Man, I know this is definitely the way to long term corporate death. So just waiting for the day
    this company keels over.

    However, from the profits so far collected I think this company may outlast me. It's a dog's life...

    Sunday, July 17, 2005

    Test Blog

    Test blog message sent from email.

    Thursday, July 14, 2005

    No Internet access.

    That's what the company said today.
    Man how am I going to do any work without any internet access?
    Sure, HR have a point that Internet is the big time waster as
    many employees just browse aimlessly at company's expense.



    But what about a web programmer like me? I've lost access to my
    favourite Guru on the net - "Mr Google".



    I've brought up my predicament to my bosses and they say that
    I can do my R&D later at lunch or after work using our
    pathethic "public PC".



    I am seriously thinking of leaving the company now..



    And oh, I'm blogging this from my handphone at my own cost.

    Saturday, June 25, 2005

    What the hell is BlogShares?

    I did a search for "dumb web programmer" (that's me!) on Google and to my surprise I was listed as No. 1.

    Image hosted by Photobucket.com

    However it was listed indirectly thru BlogShares. What the hell is BlogShares.

    It looks like a blog directory with some strange way of valuating blog sites.

    Friday, June 24, 2005

    Movie Review: Madagascar

    Finally got some free time to go out and watch a movie!! I even missed Star Wars because of my work. You can thank my boss for the late nights...

    Anyway I watched the movie below. (Forgive me as the below is the best pictures I can get - its for mobile phones wall paper !!)

    Madagascar is perfectly fun and cute.

    It’s definitely more entertaining than the likes of Robots or Shark Tale.

    I loved the scene where Alex the Lion gets hit in the nuts.

    I question some scenes where we see cute little animals get eaten though.
    Is that suitable for 5 year olds :)

    The Penguins are the funniest creatures IMHO.

    Now, entering the wild brings out a very interesting conflict.

    Alex, the lion (Ben Stiller) has to fight his natural urge to eat his friends when his steak supply is suddenly non-existent.
    Poor Alex has to exile himself to keep his friends from becoming his snack.

    But it comes at the end of the film and only plays out and everything is humky dory.

    The holes??

    1. Did you notice that they were mostly on the beach most of the time.
    2. Where are the other lions? Are they no lions in Madagascar?

    Hmm... can't put up pictures of the film as I'm unsure of the copyright thingy.

    Anyway, I put up some 'pictures' from my affiliate membership to a mobile phone content account.

    You don't have to (or under any obligation) to click anything here. I just included it here as eye candy relating
    to my 'movie review' that's all.

    Javascript: FrameBreaker

    This is javascript to break out of a frame. Useful if some website 'wrap' your content within their own frame. Place this javascript on your first page (usually index.htm /index.html) and break out of someone else's frame!

    <script language="JavaScript">  
       <!-- // auto-framebreaker
     if (top.location != self.location) {
        top.location = self.location.href
           
    } //-->  
      </script>

    Tuesday, June 21, 2005

    Blogger: How to replace Blogger Favicon

    You know the blogger favicon. See below:
    Blogger's Favicon

    I was tired of that Blogger favicon and was wondering if I could replace it with my own.

    So I went about the net to find ways to do it. You know what? It was pretty easy.

    Here are the steps:-

    1. First I created a simple logo icon that contains my initials - DWP. (Dumb Web Programmer lah !!)

    2. I used PaintShop Pro but you can use Windows Paint too I guess.

    How to replace Blogger Favicon

    3. After that, I google-searched "Create Free Favicon Online" and found this great website:

    http://www.chami.com/html-kit/services/favicon/

    4. I just uploaded the picture I created (50x50 pixel GIF by the way) and I got my very own favicon created.

    5. Next I just added the following HTML code in my Blogger template:

    < rel = "shortcut icon" href="http://www.yourURL.com/favicon.ico">

    6. I didn't have my webspace so I uploaded the favicon into a friend's website. You could use some free webhosting space.(Geocities doesn't work as they filter out .ico files)

    That's it!!

    Get rid of the boring B logo.

    You can see the result above on your browser address bar.

    Monday, June 20, 2005

    PHP: Bad words filter

    Some stupid person started posting abusive words in my company's tag box (shoutbox) recently so I had to write a simple PHP function to find and replace all the bad words.

    Here it is. Not pretty or even efficient but it works!

    function filter($string) {
    $badwords=array("ass","babi","asshole","fark","celaka","pantat","bastard","bitch");
    for ($i=0;$i < count($badwords);$i++){
    $string = str_replace($badwords[$i],str_repeat("*",strlen($badwords[$i])),$string);
    }
    return $string;
    }
    Example usage:

    $post = filter($post);