Author: Soul Solutions Created: Sunday, 6 August 2006
Tips and Tricks as we come across them

johnWeeGo.jpgYes camera phones take pretty aweful photos but i stumbled onto a cool 1/3 effect on the JASJAM while scrabling to take a photo of Darren mountain biking today.

The setting merges 3 quick photos into a single long one blending much of the photo. Since a tiny lense is never going to take pro photos i think ideas like this are great.

mtb 014.jpg

BronwenWeeGo.jpgPicked myself up one of these from Think Geek.  Fitting that goes on the end of a tap that lights up when water goes through it...and temperature sensitive to give red / blue light.

Was a bit worried about the "Not recommended outside the USA"...but it works on my Aussie tap.  YAY.  Will have to wait till night time to get some good pics of it in action.

johnWeeGo.jpgI come across this trick every so often so thought it best to write it down. In the AJAX world it seems this is more and more common, why would i ever want to post back again?

If you have a textbox in a form and when the user presses enter you don't want them submitting that form you can cancel the event in javascript.

Within your MS AJAX js class set a flag to indicate if this object was the one that submitted, then we hook the form submit event and cancel if so.

 


//in your init
this._keyPressHandler = Function.createDelegate(this, this._onKeyPress);
this._VerifySubmitHandler = Function.createDelegate(this, this.VerifySubmit);
        
$addHandler(this._Textbox, 'keypress', this._keyPressHandler);           
$addHandler($get("Form"),"submit", this._VerifySubmitHandler);
////

//two events handlers
    _onKeyPress : function(e) {
        if (e.charCode==13)
        {
            this._submitted = true;
            //do whatever you need to do on enter
        }
    }, 

    VerifySubmit: function(e)
    {
        if (this._submitted)
        {
            this._submitted = false;
            if (e && e.preventDefault) //FF
            {
                e.preventDefault();
            }
            return false; //IE
        }
    },

johnWeeGo.jpgI just booked my flight to attend the Virtual Earth Seminar in Sydney on April 2nd. It is out at North Ryde so if anyone wants to share a cab ride I am flying in on Qantas at 11:15am.

BronwenWeeGo.jpgI needed to turn on content expiration for a single file and wanted to do it through IIS so i didn't have to write code (lazy me).  Cause i'm blind took me a while to find.

To set a single file/directory/website content expiry...

  1. Navigate to the file
  2. Right click and choose properties
  3. Choose HTTP Headers Tab
  4. Click "Enable Content Expiration"
  5. Choose the expiry you want and save

iiscache.JPG

To check it works, run a program like Fiddler, run up the site and navigate to whatever content you turned the caching on for.  Find the item and the Caching should now display something like "Expires, Sun 24 Mar etc"

BronwenWeeGo.jpgI installed Visual Studio Team Suite awhile back and haven't had to use TFS yet.  So now I want to use TFS, there's no "Connect to TeamFoundation Server" option under tools.  After looking at MSDN I discover you have to install Team Explorer.

So first, go download Team Explorer.  You'll quickly discover it's an IMG file.  So if you don't have anything to extract from IMG files, go download something like ISO Buster. Extract and install away.  You should now have Visual Studio Team Foundation Server in the list of source control plug-in's under Tools->Options->Source Control->Plug-in Selection AND a "Connect to Team Foundation Server..." option under Tools.

I found this an odd set of steps to have to do.  Anyone know why you not only have to do an extra download but have to do the weird img extraction process aswell?

BronwenWeeGo.jpgI had a problem where i had a UDF on 2 databases with the same data that were returning different results.

The query that was running was basically:

SELECT COUNT(*) FROM Comment WHERE Date <> NULL

DB1 would give me a results of 3 and DB2 would give me a result of 0. If i ran that SQL in QA on either database i'd get 0.

It drove me nuts for ages, till I realised that the 2 databases had 1 slight difference..the UDF on DB1 had ANSI_NULLS OFF while DB2 had ANSI_NULLS ON.

So in summary, ANSI_NULLS OFF allows you to use the <> null form of a query as above, but ANSI_NULLS ON means the query should be written as follows:

SELECT COUNT(*) FROM Comment WHERE Date IS NOT NULL

As I don't mess with the ANSI settings this one caugt me as I NEVER attempt to use the <> null version.

johnWeeGo.jpgI'm not going to debate the merits and flaws in UAC but here is a tip for those people that use UAC and hate the video mode change that causes that annoying flicker.

In group policy editor - gpedit.msc there is a setting to switch to secure desktop for UAC prompt. Simply disable this. Maybe UAC isn't so bad after all

gpeditUACvideomodes.jpg

johnWeeGo.jpgI am pleased to announce that I will be presenting an evening of Virtual Earth at the April meeting of the QLD MSDN user group.

If you would like to attend please come along.

So does anyone have any specific questions or topics they would covered?

Currently I’m planning to cover the following:

  • Introduction and quick demo of Virtual Earth version 4.
  • How to build a really simple VE site in 10min.
  • The limitations of the 10min site and the architecture of an enterprise Virtual Earth site.
  • ASP.NET AJAX web services and JSON for communication with server side code.
  • Clustering Virtual Earth.
  • OO JavaScript and AJAX.
  • New JavaScript features in the upcoming Visual Studio codenamed “Orcas”.

Visit http://www.qmsdnug.org/ for more information.

5:30pm for 6pm, Tuesday April 17th at Microsoft's Brisbane Office, Level 9, Waterfront Place, 1 Eagle St, Brisbane


 

johnWeeGo.jpgIts been a long time comming but i published today my 2nd revision of the very popular article on clustering virtual earth pins. This revision utilises MS AJAX web services and the server side code is in C#. Full example source code is downloadable from this site.

Read the article here.

Have any questions or comments?

Copyright © 2002-2009 Soul Solutions Pty Ltd. | Login