Author Archives: Jason Honicker

Plain Text Transmogrification through Regular Expression Sorcery

Plain Text is everywhere and it isn’t always present in exactly the format you would like it to be in. Take for example an address line like this one; “Pottsville, PA 17901”, that is in a single field (or xml element). The data needs to be separated into city, state, and zip code fields. Luckily there is a pattern to the address data, although the city name may vary in length and might include spaces such as in “New York”, there is always a comma and space before a two letter state abbreviation, another space and then a five digit zip code.

Now, I could write a little parsing program or perhaps use several string manipulation functions in my translator to get what I want, but I know a little something about Regular Expressions (regex). Continue reading

Your Relational Database Can Do More than Store Data

It is easy to think of the database as just a place to store data in a structured and sharable way, but modern Relational Databases can do more than that. For example, triggers are a feature that let you define an action to be performed when certain events occur within the database, such as when a new record is inserted, updated, or deleted from a table.

Triggers can be useful when you don’t have control over the application using the database, but you do have control of the database itself. This is actually a common scenario because many application vendors don’t ship their own database; instead, they connect to an existing database and create the tables their application requires when they are installed. This is valuable because it lets you integrate off-the-shelf applications. For example, perhaps you have an application where you normally add and maintain customer information. You also have another application that needs some customer information, such as their name and address for shipping, and it tracks that data within its own table. By using triggers on the insert and update of the address data, you can automatically add and keep synchronized the data for the shipping application. Continue reading

Just what is the Character (Set) of that Document?

In this age of the Internet, where information is exchanged between systems regularly, it is all too easy to forget that computer systems can store their “plain-text” data in a lot of different ways. If you thought that UNIX Files versus Windows Files were annoying with their Line Feed versus Carriage Return+Line Feed differences, can you imagine the trouble we would have if ASCII didn’t exist?

ASCII, the American Standard Code for Information Interchange, has become a subset of many other character sets in common usage today, so you can exchange a lot of documents without too much hassle, but what do you do if you get something else?

Continue reading