Tuesday, February 27, 2007

T-SQL select next day

In MSSQL Server 2000 and 2005, run the following script:

declare @date datetime
set @date = '02/28/2007'

select @date+1


Run it, and it will give '03/01/2007'! Moreover, set @date to '02/28/2008', and it will give '02/29/2008'! To definitely make sure it's all working fine, set the @date to be '12/31/2007', run the query, and the answer will be '01/01/2008'.

When I provide the date in MM/DD/YYYY format to a query or stored procedure, it interprets it as MM/DD/YYYY 12:00:00 AM, beginning of the day. So when I need to make an inclusive search on the date, I need to provide date+1 value of the parameter. Instead of creating complicated clauses, @datetime+1 simply works.

Saturday, February 10, 2007

Some InfoSecurity

Footprinting
is the organized research of the Internet addresses owned or controlled by a target organization.


Fingerprinting
is a systematic survey of all of the target organization's Internet addresses (which were collected during the footprinting phase); the survey is conducted to ascertain the network services offered by the hosts in that range.



Source:

Whitman, M, & Mattord, H (2005). Principles of information security.Canada: Thomson.

Labels:

Thursday, February 08, 2007

a:visited not working in Firefox

Today I had to set up a stylesheet such that the visited links were in a different color. Ok, no big deal, changing the a:visited to some other color. Works in IE, does not work in Firefox. Oh, no... is that another one of those cases where I had to find and use a hack? Hasn't such easy problem been solved long before... Turns out it does not have to have a hack. I had my Firefox settings not to keep any browsing history, so it did not know whether I visited the page or not.

Needless to say, I could have just removed those a:* elements since their color was not important anyway....

Labels: