« November 2005 | Main | January 2006 »
December 31, 2005
Capital One's Lucky day.
Today is Capital One's lucky day. They are the first credit-card company to offer me a card without a annual fee. So I will be immediately ending my current card and transferring to a new one. Besides, Capital One has some of the best advertising I have ever seen.
These are so funny:
Capital One Ads
Posted by binhqx at 2:25 PM | Comments (2) | TrackBack
December 30, 2005
Cool App: Cartography Shop
Every once in a while I get the urge to do some 3D map making. I will have a idea for a room or structure and want to flesh it out right way. The fastest way to do this is with map making tools for 3D games. I have access to a license and dev tools for the Torque Game Engine. So I use tools that are compatible with it.
Up till now, I have used QuArK, but it sucks. I find the program to be buggy and the interface is total unintuitive. However, it was the best that is available.
Recently I was browsing around Torque Game Engine site when I saw reference to a program called Cartography Shop from The Game Creators. They had a demo to tryout so I took a gander at it. My impression is, Cartography Shop is great. The interface is simple and intuitive. It is very easy to quickly construct and texture maps. There are plenty of example modes and textures that can be dropped in and used as place holders during the inception phase.
The ease of uses that Cartography Shop provides puts other mapping tools to shame. Even with a $60 price tag, it is the best entry level map editor available. I suggest users download Cartography Shop and run it head to head with QuArK to really see the difference.
Posted by binhqx at 2:34 AM | Comments (0) | TrackBack
December 28, 2005
Failureless VoIP (Part 1)
I started thinking about how to build a VoIP network that would have 99% uptime. Not just "thinking about it" in theoretical way, but how I could implement it with the hardware and software I have at hand.
The whole phone system can be broken down into three systems: out-peering, in-peering, and administration.
I use the term peering and not client-server because in the SIP way of thinking, all endpoints are peers. It does not matter if it is a home ATA or a port on a massive media gateway to the PSTN, to the protocol they are all just peers.
Now the tricky but is the peers have a tendency to move about on the network. People use the same SIP accounts at home and at work and on the go. The system must be "smart enough" to follow them around. I have found SIP Express Router does a good job of this.
Gateways do not move around much, but they do have a nasty habit of breaking. When a gateways takes a noise dive, the system must be smart enough to diver calls to a working one. Any of the carrier grade softswitchs can do this well.
Peering is who the two types endpoints talk to each other. Out-peering is when a client who uses our network attempts to establish a call to a endpoint outside of our network. Most of the time, the call is being directed to the PSTN. Here is where administration needs to be done. We must make sure that client is a legitimate user of the system. Then we need to track how much time that user spends using the PSTN gateway for billing.
In-peering is the same only turned around. A session request will come in from the gateway and we need to figure out what user that goes too. One we find that, we need to find the user and forward the call.
So how do we make this so it never fails? The simple answer is to distribute, distribute, distribute. First we need a secure and robust network that will allow all the parts of the system to communicate. This can be accomplished using VPN network equipment. I am fuzzy as to how to set it up because I am not a communications engineer. I would need to work with a Cisco or Nortel guy to get it running. I would choose five or six locations around the country (world?) and install VPN nodes. The system will need plenty of bandwidth so they would probably be at network centers near tier one internet ISPs.
Each node has a public and private network. The private networks can intercommunicate via the VPN and will be used primarily as a data back channel. Within this wide virtual network will be a high availability database. I would probably choose MySQL's MySQL Cluster because it costs nothing to build and I have a lot of experience managing MySQL servers. The nodes of the MySQL Cluster would be hosed at each of the VPN nodes. The database would only be accessible from within VPN to prevent hackers from getting at it.
All this geographic redundancy would protect the overall network from failure due to natural or man made disaster. For example, a major city could become submerged, flooding a data center with water. That node would fail, but the network would divert request elsewhere.
Posted by binhqx at 9:14 PM | Comments (0) | TrackBack
December 27, 2005
Suns yield up their ghosts of flame
Transmigration--transmutation: these are not fables! What is impossible? Not the dreams of alchemists and poets;--dross may indeed be changed to gold, the jewel to the living eye, the flower into flesh. What is impossible? If seas can pass from world to sun, from sun to world again, what of the dust of dead selves,--dust of memory and thought? Resurrection there is,--but a resurrection more stupendous than any dreamed of by Western creeds.
Dead emotions will revive as surely as dead suns and moons. Only, so far as we can just now discern, there will be no return of identical individualities. The reapparition will always be a recombination of the preëxisting, a readjustment of affinities, a reintegration of being informed with the experience of anterior being. The Cosmos is a Karma.
-- LAFCADIO HEARN, Gleanings in Buddha-Fields (sacred-texts.com)
Posted by binhqx at 10:23 PM | Comments (0) | TrackBack
December 26, 2005
Battle of the bulge: Holiday Massacre Edition
I will admit that I have been totally pigging out this holiday season. The biggest problem is the normal good foods that I usually surround my self with has been replaced with bad food. My kitchen is full of cakes and cookies laid out everywhere. The fridge is stocked with nothing but eggnog, soda and ice cream.
I guess my best technique if not eating that stuff is by keeping it out of easy convenience. However now that it is everywhere I look, I can not control myself. To counteract this phenomenon, I have been like a madman on the DDR pad. I have been putting 2.5 hours of nonstop DDR per-night. By the time I am done, I need to crawl to bed. I am not sure that this is enough.
I can not wait till all this food is gone and I can go back to normal.
Posted by binhqx at 2:18 AM | Comments (0) | TrackBack
December 25, 2005
Christmas day
It was a good Christmas. I received a few gifts from family members, but such things are not important. What made today so much fun was the time I got to spend with the family. My Brother came home for the holiday weekend. Then on Christmas, my Grandparent, Uncle, Aunts and Cousins on my mothers side all came to our home to enjoy a meal together. My parents have had strained relationships with that side of the family in the past, but there was no sign of disagreement today. Bring together my family together again for the day was the best Christmas present of them all.
I got to spend some time with my cousin Carton. When we where growing up, we where best of friends. However, when the family became strained, we lost touch. I saw him a while ago, but it has been a long time sense we had fun together. I discovered that he was quite a DDR player and impressed me with his skill on a few songs. We where playing DDR in the basement and eventually the whole family came down to watch us play. Carton and I took tunes impressing everyone with our mastery of the DDR pad. Even my brother got on the pad with some reluctance to try a song. I think he likes it.
Uncle David brought me a set of Ubuntu install CDs. I would say that he is responsible for my fist encounter with a UNIX OS. Back in the day, he had a Sun workstation in his office at home. I was immediate intrigued by it. Perhaps that is the reason I installed BSD on my Macintosh Performa 575 in 1997. Either way, I am glad to see that I am not the only one with the open source initiative in the family.
I great Christmas over all. Tomorrow I will be visiting the other half of the family in Massachusetts. So the festivities will keep going. Man, I need a vacation from all this holiday vacation.
Posted by binhqx at 4:45 PM | Comments (0) | TrackBack
December 24, 2005
Mary Christmas to all!
and to all a good night.
ZZZZZZzzzzzz..........
Posted by binhqx at 11:49 PM | Comments (0) | TrackBack
Post-Party
What do you know, it did go all night.
The party started slowly. Everyone showed up at the right time, but the food was late. It took a bit of convincing to keep people from wandering off to burger king for a snack. Eventually the food did arrive and a feast ensued. People played Super Mario Strikers and watched Secondhand Lions for a first few hours. Then we all watched and made fun of the new The Chronicles of Narnia: The Lion, the Witch and the Wardrobe. Most of the jokes related to MMORPGs like World of Warcraft because the movie had a uncanny resemblance to many game features.
After all that was over it was one in the morning. I was about to packup and go home for the night, but a battleground started up in World of Warcraft. So I want from watching a movie about mythological battle to acutely playing one. It was quite a lot of fun.
By 4:00 AM I was ready to drop, so I went home. It was all I could have hoped for; perhaps we can do it again next year.
Posted by binhqx at 1:29 PM | Comments (0) | TrackBack
December 23, 2005
Pre-party
This Friday will be the company Christmas party. I Believe that I must take some credit for its existence. Every week for the last two months, I have be hyping just how big and important this party will be. Much of that anticipation must has transferred into my boss who is right now out buying party supplies.
I love a good party. Spending time with good friends and enjoying good food as the best thing in the world. I also love preparing for parties. There is a indescribable energy that starts to form a few hours before a party. Everyone involved scurries around with the tacks that must be completed. It also gives me a inside track when the party starts. People will be wondering where the chips and soda are and I can feel important by having the answers that are looking for.
So this will be a whole lot a of fun. There will be video games and movies later. With no real schedule or restrictions, this could go all night.
Posted by binhqx at 4:07 PM | Comments (1) | TrackBack
December 22, 2005
Sleep for physical strength
I had forgotten how important sleep is for building strength. I have been in need of strength sense I started playing DDR on my new hard pad.
This new dance pad takes is a very different beast from the foam pad. The biggest difference is in the mentality of the movements. On a foam pad, the movements as small and precise. The player does not want to transfer too much force because it can cause the pad to move or be damaged. The hard pad is the complete opposite. The movements are large and forceful because the player feet are in impact absorbing shoes. I would guesstimate that it takes a additional 30% more strength to play the same song on a hard pad verses a foam pad.
So I have been attempting to keep my DDR sessions at the same length and difficulty on my new dance pad. However, I get wiped out, I am not uses to the energy output that is required to play. My DDR games now put a increased strain on my legs and back causing them to ache.
On Tuesday night, I decided that I was too exhausted to play and when straight to bed. When I woke up 11 hours later, my muscles did not hurt so much any more. All that extra sleep must have given my body more time to repair its self. When I came back on Wednesday, it was like playing a whole new game. I could last longer and play harder then two days ago.
I had forgotten how important sleep was when increasing physic activity. Without extra down time there is no way to heal and build strength.
Posted by binhqx at 1:04 PM | Comments (0) | TrackBack
December 21, 2005
The end of things
Is not bound by rules and measures:
In the Mind harmonious [with the Way] we have the principle of identity,
In which we find all strivings quieted;
Doubts and irresolutions are completely done away with,
And the right faith is straightened;
There is nothing left behind, There is nothing retained,
All is void, lucid, and self-illuminating;
There is no exertion, no waste of energy--
This is where thinking never attains,
This is where the imagination fails to measure.
Posted by binhqx at 9:24 PM | Comments (0) | TrackBack
December 20, 2005
MySQL: Regex row maching
Today I was working on a query that would mach call records to International dial codes. Her is the problem, the call list looks like this:
Table: phone_numbers
int_number ---------- 011493081878433 011496857070 011911155656001 011353857399831
and my international dial code list looks like:
Table: country_codes
code country ----- ----- 49 Germany 91 India 3538 Ireland - Cellular
So I have a list of phone numbers that are variable length and a list of dial codes that are also variable length. So how can I match the phone numbers to country codes? The easy answer is to manipulate one of the columns to look like another. So here is how international phone number 011496858433 breaks down:
Int indicator - country code - local number 011 - 49 - 6857070
So the code will always appear after the 011 then run a unknown number of digits and have some digits after it. We need to make a query for each code that will return true if the code and phone mach and false all other times. The best way to accomplish this, like all other problems, is with regular expressions(regex). Lets take the first two number on the list and make a regex that will mach them.
Query:
SELECT int_number, country FROM int_number, country_codes WHERE int_number REGEX '^01149' AND code = 49;
Result:
int_number country ----- ----- 011493081878433 Germany 011496857070 Germany
Both cases start with 01149 which is exactly what ^01149 means. However we do not want to write a individual query for each country, that would be very difficult to maintain. Instead, we want to generate a dynamic regex for each item in the country_codes table. This is done with the CONCAT operator. Check this out:
Query:
SELECT CONCAT('^011', code) as regex, country
FROM country_codes;
Result:
regex country ----- ----- ^01149 Germany ^01191 India ^0113538 Ireland - Cellular
Now we can mach the columns using the dynamically generated regexs:
Query:
SELECT int_number, country
FROM int_number, country_codes
WHERE int_number REGEX CONCAT('^011', code);
Result:
regex country ----- ----- 011493081878433 Germany 011496857070 Germany 011911155656001 India 011353857399831 Ireland - Cellular
No problem! Now we can easily mach any number of phone numbers to country codes. This type of query can take take a performance hit when the comparing lists become large. It can be sped up by pre-computing each regex and storing with the country code.
note: international numbers are made up and may or may not connect if dialed. Querys are untested and my contain errors is tried verbatim.
Posted by binhqx at 10:02 PM | Comments (0) | TrackBack
December 19, 2005
Radius CDR and mysql
I made a bit of a database blunder today. When I created the CDR database in mysql, I believed that the "Acct-Session-Id" attribute was unique incrementing ID number for every call made. So I used "Acct-Session-Id" to identify the start and end of each call to form a complete record.
However, I was looking at the CDR database today and found a growing number of calls that started ten days ago and ended just recently. I highly doubt that any call where going for that long. I would have seen it on the call volume graphs. Do I realized that call-end records from now where overwriting call-end records from ten days ago. This is because the call-switch, from Sansay, started reusing old Acct-Session-Id numbers.
So using Acct-Session-Id as the only method to identify call session start and end would no longer work. I too another look at the radius CDR and found another attribute that is identical in the start and stop messages called "h323-setup-time." This is a time stamp to indicate when the fist request for the call was processed. I examined "h323-setup-time" attribute and found a immediate problem. The "h323-setup-time" data looks like this:
19:25:50.284 UTC-5 Mon Dec 19 2005
Mysql database wants date data that looks like this:
2005-12-19 19:25:50.284
There are a couple of options of how to accomplish this conversion. Mysql has a funtion called STR_TO_DATE() that can be used to pull date information out of strings. However, the string must be clear of other extraneous data. Specifically the "UTC-5 Mon" from the "h323-setup-time" attribute. Using Mysql's string manipulation functions I could splice and rejoin the date into something more usable, but that would put some very serious clutter into every database query.
Instead I wanted to use as much of the the freeradius server's internal logic to fix the date. I used a special rewrite module called attr_rewrite to rewrite the "h323-setup-time" attribute with regular expressions (regex). Take a look at this monster of a regex:
attr_rewrite h323-setup-time_for_mysql {
attribute = h323-setup-time
searchin = packet
searchfor = "^([0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}) *[a-z,A-Z]{3}-[0-9]{1,2} *[a-z,A-Z]{3} *([a-z,A-Z]{3}) *([0-9]{1,2}) *([0-9]{4})$"
replacewith = "%{4}-%{2}-%{3} %{1}"
ignore_case = no
new_attribute = no
max_matches = 1
append = no
}
This will take the unwieldily:
19:25:50.284 UTC-5 Mon Dec 19 2005
and turn it into:
2005-Dec-19 19:25:50.284
That can be feed nicely into STR_TO_DATE() with the format string:
STR_TO_DATE('2005-Dec-19 19:25:50.284', '%Y-%b-%d %T.%f')
That in the database looks like:
2005-12-19 19:25:50.284
Hurrah I win! With both "Acct-Session-Id" and "h323-setup-time" I now have all the information I need to make accurate CDRs. To bad I also now have a database full of bad call information. It is a good thing I keep a backup of all radius transactions that can be used to reload the database.
Posted by binhqx at 9:41 PM | Comments (0) | TrackBack
December 18, 2005
Weekend update 10/18
Oh why do I hurt myself so. This weekend was punctuated with significant muscle pain. I did not realize just how additional strength playing DDR with shoes on a hard pad takes. On the soft pad, I was playing 1.5 hours of 9 and 8 foot songs with scores of Bs and Cs. On the hard pad I get max of 1 hour with 6 and 7 foot songs with scores of D and C. My legs and back are aching for the extra exertion. It will be months before I am strong enough to get to my former scores.
Saturday was quite. Sunday we celebrated my cousin Ariel's birthday. She is three years old and growing like a weed.
I'm going to go find some Aspirin....
Posted by binhqx at 2:59 PM | Comments (0) | TrackBack
December 17, 2005
My gai-si de (damned) PC
Every once in a while, my PC just dies. It will be working flawlessly and then just freeze up and not reboot. The POST will make a beeping sound indicating bad memory. So I pull and reseat the memory, some times a few times, and eventually the PC will boot to the BIOS. Now at this point, anything can go wrong. Sometimes the LAN card stops being detected; sometimes a hard drive will disappear; sometimes it will look like it is booting and just freeze again. This particular time, the BIOS could not find the boot sector on any of the hard drives or CD-ROM. I swapped cables, drives, ports, the whole works. However, nothing would get it to boot.
There is one thing that just about always fixes it, but I tend to shy way from it because of the time it takes. That is to strip the entire machine down to the case and put it back together again. So with my handy screwdriver and Leatherman, I tore the whole thing apart. Before putting it back-together I clean all the exposed contacts with a pencil eraser blow out as much dust as I can find.
Once it is put back together, It boots just fine. The sound card was not being detected, but when I moved it to another slot it started working again.
My Mac almost never breaks. Why does my PC make me wast so much time. It just ticks me off.
Posted by binhqx at 10:49 PM | Comments (0) | TrackBack
December 16, 2005
Cool data
Earlier this week I constructed a database to log all the calls for in-house billing of our customers. It contains the information about who calls whom and for how long. This type of data could be considered sensitive information. My database administrator code of ethics prevents me from examining the individual entries for my personal gain. Besides, the day-to-day activities of other people are of little interest to me.
However, I recently discovered that I like data. Big sets of date from some real world sources are the best. I started out just writing simple queries to find out how much each customer is spending for invoicing. However I soon realized that this database contains quite a bit more. The data can be examined to find when during the day most calls are made or how call volume is affected by each day of the week. As the size of the database grows, I will be able to identify trends over longer spans of time.
The more I use the SQL language, the more I see how it can be use to examine data sets. It is a toolset for putting records together and pulling them apart.
Unfortunately, my queries must be restricted to those that are for the benefit of the network and the business. Perhaps someday I will get a release from all the customers to do some more interesting research. The records contain a lot of information about when and where people are communicating. The data could be combined with geographic and censes data to lean more about our society.
I am not talking about those stuffy statistics found in reference books; I am talking about live real-time trends. Seeing how people communicate and what events compel them too. That could be some interesting stuff.
Posted by binhqx at 8:16 PM | Comments (0) | TrackBack
December 15, 2005
Ways to grief in WoW with Druids
The Druid character class has two simple abilities that when combined together make a interesting phenomenon. The first ability is called "Feline Swiftness" this gives a 15% speed boost while out doors. The second ability is called "Faerie Fire," this is a 30 yd is an offensive spell that does no damage.
So a Druid in Cat form can run faster then most enemies and cast a damage-less offensive spell in any direction while doing it. When a offensive spell is cast on a NPC enemy, it causes the enemy to aggro and follow the player in the hopes of killing him. As long as the enemy is continuing to be hit with the spell, it will continue to follow. When the Druid in Cat form uses "Faerie Fire," the enemy will aggro and follow. However, due to it's increased speed, the enemy has no change of ever catching the player. The player can continue to run away and cast the spell for as long as he want. Using this technique can lead a enemy anywhere he wants to take it. This is called "training."
There are two way this "training" ability can be used to grief. It can be used to bring high level enemies into low level areas where inexperienced players will attack and be kill by it. Or the player can train quest giving NPCs of the other faction and prevent other players from advancing in quests.
I for one do not advocate grieving in WoW, but this combination of abilities make for a interesting exploit of in-game dynamics.
Posted by binhqx at 11:28 PM | Comments (0) | TrackBack
December 14, 2005
Cobalt Flux!
I got my Cobalt Flux dance pad today! I am so excited to start a new chapter of my DDR training. No more barefoot tiptoeing on sot pads, its time for some hardcore dance moves on a solid surface.
Perhaps not like the bunny, but similar. I did not get the back bar, but it is not really needed that much to lean to play DDR in shoes. The company I work for was generous enough to purchase the Cobalt Flux for my birthday. I am so grateful to them for that. I played a little at work with SB. Dancing on a hard pad is very different from a soft pad. The soft pad is more forgiving on the feet and joints, but the hard pad has more durability and responsiveness on fast steps.
I can not want to get this thing home and give it a proper breaking-in"
Posted by binhqx at 10:51 PM | Comments (1) | TrackBack
December 13, 2005
Coding in the zone
If you ever talk to a programer, he/she will know what it is like to being in the "zone." Being in the "zone," a programer achieves a oneness with the machine that other people can not understand. The programer thinks like a computer; breaking down all problems into a series of logic and arithmetic operations. Code will flow from the mode of the programer into the machine and the two will synchronize in perfect harmony.
The only problem with the "zone" it it leave little room in one's mind for anything else. Simple tasks like eating, sleeping , or using the restroom become a utter nuisance. Their function does not cleanly fit into the human-machine interface. Any type of outside disturbance to the coder in the "zone" is met with contempt and scorn. It is usually bet to just leave them be until they find their own way out, or pass out, whichever come first.
I have a real problem with writing code before bed. With a mind full of memory structures and method calls, I find it impossible to stop thinking. This makes it extraordinary difficult to get to sleep. It is like looking for a way to turn you mind off. Without years of zen meditation training, it can not be done. So I usually end up reading a book till the wee hours of the morning. If my boss complains that I'm late for work, I can just tell them I was working on their project all night and should be grateful that I did not charge for the extra hours.
Posted by binhqx at 1:14 PM | Comments (0) | TrackBack
December 12, 2005
Sage of Omi
It is an invaluable treasure.
It is called Bright Nature of man.
It is peerless and surpasses all jewels.
The aim of learning is to bring out this Bright Nature.
This is the best thing in the world.
Real happiness can only be secured by it.
To-ju Naka-e
(source: http://www.sacred-texts.com/bud/rosa/rosa07.htm)
Posted by binhqx at 12:47 PM | Comments (0) | TrackBack
December 11, 2005
Weekend update 12/11
Spent most of the weekend with family.
Saturday was a nice quiet day. The high point was seeing a episode of Stargate SG-1 that I had not seen before. Sharing that over a hot pizza with my family really makes my day.
Sunday was a big Chihuahua meetup at the Stratham SPCA. It was the December meeting so we had a visit from Santa Claus. So I spent the day posing little dogs on Santa Claus and taking their pictures. I was surprised at the number of people and dogs who showed up. In total 40 people and more then 35 small dogs showed up. The whole event was more remisant of a ciruse then a dog meeting. These god meeting have been growing by leaps and bounds. When there started they where just a few friends getting together so they and their dogs can socialize. However it has ballooned into a major event.
Posted by binhqx at 8:16 PM | Comments (2) | TrackBack
December 10, 2005
Three small books of the Freemasons
Today I received a interesting gift from my grandmother. She was going through my grandfathers personal effects and found a set of three small books. They are titled:
Introduction to Freemasonry - I Entering Apprentice ( text available online)
Introduction to Freemasonry - II Fellowcraft ( text available online)
Introduction to Freemasonry - III Master mason ( text available online)
All three of these book are authored by Carl H. Claudy in 1931 and printed in 1947. Apparently this book set was given to all new initiates of Freemasonry. This particular set was given to my grandfather in 1948. However I had no idea what Freemasonry was. So I checked the wikipedia entry on them:
Interesting stuff. I started skimming through the books. Most of their content has to do with explaining the reasons and meaning of Masonic symbols and ceremony. Quite a bit of geometric understanding is required to fully grasp many of the concepts. Things like "The 47th Problem of Euclid" (A^2 + B^2 = C^2) have both geometric, physical, and metaphysical importance. Masonic culture is loaded with symbols and ceremony.
Freemasons are a "secret society" meaning that some of there inner-workings are kept hidden from public view. This kinda weirds some people out. However, such things are necessary to make the differentiation between being inside or outside of the organization.
So what is the purpose of all of this? I guess it is like any other fraternal organization. Meet with like-minded people, network, do things in a group that can not be done alone, etc. However, what I hear lately is the majority of the Freemason population is becoming old and new initiates are not joining in. I suspect this is due to a vast culture difference between the two or three generations. If the Freemasons want to survive, they will need to do some modernization. I am sure there are many intelligent young people would would enjoy the benefits of a fraternal organization. But the Freemasons have all the social appeal of their hanging out with their grandparent.
Posted by binhqx at 10:47 PM | Comments (0) | TrackBack
December 9, 2005
Casting Call for Motoko Kusanagi
I was watching Godzilla X Mechagodzilla yesterday. I realized, if a live action Ghost in the Shell is ever made, Yumiko Shaku is a shoe-in for the role of Motoko Kusanagi.
Here is a quick head-shot comparison if you do not believe me.

Yumiko Shaku next to Motoko Kusanagi.
Or look at my color corrected version.
Posted by binhqx at 3:11 PM | Comments (2) | TrackBack
Snow Day.
Today was a snow day! No work for me!
Really, the snow in the north east has shutdown everything. Most of the day, my road was blocked with 14" of snow. I was a bit disappointed though; I had a sandwich waiting for me in the refrigerator at work. Now I will not be able to eat it. :(
So I pent most of the day moving snow and watching Startrek: The Next Generation.
Posted by binhqx at 2:21 AM | Comments (1) | TrackBack
December 8, 2005
A wash of a day.
I wanted to write at length about the Smarty template system. However i was distracted for most of the day by this picture. Apparently there are 75 band names in there. Matt and I found 42 of them.
Next I was sidetracked by the urgent need for some verbiage about my professional history/bio for some investor documents. I do believe that I have any "history" to speak of. I went to school for four years then I started working my job full time after I graduated. That is it. Stretch that into a few pages for me would you.
So al I really accomplished today was a wrapper class for Smarty that would allow me to factory Smarty instances preconfigured for my application. I guess it is better then nothing.
Posted by binhqx at 9:58 PM | Comments (0) | TrackBack
December 7, 2005
The many faces of variable scope in PHP
The topic of variable scope on PHP is a interesting one. This is because the way scope is handed has been changing in each major revision.
The one I was most interested in the topic of PHP global variables. What confused me is a line register_globals = off in my php.ini file. Everyone suggests that it be set this way for security reasons. That is good and all, but I believed that this also meant what globals can not be registered at all.
So I spent most of the day trying to figure out how I could write a application that had no globals at all. Evenly I decided that it was impractical to do it so, I must be doing something wrong. So a wrote a little test code to see what methods of globals variables access where disabled by register_globals = off.
//See if register_globals is disabled.
echo "register_globals = ".ini_get('register_globals')."\n";
//Three ways of registering globals.
$a = 'one';
$GLOBALS['b'] = 'two';
$c = 'three';
//Access the globals from within a function.
showMyGlobals();
//Function definition
function showMyGlobals()
{
global $b;
echo "A = '".$GLOBALS['a']."'\n"; // <-- should work
echo "B = '".$b."'\n";// <-- should work
echo "C = '".$c."'\n";// <-- should not work
}
results:
register_globals = 0 A = 'one' B = 'two' C = ''
So it looks like the only thing that "register_globals = off" effects is access globals without defining the variable as a global at the begging of the function or using the "$GLOBALS" superglobal.
I just wish someone said this at the beginning of the register_globals doc so I would not need to wast so much time on it.
Posted by binhqx at 5:21 PM | Comments (0) | TrackBack
December 6, 2005
DB_DataObject
I started playing with DB_DataObject today. So far, I have liked everything I have seen about it. The main habit that I wanted to avoid in my newest project is hardcoding hundreds of SQL query 'chunks' that are concatenated together. DB_DataObject avoids this by having a abstract and object oriented way to construct queries and extract data.
DB_DataObject have some excellent encapsulation. It is posable to auto generate the classes for the tables and start pulling DB queries with about 5 lines of code. The only problem I have seen with DB_DataObject so far is with the documentation. The some of the examples from the dev site do work immediately. It would also be better if the examples where closer to complete mini-apps that can be templated from.
Tomorrow I am going to start work on a web interface that will pull data out of the CDR database. I think I will break down each customers info into different types of services. Stuff like PSTN termination, PSTN origination, toll free termination, whole sale, etc. Each serves will have its own set of records and will generate a individual item on a invoice. This should keep the level of complication of each query to a minimum.
Posted by binhqx at 1:17 PM | Comments (0) | TrackBack
December 5, 2005
Philosophy Monday: The prince's robes
In fear that it may be frayed, or stained with dust he keeps himself from the world, and is afraid even to move.
Mother, it is no gain, thy bondage of finery, if it keep one shut off from the healthful dust of the earth, if it rob one of the right of entrance to the great fair of common human life.
---Rabindranath Tagore, GITANJALI [1913]
Posted by binhqx at 10:11 PM | Comments (0) | TrackBack
December 4, 2005
Weekend update 12/4
This weekend turn rather depressing due to the event of yesterday. I spent most of the time keeping my self distracted with anime, music, movies, etc.
I was reading some of my old blog entries. I think my quality of writing has been dropping over the last few months. This is probably due to my lack of reading. I read the english language all the time, but it is mostly news, other peoples blog, or technical manuals. The reading I have not been doing is the kind that transcends simple communication. I am speaking of writing as a art form. A real author takes the act of written communication and creates something that is so much more.
/me walks over to his book shelf and reads of a few of the names.
Isaac Asimov, Douglas Adams, Neal Stephenson, Daniel Keyes and Arthur C. Clarke are just a few of these types of people.
/me pulls a book entitled A Stranger in a Strange Land from the shelf and opens it to a random page and reads a sentence:
' "Hold it," Harshaw said hastily. "The trouble is with the english language not with you. 'However, unlike them, I can not write in a vacuum. I need to see well written words to template my own. If I only consume garbage words, then that is all I can produce. So to improve my writing I must read good writing. I will need to pick up some "well-crafted" pieces and immerse my self in them.
/me puts the book back on the shelf and returns to his computer to continue typing.
On Friday, I saw the movie Sky High. Something about it did not sit well with me. It took me to Sunday to figure out what it was. The movie puts too much emphasis on the importance of high school when compared to the rest of ones life. In the movie, the student population is broken down into two echelons "Heros" and "Sidekicks." The outcome of this rank decides what that person will be for the rest of there life. When in truth, nothing a persons does, short of a felony, has any permanent baring on the rest of there lives. High school is a strange world completely devoid of reality. It is populated by people who are still in the process of mental development. Once a person leaves high school, they realize just how unreal and messed up everything was. So whenever I here of someone having a social problem in high school, whether it is being unpopular or being picked on, my advice is to just grit and bear it till graduation. After that, the entire high school universe will just flake apart and blow away on the wind.
On Sunday, Yomiko call. We talked about school for a bit, then she got down to business. She wanted to know if I had a girlfriend. Apparently, that is what her mother thought when I was not taking her phone calls all week. I said that I have been spending a lot of time at work (where my phone does not work) and asleep (where my phone does not work). Someday I will need to reveal just how boring she is to me, perhaps after she graduates. However, she seems like she needs a bit of compassion from time to time. Telling her off because I find her "inconvenient" would just be selfish.
I need to hit the dance pad now. One of the ways I deal with depression is with food. I have been bingeing sense Saturday. I had to break out one of the emergency chocolate supplies to share with my mother. Now it is time to work all of that off.
hmm... Emergency Chocolate Kit (ECK), that is a good product idea.
Posted by binhqx at 5:23 PM | Comments (1) | TrackBack
December 3, 2005
Saying goodbye to a old friend.
Bryce (the black dog in the picture) was a black Labrador mix who was part of my family for many years. Recently his heath seriously deteriorated. The medication was helping to hide the symptoms but nothing could stop the fact that he was dying. The only humane thing to do was to free him from his suffering. This morning my father and mother took him to the vet to be put down.
He was a fun loving spirit. He who would always greet me at the door no matter how late I got home at night. He was my companion after hours when the rest of my family had gone to bed. Bryce was always concerned with the the safety of his home and family. When ever I was with him I knew he would warn me of any danger. I away felt so safe in his presents.
So today I say goodbye to Bryce. I will and do miss him terribly.
Posted by binhqx at 7:33 PM | Comments (3) | TrackBack
December 2, 2005
Funny stuff: I am a Japanese School Teacher
This is perhaps the most in depth and funniest documentation of life in Japan.
I am a Japanese School Teacher
This is the journal of a American in Japan teaching english. He details the exploits and culture clashes of daily dealing with the youths of a foreign country.
They are so funny; I suggest starting at the beginning and reading through to learn of his own evolution in the land of the rising sun.
Posted by binhqx at 11:54 PM | Comments (2) | TrackBack
December 1, 2005
End of the Month Statistics
Here are the site statistics for the month of November.
Total Hits 21774 Total Files 10536 Total Pages 5216 Total Visits 1622 Total KBytes 219033
Not bad, but not a good as October. However, this could just be due to there being one less day in November.
The most interesting stats are the search strings that are being used to find this place. Check these out.
Rank Searches Search String 1 260 anime eyes 2 24 drawn eyes 3 6 anime reading 4 5 drawn anime 5 2 "anime characters" 6 2 anime + eyes 7 2 anime characters 8 2 anime eyes pictures 9 2 anime pictures drawn 10 2 anime+eyes
So it looks like the grand majority of the searches are for a article I wrote more then a year ago.
Perhaps someday, people will come here to find resent articles as well.
Posted by binhqx at 10:26 PM | Comments (0) | TrackBack