Week 3000

Still adjusting to working with offshore developers. There definitely is a pattern of setting up a request, expecting it to be all done in the morning, and having to answer a few questions or concerns the next morning. If you don’t get to those questions immediately, you miss another day cycle.

Speaking of cycling – I took a day off of biking to work on Monday. Tuesday I went again and hit tons of personal bests! I’ve given in and started using Strava and it’s interesting to see how there is a an actual trend of improvement. For example, here’s my times on the Manhattan Bridge.

It is cheesy, but all these personal records and gold medals against myself are very rewarding.

Another takeaway: maybe rested legs are stronger!  Due to rain and hangovers, I’ve only done 24 miles this week . Hope for more next week!

Also at work, we’ve whipped up some backpacks for kids that can’t afford school supplies.

I did some virtual phone banking at lunch on Thursday and Friday for Danny O’Connor. Mostly leaving messages, but every bit helps. There’s a special election on Tuesday in Ohio and I want to make sure I do what I can for it. I invite you to join me – these things are easy, they don’t take time and they make a  difference.

On twitter, I really like the #InvisibleNetworks tag. @ctrlcreep is running 30 days of story prompts and people are replying with weird imaginative little stories.

Max is writing a book. He’s done 2 chapters about a bunch of robots in space. Cute Bun, AVX and their pals are all fighting and using lasers and it’s awesome.

Zelda is still working on her walking. 3 or 4 steps at a time now.

This week I got to dig in a bit on some performance profiling.

While doing some performance testing I found I needed to put in a bunch of temp log statements, but ugh… So I just created a decorator that will log the docstring of any python function and voila!

It’s hard to know exactly where your performance hits happen – so Robert Kern’s line_profiler is a great help.

I set up a terminator session with a few open terminals (different terminals allow you to take advantage of multiple processes and cpus). Then I used entr in each one to run profilers and timers and linters on the scripts.

ls *.py | entr -cs 'kernprof -l ProfileDriver.py ; python -m line_profiler ProfileDriver.py.lprof

This tells entr that whenever any python file changes

  1. clear the screen “-c”
  2. profile the code: “kernprof -l ProfileDriver.py;”
  3. then display the saved profile of the code: “python -m line_profiler ProfileDriver.py.lprof’

In other terminals I put in

ls *.py | entr -cs 'flake8 *.py'
ls *.py | entr -cs 'pylint *.py'

This way I keep my code clean – with a dash of autopep8 -a -a -i  to solve the easiest pep8 errors automatically. It’s also really something how much easier it is to reason about the code as I break it down into smaller chunks.

I’ve installed PyCharm in the linux workspace, and it is definitely a step up. Comes with vim emulation built in and it’s got some nice refactoring tools.

But wait, there's more

Leave a Reply

Your email address will not be published. Required fields are marked *