Skip to content

Instantly share code, notes, and snippets.

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /.
Reason: Error reading from remote server
Apache/2.2.22 (Debian) Server at georgia.chris-martin.org Port 80
class Generator
constructor: (@next) ->
map: (f) ->
new Generator =>
x = @next()
return f(x) if x != undefined
flatMap: (f) ->
gen = undefined
* 1a
| 1b
| 1c
* 2a
| 2b
| 2c
* 3a
| 3b
| 3c

So this blog post is making the rounds on Hacker News and such, and I've got to say... no shit?

the world doesn’t care anymore what you know; all it cares “is what you can do with what you know.”

You only have to spend a very brief amount of time on the other side of the conference room desk in an interview to fully appreciate how obvious this statement is. If we're looking to hire, it's because we've got stuff we're trying to accomplish, we can't do it by ourselves, and we need people to help us. So what's the one criterion you need to meet? You have to be able to help.

The employers can't help you become that. They're the ones who need help. That's why they're hiring.

Personal note: I work for a non-profit software group. I don't have any Innotech stock to raise a quarter of a point. My only interest is helping my organization do its job, because I like working at a place that's actually capable of doing the work we have. So

Fuck gender.

I was watching today's TED talk about the responsibility of adults to guide the culture in which young people are raised to combat gender bullshit, particularly violence, when I thought back to the advice of a dog trainer.

If you want a dog to stop doing something, give it something else to do instead. Dogs aren't great at understanding negations. The best you can do is shift the dog's attention. Don't chew on a paw, but chew on a toy. Don't bark at a squirrel, but look at my face. Don't eat rabbit shit, but eat a dog treat. Providing an alternative is far more productive than trying to communicate "stop it".

Everything in this talk I was watching, and more generally every good message I hear about gender, is a negation. Violence must stop. Inequalities in respect and pay and opportunity and must stop. Differing expectations about innate cognitive abilities is wrong. The way we will tear out these diseases is by reshaping culture, by convincing our adults to train our dogs - I mean, to teach

In school they told you to write, and what you wrote was shit because you didn't have any intelligent thoughts to express, because why would you? They told you it was a writing assignment, not a whatever-you're-writing-about assignment, so you were focused on writing. We do learn what we're taught, quite well, but what we're taught is that breaking your pen in half will spill enough ink on the paper to start you off with a B.

Programming is taught and practiced the same way. You can tell people to write code, and they'll write some code, but that doesn't mean there is any manner of intelligent idea or intent expressed in it. It requires a reason, an actual objective to care about, for a person to actually do anything beyond following a cargo ritual to build an empty resemblance of a product.

function unique(array) {
var visited = {};
return array.filter(function (x) {
var isNew = !visited.hasOwnProperty(x);
visited[x] = true;
return isNew;
});
}
Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(153,548),absolute(1506,1314),button=1,modifiers=Button1,clickCount=1] on win0
java.lang.NullPointerException
at gz.jsunit.JsUnitAction.runTest(JsUnitAction.java:35)
at gz.jsunit.JsUnitAction.actionPerformed(JsUnitAction.java:24)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:151)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:259)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:892)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:114)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:230)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

Line numbers become hidden as editor font size increases

The size of the line number column is fixed. It ought to scale up with the editor's font size, because otherwise the line numbers don't fit.

Screenshots are from version 12.0. Also seen in version 12.1.4.

Corner cases of mathematical definitions tend to take people by surprise, such as that 0 factorial equals 1 and that universal quantification over the empty set is always true. In these examples, functional programming (but never procedural programming) is illuminating. In Scala:

def factorial(n: Int): Int =
  (1 to n).fold(1)(_*_)
def all[A](set: Set[A], p: A => Boolean): Boolean =
 set.map(p).fold(true)(_&&_)