Catching HTML bugs with Safari 5
A bug in a seemingly harmless HTML code had been bugging me for almost 2 weeks. I was sort of yanking my hair while trying to trace the bug which messed up the HTML page. The debugging task was even harder because I work on a HTML template with an extension .THTML. The template does not only contain standard HTML but also tags which are only recognized by AWS (Ada Web Server) . This template file is parsed by the web application (I am developing), which has AWS library, before it is dispatched as raw HTML code to a browser.
In my design, I break down the HTML template into header, body and footer so that I can reuse the common codes in header and footer. That means, all the body templates are without <html> tag. This missing <html> tag disables the syntax-coloring feature of code editor, leading to a more laborious code reading.
Before this, I had gone through every line of html source code in the template file umpteen times. This “obscure” bug, if not removed, would throw a monkey wrench in my works. I browsed the Internet and read articles in hope that I would get some clues. So, I was reading a few articles about Extensions in Safari 5. Extensions are not really impressive to me as I do not need to add missing functionalities to my browser. Safari itself is more than enough for my daily browsing activities. Somehow, my curiosity had driven me to enable the Develop menu in Safari 5. After activating it, I noticed some debugging tools in the menu. I enabled the web inspector by selecting Show Web Inspector in the Develop menu (Figure 1) then navigated to the web page I wanted to debug. To use these debugging tools, the Develop menu must first be activated. Here is a simple guide to enabling the menu.

Figure 1
Safari 5 immediately detected two error messages as shown in Figure 2. These two errors were easily corrected. After removing these unmatched </div> tags, my web page still did not show up properly with the intended layout.

Figure 2
Then I selected the Elements tab and it showed me the page source in debugging mode as shown in Figure 3. I instantly spotted the <div class=”data-base-layer”> tag which was supposed to be in the <div id=”container”> tag.

Figure 3
I clicked on the little grey triangles in the left pane to expand the <div id=”container”> tag and the <form> tag. There were two <div class=”data-base-layer”> tags (labelled as “1″ in Figure 4) and the one in label “2″ was supposed to be right after them.

Figure 4
I checked the source file again and they seemed to be in the correct place. Further investigation finally reviewed that there were two very tiny typos lurking somewhere within the second <div class=”data-base-layer”> tag as shown in Figure 5.

Figure 5
The web inspector in Safari 5 has helped me to identify errors effortlessly. If only I had such inquisitiveness two weeks ago, I would have saved so much time and efforts in debugging my HTML codes. An proverb says: “Curiosity killed the cat.” It is not always true, at least in this case. I will say: “Curiosity saved the donkey.”
Transverse Myelitis
Just came back from the hospital after visiting my uncle. He has been admitted to hospital last evening. He was admitted to the General Hospital last Thursday and was discharged this Sunday. No conclusion from the GH.
His doctor came in when I was there. He said my uncle suffers from acute Transverse Myelitis.
Transverse Myelitis (TM) is a neurological syndrome caused by the inflammation of spinal cord. It is a complicated disease and takes times to eradicate inflammation. His doctor has done lumbar MRI today. They will do another thoracic MRI tomorrow to confirm clinical diagnosis.
Timeless memories
I used to have the desire which my ashes will be carried away by ocean waves and winds. This morning, I came across this website, Glass Remembrance, where a person’s ashes can be made into beautiful hand-made glass art.
I like to be preserved this way after my death. My children can have a portion of “me” in a nice decorative glass flower in their home, if they want to.
iPhone is good for business
As I promised earlier in an article that I would write about my experience of using the iPhone. Well, here it goes…
Good-bye 2009!
The year 2009 is not my favorite year. Despite of some happy moments, 2009 is a year of sorrow and suffering, at least for me. I have recorded enough all the happenings in 2009 and let the memory be the past. So, good-bye 2009!
Well, I have only one New Year resolution for 2010, to fully implement my MIS (Medical Information System) at client’s site before 2010 ends. Simple as that.
I got an iPhone
If you have followed my blog, you must be aware of how I criticized about iPhone and Apple’s aggressive strategy with mobile carriers in my article, “iPhone is in Malaysia!” I have also been going around telling customers and friends that iPhone is not as useful as it seems and is more a toy to attract young generation.
Well, I admit that I was wrong. I am developing a cloud/web-based MIS (Medical Information System) which enables patient to be able to view certain information and interact with the clinic/doctor from anywhere. Likewise, it also provides doctors greater mobility and still are able to care for their patients while they are away.
After reading articles (on Apple’s website) how iPhones help hospitals in the U.S. to provide better healthcare at lower cost, I decided to build the MIS with iPhone support. I based my decision on these reasons:
- Ease of use. I have been toying/using around with an iPod Touch for a few months and I find that it is easy to navigate/use. iPod Touch is essentially an iPhone without the phone. You get what I mean.
- Beautiful UI. Apple is well known for its brilliant UI (User Interface) in Mac OS X and iPhone OS. Nothing else comes closer to it.
- Security. All applications must be approved by Apple and be signed with license keys issued by Apple. Apple’s iTunes Store is the only place to download applications. I can be rest assured to have less (or none) headache about spooky applications from unreliable sources. Of course, there are jail broken iPhones which do not play by the rules but I am not too worried about that.
So, I went ahead ordering one last week. Last night, I went to Maxis center to collect my 32GB Black iPhone. It is such a beauty.
Give me a couple of weeks mingling with it and I promise you I will write about my experience.
Nightlighting
Recently, I have been reading a little about women’s health while working on a software project. It is astonishing to know most of the facts about women and women-related illnesses. When reading about menstruation, I learned some terms such as menarche which means woman’s first menstruation, dysmenorrhea which is a medical condition characterized by severe uterine pain during menstruation.
Heredity, diet and health condition can affect a young woman’s menarche. This is something most parents with growing young daughters have overlook. Diet plays a very important part in young women especially teenage girls. Many teenage girls despite of having their menarche years earlier, neglects or intentionally limit their dietary intakes for body slimming purposes. This ignorance can seriously affect their reproductive system.
One most interesting fact I learned about menstruation is the term “Nightlighting”.
The word “menstruation” is etymologically related to “moon”. The terms “menstruation” and “menses” are derived from the Latin mensis (month), which in turn relates to the Greek mene (moon) and to the roots of the English words month and moon—reflecting the fact that the moon also takes close to 28 days to revolve around the Earth (actually 27.32 days). The synodical lunar month, the period between two new moons (or full moons), is 29.53 days long. — Wikipedia
In some traditional societies without nightlighting believe that women ovulate in full moon and menstruate in new moon. There are studies in both humans and animals where artificial lighting at night does alter the menstruation cycle. While none of the studies have suggested the lunar phase affects the ovulation cycle, bright light exposure in the morning stimulates more regular cycles.
Research also suggested that sensitivity of women’s cycles to nightlighting is related to nutritional deficiencies of certain minerals and vitamins. Again, balanced and healthy diet is utmost important to women’s health.
问心无愧
在这短短几星期之内,所发生的一却事情,都不是局外人所能理解的,包括当事人在内。这些变化有如风云难测。被人冠上莫须有的罪名,再加上这些人和周围的人的一极化思想,要做到问心无愧,谈何容易。
接下来的,不会只是一场暴风骤雨这么简单。现在最重要的是把手上的软件工程开发出来,抢先把一却安顿下来再说。
Making my dad proud
Perhaps this is the most difficult post ever for me to write. A mixture of emotion makes it even harder to start and it is impossible to write this post without shedding tears and touching emotion.
Night watch
Last night I was on duty to watch over my father at Hospital Pantai. Before my shift began, LA and I went downtown for a quick dinner and also to buy some satay for my dad upon his request. We were back to the hospital about 9-ish. Since my dad was very hungry, they did not take his glucose level. He finished his satay aout 9:30P.M.
About 30 minutes to midnight, the nurse came in to give dad some medication and his nebulizer. I told the nurse about the glucose level and she took the reading after everything was settled. I reminded the nurse to take note that the glucose level was taken post-supper. Then we tucked my dad to bed.
Half an hour later, he said he wanted to pass motion. I called the nurse to get help. Then there was some commotion. Two nurses and I helped my dad to get up the bed to sit on the commode. While waiting, the nurses changed the bed linen. Unfortunately, nothing had been passed out. Dad actually fell asleep around midnight.
Around 1:45A.M. this morning, he woke up again. He wanted to pee and to have some water. Then he went back to sleep. He was sleeping quite soundly that I could hear him snoring.
He woke up again at 3A.M. complaining his back was itching. He told me to rub some Betamethasone cream. He went back to sleep only this time he was sleeping sounder. Unfortunately, he was disturbed by the nurse again 5A.M. in the morning. The nurse took his blood pressure and glucose level reading. His glucose level was 6.5 compared to 13.5 at 11:30P.M. After the nurse gave him medication and empty his urine bag, he went back to sleep.
At 7A.M. another nurse came in trying to wake him up for a morning wash, I told the nurse to allow him to sleep. The nurse told me that there would be no student nurses today because of the Merdeka holiday. I replied without hesitation, “Then the nurse can do it. That’s what the nurses are for.” The nurse wasn’t quite happy getting a whack (literally) from me. She stood there for a while then took off.
As there were college students came to do their internship with me before, I really dislike the idea that businesses and company take advantage on interns as a damn cheap labor to do all sort of donkey jobs. I can imagine how these in-house nurses take advantages on training nurses and get them to do all sort of donkey jobs the in-house nurses won’t like to do. I think that nurse deserves a whack from me.
He woke up at 8A.M. to wash, took his breakfast and medication and watch the live telecast of Merdeka celebration on TV.
Mom, Mee and BS came so I went home at 9A.M. Before I went home, a nurse came to assist my dad to the washroom for passing motion and then gave him a morning bath.
Protected: Conclusion statement
Irresponsible doctor on-call
Last night, I was experiencing pounding pain on my left eye which was radiating to the back and into my brain that caused headache.
I called ISEC emergency number and spoke to a nurse on duty. She advised me to go to A&E of a nearby hospital to have my eye checked. One of the factor could be infection.
LA took me to Pantai Hospital. After the medical officer had examined my eye, he rang the opthalmologist on-call, Dr. Lim.
From their phone conversation, we could tell that he was reluctant to come. After many times of persuasion and insistance by the medical officer, he finally agreed to come. But we were told that we would have to wait. What an arrogant bastard!
A doctor on-call is a doctor on night duty. He has to respond to emergency cases at night regardless of the parient’s condition. This doctor’s attitude was really irritating. WTF! After some thoughts, I decided to go home without seeing him. I did not want this irresponsible doctor to earn my money. Furthermore, my pain had subsided due to the paracetamol I took before we left home.
iPhone 3.0 Software Update
A couple of weeks ago, the iPhone 3.0 software update was official launched. I connected my iPod Touch to iTunes 8.2 and clicked Update. Unfortunately, iTunes said that the update wasn’t available at iTunes Malaysia store. I wasn’t very happy with the service Apple has provided. The update was supposed to be free but it would cost me US$9.95 to upgrade my iPod Touch to iPhone 3.0.
Here’s the screenshots (click to enlarge): Read more
I need a vitrectomy
This morning I checked in to the clinic and the doctor who replaced my doctor told me that there was a large tear and the water (vitreous fluid) had sipped into the tear. Retina detachment was forming and was progressive. He insisted me to seek expert advice from a VR (Vitreo Retina) specialist in Kuala Lumpur.
Upon hearing his comment, what I feared most had stricken down my spine. It was inevitable finally. What has to come, has come. I had to accept the reality. My mood swung 180 degrees.
I see a shadow
Perhaps, the worst nightmare, I have been expecting. After an afternoon nap, I woke up to see a shadow at the bottom of my left vision. It was not black or grey shadow but simply shadow which I could not describe. It was almost 5PM and I quickly told LA to give my doctor a call and hopefully still could catch him at his clinic. The doctor told us to check in his clinic and he would wait for us.
By the time we arrived at his clinic, all his staff had gone back after clinic hour. He was waiting in his office. After the examination, he told us everything was stable and nothing to worry about and he gave me another (4th) round of laser retinopexy. According to him, he felt better to give me another laser to secure the area surrounding the broken capillary which ruptured last Wednesday.
After the laser, he assured us again everything was stable and I would be fine. He sent us home and told me to check in again the next day for a follow up. He also told us that he would not be in so another doctor from Terendak Military Hospital would replace him.


Listen to my podcast