Tuesday, October 2, 2007

Filter for Spam on GMail

I've been getting a ton of spam on GMail lately that falls into two categories: Russian-language spam, and another spam with several variations, of the form:

  • Hello! I am bored this evening. I am nice girl that would like to chat with you
  • Hello! I am bored this morning. (etc)
  • Hello! I am tired this evening. (etc)
  • Hello! I am tired this morning. (etc)
  • And so forth...
So I've been honing a Gmail filter that knocks both out at once. So far I don't have any false positives, and I have about 5000 legitimate emails and 5000 spams in my gmailbox. Create a filter, and in the box for "has the words," just paste:

и|KOI8|windows-1251|("Hello! I am" (tired|bored) (today|tonight|this))

You can also test this against your mailbox in general by putting that exact text in the search box in gmail, and if you want it to search everything, add a space and then in:anywhere.

If you have any other filtering tips, post a comment.

Wednesday, July 11, 2007

Handler "$HANDLER" has a bad module "IsapiModule" in its module list

If you've seen this error when trying to get a CGI handler working in IIS7 on Windows Vista, check your applicationHost.config file (in c:\windows\system32\inetserv\config). Specifically, look in the <modules> list to make sure you have an entry specifying:

<add name="IsapiModule" type="" precondition="" />

I was beating my head against the wall with this error message until I added this. (In my case it was within <location path="My Website"><system.webserver><modules>, just to be specific.)

I already had an entry for IsapiModule in globalModules, mind you. I have no idea why this is required, so far the IIS7 configuration system leaves a lot to be desired.

Microsoft, when providing a gun that can shoot you in the foot, it might help to add some safeties. How about making it really easy to configure common CGI modules like Perl, PHP, Python, Ruby, etc?

Wednesday, May 23, 2007

Ummm... my BlackBerry has GMaps+GPS and NO support?

Official Google Blog: Cingular BlackBerry 8800 has Google Maps and GPS

Steve acts like this is some new development in phones... yet my BlackBerry 8703e has full GPS support, runs Google Maps, and does not benefit from this special code unlock that google has provided for these 8800 phones.

Why?

Oh... my phone runs on Sprint PCS network. Perhaps Sprint hasn't paid google for the favor yet?

Wednesday, April 18, 2007

Handy SQL Server Query: Date String For Filename

Here's a simple piece of code for creating a string in YYYYMMDDHHMMSS format, suitable for use as a filename:

REPLACE(REPLACE(REPLACE(CONVERT(char(19), GETDATE(), 120), ' ', ''), '-', ''), ':', '')

If you ran this at 1:23:05 PM on December 3, 2006, it would return "20061203132305".

SQL Server 2000 Database Doesn't Shrink After Removing Columns

If you've ever come across a situation where you've removed text, ntext or image columns from a SQL Server 2000 database, and the size of your database doesn't shrink even after compressing it, you may have run into the problem described here:

DBCC SHRINKFILE and SHRINKDATABASE commands may not work because of sparsely populated text, ntext, or image columns

The solution is to create a DTS package to transfer all of your database objects into a new database, and remove the old one, and then rename the new one to your original database name (if necessary). We did this recently and recovered 50% of the disk space wasted.

Hopefully this problem was solved in SQL Server 2005.

Using SQL Query Analyzer via RDP Can Be Slow

I won't bore you with how I discovered this phenomenon, but rest assured if you run Microsoft Query Analyzer on a remote computer using Remote Desktop Protocol (RDP), you may notice strangely slow execution times when returning a large number of rows in text-result mode. If you switch to grid results, or if you minimize the query analyzer while the query is running, you will not have this problem!

A real world example:

A SQL Query that returns 40,000 records. When running this query in text results mode via RDP, Query Analyzer consistently took 8-9 seconds to finish. When running in grid results mode, it took < 1 second! When minimized in text results mode, it took 2-3 seconds (most likely due to my slow reflexes minimizing the window). You may find that this is true for many programs that are outputting a large volume of text to the screen -- keep then minimized if possible. And it's not what you might initially think, that a large number of screen-draws are being performed, slowing things down. Nope, my query analyzer results were not scrolling down the screen visibly. This is just some weird behavior with RDP and certain text displaying screens. If anyone knows why this happens, feel free to comment below.

(Note: this behavior was specifically observed using RDP connected to a Windows 2003 Server running SQL Server 2000.)

TimeZones in JavaScript

If you want to obtain the user's timezone offset in JavaScript (that is, the difference between their timezone and Greenwich Mean Time, or GMT), use this snippet:

(new Date().getTimezoneOffset()/60)*(-1)