JavaScript to PHP

[Friday, 25 June, 2010]

There was no achievement for the slacking day except for a successful change of coding from JavaScript to PHP for the updates part of my website.

Since years ago, I scripted it in a way such that it was easy to update without using database. However, it was not ideal for search engine optimization for the bots probably could not read the coding well.

Using the same technique for PHP, bots could crawl through the site and grab all the information.

However, the greatest problem now was that I had to integrate the coding into Blogger for my blog and since it did not support PHP coding, I could not change the other parts.

.

Housekeeping Days – Windows 7

On Monday, the first day of my off days, I started packing my cupboard. Since my elder brother had gone to Malaysia for holidays with his colleagues and girlfriend, I was able to squeeze some spaces to open the cupboard and unload the stuffs.

I looked through the old lecture notes from my poly days and realised I had actually studied many things, which I had totally forgotten and not having a slight impression of them. Since the notes from UOW was all printed from softcopy, I threw them abandoned the hardcopies as well.

Due to my back problem, it took me long time to do my work with the intervals of rest. I even dozed off for long hours in the late afternoon and woke up feeling more tired than ever. Eventually, I finished three quarters of the packing and had to give up.

Day two was another busy day. I started configuring my younger brother’s laptop. It was my virgin try on Windows 7. Installing the software and transferring the remaining of the files on the office’s laptop lasted me for many hours.

My new baby was running on Intel Core 2 Duo CPU, T9400 at 2.53GHz with 4GB of memory. It was the lightest model since a year ago for 17’ inches laptops.

There were, however, many disadvantages. The graphic card could not even support Counterstrike Condition Zero well, let alone L4D which I was reluctant to try. The screen was dim and the sound was obviously not fantastic. I could feel the heat even after placing it on top of the fanning system. It had only three USB ports and all of them were at the right side. My brother had also warned me that the battery life could barely last over three hours.

At least, it was better than my office’s office in terms of RAM and weight (especially). The faulty HP laptop with auto adjustment of volume, refusing “alt” + “tab”, was more than a nuisance to work with. The BIOs problems forcing the draining of battery even when the system was off, killed my entire good impression for HP laptops.

Windows 7 was half an alien to me but I could see the great improvements. I was able to drag the folder upwards to the edge and it would maximum the window other than having to double click the window. The taskbar was neatly organised with all the similar items grouped together, displaying using rectangular icons instead of long bars; on mouse over, each individual icon would pop out nicely. The “quick launch” buttons were merged into the taskbar as well and I soon got used to it. For all the special folders such as “my document” and “my music”, I could see that they were classified under “library”, such that different folders could be added inside, but of course there was a default folder to be assigned.

I had problem with the installation of Photoshop CS3 due to the AVG antivirus. Following was the installation of PHP, which required the web server – either IIS or Apache. I was not confident at all since PHP did not seem to work well with Windows Vista. The other essential software are Microsoft Office 2007, MSN Live Messenger, Notepad++, Flash Renamer etc. I also set up the games.

In no time, I would be ready to strive all the way for my websites without worrying for the transferring and backing up of data files.

.

FYP Presentation was over

It was my last struggle on Saturday morning to finish up all the work, including updating the site and flash video. I was nodding so badly since I had already exhausted myself the night before; and yet, I went off to bed after 3am again.

As expected, I could not wake up a couple of hours later. I was late but the waiting for bus 75 delayed my trip furthermore, such that I was late for more than twenty minutes. I went straight to the student lounge and waited there. While I was trying to setup my laptop to look at the PowerPoint slides, I realized I did not bring my adapter along and my laptop was the only one with PHP installed, which was required for presenting the website. Thus, I sat there without setting up my system, and did my best to recall the contents.

It was near nine AM when I started to message them. Soon Siong called and told me they were already at the third level. The setting up of the game using Ad-hoc network was problematic somehow even though we managed to do it easily at Starbucks a couple of times. The latency was bad. I tried to install PHP into Andy’s system but his MySQL did not seem to be working. We gave up on showing the site as my laptop failed to stay as the server to demonstrate the game, which was the most crucial part.

The assessors were not very interested in all the PowerPoint slides, which disappointed me since lots of efficient was spent. I did not want to skip the parts immediately since Mr Prem did mention a lot during the previous lecture and I thought I need to show him we had made drastic improvements; moreover, I was afraid that the entire presentation would end too early.

The setting up of the game was disastrous. The projector’s screen size turned the interface haywire. Somehow, the connection socket was not working well. Things were not within my anticipation. We wasted a lot of time on the preparation, but luckily, the assessors were not annoyed over it, or at least, they did not appear to. Mr Prem sounded more like trying to help us than to pinpoint us, but, his words had destroyed my hopes of getting a better grade completely.

We were deciding to go for lunch together but Andy dropped out since he had to go to find his girlfriend. Stephen suddenly decided to go off as well. Soon Siong and I ended up going to Clementi hawker to eat instead. I recommended him the famous chicken cutlet. After that, we took the train home. The lack of rest had provoked my backaches.

I tried to clear my emails at home before playing game, but I was too tired to stay conscious for long. In the evening, I went for a jog towards the Marina Barrage again using the Polar system. The strap attached with the device to measure my heartbeat went loose after a while and it made me very uncomfortable. Somehow, it caused problems to my constant pace for I tried to inhale more each time to stop the strap from slipping down. It somehow made my heart work harder to weaken it, and I felt discomfort on my chest to pace my way. After passing by the bus-stop nearest to Marina Bay MRT station, the strap slipped down. It was disastrous. I had to slowly adjust it when there were fewer people around.

Marina Barrage was as crowded as usual with couples, families and groups of friends; inclusive of babes. The strong wind dried me up soon but it did take a break for a short period of time. I sat there alone to watch all the happy faces till the darkness almost overwhelmed the entire sky. My mum gave me a call to tell me that she wanted to dine outside and thus I made my way back. This time, I fastened the Polar strap more. I was hot on my pace but somehow it was not as fast as what I had thought. When I was near the carpark near my place, I saw a babe from the manicure shop.

My mum and younger brother wanted to go to Bugis but we decided to stop at The Central where I met Christine. Then, we went to Billy Bombers after buying my mum Christmas present. We had some advantages since it was my younger brother’s birthday the day before and they had some promotions. The fish was less than what my younger brother had described but the strawberry milkshake was nice.

Date: 12/12/2009
Time: 18:23
Duration: 23:12
Calories: 311 kcal
Average Heartbeat: 176
Maximum Heartbeat: 197
Fat Burn: 00:54
Fitness: 22:18

Date: 12/12/2009
Time: 19:41
Duration: 22:29
Calories: 319 kcal
Average Heartbeat: 182
Maximum Heartbeat: 196
Fat Burn: 00:15
Fitness: 22:04

.

Beautiful Start of the Day

I started off yesterday morning in great delight. I met the cute QA students and Julian kept me entertained throughout the way from Clementi MRT station to the campus. Another great thing was to witness the bus driver going down to help the wheel-chaired student up the bus. Great people made life beautiful.

I proceeded straight to the chin-up bar for the first time this week and managed to complete another set of 12 pulls. I did not know I could do it since my entire body was still weak from the body checkup the day before. I did not expect Chi Chiang to witness my pathetic struggle in my bag containing the laptop.

I went for early lunch with Jingkun. His timetable was quite different from the rest and I was not bothered for the day. We went to West Coast together and even though we chatted quite a lot, we actually took shorter time than usual.

I found myself a normal classroom to avoid all the noises and especially the freezing air-conditioner. Having spent the afternoon with the new project and some aliasing of work, until four plus, Weiming asked me to help him to close the lab. I ended up debugging PHP codes for them and suddenly, Weitat called me to inform me there was a meeting going on.

I was very late for the meeting and when I opened the door, the big bosses were around to give me a shock.

.

Changing File Permission on Web Server

My “Current Online Users” counter was working fine until I switched webhosts.

I remembered clearly I needed to change the permission of the text file on the server before it could work for I was not using SQL database. However, no matter what I tried, even to the extent of changing the permission for the folder, the counter refused to work.

I asked around my friends but none of the programmers was familiar with writing and reading a text file using PHP. I tried to google for solutions but it did not help, until I found on “www.php.net/fwrite” the line “PHP does not recognise the permissions setting for the file until you restart the server”. It stunned me for quite a moment. I was not using a dedicated server and I was not running the website on my personal server or computer, and it would be troublesome to get the server reset; moreover, I could not confirm it would work.

It actually took me a few days from assuming the servers were problematic to suspecting my FTP application was buggy, and finally to the urge to try debugging. My knowledge of the script was too shallow to spot any problem; moreover, I supposed there could not be a mistake since I had been using the same script for years. I started by adding codes into the different files for prompting. The last thing I did was to do a trial and error to remove a space/tab between a “3” and “000”, which aroused my suspicious. It finally worked.

I concluded that changing file permission was an immediate effect, which did not require restarting of the server. However, it might not always be the case for some extremely lousy servers that could or could not have existed.

.

The Website Feeling is Back

Jingkun was on medical leave on Wednesday due to his ankle’s injury. Daniel, Weitat and Kevin joined me for lunch but since we had no car, there was some hesitation at first. The canteen’s only opened stall was the one which I had condemned and thus, I advised them to lunch out instead. Since the weather was hot, I was quite guilty over it.

We walked to Clementi hawker centre and the western food stall was on business for me. I ordered chicken cutlet for Kevin and Weitat while Daniel went for chicken chop. I prepared my coins to pay for my lunch because my wallet was “exploding” but the auntie collected the notes from Weitat when I insisted I had to pay for my meal first. The coins were shared among Weitat and Kevin and it made me guilty again.

Back to the office, I continued with my work. The boredom from doing George’s website design threw me into my own PHP project. I got addicted once again. Ajax codes were improved to “post” instead of “get”, which improved a lot on the security. Alas, time restricted my enthusiasm.

I spent the night with the website after clearing emails and dragged till quite late before going to bed.

Switched from HTML to PHP

It took me quite long to finally switch my entire website from HTML to PHP due to the programming method.

All the while I was using IFRAME and probably nobody could notice it if he was using Internet Explorer; Firefox lovers had serious problems viewing the website. Occasionally I had also been amending the website’s coding to synchronise with both Firefox and Internet Explorer, and thus, if you had been observing the site carefully, you most likely would have found some small improvements in Firefox’s view for certain features.

Since the scripting method I had been using depended too much on the frame, it was a very tedious progress to switch.

What are actually done?
– Entire site is changed from HTML to PHP
– All coding is amended to suit both Firefox 2.0 and Internet Explorer 6.0
– Internal site structure is improved for easier future update
– Menus and submenus are shifted and improved
– Scripting and presentation for various pages are improved

Shifting to PHP also means that I would be shifting from Blogger to WordPress in near-to-come. Next progress is to edit and update the contents. Stay tuned.

Meanwhile, please highlight if there is any error.

From HTML to PHP

I have been working hard to push my personal website from HTML to PHP. Since the current one works with IFRAME, scripting is tedious somehow; too much to be elaborated.

Progress is good and it is almost ready, except that synchronising with blogspot will be another tedious progress since it is an external site. Work shall resume when time permits in case anything goes wrong, there will be ample time to solve it.

Back to PHP Again

[Wednesday, 13 December, 2006]

Gilbert and I were supposed to go for a swim finally but I woke up only at 10am, feeling weird that he did not call me at 9am as agreed. Then, he told me he felt lazy. Since I went to bed very late, I started to feel lazy as well. In the end, we did not go out at all.

Nothing much was done in the drowsy afternoon until the early evening, my enthusiasm for building the website for my job erupted.

The first thing I wanted to do was to try out PHP. I had been using frames so often in my websites that it was difficult to display individual pages. There were of course some advantages but still, for more commercialised website, I decided to drop the old method.

I needed to keep all the pages constant, such as the side navigation and top banner. I wanted to maintain just a file like the frames so that when I needed to change the design or layout, I needed not edit all the pages.

It was hours of time consumed and yet nothing seemed to work out. Shamefully, I only managed to do the template using external text files, which was so unprofessional. I messaged Irwin who never ever denied my approach for help. We spent quite a long time trying to figure the problems. I did countless trial and errors and finally…

It worked.