Law of diminishing distance
There is an implicit law and unseen forces in nature 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 against the law of diminishing distance.
MongoDB find vs findOne
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
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.
Experience vs Expertise
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.
Continue reading
It’s not a bug, it’s a feature
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? 😉
We will keep using the clock. I paid good money for it and we can live with its “uniqueness”. 😀
[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!
Running codeskulptor locally in Ubuntu
For the impatient, jump to the end of this post for the summary of the commands to be invoked. 😉
I have signed up again for a Coursera course for Interactive Python programming to improve my Python programming skills. I am going to sidestep the question if I am going to finish this course for the moment. 😉
The course professors have developed and are using CodeSkulptor to make it easier to create, submit, and grade the course. CodeSkulptor is basically a browser-based Python interpreter that implements a subset of Python 2.x. It absolves the students enrolled in the course from the requirement to install Python in their local machines plus it also allows them to continue working on their code while on different machines (provided they know their work’s randomly generated URL).
The abstraction provided by CodeSkulptor however renders some incompatibilities in running the code locally. This could be a disadvantage for people who wants to work offline, either by choice or by location. Coursera member Jimmy Delgado has provided good quick tutorial on how to run CodeSkulptor code locally. The post is in the Coursera forums but I am replicating it here and then augment it with the steps I have added to make it run on my Ubuntu 14.04 installation.
3-day detox diet retrospective
I was interested in the juicing and smoothie diets especially with their claims in helping the body detoxify. I came across the Dr. Oz 3-day detox diet plan which looks feasible. I started it 4 days ago and created a page on what I did differently.
Serenity
Its confirmed…
I am definitely entering the cycle where I am burned out. This is actually surprising as it came a couple of months earlier.
I am too mentally tired to be excited in trying a couple of tech that i thought was cool.
I need to get myself out of bed and hack at something. It is easier said than done though.