Pudd makes the web work for you.

Showing: Page 1 of 2 Previous   |  Next 

Windows Azure Websites – updates published, but not being reflected on front end

Posted By: John, 13 December 2012

Sometimes technology throws up frustrating and inexplicable ‘features’ that confound and confuse.

Our early experiences with Windows Azure websites has been pretty care-free, but when we started applying updates to a simple ASP.NET MVC site a week or so ago, we were baffled when nothing changed.

Everything seemed to work as expected… apart from the changes to the website.

Two days of digging later, my colleague Naresh struck gold with the answer. He, being too modest to blog about it himself, kept quiet... so I’ll take the opportunity to steal in!

The solution is simply to restart the site through the Azure portal… but bizarrely for us, this only works before publishing the changes. Quite why this specific chain of events freed us from the out-of-date site version, and what causes the behaviour in the first place, we can only speculate.

Perhaps it was something to do with the imminent (now past) end of the world.

Statement of intent: the beginnings of long some overdue attention on the blog!

Posted By: John, 03 December 2012

In the coming weeks, I’ll be writing about my experiences withthe latest technologies that I've been working... 

In addition to the old faithful ASP.NET Web Forms (now at version 4.5), I'll include the more recent ASP.NET MVC 4, Entity Framework, and NoSQL (specificallyMongoDB). 

These go hand-in-in with working on HTML/CSS, Javascript and jQuery... so I'll pull in some relevant info there when it makes sense to.

There is a lot of info around about these technologiesalready, but the combination of .NET with MongoDB is relatively undocumented,so that may attract a bit more of my attention than other topics.

As usual, my ‘Blogs of Interest’ section contains links to a hugeamount of information provided by industry leaders about these and othertopics, all of which interest me!

The intention will be to make this pretty technical, but I suppose that will depend on your own point of view!

Azure websites supporting asp.net 4.5

Posted By: John, 31 October 2012

Windows Azure websites has become a fond favourite over here, and the addition of asp.net 4.5 support only reinforces that.

If you don't already know, Azure provides extremely easy provisioning and fantastic resilience (and not just on the MS Windows OS).

We've been using it since the summer, and have been very pleased with the results so far!

Find out more about Azure support for asp.net 4.5 at http://www.pudd.co.uk/External-Blogs/10/Posts/6928

Flickr API User Tokens

Posted By: John, 30 May 2011

If you're creating a web app that needs to automatically authenticate with Flickr, without any user intervention, you'll need to supply an API key, secret and user token.

Usually, the user token is generated creating a request to Flickr, sending the user across to the site for them to authenticate and them returning to the site.

If you only want to work with one user, account, you can store the token (in your web.config for example) and reuse it.

This script allows you to connect to enter your application details, takes you through authentication with Flickr and generates your user token.

Flickr API User Token Generator

Eliminate the default doc name in URLS with IIS7 and URL Rewrite

Posted By: John, 16 February 2011

ASP.NET, for all of it's wonder has a habit of throwing a spanner in the works.

Until the relatively recent launch of URL Rewrite Module for IIS7, it wasn't easy to get pages that were linked to as "domain.com\default.aspx" to redirect users to "domain.com".

Why do we want to redirect users from "domain.com\default.aspx" to "domain.com".

Good question! We want to make sure that each page has a single, unique address. This means no duplication of data across numerous pages, so search engines (in particular) recognise the value of that page - plus it makes understanding analytics data much easier.

The easy solution

Microsoft have given us a solution - a module that takes no more than a minute to download and install on a webserver and is easily defined in your web.config to do exactly what we want.

The URL Rewrite Module

You can find out more info on the URL Rewrite Module at iis.net URL Rewrite or download here:

x86 version of the URL Rewrite module
x64 version of the URL Rewrite module

The Code

This is for your web.config file.

            <rule name="Strip Default.aspx Out">
                <match url="(.*)default.aspx" ignoreCase="true" />
                <action type="Redirect" url="{R:1}" redirectType="Permanent" />

treats for tweets on KLM

Posted By: John, 12 February 2011

Dutch airline KLM created a nice feeling for a number of their customers by following their customers on Twitter and rewarding them for promoting the business through Social Media.

YouTube comments questioned why their complaints hadn't been dealt with in such a fashion... which does go to show that these gestures can win fans, but it needs to be a true reflection of the business.

Paged data from SQL Server - An equivalent to MySQL's LIMIT

Posted By: John, 29 December 2010

When SQL queries result in hundreds and then thousands of records being pulled into an application, memory starts to become a real problem, and that hits performance.

It's pretty rare that a user will want to view 40,000 records in one go, so most applications will present the data to a user across a number of pages. So why pull all that data into the application only to show the user a fraction of the records (probably never more than 100 records at any one time)?

Typically, when working with embeded SQL, the application will handle a lot more data than necessary.

Really, we only ever want to call the records that we’re going to display on a particular page.

"Select * from Orders" isn't going to cut it.

Developers working on MySQL have a very easy solution. Limit. We can easily get the specific number of records that we want to display on a page.

This will give us the first 10 records (our first page):

"Select * FROM Orders Limit 10"

This will give us the next 10 (page 2):

"Select * FROM Orders Limit 10, 10"

However developers working with  SQL Server don’t have access to this very handy "Limit" option (that MySQL has been allowing developers to use for as long as I can remember), but there is a simple alternative.

Some of the more up to date Microsoft options (such as Linq-to-SQL), or indeed utilising Stored Procedures, make this a lot easier, but we need to support those applications that didn’t benefit from such “modern advancements”.

And, although it’s not as simple as "Limit", it’s only a few lines of code, and is well worthwhile.

The solution is to run the query by proxy. We can create our normal query, but we won’t run this query ourselves. We’ll ask another query to run it for us, eliminate all of the records that we're not interested in and pass us the ones that we are interested in.

The Query

So, starting with our standard query, we need to make one small tweak. We want to know the index of each row that we’ve retrieved. We can do this by adding an additional column RowNumber  as follows:

SELECT *, ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber' FROM Orders

Note that we need to supply an order by here. This is important, but you can simply use the identity (e.g. OrderID) if needed).

If we run this query, we'll receive the full set of results, with the addition of our new RowNumber column.

Any required filtering should be added to this initial query (such as "Where CustomerID=10"). We want to get a full set of results here.

The Proxy

This is where we start to notice the real change. Below we have a piece of SQL that can be heavily reused.

The following SQL Query will run our requested search through the data and return a subset of the data. Our paged data.

WITH TheTable AS 
(SELECT *, ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber' FROM Orders)
ORDER BY RowNumber

You'll notice our initial query embedded within this larger query. This, along with the numbers (11 & 20) control that data that we get back. The rest is totally generic and will save your application a great deal of memory.

Old OLEDB Site.... "No error message available"

Posted By: John, 30 August 2010

No error message available, result code: DB_E_ERRORSOCCURRED(0x80040E21)

One of the least useful errors I've come across. I came across this whilst making some changes to an old website which was using OLEDB. I restored the DB locally and set it up to user Integrated Security rather than reinstate the permissions from the server.

Apparently this was the problem - rather than using Integrated Security=True in the connection string, to get this working with OLEDB, we need to use Integrated Security=SSPI. A quick change to the web.config file and we're away!

Twitters importance to your social media plans

Posted By: John, 20 August 2010

We predict that Twitter will continue to be a big one to watch in the coming months and years for businesses seeking to engage with their existing customers and to break down the barriers of attracting new ones.

Twitter provides business with the opportunity to easily communicate easily with their audiences and when used effectively it becomes a very powerful component of a digital marketing strategy.

What's more, as Twitter's plans to further itself and develop methods to monetise their platform, opportunities innovative businesses are likely to arise. See what Twitter have to say about it themselves:

"Every day, millions of people use Twitter to create, discover and share ideas with others. Now, people are turning to Twitter as an effective way to reach out to businesses, too.From local stores to big brands, and from bricks-and-mortar to internet-based or service sector, people are finding great value in the connections they make with businesses on Twitter."

If you'd like to find out more about how Pudd.co.uk can help your business make the most of Twitter, including planning, execution & monitoring, please get in touch

Google take steps to help protect mobile app owners

Posted By: John, 31 July 2010

Google have announced a big step forward in helping companies and individuals to protect the software that they develop for Android devices from being illegally copied.

In a recent blog post on the Android Developers Blog, Android developer Eric Chu annouced the new Licensing Service For Android Applications.

The service offers an easy to implement approach to protecting software developed for Android 1.5 and above.

In the meantime, there is still no announcement of when an OS upgrade will be available for my Dell Streak!

SQL Server 2008 "Saving changes is not permitted"

Posted By: John, 22 June 2010

With SQL Server 2008, MS introduced an updated Management Studio tool.

One change within this stops users from making many changes to a database once first saved. Changes, such as adding a new field amongst the existing fields, results in the following message:

"Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created."

The good news, is that in the vast majority of cases, the change that you're trying to perform is entirely harmless. Although the database table may need to be dropped and rebuilt, you'll end up with the data still in the table and working.

Even better news, you can override this behaviour in the MS Management Studio options, by clicking Tools > Options > Designers and unticking (or unchecking, I guess) "Prevent saving changes that require table recreation".

Website speed a big player in user experience

Posted By: John, 16 June 2010

 Whilst I'm at risk of this blog already becoming a homage to Google, I can't resist posting a little more about them.

Make people want your things - Google Style!

Posted By: John, 15 June 2010

Google have marked themselves out as a highly creative and innovative company and the beautiful thing about it is that this runs throughout their entire business.

Their search engine changed the face of the internet and turned them into the most significant operator online, but they have no intentions of stopping there.

The Google Search engine is a great brilliant piece of engineering. However the astounding thing about it is it's success in the marketplace. Google has an incredible brand, developed entirely online through word of mouth and user engagement.

Their most recent offering (at least the most recent one that I've found out about) offers you the ability to search online (through their own mobile phone software) without typing anything.

That's really very nice. The name is pretty nice too. Google Goggles.

But what's even cooler is how they go about telling us about it - and as you might expect, you don't need to read a thing. A charming, simple animation explains what the tool can do and it's hosted, or course on Google Owned YouTube. I've been a devout iPhone user since it launched, but Google have me thinking now!

Take a look at how Google are helping you to understand their easy to use product in an ease to follow video. http://www.google.com/mobile/goggles/#landmark

Google have said the tool will be available on other platforms too.

Fry on Twitter

Posted By: John, 11 March 2010

Stephen Fry speaking about his Twitter phenomenon to .net magazine and potential power it holds! http://www.netmag.co.uk/fry/

Electronic Britian

Posted By: John, 08 October 2009

Watching Micro Men, the story of Sinclair battling with Acorn for supremacy in the early eighties just a few miles down the A11 from us really does make me think!

The idea of what the personal computer was and what it would be.

This weekend, for the first time, England's match will be shown online only. The pubs will be empty, as the Ukraine FA hope to cash in following the failure of Satanta.

It's a really interesting event as the empowerment that the internet brings enables this FA to side-step the traditional broadcasters and take 100% of the revenue by selling directly.

The interesting thing to see will be whether this achieves the level of viewers that an England internation would typically achieve. Do football fans want to gather around a computer and pay to watch the match online.

Is the infrastructure that the organisers have in place substantial enough to sustain the one million concurrent users that it plans to? How will our local networks handle the load?

It will tell us a great deal about the current position of the internet and where it might go soon - probably somewhere very different to where Sir Clive Sinclair imagined it would be!

Showing: Page 1 of 2 Previous   |  Next 
John Puddifoot - eCommerce Project Manager, Architect, and Application Developer