View examineNaN.js
function examineNaN(x) {
const buf = new ArrayBuffer(8);
const view = new DataView(buf);
view.setFloat64(0, x);
let binStr = '';
for (let i = 0; i < 8; i++) {
binStr += ('00000000' + view.getUint8(i).toString(2)).slice(-8) + ' ';
}
View perf_zine.txt
find 27968 97997.204322: 707897 cycles:pp:
7fffc034eac7 read_extent_buffer ([kernel.kallsyms])
7fffc032e4f7 btrfs_real_readdir ([kernel.kallsyms])
7fff81229eb8 iterate_dir ([kernel.kallsyms])
7fff8122a359 sys_getdents ([kernel.kallsyms])
7fff81850fc8 entry_SYSCALL_64_fastpath ([kernel.kallsyms])
c88eb __getdents64 (/lib/x86_64-linux-gnu/libc-2.23.so)
View rustconf-talks.md

Talks I'd love to see at RustConf

hi! I'm on the RustConf program committee this year, so here is a quick list of talks I'd be interested in seeing submitted. These are just things I personally think are interesting and I certainly don't represent the program committee as a whole :). As of today I haven't seen talk proposals about any of these!

introduce a small part of the Rust compiler

I imagine a lot of Rust developers have never read any of the code in the Rust compiler (I haven't!). And I know the language is trying to bring in more contributors! So I think an awesome talk could be:

  • pick a small part of the Rust compiler (maybe a part you've contributed to!)
View gdb.md
% self  % total  name
 68.90    68.90  sleeping - ci/ruby-programs/day.rb
 10.33    10.33  black_panther - ci/ruby-programs/day.rb
  6.99     6.99  learn - ci/ruby-programs/day.rb
  6.89     6.89  eat - ci/ruby-programs/day.rb
  6.89     6.89  clean - ci/ruby-programs/day.rb
  0.00   100.00  block in <main> - ci/ruby-programs/day.rb
  0.00   100.00  <main> - ci/ruby-programs/day.rb
  0.00   100.00  <c function> - unknown
View ruby-allocator-count.py
#!/usr/bin/python
# to try this you'll need to edit in the name of your ruby binary and install bcc-tools
# bcc installation instructions are at https://github.com/iovisor/bcc/blob/master/INSTALL.md
from __future__ import print_function
from bcc import BPF
from time import sleep
import os
# load BPF program
View freeze-mac.c
#include <mach/mach_init.h>
#include <mach/port.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
int main() {
for (;;) {
pid_t pid = fork();
if (pid == 0) execv("/usr/bin/true", NULL);
View regexp_compilation.rb
require 'pathname'
SEPARATOR_PAT = Pathname::SEPARATOR_PAT
def chop_basename(path)
base = File.basename(path)
if /\A#{SEPARATOR_PAT}?\z/ =~ base
return nil
else
return path[0, path.rindex(base)], base
end
View things_i_don't_know.md

things I don't know

I took this list from What CS majors should know.

I think it is fun to list things I don't know so I did it =D. I actually found it to be a cool exercise -- maybe I should do a fun graphics project and learn about Open GL!

i wrote this because, while i think the things on this list are potentially worth knowing, and I actually think it's an awesome list of project ideas as well as good food for thought for people developing CS curricula (many of the things I don't know are great exercises!) -- I thought it was really weird to say that every CS student should know all of them. I have a CS degree and I learned very few of the things I do know inside my degree.

I classify "do know" as anything that I have a reasonable grasp of or at least some basic experience with -- the kind of experience I'd expect a CS student to be able to get. If I say I don't know something, it means either I know pretty much nothing about it (for "gr

View a_networking_puzzle.md

You are trying to make a lot of simulataneous network connections to localhost. You get up to about 2000 HTTP requests per second, when your CPU usage goes up to 100% on all cores.

perf top reports the following:

 31.01%  [kernel]                    [k] inet_csk_bind_conflict
 20.60%  [kernel]                    [k] inet_csk_get_port
  9.82%  [kernel]                    [k] _raw_spin_lock
  4.62%  perf                        [.] 0x0000000000038ba1
  3.90%  [kernel]                    [k] _raw_read_unlock_bh