One of my friends at the office nicknamed me the Oracle for my penchant of spouting off solutions to his problems before he’s even finished describing it. One such conversation went like this:
So I’m having trouble doing this regular expression in vim, I’m trying to-
Percent sign.
Huh?
Nothing, go ahead.
So here’s what I’m trying to do… [ much technical discussion follows ]
So, umm, yeah, just add a percent sign to the beginning of your expression. Otherwise vim scope’s the regular expression so that it doesn’t actually effect anything except the current line.
It’s a direct result of all the hours of frustration you spend banging your own head against the wall for one bizarre reason or another that eventually you build up a bag of tricks that come in handy. From the strange behavior perl exhibits on systems with UTF character encodings enabled, to unfreezing a “frozen” terminal with CTL-Q because you accidentally locked it with CTL-S, there’s a ton of useful little tricks that you build up over time.
Well, the oracle was tested again the other day. I received the following email:
Hey!
I saw that you're doing some cryptographic..
http://www.psifertex.com/crypt/
I have a mathematic equation to solve, but i can't even imagine what it is.
so, as i saw, that you have something of it on your website, i thought you migh help me out a bit..
if you don't have time for it, please, at least let me know what it is, so I can search the web and solve it myself.
the equation is here:
++++++++++[>+++
++++>+++++++++
+>+++>+--------
-----------
---..+..+
+..--------
.+++++++.--.++
++.+++++++++.++.
and here are the answers for this equation:
666
31337
sqr of 144
1003*2
191*7
1,618
I would be very thankful for your help.
First, I had to figure out why this random internet user would think I could help. I eventually realized it was because of the top line of my crypt page. Which was just some dots and pluses showing the distribution of prime numbers over integers, but has nothing to do with the jibberish above. Except it’s not quite jibberish, and I did indeed happen know what it was supposed to be. Any takers in the audience? Programers may very well recognize it, but I was thankful that I remembered it from a slashdot post a while back.
Select the following text for the answer:
The language above is “BrainFuck” (or BF in polite circles) [see http://www.muppetlabs.com/~breadbox/bf/], a turing complete language specifically developed to be obnoxious to read, but able to do anything any other language can do if you’re insane enough to try.
Of course, the sad part was that his original question was sent at 2:17am EST and I responded by 8:54am EST which was apparently too late for the daily contest the individual was trying to enter in. Oh well.
Some people say that a person is a collection of memories and attitudes.
For Jordan its memories, attitudes, and a special place in the left cerebral cortex called the bag’o'tricks.
Why in the heck won’t grep -vi ‘Permission’ filter out “Permission Denied” from my find on root directory?
Jordan: Duh, find is printing those messages to standard error, and grep’s only seeing the standard output from the pipe.
Left by Andrew on March 24th, 2006
Holy crap, where’d you find out about CTRL-Q? Why in the world is that ‘feature’ even there? Does the S in CTRL-S stand for “stasis” something? Why would you even want that?
Left by Eric on March 24th, 2006
It’s extremely old school. I think it’s TROFF / TRON — some sort of control character for halt input / resume input, but I don’t really know. One of those things I never really understood _why_ just the _how_.
It can actually be kinda useful if you need to type something in but don’t want someone to watch:
CTL-S
somescript.sh
mypassword
clear
CTL-Q
Of course, it’d still be in your history, but it keeps it off the screen for all bit a millisecond. Most of the time though it’s just obnoxious as it seems like you’ve totally frozen your shell.
Left by Jordan on March 25th, 2006