Wacky VBA, Bitchen PHP

I was spending a night debugging some heinous VBA code. It was my code, but it sucked. It sucked because it's pretty hard to write glue code that integrates different parts of MS Office. All I wanted to do was produce some distribution lists from an Access database, but thanks to Office Outlook's totally complicated system of managing email lists, you can't just spit out something like the old .alias file:
listname: joe@blow.com, foo@bar.com, blarg@foo.com
That would be easy. No, Outlook requires you to make a DistributionListItem, and then AddMembers to it.

MS Access VBA: Error -2147217900 (80040e14)

Jawahar on Expertsforge says this is an SQL syntax error where a keyword is used as a field name.

In Access, the app finds these keywords and quotes them before running the query. It's all done behind the scenes, but you can expose this feature through the query design tool.

Create a new query in design view. Bring up the SQL view. Paste your SQL in there. (You are probably already be at this point, testing your SQL and knowing it works.)

Los Angeles County Real Estate, by Zip Code: Zillow Links to Recently Sold Homes

This list of links will open new windows displaying Zillow's recently sold listings for homes in the zip code.

Los Angeles County Real Estate, by Zip Code: Redfin Links

This is a list of community names and zip codes, linked to their respective Redfin market-conditions pages. The links will open new tabs, so you can click a load of them.

MS Access VBA: Generating Code for Handlers

I've been working with "unbound forms" and, ay ay ay, what a pain in the butt. Unbound forms are regular forms, except that the controls aren't associated with any data source. An unbound form is like a panel of controls, without wires behind them, and no information being shown or recorded. It's like a prop without a performance. It's weird to use an Access form that doesn't seem to work, because the data structure behind it doesn't exist -- without information, there's no animation.

CSV Files, Comma Separated Values

This is the latest version of the CSV class, but renamed to work with CakePHP.

The main change is the addition of a feature that will let you save the headings into the object, then parse lines and return them as associated arrays rather than numerically indexed arrays.

Here's some sample code showing how to use it, followed by the class:

~~~~ $csv = new csvComponent(); $fh = fopen($filename, 'r'); // First, detect the headings -- this feature allows us to put some // information above the actual data. while( $data = fgets( $fh ) ) { $line = $csv->textToArray( $data ); if (p

Hispanic Surname Extraction with Regular Expressions

The challenge with these names is twofold. For one, they follow a European convention of using "of" to denote the family, e.g. De La Cruz. This is like the Irish O'Connor or Italian del Vecchio. Secondarily, some people use their Catholic-style names, where the maternal name is combined with the paternal name, e.g. Lucy Lopez Valdez.

Common MIME Types, in PHP

This is based on a list of common MIME types that's been posted around the web. It's in PHP array format. The long list cannot be used as-is due to repeated keys. The long list is followed by a shorter sublist of popular formats you're likely to need.

How Much Money Can You Save on Gas by Riding the Bus?

This is a javascript calculator that will estimate if taking a bus will cost less than what you pay in gasoline. Surprisingly, for short commutes, commuting by car is cheaper than getting a bus pass. (Calculator is on the full article.) You can get prices at Gas Buddy.

Vi and Vim, Macros

Vi and Vim have a "macro" feature to help automate routine editing tasks.

Sometime, you get a document, a file, or some data that's just messed up looking, or was formatted for printing, and you need to reformat it.

Most editors have some kind of macro function, where repetitive tasks can be automated. Unfortunately, these macros have, over the years, acquired an acute case of featureitis. Vim keeps it simple.

Be Specific; The Inner Platform Effect

Here are some choice words about seemingly perpetual problems that emerge in software development.

RAID 5 Parity. What is it, and how does it work?

One morning, I started wondering how RAID 5 parity works to rebuild a disk array. It seemed "magical" to me, that you can get redundancy and still use most of your disk capacity.

Resolve IP Addresses to DNS Names

Sometimes, you have textual data, like log files, with IP addresses. You sometimes want this data to show hostnames instead.

No Eval? Variable Interpolation on PHP Code

We recently turned off the websites' ability to use the eval() or related functions. In a small CMS I'd written a while back, I was using eval to interpolate variable names in strings. This was a simple way to do "lazy evaluation" on strings I was using as templates. With eval, there was no need to use a special templating syntax - the syntax was PHP's.

Now, with eval turned off, I needed a function to interpolate variables in a string.

TXTMOB for Web Hosts (project)

This is a hack of txtmob that's being developed to run on cheap web hosts.

So far, it'll let you send to the group via the web form, so it's suitable for a one-way, moderated list. Good for news.

The sms forwarding feature doesn't work, so, it's not able to do "real" txtmob yet. Maybe it will one day... This code is very alpha, and based on code from SourceForge, that was at version 0.14, so you know what you're getting :-)

I'm not forking the project. This is just a personal fork for personal use.

Fun Details, and Some Roadmapping

Syndicate content