|
Welcome to CrazedSanity Dot Com!
Home of the Dynamic Content System (cs-content)!
Server Time: 02-23-2012 00:32:40 CST
|
|
|
Sometimes it is tough to stay focused. Especially when it gets down to getting caught-up in the minutia, the little details that turn out to take just as long (or longer) than the entire rest of the project. Last week I was working on an idea for COMET. The basis was long-poll Ajax requests which discovered events from a database event log. This particular log is one used by my "CS Web App Libs" project (web application libraries). There's a class/library that covers logging things to a database, along with some (mediocre, mostly untested) retrieval code. Okay, so I did all the Ajax stuff, got the PHP script on the backend to go into a loop that could get down to loops that were just 100ms (that's how long it waited between polls; I didn't check to see how long the query took). The query would ensure results were greater than the last retrieved log ID (a unique, always-incrementing number) to ensure that no results were duplicated... That's when I realized that this database logger (cs_webdblogger) couldn't limit results like that. It seemed like it was because there was a list of fields to filter by, and the "log_id" wasn't one... so I added it. Uh-oh. I then found that the code that builds the SQL string (to poll the database) purposely would not allow special characters (such as ">"), so I couldn't do a query which had "log_id > 12345"... So I started looking at that code. I realized it was only built to built a string out of an array. There were "patches" done to make it work for SQL, but they were kinda shoddy. So then I started thinking of building something similar, but specifically for SQL. This will be the, what... 3rd step back? Fourth? So I started working out how to change that code so that it would do the ENTIRE SQL STATEMENT (instead of just segments). Including the table joining and what-not. That's when I stopped. Four steps back, maybe five... But I decided to circumvent the "string from array" code and add an argument to a method, add the " log_id > 12345" part, and move on. And you wonder why I have problems staying focused? AND THEN... I post a blog about it. And realize that, because of the length of my new blog, it's tough to see if there are other new blogs by other people... so I start thinking about how to have an "expand" option, and how to stylize it... ugh. And, once again, I've lost focus. |
|
Follow @crazedbuzz