Making PHP Work For Me

It's still snowing outside ...

I know it's such a simple little thing, but I've just added a cool little check to the load of this page that will see whether someone is using a PPC device before deciding which version of the site to load. There are two main pages for this site. The one with all the graphics and Java that is seen on desktop browsers, and the one that is very simplified text that is used for mobile devices where data costs 5 cents / KB (give or take). By adding a very simple HTTP_USER_AGENT command in my index.php file and looking for the "PPC" string, I'm able to redirect as necessary.

Yeah, this is a pretty simple thing, really. But I thought it was rather cool.

For the past four years I've focused pretty heavily on the Microsoft technologies available with VB and C#. I was accustomed to seeing things in a very broken apart way. However, now that I'm learning more and more PHP, I can see that the MS direction was the wrong direction to follow for so long.

Several people have told me about the power and versatility of PHP and the newer web languages, but I had held grudges against them, and by extension, everything they favored. However, as I try to grow up just a little more, I can see why they had promoted these technologies while I was content to work with smart-client apps written mainly in VB.net with a SQL2000 back-end.

One of the funniest items that I've noticed is that a LAMP server will run on almost anything. Given enough time, I'm sure a digital Timex watch could host a server. This is not the case with the Microsoft technologies, where a pretty robust machine is required just for the base OS and IIS (not to mention everything else that typically gets dumped onto a web server). My LAMP consists of a simple 200 MHz RISC processor with 32 MB ram. It's all condensed inside a little enclosure just large enough to hold the main circuit board and a 3.5" HDD. Sure, it's not the fastest box in the world, but it gets the job done.

Of course I think I've pretty much reached the end of what I can do on a personal site. In order for me to learn the next level of functions and technologies, I'll need to work with something a little more powerful, and develop a solution that will push my infantile knowledge of PHP and MySQL even further. At work there is a development BSD box that hosts several of our test sites. I think it's time I start pushing the company to afford my training. Depending on what decisions are made in the next four months by management, this learning time could be later put to very effective use.

I know I said that I wouldn't make this site a geek discussion ... but sometimes the simplest things can spur me on to learn the next level of a particular skill. Depending on how much I can learn between now and January 2008, the future might be a little brighter for Reiko and myself.

Vancouver Under Siege

The snow is still falling.

It looks as though I might just be working from home, tomorrow ... which means barely working as most of the tools I need are on the network at work, which is not directly accessible to me outside.

There have been reports that Vancouver will have about 40 cm of snow fall in total. This is a pretty big amount for a city that hasn't seen 40 cm in the last 5 years combined. I'm not all that concerned about it, and it was pretty funny to see some of the accidents and hear about how the busses couldn't make it up and down certain hills. Funny in retrospect, that is.

The nice thing about what I do and where I work is that it can take place pretty much anywhere. If I were to configure my notebook properly, I could easily do everything for my employer from any place on the planet where internet was available. This would be a great thing for me to exploit ... if I could exploit it the way I've wanted to for the last six months.

Reiko is in Japan, and I am in Canada. Long distance relationships are so very hard on both people ... and I really don't like how I can't offer my help to Reiko when she needs it the most. I've asked my employer if I could work from Japan for a while, but unfortunately, this cannot occur. There are too many things that need to be done face-to-face ... and because of this, I can't quite telecommute.

Of course, this doesn't stop me from trying.

Either way ... I'll see how much snow is on the ground tomorrow at 6 am. If there is a sizable amount, then I will not walk through the slush and cold just to put in my eight hours in a chilly office. It's been a while since I last telecommuted ... and working from home is often more productive, for lack of distractions.

Medieval Times

It's snowing outside ...

For the past 10 days, the city of Vancouver has been without clean water. And for the same 10 days, the citizens of Vancouver have been pretty quiet.

I'm really quite surprised that there hasn't been some sort of protest of rally somewhere downtown yet. There have been rallies carried out for everything from raising transit fares to Bush's visit to China. "Educated" people have called for the demolition of the provincial legislature, and demanded that groups of sqatters be permitted to use buildings slated for demolition as their homes.

Yet when it comes to the state of the city's water supply, there has been very little noise.

Today I cleaned my home, and aside from the mirrors and windows where Windex is used, I can't tell if anything is clean or not. There is a fine powder coating my bathtub, the kitchen sink, my floors, the counter ... everything where I had used water with the cleanser. This makes me wonder what the water was like before purification systems.

It's clear that the water we drink in Vancouver doesn't go through much filtering before it's passed into the water pipes. If the water facilities in Southern Ontario were like this, I'm quite certain that I would have died long ago from whatever mutagenic enzymes and bacteria currently exist in Lakes Erie and Ontario.

I understand that some cities are fortunate enough to be surrounded by a bountiful natural environment where resources can be tapped without much processing, but with the rising populations in the Vancouver area, can we really afford to ignore the possible consequences of such contamination in the future?

I know that it would cost millions to upgrade the filtering systems for Vancouver, North Van and Burnaby, but how long can we go with bottled water? Rather than attacking the next over-budget item on the Olympic agenda, perhaps the city can look at upgrading the water systems to ensure the everyday citizens and world-class athletes can rely on the basics.

First Snow of the Season

I love winter.

The cold. The wind. The rain. The snow. I just can't get enough.

Walking through the cold makes me feel great to be alive. The wind is a fierce reminder that even air can hurt. Rain is what Vancouver and Richmond get most of the time, but the snow is what covers the mountains and makes the massive stone walls appear even more impressive for the half hour I'm outside during daylight.

Of course, with the cold comes the warm. Stepping into a home after braving the cold for an hour or two certainly gives one an appreciation for comfort. This also makes me wonder what the people who don't have a home are doing to keep warm. I've often considered this as the seasons change and we edge ever closer to the top of the globe.

Though I can't change the world all at once, I can certainly change someone's world. This weekend I'll donate some new blankets to the shelter. There's apparently quite the shortage, and if it costs me a couple of bucks, then so be it. I enjoy the warmth of my home and my electric blanket every day of the year. It's only human decency to help others enjoy some measure of heat during the coming months.

Too Much Information?

For the last month I've been trying to be pretty regular with my postings on this site. I know that very few people come here, and even fewer people care about my opinions and happenings in life, but this gives me a place to flush out ideas and be a little more social. One of the biggest reasons I decided to make my own site using the WordPress software rather than going with a generic package at MySpace or Windows Live (like my last blog) was because of the problem with advertising.

Advertising agencies collect a phenominal amount of information about each of us. I can't visit Google without seeing AdSense adverts targeted towards me, no matter what website I happen to view. I can't go a day without at least one spam email referring to me by name. I had hoped that by constructing and maintaining my own site that I would reduce the effectiveness of these spy machines and provide readers with richer content and a better user interface (I would really like to see MSN or MySpace try to offer some of the services I've managed to get integrated here).

Relatively unlimited disk space is another benefit here. Sure, for the moment my site is a total of 28.9 MegaBytes (thanks to all the pictures), and most blogging sites let people have upwards of 200 MB or even 1 GB of space ... but by hosting my own solution, I could easily have a site as large as I wanted. This might be useful going forward if I were to post streaming videos, or audio files, or whatever else might be worthwhile in the future. I think it would be really cool to have some streaming video on here showing some trips, or exciting events (like getting married, or some special moments with my future children).

One of the features that I was recently thinking about was having my cell phone contact this website and update my current GPS (Global Positioning System) location. This way I could have a Google Map showing in the side bar with a little arrow showing where I was at that moment. This would be relatively simple so long as I write a little Java application that would run on my cell phone and find out what radio tower I was closest to, then relay the GPS coordinates to a private database table on my website. This is something I will definately do when I have kids, because I will want to know where they are at any given time.

Of course I wouldn't tell them that the cell was going to act mainly as a locator ... they would just think that I was a cool dad for getting them a cell phone for their first day at school :P

But this makes me wonder ... is this too much information? If I did write that application so that others could see where I was at any given time through a website, would I want to let everyone know where I was?

In 99% of all instances, it really wouldn't matter. When I'm outside, I know I have no real right to privacy. I pass by at least 9 video recorders on my way to the bus stop every morning, and at least 14 on the way home. I'm sure there are several recorders that I don't even know about that catch me walking from one location to another. But one thing that I do enjoy is the privacy I have in my home. By telling the world that I was at my home, would this errode even more of my false sense of privacy?

I find myself thinking more and more about when privacy matters, and what information I can show people. In most cases, it doesn't matter if somebody knows where I am at any given time. I'm sure there are some people that would be interested to know where I might be if I wasn't online at a certain time. I'm sure that others would be interested to know where I might be if I was vacationing somewhere or travelling. I'm just wondering where the line is set for the transition from "Amusing Information" to "Too Much Information".

Of course, I'll still put that tracker software in my kids phones. They might never know how to read an analog clock because of it, but I'll have some piece of mind even when they don't get home on time.

Less Than A Month To Go!

w00t!

My counter has finally dipped below 30 days, and I'm starting to get super nervous. I'm not nervous because I'll be on a plane. I'm not nervous because I'll be a stranger in Japan. I'm not even nervous because I'll be meeting with Reiko's parents and having dinner a few times. My nervousness comes from a feeling of unpreparedness ...

Before leaving for my trip I want to make sure that I have absolutely everything I'm going to need. The problem with this, is that I'm not exactly sure what "everything" actually is. Sure, I'll be going with the requisites such as personal grooming stuffs and clean socks. I'll make doubly sure that I don't forget Reiko's Christmas present, which is currently sitting in my kitchen. And I'll even make triple sure that I bring the wrapping paper and tape required to wrap it before I give it to her (I'll leave it unwrapped in the event Customs wants to examine the package first).

Unlike the last trip, I don't need to get lots of government stuff done before I leave. Heck, I don't have any government stuff to do before this trip. I don't need to file my taxes, do anything with my passport, or clear up the medical insurance in any way. This in itself should be a blessing. Just to be safe, I'll let the Canadian embassy in Japan know that I'll be in the country and how they can reach me if necessary ... but I don't think it will be necessary unless Kim Jong Il decides to make a statement.

When I think about it, I think that I should put much greater effort into learning the Japanese language. I'm going to be travelling from Tokyo to Gifu without someone at my side, and then from Nagoya to Osaka on the way back. If I could remember the basics of how to communicate, then I'm sure this feeling would go away. As it is, it takes me forever to read and comprehend some of the simplest sentences in Hirigana, and even longer to read Katakana. Kanji is still years away, at this rate. Although I can understand more Japanese now, I can't put words together in meaningful sentences. Given the resources and tools I have available, I really don't see what my problem is with learning how to speak ...

Clearly, I need to focus on the long term goal while making strides in the present.

I Know What I Know

These words were sung by Paul Simon over 20 years ago, and the song has forever stuck in my head1. I often think of this song whenever I realize that people don't know what they don't know.

This past weekend I was forced to give up my secondary job due to a simple thing like incapacitating back pain. For most of the last week I was in extreme pain whenever I would use any muscles in my lower back, and this certainly gave me some appreciation for how often we use our lower backs throughout the day. To that end, I was forced to prematurely end the contract with that company and begin looking elsewhere for supplementary income.

On a chance encounter, I happened to overhear a store manager at a semi-local herbal store complain about how long it took to do an inventory count and line it up with their monthly purchases and sales. Seeing this as a prime opportunity, I asked how they performed this task and was shocked to hear that this small company relied 100% on paper.

While this might not have been so strange 5 or 10 years ago, to hear of a company not using a computer at all in their day-to-day operations is quite amazing. Aside from "cash only" restaurants, I didn't think any tax-paying company would ever want to do things the hard way. When I had asked why they hadn't gone computerized, the reply was "Inventory systems cost way too much, and none are designed for a herbal remedy store".

Jackpot.

I've been working with custom software packages that track everything from inventory to accounting to fulfillment for several companies. A small business like this could be a cake-walk if they truly feel that nothing on the market will work for them. When I asked what they would be looking for in a software package, the list was pretty light. They wanted an automated inventory system tied to a POS that could handle basic book-keeping. When I asked some more detailed questions such as what information they would need to track about customers, or vendors, or inventory receipts I was greeted with a blank stare. They hadn't thought about it before.

Of course, the manager wasn't really thinking about everything they needed right off the bat. Such a thing isn't normally remembered my anyone because they're too busy dealing with the day-to-day operations of a business. I advised the manager that I could write some custom software for them pretty quickly, and could even have it in place within a month. I offered to work on a special rate, too ... 1/2 my normal rate, and a store credit for the rest. I visit that business often enough every year that I could easily have a great supply of stress-relief tea and dry skin lotion (not to mention the occasional stomach relief pills).

Today the call came in, and the manager would like me to put something simple together just to walk through what they could have, and work out what they actually need. So I'll drop 4 hours of design time into the application using basic requirements, and then approach them with the rest. The biggest questions I'm going to have will revolve around what these people may not know, and none of us know what we don't know.

I certainly hope that this good fortune doesn't turn out to be the end of a steady client-vendor relationship.

Bathing In Turpid Water

In the past week, this region of British Columbia has experienced record rainfalls. With this has come the usual mudslides that occur and pollute the water supply, but this year was quite a bit worse than in the past.

Last Thursday, the GVRD (Greater Vancouver Regional District) Water Works issued a warning saying that it was unsafe to drink the water. By late Friday, half the region could once again drink the tap water and/or use it on foods and for personal hygiene. Vancouver, North Van and Burnaby were the exceptions to this, and as of this moment, we're still not permitted to drink the tap water.

On Friday hundreds of thousands of people tried to stock up on bottled water. As usual, this resulted in the occasional fist-fight as those who arrived at the stores early were able to hoard an unnecessarily large amount of water, while those who arrived 5 minutes later were left with nothing. People would sometimes call ahead to stores to make sure that water was in stock, only to be told "no". In the paper, I had read how one store owner was reamed out by an elderly person for not having enough water in stock, and while I can understand the frustration, I do not believe this would magically make more water appear.

I find it funny that we live in the province with the greatest amount of fresh water, yet the most populous city has none. For the most part, I can get by without much drinking water by consuming milk or other liquids. I can get by without using water in my dinners by eating something without rice. Though I must admit that it's been quite an effort to stay away from the water.

I'm also surprised that I haven't seen scalpers try and sell water at inflated prices. One could easily get $5 for a two dollar bottle of water if the need was great enough. Sure, it's unethical, but that has never stopped people from earning a dollar in the past.

Of course it's odd that many of the resterants and coffee shops haven't closed down because of this. These are some of the largest consumers of water, yet they're still getting by just fine. I've never heard of a coffee shop using bottled water ... so what is their source? Yesterday at 7-Eleven I noticed some children buying slushies, but this also made me wonder what the ice was made from ...

I know that turpid water will not likely kill us. There is a possibility that the bacteria and sediment inside could give some people intestinal problems, but I don't think this would be an issue for most people so long as they consume the water in moderation. The only real question is "how long until the water can be trusted again?"

Heavy rain is in the forcast for the upcoming week. If needs be, I'll just put a pan outside to collect some rain.

Has It Been Three Years, Already?

Over the years of my short life, I've learned that television shows typically work in cycles of threes. Every three years there are about three new television shows that are enjoyable, intelligent, and plausible. Typically, these shows have a very short lifespan and are replaced with two years of the common pointless dribble that is everyday TV. The fall 2006 season appears to have three great contenders from around the world that I just cannot get enough of.

From Japan: Death Note (the anime)

This is an increidble series. The main character (Light) finds a notebook that appears to have fallen from the sky. He learns that he has the power to kill anyone by writing their names in the book, so long as he is thinking about their face at the time he writes it. He can also specify how someone will die, otherwise, a heart-attack 40 seconds after writing the name is the default.

This is a great example of how absolute power corrupts absolutely. Light is a straight-A student who's studying hard to get into the best schools. His father is the chief at the local police precinct, and his mother and sister are pretty normal people.

After finding this book, Light decides that he will rid the world of injustice by killing anyone who has committed a crime. At first it's so that the world can be a better place, but that quickly changes to reveal Light's ambitions to be diefied as a god.

Each show is packed with intelligent plot twists, some great animation, and great suspense. I look forward to watching this show right to the end.

From the US: Heroes

This is a pretty good series, oddly enough. The premise is simple: a bunch of random people begin to develop supernatural abilities and their lives are somehow connected.

This reminds me a bit of what the X-Men movies did to the comic, but the show is enjoyable nonetheless. The plot twists are few, and the suspense is short-lived, but despite this, the intelligence behind the story stands out like a beacon in the night. I think that the real genius of this story will be missed by anyone who doesn't stop and think about what they just watched. Often times I'll be thinking about the episode afterwards and piece together bits and fragments from other episodes to see how things fit together.

This show is way ahead of anything else produced in North America, and it's a nice change of pace to watch something interesting where humans are used to play the characters (most of what I watch is animated).

From everywhere: The new season of Documentaries

Documentaries have been one of my favourite genres of entertainment for years. Insightful and educational, I have learned more about the world through documentaries than in the 15 years in the various schools growing up.

For the last few years, it seemed as though documentaries were trying to redefine themselves by becoming more like a "reality-tv" show than an educational medium. National Geographic, I feel, had the worst implementation of this as their takes on Egyptian tombs and pyramids made me fall asleep. There is nothing boring about Ancient Egypt ... for a documentary to whore themselves out to such a level as to make something enjoyable just a 44 minute romp on the couch is sad, indeed.

But that seems to have changed now that many of the documentaries put out by PBS, History and Discovery are using HDTV and intelligent discussions in their shows. In the last six months, I have seen such quality documentaries come out on these channels that I actually look forward to what they might show the following week.

Documentaries are not just a source of idle entertainment, but of knowledge and information. There is so much in the universe that I will never fully understand or properly appreciate. With these documentaries, I can at least appreciate them better and have a basic understanding of their importance.

It seems that the rut is temporarily over as these new shows allow users to think and form conclusions (even if they prove to be wrong in the following episodes). I can only hope that this season will last longer than normal, as I do not look forward to another two years of unintelligent dribble.

Sleeping Through the Storms

The last few days worth of rain and wind has certainly left it's mark on the residents in and around Vancouver. Trees have fallen, streets have flooded, power has failed for many, people have been forced from their homes ... and oddly enough, the water is contaminated.

This last point is the only one that has directly affected me, though. I use quite a bit of water every day ... not being able to drink as much will certainly leave my throat dry.

And despite all this ... I've slept through the worst of all the storming.

Typically I dream of only three things:

  1. People I care about

  2. Work

  3. Mistakes

    Work is the most common of these three (sad, huh?), and it's not really limited to the software I write, but the data structures that are required to make things work. I have often woken up hours before the alarm with solutions to some of the most complex logic branches I've had to devise, as well as crystal clear coding structures required to make a certain function work in the real world. Lately, however, I've been thinking about the functions and methods of PHP and how I can integrate them into this site.

    One shining example is the random image that will appear in the upper left hand corner of the site (the polaroid). Before today, that was a static image. However, by extending some of the other simple scripting I had seen elsewhere, I found that I could easily adapt the technologies to make that image random with each page load. After writing that function, I added another 8 polaroids (thanks Photoshop!) and voila!

    10 minutes to code and test, then 30 seconds to implement.

    PHP is something I should have learned years ago. I've known that it would become really big since it's early uses, but never really got on board due to personal grudges against the people that touted its superiority to existing web technology. This has really held me back on some pretty exciting areas of the programming world, and has probably kept me from moving to Japan that much sooner.

    In Japan, I find that most programming positions require people to be very familiar with PHP and MySQL. In North America, this has started picking up steam, but has been limited to certain business markets ... none of whom I've ever needed to work with. But as I learn more and more about this language, I'm seeing some phenominal potential for its uses.

    To this end, as I dream up new things to add to this site, I'll try to implement them. I'm sure that I'll eventually reach the end of what I can do on a personal site ... but I feel this would be a great testing ground. My server has a laughably slow processor (compared to actual production-level servers) and very limited capabilities. If I can maintain a great looking site while also keeping the functions fast and smooth, then I should have no problem transferring these skills elsewhere. At the same time, I'll see about learning even more PHP and JavaScript as these seem to be the main technologies in use across the ocean.

    Finding work in a foreign country is never easy. But hopefully by attacking this learning curve with my usual passion, I won't be caught sleeping through the next storms.

  1. 1
  2. 2
  3. ...
  4. 252
  5. 253
  6. 254
  7. 255