20 Dec 2019

Python profiling

History / Edit / PDF / EPUB / BIB / 1 min read (~66 words)

Run your program with python -m cProfile -o profile.cprofile my-script.py

Install snakeviz (pip install snakeviz) to visualize the generated profile.

snakeviz profile.cprofile

Alternative approach

Install pyprof2calltree to convert the cprofile to a kcachegrind compatible profile.

pyprof2calltree -i profile.cprofile -o callgrind.profile.cprofile

17 Nov 2019

RFC

History / Edit / PDF / EPUB / BIB / 2 min read (~283 words)
  • Keep all RFCs under a single location
  • Uniquely identify RFCs
  • Use a shared template
    • Editor: Name <email>
    • Status: Draft/Review/Approved/Abandoned/Implemented
    • Required approvers: Name <email> (why), Name <email> (why), ...
    • Approvers: Name <email> (date), Name <email> (date), ...
    • Created on: <date>
    • Updated on: <date>
    • Overview: A high level description of what you're describing in the document
    • Background/Context: Context relevant to understanding the document
    • Problem description: Describe what you are currently cannot do and want to be able to do
    • Motivation/Why: Why is it relevant to solve this problem now?
    • Drawbacks/Why not: What are the downsides of solving this problem?
    • Proposed solution: What is the best solution proposed?
    • Alternative solutions: What are the alternative solutions considered and why aren't they the proposed solution?
    • Impact and risks: What will be the impact of this change on existing systems, processes, or stakeholders?
    • Unresolved questions: What are the questions that need to be answered but don't have an answer to yet?
    • References: Documents/URLs that can be useful to consult
  • If a RFC is abandoned, the reasons why should be made explicit in the document

06 Oct 2019

Investing

History / Edit / PDF / EPUB / BIB / 2 min read (~282 words)

Note that most of the process is guided by a long term investment strategy. In other words, we expect to keep the assets we purchase for as long as possible, only selling to rebalance our portfolio.

  • Do not put all your eggs in one basket (stock), diversify.
  • Use indexes to determine which stocks to buy.
  • Start small (10% of what you want to invest in total) and do not invest everything at once, learn from your mistakes.
  • Do not sell when your stock drops, as it will drop in value at some point while you're holding it
  • When you start, there will be a period of time where some of your stocks value will go into the negative. Ignore it and wait a few months before deciding whether to part from it or not.
  • Pick stocks with good $R^2$ score and positive slope.
    • The idea here is that we want to invest in stocks which have shown to be highly predictable in the past, while also displaying linear growth (as such, this is not a useful indicator for stocks which have explosive growth).
  • Invest some percentage of the portfolio in stocks which provide regular dividends, this is to replace holding "high yield" saving accounts.
    • Opt to invest in REIT, which will offer monthly dividends as well as attractive growth in their value while you hold them.
  • If you want to keep things simple for yourself, buy ETFs.
    • VFV.TO is an ETF that tracks the S&P 500 in CAD and has a low expense ratio.
  • Compare your portfolio's performance against indexes.
    • If you perform more poorly than indexes over 6 months/1 year, sell the stocks you have and buy the index you compare against.
14 Jun 2019

Meetings

History / Edit / PDF / EPUB / BIB / 1 min read (~171 words)

  • Write/prepare an agenda listing the items to be discussed
  • Indicate the duration and responsible/lead of each
    • Aim for a meeting to last under an hour. If more time appears to be required, then prior work should be done in order to reduce the amount of time necessary for the meeting.
  • Define the list of invitees, try to keep it short, possibly under 6 people
  • Share the agenda with all the attendees
  • Schedule the meeting around boundaries (beginning/end of day, before/after lunch)

  • Present the agenda
  • Designate a person that will make sure that the agenda is respected

  • Determine next actions
  • Define deadlines for each next action
  • Assign a responsible for each next action

  • Create tasks in a task tracking system for the next actions

  • In the case where a recurrent meeting needs to be scheduled at a different time than usual, specify in the body of the message the reason of the change.

26 May 2019

Writing bug tickets

History / Edit / PDF / EPUB / BIB / 1 min read (~37 words)

  • Summary
  • Software version
  • Reproducible in latest version?
  • Environment details: compiler/interpreter, operating system, etc.
  • Steps to reproduce
  • Expected results
  • Actual results
  • Screen capture (if relevant)