There are, roughly speaking, three ways to develop large user-facing programs, which we will refer to here as 0) the Unix way, 1) the Emacs way, and 2) the wrong way.
Disclaimer: This post is in no way a rant about NodeJS or Ruby on Rails. It merely reflects on our decision and the reasoning behind it. Both the frameworks are great for the purpose they are built, and yes that is why a part of our stack is still running on NodeJS.
I am huge fan of NodeJs and…
Drawing programs don’t always have a “point”, even if they are fun. Recursive Drawing, however, aims to use a simple and addictive user-interface to explore how drawings could be translated into programming.
On the surface, it’s a purely fun tool (which you can, and should, play with!) to draw crazy-awesome things like Fibonacci trees (like in the video). But deep down, it’s an experiment in translating visual objects into programming commands. That’s called a spatial or visual programming environment, and it’s a way to disconnect the syntax of programming from the logic and math.
Environments like these also let non-English speakers and young people get introduced to programming skills without having to master the language itself. But if you don’t want to pay attention to all that, it’s just really FUN!
Previously: A dangerously addictive online fluid dynamics simulator and a particle/gravity simulator that really looks more like fireworks.
Enigma in a spreadsheet!
Back in the summer of 2009 a friend of mine read a few of my books covering cryptography.
This is his interpretation of the Enigma cipher machine; the distillation of a mental model he formed from reading those popular-science treatments of the machine.
He is not a programmer or anything but he just proved his aptitude; and he’s super-leet at Excel too!
I think we can all agree this is programming, even when done by someone who is not a professional programmer and who has no formal programming education.
When I asked him if I could post his old Enigma spreadsheet, he was skeptical that anyone would be interested. Outside the programming world, normal people think making complicated spreadsheets in their spare time is creepy and to be suppressed ;)
Now the Internet is awash with Engima machines in Flash applets and such; none seem to agree with any other, and this spreadsheet is no exception to that. So it would be most unlikely this is a truly accurate representation of the real machine.
However, my friend is a good visual learner; I think if we could just get him to Bletchley Park he’d refine and fix his mental model and build a better, more correct spreadsheet :)
I figure we all just have to give him encouragement - comments and code review and such - and get his appetite whetted for doing more of this computer type of thing! So if you enjoy his work, please say
Discussion on Hacker News and Reddit; saw it somewhere else? please say :)
__label__(:loop)
puts “The Ruby core team is playing a joke on us!”
__goto__(:loop)
puts “This line of code is never reached.”
This code works only if you compile ruby 1.9 to support goto statement.
p/s: Got this from the comments - http://kerneltrap.org/node/553/2131
A great article explaining a bit in depth of how Ruby code is translated to native machine code via JVM.
Convert Ruby 1.8 to 1.9 hash syntax
In vim, for an entire file:
:%s/:\([^ ]*\)\(\s*\)=>/\1:/gIn the shell, for an entire project:
perl -pi -e 's/:([\w\d_]+)(\s*)=>/\1:/g' **/*.rbNow, instead of those old-school hashes like this:
get '/', :agent => MOBILE_BROWSERS doYou’ll have new-school hashes like this:
get '/', agent: MOBILE_BROWSERS do
It’s by Twitter. Should be good :)
Interesting look at the issue.
I think this is common among non computer science grads who end up as programmers (such as me)