What languages do you know?

One of the ‘How to tell if someone is a programmer’ jokes is to ask someone what languages they know. These would be popular answers.

Languages

I’m not really a programmer, but I know a fair number of these.

I went to a C class in 1988 but never had a reason to use it. I really learned C one summer a few years ago when I had some kids to help me, but I’ve never used it. It’s pretty good at making you think.

I can read and debug Java but can’t write it.
No reason to use C++.

I use PHP all the time and I’m at the point where I think I need to start using classes.

Absolutely no reason to go anywhere near C# or Visual Basic.

Python and Perl seem like they would be useful, especially for some of the string manipulations I do with sed.
I’ve played with Python a bit and it looks like something I’d like if I had the time to learn it. Perl is {$}}@##}}

Learning JavaScript.
Spent an hour today figuring out that <> is not used in JavaScript—it’s !=

Upgrading to the latest ActionScript.

Haven’t used SAS for 20 years but liked it a lot when I used it.

Of course I use SQL all the time—how else do you get to your data?

Update: Spring 2014
I learned Objective-C—so I can convert some programs to the iPad. It’s a really nice language and Apple has lots of API that make it easy to develop apps.

Not on the list, but I just spent a while learning Bash shell scripting. It comes in handy when maintaining Linux boxen.

Update: Winter 2016
I’ve heard all of the jokes about Perl being an unreadable mess, but I have been updating a site that is built with Perl and I must say that it isn’t bad. The language has some quirks but I have been able to read the code without much trouble and make changes to the web pages without spending a whole lot of time learning a completely new language. I even wrote a couple of new scripts that worked the first time.

Update: Fall 2016
I just read The Swift Programming Language and have started watching CS193P with Paul Hegarty. The language is completely different from anything I’ve used before. It is a shining example of what a talented group of programmers can do when they do not have to maintain backward compatibility with previous languages (e.g. Objective C and C) or fit into an existing paradigm of how object oriented languages must behave. I really like working with it in the Playground and can’t wait to make real apps with it.

How to tell if someone is a programmer.

When you say “Hello”, they answer ”World”.

They use nested parentheses in normal writing (at least I do (sometimes)).

They are wearing socks (and sandals).

Ask them what languages they know.
You can tell the programmer by the way he names numerous langauges but forgets to include ‘English’.

If you ask them a question there is a pause as they break out of the for loop.

If you ask them whether they use Mac or Windows, the answer is ”Usually not.”

More things I can’t remember.

Manipulate a phone number

To change a phone number from a string of digits, e.g. 8051230123 to a formatted value e.g. 805.123.0123 you can use the following grep pattern to parse the string


([0-9]{3})([0-9]{3})([0-9]{4})

and

\1\.\2\.\3

to replace the parsed string with dots.

Tar up a folder

Someone wrote this up for me years ago and I still refer to it from time time.

Assuming you want to copy the site onto your local machine:
The following will tar and compress up the entire www tree and
put the archive file in your home directory (on the server).

cd /; tar -czvf ~/www.tgz www

to decipher:
tar – tape archiver
-c – create new archive, write supplied files too it
-v – verbose – print out names of files as they are added to archive
-z – compress archive using gzip (gnutar only, as used on OS X)
-f ~/www.tgz – write output to file www.tgz in home directory
www – the file to include in the archive

To extract it again:


cd /where/you/want/it; tar -xzvf /path/to/www.tgz
 

will unarchive the www tree under the directory /where/you/want/it

Wordlist

My favorite words list has formatting in the CSS to make the first word of the definition (the part of speech) capitalized.


.definition p:first-line {
  font-weight: bold;
  font-variant: small-caps;  
}

Some words can be used as Verbs and Nouns, or Verbs and Adjectives, so I need to change the formatting of the part of speech.


<span class="boldSmallCaps">Adjective</span><br />

So the part of speech is now formatted with this CSS

.boldSmallCaps {
  font-weight: bold;
  font-variant: small-caps;  
}

Frequencies for equal-tempered scale

Link

Prevent your ISP from redirecting mis-typed URLs

My ISP started to hijack mis-typed URLs and open up their search engine page—which makes it difficult to correct typos. You can bypass your ISPs DNS server by using OpenDNS (208.67.222.222 , 208.67.220.220) or Google Public DNS (8.8.8.8 , 8.8.4.4 ). If you are using OSX, open up the Network Panel in System Preferences and then click on the Advanced button. In the DNS tab, replace the default IP address with one of the ones above.

Block access to javascript from Tynt, the Copy/Paste Jerks

For my word of the day I frequently copy a sentence with the target word and lately I’ve noticed that I get the URL with it. It’s annoying to delete the URL and apparently it annoys John Gruber too. The solution is to edit your /etc/hosts file and block their server. Add this line to the end:
127.0.0.1 tcr.tynt.com

Make files invisible

SetFile file -a V