What i learnt today #1

Standard

I don't blog much, that's why i decided to do some microblogging series about things i learn from day to day. Hope someone likes it, anyway so i do ;-P

So i aliased today='vi ~/md/today/$(date "+%Y-%m-%d").md' from this tweet so i can take quick notes over the day quickly and easily with vim.

I also red about Project Orleans from Microsoft, which is more or less Erlang/OTP written in C# under the .NET framework umbrella with a better DX (Developer Experience). It started as a Azure cloud-based backend for the game Halo. Somewhat related i remembered one of the best talks i attented to at last year's Craft Conf from Caitie McCaffrey explaining the Saga Pattern and how they applied it in Halo. More info in this InfoQ article.

I still enjoy 3D FPS, i don't play anymore and i hope i don't play again (too addictive) but i enjoy watching videos from time to time, mostly Q3A 1vs1. I also whatch them in one of the Social Point's gym bicycles which is great because the time somewhat pass faster. I particularly have enjoyed The Story of Overwatch video series, which has great inside about how important is gameplay in shooters and how they have been inspired by the classics, and this latest DOOM video at 1080p from the NVidia guys.

Also i red somewhere that chapters 20 and 21 from the Google SRE book are a must if do microservices so i will take a look there. Now i'm in 4th chapter so i'll jump straight to there this weekend.

Finally there are some enthusiasts of the Rust language like Alberto Fernández and Guillem Nieto at Social Point backend team. Talking with Marcos Quesada i arrived at the conclusion that ideally we should learn all languages with concurrency primitives and pick the best one for the tool since all of them have its prons and cons. The Learn X in Y tutorials are great for having a bird-eye view if you are an experienced programmer. So far i think i can say i know Erlang and Golang, so others in my list are, in my order of preference: Elixir (since like Erlang compiles to the BEAM VM but looks like Ruby), Rust (i find its syntax ugly but being free of memory bugs at compile time seems amazing), Clojure (since i hadn't had the chance to learn LISP at the university), Java/Scala+Akka (JavaVM is everywhere and the ecosystem is huge), Pony (why not?) and Haskell (this is the last one because i don't know anything about Category theory). Oh, and this is why i didn't choose Stackless Python in the list nor NodeJS.

How to make Canon Selphy CP900 photography printer work in OSX El Capitan

Standard

Since Canon does not provide CP900 drivers for latest OSX versions (shame on you Canon!) maybe these steps will help you:

  • Start the printer and connect it to your Mac via USB interface (yes, does not work with Wifi). Check out that the printer screen shows a computer connected to a printer.
  • Download the Gunterprint free software drivers for OSX from here.
  • Unpackage and install the drivers.
  • Go to Printers & Scanners in the control panel.
  • Add a new printer.
  • A Canon CP900 printer will appear with USB Kind value. Wait a little, a new one will appear with Kind guttenprint52+usb (52 because i downloaded drivers version 5.2). Click on the latter, and then click on the Use selector, and then choose the Canon SELPHY Cp900 - CUPS+Gutenprint Simplified. For some obscure reason just the Simplified driver worked for me. Now click on Add.
  • Try to print and voilà! Bear in mind that this printer sheets are 15x10 so change it accordingly in the print configuration dialog.

Ubuntu upgrade and apache 2.4 virtualhost configuration

Standard

I decided to upgrade my old Digital Ocean droplet to Ubuntu 15.10 which brings apache 2.4. Since i have this WordPress blog hosted in that server i had to change some things to make it work:

    • Change the Directory directives with Order allow,deny and Allow from all to Require all granted
    • Prepend the positive conditions with a '+' in the Options lines that had also negative conditions.
    • The sites-enabled symlinks now need the .conf extension as the sites-available configuration files do, so i had to rename them.

Source: Digital Ocean

Technological procrastionation, chapters zero and one

Standard

Chapter zero

Procrastination is the art of [...] putting off or delaying, especially something requiring immediate attention, and i think i'm quite a good artist in that, specifically in the tech side. I have a Trello list with a board full of project ideas but, except this blog and some minimum stuff at GitHub, i haven't done much. I think it's in part because i'm lazy and in part because i have already my 40h job and i like to enjoy weekend life in a spontaneous way, so if i have to do something i see it as an obligation and i don't like it. On the other hand i think side projects are a big contribution for IT résumés so i should find something that motivates me enough that i don't see it as work.

So during my free time i usually prefer to dive in reading tech literature, most of it from Hacker News (with this style extension to avoid the horrible design) and Reddit (mostly subreddits via RSS/feedly). In the tech side read mostly about programming languages, frameworks, software engineering and programming techniques, databases, compilers, text editors, cloud computing and virtual machines, processors and hardware architectures, operating systems and devops, networking, security, design, UX and any other random stuff that appears in those web pages and i think it's worth checking.

In the long term i think it's not a very good tactic, because i learn about tons of stuff, but since i don't go deep with any of them unless i can do it at work, i'm not particularly good at any of them. But hey, i do all this research as a hobby, i really like it and for now i think it's really OK.

So what i'll try to do is write a "technological procrastination" series of posts about random i thinks i find interesting around so at least i have something to write about :-)

Chapter one

  • WordPress >= 4.1 has a distraction free writing mode for posts.
  • “What happens when you type Google.com into your browser and press enter?” is an old question that was asked to interviewees in Google's interview processes. Someone has opened a GitHub repo where anyone can contribute to answer this question in depth, and there are many pull requests ready to merge.
  • What blocks Ruby, Python to get Javascript V8 speed? is an interesting question posted in Stack Overflow, which led me to learn about Lars Bak, who now works at Google's V8 team but has worked, among others, as the programming leader of the current Java VM. Also one of the comments references the GIL or Global Interpreter Lock which is how CPython (the "normal" Python interpreter written in C, more about Python's GIL here and here) and RubyMRI/CRuby deal with concurrency in multiprocessor machines in a simple but not in the most very efficient way in some cases, e.g. works really good in I/O-bounded tasks but not in CPU-bounded ones.

reloading...

Standard

I did some updates on this site, i hope you like them :-)

How to install erlang R16B03 and 17.1 with observer in OSX

Standard

This is a receipt for building Erlang/OTP R16B03 and 17.1 versions (note that since version 17 the release name pattern changes) with Observer, a really nifty graphical tool to monitor and debug Erlang/OTP applications and processes.

[Update]

As Dave Cottlehuber just posted in the comments, there is another way to install both R16B03 and 17.1 erlang versions for a 64 bit arch with a working observer with homebrew, where do you just need to:

So if you want to run version 17.1 after installing R16B03-1 you just do:

[/Update]

This receipt uses homebrew, the package manager for OSX, and kerl, an Erlang/OTP builder and installer.

In order to activate the release you should add to your shell's configuration (~/.bashrc or ~/.zshrc) one of these two following lines, depending of which erlang version you want to run:

Here you are a sample screenshot of Observer in action:

Screenshot 2014-09-05 19.07.46 Have fun with Erlang!

Spotify engineering culture notes

Standard

Agile

  • Scrum gave them a team-based culture starting point
  • It didn't scale for several teams so they made Scrum optional, but continued embracing Agile principles.

Team configuration

  • Are around 8 and have end-to-end responsibility for the stuff they build (design, code, commit, deploy, maintain, devops) and full autonomy to do it.
  • They have a mission/vision and short-term goals that are renegotiated every quarter.
  • Area: work zone with adjustable desks, lounge zone for planning sessions and retrospectives with whiteboards (kanban, brainstorming) another room for small meetings.

Autonomy

  • Leads to motivation which leads to build better stuff
  • Leads to be faster, working locally, avoiding managers and intermediators
  • Minimize dependencism and over-coordination, improve scale-out
  • Continuous delivery based on small, easy releases based heavily on automated tests

Goals

  • Teams' mission needs to be aligned with the core strategy of the company
  • Teams need to be loosely coupled but tightly aligned

Alignment vs Autonomy

align-autonomy

Leadership

  • Leader must communicate what needs to be solved and why (mission), but not how
  • Teams must coordinate to solve it

Coordination

  • Everyone can change others code even in different teams but must pass through peer code reviewing
  • Design guidelines and code standards reduce engineering friction but not too strict

Team building

  • Built around talent
  • Keep the motivation high
  • Trust > Control

Clean code and software estimation

Standard

I just finished reading the Clean Code book, from Uncle Bob (@).

One of the chapters that was more interesting to me was the one about software estimation. That's because i think estimation is hard and is something that i want to improve upon.

Some general observations from Uncle Bob about software estimation

  • simplest but most frightening activity that we software professionals face.
  • bussiness value and developer reputation depend much on it.
  • it's the main cause of opposition in the bussiness-development relationship.
  • developers view estimates as guesses, bussiness as commitments.

Commitment

  • is about certainty, and professionals shouldn't make one unless they know they can achieve it.
  • missing one hurts developer's reputation and  bussiness cost.

Estimation

  • is a guess, no commitment implied: missing one is not dishonorable.
  • most developers are terrible estimators because they don't know that the nature of an estimation is a distribution, not a number.
  • the probability distribution of finishing a task can be seen as a graph where the X axis is the unit of times to complete it and the Y axis is the probability to finish it in those units:

Screen Shot 2013-09-15 at 1.22.43 PM

  • To minimize the uncertainty a developer may be asked for a commitment. Giving it explicity or implicity without certainty is a mistake and is not professional. Remember, "do, or do not. There is no try" -- Master Yoda.

Estimation techniques

Three Point Estimation
  • The Three Point Estimation (based on PERT) is a 3-point estimation technique where the points are the Optimistic Estimate (O) or best case, the Nominal Estimate (N) or greatest chance of  success case and the Pessimistic Estimate (P) or worse case.
  • The probability of distribution of the expected duration of a task is described as . Basically this formula gives 4 times more importance to the nominal estimate than the best and worst cases and does an average. The uncertainty of this task is mesured as the standard deviation .
  • For a serie of tasks we have that and
Consensus Estimation
  • Wideband Delphi: the team assemble, discuss, estimate the task and iterates until agreement.
  • Flying Fingers: Wideband Delphi alternative where tasks are estimated on at time, each participant put their hands below and raise it at the same time from a cost estimation of 0 to 5 units (fingers)
  • Planning Poker or Scrum Poker: similar to Flying Fingers but the units are chosen from a deck of cards. The units normally use the Fibonacci sequence (1, 2, 3, 5, 8) are sometimes are equivalent to man-hours of work. If you don't want to buy the card deck you can use mobile apps like these ones.
  • Affinity Estimation: the card tasks are put randomly in the table and the team members sort the cards into unit cost piles without talking, the cards that are moved more than X times are discussed afterwards.
Consensus + Three Point Estimation

The team reaches a consensus based on the previous techniques but there are three estimates (O, N, P) and a probabilistic distribution is created for each task.

Conclusions

As a software developer you should know that an estimation is a guess, and to do it accurately is a hard task. If you estimate alone do a 3-point estimation, otherwise reach a consensus with your team using e.g planning poker (if you do Scrum this fits well in the backlog estimation meeting). Do not make a commitment to any task time unless you know 100% that you can achieve it. If a manager puts pressure on you to make a commitment negotiate first which task parts are going to be in and which ones out.

Additional links

Vim tricks #1

Standard

I've been toying with vim for around 10 years now. My approach to learn it has been slow, getting settings, mappings, plugins and tricks from here and there.

Here are some stuff that i found useful lately:

  • Paste last yanked text with "0p, which is the content of the default register (zero)
  • Indent a visual selection of a text representing a json (requires python, source) putting in your.vimrc this line: map j !python -m json.tool
  • Jump to prev/next class/method definitions:
    • ]] # next class/method
    • [[ # prev class/method