Computer Programming

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

Javascript Delayed Hiding of an Element, Delayed Function Calls in Different Contexts

So I'm working on a small "speech bubble" library, and needed to delay hiding of the bubble. It's not that it was required, but it was a pain in the butt figuring out how to arrange the event handlers on the different elements so that you don't end up with a situation where you get a flickering bubble because you hide the bubble, and that fires a mouseover event that, in turn, displays the bubble again. That fires a mouseout event that causes the bubble to be hidden.

All Your Parsers Are Belong to Us

Getting Started with Exploratory Parsing. Describes a system where you can write your parser by analyzing huge bodies of text. In short, a system for writing all the parsers required to analyze the text on the internet. (In English.) (Ward Cunningam invented the idea of the Wiki.)

Learning the Facebook API

For the past few months I've been working on web apps. The first was a mobile site based on jQuery Mobile. While it was "cool", it quickly dawned on me that it wouldn't get any significant usership. For one, it was like a clone of 4square and Scvngr - and who really uses that? I'd peer into the lists of checkins, and it wasn't looking too encouraging. People use it when they're bored and alone, and my scenario didn't involve either of those situations.

Javascript Module Pattern

Javascript Module Pattern In Depth at Adequately Good is a very good article about how to make JS modules that don't pollute the global namespace.

PHP Namespaces with Autoloader Example

It took a while to wrap my mind around PHP namespaces - despite the fact I've needed them for years. It's just one of those features that seems weirder in PHP than in other systems. But that's normal for PHP - quirky. Unfortunately, it's not quirky like Perl, where the quirk eventually makes you feel good. With PHP you just feel kind of odd, maybe a little inferior... like your language is slipping toward becoming the Visual Basic of the web.

Function-Generating Functions in Javascript

I wrote this before I practiced with the module pattern and with adding methods to prototypes. So this article doesn't explain a best practice. Still, it's a pretty good pattern. See also the Javascript Patterns book.

MS Access to KML Data Dump

Here's a script that helps to export KML files for Google Earth from Access tables. The idea is that you create a query with columns named "Latitude" and "Longitude" and any other columns you need. Open that query, and pass the recordset to this dumper. You also specify a file name, and a list of columns to use for the name and definition fields.

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 VB.net 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.

http://www.harding.edu/fmccown/vbnet_csharp_comparison.html

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 http://www.tech-faq.com/convert-word-to-pdf.html. It's posted as a service, because the code there needs some editing.

Also, a useful thread about executing OOo macros is at http://www.oooforum.org/forum/viewtopic.phtml?t=2619.

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

Syndicate content