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…
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.
Backup your Mac with AppleScript
All programmers are lazy. They want to automate tasks as much as they can. Because of this uniquely great habit, they have developed countless of useful software.
Ok. I am lazy. I have been using rsync to sync folders I am working on between my Macs. I have been using command line scripts in Terminal for almost two years and finally I have gotten lazy over the task.
The thing is, I need to execute the scripts in Terminal every time I want to synch my folders. Of course, I could simply use cron to automate the tasks at specific time but I ran the risk to cause havoc between the folders on different Macs. It is best not to cron the task.
So, I learned up AppleScript and after a ten-minute hack, I wrote a nice AppleScripts to do the job. It is quick and dirty.
set debug to false
with timeout of (30 * 60) seconds
tell application "Terminal"
set Window_Title to "Sync Documents"
set Rsync_Cmd to "rsync -acrtv --delete
/Users/username/Documents/
username@xxx:Documents"
set output_doc to do shell script Rsync_Cmd
choose from list paragraphs of output_doc with prompt
"Result:" with title Window_Title with empty
selection allowed
end tell
end timeout
Copy the script to ~/Library/Scripts/Applications/Finder and save it as “sync documents.scpt”. Then launch Script Editor to edit username to your login name and xxx to your Mac IP address or computer name. This script will sync your Documents folder under your user home directory. To execute this AppleScript, at Finder, click on the script icon on the menu bar and select the script to launch.
rsync uses ssh. If you have not setup a password-less ssh login, you will need ssh-askpass in /usr/libexec. Unfortunately, it does not ship with Mac OS X. You can get it at Joe Mocker’s weblog.
Objectively Boolean
I was introduced to Objective-C in a workshop organized by Apple Malaysia about 3 years ago. Read my posts here and here. No real development using Objective-C after that.
One plain reason for me to pick up Objective-C again recently is to develop Cocoa and Cocoa Touch applications for the Macs and iPhone (and iPod Touch). Trying to having nonpartisan mind after so many years of using Ada (and away from C/C++ and variants) is a difficult task to comprehend. As an individual Ada developer (having my own opinion) I am finding C/C++ very compromising in many ways, for instance, readability of codes and safety. Although Objective-C has many improvement over C/C++, it is still lacking what Ada offers.
By syntax, Objective-C is still very much like C. A few obvious clues to tell if it is an Objective-C are the use of #import, instead of #include; the @ sign; the Smalltalk-like message passing syntax and several others.
The #include statement in C/C++ has many drawbacks. One which seriously affecting compilation efficiency is the repeating includes of same header files. With #import, header files are included once only throughout entire compilation.
One deadly pitfall I have encountered so far is the way Boolean type is implemented in Objective-C. C supports Boolean data type, bool, which takes on the value of either true or false. Objective-C has similar data type, BOOL, which is 8-bit number that takes on YES as 1 and NO as 0. If you unwittingly assign a 2-byte integer to a BOOL type, the result can be catastrophic. Only the lowest byte will be used for the value of BOOL. If the lowest byte is zero, for example, 4608 which its hexadecimal value is 0×1200, BOOL will be zero or NO.
Ada’s strong-typing disallows this to happen and thus saving, possibly countless hours of debugging. Personally, I like neither bool nor BOOL. I prefer Ada’s Boolean.
Unlike the dreaded C++, Objective-C does not support operator overloading and multiple inheritance. In Ada95, a restricted form of multiple inheritance is supported. In Ada2005, multiple inheritance is supported by new form of type called the interface type, similar to abstract tagged type with no components.
Apple TV playlist
I have installed an Apple TV at my client’s office waiting area. His purpose is to educate his patients while they are waiting for their consultation. That is a brilliant idea as we had long and boring waiting experience when LA was consulting him.
The idea is to design different programs with advertisements and messages interleaved among documentary and his own educational videos for playback on different days of the week. And the most important thing is to allow the doctor himself to easily update his educational videos and advertisements anytime as he wishes from his new 24″ iMac.
After I installed Apple TV a few days ago, I realized it did not have movie playlist. After Googling for a while, I wasn’t alone. Here is a blog entry with the same problem. And I found out the Apple TV Software Update 2.3 allows movie playlist in iTunes to be seen on Apple TV. I downloaded the 2.3 update this afternoon, and after I activated the movie playlist in Apple TV settings, it is now able to play the movies in the playlist as desired.
I pondered why Apple did not ship Apple TV with new software update 2.3. It was released in November 2008. About the Apple TV software update can be found here.
Another ultimate experience
When LA birthed Richie, I was there with her almost the whole day in the labor room. That was the first awesome experience in my life. About three years ago, when LA birthed Nik, I was there with her in the operating theatre (OT). That was another more wonderful day in my whole life. I could hear her doctor cut open her lower abdomen (Caesarean section).
Almost a month after Nik was born, I suffered from retina detachment and had to undergo a surgery to repair it. That was myself experiencing the first surgery of my life. The experience was really awesome and I had some mixed feeling.
This afternoon, I had to test out some equipment in the OT while the doctor was performing laparoscopic surgery. Like the second experience, I had to put on the surgical gown and mask before entering the OT. Only this time I was with the doctor.
That's me in surgical clothing
Although the laparoscopic surgery was not invasive, it was thrilling enough to witness the live performance before my own eyes. At least, it has proven I have a strong stomach up to this level.
A good head start
Happy New Year 2009 buddies!
It seems like a good head start for me. Everything I planned for today seems to be smooth sailing although I am having one problem which I do not know why it happens. I guess I will need to toy with it and/or hack it to learn why it isn’t behaving as it supposed to be. If everything is running perfect before end of this month, I will acquire an iPod Touch to proceed further. This will be my first wish on this very first day of 2009.
Busy
Dear family, friends and readers,
If you have noticed, I post less starting October. Perhaps some of you are wondering why. Yes, you are right, I am busy working on my research and the thesis. Please continue to check my blog regularly and all comments are welcome. I will check and reply comments and will write new posts when time and ideas sneak in. I will be writing selectively rather than random thoughts.
Thank you for your patronage.
Butterworth low-pass filters
I was reading about Butterworth low-pass filters since two weeks ago. Signal processing was not my favorite but this particular linear analog electronic filter had somehow captured my attention. I have interns working on some projects. One project uses Butterworth low-pass filters to process signal acquired from some sensors.
I have to verify their works using Mathematica on Mac OS X for data modeling. But there is a problem with this software. It does not have a built-in function of Butterworth low-pass filter so I need to build one.
The gain G(ω) of an n-order Butterworth low pass filter is given in terms of transfer function H(s) as:

where ωc is break frequency.
The Mathematica code with break frequency normalized at 1 rad/s:
butterworth[w1_, w2_, o_] = 1/(1 + (w1/w2)^(2*o));
LogLinearPlot[
Evaluate[Table[
10*Log[10, butterworth[w1, 1, order]], {order, 5}]], {w1, 0.01, 100},
PlotRange -> {-100, 0}, PlotPoints -> 100, ImageSize -> 400]
Export["butterworth.jpg", %]

Plot of the gain of Butterworth low-pass filters of the n-order 1 through 5.
Writing a conceptual paper
This may or may not be the greatest invention or rather I will not call it an invention yet. I am thinking of how to write a paper to record the conceptualization of my idea which I talked about earlier. First, at this point, I can’t discuss my idea with anybody in order to protect my interest; that makes the writing more difficult. Second, I have nothing to prove so writing this paper is like writing a Sci-Fi novel. So, I need a different approach, may be.
I dug out my collection of conference proceedings yesterday afternoon, hopefully I could find some inspiration. Obviously, I haven’t.
Hello? What is Ada?
I was giving an Ada talk this afternoon. The room was quite packed with students although not full. They were mainly 3rd year sem 1. Most of them were looking at technologies that they could work with their FYP (Final Year Project).
While I regaled them with fascinating true facts of Ada, I could see various reactions on their innocent and ignorant faces. Almost half of them gave an expression of “What is Ada going to do with my project?”, “What is Ada? Never heard of it.” or “Ada is old technology and is unpopular.” It was years of experience telling me not to waste too much time with such audiences. I quickly skimmed through some technical facts which they wouldn’t understand and continue regaling them with some interesting facts.
Finally, I had come to the end of the talk. It was the questions and answers session. No one had asked any questions except a girl who asked me about C# after the talk session was over. I explained to her the benefits of Ada over C# but she said she would have to start all over again. Again, my instinct told me not to waste time with such attitude and I turned my focus onto the two students whom I am supervising now. I continued with them a discussion of their project.
Unlike a couple of years back, I was too over-enthusiastic about Ada. I would talk regardless of audience reactions. After a few talks and a seminar this year, I find that I have changed. My enthusiasm is parallel to audience reaction.
Working at Honda?
I was working at Honda’s Showroom (KAH Motor) while I waited for my car to be repaired since 0830 this morning. One thing Honda has done right is the 3S (Sales, Service, Showroom) Center. They provide free drinks, Astro and WIFI for customers. The waiting area is very comfortable and cozy. One thing lacking is insufficient seats.
It was great experience to do my work at Honda’s showroom. I have a lot to prepare for the Ada Workshop tomorrow.
Ada Obsession
Well, well, well. Kazeserver alpha RC1 has to be delayed due to some design issues and I am rewriting most part of the software so that the source can be understood easily. For the past two weeks, I was troubled by the old design but I have got a new picture now.
Isn’t Ada code easy to understand? Well, yes. But I was using a lot of Unbounded_String in records which made my code hard to read and understood. While Unbounded_String is compatible with database operation, it lacks the understandability and readability if compared to String (1 .. 10) for example.
Today, I am totally obsessed in Ada and am feeling the strongest Ada obsession after a couple of years. The feeling is still burning. If my Ada obsession keep burning, I believe I can release KazeServer for alpha testing before of June. Hopefully.
Increased productivity
After solving the post-commit hook script problem (read here), I am a happy software developer again. I am able to receive post commit emails to help me keep track of changes in my development work. I have been experiencing the same level of efficiency and productivity before this problem struck me.
I guess I am happy of the whole week of activities and I am signing off to bed.
Gourmet Chocolates
I love chocolates! Recently, I craved for chocolates because of the increased brain activities. Chocolate is the favorite food while I am working on computers. Besides providing more energy for my brains, I love the way it melts in my mouth. LA has baked some chocolate cookies last week and I almost finished them.
I found a site which sells delicious gourmet chocolates. Gertrude Hawk Chocolates is made of fresh and finest ingredients. It is dedicated to create the best gourmet chocolates which include dark chocolate and other mouth-watering, delicious Chocolate Smidgens, caramel-dipped apples, gourmet summer taffy and many more.
Gertrude Hawk Chocolates also provide gift giving service. Their beautifully gift-wrapped assortments and pre-made gift baskets add more values to your gift-giving needs. Besides, you can also create your own personal gift with their Create-a-Basket program.
Hmmm… I wish to receive a Gertrude Hawk Chocolates gift basket.
DocBook Publishing – Output to HTML
I learned about DocBook last year and found it a great tool for technical documentation. It is a XML based semantic markup language. The DocBook is originally intended for computer hardware and software documentation but it is great for other documentation purposes.
I have been working on some documentation, new and converting existing from Lyx to DocBook. With DocBook, I am able to publish the contents easily to many formats, namely TEX, text, pdf or HTML. I had been trying to output some of my DocBook documentation to HTML.
This afternoon, I have finally succeeded to publish to HTML. I installed some DocBook packages on Ubuntu. Here are the packages you need to get DocBook going:
- docbook
- docbook-xsl
- docbook-xsl-doc
- docbook-xsl-doc-html
- docbook-xsl-doc-pdf
- docbook-xsl-doc-text
- xsltproc
- and optional xalan and fop
To output your DocBook document to HTML, simply this:
$ xsltproc --output paper.html \
/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl\
paper.xml
You can turn on chapter and section numbering by setting chapter.autolabel to 1 and section.autolabel to 1. To include the chapter number in every sections, set section.label.includes.component.label to 1.
$ xsltproc --output paper.html \
--stringparam section.autolabel 1 \
--stringparam section.label.includes.component.label 1 \
/usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl \
paper.xml
Patched a security hole in KazeServer
While I was at Honda waiting for the technician to reprogram the ECU, I found a security hole in the authentication part of KazeServer. An unrecognized user id with a null password would grant access to KazeServer but without any significant usability but posed a potential risk.
I quickly identified the cause and rectified the problematic logic in the program design. One down and many to do. One of the other critical problem is that KazeServer will get over with initialization and execute even without the MySQL server is running. A serious bug though.
Another 3 more days to release Alpha RC1 and yet so many problems and unfinished parts. I feel the release will have to be postponed then.
Pre-Alpha RC1
I am in the midst of getting the KazeServer to roll out. During this pre-Alpha RC1 stage, works have been a little pressured especially cleaning up parts of the codes to make it neater and more efficient. A number of factors are also affecting during pre-Alpha stage.
One of them is the gnat Ada compiler issue on Ubuntu Hardy Heron or 8.04. Hardy comes with gnat-4.1 with a number of packages not added. Without these packages, I can’t build AWS-2.3. So, I have to roll out Alpha RC1 on Mac OS X until Ubuntu Intrepid or 8.10 with gnat-4.3 is released (hopefully with gnat-4.3 by October). I have another option which is I have to move to Debian Etch with gnat-4.1 but including the libaws-2.2.
libaws-2.2 is a pre-built library for AWS on Debian Etch. I am developing using gnat-4.4 and AWS-2.3 on Mac OS X. Moving to Debian Etch means I am downgrading the version of gnat and AWS and I feel a little skeptical about it. This is one thing I hate most, version inconsistency among the Linux distro.
After talking to my friends on this matter, it looks like I have few choices but to target on Mac OS X for the moment considering the tasks of installing and get the Debian Etch up and a whole lot of uncertainties in gnat-4.1 and AWS-2.2.
Entering Alpha stage
Finally, after weeks of experimental development, KazeServer is entering Alpha development stage. I expect to roll out Alpha RC1, hopefully before this weekend.
KazeServer is a web-enabled membership management system that allows registered members of an organization to login to review their membership data and other membership related transactions or records. KazeServer is developed 100% with Ada and AWS (Ada Web Server). The application itself is a web server. No web server, e.g. Apache, is needed to run KazeServer. It is a totally stand-alone independent application with a built-in web server (AWS).
佛学 佛教 地藏经 太极 般若 诗 Ada algorithm Apple AWS behavior bread bread maker Buddhism cataract cataract surgery chinese input Christmas DAP Debian diagnosis earthquake emergency encryption Family Flywheel Food fracture free sparring Gifts gnat GPS Health heart holiday Honda HOWTO information Injuries input method iPhone iPod Touch iTunes jiyu kumite Karate karate-do kata KazeServer kumite Lamport laser retinopexy Leopard Linux Mac MacBook Mac OS X Malacca Malaysia Martial Arts Medical melaka MMU mysql Okinawa Olympic 2008 Penang Philosophy Photography pneumatic retinopexy Politics posterior vitreous detachment Princess psychology PVD recycle Research retina retina detachment retina repair retina tear Sanchin scholarship science scim Security Sichuan sparring Sports SSH stroke Subversion tongue training Ubuntu vitrectomy Wenchuan wholemeal wordpress Xcode Zakimi
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.


Listen to my podcast