This Week I Learned - 2017 Week 16

Last week post or the regular whole series.

Minor hiccups due to sleeping schedule messed up my daily routine. Nothing but readjustment to get back on track. Switching different way of monitoring your habits did not produced the result needed. Furthermore, you should unwind during the weekend. If you need to use the Internet, write down the items you want to research instead of impulsively googling. Maybe I should just switch to dumb phone, nothing but for calls and SMS, like the old days. But it may not be a feasible solution and impractical.

#1 My whole development life in a circle where I have to encounter XXX again in the current development works. There is a write up on the origins of XXX as FIXME (via HN). Reason that we use XXX is easily greppable comment prefixes.

#2 How to handle Perl class-level variables. Two ways. (1) Lexical variable scoped (via subroutine) and (2) package variable. Simple concept that took me a while to finally realize and understand it.
# (1)
my $foo = 123;
sub get_foo { $foo }

# (2)
our $fubb = 456;

On a related note, found a list of Perl modules related to testing. There is so many modules that I haven't try out yet. So many things to try out, yet so little time.

#3 How do you remove all files except one? Seems hard yet so simple, if you know and remember how it works. Only on a rare instance you will encounter this. Typically we just move the file to different folder and delete the source folder.
$ shopt -s extglob 
$ rm -- !(file.txt)

#6 "If you haven't experienced true solitude yet, go find some. It's pretty grounding." (via HN) It's not a man against the wild but rather a man seeking himself through the solitude of nature. It has been so long that we ever lie down and look up the sky and enjoy the stars?

#7 "Colour is in the eye of the beholder". Interesting that our vocabulary influences how we perceive colours. Himba people have interesting vocabulary for colours, for example zoozu (dark colours and black), vapa (light colours and white), borou (green with blue and purple), dumbu (beige with yellow and some light green), and serandu (red with orange and pink). You can read more on this presentation, The Development of Color Categories in Two Languages: a longitudinal study.

#8 If you're facing problem with Google Chrome whenever you're opening new page but it took a while to load while waiting for "Resolving host...". Clear the DNS cache in Chrome. Seems to resolve the lagging issue for me and making browsing experience bearable.

No comments:

Post a Comment