Google App Engine logoRecently I turned my interest at content delivery networks (CDN) and found a plethora of blog posts both praising and bashing Google App Engine as a CDN. This is the first post in a series of posts I will publish discussing Google App Engine as a CDN.

Google App Engine wasn’t created to be a CDN provider, but it does have CDN capabilities. Some posts argue that App Engine is not a real CDN, others describe how to utilize it as a CDN. Just Ping is a service that will ping/resolve domain names from 41 different locations. Pinging my App Engine results in 12 different IP’s over the world!

Misinformation published about App Engine

Google App Engine was first released as a beta version in 2008. There are a number of posts detailing problems and restrictions in App Engine. Most of them were published around the launch and I started looking into App Engine a couple of weeks ago. Here are some fact corrections:
The facts, the API details and code »

ASP.NET – Automatic CSS and Javascript versioning

27 Mar 2010 In: ASP.NET, EPiServer

Letting browsers cache files is a great way to improve your page load speed but also to reduce your bandwidth usage and ultimately save some money. It’s a win-win situation! Yslow recomends that files are cached at least 2 days, Googles Page Speed recommend 30 days. However, letting visitors cache css and javascript files can cause problems if/when you need to update those files but wouldn’t it be awesome to add an infinite cache timeout as long as the file doesn’t change? The solution to allow long term caching and still be able to make changes is to change the name of your file(s) every time you make a change, another is to append a querystring parameter to the url making it “new”. Manual changes are always tedious and tend to fail sooner or later, so wouldn’t it be nice if versioning was totally automated?

When I’ve pondered the problem of automating versioning of page includes I’ve come up with the following two reasonable ways to do it:

  1. Let the application handle the versioning during runtime.
  2. Create a build script that will look for css and javascript includes inside the aspx/ascx files and attach unique version numbers to them.

Alternative one makes the most sence to me, it’s pretty easy to implement, it will have minimum performance impact and it will allow for more control than having a build script update the code.
Keep reading & download code »

The iPhone (and now iPad) SDK supports reverse geocoding out of the box. Reverse geocoding means you have a coordinate and want to find out where you are located, for instance, the name of the street you are on. Forward geocoding means you know the name of a location and want to find the coordinates. For reasons not totally clear to me there’s no support for forward geocoding, I’ve read somewhere that it has something to do with license deals.
I’ve started working a little with the iPad simulator and with its large display it makes sense presenting information on a map view. Because I haven’t found a good example/API for forward geocoding I’ve decided to publish my own. There are a few players offering geocoding services, Yahoo, CloudeMade, Tele Atlas and of course Google. Yahoo and Google are both free but I’ve decided on using Google.

This sample iPad application contains a search bar and a large UIMapView. Search results are visualized on the map with a placemark and by clicking the placemark the map will zoom to the viewport returned from the geocoding service. When I started working with the geocoding service it was still in version two, this last week Google launched version three. Version two will be depricated of course but I had already written the parser for version two so I’ve included it as well in my sample. Of course the API works for iPhone as well. Because the API contains quite a lot of code you will find the code inside the sample project at the bottom of this page.

Forward geocoding APi for iPad and iPhone

More about the API and download the code »

Fixing IE8 XForms support for EPiServer 4.x

13 Feb 2010 In: Development, EPiServer

If your EPiServer site is running a version older than CMS5 R2 and you (or your clients) are using Internet Explorer 8 you’re having problems creating XForms. There are multiple issues with XForms in versions prior to CMS5 R2 that can be somewhat confusing. A form created with IE6 will work for a visitor using IE8, a form created with IE8 will not work for anyone. If you use IE8 you cannot save your form if it contains radio buttons or checkboxes. There is a posts on EPiServers forum where Vladimir Ljepoja claims a solution for EPiServer CMS 5 R1 SP2 and DropIT has published a blog post on how to fix the problem for EPiServer CMS 5 RC1.

I’ve investigated this problem thoroughly and found the reason why IE8 is causing problems and how you can solve it for all versions of EPiServer. This work is based on investigations in EPiServer 4.61.5.

What’s causing the problem?

When I started investigating this problem I obviously started in font-end with javascript debugging. The XForms editor javascript code is in a file named xformedit.js which is located at different places depending on your EPiServer version. For 4.6.1 it’s located in util\javascript. What’s causing the problem on the front-end is this line of code:
Keep reading and find out »

Enable auditing in WSS 3.0

24 Jan 2010 In: Sharepoint

Microsoft Windows SharePoint Services 3.0 includes the same powerful infrastructure for auditing user access to list items, and documents and pages included in MOSS. The only difference in auditing functionality between MOSS and WSS is that the UI for configuring and viewing audit trails has been removed. Microsoft provides information and code on MSDN on how to programmatically activate the audit functionality.

SharePoint offers auditing for the following events:

  • Viewing
  • Updating
  • Copying
  • Moving
  • Deleting
  • Check In
  • Check Out
  • Searches
  • Workflows
  • Undeleting
  • Security Changes
  • Profile Changes
  • Schema Changes

Fortunately, you don’t need to write the code yourself because some guys has already published an excellent feature on Codeplex that enable the functionality: http://wssaudit.codeplex.com/. The current release from May 5th 2009 is listed as alpha 2, but don’t let the alpha version label fool you, this feature work great. The screen shots below are taken from my environment.

Enabling gzip compression is an easy way to make your site load faster, but how do you go about doing so for your EPiServer site and why should you?

Gzip compression will reduce the size of a text file (such as html markup, css, js and files) up to some 90%. If your user is on a slow connection, reducing the size of data does make a difference. The number of users on “slow” connections are actually growing by every sold smart phone and mobile broadband connection. Here’s a real world example:

 Content Uncompressed  Compressed 
Markup 40kb 40kb
CSS 104kb 18kb
JS 368kb 119kb
Toal 512 kb 177 kb

Gzip will typically compress a text file around 65-90%. In this example this example we reach an average compression of about 70% for the static content. A web page usually contains more CSS and JavaScript content than the size of the specific pages’ markup. Although, this is only true for the initial page the user visit, for subsequent page views the visitors’ browser has already cached the static content making page markup the biggest part of text content.

If you’re on a broadband connection, meaning 2mbit+ and not including wireless broadband, downloading the page (ignoring images) uncompressed will take less than 2 seconds. If you’re on a slower connection however, say, 0.2-0.5 mbit, it will take about 7-10 seconds. With compression enabled a mobile user with not optimal coverage (which seems more common than good coverage with Telia) you can save some 5 seconds which is significant if you’re that user. There’s another aspect to compression aswell. Say you run a large site with 100.000 unique visitors per day, by reducing at least the first page view by 330kb that reduce your daily traffic with a whopping 3,9Gb of data!

Compressing the markup will reduce the size for each request but because the markup is generally not very big the download time improvement will not be as significant. Compressing dynamic content will also use up more server resources for each page view. IIS will store/cache compressed static files on disk at first request so the impact of compressing static files is minimal.

Here’s an old but still very informative blog post by Yahoo on front end optimization.

How to enable compression »

DataFormWebPart – Getting the workspace URL

21 Jan 2010 In: Sharepoint

I recently banged my head against this one. I wanted a list of past meetings and another list for upcoming meetings in my meetings workspace. The calendar is picked up from the parent site using a DataFormWebPart and the “Connect to another library” function. This was all well and good, however, I needed the workspace url to link to the other meeting workspaces. With the list connected there is a field in the data source named Workspace, but that’s a boolean and there is no url to be found. Looking at the Xpath in SharePoint Designer for that field it points to @WorkspaceLink. The trick is to add the property “IncludeHidden” to the SPDataSource object for the web part and find the url by selecting @Workspace.

sharepoint-designer-errormsg
Unfortunately, SharePoint Designer will throw an error at you for doing this when the list is not located in the same site as your webpart. But the end result in SharePoint will be glorius.

Here’s an example of how to display a link:

<a href="{substring-before(@Workspace, ',')}" title="{@Title}">
    <xsl:value-of select="ddwrt:FormatDateTime(string(@EventDate) ,1033 ,'M/d/yyyy ')"/>
</a>

past-upcoming-meetings
Nice, huh?

Exchange 2010 – iPhone ActiveSync issue

9 Jan 2010 In: iPhone

This week we finally got around to upgrade our old Exchange 2003 server, fortunately we waited a few extra months and skipped Exchange 2007 for 2010. The upgrade was handled by our friendly neighbor and also our new ISP: DGC. We did encounter one problem after the upgrade that I assume others will face as well. Some accounts, mine included, couldn’t get the iPhone ActiveSync to work, it worked before the migration to 2010.

Cannot get mail. The connection to the server failed.

After the migration it didn’t. I tried the test service from Microsoft: Microsoft Exchange Server Remote Connectivity Analyzer and it clearly indicated that something was wrong with my account but suggested it had something to do with forms authentication being enabled, which it wasn’t. I found this error message in the event log on our new Exchange 2010 server:

Exchange ActiveSync doesn’t have sufficient permissions to create the “CN=Björn Sållarp,OU=Users,OU=Avantime Development,OU=Avantime Production,DC=avantime,DC=local” container under Active Directory user “Active Directory operation failed on KELLY.avantime.local. This error is not retriable. Additional information: Access is denied.
Active directory response: 00000005: SecErr: DSID-03151E04, problem 4003 (INSUFF_ACCESS_RIGHTS), data 0
“.
Make sure the user has inherited permission granted to domain\Exchange Servers to allow List, Create child, Delete child of object type “msExchangeActiveSyncDevices” and doesn’t have any deny permissions that block such operations.

Details:%3

Right.. This basically means the account lack permissions in the Active Directory. I figured out that because my account has been added to what’s called a “protected group” such as Domain Admins the setting for my account to inherit permissions has been removed by Active Directory. This excellent blog post explains how to get the inherited permissions back. http://www.ffoutpost.net/2009/11/10/resolve-issues-with-activesync-not-working-in-exchange-2010 remember to remove the account from the protected group before you enable inheritance, otherwise inheritance will be removed again by Active Directory within an hour or so.

About this blog

With this blog I try to provide useful tips and solutions for programming .NET, Objective-C and more. My name is Björn Sållarp, and I love writing code.


All blogposts are written on a mac!  Avantime - Strategic IT solutions
Blogg listad på Bloggtoppen.se    BlogRankers.com
WP-Highlight