├── 009-mixing-paint.md ├── 012-debugging-debuggers.md ├── 029-ink-on-fingers.md ├── 007-a-shot-in-the-dark.md ├── 003-values-of-beta.md ├── 013-convolution-and-fourier-transform.md ├── 004-ping-are-you-there.md ├── README.md ├── 015-upstream-downstream-discovering-and-displaying-watershed-topology.md ├── 030-making-a-metaverse.md ├── 027-persistent-data-structures.md ├── 032-how-to-trick-a-neural-network.md ├── 016-favorite-np-complete-problem.md ├── 001-programming-culture.md ├── 008-plants-are-recursive.md ├── 006-lossy-text-compression.md ├── 028-how-i-fixed-unix-atime.md ├── 020-making-money-disappear.md ├── 023-favorite-unicode-character.md ├── 026-dont-forget-to-sketch.md ├── 024-sorting-easy-as-123.md ├── 002-tales-of-cursed-operating-systems-textbook.md ├── 021-lol-im-so-random.md ├── 031-finding-out-whats-really-going-on-with-dtrace.md ├── 010-im-not-a-number-im-a-free-file-descriptor.md ├── 025-preserving-digital-art-and-games.md ├── 011-storing-your-data-in-kernel-space.md ├── 018-how-i-code-and-use-a-computer-at-1000-wpm.md ├── 005-code-in-space.md ├── 022-a-million-things.md ├── 014-all-together-now-programming-the-quantum-computer.md ├── 017-the-unfortunate-value-of-failure.md └── 019-what-developers-and-economists.md /009-mixing-paint.md: -------------------------------------------------------------------------------- 1 | ### Mixing Paint! With Computers! 2 | 3 | _Diana Liao_ 4 | -------------------------------------------------------------------------------- /012-debugging-debuggers.md: -------------------------------------------------------------------------------- 1 | ### Debugging Debuggers!! 2 | 3 | _Samy Al Bahra_ 4 | -------------------------------------------------------------------------------- /029-ink-on-fingers.md: -------------------------------------------------------------------------------- 1 | ### Ink on fingers! The history of printing (with code!) before computer screens 2 | 3 | _Mariko Kosaka_ 4 | -------------------------------------------------------------------------------- /007-a-shot-in-the-dark.md: -------------------------------------------------------------------------------- 1 | ### A Shot In The Dark 2 | 3 | _Brendan Curran-Johnson_ 4 | 5 | Brendan reverse engineered a camera and now can control it from his laptop. 6 | 7 | Olympus has an open source camera that allows anyone with network access to connect to the camera and control it is over HTTP. This is obviously crazy insecure, so Brendan figured maybe the private API is also terribly insecure. Turns out it is! 8 | -------------------------------------------------------------------------------- /003-values-of-beta.md: -------------------------------------------------------------------------------- 1 | ### Values of beta may give rise to dom! 2 | 3 | _Mark Allen_ 4 | 5 | Title is an obscure error message that Mark ran into in UNIX. 6 | 7 | First use of UNIX: typesetting programs for patent applications. groff and other utilities date back to this era. 8 | 9 | If you try to move . on some UNIX systems you'll still get this error. 10 | 11 | System 6 UNIX is only 40K LOC, very readable. 12 | -------------------------------------------------------------------------------- /013-convolution-and-fourier-transform.md: -------------------------------------------------------------------------------- 1 | ### Convolution and the Fourier Transform: Math! 2 | 3 | _Laura Lindzey_ 4 | 5 | Laura is a geophysicist. They use ground-penetrating radar, mounted on a plane, to study Antarctica. 6 | 7 | Cross-correlation (f star g): how similar are f and g? f star g at n = sum (m = - infinity to infinity) f[m] * g[m + n] 8 | 9 | Convolution: also how similar are f and g, but studies magnitudes, not values 10 | -------------------------------------------------------------------------------- /004-ping-are-you-there.md: -------------------------------------------------------------------------------- 1 | ### Ping! Are you there? 2 | 3 | _Lydia Gu_ 4 | 5 | Layered model of entowrking: transport, network, link. 6 | 7 | Transport: retransmission, congestion control, etc (TCP) 8 | Network: routing (IP) 9 | Link: protocol for data exchange between 2 physical devices 10 | 11 | Smurf attack: puts victims network broadcast IP in the "send me stuff" part of an echo request to a network. This amplifies the size of the pings by the size of the network. 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # !!Con 2016 Notes 2 | 3 | My notes on !!Con 2016. Pull requests are welcome! I didn't have a chance to write down detailed notes on a few talks. 4 | 5 | I especially could use some help on: 6 | 7 | * [Values of Beta](003-values-of-beta.md) 8 | * [Ping! Are you There](004-ping-are-you-there.md) 9 | * [Mixing Paint](009-mixing-paint.md) 10 | * [Debugging Debuggers](012-debugging-debuggers.md) 11 | * [Convolution and the Fourier transform](013-convolution-and-fourier-transform.md) 12 | * [Ink on Fingers](029-ink-on-fingers.md) 13 | -------------------------------------------------------------------------------- /015-upstream-downstream-discovering-and-displaying-watershed-topology.md: -------------------------------------------------------------------------------- 1 | ### Upstream/Downstream: Discovering and Displaying Watershed Topology! 2 | 3 | _Mark Philips_ 4 | 5 | Given any particular spot on the ground, if it rains there, where does the water go? What is downstream from that spot? Conversely, what is upstream from that spot? 6 | 7 | Created a really cool program that shows this. Like, this program is super cool (he demoed it). watersheds.fernleafinteractive.com 8 | 9 | Each polygon has one polygon downstream of it and several upstream of it. Therefore the entire map forms a directed acyclic graph. 10 | -------------------------------------------------------------------------------- /030-making-a-metaverse.md: -------------------------------------------------------------------------------- 1 | ### Making a Metaverse! A WebVR (not so M)MO for Programmers! 2 | 3 | _Irvin Hwang_ 4 | 5 | Rift Sketch - Virtual reality live coding environment made by Brian Pieres. This allows you to be come the wizard on the cover of "The Structure and Interpretation of Computer Programs". Irvin was inspired by this and started the "Construct club", which uses Meteor, three.js, and WebVR. 6 | 7 | In this work a program is a pair of functions: one for initialization and one for updates. 8 | 9 | "The greatest single industry of the future will be education. The second greatest will be entertaintment. I think the two should be synonymous." - Arthur C. Clarke. 10 | 11 | VR right now is where the Internet was in the early 90s. 12 | -------------------------------------------------------------------------------- /027-persistent-data-structures.md: -------------------------------------------------------------------------------- 1 | ### They're Functional! They're Efficient! They're Persist Data Structures! 2 | 3 | _Anjana Vakil_ 4 | 5 | In functional programming, functions can't have side effects. This naturally pushes people to use immutable data structures. This leads to inefficiences, though, because small modifications to data structures often manifest as full copies of the existing structure. 6 | 7 | Persistent data structures solve this problem by re-using the unchanged parts of the old data structure. 8 | 9 | In Javascript, can use Mori or Immutable.js. Most languages have libraries of immutable data structures. Clojure is especially notable as its core data structures are immtuable; the language was built from the beginning using these techniques. 10 | -------------------------------------------------------------------------------- /032-how-to-trick-a-neural-network.md: -------------------------------------------------------------------------------- 1 | ### How to trick a neural network 2 | 3 | _Julia Evans_ 4 | 5 | Step 0: Be very confused about neural network 6 | 7 | Step 1: Read a cool paper: "Explaining and harnessing adversarial examples" 8 | 9 | This paper said: sometimes neural networks work really well, but sometimes they totally fail. 10 | 11 | Step 2: Spend 10 hours setting up neural network software. 12 | Step 3: Download the neural network in the paper. 13 | Step 4: Predict some things with it. 14 | Step 5: Trick it 15 | Step 4.5: Be very confused about neural network 16 | 17 | To make the neural network thing it's more like something, take the derivative (ie backpropogation) and apply that to the image. Repeat until the network is very sure that the image is of the target. 18 | 19 | Pandra to vulture took way more steps than velvet to paper towel. 20 | 21 | This was all done with tensorflow. 22 | -------------------------------------------------------------------------------- /016-favorite-np-complete-problem.md: -------------------------------------------------------------------------------- 1 | ### My Favorite NP Complete Problem 2 | 3 | _Mark Dominus_ 4 | 5 | NP problems are easy to check that a solution is correct but not necessarily easy to compute the correct solution. 6 | 7 | The SAT (satisfiability) problem is this: if someone hands you a logical proposition with variables, is there a set of true and false values you can assign to the variables such that the proposition is true. 8 | 9 | If you had a good algorithm for this, you could use it to solve every other problem in NP. SAT would "completely" solve NP; it is therefore "NP-complete". SAT is at least as hard as all other problems in NP. 10 | 11 | There are other NP-complete problems: Hamiltonian cycles, for example. Karp gave a list of 21 NP-complete problems in 1972. A solution to any one of them would completely solve NP and therefore also solve the other 20. 12 | 13 | Since then, people have discovered hundreds of NP problems. 14 | 15 | < long digression about Elmo > 16 | 17 | 18 | -------------------------------------------------------------------------------- /001-programming-culture.md: -------------------------------------------------------------------------------- 1 | ### Programming Culture 2 | 3 | _Catt Small_ 4 | 5 | How vs what and why 6 | 7 | Programmers talk about how (focusing on particular tools) rather than what the project is trying to achieve -- leads to project failure. 8 | 9 | Maybe attributable to way programming is taught. When students leave school they don't know how to actually build things, but they know how things work. We need to teach students how to build things. 10 | 11 | Most programming languages are pretty similar. But programmers focus too much on their favorite programming language. Within PLs, people over focus on comparing libraries or frameworks rather than on the problem at hand. 12 | 13 | Programming is very artistic and creative because you build things. But artistic people are often pushed away from programming because of the culture of competition. 14 | 15 | Ultimately programming is a means to an end. The tool doesn't matter more than what you've made. Rather than focus on the tool, focus on what you've made. 16 | -------------------------------------------------------------------------------- /008-plants-are-recursive.md: -------------------------------------------------------------------------------- 1 | ### Plants are Recursive - Using L Systems to Generate Weeds 2 | 3 | _Sher Minn Chong_ 4 | 5 | Recursion not just in the sense of functions calling themselves, but rather the self-similar repetition (e.g. fractals). Many plants exhibit obvious fractal tendencies. 6 | 7 | L-systems: string re-writing sytem that consists of axions are rules. 8 | 9 | For example: 10 | 11 | Axiom: A 12 | Rules: A -> AB 13 | B -> A 14 | 15 | Iteratively apply rules on the starting state to create an L-system. 16 | 17 | How to go from string and symbols to drawing? 18 | 19 | Use strings to represent a given drawing transformation such as "rotate 60 degrees" or "add edge" 20 | 21 | To draw snowflake: 22 | 23 | Axiom: F 24 | Rules: F -> F - F + F - F 25 | 26 | Where F is a line, and -/+ represent rotations. 27 | 28 | So, we can use this to describe plants, with some modifications. We introduce [ and ] to save and restore state. Can also introduce several transformation rules for the same symbol and randomly choose between them. 29 | -------------------------------------------------------------------------------- /006-lossy-text-compression.md: -------------------------------------------------------------------------------- 1 | ### Lossy Text Compression, for some reason? 2 | 3 | _Allison Parrish_ 4 | 5 | Lossy compression: represent values in a small representation with loss of precision. 6 | 7 | Any list of values can be represented as the sum of cosine functions at different coefficients (discrete cosine transform). The DST has the same number of coefficients as original values. The trick is that lower frequency components carry more information than higher frequency ones. JPEG compression uses a 2-dimension DCT. 8 | 9 | How can we apply this idea to text? 10 | 11 | Have to represent text as a number. 12 | 13 | First attempt: map each letter to its number in the alphabet. Can compress the text in a lossy way using this technique. This mostly doesn't work. 14 | 15 | Second attempt: compress meaning of words. Python library called word2vec created by researchers at Google. word2vec describes a distance function on words -- e.g. 'puppy' is more similar to 'dog' than 'mastadon'. Can also define a distance from an arbitrary point in the vectorspace. So, apply DCT to word2vec'd corpus. This works pretty well. 16 | 17 | This likely has no practical applications. 18 | -------------------------------------------------------------------------------- /028-how-i-fixed-unix-atime.md: -------------------------------------------------------------------------------- 1 | ### How I fixed UNIX atime - with ten lines of code and feminism! 2 | 3 | _Valerie Aurora_ 4 | 5 | Every UNIX file has three useful timestamps: 6 | * atime - the last time the file was read or _a_ ccessed 7 | * mtime - last time the contents were modified 8 | * ctime - last time the metadata was changed 9 | 10 | These are all part of the inode definition. 11 | 12 | These timestamps are very useful. For example, sendmail can know that if atime > mtime, then no new mail has been added to the file. 13 | 14 | Reads are often cached in memory - no SSD or disk. Writes, on the other hand, must eventually go to disk. Unfortunately atime turns almost every read into a write! 15 | 16 | Non-feminist solution: nobody gets atime. However, this breaks a lot of programs. But if you complained about this, people would just explain to you to not use atime. 17 | 18 | Second non-feminist solution: buffer atime writes. Lots of technical problems for this, mostly that it involves lot of random buffer updates. 19 | 20 | Feminist solution: relative atime updates -- if the atime is already greater than mtime, don't update it. Only update atime if it's less than the mtime (or if it's greater than 24 hours old). 21 | -------------------------------------------------------------------------------- /020-making-money-disappear.md: -------------------------------------------------------------------------------- 1 | ### Making Money Disappear With Hash Functions 2 | 3 | _Brendan Cordy_ 4 | 5 | What is a bitcoin address? 6 | 7 | Bitcoin is essentially a gigantic balance sheet. Addresses are the bitcoin equivalent of account numbers. This balance sheet is maintained by a huge anonymous peer to peer network. 8 | 9 | Two problems: 10 | * How to stop people from spending other people's money? -> Public Key Cryptography 11 | * How to stop spending the same money simultaneously? -> Bitcoin Mining 12 | 13 | Bitcoin addresses are a 25-byte string in base 58. We use 58 to remove ambiguous letters like i and l. 14 | 15 | To make an address: 16 | * Get a public key based on an eliptic curve 17 | * Hash the public key 18 | * Base58 and append a checksum 19 | 20 | Since we only need a correct public key when spending money, simple to create addresses that don't have a valid public key backing them -- equivalent to an ATM account with no PIN number. Turns out a few bogus addresses have significant amounts of money associated with them. 21 | 22 | So why hash? Mostly for compression. Security benefits are negligible. Another question is whether or not the leak of money into unusable addresses is an intentional feature of Bitcoin or an unintended side effect of the protocol. 23 | -------------------------------------------------------------------------------- /023-favorite-unicode-character.md: -------------------------------------------------------------------------------- 1 | ### My Favorite Unicode Character 2 | 3 | _Anne DeCusatis_ 4 | 5 | Definitions: 6 | * Character - Unicode code point 7 | * Glyph - appearance of a character on the page 8 | 9 | Zero-width-joiner -- control character that joins things. 10 | 11 | Before computers, had typewriters. ASCII came next, but it only had English characters. People worked around this by ignoring accents and such. EBCDIC was introduced by IBM and it could maybe handle Italian. Still there wasn't one universal standard. Then, Unicode happened! Unicode is a single standard for using multiple code planes at the same time. 12 | 13 | To handle overlapping characters, use a ZWJ. There's also a zero-width-non-joiner, which forcibly separates characters that might automatically be joined. 14 | 15 | The emoji "couple with heart, woman woman" is a woman, ZWJ, heart, ZWJ, woman. 16 | 17 | In Python, `len(couple with heart woman woman)` is either 20 or 6 characters depending on your version of Python (there's an additional code point on the heart to select the emoji display style). 18 | 19 | In Java, `"couple with heart woman woman.length()` returns 8. But `couple with hearth woman woman.codePointCount()` is 6 as "expected". 20 | 21 | When writing programs that take user input, thing carefully about Unicode. We want to write apps that work for everyone in the world, not just people who speak English. 22 | -------------------------------------------------------------------------------- /026-dont-forget-to-sketch.md: -------------------------------------------------------------------------------- 1 | ### Don't forget to sketch 2 | 3 | _Adam Marcus_ 4 | 5 | Often have too much data to study in depth, but want to get some broad sketches of it. Here are two sketching algorithms: the bloom filter and the count min function. 6 | 7 | Bloom filter - Is item X in dataset D? 8 | 9 | Bloom filter is a bitset plus a collection of hash functions. To insert a new value into the filter, compute the hash for each hash function and set those indices to true. Keep the bitset and repeat as you add elements. Then to check membership, see if all three hash functions on the value return indices that are already true. Note that this condition can be met by chance on elements that were never added to the set. 10 | 11 | Thus, bloom filters never have false negatives but can have false positives. How many false positives? Not too many. 12 | 13 | Count min - How many of X are in a dataset D? 14 | 15 | Again using a collection of N hash functions, this time we have N rows of counters. When we add a value, we increment the counter at each hash location in that hash's respective buckets. To estimate the true count of a value in the dataset, we look at the minimum of the counter values for each hash row on that value. 16 | 17 | Thus, we have a risk of overestimating the count, but not under-estimating it. The count will be more accurate for the more common elements in D. 18 | 19 | Embrace randomness. By being OK with a bit of randomness, we can create powerful algorithms. 20 | -------------------------------------------------------------------------------- /024-sorting-easy-as-123.md: -------------------------------------------------------------------------------- 1 | ### Sorting is as easy as 1, 2, 3 -- but not as easy as a, b, c 2 | 3 | _Jake Levine_ 4 | 5 | Last year, Meetup added support for Japanese! When a user signs up for Meetup, they're presented with a list of categories that they're interested in. But when this list was translated to Japanese, it wasn't sorted anymore. What gives? 6 | 7 | Sorting Integers is pretty easy. But is sorting Strings? Java doesn't correct sort words of multiple case correctly if you use the `Collections.sort` method. However, Java has a `Collator` class which can, in theory, correctly sort in a locale-sensitive way. 8 | 9 | ```java 10 | Collator c = Collator.getInstance(new Locale("en", "US")); 11 | result = Colections.sort(names, c); 12 | ``` 13 | 14 | This works! But for Japanese words it still doesn't work. It turns out Japenese has 4 alphabets: kanji plus 3 phoenetic alphabets, which were all used in the dataset. Sorting Japanese words depends on the pheonetic pronunciation, which is context dependent. Thus, Japanese cannot be sorted on a word by word basis without more context. 15 | 16 | An analogy: in English, if "I would like to READ a book" was sorted from "Have you READ this book". To solve this problem, translate the kanji to phoenetic alphabet (a human process), sort by the phoenetic calendars, but then continue to display the kanji. This didn't fully solve the problem but it's a step in the right direction. 17 | 18 | The truly correct solution is to avoid using the text in this way. Developing global products is much harder than expected, and language is hard. 19 | -------------------------------------------------------------------------------- /002-tales-of-cursed-operating-systems-textbook.md: -------------------------------------------------------------------------------- 1 | ### Tales of the Cursed Operating Systems Textbook 2 | 3 | _Kiran Bhattaram_ 4 | 5 | 1. Kernel memory leaks 6 | 7 | Stripe started seeing sadness in internal DNS servers. Things would run out of memory and the Linux OOM killer would kill stuff... even though nothing was using that much memory. Looking at the logs, almost all memory was being used by the internal kernel slab. 8 | 9 | They knew something was using memory in the kernel but didn't know what it was. 10 | 11 | Enter /proc/slabinfo. Turns out a lot of anon_vmas were running around. 12 | 13 | The bug was to form the nsd process and then kill the parent. But the pointer to the old process would leak in the kernel. 14 | 15 | 2. Networking slowness 16 | 17 | In a pubsub section, publishing a message to localhost was taking 40 ms. How? 18 | 19 | The HTTP library was sending a header, getting an ack, then sending the body and getting an ack. Using Nagle's algorithm, the server was buffering packets because there wasn't enough data to ack. After switching to send the body before waiting for the header to ack, everything sped up. 20 | 21 | 3. Oints 22 | 23 | Stripe stores data in Mongo and periodically does filesystem level snapshot backups. They periodically attempt automated restoration to test the backups. 24 | 25 | The error was something in Mongo saying "oints", which somehow indicated index correctly. This turned out to be because they were fsyncing when snapshotting but not blocking incoming writes while doing so. 26 | 27 | 4. Concurrency 28 | 29 | This one was cutoff due to time. 30 | -------------------------------------------------------------------------------- /021-lol-im-so-random.md: -------------------------------------------------------------------------------- 1 | ### lol im so random 2 | 3 | _Mark Wunsch_ 4 | 5 | `Math.random()` exists in both Java and Javascript. How do we teach a computer to flip a coin? 6 | 7 | In 1955 the RAND corporation published a book called "a million random digits". 8 | 9 | "There is no such thing as random numbers" - John Von Neumann. Computer's cannot generate a truly random sequence because computers do math; the output of a given function is deterministic. So we use pseudo-random numbers, which are mathematical functions with apparently random outputs (but they are not truly random). 10 | 11 | PRNGs are seeded; based on the seed, the output of the PRNG is determined. A PRNG is a state machine; every time you call `generate()` on it, it advances some determinable internal state. 12 | 13 | An application of this is property-based testing such as quickcheck. 14 | 15 | PRNG algorithms. The Mersenne Twister is a popular PRNG algorithm; it's a twisted linear feedback shift register. A Mersenne Prime is a prime number one less than a power of 2. The _period_ of a PRNG is how long it can produce numbers before the sequence starts to repeat itself. 16 | 17 | The balancing act of a PRNG is: 18 | * Period length 19 | * Quality of randomness 20 | * Generation speed 21 | 22 | Note that PRNGs are not suited for cryptographic purposes. 23 | 24 | What does it mean for a PRNG to be cryptographically secure? 25 | 26 | In cryptographic applications, you want the next return value from `generate` to be hard to predict based on the previous one. A cryptographically secure random number generator heavily emphasizes this property. 27 | 28 | A CSPRNG will periodically reseed itself, for example, using an entropy pool. 29 | -------------------------------------------------------------------------------- /031-finding-out-whats-really-going-on-with-dtrace.md: -------------------------------------------------------------------------------- 1 | ### Finding out what’s _really_ going on, with DTrace! 2 | 3 | _Colin Jones_ 4 | 5 | I like it when computers work exactly what I expect. But that usually doesn't happen. It'd be nice to learn why things aren't going on. 6 | 7 | DTrace allows you to write programs that analyze your programs. It's designed to run in production from within kernel space. 8 | 9 | You can, for example, trace system calls. The developer can also add explicit call points for DTrace if they so choose. But the cool part is you can also trace arbitrary C function calls -- whether they're in the kernel or not! 10 | 11 | Case study: 12 | 13 | The team has some tests that are intermittently very slow -- usually sub second, but then pausing for 30 seconds. This is across machines! What should we check? 14 | * GC pauses 15 | * Connection pool contention 16 | * Randomly forgot to delete a sleep in the code. 17 | 18 | Using DTrace we can trace GC and find out that the slowest GC was only 160ms -- way less than 30 seconds. We also are able to rule out CPU usage. Similarly we rule out memory and disk. 19 | 20 | That leaves network. We use a DTrace script available online to trace network calls. As expected we have a lot of fast connections to localhost. Weirdly, though, we also call out to somewhere else - some random IP address. We use DTrace on the DNS resolver and it turns out they were all trying to connect to 'someplace.com'. Now that things are identified they were able to find a 3rd-party HTTP call in the tests, which they axed. 21 | 22 | DTrace gets you the answers. It's not super hard -- it doesn't take years of study to get to the point where it's super useful. 23 | 24 | To learn more read Branden Gregg's blog or "The DTrace Guide". 25 | -------------------------------------------------------------------------------- /010-im-not-a-number-im-a-free-file-descriptor.md: -------------------------------------------------------------------------------- 1 | ### I'm not a number, I'm a free file descriptor 2 | 3 | _Andreas Fuchs_ 4 | 5 | File descriptors are numbers that point at an entry on the file descriptor state data structure in the kernel. File descriptors point at basically any input or output system - files, pipes, etc. 6 | 7 | For example, `grep foo | some_file` opens a series of file descriptors for grep, the pipe, and some_file. 8 | 9 | Through a process called inheritance, child process can inherit file descriptors from parents. You can also pass file descriptors around using UNIX domain sockets. UNIX domain sockets offer a serializable, guaranteed delivery way to send file descriptors from one process to another (but this obviously doesn't work across a network). 10 | 11 | What happens if the sending process closes the file before the receiving process picks it up? The kernel keeps it open for you. Also, you can totally send UNIX domain sockets down in UNIX domain sockets. You can use this to circumvent the open file limit. 12 | 13 | For example, make a pair of UNIX domain sockets that both connect to the same process. Then when you ned a file descriptor, you send it in one and then read it back out the other way -- basically using the domain sockets as a storage place for your file descriptor. 14 | 15 | So imagine we do this with... another ring buffer! Using this you can have 200,000 open files. Then the OS itself can no longer open files. Since the file descriptors aren't associated with your process, `lsof` won't detect them. But this doesn't work on OSX the descriptors stored inside the inner rings are deleted - why? We suspect OSX does reference counting on sockets. 16 | 17 | What does Linux do, then? It does a mark and sweep garbage collection on file descriptors! 18 | -------------------------------------------------------------------------------- /025-preserving-digital-art-and-games.md: -------------------------------------------------------------------------------- 1 | ### Preserving Digital Art And Games For 100 Years! 2 | 3 | _wilkie_ 4 | 5 | Wilkie works as something like a digital archivest. In particular, he helps scientists package their code and methods in a way that is reproducable and storable for the long term, so that future scientists can re-run the experiments if they need to. However, it's really hard to get people to care about archival. 6 | 7 | This is surprising. In the physical world, we can walk up to paintings that are hundreds of years old. You can go to France and see the Mona Lisa. But in the digital world, you can't even compile code that you write before you left on your trip. 8 | 9 | When growing up, Wilkie was mezmorized by a game called ZZT in which you play as a disembodied head that walks around doing things in a 2D world. How would we archive this as a form of interactive media? It's an interactive game, so we when we archive it we have to preserve that interactivity. 10 | 11 | Normally when archiving software, we virtualize or emulate the dependencies of the executable and call it a day. But what happens if KDM stops being maintained? What happens if the version of VirtualBox you need stops being mainted? 12 | 13 | Moreover, is it enough to just archive the game? In the case of ZZT, packaged with the game was a level editor, which the community has embraced in full. It's not enough to archive ZZT. 14 | 15 | We can do something more containerey: 16 | * ZZT specifies it needs DOS 17 | * DOS can run in DOS box, which specifies its own dependencies 18 | * DOS box is packaged with Docker, but could be any containerization solution 19 | 20 | We can also add more depdencies like a windowing manager. 21 | 22 | As a takeaway, when building tools, think about how you're hurting or helping people archive what they make in the long run. 23 | -------------------------------------------------------------------------------- /011-storing-your-data-in-kernel-space.md: -------------------------------------------------------------------------------- 1 | ### Storing your data in kernel space - an excellent bad idea! 2 | 3 | _Kamal Marhubi_ 4 | 5 | Ordinarily when writing programs, we want to keep memory usage low. We don't like when Firefox uses 2gb of memory on a 4gb laptop. 6 | 7 | Let write a program that stores lots of data in memory without using a lot of memory. To do this we'll store it in kernel memory. 8 | 9 | Kernel memory is mostly book-keeping process state. Modern computers have a special piece of hardware, the memory management unit (MMU), which prevents user programs from using kernel memory. To get around this, we'll store the data in pipes. 10 | 11 | When data is going through a pipe, it's stored in kernel memory. User processes only have pointers to the data as a file descriptor. So, how can we get a random access buffer from a pipe? Well, just read all the data in the pipe and then write it all back. 12 | 13 | To store larger amounts of data, we'll just use lots of pipes. In Linux we can store up to 1 MB per pipe, but there's a per-user limit of 64 MB total buffer size. Except that the pipe create call can never fail... it might just give you a really small pipe. Like, a 4K pipe. But each pipe uses 2 file descriptors, so this only gives us a max of 128 MB of storage. Can we do better? 14 | 15 | Use write once pipes, which close the input file descriptor after we write. So now we can get up to 256 MB per process. Maybe let's have a lot of processes? 16 | 17 | < Kamal demos a program that uses this trick to get 2 GB of kernel buffers using a lot of processes, but he's blocked by the total file descriptor limit on the system > 18 | 19 | Ok, now we'll upgrade ourselves to have way more file descriptors total in the kernel 20 | 21 | < Kamal re-runs the program; the Linux OOM killer goes crazy and his machine appears to crash. Turns out it killed his login session > 22 | -------------------------------------------------------------------------------- /018-how-i-code-and-use-a-computer-at-1000-wpm.md: -------------------------------------------------------------------------------- 1 | ### How I code and use a computer at 1000 WPM! 2 | 3 | _Sina Bahram_ 4 | 5 | (Sina is blind) 6 | 7 | Sina does a shoutout to Mirabai our awesome transcriber. 8 | 9 | Sina googles some stuff and his computer talks out the text of the impossibly fast for us to understranding like way too fast. 10 | 11 | He then types into the terminal -- looks like he used top -- and the computer continues to spit the text out impossibly fast. He also puts some techno on. 12 | 13 | He then slows down the screen reader and it becomes intelligible. 14 | 15 | For capital letters the screen reader raises its pitch. This is an example of multimodal presentation -- presenting through different channels. This is a more efficient way of highlighting the capital letter than saying "capital C". Similarly the reader says "unavailable" instead of "greyed out" for disabled menu options. 16 | 17 | Who has used an a-tag styled as a button? We have to make sure to use HTML to communicate the semantic meaning of the text and use CSS to style it. Headings aren't to make text big! 18 | 19 | Ars technica's website is pretty organized. 20 | 21 | Hacker News isn't semantically laid out and it's very hard to navigate using the speech reader. Reddit also isn't laid out well. Unlabeled link text really matters. Always have alt text on graphics. 22 | 23 | Sina's interaction with technology is mediated by software such as a screen reader. But bear in mind that other users of the website is also mediated through technology such as search enginer crawlers. 24 | 25 | The W3C web content accessability guidelines are really useful. 26 | 27 | < Sina types into a Python interpretter while the screen reader plays > 28 | 29 | < Sina switches the audio to his phone. It speaks super quickly in a similar way as his computer > 30 | 31 | This accessibility is built directly into their iPhone. iOS has all kinds of accessibility stuff built in, including a computer vision program for controlling the phone with head movements for people who are paralyzed. 32 | -------------------------------------------------------------------------------- /005-code-in-space.md: -------------------------------------------------------------------------------- 1 | ### Code in Spaaace! 2 | 3 | _Katie Bechtold_ 4 | 5 | Katie has worked on a lot of software that has gone to other planets or at least flown past them. 6 | 7 | A spacecraft is a lot like a network of embedded computers. Different computer functions might be: 8 | 9 | * Command and data handling 10 | * Fault protection 11 | * Scientific intruments 12 | * Power distribution 13 | * Guidance and control 14 | 15 | Most of them have to worry about the following problems. 16 | 17 | * Space is big -> spacecraft have to go far away -> access to hardware is remote with big time lags 18 | -> spacecraft needs to operate independently 19 | * 5 hours to New Horizons (Pluto), 15 hours to Voyager 20 | * Earth is a gravity well -> space is expensive to get to (11.2 kilometers per second escape speed) 21 | -> spacecraft cost a lot of money -> $10-25k per kilogram of equipment in space -> most missions 22 | are a few hundred million to a few billion dollars -> missions are rare -> risk aversion 23 | * Therefore, need spacecraft to be very very reliable and predictable: 24 | * Real time operating systems. These are predictable, not fast. Need predictable timing for things like firing thrusters, measuring things, shielding electronics from the sun. 25 | * Deterministic languages and tools. Deterministic means not using dynamic memory allocation, period. Also avoid recursion. Loops must have statically inferrable termination times. Languages used: C, Ada, Forth. 26 | * Totally scheduled data bus periods; no random retrys on ethernet cables between systems. More modern spacecraft networks are full point to point duplex networks, so no congestion is possible. 27 | * If far from the sun, can't use solar power. NASA currently low on plutonium. 28 | * Need lots of radiation shielding. High energy particles, however, don't care about your shielding. 29 | * 3 bits for every 1 bit in memory which vote 30 | * Watch dog timers on processes. 31 | * Leads to older hardware! More constraints for programmers like "12 MHz processor" and "70 KB main memory" 32 | -------------------------------------------------------------------------------- /022-a-million-things.md: -------------------------------------------------------------------------------- 1 | ### A Million Things To Do With A Computer 2 | 3 | _tef_ 4 | 5 | Scratch has these philosophies: 6 | * Low floors - easy to get started 7 | * Wide walls - plenty of things to do 8 | * High ceilings - sky's the limit 9 | 10 | Scratch is secretly a Lisp. Logo is Scratch's predecessor and it comes from a paper in the 60s about teaching computers to kids titled "20 things to do with a computer". Things 1-20 were "build a robot and do cool things with it". This process emphasized feedback, play, exploration. 11 | 12 | Logo was extrapolated on by Mindstorms by Seymour Papert (the Lego thing was named after this). In this book Papert talks about what he calls the "math world" which is an internal world in the programmers head. 13 | 14 | This emphasizes "coding to learn" not "learning to code". The point of the 20 things to do with a computer paper was on how computers can enable kids to have agency, to use computers as a medium for learning. 15 | 16 | Scratch has a cat named Felix. Felix is a puppet on a stage. 17 | 18 | Instead of using ASCII-art to describe the program, Scratch uses a block oriented interface. Scratch is syntax free. When you have no syntax you have no syntax errors. 19 | 20 | Scratch's lack of syntax in the language core makes it much easier to make it multilingual. 21 | 22 | Downsides to blocks: no autocomplete. Harder to write large programs, but this is mostly due to the emphasis placed on the programming language so far. 23 | 24 | Scratch is finally being open sourced. But more than just a programming environment, it's also a community. Scratch is a world where 'View Source' still works. tef's favorite project was a kid who made his own game, but he made it too hard. So he had to implement cheats. 25 | 26 | Philosophy again: 27 | * low floors: no syntax, no stumbling blocks 28 | * wide walls: lots of addons, rich library 29 | * high ceilings: hardware support, lots of extensions 30 | 31 | < tef demos a stack-based calculator written in Scratch > 32 | 33 | The slides are all also in Scratch 34 | 35 | Your programming languages could be so much better. So, so much better. The main reason Scratch is so amazing is that the community hasn't learned from us. 36 | -------------------------------------------------------------------------------- /014-all-together-now-programming-the-quantum-computer.md: -------------------------------------------------------------------------------- 1 | ### All Together Now! Programming the Quantum Computer 2 | 3 | _Jennifer Fernick_ 4 | 5 | Thing to take away: the various levels of abstraction on a quantum computer 6 | 7 | Quantum computing: using quantum phenomena to preform computational tasks. Offers exponential speedups over classical algorithms for some applications. 8 | 9 | Downsides: 10 | * Sensitive to environmental noise 11 | * Measurement of quantum states destroys superposition -- how can we create RAM in quantum system? 12 | * No cloning theorem 13 | 14 | Quantum mechanics: probability theory but over the complex numbers 15 | 16 | qubits: a superposition of values 0 and 1 17 | 18 | When measured, superposition collapses into a discrete state 19 | 20 | qubits can be made of many things: 21 | * Particle spins 22 | * Polarizations of photons 23 | 24 | N qubits = 2^N complex coefficients, so a 64-qubit computer can represent 18 quintillion parallel operations 25 | 26 | Stages of quantum computers: 27 | * Single qubit operations 28 | * Multiple qubit operatins 29 | * Error correction 30 | * Memory of qubits after the fact 31 | 32 | Quantum gates: 33 | * Configuration of qubits to perform logical operations 34 | * Quantum circuits are composed of reversable quantum gates so that we can do basic operations on an n-qubit register 35 | 36 | Quantum programming language research involves: 37 | * High level formalisms for reasoning about quantum algorithms 38 | * Compiler design -- what are primitive operations? What level of abstractions should be offered? 39 | * Highly difficult due to variety of quantum computer implementation approaches. Basic primitves are unclear. 40 | * Probably have programming model similar to Google Cloud Compute: a remote procedure call over a highly specialized API 41 | 42 | Applications: 43 | * Simulations 44 | * Metrology 45 | * Optimization 46 | * Materials science 47 | * Chemistry 48 | * Machine learning - Grover's algorithm 49 | 50 | But that isn't the sexy stuff. The sexy stuff is Shore's algorthm: a proposed quantum algorithm that would dramatically speed up the factoring of large numbers into component primes, thus breaking public key cryptography and therefore the Internet. 51 | 52 | Quantum Computational complexity 53 | * Does not break the Church-Turing thesis; a classical computer can do everything a quantum computer can do, just slower 54 | * There are probably algorithms that are slow for a classical computer (in NP) but not for a quantum computer 55 | -------------------------------------------------------------------------------- /017-the-unfortunate-value-of-failure.md: -------------------------------------------------------------------------------- 1 | ### The Unfortunate Value of Failure 2 | 3 | _Ramsey Nasser_ 4 | 5 | As developers we fail all the time, and it feels bad. 6 | 7 | Failure is irrevocably linked to surprise. Failure always happens when something happens that we did not expect. Therefore, failure is always linked to new information. 8 | 9 | Yet failure feels terrible. Why? Part of the reason is the way we approach it in programming. All the UX of errors in most programming environments emphasize red, a stop sign, an exclamation point, basically very negative things. 10 | 11 | We also have a culture in programming of harping on errors as the programmer's fault. 12 | 13 | < Ramsey walks us through a person on StackOverflow who only posts answers that are one sentence followed by "Stop doing that" > 14 | 15 | These responses are worse than no response at all. They'll drive people to stop doing programming. 16 | 17 | < Ramsey posts some of Elm's error messages, which not only are detailed but automatically include a rationale for why the program is incorrect > 18 | 19 | Most computer failures are due to the machine needing more information to keep on going. The state space of programming is huge -- there's no way for humans to reason about the way programs holistically work. We have to focus on only a few things at a time. 20 | 21 | < example of the state space of the add function in C > 22 | 23 | This is also why reproducibility is hard. 24 | 25 | When programming we're always doing something new -- we don't write the same program over and over again. That is why programming is prone to failure. 26 | 27 | < Ramsey has an excerpt from the movie Amadeus where Mozart's rival is shocked to read his manuscripts and sees there are no corrections; the music is perfect, as if Mozart was just writing it down, fully formed > 28 | 29 | We don't program by taking dictation from God. We have to make corrections. 30 | 31 | If you don't fail 90% of the time you're not aiming high enough. -Alan Kay 32 | 33 | Anxiety as a programmer is the difference between what you're trying to do and your skill. But part of growing as a programmer is doing harder and harder things. If Ramsey just kept making websites every day, he'd probably feel pretty confident in himself, but he wouldn't be growing as much. Now he works on compilers. He still feels terrible, but he's objectively better as a programmer than he was. 34 | 35 | Failure is learning + growth. It's not something you did wrong. 36 | 37 | Some takeaways: 38 | * Tools need better error messages. This is actually a really hard problem; the way many tools are written makes it very difficult for the tool author to report more information to the user. Tools need to be built from the ground up with rich error messages in mind. 39 | * More safe spaces for failure. 40 | * Teachers: fail in front of students. Don't give people the image of a good programmer as Mozart descending from the clouds with perfect music. Note that this is easier for men to do; if a woman is publicly failing at programming she's likely to get shot down a lot faster than a man would. This is part of why safe spaces are so important. 41 | -------------------------------------------------------------------------------- /019-what-developers-and-economists.md: -------------------------------------------------------------------------------- 1 | ### What Developers and Economists Can Learn From Each Other 2 | 3 | _Rob Jefferson_ 4 | 5 | Economists do a ton of programming. After being in both programming and economics, Rob things the two disciplines can learn a lot from each other. 6 | 7 | Background: Rob went to CMU for 2 years for CS, dropped out and did stuff, came back and finished a degree in economics, then went to Northwestern to do an econ PhD but dropped out. Eventually wound up as a researcher turned software engineer. Now works for Comcast as a devops engineer. 8 | 9 | Modern economics is programming! 10 | * Statistical modeling is a primary task for empirical work 11 | * Computational econ is increasingly popular, simulates things with AI 12 | * Using GPUs for econ linear algebra is increasingly popular 13 | * Algorithmic game theory is of considerable interest to both CS and econ. Applications in auctions, load balancing and routing. 14 | 15 | Yet, coding gets short shrift. Very little econ students get formal training in programming. 16 | 17 | There's some hope! 18 | * There's now a quant-econ project: open source Python and Julia libraries with lots of tests. 19 | * Some software carpentry 20 | * FRED (Fed Reserve Economic Data) and Quandl open common data sets 21 | * Open Knowledge Foundation 22 | 23 | Some need to understand algorithms. Not at an expert level, but at least a basic understanding of asymptotic behavior. Need to understand that nesting more loops is not always the answer. Use memoization, dynamic programming, etc. Finally, need more testing. 24 | 25 | How bad could it be? (aka disasters in econ research) 26 | * Donohue and Levitt (2011), aka the "abortions and crime" paper largely due to bugs in the software modeling the effect 27 | * Feldstein (1974), "Social security depresses savings" 28 | * Reinhart and Rogoff (2010) 29 | 30 | Economists should learn to write tests. Unit, integration and regression. They should use standard libraries. Use version control. 31 | 32 | What programmers can learn from economists? 33 | * Causation and modeling. In any sort of model, we have factors X and interested in their impact on Y. If X is correlated with Y, have an endogeneity bias, so need to replace X with Z, which is correlated with X but not Z. 34 | * Unfortunately endogeneity bias is everywhere and very hard to avoid. 35 | * Don't avoid institutional effects! Sometimes seemingly technical problems are actually policy related. 36 | * Understand cultural and historical contexts -- classic example being "falsehoods programmers believe about names". 37 | * Specialization and trade. Generalists are great but life is too short to do everything. Need specialists. But specialists are only useful when trade is involved. 38 | * Comparative and absolute advantage. Comparative advantage demonstrates what's possible, not necessarily what's best. 39 | 40 | What should both programmers and economists learn? 41 | * Stop putting such a huge premium on the hardcore. In tech, OS hackers are hardcore and real, web devs are not. In econ, theorists are at the top. 42 | * We're only as good as what we tolerate. Econ: privileging theory over empirical results. Tech: privileging tools over people. 43 | * Minorities in both fields are highly under-represented. 44 | 45 | What can we do? 46 | * More inclusive events. 47 | * Make it easier to get into technical and economic discourse. 48 | * Be patient and listen. Don't impose problem with tools first -- wait and see. 49 | 50 | Talk is dedicated to Tiago Pires, 1984-2016. 51 | --------------------------------------------------------------------------------