BKStart a conversation ↗

Writing / Archive

Notes from close to the system.

Seventeen years of working notes on architecture, distributed systems, and now AI — written while building, not after.

All posts

276 posts
  1. The Terminal Was the Gateway Drug. Now the GUI Is Making a Serious Case.

    Coding agents made the terminal feel like the natural place to work. Their new desktop apps are making the graphical alternative harder to dismiss. I am not done choosing.

  2. Do You Still Need to Write the Agent Loop? AgentCore Harness vs. Runtime

    AgentCore's managed harness turns the agent loop and everything around it into configuration. Here is the one question that decides whether that's for you, and the four rows in the feature grid that answer it.

  3. The Tool Call the Model Can't Make: Strands Hooks as Guardrails

    A system prompt is a request. A Strands hook is a rule. Where to put the checks your agent must never talk its way past, and how cancel_tool, interrupts and retry fit together.

  4. Stop Re-Reading the Book: Prompt Caching in Strands

    Every model call in an agent loop re-sends the whole conversation. Bedrock prompt caching is a bookmark that stops you paying full price for it — here's what Strands does with one line of config, what it doesn't, and the six ways to break it silently.

  5. Give Your Agent a Voice

    Adding speech to a Strands agent with ElevenLabs Speech Engine — what it is, where the seam goes, and how little code it takes to get a voice agent running.

  6. Your Python Private Is a Post-it Note

    You are building something that runs code you did not write. A plugin host. A notebook kernel. An AI agent with a Python tool. The untrusted side needs to call your API, so you hand it a client object with the credential…

  7. Workflow, Graph or Swarm? Choosing a Strands Multi-Agent Pattern

    AWS's Strands Agents SDK gives you three ways to make several agents work on one problem: Workflow, Graph and Swarm. The documentation has a comparison table with nine rows, which is thorough and — the first time you…

  8. How This Site Was Built (And Why Web Design Just Changed)

    The site you're reading this on is new. Set aside the obvious narcissism of a site whose homepage is five video chapters of me walking around — I'll come back to that — because the interesting part isn't the result. It's…

  9. When Open Source Goes Wrong

    Over the past few months, I’ve been reflecting on my experience creating OpenHPSDR‑Zeus, and more broadly, what it means to build software in the age of Generative AI. This isn’t intended to criticise any individual or…

  10. Agentic Coding and the Erosion of Competitive Advantage

    I spent a couple of evenings over the last month or two building Log4YM — a modern, cross-platform logging application for amateur radio. Dockable panels, real-time DX cluster, interactive 3D globe, AI-powered talk…

  11. Building a Visual Workflow Designer with Angular 19

    I recently built a visual workflow designer — a node-based canvas where you wire together processing steps to compose data pipelines. It's the kind of tool you see in platforms like Node-RED, Apache NiFi, or n8n, but…

  12. AI Does What I Tell It

    AI is transforming software engineering - not by replacing engineers, but by reshaping their role. Understanding where AI excels and where it struggles is the key to leveraging this powerful technology.

  13. Embracing The Terminal: My Unexpected Journey from IDEs to the Command Line

    A New Beginning It's a new year, and for me, it's the dawn of a new era in how I interact with my machine. When I made the switch to macOS in 2025, I didn't anticipate it would spark such a fundamental change in my…

  14. Building RotatorControlWeb: 3D Visualization for Ham Radio Antenna Control

    Introduction As a ham radio enthusiast, precise antenna positioning can make the difference between a clear contact halfway around the world and static. Traditional rotor controllers, while functional, often rely on…

  15. Simplifying SSH

    How to SSH into a Linux Machine from macOS Without Typing Everything Every Time If you're tired of repeatedly typing ssh user@host and entering your password every time you connect to a Linux machine from macOS, there's…

  16. Using AI to Develop Applications End-to-End – A PileupBuster Showcase

    Introduction In this post, I want to share some reflections on how artificial intelligence can accelerate and enhance the full lifecycle of app development, using my recent project, PileupBuster, as a showcase.…

  17. Understanding AWS Lambda Concurrent Execution Quota

    A comprehensive guide on AWS Lambda concurrent execution quota, how to increase it, and best practices for managing reserved capacity.

  18. Ensuring S3 Files Update with Terraform: The Power of etags

    The Challenge with S3 File Updates in Terraform When managing infrastructure as code with Terraform, one common challenge is ensuring that file content in S3 buckets actually updates when the source files change. By…

  19. Welcome to New Blog

    After many years of BlogEngine.NET, it's time for a change

  20. How to find the oldest file in an S3 bucket

    This Python example searches for the oldest file in a bucket and prints same. Ensure to pip install boto3. import boto3 # Specify the bucket name bucket_name = 'my-bucket' s3 = boto3.resource('s3') bucket =…

  21. Local debug of an AWS Java Lambda using IntelliJ

  22. Configuring JetBrains Rider to use AWS Lambda Test Tool

    Developing serverless applications using AWS Lambda can be an exciting journey into the world of event-driven programming. However, testing and debugging these applications can be a slightly more intricate process than…

  23. Getting Started with AWS Glue: A Comprehensive Guide

    Introduction AWS Glue is a fully managed, serverless data integration service offered by Amazon Web Services (AWS) that simplifies the process of extracting, transforming, and loading (ETL) data for analytics purposes.…

  24. Getting started with Azure Data Factory

    In the video I show you (with no/low code), how to: Download XML from a website Transform this data into CSV Upload it to cloud storage

  25. Streaming API–Quickstart

    In this video I demonstrate how to stream data over a HttpResponse using a.NET Core Web API.

  26. HTTP Header Propagation ASP.NET 6 with HttpClientFactory

    Today I show you how to add header propagation in ASP.NET. “Header what?” I hear you say. Essentially it’s a mechanism whereby when you make HTTP requests via a HttpClient, you can automatically ‘forward’ headers that…

  27. Parallel Batch Request Handling

    Picture this: You find yourself with a big list of resource identifiers You want to get information for each id via a http request You want to batch the resource identifiers rather than making individual http calls You…

  28. Await forever – deadlocked so easily

    Async/await simplifies async code, use it everywhere and life becomes so simple right? While this is true I’ve seen situations where users either chose to, or had to, mix async and non async code and got themselves into…

  29. Azure Application Gateway CORS support

    In this video I show you how to add CORS support to an Azure Application Gateway Route.

  30. Azure Arc Server Registration Error

    Today while adding a new server to an Azure subscription I encountered the following error: The subscription is not registered to use namespace 'Microsoft.HybridCompute' In this video I show you how to register the…

  31. Websockets

    This video shows you how to create a websocket server in Java. Links: https://www.javainuse.com/spring/boot-websocket https://start.spring.io/ https://www.websocket.org/echo.html Azure:…

  32. Proxying a REST API with AWS API Gateway

    In this video I show you how to use AWS API Gateway to quickly proxy an existing API.

  33. Bitbucket - Pipelines - Terraform - Private Modules

    So you’ve started using Terraform. You’ve progressed to creating Terraform modules. You’ve put your module in a private Bitbucket repo. Now you want to access it from a Bitbucket build pipeline and you see the following:…

  34. AWS CloudFront multiple origins

    In this video I show you how to configure multiple origins for a single CloudFront distribution.

  35. Azure Key Vault References

    In this video I show you how to move application secrets into Azure Key Vault without any code changes. I do this by using a vault access policy. Note: You'll have to ignore my managed identity references in this video.…

  36. Azure Managed Identities

    In this video I show you how to leverage Azure Managed Identities to allow access between Azure resources. (excuse the audio quality... I need to improve on this)

  37. Materialized Views and Microservices

    In computing, a materialized view is a database object that contains the results of a query. For example, it may be a local copy of data located remotely, or may be a subset of the rows and/or columns of a table or join…

  38. test

    testing

  39. Flexing those Java generic PECS

    I believe I’ve previously covered C# generics covariance and contravariance in the past, now it’s Java’s turn. As you may or may not know The term PECS stands for “Producer Extends, Consumer Super,” which is an odd…

  40. VS2019 Docker ASP Core Environment Vars

    Tip If you are debugging with VS2017/9 and want to pass environment variables to your container then read this post, if you are looking for pictures of cats then sorry but leave a comment how you got here. Step 1 Create…

  41. Azure AD Angular7 .NET Core 2.2 ADAL

    Hi Everyone, I thought it worth sharing how to configure Azure Active Directory to work with a.NET Core 2.2 webapi backend and an Angular7 front end that uses ADAL (i.e. v1 of Azure AD). AD Versions As you may or may not…

  42. Setting your C# language level

    The C# compiler defaults to the latest major version of the language that has been released. You may choose to compile any project using a new point release of the language. Choosing a newer version of the language…

  43. C# Concurrency lesson – Barrier to entry

    Imagine the scenario you are on a team race, there are a number of stages along the route however only once all your teammates have gotten to the end of a stage can anyone proceed to the next stage. Now imagine the…

  44. C# Concurrency lesson – SemaphoreSlim

    In Windows we have two types of semaphores, local and named system semaphores. You can think of a semaphore as a bouncer in a nightclub, the responsibility is to only allow a number of people into the club at any one…

  45. Pulling ECR images into AKS

    Hi everyone, Recently I found myself using Azure managed Kubernetes (AKS), however the images I wanted to pull were in AWS ECR. If my k8s cluster was in AWS it would be transparent to me provided the IAM user had…

  46. Welcome to BlogEngine.NET

    If you see this post it means that BlogEngine.NET is running and the hard part of creating your own blog is done. There are only a few things left to do. Download Themes Official Website Donate Write Permissions To be…

  47. Kotlin: A better Java

    I’ve been quite vocal in the past that the Java language syntax is low on my list of favourite languages. I believe this stems from the fact that I write lots of C# (and even TypeScript) these days, and those languages…

  48. Effective Software Development 2017

    I’ve been thinking a lot about the state of software development recently and moreover taking a step back trying to identify and articulate where I stand on past, present, future trends or concepts and define how to…

  49. PowerShell Oracle Db Backup

    Hi all, I thought I would share with you this quick PowerShell script I created to Export an Oracle database, 7Zip it and then upload it to AmazonS3. Export.ps1 param([String]$dumpname=(get-date -format dd-MM-yyyy))…

  50. Azure Logic Apps – Lesson 1 - Quick Sample

    Hi all, I’ve been pretty busy lately and have been struggling to get the time to write a few blog posts. So what I’ve decided to try to do is create a few videos instead, I’m going for a warts and all approach so I’m not…

  51. Out with the old in with the new(er)

    With 2016 drawing to a close and 2017 already in full swing for me, I thought this was a good opportunity to reflect on how 2016 went and what 2017 has in store for me from a technological point of view. 2016 If asked…

  52. Azure vs. AWS Text to Blob with SDKs

    This demonstrates what is involved in writing and reading some text to an Azure and an AWS blob. Use case What I set out to achieve was to demonstrate how to read and write some text to a blob with the SDKs. Just to make…

  53. Certification

    It’s been a busy year and my blog posts have suffered while I’ve been preparing and sitting these exams. But I’ve got them both now, so expect my Azure vs AWS series of posts to continue.

  54. Media Indexing In the Cloud

    So out of the blue I found myself giving Azure Media Indexing a trial run, for no other reason other than I could, this is why I love cloud tech so much, it brings something that would have been very difficult 5-10 years…

  55. Cloud costs: Shut those VM’s down

    The public cloud is fantastic for numerous reasons, if you’re not faced with some restriction such as where your data lives or other factors, then my advice is get away from private clouds and get to the public clouds as…

  56. Web App deployment to AWS and Azure

    As promised, hereby the first instalment of the AWS vs Azure blog post saga, again I’m trying to remain impartial throughout. What I intend to outline at this stage is how to get started deploying a new application to…

  57. AWS or Azure

    History So way back circa 2008 I registered for AWS free tier, now back then I was working in a different industry that didn’t have much need for ‘the cloud’. I played with a few Linux vm’s during that year but nothing…

  58. IE 11 Disassembly

    So I’ve been looking at an issue for a client today whereby an application working perfectly well on most browsers was failing on Internet Explorer 11. Users were presented with the following error: I think we can all…

  59. A web app in minutes, Java and .NET

    In this post I show you how to generate a shell for a web application in both Java and.NET, while they are not directly a one to one mapping I think some of you will find this interesting should you have never created a…

  60. WebAPI OData DTO

    So I’ve started using OData in anger and pretty much immediately stumbled on a problem when using Data Transfer Objects (DTOs). This post explains that problem and the solution. Problem The following error is encountered…

  61. IntelliJ Application Servers Greyed Out

    If you ever come across the problem of the IntelliJ Application Servers menu greyed out like this: This is simply because you need at least one Run Configuration. I’m using JBoss just now so here’s what I do to add a run…

  62. Not accepted here

    and it's not because I'm Irish;-) ODataController - 406 So I’m working on a project that returns some entities from an OData endpoint, I wanted to remove the unnecessary parts of my entities so I created some DTO’s…

  63. Azure, SQL User invalid from Azure Website

    Problem I was faced with a problem this morning that took me a good 30 minutes to figure out... I had created a website and associated SQL database. However I changed said database as part of some development work. The…

  64. Tech of the week

    Appears to be the story of my life lately, just as I get excited and proficient on one stack I get side tracked with something else. The latest stack I’m playing with is the Ionic2 framework, but first some history. UX…

  65. Prevent Angular event bubbling

    In this screencast I show you how to prevent a click event on a table cell content from propagating up to its parent. Screenshots

  66. Angular Form Validation

    Hi all, Ok this is my very first ever screencast, it’s not very polished but hopefully I’ll get into the swing of things with some more practice. The screen cast shows how to add validation to forms the Angular.JS way.

  67. Angular.js Auth with ASP WebApi2

    So in my previous post I show you how to auth with a bearer token against WebApi2 with the OWIN middleware using a HttpClient. Next up I show you how to do the same with AngularJS. AngularJS True to form I’m not going to…

  68. NDepend

    Hi all, I’d like to introduce you to what appears to be a great tool for the.NET platform. http://www.ndepend.com/ I’ve promised to write a review on this tool, however, I’ll be perfectly honest and admit that I’ve just…

  69. WebAPI OWIN and HttpClient Authorize

    Hi all, I know I promised my next post was going to be more Azure but I encountered a little task that took me a while to get working, the scenario was that I wanted to make a call to my WebAPI (MVC5) service using a C#…

  70. Writing to an Azure Queue

    If you've seen my previous post then this post is quite similar, this time however I write to an Azure Queue and not to a blob. Code First of all you need an Azure storage account as before, but once this is set up,…

  71. Azure WebJob triggering on BlobUpload

    Tonight I’m going to follow up on my previous post where I promised to show you how to react on someone/something uploading a Blob. Please read…

  72. Uploading a Blob to Azure container

    In the picture above you see a storage account in Azure, in the storage account we have an ecbfx (European Central Bank FX Rates) container. Now let’s see how to upload some data to this container using a C# console…

  73. Broadband in rural Ireland

    View Full Album This is a post that I've just not got time to explain in full yet... But if you are stuck on 1-2mbps ADSL and have a bit of time on your hands then it's possible to get +20mbps broadband. I achieved this…

  74. So what is this – JavaScript

    To the uninitiated this can be really confusing in JavaScript. Consider the following: The code above logs this three times, but what is this? The main source of confusion is a quirk of the language where depending on…

  75. Angular.js .NET File Upload

    In this post I’m going to show you how to upload a file using Angular.js on the client side and ASP.NET Web API on the back end. Let’s get started Create your project in Visual Studio, and add your Angular.js app…

  76. Why Java Sucks

    Editor's note: The videos referenced in this post are no longer present on the remote site... but looking back... you didn't miss much 😜 http://2014.javazone.no/videos.html An ex colleague of mine sent me this link this…

  77. IDE’s and tools

    I’ve gotten a few emails from last night’s post asking me why I’ve gone black (and will I go back?), well you know what they say! Btw: I’ve Visual Studio, IntelliJ and WebStorm on black/dracula themes at the moment and a…

  78. Idiot’s guide to Angular service vs factory

    You won’t believe the amount of questions I’ve come across regarding the confusion between Angular services, factories and providers. This blog post attempts to help clarify same and get you started. Which should I use?…

  79. Recursive Directives Angular.js

    Another day, another post with me talking about something I barely know about. Today I’m going to show you my first second stab at a recursive Angular.js directive. Let’s first have a look at the end goal (forgive the as…

  80. Be careful of deferred execution

    Take the following code, if you have ReSharper installed you’ll be warned that there is possible multiple enumeration of your IEnumerable, this means that Select will be repeated twice for everything in the array.…

  81. Efficiency Yield

    Talking to an ex colleague of mine this evening about some use cases for yield, it’s quite a handy little keyword, I often use it for splitting a large collection into smaller ones (Chunk). Efficiency I was presented…

  82. Enum on steroids – Java

    Hi, I was reviewing some Java code this week and came across this wonderful way of establishing structured enums. Code //Declaration private enum ServerType {DEV(" https://server1:8001 ", "customservicesuser", "xzy"),…

  83. Garbage Collection in the JVM (1.6)

    Hi guys, I’ve found myself discussing garbage collecting in the JVM a few times this week and thought I’d share this information with everyone that ever wondered how all this works. Automatic Garbage Collection Automatic…

  84. BOOM! Bye bye iPhone, again…

    So I’ve splashed out the 600 euro and got me a SIM free Samsung Galaxy S4 Android phone. Why? Well I find myself doing more and more Java these days (as if I wasn’t busy enough keeping up to speed on.NET and iOS too) and…

  85. C++ ACE

    Overview I’ve been looking at a C++ application that uses ACE library, now I’ve never used this library myself, I used to love BOOST when I was 100% C++ (way back in the day sniff sniff). C++ 11 has drastically improved…

  86. Using MVC5 Owin Security with EF Code First

    Good evening, I’d like to share my solution for using MVC5 Owin security with VS2013 Update 1. I wanted to have my own DBContext contain both my own DBSets and also the security tables. Now I could find zero…

  87. Parameterized Unit Tests with JUnit

    I’ve been shown a lovely little utility for testing with JUnit 4.11 whereby one can have a list of items performed as part of the single unit test. First add the annotations you see below and set your inputs and expected…

  88. Xamarin a few weeks on

    I’ve gotten my hands dirty, I’ve published v1.0 to the store I’ve gotten the best support I’ve ever seen from Xamarin I’ve gone back to Objective-C, BOOM! Bindings drove me daft The reason I walked away was that I found…

  89. Xamarin UIDeviceFamily

    I was releasing an app to the Apple App store tonight (actually two apps, I've done an Atley Hunter;-)) One of my apps encountered a problem when I tried to upload my archive: "This bundle is invalid. The UIDeviceFamily…

  90. To Xammer or not to Xammer

    Xamarin vs XCode Anyone that reads this blog regularly or knows me, will know that I’m a C#/Java guy primarily, but I do love all other languages, especially JavaScript and Objective-C (my Objective-C is just about…

  91. File Upload MVC4 Web API, Knockout.js

    I wish to follow up on my previous post Uploading a file in MVC4 C#5.NET 4.5. I promised a few things here, an Ajax client, WinRT, iOS, Droid. This post addresses the ajax upload. First some background, I’m working on an…

  92. ASP MVC4 Web API file upload: Unexpected end of MIME

    So I’ve had a problem uploading a file using an HTML5 input of type file field. For love nor money could I see a problem with the code above (in my defence I’m working on this project late in the evening and have my…

  93. Enabling Facebook OAuth in MVC4 SPA

    There are two steps, the first step is to register a Facebook application, after you register you will have a key and password. The next step will be to insert these into your application. Step 1. Enable OAuth login…

  94. JAX-WS, Eclipse, JBoss

    Ok another Java post, they are few and far between, but I’ve already polluted this blog with Objective-C, JavaScript and other non.NET languages so why not. So I was lying in bed last night my wife was hogging the…

  95. Customization of Web API

    If you’ve used ASP MVC Web API then you are most likely familiar with the notion of content negotiation, this is the process where the content returned in the response is dictated by the accepts header in the request. In…

  96. Eureka moment

    After all these years, where I’ve modified connection strings etc in the web.config release folder. I’ve finally realised I can preview the transformation that Visual Studio does. To be really honest I’m not sure if this…

  97. Removing sensitive data from git

    Ok, so in my case it was not so sensitive, I had generated a publish profile for one of my projects, that said I don’t want the world and their aunty to be able to publish their apps to my server so I needed to remove my…

  98. An image button in iOS

    So as I wait for my second iPhone application to be approved by the Apple store, I start to wonder a few little things. How can I improve my existing apps through functionality and user experience? Given I’m pretty much…

  99. The lazy singleton pattern revisited.

    If you want to get a feel for the singleton pattern in C# one of the best resources I always revisit is on Jon Skeet’s (@jonskeet) website http://www.yoda.arachsys.com/csharp/singleton.html I encourage you to read the…

  100. That pesky iOS keyboard again

    In my previous post I showed you how to have the keyboard resign first responder status when Return is pressed. A little tip: is that you don’t need to set the delegate in code like my previous post, you can use the…

  101. iPhone: remove the iOS Keyboard on Return

    Ok this is another XCode/ Objective-C/ iOS post. Stop reading now if you feel sick MSFT fans. So you’ve written an app and you test out that new data entry field only to find out that the keyboard covers your action…

  102. SignalR chat on Azure

    At lunch today I created a little fun website and it only took about 15 minutes (as you can plainly see from the styling). Technologies The technologies involved were Azure (website) SignalR ASP MVC 4.NET 4 (because at…

  103. Kendo Datasource & MVC4 Web API, you broke my heart

    So I’ve spent many a sleepless night this week knowing that the webapplication I was working on was not doing server side paging… This morning I decided I needed to remedy that and was I in for an experience. At first I…

  104. ASP MVC4 Web API Delete 404

    runAllManagedModulesForAllRequests To support DELETE verbs in MVC4 the webconfig should have runAllManagedModulesForAllRequests defined. If you have an older project (like my project that I started in VS2012 RC) you may…

  105. Kendo UI Web Grid and ASP MVC Web API

    I’ve just been through the mill trying to get kendo grid working with an ASP MVC Web API Http Post Action. I think it may help someone if I post my findings. OData If you use Kendo UI you know that the datasource has…

  106. Knockout.js accept terms and conditions checkbox and submit button

    Here’s a nice way of enabling a button on a form IFF the Accept T&C checkbox has been clicked. Knockout script So we have a simple acceptTerms variable that is observable. Markup In the markup above you can see that…

  107. XCode disabling ARC for a single file in a project

    So I’ll put it out there, I’m a novice Objective-C man, in fact I’m still sitting on the fence on whether I should write my iOS apps in C# (MonoTouch) or Objective-C (xcode), I’m leaning a little more towards the…

  108. A magical concoction ASP, Web API, jQuery, Kendo UI, Knockout.js, WCF, Async, Moq

    So the heading for this post is a little bit of a mouthful, but I want to tell you a story of how some of these technologies play together, so often in blog posts we are presented with a trivial example (I’m holding my…

  109. Using DataTables.net with ASP MVC Web API

    So I’ve been working on a Web application that uses the ASP MVC4 Web API. I like this approach especially as it will easily allow me to support other clients I/others may write in future, in so far as, it returns JSON…

  110. Ninject Dependency Resolution in ASP MVC4 Web API

    Ok so you’ve been using ASP MVC3+ and using Ninject as your Dependency Injection resolver. Now you want to start leveraging the ASP.NET Web API and continue to use Ninject. I was surprised to find it wouldn’t work out of…

  111. Pry it from my cold dead fingers

    I usually try to avoid getting into the OS / Browser etc drama, yawn... But I found this blog post on Pluralsight tonight, and I can’t help but laugh, I’m with the 72% it turns out, I am asking myself did I pick that…

  112. Authenticate, Authorise Web API with HttpClient

    Hi all, I said I’d post this because I didn’t manage to find a suitable blog post or documentation indicating how to do this with the HttpClient (beta). (bleeding edge again ey). This post outlines how to create a simple…

  113. Deserializing JSON

    With this post I’m back to my lovely OneNote screen clippings, my last few postings were done on Windows8 and I’d no OneNote installed. So you want to Deserialize JSON in.NET! (C#) How do you go about it? There are a few…

  114. ASP Web API query single entity

    What’s wrong with this? public class UsersController: RavenController {public User Get (int userId) {this. AutoSave = false; var user = RavenSession. Load < User > (userId); if (user == null) throw new…

  115. Using RavenDB with MVC Web API

    I’m starting this post with a disclaimer. I’m not a RavenDB expert, actually far from it, in fact I’ve only started working with it this evening! I’m working on a pet project and getting the initial building blocks in…

  116. LINQ DistinctBy

    Here is an extension method that I just had to share, TBH I’ve forgotten what I robbed the initial idea from, it wasn’t mine, but it’s something I found that I use over and over. The problem is I want to use the…

  117. VS11 XML

    I’m working with an XML document all morning, and for the hell of it I decided to open it in VS11. Guess what I found, some pretty cool XML/XSD/XSLT support but the biggest feature I found is the following… Paste XML as…

  118. Uploading a file in MVC4 C#5 .NET 4.5

    Back on the bleeding edge again. I’m in the early stages of my next killer app and I’m investigating the pros and cons of using the new ASP WebApi. One of the features of this so called killer app will be to upload…

  119. Using jQuery UI Autocomplete

    Hi all, here’s an example of how to use jQuery UI Autocomplete in ASP MVC3. The sample app I will show actually connects to a work related webservice, but you could use any repository you so wish. Steps Create a MVC3…

  120. Async MVC Controllers

    I previously wrote a post on MVC async controllers. Now I want to follow up on something that’s more cutting edge, unfortunately I’m one of those people that like nosing about with what’s new, how it will affect me and…

  121. Layout in Windows Phone 7

    So my wife left me for a hen weekend and I needed something to do with my time. Friday night I dedicated to my real work to clear my conscience and then I went to play. Windows 8 I spent a few frustrating hours on…

  122. Reading a file in Windows 8 CPP vs CSharp

    I left my last blog very indecisive, would I use CPP, would I use.NET or would it be html/js. Again I’m thinking Cpp is really for faster and better performance, and while it might even be the hands down winner on ARM…

  123. jQuery and WinRT

    As part of this WinRT comparison I’m doing, I next need to recreate my apps in html+js. This is my first WinRT app I’ve written in html+js and right off the mark I hit a problem with the WinRT sandbox. These days I won’t…

  124. Reading a file in Windows 8 HTML5 js

    Hi again, this is my last post where I compare the same WinRT application written in three different ways. C++ / Xaml C# / Xaml JavaScript / HTML My previous post covers C++ and C#, this one covers JavaScript. JavaScript…

  125. It’s COM Jim, but not as we know it!

    Those of you that started out in Windows C++ like me are likely familiar with COM, COM+, DCOM. If you stayed in unmanaged land then you’re probably still very familiar with ATL, HResults etc. However if on the other…

  126. Visual Studio you rock.

    I was not sure what I’d installed but tonight I needed to create a few regular expressions, and as I started typing this appeared in VS2010. Pretty cool if I say so myself. A quick look at my extension manager and I see…

  127. Converting EPM operations to Tasks using the TPL

    Previous post Overview The Event Programming Model (EPM from here on in) was introduced in.NET 2.0, its purpose was to serve as a simpler pattern for asynchronous operations than the Asynchronous Programming Model (APM /…

  128. Strategy pattern

    So what is the strategy pattern? It’s one of the simplest object orientated design patterns, I find that it helps clean up day to day object orientated design. Its purpose is to Encapsulate a family of related algorithms…

  129. Converting APM operations to Tasks using the TPL

    Those of you who have already used.NET 4.5 developer preview will know that tasks are becoming more common in the API, especially with the advent of the async await keywords. But many of you (including me) can’t really…

  130. An invisible Azure Message

    When creating an Azure queue, you specify a lock duration, once a message is read from the queue it’s marked as invisible for other readers for a period of time, e.g. one minute. Choosing the invisibility time is a…

  131. Azure Service Bus

    When communicating between roles in an Azure application we’ve a few options; to name a few: Http Tcp Queues While Http and Tcp are tried and trusted they do come with some limitations that queues help overcome. In the…

  132. Migrate SQL Server DB to Azure SQL

    Here’s one way to migrate your SQL Server Database to the Azure platform. Get the SQL Azure Migration Wizard http://sqlazuremw.codeplex.com/ Start the wizard and select SQL Database Migrate option Select your source…

  133. Azure Tools

    This evening I decided I’d install the new Azure tools after watching the latest vids that have appeared. I right click on my MVC3 app and choose to: Add Windows Azure Deployment Project Then I hit F5 to run the project…

  134. Synchronize your controllers when necessary

    Earlier today I happened to lend a hand to a friend of mine that was experiencing a race condition in an ASP.MVC application, like a rag to a bull is multithreading to me. Here’s the scenario; my friend was calling two…

  135. jQuery and a little bit of JavaScript

    I’m still working on the LiveResume website, just something I’m playing with in my free time, no I’m not looking for a job, just have an idea that I’ve not seen anywhere else (no I’m not telling you what it is until the…

  136. Full height divs in HTML5

    Hi all, This has probably been beaten to death elsewhere, but somehow it’s the first time I’ve ever come across it. I’m working on the LiveResume website this evening (hey it was this or watch XFactor). Anyway, I wanted…

  137. Supporting WSE plain text password with WCF BasicHttpBinding

    Hi all, Ok, so I did a bit of googling to see if this had been done by someone else, turns out I failed to find a suitable solution, just many frustrated people. So this post is an attempt to make those people a little…

  138. ASP MVC Display Templates

    So I’m still working on the Live CV website I’m creating in my spare time. The idea is pretty simple: the web application will let users create an online CV. I’ll not get into the details of it until I’ve something more…

  139. CSS and custom jQuery filter selectors

    I’ve discovered a nice set of jQuery filter selectors. Take this example of selecting the checked radio button in a group. Markup Script There are many many others, e.g.…

  140. Watch that error stream with Java process executions

    I’m executing a Windows process from Java and I was bitten by a nasty oversight in one of my projects today. Everything’s been working fine for some time, but today the application I’m calling started spitting out errors…

  141. VS2010 C++11 Variadic Templates

    If you’ve been following the changes in the C++11 standard you may have heard of Variadic templates. In layman’s terms: var arg template parameters. Let's take C# to explain what we’re talking about: Take the Action…

  142. Silverlight Fluid Motion

    You know what? I love Silverlight! The only reason I don’t spend more time in it is that ASP is more suited to non enterprise applications. However tonight for you dear reader I’ve got an enterprise application (below).…

  143. MVC Mailer on NuGet

    So have you ever found yourself doing this? Well no there’s a nicer alternative whereby you can build up your mail in HTML. Check out the MVCMailer package on NuGet. PM> Install-Package MvcMailer Attempting to resolve…

  144. Android

    So it took me 2 hours (downloads on 2mbps included) to create an Android app in Eclipse. Wonder is that something I should be proud of given I’ve been in software for nearly 15 years now... 2 hours for a hello world...…

  145. EF 4.1 Code First Database re-create

    If you’ve upgraded to Entity Framework 4.1 you may have noticed the following no longer compiles. (the line of code that causes the database to drop and recreate on schema change). Solution DbDatabase. SetInitializer…

  146. HTML 5 Audio

    So does your browser support the HTML5 audio tag when it comes to MP3s? Browsers in order of my preference: IE9 – Nope Firefox 5 – Nope, moreover doesn't gracefully degrade to my fallback text! Chrome 13 – Sure Safari 5…

  147. smart_ptr in Java 1.7

    Darn it but I’ve been doing a lot of Java recently and u know what, I’m no expert but I think I could even raise the rating on my C.V. at this stage. My first experience of Java was reading a book back in 2001 belonging…

  148. Why I love the Task library

    Ok, forget about mvvm, that’s not the point of this quick post… Have a look at that, ain’t it a thing of beauty!? No more having to get back onto the gui thread, even webforms people have to do it with Control.Invoke (or…

  149. var keyword comes to C++

    Ok so it’s not the var keyword in C++, but in C++11 it’s called auto. This is something I love in C#, life would be miserable without it, it’s magnificent especially in LINQ, in fact LINQ could become quite painful…

  150. Sample HTML5 canvas drawing

    So how hard is it to draw on an HTML5 canvas? Well if you ever lived in a GDI+ world like I once did, then it’s pretty simple. In fact it’s somewhat familiar to Silverlight/WPF people too, the parameters passed to draw a…

  151. scoped_ptr in C#

    Is there a better way? Or at least a more generic way to leverage the dispose pattern? Well here’s one I thought of tonight. public class ScopeMngr: IDisposable {private Action _dispose = null; public ScopeMngr (Action…

  152. Tip: Auto Logon with Windows 7 User account.

    Ok, only you can decide if this is something you want to do, keeping in mind the security concerns. Here’s how: Press the Windows key + R on your keyboard to launch the “Run” dialog box. Type in control userpasswords2 +…

  153. C++11–shared_ptr

    To be honest, it’s been a long time since I did any real C++, however I’ve been reading a Java book lately and it’s made me kinda lonesome for C++, the Java book goes into a lot of detail about core language structure,…

  154. MVC Action Filters

    So what are MVC Filters? To quote Professional ASP.NET MVC2 ISBN 978-0-470-64318-1 “Filters are a declarative attribute-based means of providing cross-cutting behavior to an action method.” So what are MVC Filters? Well…

  155. Specifying CSS classes and HTML attributes with MVC helpers

    Ok you’ve finally got your MVC controller and models all wired up, your BL is fine, now you want to pretty up those views, so you’ll start to use some CSS and JavaScript. Here’s how you can specify HTML attributes with…

  156. Progressive Enhancement with Modernizr

    If you’ve been to an HTML5 session or lived in the HTML5 world for any length of time you’ll have come across the term “Progressive Enhancement”. It’s about taking a base application that works on downstream browsers and…

  157. Ain’t she sweet

    Nothing, really ground breaking, but don’t it look neat! (if I say so myself). (that Facebook link will be going up alongside Flickr/Twitter when I get around to it). Site written in ASP.NET MVC3/ jQuery / Razor /…

  158. Charts in MVC3

    So you want to draw a chart in MVC and don’t know where to start? Step 1) Create a new MVC3 project Step 2) Open NuGet and add a library reference to “microsoft-web-helpers” Step 3) Change your action method to create a…

  159. Global MVC Helpers

    This evening while I was helping an ex colleague of mine, who was venturing onto the web platform for the first time, an interesting thing happened, he taught me a thing or two! Neil had been researching web forms and…

  160. jQuery–Preventing default link behaviour

    This sample shows you how to hijack the default behaviour of the anchor tag and do something different. The interesting part is that we use the event arg in the click function, once we have this actual arg we can call…

  161. Microsoft Synchronization Services, WCF OData, SQL Azure, WPF, iPhone

    Part 1 – Setting up your database I did some work with an interesting piece of tech lately, Microsoft Synchronization Services 4.0 CTP. This post aims to give an overview of where to start, but firstly, let me describe…

  162. MVC Scaffolding and EF4CodeFirst–A data driven website in under a minute!

    Here’s a run through on how to create a data driven web application in under a minute. I’m going to create a simple part tracking system so as to manage the vast amount of helicopter parts lying about my garage. Some…

  163. “Knock, knock.” -- “Who’s there?” -- long wait... -- “Java.”

    So who's faster? Well C# or Java if you are talking “RAD”, but who executes faster? IMO, C# and Java can be just as fast or faster because the JIT compiler (JIT or just in time is a compiler that compiles your IL the…

  164. Keyboard window shortcuts Win7

    If like me you prefer to learn keyboard shortcuts and sell your soul in order to avoid moving the mouse, then you’ll like these shortcuts that I’ve stumbled upon this evening. [Win]+[Left Arrow]: Dock the active window…

  165. .NET 4.0 Code Contracts

    Yesterday I read an interesting article on a flight home from Amsterdam and thought I would share it with you. One of the generally accepted approaches of writing functions is to validate your input arguments before…

  166. jQuery Template Example

    Straight to screenshot. Ok so I’m here in a hotel in Germany, been stuck in Java all day so I needed.NET like a drug this evening. Let me describe what you see above. The screenshot is from WebMatrix, it shows the…

  167. The Ultimate Top 25 Chuck Norris “The Programmer” Jokes.

    1. When Chuck Norris throws exceptions, it’s across the room. 2. All arrays Chuck Norris declares are of infinite size, because Chuck Norris knows no bounds. 3. Chuck Norris doesn’t have disk latency because the hard…

  168. Ajax with jQuery

    Hi all, I’m sitting here waiting for a 50meg upload to finish... god my internet is slow. May as well add a post ey. So I’ll show you how you can request some JSON data from a MVC action using jQuery. You are probably…

  169. The happy life of a web developer

    Spent some of the weekend mucking about with getting a website to go with an iPhone and WP7 app I’m developing with one mister Tomas McGuinness, the whole idea is a wonderful combination of the MS stack of love with a…

  170. RIA Service in 5 minutes

    Hi all, I’ve previously blogged about how mind blowing WCF RIA Services are here. This week I found myself working with RIA Services again and this time I’ve got to show you just how easy it is (in case you didn’t take…

  171. ASP Glimpse Module

    Now there’s a pretty sweet way of looking at what’s happening on your server, I’ve picked this tip up from watching Scott Hanselman’s MS Stack Of Love (recommended watch) @ MIX11 this year. Here’s how (pardon the…

  172. RESTful WCF Services

    WCF not only provides SOAP, it’s also capable of providing RESTful services through use of the WebGet and WebInvoke attributes in the System.ServiceModel.Web assembly in conjunction with the webHttpBinding and webHttp…

  173. Cloud Computing (Azure) here I come

    I’ve been playing (seriously playing) with Visual Studio LightSwitch for the last few weeks and I have to say it’s knocking my socks off, not since I programmed in MS Access (am I allowed to say that? Should I even admit…

  174. OrderBy multiple fields with LINQ extension methods.

    Not many comments needed I imagine. The “ThenBy” extension method is what you’re looking for.

  175. ASP MVC Controller Exception handlers

    When you create a new MVC project a view called Error.aspx is created for you in the Views/Shared folder. <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage <…

  176. LINQ

    This is just a quick sample to show you can use LINQ in 2 different yet identical ways. The task is to show the count of people that have the same ages in our sample input data. class Program {class Person {public string…

  177. Dynamically load HTML into a div using jQuery

    Mucking about more and more with jQuery now that it’s pretty much become the industry standard, so I needed a little project to work on. I’ve previously created my online c.v. in a Silverlight4 app (must dig that out and…

  178. Automatically Scaling Telerik Radial Gauge

    Took a little time out tonight from the web application I’m working on as I want to create a little dashboard prototype that has to be desktop based as a result of where it will be used. I’ve got a server JBPM (Java…

  179. ASP MVC Entity Framework and Data annotations

    When you create a MVC view for data entry it already has the scaffolding in place to handle client side validation (and server). However you need to specify the data annotations you need. You’ve two options. Modify the…

  180. Create those delete views

    You may wonder why you would create a view for the delete action. One reason is to prevent webcrawlers interfering with your data, so create those delete views!

  181. SQL Server 2008 Prevent Saving changes

    When you modify a table in SQL Server and this change requires the table to be dropped and recreated, it’s necessary that SSMS is configured to allow this. Go to SSMS/Tools/Options designers and uncheck this option. See…

  182. Using Telerik RadScheduler with MVC3

    The cool hip thing these days is MVC, hang ur head in shame if you are still plodding along with plain old ASP.NET. Actually that’s not quite right, in fact it couldn’t be further from the truth, ASP.NET is alive and…

  183. SqlDataSource Strict Concurrency Checking–Simplistic approach

    Let’s say you have a simple UPDATE command. UpdateCommand="Update SEC_USERS SET FirstName=@FirstName, Department = @Department, Gender = @Gender” Now, let’s assume that two end users of your system have already requested…

  184. I’ve achieved my coding certification

    The "Works on My Machine" Certification Program Joseph Cooney had a brilliant idea for a new application certification program. But Vista's bland white-on-gray badge, in my opinion, doesn't properly communicate the...…

  185. Too easy to be simple

    Was having a conversation this evening with an ex colleague of mine, he’s recently ventured into the world of Silverlight which he loves, for him; even though it didn’t start out that way; this has become a stepping…

  186. Routing Regression With Two Consecutive Optional Url Parameters–(source Phil Haack)

    It pains me to say it, but ASP.NET MVC 3 introduces an ugly regression in routing from ASP.NET MVC 2. The good news is that there’s an easy workaround. The bug manifests when you have a route with two consecutive…

  187. @helper / razor

    Here’s a neat little trick. Declare a helper function in your view with the @helper syntax. Note: you will get intellisense when you type the @ listing the GiveHigh5 function. Here’s the output: Enjoy

  188. DRY out your MVC Views

    For those of you that don’t know DRY: Don’t Repeat Yourself. Take the following two screens. They are nearly identical. MVC3/Razor provides two ways to make things DRYer. Layouts (same as ASP.NET master pages, not…

  189. Razor…

    Unless you’ve been living under a rock lately, you’ll at least have heard of MVC and Razor even if you don’t really know what they are… ASP.NET MVC 3 is the next major release of ASP.NET MVC. ASP.NET MVC is a part of the…

  190. MS Lync–What exactly is it…

    Couldn’t tell you! Installed it and got the following.

  191. Retrieving stock quotes in C#

    I’ve been playing with the idea of writing a currency converter for my new Windows Phone 7. Stumbled across a tweet by Scott Hanselman regarding http://channel9.msdn.com/coding4fun. Turns out someone else beat me to it…

  192. How to deploy apps to your Windows Phone 7

    Download and install Windows Phone Developer Tools Select the registration in the start menu Enter your live id (ensure you’re registered at the developer portal to create wp7/xbox apps http://create.msdn.com/en-US/)…

  193. WP7

    Received my first Windows Phone today, just had to try an app after finishing work... Wrote a little app to search the subnet looking for some JBoss application servers, works just as well on my phone connected to wifi.…

  194. SQL Server 2008 Calculation Variables

    SQL Server 2008 has a shorthand/compact way of assigning calculation variables. e.g. Sql2005 DECLARE @val INT set @val = 1; set @val = @val + 1; Sql2008 DECLARE @val INT set @val = 1; set @val += 1; Same applies to other…

  195. VS2010 Script chooser

    In a Visual Studio 2010 ASP page, start typing

  196. Thread starvation in MVC

    On IIS, the.NET Framework maintains a pool of threads that are used to service ASP.NET requests. When a request arrives, a thread from the pool is dispatched to process that request. If the request is processed…

  197. The future is live

    Probably like a lot of other computer people I find myself working with more than one computer. Therein lies the problem, is it worth the overhead of manually having to synchronize all these PCs? Sure source code is and…

  198. Hello IIS 7.5 Express

    Cassini; we’ve all used it and loved it, now it’s the end of the road for the Visual Studio webserver. It gets replaced by IIS 7.5 Express. You can install it on its own. It's IIS, except it runs as a user process rather…

  199. MVC3 Released

    Today Microsoft announced the (actual, final, honest) releases of: ASP.NET MVC3 with Razor Lots of new features, the new Razor syntax, more extensibility hooks, new JavaScript features, better validation, easier caching,…

  200. Not just a new look for 2011

    Have updated a host of new features on my blog (running Blog Engine 2.0 released on 1st January). I’m now writing my blogs offline with Windows Live Writer, and with a click of the mouse posting them to…

  201. From Oracle to MSSqlServer

    Was asked how to do this the best today... http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9dfb1773-5594-44a9-869f-a891629f80a5&#x26;displaylang;=en

  202. Oracle Database Restore

    How to create an Oracle user/schema and restore an existing database to this new schema. drop tablespace xxx_demo_data including contents and datafiles; CREATE TABLESPACE xxx_demo_data DATAFILE…

  203. Open Redirection Attack prevention

    If you've had a look at the MVC3 preview generated code you will notice the Url.IsLocalUrl method getting called from the LogOn action. [HttpPost] public ActionResult LogOn (LogOnModel model, string returnUrl) {if…

  204. Asynchronous WF4 activities

    Anyone that's ever written UX/GUI code will know that while it once was acceptable (unavoidable) to block the UX thread with long running operations, it's now almost always done in a background thread/task etc. Well with…

  205. ReHosting the workflow designer

    If you've attempted to host the workflow designer in.NET &#x3C;= 3.5 you'll remember it's not such an easy achievement. However doing so in WPF.NET 4.0 is quite trivial. Have a look at the Visual Studio 2010.NET 4…

  206. SQL Server Check Constraints

    Here's an easy one to get caught out on. Say you remove a constraint on a table to do some maintenance etc. e.g. ALTER TABLE BANDWIDTH NOCHECK CONSTRAINT FKUserLimits; When you wish to bring the constraint back on stream…

  207. WF4 WriteLine testing using extensions

    If you wish to test specific writelines on a console application: you can do so by adding a StringWriter object to the workflow extensions. The writeline activity will use the textwriter if it exists as opposed to the…

  208. HowTo: Consume WCF From WF4

    Hi all. I've discovered this is not as simple as it would appear to be. In fact it's worse; in "order" to do this you will need to jump through a few hoops...; in a particular order! 1. Add an activity library project 2.…

  209. It's my football and I'm going home

    We've all created API libraries, and libraries by their nature encourage reuse. However what happens if you want to be selective in who else uses your assembly? One simplistic approach would be to ensure that the calling…

  210. XAML gotcha

    Here's one I'm ashamed to admit caught me as I was finishing up work this evening, it's been a good few weeks since I've gone near WPF/Silverlight given I was on holidays and spent my time playing with WF4 and MVC2.…

  211. Moq

    How many of you create your own mocks? I've recently been using Moq and I give it the thumbs up:-) Note it's using.NET 3.5; time for an upgrade? I can't stress enough how much I love LINQ, today worked on a problem for a…

  212. Silverlight extra day of PDC...

    Register now! Learn about the future of Silverlight from Corporate Vice President, Scott Guthrie and other experts, direct from Microsoft’s HQ. http://www.silverlight.net/news/events/firestarter/ If you are an INETA User…

  213. IE9 Beta

    A word of warning: Don't do it:-) I'm v.guilty of using all the latest technologies so a few weeks back I installed IE9 Beta. Problems encountered: MVC2 projects getting 404 a lot, I did see this discussed in an…

  214. MVC Binding restriction

    There are a few options when restricting what properties of a type get automatically bound by the framework. Take the Loler type seen in my other MVC2 blog posts. [Bind (Include = "ID,Name,Description")] public class…

  215. MVC Stories: HTTP Post alternatives in MVC2

    Below are two screenshots of two alternative mechanisms for handling an MVC2 post.

  216. VS2010 parallelism

    Take some time to explore the new VS2010 debugger. Those of you who have experience with multithreading know that it can be a right old PIA (and I'm not talking Primary interop assembly here!). Try the parallel…

  217. LINQ in ASP.NET

    A quick sample of how to use LINQ in your webpages. <% Model.ToList().ForEach(item => {%> < tr > < td > <%: Html.ActionLink("Edit", "Edit", new {id = item.AlbumId})%> | <%: Html.ActionLink("Delete", "Delete", new {id =…

  218. Workflow Arguments how to

    So you've started up your very first 4.0 Workflow application. You've added some arguments and want to know how to pass some information... You can either use the Dictionary approach that exists since 3.0 or you can use…

  219. MVC Stories

    Hi All, Been a while since I've written some posts, been pretty hectic hours at work and weekends building a house so my chances to blog have been limited. I intend over the coming few days to give a few tips and tricks…

  220. Synchronization Context

    A sample of using SynchronizationContext to post a message back to the UX thread. private void Window_Loaded (object sender, RoutedEventArgs e) {SynchronizationContext ctx = SynchronizationContext. Current; ThreadPool.…

  221. WCF 4.0 File-less Activation (.svc less)

    http://url/abc.svc The.svc at the end of the url makes it user unfriendly. It also makes it a Low REST service as it does not follow the REST URI principle. Till date developers have to overcome this limitation by…

  222. Output and Encoding in ASP.NET 4.0

    Pre.NET 4.0 Prior to ASP.NET 4.0 (and especially with MVC) when a user outputted information to a webpage they used &#x3C;%= Server.HtmlEncode(modelViewStore.Content)%> The reason for the Encoding is primarily to prevent…

  223. WaitCursor and MVVM

    Ever wondered how to display the correct cursor in an application that is databound to async methods? Pretty easy solution, just databind the cursor on the window itself. Here's how: Add an IsBusy property on the…

  224. INotifyPropertyChanged diagnostics

    Those of you that use INotifyPropertyChanged may have noticed it's easy to break the code if you choose to refactor/rename as the property name string does not get refactored. Here is a mechanism to catch this problem at…

  225. WPF ListViewItem Commands with MVVM pattern

    If you're interested to see how to attach commands to listview items for use with an implementation of the MVVM pattern, have a look at this. < Style x: Key = " Local_OpenEntityStyle " TargetType = " {x:Type…

  226. Windows special folders enum

    Ever want to find out from C# where some "special" folders are located so you can use them in your desktop application? Here's how. Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) See…

  227. Exposing OData with WCF RIA Services 4.0

    I was just about to write up a little blog on the how and why of Exposing OData (Open Data Protocol) in WCF 4.0. But seeing it being a Bank Holiday and, if you follow any of my posts, you'll know I don't spend a lot of…

  228. Preserving ListView state

    XAML Serialization to the rescue. The following sample code will persist the current Listview state to disk and restore it the next time the control is loaded. < Window x: Class = " WpfApplication1.MainWindow " xmlns = "…

  229. LINQ to Xlsx

    A sample of how to read an Excel 2007/2010 file using Open XML SDK V2. (forgive the bad syntax highlighting) using System; using System. Collections. Generic; using System. Linq; using System. Text; using DocumentFormat.…

  230. .NET Concurrency

    Optimistic Concurrency In a multiuser environment, there are two models for updating data in a database: optimistic concurrency, and pessimistic concurrency. The DataSet object is designed to encourage the use of…

  231. LINQPad

    If you've not used nor know what LINQPad is... tut tut tut Download it from here. http://www.linqpad.net/ it will make your life easier, in fact you'll wonder whatever you did without it... So how does it help...? Try it…

  232. Type Equivalence Embedded Interop Types

    Beginning with the.NET Framework version 4, the common language runtime supports embedding type information for COM types directly into managed assemblies, instead of requiring the managed assemblies to obtain type…

  233. Declarative RIA Data and Controls

    I'm really loving this declarative approach with Silverlight and WPF... (ask me why and I can't tell you!:-) Anyway I've just stumbled across a way of managing RiaDataContexts Declaratively I found it on the Telerik…

  234. Expression Blend visual states

    A few people have asked me what's the easiest way of doing transitions on Silverlight. One of the easiest ways has to be to use the VisualStateManager with Expression Blend, see screenshot for sample logged in state. If…

  235. Providing Security in RIA services

    If you wish to prevent clients accessing your data: [RequiresAuthentication] [EnableClientAccess ()] public class LolerService: LinqToSqlDomainService < LolerModelDataContext >

  236. Popups in WPF

    Here is some code to show a popup in WPF, I've nothing in the popup at the moment, just a gradient background and border. < Popup Name = " popup1 " Width = " {Binding ElementName=bdrCalendar, Path=ActualWidth,…

  237. RIA Services

    Over the w/end I was helping a mate with his Data-driven Silverlight app. I was gobsmacked that his developer spent days and weeks writing plumbing code, hand coding infrastructure code and even worse my friend had to…

  238. Filtering data in Silverlight

    Ever want to filter data in Silverlight? Here's a simple example that uses a lambda expression to search on name (case sensitive). ComboBox cbx = ((ComboBox) sender); ICollectionView dataView = CollectionViewSource.…

  239. Cocoa Is My Girlfriend

    Tonight I've stumbled across an interesting Blog on cimgf. http://www.cimgf.com/2010/02/12/accessing-the-cloud-from-cocoa-touch/#more-909 It's been many years since I wrote PHP, so I'd naturally use ASP.NET serverside…

  240. Silverlight 4 Databinding and VS2010

    If you've got a data driven application, databinding is the infrastructure of choice that makes the link between data and your UX. Silverlight 4 has a few improvements that bring it closer to WPF. TargetNullValue - lets…

  241. Silverlight and WPF

    Tonight I tried to use the FlowDocument that you'll know well if you are familiar with WPF... Important part above "tried to use"... but... Silverlight version 3 doesn't support it:-(That's a second thing I've found…

  242. Different views in WPF/Silverlight

    In my early WPF days I noticed the magic that having two different controls bound to the same ObservableCollection meant that when I selected an item in one control, the same item got selected in the other... which I…

  243. C# 4.0 Dynamic Keyword

    "object x" is a shorthand for "System.Object x". This declares the variable x to have the type System.Object, this is strongly typed. And since C# provides autoboxing, you can assign anything you want to this variable.…

  244. C# on the iPhone

    Recently I've noticed that the country has gone iPhone mad and I'm starting to buy into it myself... my blackberry days may be numbered as the only distinct advantage I see is that bandwidth is not used retrieving…

  245. WPF Textbox changing validation

    Here's how to ensure that databinding happens when the value of a textbox changes. (as opposed to losing focus for example) < TextBox Text = " {Binding Interval, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged} " />

  246. Anonymous delegates and Lambdas

    Just a sample that may catch your eye as unusual... class WorkItem {public WaitCallback Callback; public object State; public ExecutionContext Context; private static ContextCallback _contextCallback = s => {var item = s…

  247. The three A's of Silverlight Security... (Part I)

    · Authentication · Access control · Auditing Authentication. One of the critical requirements of any LOB application is authentication; before the user can use any function he will authenticate by giving a user id and…

  248. Silverlight Multithreading and the UI

    When you wish to know if you are on the UI thread and you've no access to any UIElement how do you do it? static bool IsUiThread () {return Deployment. Current. Dispatcher. CheckAssess ();}

  249. Checked GroupBox

    Here's a bit of code that I'm using in an application to give this result (Checked GroupBox). < GroupBox Grid.Row = " 3 " Grid.Column = " 1 " BorderBrush = " Black " Margin = " 0,0,116,0 " > < GroupBox.Header > <…

  250. Data Validation in Silverlight (Method 1)

    Here's one way to do validation in Silverlight. This is a pretty straight method using exceptions (if you're from the camp that allows exceptions in your Data objects). public string Name {get {return _name;} set {if…

  251. Anonymous delegates and event execution

    A nice little trick to save you always checking for null when firing custom events. Initialize to anonymous delegate. Ok... we've an extra call in the invocation list so use judiciously. public event…

  252. LINQ to SQL

    Requirement: Northwind SQL Database Advantages of LINQ to SQL While everything with LINQ to SQL can be done with ADO.NET, there are a few advantages: Less code: you don't need to write ADO.NET code for querying the…

  253. Ajax on the Microsoft Content Delivery Network

    You can now start using the Ajax toolkit/library without having any server support.

  254. WPF...Cool 3D browser

    Pretty cool app to pass a minute or so http://chriscavanagh.wordpress.com/.

  255. Extension Method for WPF Window with Forms Owner

    Extension Method internal static class InteropExtensions {public static bool? ShowDialog (this System. Windows. Window win, IntPtr handle) {WindowInteropHelper helper = new WindowInteropHelper (win); helper. Owner =…

  256. SQL Server Compact Edition

    I've been playing with a workflow service hosted here /PSService/PSService.svc. Feel free to give it a bash [August 2012, removed]. Endpoint is using basic HTTP binding. Tonight I whipped a SQL Server Compact database…

  257. WPF Grid splitters

    Adding splitters to the WPF grid couldn't be easier. Vertical Horizontal ResizeDirection="Rows" Background="Transparent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1" />

  258. WPF Routed events

    Ever have a control on a window and want to be able to receive button clicks from this child control? More than once I've done this the hard way, but now... public VariablesWindow () {this. InitializeComponent ();…

  259. Key modifiers

    Recently I used PInvoke to check if the SHIFT key was pressed while I was doing a drag operation... What I should have done then and have done now is if ((Keyboard. Modifiers & ModifierKeys. Shift)!= ModifierKeys. None)…

  260. A Custom Diagramming Library

    Recently I've been working with a 3rd party diagramming library written in Windows Forms. It's been great and it's pretty fast in building 80% of the application I'm working on. [Update August 2012: I never got around to…

  261. WPF Data Triggers

    Today I needed to control the enabled property of a button "Remove Item" on my form depending on whether there was a selected item in a Listbox. Here's how < Button Content = " Remove " Click = " OnRemoveTranstion " > <…

  262. Converting your VS2008 projects to support XAML designer in Expression Blend 3

    If you've created a new WPF project in VS2008 and then you try to design your UX in Expression Blend 3 you'll find that you get XAML view only. What is required is to add…

  263. .NET DateTime Webservices UTC

    With.NET 1.1 when we receive a UTC DateTime in a SOAP response from a Webservice it used to get converted to local time. With.NET 2.0 when we receive a UTC DateTime in a SOAP response it stays in UTC. If you need it in…

  264. Expression Blend for WPF/Silverlight 4

    Announced at PDC this week. http://www.microsoft.com/downloads/details.aspx?FamilyID=6806e466-dd25-482b-a9b3-3f93d2599699&#x26;displaylang;=en Finally a version of Blend that will open VS2010 projects (and of course…

  265. BlogEngine and Silverlight

    I've had a few people asking me how did I host Silverlight 3 in blog engine. Silverlight Usercontrol It was pretty simple really (when you know how). Basically Silverlight 3 needs an <object> tag. So I created a user…

  266. Configuring IIS to host WCF services

    It's true what they say, to learn new technologies it's simply a matter of ABC (Always be coding). I've watched many the video, read many the book but it's only when I went to try to do something that it sinks in. Like…

  267. Windows Forms Validation

    One approach for validating child controls on Windows Forms is to Validation. Add a Validated event handler to all child controls you're interested in. On a button event handler call this.ValidateChildren(); This will…

  268. WPF ErrorList

    http://errorlist.codeplex.com/ ErrorList I recently wrote a control that tries to replicate the error list seen in Visual Studio. The control is dependent on.NET 3.5 SP1 because it uses the WPFToolkit. I'm hosting a…

  269. Inline XML LINQ manipulation sample

    A quick example of inline XML and LINQ Code void LinqToXmlSample () {Console. WriteLine ("{0}: Start", new StackTrace (0, true). GetFrame (0). GetMethod (). Name); XDocument xDocument = new XDocument (new XElement…

  270. Resource Cleanup and Lambda Expressions

    A neat way of always cleaning up resources is to use Lambdas as data. Take the following. Source internal interface ITryCatchReport {void Try (Action < IServer > action);} internal class TryCatchReport: ITryCatchReport…

  271. Visual Studio Project Dependencies

    Adding project dependencies in Visual Studio is done automatically with.NET projects when the Add Reference dialog chooses another project from your solution. However you can get Visual Studio to add project dependencies…

  272. Blend Button Design

    Here's a video from Steve White, a program manager in Expression Blend. He shows how to style a button in Silverlight using Expression Blend 3. &#x3C; http://electricbeach.org/apps/Silverlight Button Control Styling…

  273. Another www.briankeating.net

    Hello and welcome. So I've started blogging... let's see how long this lasts. Why the change? About 5 months ago I started writing my own blog engine. This was a great idea when the only thing (.NET wise) that I wanted…

  274. Testing Silverlight

    My first (public Silverlight application)... Had quite a bit of fun getting this Silverlight 3.0 application hosted in Blog Engine... More to come... time for some sleep now... 02:20am... [usercontrol:~/User…

  275. Windows Workflow 4.0

    Ok, forget what you learned about workflow in 3.5. Windows Workflow 4.0 4.0 changes everything you thought you knew about workflow. WF 4.0 represents a bottom-up rewrite with entirely new thinking. The gains are…

  276. Test syntax highlight

    Testing the syntax highlighting option with the blog engine. int test = 0;