The Daily WTF Changed Name? WTF!

Posted by Ikhwan on February 28, 2007

I’ve been busy lately and not being able to catch up with my feed reading as usual. And when I skimmed through unread items for TheDailyWTF today, I realized that they’ve changed their name to “Worse Than Failure”. wtf! Come on, I like the old name better. This is so lame…

Mail() Makes Me Want To Hide Under A Rock

Posted by Ikhwan on February 13, 2007

I’m having a problem with PHP mail() function in my web hosting, but it worked several month ago. I guessed this is because they enabled sender address checking, as per an email they distributed some time ago, to make sure you do not use some bogus “from” address for spamming, phishing etc.

Ok, instead of using just plain mail($to, $subject, $body), I’ll change it to mail($to, $subject, $body, 'From: me@mydomain.tld'), adding “From” at the mail message header. Fair enough, no biggies. But when I tried it, it didn’t work!

It returned the error Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for receiver@someemailaddy.net in MyFile.php in line 666. Arrrghh. Stupid son of a mother… I then quickly tried sending mail from the webmail provided by the hosting control panel. It worked just fine!

Going into tension mode now. Okay, maybe I’ll go contact support, they’ll help. I went to the hosting website, and saw that their online chat support is online. Wow, 11.00 at night, and this is a local hosting. Can chat in Malay some more!

“Hi, mail() in PHP not working, error message: SMTP server response: 550 5.7.1 Unable to relay for blah blah blah”

The support person replied after several minutes, “Thanks for [some standard template message]”.

“mail() not working blah blah blah”, I repeat the problem.

“What’s ur domain?”

“ikhwanhayat.net”

“There’s nothing wrong. If not then thousands of user would have that problem. It’s ur code.”

What?! You are accusing me a newbie now! Demmit, I’m a professional developer you know! I write codes for a living okay! I’ve been known to be coding in my dream you know!! But of course I didn’t said it out loud, although I’m rather annoyed now.

“Do you set it to mail.ikhwanhayat.net”

“Yes, I did put the MX entry to mail.ikhwanhayat.net”, I explained, because some time ago I did change it to something else.

“U don’t need to change any MX records, that’s for DNS. It is not related. The problem is ur code.”

Hey, I know that, I’m just trying to imply that I’m not a newbie okay. I know MX records things okay! Not a n00b!

“Okay, I’ll check my codes again, maybe I left out something”

And I created a simple file, with just one line mail() function in it, upload it, and run it… And it worked fine!.

Wait… something fishy is going on. Oh no, is it because… aarrgh, demmit. I should just gauge my eyes out and feed it to the dogs. It just’ve dawned upon me that I did change my codes, FTP’d them to the server, but I tested the code in localhost.. -_-” Arrrgghhh.. this is so embarassing. My localhost can never do mail(), it’s Windows, I’ve never did gone through the hassle to setup the SMTP or whatever to make it work.

Okay… I’ll admit now that I’m a PHP n00b! Freakin’ st00pid n00b!!! I am so ashamed of myself, let me go hide under a rock.

Then I gave some lame excuse and said thanks to the support, and ran away as fast as I can. Heh, they got online chat support at night, my web hosting MesraHosting.net. (free link ad for you, I felt guilty that I disturbed you with my n00biness).

Programming Challenge at ITTutor

Posted by Ikhwan on February 10, 2007

Beberapa minggu lepas, aku submit satu programming exercise kat ITTutor.net. Ia berkenaan satu game ringkas bernama FizzBuzz. Saje je nak tengok macam mana satu soalan ringkas diselesaikan melalui pelbagai cara. Ramai juga yg memberi sambutan. Dapatlah tengok macam-macam algorithm dlm bermacam-macam language.

Kemudian, ada pulak yang submit challenge lain. Yang ini tentang memodelkan hari-hari dlm minggu dalam bentuk OOP. Antara requirementnya ialah dapat listkan hari, listkan hari tu in reverse, listkan hari bekerja shj, dan listkan weekends.

Hari ini, ada satu lagi. Kali ni lebih susah sikit, tapi menarik. Gunakan Flickr API utk paparkan gambar-gambar dgn carian berdasarkan tags. Aku lebih suka kalau soalan-soalan lebih simple, tapi bermain-main dgn algoritm, sebab soalan mcm ni lebih senang org nak join. Tak perlukan library yg kompleks, jadi byk language boleh join, tak perlu advance knowledge tentang language/platform tu. Tapi kita tengok macam mana dulu, maybe byk juga sambutan.

Aku sangat suka challenges mcm ni. Pertama sebab dapat tengok code orang lain, boleh tengok mcm mana orang lain solve problem. Kedua, boleh latih diri sendiri, bukan shj utk language yang kita dah tahu, malah boleh push kita utk learn new languages.

Kebelakangan ni, rasanya ittutorian yang aktif kat forum pengaturcaraan nampak ramai yang handal-handal dan lebih diversified. Kalau dulu, buat quiz mcm ni selalunya mesti orang reply dlm sama ada code VB, C/C++, C#, PHP atau Java. Mainstream languages. Sekarang ni kita boleh tengok Ruby, Python, JavaScript, dan sebagainya.

Update:
Beberapa blog terkenal membincangkan tentang soalan FizzBuzz (rujuk paragraph 1 di atas).
Jeff Atwood (Coding Horror)
Scott Hanselman

Sedikit sinopsis, Imran, tuan punya entry asal mengenai FizzBuzz tu, menggunakan soalan ni utk menapis programmer semasa interview. Tapi, yang mengejutkan ialah, ramai yang tak boleh buat soalan tu, walaupun soalan tu nampak simple giler!

Good Bye RHBI

Posted by Ikhwan on February 09, 2007

Yesterday was my last working day at RHBI. I’m changing jobs! It’s kind of a big deal to me, ‘coz this is my first time. First time tendering resignation, first time packing up and cleaning my desk, first time quiting my first job.

I’m pretty sad about it, rather speechless actually at the end of that day. Same feeling like when I was leaving school. I’ve been working there for about 2 and a half years. That’s like from form 4 until form 5 added with half a year in lower 6. Maybe not long enough for some people, but long enough for me to feel attached.

This is the place where I first learn and fall in love with .NET. Growing up and starting a journey as a professional software developer. In fact, I feel like there’s unfinished business when I leave. Two big projects was under me and both are still not quite finished. Sadly I can’t be there to see them released to the production.


All the best for my ex-colleagues: Vincent (the nicest boss in the whole company), Jayce (always changing hair-style, looks good in all of them), Yus (call me if you need help with the payung again), Nick (the really quiet one), Colleen (the really loud one), Harris (quite a chatter, especially about techies stuff), Joseph (the team mascot, so fun and cheerful.. and red), Siew Kien (like to ask me “tak pergi makan ke?” if she sees me at my desk at lunchtime), Gary (I wonder if he ever got sore throat answering that many calls everyday), Ley Koon (like to call me Superman coz my hair curls at the front), Kak Zima (thanks kapten for the baju melayu, I don’t have to wear green every Friday anymore), and finally my secret admirers Peck Li (can’t forget the face expression when you’re suprised) and Elaine (we have so much in common, it’ll be hard for me not to remember you too much)
.

Farewell, thanks for the experience, thanks for the memories.