HOME - ABOUT

SQL - Simplifying User-Defined Functions

08.10.08 @ 9pm

I recently learned of the concept of Spartan Programming and since then, I’ve been trying to find ways to apply some of the techniques.

As a talentless hack, some of the ideas are beyond me, but one of them — reducing the number of variables — I am capable of. I was working on a typical user-defined SQL function that was something…

Export HTML Data to MS Excel: a PHP/JavaScript Solution

10.30.07 @ 2pm

Google up “export HTML to Excel” and most of your matches will provide methods using ASP/VBScript by either declaring the Response.ContentType = “application/vnd.ms-excel” (exhibit A) or building a new ActiveXObject and fuddling around with that (exhibit B).

Well, neither of these helped me at all since I was using PHP for this particular project, so I had to come up with my…

World of Warcraft: Mac Video Capture Option

10.21.07 @ 1pm

Blizzard has a added new video capture feature to the Mac version of World of Warcraft. Initially, I tried it on the highest resolution setting of 1446×904.When I hit the capture button, the game slowed to a painful crawl and after a few seconds, I received an error that the setting was too high and the capture stopped. When I…

Handling “z-index” Bugs in IE6

09.21.07 @ 8am

After some thorough research (i.e. a few Google searches), I hadn’t come up with a fully satisfactory explanation of why IE6 mishandled the z-index attribute. So, here’s a concise survival guide if you intend to use this attribute in IE6.

First, let’s revisit the intended properties of z-index:

  • It applies to positioned elements only.
  • Only when a z-index integer value is specified should a…

jQuery, AJAX and Redundant Event Handlers

09.10.07 @ 3pm

It didn’t take me long to realize that jQuery’s AJAX functions don’t trigger the $(document).ready() event. But then, it wouldn’t really make any sense if they did. Naturally, this event fires just once and naturally, AJAX leaves it alone. Therefore, it becomes necessary to supply event handlers to the AJAX callback functions, even if it means duplicating handlers in the…

ASP.Net - Error: Newline in constant

09.07.07 @ 8pm

Here’s a tip from a few years ago. I was working in C# on an ASP.Net application and needed to run some Javascript code from the server side. That’s when I ran into the error.

I was trying to run something similar to the following code…

addthis_url = ‘http%3A%2F%2Fwellknownmeats.com%2Faspnet-error-newline-in-constant%2F’;
addthis_title = ‘ASP.Net+-+Error%3A+Newline+in+constant’;
addthis_pub = ”;

MS SQL Server: Kill All Connections to a Database

08.22.07 @ 12pm

Have you ever needed to kill all the connections to a database in MS SQL Server? Do you go to the Process Info screen, right-click every process, clicking Kill Process and then hitting Y in the confirmation box? What a hassle.

addthis_url = ‘http%3A%2F%2Fwellknownmeats.com%2Fms-sql-server-kill-all-connections-to-a-database%2F’;
addthis_title = ‘MS+SQL+Server%3A+Kill+All+Connections+to+a+Database’;
addthis_pub = ”;

MS SQL Server: Find a Value In Any Field In Any Table

08.20.07 @ 10pm

As part of a project at work, I found myself needing to update every field in an entire database that contained a certain value. If I had needed to do this in a database I had created or a database that didn’t have hundreds of tables, I might have done it manually like I have done it in the past.…