Monday, October 31, 2005

Have a very happy halloween!

 

Monday, October 31, 2005 9:02:59 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, October 27, 2005

This seems like a good 'dev box' sql replacement.

VistaDB 2.1 database for .NET has been released
This 2.1 update includes over 60 improvements, including new support for .NET 2.0 and Visual Studio .NET 2005. VistaDB is a small-footprint, embedded SQL database alternative to Jet/Access, MSDE and SQL Server Express 2005 that enables developers to build .NET 1.1 and .NET 2.0 applications. Features SQL-92 support, small 500KB embedded footprint, free 2-User VistaDB Server for remote TCP/IP data access, royalty free distribution for both embedded and server, Copy 'n Go! deployment, managed ADO.NET Provider, data management and data migration tools. Free trial is available for download.
- Learn more about VistaDB
- Repost this to your blog and receive a FREE copy of VistaDB 2.1!

Thursday, October 27, 2005 8:37:57 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

Just read this on a Microsoft blog....

http://blogs.msdn.com/somasegar/archive/2005/10/27/485665.aspx

Looks like Visual Studio 2005 is shipping... :)

Thursday, October 27, 2005 12:51:59 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

I was never any good at math in school. Though later in life I've kind of wished that I had tried harder, when I saw this blog post on Chris Sells' site, I was almost a tad reluctant to take the test. It was actually pretty easy:

 

You Passed 8th Grade Math
Congratulations, you got 9/10 correct!
Thursday, October 27, 2005 7:59:58 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, October 21, 2005

Ok this is another one of those things that's probably been around for quite a while, but I had never seen or knew about.
How often have you wanted to created a select list (drop down) with category headers, but you don't want someone to selcect the category header itself? Well you'd have to assign a value of  -1 or 0 or something, and then perform some sort of validation to ensure the user had not chosen the 'invalid' item.

I found this on the Apple site, and although I need to do some more research, it appears to be part of the HTML 4.0 spec, and so far it works in every browser I've tried it in.

Here is the dropdown (it does not do anything):

And here's the script:
   <SELECT NAME="browser">
    <option label="-1" selected>Choose a browser...</option>
    <OPTGROUP LABEL="Netscape Navigator">
     <OPTION LABEL="4.x or higher">
      Netscape Navigator 4.x or higher
     </OPTION>
     <OPTION LABEL="3.x">Netscape Navigator 3.x</OPTION>
     <OPTION LABEL="2.x">Netscape Navigator 2.x</OPTION>
     <OPTION LABEL="1.x">Netscape Navigator 1.x</OPTION>
    </OPTGROUP>
    <OPTGROUP LABEL="Microsoft Internet Explorer">
     <OPTION LABEL="4.x or higher">
      Microsoft Internet Explorer 4.x or higher
     </OPTION>
     <OPTION LABEL="3.x">Microsoft Internet Explorer 3.x</OPTION>
     <OPTION LABEL="2.x">Microsoft Internet Explorer 2.x</OPTION>
     <OPTION LABEL="1.x">Microsoft Internet Explorer 1.x</OPTION>
    </OPTGROUP>
    <OPTGROUP LABEL="Opera">
     <OPTION LABEL="3.x or higher">Opera 3.x or higher</OPTION>
     <OPTION LABEL="2.x">Opera 2.x</OPTION>
     <OPTION>Other</OPTION>
    </OPTGROUP>
   </SELECT>

Friday, October 21, 2005 10:50:17 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Thursday, October 20, 2005

So I was looking for a way to 'randomly' display a picture from a given directory. I was going to get all crazy, and do a bunch of file system operations, and then some randomization on that. After I had started, I stopped. I thought this does not need to be so complicated!

I talked to a few friends, who thought my approach seemed fine. But to be quite honest I was in a lazy mood and decided that I didn't feel like comming up with some complicated solution for something that seems so easy. Then it hit me. Isn't there some AdRotator thing in .NET? Yeah there is, and it's slick.

I simply added the following code to my .aspx page.

<asp:AdRotator id="ar1" AdvertisementFile="headers.xml" BorderWidth="0" runat=server />

Well I'm not really using Ads. I have a header graphic similar to a banner ad, but I wanted it to be random each time the page loaded. The cool thing about using this control is that there is no codebehind logic to worry about.

There is then an xml file in this case called headers.xml with the followng structure:

<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>

<Ad>
<ImageUrl>images/header/header1_noglow.jpg</ImageUrl>
<AlternateText>Alt Text</AlternateText>
<Impressions>1</Impressions>
</Ad>

<Ad>
<ImageUrl>images/header/header_sky2.jpg</ImageUrl>
<AlternateText>Alt Text</AlternateText>
<Impressions>1</Impressions>
</Ad>

<Ad>
<ImageUrl>images/header/header_sky.jpg</ImageUrl>
<AlternateText>Alt Text</AlternateText>
<Impressions>1</Impressions>
</Ad>

<Ad>
<ImageUrl>images/header/header_window.jpg</ImageUrl>
<AlternateText>Alt Text</AlternateText>
<Impressions>1</Impressions>
</Ad>

</Advertisements>

Here are the arguments that you can configure in the XML file, and what they do on the front end.

  • ImageUrl - An absolute or relative url to image file
  • NavigateUrl - The location to navigate to when the image is clicked, if you leave this out, clicking the image does nothing
  • AlternateText - The 'alt' text to be displayed on the image
  • Keyword - Specifies a category for the ad that the page can filter on
  • Impressions - A number that indicated the 'weight' of the ad in the schedule of rotation relative to other ads in the file. The larger the number, the more often it will be displayed

So this is really basic stuff, but something I've always ignored in the past. So if you want a way to display a discrete set of images randomly, this might be the ticket.

Thursday, October 20, 2005 7:07:15 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

So I thought it would be cool, to create a page for my wife's web site, that would let me know how many people are on her site at any given time. This will be useful to know when it's OK to upload new code that would bring the site down. Don't want to upset our users! Since her site is on a shared hosting environment I don't have physical access to the box. So I created an admin page on the site that prints out the number of users on the site using this code:

 

//using System.Diagnostics;

PerformanceCounter PC;
PC = new PerformanceCounter("Web Service", "Current Anonymous Users", true)
PC.InstanceName = "";
Response.Write("Current Anonymous Users: " + PC.NextValue().ToString());


The first argument in creating the new PerformanceCounter is the Category of the Performance Counter (SQL Server, Browser, Server, Memory, Processor, etc.) The next argument is the item for that category (Current connections, Active Sessions, Current FTP Connections, etc.) The two things to know when doing this are to: 1.> Know the instance of the item that you want to monitor. The instance name is the name of the site in IIS, or if you were looking at CPU utilization, the processor, etc. You can find this data by looking in Perfmon, or by asking your service provider. 2.> On your PerfomanceCounter object PC in this case, call the NextValue() method to get the current value of the counter.

This is a pretty simple example of accessing the performance counters intrinsic to the OS.

Thursday, October 20, 2005 6:38:59 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, October 19, 2005

Ok so on the reccomendation of a colleague here at work, I installed the MSN IE Tool bar, and the new Microsoft Anti Phishing plugin. I too get a lot of bogus emails phishing from Bank of America, US Bank, Ebay, Paypal, etc. etc. all of which I may have some sort of affiliation. I tend to ignore most of them, but every now and then, I'm almost compelled to believe that one is from a legitimate source. So I figured the plugin and toolbar instal could not hurt.

So I installed it, and wanted to see it work. Simple.... a quick trip to my Gmail spam folder (GMail does an excellent job of notifiying you of what it thinks is a spoofed or bogus email by the way) and there is an email from 'Chase Manhattan' - Oh no I need to reinstate my account... (What account? I closed it a long time ago...) So I figured this would be a perfect test!

I clicked the link, and it was painfully obvious from a technical standpoint. The link was going to some .br address, and was clearly nothing to do with Chase. The acutal page that rendered looked good, and if you were not paying attention to the address bar, it's easy to see how you could be duped.

MSN Toolbar INSTANTLY notified me that this was potentially a fraudulent site, and would not let me enter information. They even put a link in the notification bar to report the site. I thought to myslelf, cool... I'll help them out by agreeing with them and reporting the site. Then this screen came up:

Ok, first a quick explanation of what this is. It's called CAPTCHA, and it's developed to make sure a human is the one entering information into the form, and verifying that it's not a robot or some program doing it. I'm all for that, but this is absurd. Sure, when you really sit and work at it, I guess you can make the numbers and letters out... is that a 1 or an “l” at the start, or is is just noise? Is that a “J” at the end?

The short story? I didn't even bother trying, I've seen so many forms like this, and had trouble 'matching' their letters. I closed the page and said forget it. So here's a capture of a good implementation of CAPTCHA from Scott Hanselman's blog.

 

I'm no Microsoft basher, but you think they would be able to implement an easy, yet effective CAPTCHA implemenation.

 

Wednesday, October 19, 2005 8:55:18 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, September 12, 2005

It's sweet.

I picked one up this weekend, oh man, the form factor is so dang cool. From the pictures online, it looks small, but wait till you hold one. Wow. Simply amazing. Some new coolness:
    * Color screen - view photos too! The 1.5” screen sounds small, but it's amazingly bright and clear.
    * Sync Outlook contacts
    * Sync Outlook calendar
    * Album artwork on screen

The 2 GB model is $199, and 4 GB is $249. The boxed version from Apple even comes with an adapter to retrofit your dock from a 'traditional' iPod allowing the Nano to work with your existing one. Apple thinks of everything.

Monday, September 12, 2005 7:53:02 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, August 24, 2005

Wow is all I can say.  Sure there is Skype, and others... but Google Talk has a nice clean interface, and is simple.  I was up and talking in seconds.

http://www.google.com/talk/

Not sure if it integrates into the sidebar, but you should check it out.

 

Wednesday, August 24, 2005 8:17:29 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |