This Week I Learned - 2017 Week 19

Last week post or the whole series.

Slow week but nevertheless, it was an interesting turn of event. Can't wait for more excitements to unfold in coming week. Importantly, never lose focus on your goals over petty things.

#1 One of the best experience shared I've read when comes to employment agreement. Always read the agreement carefully and lawyer up when necessary. Emphasis added by me.
I got sucked into a dispute with a former employer once over intellectual property rights in an employment agreement. They kept trying to sneak in a clause into the agreement in every other paragraph that gave them ownership of, full rights/responsibilities for, and access to, anything I did remotely related to programming or computers outside of work while not on the clock. It was so broad, even my non-lawyer ass knew it was an awful thing. It became a deadlock argument back and forth until I asked if they were accepting liability for any illegal activities I could perform outside of work. Suffice to say those clauses disappeared by CoB the next day in the agreement.
#2 Perl's answers to the Fizz-Buzz question.
#! /usr/bin/env perl
use strict;
use warnings;
use 5.024;

my $t = <>;
chomp $t;

for my $ins ( 0..$t-1) {
    my $limit = <>;
    my $sum = 0;
    map {
        $sum += $_ if ($_ % 5 == 0 or $_ % 3 == 0) 
        } 0..$limit-1;
    print "$sum\n";
}

What interested me is not the solution but the input from the diamond operator (<>) used within this context, which itself is also another interesting story. The diamond operator is useful when writing GNU/Linux console utilities as the operator will work either on standard input or files.

#3 Probably the best sequence diagram to illustrate an HTTP request through CGI. Source from Web Development with Perl.

#4 Why does Google prepend while(1); to their JSON responses? (via HN)

#5 Why you should just use PostgreSQL if you're using Open-sourced database systems? See the number of features (those in green) available. Sigh. Yet we still stuck with MySQL.

No comments:

Post a Comment