Skip to content

Instantly share code, notes, and snippets.

@jvns
jvns / perf.md
Last active August 29, 2015 14:01

perf!

Yesterday we talked about perf. Let's start using perf!

I learned how to make flame graphs with perf today and it is THE BEST. I found this because Graydon Hoare pointed me to Brendan Gregg's excellent page on how to use perf.

Wait up! What's perf? I've talked about strace a lot before (in Debug your programs like they're closed source). strace lets you see which system calls a program is calling. But what if you wanted to know

  • how many CPU instructions it ran?
  • How many L1 cache misses there were?
@jvns
jvns / gpa_vs_team_size.ipynb
Created May 22, 2014 20:39
Does team size affect CodeClimate GPA?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

stats:

  • Bayesian statistics and Markov chains
  • ANOVA
  • how do you decide what sample size is big enough?
  • likelihood ratio tests
  • go through all of the different distributions. I only really know the normal one :) (this is a really cool question actually! Understanding what distributions come up in real life and how to handle them is super interesting .)

ML:

Abstract for your talk

strace lets you look into the soul of a program and see how it works. Without even seeing the source code! ANY program. I've become kind of obsessed with it and I'd like to share my obsession with you. We'll learn about system calls and go through a couple of practical examples of how to use strace to solve your everyday programming problems.

Timeline for your talk

1: Hello!!!!

2-4 Okay what even is strace?!

@jvns
jvns / ml_cfp.md
Last active August 29, 2015 14:05

machine learning mistakes

This isn't an academic machine learning conference. This isn't a business conference. Nobody will tell you "Big data is at the foundation of all the megatrends happening today". This is a conference for people who work with data all day and have stories to tell about it.

This is a conference where we talk about what you do when you have a dataset and a business problem you're trying to solve and

  • you're not sure how to map your actual business problem to a metric
  • and you have lots of data but 80% of it is unlabelled and how should you handle that
  • and you start with a simple model and it does pretty well but could it do even better? and you're not sure.

Title: Systems programming as a swiss army knife

Duration: 30 minutes

Description:

You might think of the Linux kernel as something that only kernel developers need to know about. Not so! It turns out that understanding some basics about kernels and systems programming makes you a better developer, and you can use this knowledge when debugging your normal everyday Python programs.

We’ll talk about how to use strace, ltrace, /proc, and friends to debug your servers and your misbehaving programs. A few specific tricks we’ll cover:

@jvns
jvns / exercise_solutions.md
Last active August 29, 2015 14:06
exercise_solutions.md

Exercise 1

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>

#include "utils.h"
@jvns
jvns / smile.c
Created September 19, 2014 04:19
#include <unistd.h>
#include <stdio.h>
int main() {
while(1) {
printf(":) ");
fflush(stdout);
sleep(1);
}
}
@jvns
jvns / bundler.md
Last active September 28, 2015 02:27

why I didn't understand Bundler

Yesterday I was having drinks with @sferik, and I mentioned that I find Bundler really confusing, more confusing than virtualenv. And then he called me on it and was like "okay but why?"

And I think we figured it out! And it wasn't just that I know the Python ecosystem better than the Ruby one (though I do). Here's the story. (it doesn't have much to do with bundler, and it might not be true, but it felt satisfying to me)

In 2012, I wanted to install Octopress. I already had some Rubies on my computer, and Octopress had helpful instructions telling me to bundle install. It did not work and I was real sad.

the story gets real simple real fast: if you want to install a Python package, it almost always works with Python 2.7. If you have any Python on your computer and it was installed in the last couple years, you have Python 2.7.