All Meshed Up

by Jack 6/4/2008 9:27:17 PM

Well, I finally got my Live Mesh invitation! I signed up to the waiting list a couple of weeks ago, so it's not been that long actually. After reading several articles and blog posts about Live Mesh, it's cool to be able to try it out. I must say that, so far, it's very impressive. The installation and set up, on a Vista Ultimate laptop, went without a hitch and I'm already happily synchronising away. The integration with Vista is so seamless that I've found myself looking at a meshed up folder and haven't been able to work out if I'm looking at the online version or the local version – they look identical until you look at the file path.

So it's goodbye to Groove 2007, which I'd been using to synchronise files between machines. I always felt that Groove was a bit of overkill for what I needed anyway and the fact that there is no 64 bit support really was the final nail in the coffin.

Also, I must admit that I still haven't got my head around all the stuff that Live Mesh can do. I do know that the folder synchronisation and the online storage is really just an example of what the platform is capable of. I can't wait until the mobile version comes out. I know a lot of people knock Microsoft, but you've got to hand it to them, they keep on churning out great software at a staggering rate.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

Detect IE7 And Newer Browsers With JavaScript

by Jack 4/4/2008 9:48:00 AM
Here's a neat way to detect IE7 and newer browsers with JavaScript that should be future proof as well:

if (!(window.XMLHttpRequest)) {
//do stuff for IE6 and older browsers here
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

Block Clicking On Google AdSense By IP Address

by Jack 3/7/2008 7:29:09 PM

So, we all know it's a bad thing to click on your own AdSense adverts right? Well, what if you are in an office and you all share the same IP address and you know you shouldn't click on the AdSense links but other people don't realise it. Or maybe you want to block someone who is maliciously clicking on your links, trying to cause trouble between you and Google. Here's a way to block users from an IP address from clicking on the AdSense links on your site. It uses ASP.NET and VB.NET, but the principle could be used in other languages.

First of all create a .js file with the following code and call it adsense_blocker.js:

 

// attach function

attachOnloadEvent(adsenseBlockInit);

 

//do we have adsense?

function adsenseBlockInit() {

 

    var el = document.getElementsByTagName("iframe");

    for (var i=0; i<el.length; i++) {

        if (el[i].src.indexOf('googlesyndication.com') > -1) {

 

            el[i].onmouseover = adsenseBlock;

        }

    }

}

 

// when moving mouse over adsense show alert for current ad unit

function adsenseBlock() {

alert('Clicking on Google AdSense advertisements has been blocked!');

}

 

// attach function to window onload event

function attachOnloadEvent(func) {

    if(typeof window.addEventListener != 'undefined') {

        

        window.addEventListener('load', func, false);

    } else if (typeof document.addEventListener != 'undefined') {

        

        document.addEventListener('load', func, false);

    } else if (typeof window.attachEvent != 'undefined') {

        

        window.attachEvent('onload', func);

    } else {

        

        if (typeof window.onload == 'function') {

            var oldonload = onload;

            window.onload = function() {

                oldonload();

                func();

            };

        } else {

                window.onload = func;

        }

    }

}

 

This code will attach a mouseover event to any AdSense units you have on the page that shows the user an alert box. We don't want to block all users though, so create a default.aspx, paste your AdSense code in the page and then add the following code to your code behind file:

 

Imports System.Net.Dns

 

Partial Class _Default

Inherits System.Web.UI.Page

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then

 

Dim strHostName As String

Dim strClientIPAddress As String

Dim strIPAddressToBlock As String

 

'ip address we want to block

strIPAddressToBlock = "0.0.0.0"

 

'get user's ip address

strHostName = GetHostName()

strClientIPAddress = GetHostAddresses(strHostName).GetValue(0).ToString()

 

'register .js file if necessary

If strClientIPAddress = strIPAddressToBlock Then

ClientScript.RegisterStartupScript(Me.GetType(), "adsense_blocker", "<script type=""text/javascript"" src=""" & Request.ApplicationPath & "/adsense_blocker.js""></script>")

End If

 

End If

End Sub

 

End Class

 

Test it out by adding your IP address (look at the strClientIPAddress variable to find it) and you should find that you can't click on any AdSense links. Change the IP address and you should be able to mouseover the AdSense units without getting the alert box. Remember not to click on them though! The good thing is that you don't have to change any of the Google code, as that's against their terms and conditions as well.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

IE6 And PNGs With ASP.NET

by Jack 2/2/2008 12:58:08 PM

Here's a little bug that caught me out. Looking at one of my new sites that has transparent PNG images in IE6, I was surprised to see that the transparency just doesn't work. It's a well documented bug in IE6 apparently with several work fiddly work arounds. No problem with .NET though – just create GIF file versions of the PNG files and swap the images over if the user is browsing the site with IE6:

If Request.Browser.Browser & Request.Browser.MajorVersion = "IE6" Then

imgLogo.Src = "images/logo-ie6.gif"

End If

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

Microsoft Action Pack Web Solutions Toolkit

by Jack 1/24/2008 10:29:21 AM

The eagerly awaited Microsoft Action Pack Web Solutions Toolkit turned up yesterday. Included in the kit are various pamphlets and three DVDs - Visual Studio 2008 Standard, Expression Studio and a "Custom Web Development Jumpstart" DVD, which is basically full of documents and presentations about all the latest Microsoft technologies, such as ASP.NET AJAX and Silverlight. There's one licence each for VS 2008 and Expression Studio, which I'm looking forward to having a play with. There's also a big round Silverlight sticker in the pack. Hmm, where's that gonna go – on the office window, the laptop, my forehead?

If you're running a small software development business using Microsoft technologies then it makes sense to subscribe to the Microsoft Action Pack. For a flat annual fee you get access to all the latest software, such as Office 2007, Vista Business and SQL Server 2005, for internal business use, development and testing. To qualify, you just need to sign up as a partner and pass an online course in your area of expertise. If you mainly do web development then you'll also get this toolkit.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

.NET Security Patch Issue

by Jack 1/17/2008 4:35:16 PM

Beware of the security update for .NET 1.1 - KB886903 . I've just spent several hours trying to work out why my machine running VS.NET 2003 and .NET 1.1 on Windows XP Pro SP2 suddenly started to return the following error every time I tried to launch a site in debug mode from Visual Studio: Error while trying to run project: Unable to start debugging on the Web server. Could not start ASP.NET or ATL Server debugging. Verify that ASP.NET or ATL Server is correctly installed on the server. If the site is launched without debugging then ASP.NET returns a 404 error page. Very strange. After much head scratching and trying various workarounds I uninstalled and reinstalled the .NET Framework 1.1, then installed SP1 for the Framework and, hey presto, everything started working again. However, Windows Update then prompted me to install the security update, which I did, restarted the machine and, lo and behold, all the errors were back again. That kind of gave it away. I uninstalled the KB886903 update and now it's all up and running. I'm yet to find a workaround for installing the update without breaking ASP.NET.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

Visual Studio 2005 Express Editions

by Jack 1/17/2008 4:32:04 PM

Now that VS 2008 is out all the main Microsoft download pages are, logically enough, offering the 2008 express editions. If you are still looking to download one of the 2005 editions, as I was today, then they are still available here. I guess Microsoft will remove that page sooner or later, but it works at the moment.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Category: Web Development

Powered by BlogEngine.NET 1.3.1.0

About Me

Jack And Cheryl At The Seaside I write songs, build websites, play piano...


E-mail me Send mail

Calendar

<<  September 2008  >>
MoTuWeThFrSaSu
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

View posts in large calendar

Pages

Recent posts

Recent comments

  • HACK3D (1)
    Jack wrote: Hey! I'm touched that anyone would bother to hack … [More]

Tags

Don't show

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in