This is my repository of interesting ideas and information, mostly from other people, sourced mostly from the internet. About me
JS generator functions in 30 seconds
The generator concept exists in most languages, and is a very useful abstraction. Definitely learn and use it. Here’s what it looks like in Javascript: function *aGeneratorFunction() { console.log('stage 1'); yield 123; console.log('stage 2'); yield "almost there"; console.log('stage 3, done'); return {foo: "bar"}; } Make a “Generator” object and run it: let gen = aGeneratorFunction(); gen.next(); // {value: 123, done: false} > stage 1 gen.next(); // {value: "almost there", done: false} > stage 2 gen....
Why bubble sort is bad
This is a graph of runtime versus input size. Grey is bubble sort, other colors are merge sort, quick sort, and radix sort. This image is 20,000px tall
Java magic: Integer caching
I came across a code snippet on StackOverflow: Integer a = 42; Integer b = 42; Integer c = 555; Integer d = 555; System.out.println(a == b); // prints true System.out.println(c == d); // prints false Wait, what? The second comparison evaluating to false makes sense. In Java, when == is used with reference operands, equality means they point to the same object in memory (primitives are compared literally). So c == d should return false, because they’re separate objects in memory (even if representing the same number underneath)....
My Job: curating SE data at openscience.us
Back in January, I started a part-time job at N.C. State, joining my colleague and good friend Carter Pape in developing version 4 of openscience.us/repo , a long-term repository for software engineering (SE) research data. I wasn’t too knowledgeable about what I was getting into, but through the past few months I’ve gained some insight into the philosophy of SE research – and how Dr. Tim Menzies and his brainchild OpenScience is making software engineering research a more reproducible and replicable process....
Increasing the presence of women in computer science
Female representation in computer science is, frankly, pretty sad. In fact, women make up only 26% of “Computer Science and Mathematical Science professionals” in the United States (Google Inc., 2014, p. 2). Similarly, the Bureau of Labor Statistics found that women comprise just over 29% of the “Computer and Software” category as of 2013 (Ullman, 2013, p. 1). However, back when the field was just beginning to turn itself into the massive consumer industry that it is today, women had a vastly higher representation in the field....