Law of diminishing distance

No Comments

Its the implicit law of natute that increases the intensity of the urgency to take a crap as the distance decreases between your vehicle/position and your home or the nearest toilet.

Ever heard of the male trick of thinking about other things to delay “satisfaction”?  It doesn’t work.

MongoDB find vs findOne

No Comments

I got hit by this newbie bug. The exercise entails getting a specific record from the database, storing it in a variable, updating it a few times and saving it in the database after each update. Sounds simple, until I am perplexed that I cannot view the variable more than once. The second invocation is just showing or returning an empty string.


> var myobject = db.products.find({_id : ObjectId("507d95d5719dbef170f15c00")})
> myobject
{ "_id" : ObjectId("507d95d5719dbef170f15c00"), "name" : "Phone Service Family Plan", "type" : "service", "monthly_price" : 90, "limits" : { "voice" : { "units" : "minutes", "n" : 1200, "over_rate" : 0.05 }, "data" : { "n" : "unlimited", "over_rate" : 0 }, "sms" : { "n" : "unlimited", "over_rate" : 0 } }, "sales_tax" : true, "term_years" : 2 }
> myobject
>
> //why cant i display the object contents again?
>

It turned out that I should have used db.products.findOne instead. The findOne function returns an actual document record while the find function returns a cursor. Yes, the cursor moved the pointer on the next record after each read request which means that subsequent read calls to it are getting nothing since the cursor was already pointing to the “end of cursor” location after the first read, if I correlate that correctly with how cursors in relational databases work.

Great to know. I want my 15 minutes back. :)

ciao!

Shopping and Shipping from the US

No Comments

Online shopping and buying credits presents one of the most alluring temptation combo known to the modern man. There are a few local online shops that have established their own brand but nothing beats the variety of what is available in the US market. Unfortunately not all of the US shops deliver directly to the Philippines, and some who do are expected to either leave a scorching mark on one’s wallet or are in danger of not arriving in your doorstep if its valuable enough to catch the fancy of those in the courier/custom/postal service.

Here comes to the rescue a variety of maildrop services in the US. Their services basically provides you with a US address or PO box, and then handle shipping it to the Philippines at a nominal cost. Searching for them is easy enough but I will detail something that I have used in the past, mostly because of their affordable price and convenient arrangement for somebody who doesn’t always have somebody left in the house to receive packages: Johnny Air Cargo.

More

Experience vs Expertise

No Comments

It is common to see in the IT industry people trumpet how many years of experience they have for certain technology or skills. The practice is one of the cheapest form of self-advertisement. The problem is that experience doesn’t always equate to expertise.
More

It’s not a bug, it’s a feature

No Comments

Our kitchen clock stopped working and the wife fetched from storage the clock I purchased from Ikea almost a decade ago when I was assigned temporarily in Finland. It was a pine-wood clock under the Doldis model name. It was smaller than the clock it replaced but thankfully it was still working and usable after all these years of storage.

The clock only has the hour and minute hands. The lack of the minute hands makes it not as useful when cooking. There was something else though that made me a butt of some jokes from my wife as I didn’t catch it when I bought the clock. Can you see it? ;)

Ikea Doldis Clock

We will keep using the clock. I paid good money for it and we can live with its “uniqueness”. :D

[UPDATE] I am aware that using more than 3 Roman numerals is acceptable albeit non-standard. The clock doesn’t use that form for number 9 though. :)

ciao!

Older Entries