This Week I Learned 2017 - Week 52

Last week post and something from the current and previous years.

Last week of the year 2017. Is good to have some reflection by looking back at all the blog posts for the whole year. In total, including this post, I've written 75 posts, 17 more posts that last year. My plan for next year is hopefully even more post but on diverse topics rather than usual technical stuff.

Sedentary lifestyle is still an issue although how much I tried to get more active in my daily life either at my office and my home. The heatmap below illustrates that. Compare to last year, I'm comparatively less active. As you age, metabolism drop and lacking physical activity does impact you health someway or another. One good indicator is you gain more weight. Furthermore, you have to spend more money to buy new cloth. Having a pedometer does help but it's good you can have a weekly review of your daily steps taken. Having a weekly review on the step taken or exercises done is the plan for the next year. Adjustment through adding one or two micro habits into your daily life here. Awareness is the key here.



FOSS contribution? Unfortunately, still nothing much even though the daily commit streak was there. Is an ongoing battle on what to work on and pushing the first commit ahead. Although I've tried to created a few new project but didn't pursuit much ahead. My weekly reflection indicated that trying to do too many stuff at one time will make you overwhelmed and nothing much get done. The usual Analysis Paralysis symptom. Adjustment for 2018? Keep the daily streak but be more focus and set priority on what you want to do. Finish what you plan to do. If you can't, delegate or postponed it to a scheduled date, and move on to something else.



And this is how I plan to do in coming year of 2018.

Enough rambling, back to the usual stuff.

What did I miss? That probably the most important question you should either ask yourself or the domain expert in the pursuit of improving or mastering your craft. I've long seek the answer to this question. How good can you be? What is your threshold of your skill? The book The Talent Code did provide some answers (one of it is practice or the way how to practice but there is more to that). However, the missing piece is still how to sustain the curiousity to move forward, especially you've done the craft long enough and stuck in the "same sh*t different day" or "been there done that" mindset. This is very true when comes to software development where each year, some new techs were "rediscovered" again and again. However, this does not apply to professional sport where your genetic and age will play a crucial role in advancing your craft.

In MySQL, ON DELETE NO ACTION is the same as NO ACTION RESTRICT. Yet another quirk of our beloved MySQL database. Compare to the standard SQL or other real databases,  InnoDB storage engine does not supports deferred check, meaning that you can take no action on deleting a record during a transaction and resolve it before completing the transaction. Yay! Embrace the powerful feature of MySQL!

React is the future, inevitably you have to embrace it and add it to your front end development stack one way or another.

Betta Spawn Log : BSL20171231 : HMPK Marble (S) x HMPK Blue (S)

Male: HMPK Marble (blue and white)
Age: 3+ months
Temperaments: Active.
Size: Medium (3.0cm body only)
Grade: C

We picked this male Betta of all the male because it was actively building, probably the largest bubble nest of all. Comparing its small size and the bubble nest size, we hoped to increase the probability of successful spawn. When we first bought this male, it's the only male Betta in the aquarium which was actively making a bubble nest in a very small jar. Active, mature adult, and healthy Betta fish build bubble nest all the time.




Female: HMPK Blue
Age: 3+ months
Temperaments: Aggressive
Size: Medium (3.0cm body only)
Grade: C

Log Notes
2017-12-25
Setting up the breeding tank. The usual aquarium plant, Indian Almond leave, floating plastic bag, transparent cup for the female Betta, and lastly the male Betta.



2017-12-29
We were not sure whether the pair of Betta fish mated successfully, but from the top view, we can see the small fry (black dot) have appeared in the bubble nest. Note that we were using a small plastic bag cover to hold the bubble nest. Once we confirmed mating was successfully, both females (yes, we used both to create some sort of competition between the female Betta to encourage fertilization) were removed from the breeding tank.


2018-01-04
The process of "cooking" BBS (Baby Brine Shrimp) as the food source for the hatched fry. It was a trial and error process where sometimes we didn't manage to hatch the shrimp. It was a lot of work and my SO took a lot of time to ensure all the fry were fed correctly.



2018-01-05
We extracted the male Betta from the breeding tank. The male seemed very depressed and was inactive for quite some time. Most likely this was post-breeding depression as it was separated from the fry. After this incident, we decided to switch to leave father with fry breeding method.



2018-03-13
Right now, all these fishes should be around 2.5-plus years old (see photo below). Therefore, we decided to move all the Betta fishes from the breeding tank to growing tank. Total fish count was 56. We were quite surprised by the number of fishes and initially thought that it should be around 20-plus to 30-plus. These juvenile fishes were quite happy with the additional spaces and were seen busy exploring the whole tank.


The setup of the growing tank was simple: 15 gallons aquarium tank, an air-pump filter (with carbon), Almond leaves extract and leaves, aquarium plants (Amazon Frogbit and Anacharis / Water Weed). We expect to change the water on bi-weekly basis, perhaps 25% changes.



2018-04-03
We started to jar all the male Bettas as we noticed they started to fight each others and many were susceptible to damaged fins. How we wish we have more jar available at this hour.




This Week I Learned 2017 - Week 51

Last week post and something from the past.

One more week to go before the end of 2017.

The breeding process ended up with failure and our beloved one ended up in casualty due to stress and infection. Nevertheless, hard lesson learned and time to wipe out the whole population and try again.

Fender or Squier? Made in America (MIA), Mexico (MIM), China (MIC), or Indonesia (MII)? Is the year end now and there are plenty of sales going on at the local music store to clear the old stock. Found a Fender Standard Stratocaster Satin MIM with a good bargain price but how does it compare to Squier Vintage or Squier Classic Vibe? The price differences is negligible but the MIM Strat is pretty much the closest you can get to a MIA Strat although there are still quite a few differences.

When comes to Squier Strat, the rank of all Squier models according to the quality (worse to best) as follows: Bullet, Affinity, Standard, Vintage Modified, Deluxe, and Classic Vibe. If you've a budget constraint and still want to get something worthwhile, get the Standard Strat. If not, go for Classic Vibe Strat, especially the '60s if you like the classic rock. The build quality definitely worth it.

During my travel, pleasant surprise to find a Squier Vintage Modified Surf Stratocaster. While I'm not a fan of the looks of the pickups, the Duncan Designed LS-102 lipstick seems unique and new to me. Unfortunately, my tight schedule prevented me to taking her for a drive. Clearly, one of the six unique Squiers you need in your collection.

You have to have a system. The more you read, the darker it gets.

When integrating with different systems, the unit test have save my arse for so many times. Changes in the web service API and lack of support of Unicode. Encountered this error message while checking the log, "HTTP::Message content must be bytes ......", it seems that the web service API calls were having issue sending and receiving HTTP request and response in UTF8. A simple Unicode conversion when making HTTP request (encoding) and receiving HTTP response (decoding) should fix the issue. Surprised that REST::Client does not have handler to handle the HTTP request and HTTP response body content.

$req = HTTP::Request->new(POST => $endpoint);
$req->content_type("text/plain; charset='utf8'");
$req->content(Encode::encode_utf8($utf8));

Judge Archer, ironically, the commentary is far more interesting than the movie itself.

It just dawned to me that this is so true. The lack of fundamental music theory is going lead you to great misunderstanding.
Most lead guitar parts are not chords. Typically playing in a band context will create a chord from multiple instruments, but that isn't always the case.

This Week I Learned - 2017 Week 50

Last week post or something from the archive.

Two more weeks to go and we can start the new year. Meet quite a few talented and inspiring people around. Wish I pick up illustration at a younger age. It never too old to try venture into something totally new.

The Second-system effect, where simple and efficient system was replaced by over-engineered systems due to personal agendas, preferences, and career advancement. The Mythical Man-Month book is within my reach and every time I saw the book cover, it reminded me of the profound insights of Fred Brooks. The Hack story at Facebook done everything correctly and to prevent such effect (Facebook should have just buy Zend last time and replace PHP with Hack instead). Software architecture is more leans towards theoretical, common sense, and management rather than practical hands-on stuff. Most of the recommended reading literature indicate this.

PostgreSQL Exercises. Yup, someone have helped me to check off one item of my bucket list. PostgreSQL should gain more traction and exposure comparable to MySQL. I'm glad someone made some contributions towards that direction. History always repeat itself, this time, unfortunately, the worse (MySQL) is always better.

License compliance. A concept so foreign for so many software house, let alone those startups or companies without even a human resource department.

Not really time management but mission, GTD, energy management, and automation.

Three girls in kitchen by William Gedney via (RD). When times were simpler and photography was manual, constraints, limited, and more humane. Roger May have a good write-up on his photography works.

Embroidery, potential new hobby for the coming new year? Example of a work (screenshot captured and cropped by me) by glazier-heart shown below. Not that hard, you just need patience and tracing ability. What if you combines your masterpiece with sarcasm and cynicism? Surely it going to be an awesome gift. Note to self, remember the Wheaton's Law.


This Week I Learned - 2017 Week 49

Last week post or something from the archive.

A few weeks ahead and we will reach the end of the year 2017 and embrace 2018. Slow week, lots of travelling and nothing much done. Interesting conversation with quite a few breeders.

Da Hu Fa is another good animation coming from China this year since the release of Big Fish & Begonia in 2016, preceded by Monkey King Hero Is Back in 2015. The Chinese animation industry comes a long way since the early days of Havoc in Heaven. It's still growing but still heavily influenced by Japanese anime in some ways and lack of the maturity and unique styles.

Interesting discussion on JavaScript itself with other developers. For RESTful API, use Koa.js (the development guide have some documentation), the next generation web framework for Node.js and the successor for Express.js.

Someone introduced me to Flow-based programming (FDP) and if you're using JavaScript, there is NoFlo. If you're from UNIX background, think FDP as pipeline or pipe and filter. Worth exploring and use it in your project? Well it depends, pretty much on the context or the type of system.



Looping and concatenating multiple arrays in Perl

Saw this code while searching through something and it caught my attention. Interesting way to concatenate arrays.
use strict;
use warnings;
use Data::Dumper;

my $a = [1,2];
my $b = [3,4];

my $c = [];
push @$c, @$_ for $a, $b;

print Dumper($c);

$perl main.pl
$VAR1 = [
          1,
          2,
          3,
          4
       ];

Alternatively, you can write it as this way where we concatenate both arrays.
use strict;
use warnings;
use Data::Dumper;

my $a = [1,2];
my $b = [3,4];

my $c = [];
push @$c, $_ for (@$a, @$b);

print Dumper($c);

$perl test1.pl
$VAR1 = [
          1,
          2,
          3,
          4
       ];

However, if we have any duplicate items in both $a or $b, it will be merged as well.
use strict;
use warnings;
use Data::Dumper;

my $a = [1,2];
my $b = [1,2,3,4];

my $c = [];
push @$c, $_ for (@$a, @$b);

print Dumper($c);

$perl test2.pl
$VAR1 = [
          1,
          2,
          1,
          2, 
          3,
          4
       ];

To resolve this, we need to remove the duplicate items in the combined array by using
List::MoreUtils.
use strict;
use warnings;
use Data::Dumper;
use List::MoreUtils qw(uniq);

my $a = [1,2];
my $b = [1,2,3,4];

my $c = [];
push @$c, $_ for uniq(@$a, @$b);

print Dumper($c);

$ perl test3.pl
$VAR1 = [
          1,
          2,
          3,
          4
        ];

This Week I Learned - 2017 Week 48

The usual last week post or something from the archive.

Down with fever and flu. At certain age, you really need to love your body as much as possible. On the bright side, I'm almost off the grid for the past few days.

The Best Monitor for Programming: A Cheap 40″ 4K TV. (via HN) Not really a good choice if you want to reduce eye strain and myopia. Also, you will need to have a good distance in order to get the actual benefits. However, definitely not for me. A large screen size is suitable for people who love to have multiple opened windows at the same time. I always prefer one window at a time.

The Diderot Effect. We all will experience this someway or another. Picking up a new hobby, for example, photography. Well, not only you're just getting the camera body only, you will purchase the whole system (complementary accessories), which includes bags, lens, filters, books, magazine, and etc. The constant upgrades will lead to endless hoarding. James Clear have recommended a few ways to manage Diderot Effect. The main take away are reduce exposures, prevent impulsive purchases, self-imposed constraints, and downgrade. The last strategy seems interesting. We're seldom downgrading on stuff we owned but constant pursuit for latest greatest.

CS007: Personal Finance For Engineers (via HN) Worth every minute of your time to go through the whole thing. We have been taught and educated on different types of mathematics but not really on finance. This should be the compulsory subject for all students. Start them young and early.

Emulate the SRV tones? Forget the about the budget and get his signature guitar, amps, and pedals. Or without bursting the bank, something more affordable. While having similar gears does getting you closer to emulate original tones, do know that how a guitarist play, hold, pick, and grip guitar have a huge influence on the tone. Furthermore, post processing have a big impact on the final sound and tone. However, something related, PixxyLixxx gave a good advice on why you should have a limit on how much you can spend on a guitar (in his case, is USD 300 with certain exception). Unless you're freaking rich, when you past certain age, different priorities in life set in. You should put the extra money in your kids college funds or fixing your house.