Saturday, December 11, 2010
Error 80020006 on WP7 InvokeScript on the WebBrowser
Thursday, December 09, 2010
Switching to Azure SDK 1.3
Tuesday, December 07, 2010
If you're fiddler POST posts aren't correctly getting the form variables...
Wednesday, December 01, 2010
My "presentation" to the Windows Phone User Group
Tuesday, November 30, 2010
Marketplace advice for WP7 Windows Phone 7
2) Know your iconography.
3) Support Information – Test Case 5.6.
4) Toast Notification – Test Case 6.2
5) Applications Running Under a Locked Screen – Test Case 6.3
6) Back Button – Test Case 5.2.4
7) Themes – Test Case 5.1.1
8) Languages.
9) Failures upon Upload to the Marketplace
10) Windows Phone Developer Tools.
Sunday, November 28, 2010
Razor MVC3, a file upload form
Razor, MVC3 - a readonly textbox
Saturday, November 27, 2010
Ssssshhhh - don't tell anyone but I'm enjoying web dev with ASP.Net MVC3 and Razor
Thursday, November 25, 2010
Getting Windows Phone 7 development working
Wednesday, November 24, 2010
Razor outputting raw unescaped HTML.. ASP.Net MVC3
JQuery - responding to selected tab using tabselect
Awesome comparison of the costs and benefits of Azure versus AWS
Monday, November 22, 2010
PivotViewer, shared images and memory problems
I've spent a large chunk of the last weekend playing with the Silverlight PivotViewer from Microsoft.
- if you create a .cxml collection in which items don't each have unique images (e.g. they share a default image) then the Silverlight control does something odd - it somehow seems to try to duplicate the shared images and uses up lots of CPU and memory as a result.
To recap:
- the bug is for collections where <Item>s share img references.
- if I load up one of these collections in the standalone viewer these work fine
- the load is smooth and the memory use is expected.- if I load up the same collection in the silverlight pivotviewer then the items with shared images
take a long time to display (they pop into the display one by one) and the memory use is higher
- it increases with each image loaded.You can just about see this effect if you watch the swimmer icons when you first load up:
- using standalone pivotviewer on - http://zoom.runsaturday.com/out.cxml
- silverlight control in browser - http://zoom.runsaturday.com/
The effect is really really noticable when you get to larger data sets
Sunday, November 21, 2010
Numpty Silverlight DataBinding continues....
Some hacky fixes to PAuthor PivotViewer library
Overall the PAuthor project for creating PivotViewer for Silveright datasets works great - I've used in in .Net4 for 4 separate command line apps :)
However, when working on some large data sets (around 75000 Items) I found the following problems - mostly to do with corrupt items in my input.
Hope this post helps other people...
Problems seen in collectionCreator.Create(m_dziPaths, m_dzcPath); in ParallelDeepZoomCreator.cs
- System.ArgumentException in ParallelDeepZoomCreator.cs due to problems in my item names (some of my names included the "*" wildcard character - doh!
- And System.IO.FileNotFoundException in ParallelDeepZoomCreator.cs due to unknown problem (no real clue why these particular folders didn't exist - it was 8 out of 75000...)
To fix these I just wrapped the call with:
List<String> toRemove = new List<string>(); foreach (var c in m_dziPaths) { try { System.Security.Permissions.FileIOPermission f = new System.Security.Permissions.FileIOPermission( System.Security.Permissions.FileIOPermissionAccess.AllAccess, c); } catch (ArgumentException exc) { toRemove.Add(c); System.Diagnostics.Trace.WriteLine("INVALID PATH " + c); } } foreach (var c in toRemove) { m_dziPaths.Remove(c); } while (true) { try { DZ.CollectionCreator collectionCreator = new DZ.CollectionCreator(); collectionCreator.Create(m_dziPaths, m_dzcPath); break; } catch (System.IO.FileNotFoundException exc) { System.Diagnostics.Trace.WriteLine("STUART - SORRY - REMOVING " + exc.FileName); m_dziPaths.Remove(exc.FileName); } }
Some multithreaded problem seen in image download
The finalizer for PivotImage.cs occasionally sees IO exceptions in the File.Delete operation - the exception claims that the fie is currently open in another process.
Not sure what is causing this - my guess is it's a multithreading issue of some description.
To fix (mask) this I simple added a try catch to the finalizer:
~PivotImage() { if (m_shouldDelete == false) return; if (File.Exists(m_sourcePath) == false) return; try { File.Delete(m_sourcePath); } catch (IOException) { System.Diagnostics.Trace.WriteLine("Some clean up needed " + m_sourcePath); } }
That's it - hope it helps someone.
Saturday, November 20, 2010
Using the Silverlight PivotViewer Control and seeing NotFound when deployed on IIS
you deploy to a full IIS server you see "NotFound" reported for your
collection, then...
Make sure you've set the mimetype for .cxml, .dzi, .dzc all as
text/xml within IIS for your current website.
Worked for me :)
Helpful suggestion found on :
http://forums.silverlight.net/forums/p/194861/452655.aspx
Friday, November 19, 2010
Silverlight compressed binary serialization
As part of this app I needed to send some fairly chunky bits of data to the client. To do this I used http://whydoidoit.com/silverlight-serializer/ and http://slsharpziplib.codeplex.com/
Thursday, November 18, 2010
More problems with SQL Azure backup
Tuesday, November 16, 2010
A look at some Silverlight control libraries
- Telerik - have a huge set of controls including rich text editing, super framework libraries (like containers and transitions), and lots and lots of charting. I've attended a couple of their webinars and clearly they've got good functionality now, plus lots more coming every quarter.
- Infragistics - a fairly large set of functionality again including grids, menus and a docking framework
- Dundas - seems to be mainly focussed on Business Intelligence (BI) dashboards - so lots of charts.
- Actipro - a much smaller set of functionality focussed around an MsDev like code editor.
Tuesday, November 02, 2010
Serialising Enums with Newtonsoft JSON.Net
public class JsonEnumConverter<T> : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType == typeof(T);
}
public override void WriteJson(JsonWriter writer, object
value, JsonSerializer serializer)
{
writer.WriteValue(((T)value).ToString());
}
public override object ReadJson(JsonReader reader, Type
objectType, object existingValue, JsonSerializer serializer)
{
return Enum.Parse(typeof(T), reader.Value.ToString());
}
}
This allowed me to serialize/deserialize using attributes like:
[JsonObject]
public class MyClass
{
[JsonConverter(typeof(SerializationUtils.JsonEnumConverter<DateTimeTestFormat>))]
public DateTimeTestFormat DateTimeTestFormat { get; set; }
}
However, eventually I worked out that I could just use a more general
solution - and that I could pass that in to the top-level JsonConvert
methods:
public class GeneralJsonEnumConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType.IsEnum;
}
public override void WriteJson(JsonWriter writer, object
value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override object ReadJson(JsonReader reader, Type
objectType, object existingValue, JsonSerializer serializer)
{
return Enum.Parse(objectType, reader.Value.ToString());
}
}
Much easier... :)
Monday, November 01, 2010
Some practical experience of GPS battery life for Sports Tracking apps
>> What's the impact on the battery when doing frequent GPS resolutions?
The answer is battery life varies dependent on phone...
On an iPhone you have to really mess about to improve battery life -
the only way of doing it on older phones is to start playing out audio
(e.g. a playlist) - then you can turn the screen off but still keep
your app alive and capturing GPS.
On my WM6.5 Omnia II, it's easy to keep the app/GPS alive but to save
some power. If I do that and still monitor the GPS, then up to 6 hours
battery life is OK - so pretty good.
On a Bada Wave, there's a SYSTEM_SERVICE level call to make so that
the app can carries on even when the screen is off - locked I can
manage 3-4 hours easy - not tried any longer yet - but suspect 6 is
about the current limit.
On my Nokia 5800, it seems that the Nokia ST app managed 2-3 hours OK
- not tried it any longer.
On Android, it's too early for me to say - but I know that the Google
MyTracks app can manage long sessions - 6 hours+ - although they do
have some sample-rate dropping code to do that - basically it depends
what your activity is:
- if you're walking, then you can probably get away with sampling only
every few minutes
- but if you ever want to do turn-by-turn directions in a car, then
you'll need to up the sampling rate to something much more frequent.
Friday, October 29, 2010
PDC 2010 Updates - First Look
Wednesday, October 27, 2010
How to do "TOP N" in nhibernate's query language
Seems like you can't - so instead you have to use:
- SetMaxResults(N)
on the IQuery object.
With help from:
http://stackoverflow.com/questions/555045/nhibernate-hqls-equivalent-to-t-sqls-top-keyword
Tuesday, October 26, 2010
The 5 second guide to adding WCF Client code
Tuesday, October 19, 2010
Converting datetimes to just the date (and to pretty text) in SQLServer
Monday, October 18, 2010
Parsing DateTime's into UTC
Friday, October 15, 2010
Datetime comparison for Azure Table Storage REST API
Wednesday, October 13, 2010
Get a RelativePath string
Test if a path is a Directory?
Monday, October 11, 2010
If you see Error 32 Internal Compiler Error: stage 'COMPILE' ....
If you're looking for quick and effective free training on M$oft tools
Sunday, October 10, 2010
If you are using AutoFac and you see... "are you missing a using directive or an assembly reference" when using AutoFac
'Autofac.ContainerBuilder' does not contain a definition for 'RegisterAssemblyTypes' and no extension method 'RegisterAssemblyTypes' accepting a first argument of type 'Autofac.ContainerBuilder' could be found (are you missing a using directive or an assembly reference?)
or....'Autofac.ContainerBuilder' does not contain a definition for 'RegisterInterface' and no extension method 'RegisterInterface' accepting a first argument of type 'Autofac.ContainerBuilder' could be found (are you missing a using directive or an assembly reference?)
Friday, October 01, 2010
Back to basics - simple Azure table test results part 2
UpdateConditionNotSatisfied | Precondition Failed (412) |
Back to basics - simple Azure table test results
Thursday, September 30, 2010
Azure Storage Performance
From a presentation by Brad Calder - Microsoft PDC 2009
Per Object/Partition Performance at Commercial Availability
Throughput
Single Queue and Single Table Partition
Up to 500 transactions per second
Single Blob
Small reads/writes up to 30 MB/s
Large reads/writes up to 60 MB/s
Latency
Typically around 100ms (for small trans)
But can increase to a few seconds during heavy spikes while load balancing kicks in
Tuesday, September 21, 2010
A really good explanation of SQL Server and indexes
Sunday, September 19, 2010
When your SQL log (ldf) file gets Huge...
Do you make transaction backups?
Yes -> Do not shrink the log unless you have done some exceptional operation (such as a massive delete) as the "cost" of SQL Server re-growing the Log file is significant, and will lead to fragmentation and thus worse performance.
No and I don't want to -> Change the Recovery Model to "Simple" - Enterprise Manager : Right click database : Properties @ [Options]
Don't know -> Transaction log backups allow you to recover to a "point in time" - you restore the last Full Backup (and possibly a subsequently Differential backup) and then every log backup, in sequence, until the "point in time" that you want to roll-forward to.
Saturday, September 18, 2010
Timing tests on Azure
Friday, September 17, 2010
Azure Storage Tools
Windows Azure Storage
Explorer
Block Blob
Page Blob
Tables
Queues
Free
X
Y
Azure Blob Compressor
Enables compressing blobs for upload and download
X
Y
X
Y
X
X
X
Y
X
X
X
Y
Cerebrata Cloud Storage Studio
X
X
X
X
Y/N
X
X
Y
Clumsy Leaf Azure Explorer
Visual studio plug-in
X
X
X
X
Y
X
Y
X
N
MyAzureStorage.com
A portal to access blobs, tables and queues
X
X
X
X
Y
X
Y
X
X
X
X
Y
Azure Links
Credit to Neil Mackenzie for this list - fromhttp://nmackenzie.spaces.live.com/blog/cns!B863FF075995D18A!706.entry
Azure Team
http://blogs.msdn.com/b/azuredevsupport/ – Azure Support Team
http://blogs.msdn.com/b/dallas/ – Microsoft Codename Dallas
http://blogs.msdn.com/b/sqlazure/ – SQL Azure Team
http://blogs.msdn.com/b/cloud/ - Windows Azure Developer Tools Team
http://blogs.msdn.com/b/windowsazurestorage/ – Windows Azure Storage Team
http://blogs.msdn.com/b/windowsazure/ – Windows Azure Team
Individual
http://blogs.msdn.com/b/partlycloudy/ – Adam Sampson
http://bstineman.spaces.live.com/blog/ – Brent Stineman (@BrentCodeMonkey)
http://blog.structuretoobig.com/ – Brian Hitney
http://channel9.msdn.com/shows/Cloud+Cover/ – Cloud Cover (@cloudcovershow)
http://www.davidaiken.com/ – David Aiken (@TheDavidAiken)
http://davidchappellopinari.blogspot.com/ – David Chappell
http://geekswithblogs.net/iupdateable/Default.aspx – Eric Nelson (@ericnel)
http://gshahine.com/blog/ – Guy Shahine
http://blogs.msdn.com/b/jmeier/ – J.D. Meier
http://blogs.msdn.com/b/jnak/ – Jim Nakashima (@jnakashima)
http://blog.maartenballiauw.be/ - Maarten Balliauw
http://nmackenzie.spaces.live.com/blog/ Neil Mackenzie (@mknz)
http://azuresecurity.codeplex.com/ - Patterns & Practices: Windows Azure Security Guidance
http://oakleafblog.blogspot.com/ – Roger Jennings (@rogerjenn)
http://dunnry.com/blog/ – Ryan Dunn (@dunnry)
http://scottdensmore.typepad.com/blog/ – Scott Densmore (@scottdensmore)
http://blog.smarx.com/ - Steve Marx (@smarx)
http://blogs.msdn.com/b/sumitm/ - Sumit Mehrotra
http://azure.snagy.name/blog/ – Steven Nagy (@snagy)
http://blog.toddysm.com/ - Toddy Mladenov (@toddysm)
Azure Status
http://www.microsoft.com/windowsazure/support/status/servicedashboard.aspx – Azure Status
Other Clouds
http://highscalability.com/ – High Scalability
http://perspectives.mvdirona.com/ – James Hamilton
http://www.allthingsdistributed.com/ – Werner Vogels