« December 2006 | Main | February 2007 »
January 31, 2007
Evening with Carla and Ari
I was invited to my aunty Carla's house to spend some time with her, Ari, and my cousin Carlton. However, Carlton did not show. He had to rain check till tomorrow. So I just spent some time there with Aunty, Ari, and Brick.
Ari has a tendency to bounce around a lot. I do not know where that little girl gets so much energy. It is like she is just bouncing off the walls all the time. It is a good thing she is adorable.
Aunty had made up some beef stew, one of my all time favorite foods. It is not a good a mom makes, but I so rarely get a opportunity to have some I just had to accept the offer.
Posted by binhqx at 2:05 AM | Comments (0) | TrackBack
January 30, 2007
Ugly queries can be the fastest.
I have been examining the way to mach phone numbers to rates for quite a while. The rate table consist of a list of rates, the ID of the route, and a partial phone number that it matches to. When I phone number comes in, I want to match it to the partial phone number in the rate table and get back all the possible routes with their associated rate.
For example id the number 5551234567 came in and I wanted all the possible routes and rates. The simplest way to do this is with the following query:
SELECT route_id, rate FROM rates WHERE '5551234567' LIKE digit_match || %
The I use postgresql's 'LIKE' operator to do a wild card search. However when the rate table becomes large this becomes slow. My current rate table is just over a million entries long and I need these lookups done quickly.
The best solution I have found is to not use wild card. The partial phone numbers are always the first part of number and all numbers are 10 digits long. So there are only 10 possible combinations to try. I have some up with this query that trys all the combinations at once:
SELECT route_id, rate FROM rates WHERE (digit_match = '5551234567' OR digit_match = '555123456' OR digit_match = '55512345' OR digit_match = '5551234' OR digit_match = '555123' OR digit_match = '55512' OR digit_match = '5551' OR digit_match = '555' OR digit_match = '55' OR digit_match = '5')
The result is many times faster because the table can just look up each sub number in the table index, no string matching necessary. The difference is obvious, the first query with the wild card search takes about 800ms. The second query only takes 4ms.
Sure it makes for a ugly query, but the speed difference is well worth it.
Posted by binhqx at 5:20 PM | Comments (0) | TrackBack
January 29, 2007
Programming satisfaction.
There is nothing like watching software you wrote work, and work well. Last week i hacked together a database program on PostgreSQL that processes VOIP calls and saves the company a lot of money.
Today I turned it up and it worked nearly perfectly. Just one bug had to be stomped out. However now it is humming away processing thousands of calls flawlessly. The next revision I write will work even better!
Posted by binhqx at 5:17 PM | Comments (0) | TrackBack
January 28, 2007
A nothing day.. how about some football
I have never been much of a football fan. I will sit with other football and enjoy a game with them, but I would never watch/play it by myself. However I did play the new Madden game on the Wii and really enjoyed it. You can hear my thoughts on Madden, as well as those of others on the latest Medacast ( the last half of the podcast.).
Posted by binhqx at 5:11 PM | Comments (0) | TrackBack
January 27, 2007
Annoying things at a design meetings: the stranger.
While holding a creative design meeting there is nothing quite as annoying as a new person stumbling in (occasionally intoxicated) with out any idea what we are doing and start offing suggestions. As if just by being there they are initialed to be part of the design process.
The problem is that hay have really no idea what is happening and they are not knowledgeable about the subject matter. because time is limited no one wants to bring them up to speed as to what is going on. So every pice of input they give is replied with "Yeah, sure, that may work," or "We will put that idea in the tentative category."
I hate telling them off because they are not bad ideas, they are just ideas that are of no uses to us. That is the problem about holing meetings in common areas.
Posted by binhqx at 1:57 AM | Comments (3) | TrackBack
January 26, 2007
New Project
I have started a new project with Cap and SB. it is all a bit hush-hush right new. Hopefully I will be about to talk about it more in the future. I do know that it will be eating up a lot of time this weekend and in many upcoming weekends. That is okay though. These cold dark winter day are not good for much. I really can not wait till the warm weather comes back. Perhaps then i will feel more like going out and doing something.
Posted by binhqx at 1:44 AM | Comments (0) | TrackBack
January 25, 2007
Thai Peanut Party
Today we decided to have what can only be described as a Thai peanut party. We figured out how to cook chicken satay with peanut sauce. I would have pictures, but as soon as each batch of chicken came out of the oven, it was instantly consumed. After dinner we took some of the peanut sauce ingredients and made peanut-butter cookies with coconut. Yum!
Posted by binhqx at 12:26 PM | Comments (0) | TrackBack
January 24, 2007
Better...
I am feeling a whole lot better today. SB and Cap have once again started to work on stuff. The creative process is moving along nicely.
After DDR this evening I sat down and watched The Queen. The movie gives a unique perspective of the inner-workings of the royal family. It conveys a understanding of the actions of the royal family just after the death of Princess Diana. A simple difference between old and new world cultures nearly pulled the british monarchy from power. A great watch.
Posted by binhqx at 11:16 PM | Comments (0) | TrackBack
January 23, 2007
Blue afternoon.
i a, having one of those days where I just can not muster the energy to do anything. So I am skipping DDR and going to curl up in bed with a book. I am still trying to finish Ishmael. It is a good book, but I am already familiar with the pretense of the story via other influences.
Posted by binhqx at 10:50 PM | Comments (0) | TrackBack
January 22, 2007
Determining the SIP messages of a single dialog.
A problem with the SIP protocol is its statelessness between transactions. How is it possible to tell which SIP messages belong to which dialog. The easy answer is to just use the Call-ID field. However, there is a chance that a two calls with the same Call-ID could be sent through a stateless proxy to two different gateways. This is perfectly accessible but the proxy would have no idea which messages belong to each dialog. It is theoretically to have the proxy log the one call is stopping and the other one would be unaccounted for.
I finally found the answer to this problem in section 19.3 of rfc3261 using the tag field in the To: and From: header. These tags are generated by their respective endpoints and can be used to verify if the field has been tampered with.
So by using the Call-ID and the tags from the to and from header, we can be sure that the message does indeed belong to the dialog.
Posted by binhqx at 12:28 PM | Comments (0) | TrackBack
January 21, 2007
A good Saturday night.
The weather has become precariously cold so going out is not very enticing. Instead we had to see how much fun we could have staying in Saturday night.
First we started with WarioWare: Smooth Moves. WarioWare is a video game the consists of dozens of 5 second mini-games that have to be completed in quick succession. In the multi-player mode, each player takes a turn playing a different game. Each round the games become faster and more difficult. When a player fails to complete a game they fall out until there is only one person remaining. That person is the winner. We added a twist where as a player fails, they have to have drink of a alcoholic beverage. After a few rounds, the the performance of the players stated dropping, but everyone enjoyed themselves.
Next we watched two best Star Trek movies ever made, Star Trek: First Contact and Star Trek IV: The Voyage Home. However, now that we where slightly inebriated, the sexual orientation of George Takei became the center of a lot of jokes during the movie.
After that we all made our way to bed all drunk and happy.
Posted by binhqx at 2:33 AM | Comments (0) | TrackBack
January 20, 2007
Not going out...
It sucks when you want to go out on a Saturday night and everyone else does not.
Posted by binhqx at 5:03 PM | Comments (0) | TrackBack
January 19, 2007
Famous and The Screen at the Brick House
I braved the snow to walk to the Brick House to see Famous and The Screen. These are two very good and energetic bands.
Unfortunately it was a snowy Thursday night so by the end of the night it was just Fletch/Mario group and a couple of The Screen fan-girls hanging around. It is really too bad there where not more people around to hear them.
I need to get out more often. Even if there is no one else there but the band and the bartender, if the music is good it is worth the time.
Posted by binhqx at 4:55 PM | Comments (0) | TrackBack
January 18, 2007
Make life easy for webmasters with Virtualmin
I was looking for ways to speed up the request to completion lag of new web customers. it can take a lot of time to setup the user accounts, setup the DNS, and reconfigure the apache server. Not to mention the email hosting.
So i looked around and found a extension of webmin called Virtualmin. Virtualmin automates just about all the tasks required to setup a new web user including database accounts.
Installing it is a bit of a pain if you do not know how to add modules to apache. Virtualmin uses mod_suexec and mod_actions. If these are not installed take a look at man a2enmod to see how to install these.
Posted by binhqx at 4:10 PM | Comments (0) | TrackBack
January 17, 2007
Time to buy heat
The oil tank is down to the last 1/4, so it is time to get a refill. I had SB call around to a few heating oil providers. Due to the mild weather a dropping oil prices, I did not see a need to pre-buy or lock-in a oil price. We found Borderline Fuels, Inc. had a price $0.10 lower then everyone else and free delivery tomorrow.
So the oil guy will be coming by tomorrow to top us off.
Posted by binhqx at 4:25 PM | Comments (3) | TrackBack
January 16, 2007
New episodes of Rome
The second season of Rome snuck in under the radar. If you have HBO I highly suggest watching it. If you do not have HBO, just check your favorite bittorent site.
Posted by binhqx at 4:45 PM | Comments (0) | TrackBack
January 15, 2007
Giant Reeses Cup
Tonight, SB and I made the biggest Reeses Cup I have ever seen. It was nearly eight inches in diameter and three inches tall. That is going to be a tasty treat.
Posted by binhqx at 2:46 PM | Comments (2) | TrackBack
January 14, 2007
Ice day
Today the weather has decided to rain while the ambient temperature says below freezing. The result is a ice storm. Rain hits ant exposed surface and freezes in place creating a wonderland of deadly slippery surfaces.
So I plan to say inside today. I bought a big box of Jiffy yesterday. Today I am probably try making some of the recipes on the back of the box. Then I will take my delicious creations and watch some Stargate Atlantis.
Anything to fill the time.
Posted by binhqx at 2:48 PM | Comments (0) | TrackBack
January 13, 2007
Spending time with myself and the world.
I like to consider myself a amateur sociologist. The way people interact with each other is a field of knowledge where I am lacking. So when I have to go out and do a couple of errands and I do not have any time consternates, I do field research.
So while I am getting the thing I need, I watch other people interacting with each other and their environment. Just observing the way a young couple selects groceries can speak volumes about the devisions of domestic responsibilities in contemporary culture. Or the way a mother manages to herd her energetic children across the length of super store like Target and still not forget a single purchase along the way. It is quite extraordinary.
Other time I end up with more questions then answers. Like why would a woman buy no fewer then eight panties of different styles and florescent colors then continuously pick through them as she stood in the checkout line.
Overall I feel like I have a slightly better understanding of the world around me by just taking the time to stop and watch it in action.
Posted by binhqx at 3:41 PM | Comments (0) | TrackBack
January 12, 2007
The white guy dance
One thing I do not understand is the existence of the white guy dance. You know, the dance that all caucasian males do at cubs and other dance venues. They look so silly doing it but woman who actually have some talent will dance with them. It make no sense.
Posted by binhqx at 5:27 PM | Comments (0) | TrackBack
January 11, 2007
FUSE on the Mac!
Mac administrators everywhere rejoice. We can now mount the filesystem of any host running a secure shell damon. Thanks to the people at google who wrote MacFUSE.
FUSE is a kernel extension that allows programs running in user space to create a virtual file system. The best known example of this is sshfs. However there are so many more.
When I get some down time, I'm going to see how well it works.
Posted by binhqx at 5:12 PM | Comments (0) | TrackBack
January 10, 2007
Crumpets!
With SB back from Puerto Rico, we can finally catch up on some Torchwood. For the event I decided to make something very british, Crumpets.
I had to go out and find some metal rings to put on the grill. A crumpet is very much like a pancake. The difference is a crumpet uses yeast to make it light and bubbly and they are cooked in a ring to kepp the batter from spreading.
I found the rings at a cooking store. They are about 3 inches in diameter, metal with a nonstick finish. my biggest frying pan could fit three of them at a time. It would work better if I had a proper electric grill, but I lost the power cord for mine during the move.
I made due with what I had and the result where scrumptious. A whole pile of steamy, hot, buttery, crumpets. It is best to top a crumpet with your favorite jam or jelly. I happened to have received a jar of strawberry conserve as a Christmas present. A perfect American toping to a british treat.
Posted by binhqx at 4:35 PM | Comments (0) | TrackBack
January 9, 2007
How to tell GCC where your custom headers and libraries.
If you have ever done development with GCC on a system without root access, you know how difficult it can be to use custom compiled libraries and headers. The problem is the default locations where gcc looks for headers and libraries. These usually include the following:
/usr/include
/usr/local/include
/lib
/usr/lib
/usr/local/lib
However, these directories are root controlled. If you want to use your own custom libraries with out rewriting the Makefile you will need the administrator to install your headers and libraries there.
The other option is to tell GCC to look in a custom location for headers and libraries. If, for example, I had compiled radiusclient-ng and put its headers and libraries in my home directory.
/home/binhqx/sandbox/include
/home/binhqx/sandbox/lib
Now I can tell GCC where these file are using environment variables. To tell gcc where to look for the headers I do:
export C_INCLUDE_PATH=/home/binhqx/sandbox/include
The same goes for the libraries for the linker:
export LIBRARY_PATH=/home/binhqx/sandbox/lib
Now when I compile my program and tell it ti use radiusclient-ng, it will find all the necessary files.
gcc -Wall hello.c -lradiusclient-ng -o hello
I got this info from An Introduction to GCC. It is very useful for developers or if you just want to compile some of your own software from source.
Posted by binhqx at 4:42 PM | Comments (0) | TrackBack
January 8, 2007
A couple Medacasts without SB
Cap and I did the last two Medacasts without the talents of SB.
Medacast #040
Medacast #039
The show has a slightly different flavor with just us. By the time we did 40 I was finally feeling comfortable with just two (or three with Devin). I wonder what other people think of the quality of the show with this cast.
Posted by binhqx at 2:00 PM | Comments (0) | TrackBack
January 7, 2007
Strange Game: Seaman
Seaman is one of those bizarre games that refuses to be defined in a standard gaming category. It is basically a pet simulator. However the pet is a life-form with animal body and a human head. The pet can speak and understand english. It will attempt to converse with the player in order learn as much as posable about each other.
Seaman came out for the Sega Dreamcast back in 2000. It used a microphone on the controller to allow for speech interaction. The game can understand many words and has many scripted replies for them. The voice recognition is not very good. I often find I need to repeat the word in order for the game to recognize what I say. When it does work the result is down right creepy. The seaman creature tends to make many belittling remarks about the player. There is nothing like having your social life criticized by a fish with a human head. I mean it there is nothing like it.
Another unusual feature is all the out of game narration done uses the talent of Leonard Nimoy.
The over all reaction I get from just about everyone who sees the game being played is: "This is creepy." I see it as a experiment in video gaming. Seaman failed to create the the next level in human-AI gaming.
Posted by binhqx at 1:43 PM | Comments (0) | TrackBack
January 6, 2007
RSCS Holiday party
I was lucky enough to be invited to RSCS's holiday party. Jen worked there over the summer and she invited me as her guest. The party was great, everyone I met there were so great. Now I see why Jen always talks about having so much fun working there.
The radiation safety community is relatively small and well connected. My father has worked in the industry for many years. So I had the opportunity to mention who my father is and immodestly hear about the wonderful business relationships that have had with him and how much they enjoyed working with him.
I have not have many situations in my life when total strangers have made my feel proud of my father. It feels really good.
Posted by binhqx at 11:25 PM | Comments (0) | TrackBack
January 5, 2007
Sleepy after work.
Sometimes I feel very sleepy just after 5:00PM. I end up stumbling out of work and into my car. A dangerous way to drive. I could take a nap after work just before leaving, but cats have shed all over any comfortable napping place.
Posted by binhqx at 6:12 PM | Comments (0) | TrackBack
January 4, 2007
Do you ever misplace your cellphone?
Sometimes I misplace my cellphone for a while. While looking for it I hope that I have not missed any calls. If I find the phone with no missed calls I am relieved. Then I start worrying why no one has called me. This is a no win situation.
Posted by binhqx at 4:49 PM | Comments (1) | TrackBack
January 3, 2007
Recompile and it just works
I have been working all day on interfacing openser with freeradius for user authentication. Openser uses a library called radiusclient-ng to do all the client grunt work.
I just went to the radiusclient-ng site and used the CVS instructions to get the latest code from the repository. I made the mistake of assuming that the latest HEAD revision of the code is also the latest stable code. I did not discover my mistake till I spent all day trying to get radiusclient-ng to verify the freeradius response with a digest verification.
Eventuality I gave up and went back to the CVS repository to start fresh. It was then I noticed that there is a separate tag for all the stable release code revisions. So I grabbed RELENG_0_5_2 and recompiled. It just worked. ugh!
To get RELENG_0_5_2 run the following commands in any unix shell with cvs installed..
cvs -d:pserver:anonymous@cvs.radiusclient-ng.berlios.de:/cvsroot/radiusclient-ng loginWhen prompted for a password, hit enter.
cvs -z3 -d:pserver:anonymous@cvs.radiusclient-ng.berlios.de:/cvsroot/radiusclient-ng co -rRELENG_0_5_2 radiusclient-ng
The lesson: make sure you get the stable code.
Posted by binhqx at 1:24 PM | Comments (0) | TrackBack
January 2, 2007
Vendors selling empty promises.
I spent the day working with Cap to configure some new web store software. The vender calmed that the software would fulfill our need to quickly setup and maintain many similar web storefronts without managing them individually. This is important to us because we want to run 50+ stores without having to handle 50+ independent installations. So after we get it all setup, we can not find this multi-store feature.
We went back to the vendor and found this feature is just a scrip that will make copies of the first install. So we are essentiality back to square one. A whole day wasted because of one vendors exaggerations.
Posted by binhqx at 5:16 PM | Comments (0) | TrackBack
January 1, 2007
Happy New Year
Happy New Year everyone!
Posted by binhqx at 4:07 PM | Comments (0) | TrackBack