Computer Programming

Yes, a bit specific, but I need to store some links!

Craigslist Independent Contractor Jobs and Employee Status

Recently, I saw an ad on Craigslist that described a job, and stated that they would not accept telecommuters, all work was on-site, and "independent contractor." This ad might have been illegal, because there are laws about what defines an independent contractor and what defines an employee. Small businesses that misclassify workers can get an unfriendly visit from the tax man.

Telephone Number Normalizers: fix phone numbers into a common format

It's common to get a list of names and phone numbers in a spreadsheet or from the web, and the formatting varies. In the US, people don't use a standard formatting consistently. Lately, they have taken to making phone numbers look like domain names or ip addresses, example: 415.555.1212. This function normalizes phone numbers to look like this: 213-555-1212 x1234. The code's structured so multiple regexes are used to perform the matching, allowing for easier modification of the code. (This code was written in Excel, but should work in any VBA application.)

OMFG - the future of software, in Javascript, Xopus

Xopus is an XML editor, written in Javascript and HTML5. It's not just JS, but it's licensed software for your desktop. I'm blown away. This is Google Docs, Angry Birds, Yahoo Pipes level blown away. Check it out.

Undermining the Cache (Sharepoint?)

I was on the Ralphs website, and found some image URLs that looked like this:

Javascript and Lisp (erm Scheme or Guile)

I was reading up on Guile, figuring I should revisit Scheme annually. Found some examples, and translated them into Javascript.

(lambda (x) (+ x x))

(define add4 (let ((x 4)) (lambda (y) (+ x y))))

(define factorial (x) (if (zerop x) 1 (* x (factorial (- x 1)))))

function(x) { return add(x,x); }

function _defunmaker() { var x=4; return function(y) { return x + y; } }
var add4 = _defunmaker();
_defunmaker = null;

var factorial = function(x) { if (x==0) { return 1; } else { return x * factorial(x-1); }; };

C# and Comparison

This is a link to an awesome resource: a "rosetta stone" comparing VB and C#. Totally useful as a general reference, too. One of these days, we need columns for PHP, D, C++, Javascript, etc.

Bedrock, Google, and Patent 5893120

A story about Google losing a patent lawsuit against Bedrock, an East Texas "patent troll" has been making the media rounds, but I haven't yet seen an analysis of the patent. All I see is talk about Linux being at risk. If Linux is at risk, so is Windows, and so are the Apple OSs, because there's very little novel about the patent.

Convert DOC and OpenOffice to PDF, from the command line and a watched folder

Most of the information in this post is derived from It's posted as a service, because the code there needs some editing.

Also, a useful thread about executing OOo macros is at

Here's the code to automate the opening and saving of a file as PDF, using Open Office. Paste this into your standard macros.

Iteration Safety

So I was reading the CRM114 documentation, and he notes that CRM is hard to DoS because iterators are designed not to use iteration indices. What an interesting thing to say.

A Demo of Transmitting Passwords Encrypted

This is a demo of a technique to transmit password encrypted. It's not a perfect solution yet, but it's getting there.

Interstitial Ad in jQuery

Normally, you should use canned Javascript or canned PHP modules to implement web features, but sometimes, that can suck. Typically, these products, if they're popular, start to suffer from feature bloat. Such was the case with some code for "interstitials", which are those ads that pop up on some web pages, interrupting your reading. Popups have been around a long time, and the drop-in code is just really huge.

Risks of Web Services to Applications

Increasingly, applications are dependent on external web services.

Data and Input Validation with Filters (PHP 5.2 and up)

For years (and years) we've done data validation in PHP "by hand" either with string functions or with regular expressions. The problem with PHP has been that, well, PHP programmers aren't so great at regexs. Also, unlike Perl, there's no data tainting feature that forces you to validate your inputs before they're used in expressions. (Correction, there is a tainting extension.) The upshot is that a lot of bad data gets through. PHP finally added some data validation function, but it seems like nobody is using them. It still lacks tainting. The former problem, we can address.

Screen Scraper in Perl to Extract Dates and Times

This is something I wrote to learn some of the latest Perl tech to scrape pages. What's cool about this demo script is that it doesn't use regular expressions that much.

Reading Code with GVIM/VIM and ctags

Vim/GVim has great features to make it easy to read C (and PHP and Perl) code.
Syndicate content