Latest Blog Posts

Sharing thoughts and experiences about software architecture, development practices, and engineering solutions.

Ensuring S3 Files Update with Terraform: The Power of etags

February 27, 2025

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 default, Terraform will upload a…

Configuring JetBrains Rider to use AWS Lambda Test Tool

June 06, 2023

eveloping 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 usual. Fortunately, AWS provides…

Title: Getting Started with AWS Glue: A Comprehensive Guide

March 29, 2023

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. With its scalable, pay-as-you…

Streaming API–Quickstart

October 14, 2022

In this video I demonstrate how to stream data over a httpresponse using a .netcore web api.

Http Header Propagation Asp net 6 with HttpClientFactory

September 26, 2022

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 were issued to your endpoint…

Parallel Batch Request Handling

August 19, 2022

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

Await forever – deadlocked so easily

September 13, 2021

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 a world of problems. One…

Azure Arc Server Registration Error

July 08, 2021

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 register the Hybrid Compute provider in your…

Websockets

June 30, 2021

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: https://azure.microsoft.com/en-us/services/web-pubsub/ https…

Bitbucket- Pipelines -Terraform - Private Modules

March 24, 2021

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 | Solution In my case I…

Azure Key Vault References

January 29, 2021

In this video I show you how 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 I didn't use them.

Azure Managed Identities

January 19, 2021

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)

Materialized Views and Microservices

January 06, 2021

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 result, or may be a summary…

test

January 05, 2021

testing

Kubernetes Certification

August 07, 2019

It’s been a few years since I became certified in AWS and Azure and it’s now time for something new. I’ve rolled out a few Kubernetes clusters in recent years and believer I’ve a good handle on the pros and cons versus some of the public cloud native…

Flexing those Java generic PECS

May 01, 2019

I believe I’ve previously covered c# generics covariance and contravariance in the past, now it’s javas turn As you may or may not know The term PECS stands for “Producer Extends, Consumer Super,” which is an odd acronym coined by Joshua Block in his…

VS2019 Docker ASP Core Environment Vars

January 03, 2019

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 picture of cats then sorry but leave a comment how you got here Step 1 Create a new text file, the name doesn…

Azure AD Angular7 .net Core 2.2 ADAL

December 27, 2018

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 be aware, Azure AD has two…

Setting your C# language level

August 16, 2018

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 enables your project to make use of…

C# Concurrency lesson–Barrier to entry

August 15, 2018

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

C# Concurrency lesson–SemaphoreSlim

August 14, 2018

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

Pulling ECR images into AKS

July 25, 2018

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 permission but, in order to pull such…

Welcome to BlogEngine.NET

May 20, 2018

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

Serverless on my server

March 21, 2018

So I’ve been looking for a serverless framework that can run on-prem and in the cloud, I’ve been leaning towards OpenFaaS as it appears to be gaining more traction, however I love Azure functions and though let’s see if this is a viable solution. I…

Kotlin: A better Java

November 23, 2017

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 are a lot nicer to work with…

Effective Software Development 2017

July 17, 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 employ these ideas and approaches…

Powershell Oracle Db Backup

April 25, 2017

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)) Set-Alias sz "$env:ProgramFiles\…

Azure Logic Apps– Lesson 1 - Quick Sample

February 22, 2017

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 do is create a few videos instead, I’m going for a warts and all approach so I’m not editing the videos before…

Out with the old in with the new(er)

January 03, 2017

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 how 2016 was from a professional…

Azure DB is much slower than AWS, why?

July 11, 2016

This is a rather unusual post for me, while I’ve gone to the trouble of getting certified on both Azure and AWS platforms and try to make my posts on the same as unbiased as possible, the fact is that I’m pro Azure, and always have been, perhaps it’s…

Azure vs. AWS Text to Blob with SDKs

June 08, 2016

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 it a little more interesting…

Certification

May 26, 2016

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.

Media Indexing In the Cloud

April 01, 2016

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 ago, within reach of anyone…

Cloud costs: Shut those VM’s down

March 20, 2016

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

Web App deployment to AWS and Azure

March 15, 2016

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 is at this stage is the show to get started deploying a new application to AWS and to Azure from…

AWS or AZURE

January 17, 2016

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 came of it and my trial expired…

Typescript Gang of 4 Series

December 09, 2015

When I started out writing this blog way back circa 2008 timeframe it was fully focused on .NET tech, things have changed with time and while .NET is still my second love (my first love was C++) I now find myself in a multiple of different language…

IE 11 Disassembly

November 10, 2015

So I’ve been looking at an issue for a client today where by 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 agree that it’s not very…

A web app in minutes, java and .net

July 06, 2015

In this post I show you how to generate a shell for a web applications 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 web application on either…

WebAPI OData DTO

April 22, 2015

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 when trying to access the…

IntelliJ Application Servers Greyed Out

April 16, 2015

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 config: Once this is done…

Not accepted here

February 24, 2015

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 (which in itself is a good idea…

Azure, Sql User invalid from Azure Website

January 18, 2015

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 problem was that even though my…

Tech of the week

January 01, 2015

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 Stacks I’ve written UX…

Prevent angular event bubbling

October 27, 2014

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

Angular Form Validation

October 25, 2014

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 practise. The screen cast shows how to add validation to forms the Angular.JS way.

Angular.js Auth with ASP WebApi2

October 17, 2014

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 write a big long blog post on…

NDepend

October 13, 2014

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 not got the time right now…

WebAPI OWIN and HppClient Authorize

October 07, 2014

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# HttpClient, the problem was…

Writing to an Azure Queue

August 15, 2014

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 setup, consider the following code… What…

Fun with expressions

August 14, 2014

Anyone that’s dealt with Linq will undoubtedly have encountered expressions, this post how provide an expression in your class to consumers of this class. Scenario We would like to set some properties of an entity using expressions, also we’d like to…

Azure WebJob triggering on BlobUpload

July 29, 2014

Tonight I’m going to follow up on my previous post where I promised to show you how to react on somone/something uploading a Blob. Please readhttp://azure.microsoft.com/blog/2014/06/18/announcing-the-0-3-0-beta-preview-of-microsoft-azure-webjobs-sdk…

Uploading a Blob to Azure container

July 26, 2014

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 application. NUGET Given we are…

Broadband in rural Ireland

July 15, 2014

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 its possible to get +20mbps broadband. I achieved this by load balancing a fixed…

So what is this – javascript

May 26, 2014

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 the invocation pattern this can…

Angular.js .NET File Upload

May 23, 2014

In this post I’m going to show you how to upload a file using Angular.js on the client side and Asp WebApi on the back end. Lets get started Create you project in visual studio, and add your angular.js app controllers etc. Interestingly enough I’ve…

Why Java Sucks

April 28, 2014

http://2014.javazone.no/videos.htmlAn ex colleague of mine sent me this link this morning. www.whyjavasucks.com Apparently I got associated with it, haha, yes at one time I used to shoot down java at every occurrence, this was most likely because I…

IDE’s and tools

April 12, 2014

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 WebsStorm on black/dracula themes at the moment and a week on I’m kinda sold, the…

Idiot’s guide to Angular service vs factory

April 11, 2014

You won’t believe the amount on 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? Factory * if you don’t know…

Recursive Directives Angular.js

March 08, 2014

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 of yet unfinished css and bad…

Be careful of deferred execution

January 31, 2014

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. ToArray() One solution is to…

Efficiency Yield

January 31, 2014

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 with another use for yield. Take…

Enum on steroids – java

November 22, 2013

Hi 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"), TEST("http://server2:800…

Garbage Collection in the JVM (1.6)

November 07, 2013

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

BOOM! Bye bye iPhone, again…

September 24, 2013

So I’ve splashed out the 600euro 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 I’ll admit it’s starting to…

C++ ACE

September 17, 2013

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 life sure but it’s not got…

Using MVC5 Owin Security with EF Code First

August 16, 2013

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 documentation on this and I actually…

Parameterized Unit Tests with JUnit

July 31, 2013

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 set add the annotations you see below and set your inputs and expected outputs. (Arrange and…

Xamarin a few weeks on

June 13, 2013

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 some nice Objective-C widgets…

Xamarin UIDeviceFamily

May 17, 2013

I was releasing an app to the 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 key must be present when…

To Xammer or not to Xammer

May 04, 2013

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 passable, mainly because I’ve only…

File Upload MCV4 Web API, Knockout.js

April 22, 2013

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 expense tracking system at…

ASP MVC4 Web API file upload: Unexpected end of MIME

April 03, 2013

So I’ve had a problem uploading a file using a 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 First dose of Man Flu this year, I…

Enabling Facebook OAuth in MVC4 SPA

March 09, 2013

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 you application. Step 1. Enable OAuth login using Facebook, Twitter Steps to…

JAX-WS, Eclipse, JBoss

February 16, 2013

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 windows machine watching some film…

Customization of WebApi

February 05, 2013

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 sort if you request xml you…

Eureka moment

January 28, 2013

After all these years, where I’ve modified connections 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 is a new feature of VS201…

Removing sensitive data from git

January 28, 2013

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 sensitive data from git. Here…

An image button in iOS

November 28, 2012

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 a noob with iOS dev still…

The lazy singleton pattern revisited.

October 30, 2012

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

That pesky iOS keyboard again

October 18, 2012

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 connections pane and Crtl drag…

Add XCode 4.3 project to git

October 17, 2012

So I’ve just submitted an application to the apple app store. I’ve been using XCode snapshot feature and skydrive all along, now I wanted to use a source control system as I’ve done all my professional live. Given I’ve a github account it’s a good a…

IPhone: remove the IOS Keyboard on Return

September 18, 2012

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

SignalR chat on Azure

September 13, 2012

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 the time of writing Azure…

Kendo Datasource & MVC4 WebApi, you broke my heart

August 31, 2012

So I’ve spend many a sleepless night this week knowing that the webapplication i was working was not doing server side paging… This morning I decided I needed to remedy that and was I in for an experience Smile At first I was thinking why oh why had…

ASP MVC4 WebApi Delete 404

August 30, 2012

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 need to add this setting or…

KendoUi Web Grid and ASP MVC Web Api

August 23, 2012

I’ve just been through the mill trying to get kendo grid working with a ASP MVC Web Api Http Post Action. I think it may help someone if I post my findings. OData If you use KendoUi you know that the datasource has v.good support of OData, but you’ll…

Knockout.js accept terms and conditions checkbox and submit button

August 14, 2012

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 the input of id “agree” has bound…

XCode disabling ARC for a single file in a project

August 08, 2012

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 Monotouch approach and to be honest I…

Using DataTables.net with Asp MVC Web Api

July 07, 2012

So I’ve been working on 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 and is a RestAPI. Now I’ve never…

Ninject Dependency Resolution in ASP MCV4 WebApi

July 06, 2012

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

Pry it from my cold dead fingers

May 31, 2012

_I usually try avoid getting into the OS / Browser etc drama, yawn…. _ But I found this blog post on Pluralsite tonight, and I can help but laugh, I’m with the 72% it turns out, I am asking myself did I pick that option because it was just funny…

Using NinJect MVC with WebApi Beta

April 27, 2012

Tonight ( <-- how sad is that). I started working on a work related REST API, and iPad client The Rest API will eventually sit in a Java Application server (JBoss/Wls etc). However even though I’ve done my fair share of java programming in recent…

Authenticate, Authorise WebApi with HttpClient

April 17, 2012

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 test server that has a Json…

Deserializing Json

April 11, 2012

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 approaches, many poeple are…

ASP WebApi query single entity

April 09, 2012

What’s wrong with this? The problem is the variable name used for getting a single user the function would never be called. E.g. if we put http://localhost:65487/api/users/1 into our browser what will happen is the GetAll gets called! What we need to…

Using RavenDb with Mvc WebApi

April 07, 2012

I’m starting this post with a disclaimer. I’m not a RavenDb expect, 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 place. I read about RavenDB in a…

Linq DistinctBy

April 05, 2012

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 Distinct() extension method. However…

Vs11 Xml

April 05, 2012

I’m working with an XML document all morning, and for the hell of it I decided to open 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 classes! BOOM!! Loving VS11…

Uploading a file in MVC4 C#5 .NET 4.5

April 04, 2012

Back on the bleeding edge again Hot smile 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 pictures (nothing special…

Using jQuery UI Autocomplete

March 21, 2012

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 application Add jQuery UI (use…

Async MVC Controllers

March 14, 2012

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 new, how it will affect me and how I could leverage it in future…

Layout in Windows Phone 7

March 04, 2012

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 Saturday working on a Win…

Reading a file in windows 8 CPP vs CSharp

February 24, 2012

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 architecture, I don’t expect to…

jQuery and WinRT

February 24, 2012

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 write a web app without…

Reading a file in Windows 8 html5 js

February 24, 2012

Hi again, this is my last post were 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 / html I have to admit, this…

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

February 21, 2012

Those of you that started out in windows c++ like me are likely familiar with COMPunch, COM+Ghost, DCOM Ninja If you stayed in unmanaged land then you’ve probably still very familiar with, ATL, HResults etc. However if on the other hand, like me, you…

Visual Studio you rock.

February 09, 2012

I’m 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 Visual Studio you rock! I…

Converting EPM operations to Tasks using the TPL

February 05, 2012

Previous post Overview The Event Programming Model (EPM from her on in) was introduced in .NET 2.0, it’s purpose was to serve as a simpler pattern for asynchronous operations than the Asynchronous Programming Model (APM / IAsyncResult, see my…

Strategy pattern

January 30, 2012

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. It’s purpose is to Encapsulate a family of related algorithms such that they are callable…

Converting APM operations to Tasks using the TPL

January 01, 2012

Those of you have 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 advocate .net 4.5 in the…

An invisible Azure Message

December 29, 2011

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 trade-off between expected…

Azure Service Bus

December 28, 2011

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 last few months Microsoft have…

Migrate SqlServer DB to Azure Sql

December 27, 2011

Here’s one way to migrate your SqlServer 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 database Choose the objects you…

Azure Tools

December 21, 2011

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 and I get an error Microsoft…

Synchronize you controllers when necessary

December 04, 2011

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 web services using methods like…

jQuery and a little bit of javascript

November 27, 2011

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 Smile just have an idea that I’ve not seen anywhere else (no I’m not telling you what it is until the site is live Winking…

Full height divs in html5

November 26, 2011

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 to ensure that all different…

Supporting WSE plain text password with WCF BasicHttpBinding

November 16, 2011

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 happier. The solutions is as…

ASP MVC Display Templates

November 07, 2011

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 interesting to show. Of course…

CSS and custom jQuery filter selectors

November 02, 2011

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. @contains, :disabled, :not(selector), :parent, :password, etc etc, more info…

Watch that error stream with Java process executions

October 19, 2011

I’m executing a windows process from java and I was bitten by a nasty oversight in one of my project today. Everything’s been working fine for some time, but today the application I’m calling started spitting out errors to the error stream. However I…

VS2010 C++11 Variadic Templates

October 10, 2011

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. Lets take c# to explain what we’re talking about: Take the Action generic delegate, there’ 16 of them…

Silverlight Fluid Motion

September 19, 2011

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

MVC Mailer on NuGet

September 10, 2011

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 dependency 'T4Scaffolding (≥…

Android

August 30, 2011

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 giving I’ve been in software for nearly 15 years now…. 2 hours for a hello world… Listening to .net rocks and…

EF 4.1 Code First Database re-create

August 28, 2011

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

Async Workflows in ASP.net

August 24, 2011

So tonight I’m going to show you one way on calling async workflows from ASP.net. I’ve decided to use web forms this time as I’m living in MVC land and it’ll help me keep the finger in. So lets take a look at the app we’re trying to build Client is a…

HTML 5 Audio

August 15, 2011

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 – Arguably the best default…

smart_ptr in java 1.7

August 12, 2011

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

Why I love the Task library

August 10, 2011

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 sync context). Parallel task…

Sample html5 canvas drawing

August 07, 2011

So how hard is it to draw on a 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 rectangle for example are…

var keyword comes to c++

August 07, 2011

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 Smile, it’s magnificent especially in linq, infact linq could become quite painful without it (and also…

scoped_ptr in C#

August 05, 2011

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 Sample usage: P.s. I know creating an object to reset a boolean is a bit of overkill, but see my comments and argument for…

C++ 11–shared_ptr

August 04, 2011

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, it’s not a book on hibernate…

Tip: Auto Logon with Windows 7 User account.

August 04, 2011

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 + ENTER The User Accounts window…

MVC Action Filters

August 03, 2011

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? Sarcastic smile Well lets discuss…

Specifying CSS classes and html attributes with MVC helpers

July 16, 2011

Ok you’ve finally got you MVC controller and models all wired up, you 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 your html helpers. Button sample…

Progressive Enhancement with Modernizr

July 15, 2011

If you’ve been to a 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 detecting features and…

Ain’t she sweet

July 05, 2011

Nothing, really ground breaking, but don’t it look neat! (if i say so myself). (that facebook link will be going up alongside flicker/twitter when i get around to it.). Site written in asp mvc3/ jQuery / razor / graphics in photoshop and content…

Charts in MVC3

July 04, 2011

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 new chart and write it to…

Global MVC Helpers

June 25, 2011

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 MVC, given it was a green field…

jQuery–Preventing default link behaviour

June 16, 2011

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 preventDefault(); on it to stop…

Keyboard window shortcuts Win7

June 12, 2011

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 to the left of the screen [Win…

.NET 4.0 Code Contracts

June 10, 2011

Yesterday I read an interesting article on a flight home from Amsterdam and though I would share it with you. One of the generally excepted approaches of writing functions is to validate you input arguments before using them, If-Then-Throw pattern…

jQuery Template Example

June 07, 2011

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 default webpage where I’m presenting…

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

June 05, 2011

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 drive knows to hurry the hell up…

Ajax with jQuery

May 17, 2011

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 Smile So I’ll show you how you can request some JSON data from a MVC action using jQuery, You are probably familiar with AJAX…

The happy life of a web developer

May 09, 2011

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 bit of xcode thrown in for good…

RIA Service in 5 minutes

April 27, 2011

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 (is case you didn’t take my advise and go look it up Punk…

ASP Glimpse Module

April 20, 2011

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

Cloud Computing (Azure) here I come

April 19, 2011

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 where it all started for me…

RESTful WCF Services

April 19, 2011

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 behaviour. In fact, WebGet…

ASP MVC Controller Exception handlers

April 11, 2011

When you crate a new MVC project a view called Error.aspx is created for you in the Views/Shared folder. To instruct controller actions to use this Error handler you need to use the HandlErrorAttribute action filter, this is the default exception…

Linq

March 08, 2011

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

Dynamically load html into a div using jQuery

March 05, 2011

Mucking about more and more with jQuery now that’s 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 add it to the site); this…

Automatically Scaling Telerik Radial Guage

March 03, 2011

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 business process management…

Asp MVC Entity Framework and Data annotations

February 28, 2011

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 T4 code generation templates Use…

Create those delete views

February 27, 2011

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!

SqlServer 2008 Prevent Saving changes

February 27, 2011

When you modify a table in SqlServer 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 below

SqlDatasource Strict Concurrency Checking–Simplistic approach

February 23, 2011

Lets say you have simple UPDATE command Now, lets assume that two end users of your system have already requested information for SEC_USER Bill whose a male janitor. End user 1 updates Bills Department as he’s been promoted to CEO (hey it not…

Using Telerik RadScheduler with MVC3

February 23, 2011

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 strong and will be for a long…

I’ve achieved my coding certification

February 22, 2011

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.. authoritative.. nature of said…

Too easy to be simple

February 21, 2011

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 stone to the the wonderful world…

@helper / razor

February 10, 2011

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: enjoyThumbs up

DRY out your MVC Views

February 09, 2011

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 covered in this post) Partial…

Razor…

February 08, 2011

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 ASP.NET Web application…

Retrieving stock quotes in C#

January 26, 2011

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

How to deploy apps to your windows phone 7

January 23, 2011

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/ (remember have your phone…

WP7

January 21, 2011

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 Rolling on the floor laughing…

SQL Server 2008 Calculation Variables

January 19, 2011

SqlServer 2008 has a short hand/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 operators, *=, –=, /=

Thread starvation in MVC

January 17, 2011

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 synchronously, the thread that…

The future is live

January 16, 2011

Probably like a lot of other computer people I find myself working with more than one computer. There in lies the problem, is it worth the overhead of manually having to synchronize all these pcs? Sure source code is and always has been handled by a…

Hello IIS 7.5 Express

January 13, 2011

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 than a service. Cassini…

MVC3 Released

January 13, 2011

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, better dynamic support, and…

Not just a new look for 2011

January 13, 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 Wndows Live Writer, and click of the mouse posting them to www.briankeating.net, no more manually fighting with…

From Oracle to MSSqlServer

January 07, 2011

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

Oracle Database Restore

January 04, 2011

How to create an oracle user/schema and resore an existing database to this new schema. drop tablespace xxx_demo_data including contents and datafiles; CREATE TABLESPACE xxx_demo_data DATAFILE 'd:\oradata\abci\xxx_demo.DBF ' SIZE 10M AUTOEXTEND ON…

Open Redirection Attack prevention

January 04, 2011

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. [code:c#] [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if…

Asyncronous WF4 activities

January 02, 2011

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 WF4 it's pretty much the same…

ReHosting the workflow designer

December 20, 2010

If you've attempted to host the workflow designer in .net <= 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 training kit and you'll see for your…

SQL Server Check Constraints

December 20, 2010

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

WF4 WriteLine testing using extensions

December 17, 2010

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 console. [TestMethod] public…

HowTo: Consume WCF From WF4

December 15, 2010

Hi all. I've discovered this is not as simple as it would appear to be. Infact 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. Add a reference to this new…

It's my football and I'm going home

December 13, 2010

We've all created API libraries, and libraries by their nature encourage resuse. 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 assembly has the same public…

Xaml gotya

December 06, 2010

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 spend my time playing with WF4 and MVC2. Anyway in screenshot below.. vs…

Moq

November 18, 2010

How many of you create your own mocks? I've recently been using Mocq 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 client that were using 3.…

Silverlight extra day of PDC...

November 17, 2010

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 a INETA User Group Leader or INETA Country…

IE9 Beta

October 24, 2010

A word of warning: Don't do it :-) I'm v.guilty for 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 interview with Phil Hack and there…

MVC Binding restriction

October 10, 2010

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. [code:c#] [Bind(Include="ID,Name,Description")] public class Loler { //entity framework…

vs2010 parallelism

October 03, 2010

Take some time to explore the new vs2010 debugger. Those of you to 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 tasks/stacks in vs2010 and see just how…

Linq in asp.net

September 25, 2010

A quick sample of how to use linq in your webpages [code:c#] <% Model.ToList().ForEach(item => { %> <%: Html.ActionLink("Edit", "Edit", new { id = item.AlbumId })%> | <%: Html.ActionLink("Delete", "Delete", new { id = item.AlbumId })%> | <%: Html…

Workflow Arguments how to

September 10, 2010

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 the properites you've just…

MVC Stories

September 08, 2010

Hi All, Been a while since I've writen 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 on MCV2. Here's on gottya.. Be…

Syncronization Context

September 08, 2010

A sample of using SyncronizationContext to post a message back to the UX thread [code:c#] private void Window_Loaded(object sender, RoutedEventArgs e) { SynchronizationContext ctx = SynchronizationContext.Current; ThreadPool.QueueUserWorkItem(…

WCF 4.0 File-less Activation (.svc less)

August 11, 2010

http://url/abc.svc .svc at the end of url makes it user unfriendly. It also makes it Low REST service as it donot follow the REST URI principle. Till date developers have to overcome this limitation by implementing URLReWrite module in IIS. Writing…

Output and Encoding in ASP.net 4.0

June 29, 2010

Pre .NET 4.O Prior to ASP.NET 4.0 (and especially with MVC) when a user outputted information to a webpage they used <%= Server.HtmlEncode(modelViewStore.Content) %> The reason for the Encoding is primiarily to prevent XSS (cross site script…

WaitCursor and MVVM

June 03, 2010

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

INotifyPropertyChanged diagnostics

May 13, 2010

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 the implementation stage…

WPF ListViewItem Commands with MVVM pattern

May 12, 2010

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. [code:c#] TargetType="{x:Type ListViewItem}"> Value="MouseDoubleClick" /> Value="{Binding ElementName…

Windows special folders enum

May 11, 2010

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. [code:c#] Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) [/code] See Environment…

Exposing OData with WCF Ria Services 4.0

May 03, 2010

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 seeming it being a Bank Holiday and, if you follow any of my posts, you'll know I don't spend a lot of time writing them up, they are…

Preserving ListView state

April 29, 2010

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. [code:c#] xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http…

Linq to Xlsx

April 26, 2010

A sample how to read a Excel 2007/2010 using Open XML SDK V2 (forgive the bad syntax highlighting) [code:c#] using System; using System.Collections.Generic; using System.Linq; using System.Text; using DocumentFormat.OpenXml.Spreadsheet; using…

.NET Concurrency

April 16, 2010

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 optimistic concurrency for long…

LINQPad

April 16, 2010

If you've not used nor know what LINQPad is...... tut tut tut Download it form here http://www.linqpad.net/ it will make your life easier, infact you'll wonder whatever you did without it... So how does it help...? try it and see :-)

Type Equivalence Embedded Interop Types

April 16, 2010

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 information for COM types from…

Declarative Ria Data and Controls

March 24, 2010

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 samples.... If you've not looked…

Expression blend visual states

March 23, 2010

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 screen show for sample logged in state. If you don't know how to use…

Providing Security in RIA services

March 23, 2010

If you wish to prevent clients accessing your data [code:c#] [RequiresAuthentication] [EnableClientAccess()] public class LolerService : LinqToSqlDomainService [/code]

Popups in wpf

March 17, 2010

Here is come code to show a popup in wpf, i've nothing in the popup at the moment, just a gradient background and border. [code:c#] Width="{Binding ElementName=bdrCalendar, Path=ActualWidth, Converter={StaticResource MarginValueConverter}}" Height…

RIA Services

March 15, 2010

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 pay for it. Being able to focus…

Filtering data in Silverlight

March 06, 2010

Ever want to filter data in Silverlight? here's a simple example that uses a lambda expression to search on name (case sensitive) [code:c#] ComboBox cbx = ((ComboBox)sender); ICollectionView dataView = CollectionViewSource.GetDefaultView(this…

Cocoa Is My Girlfriend

March 03, 2010

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 (or if i had a pc powerfull…

Silverlight 4 Databinding and VS2010

March 03, 2010

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 improvments that brings it closer to WPF TargetNullValue - lets you specify the what to display…

Silverlight and WPF

March 02, 2010

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 :-( Thats a second thing I've found lacking as I move some code…

Different views in WPF/Silverlight

February 25, 2010

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 I didn't want…

C# 4.0 Dynamic Keyword

February 24, 2010

"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. "var x = E" declares a variable…

C# on the iPhone

February 24, 2010

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 emails... but nowadays bandwidth is…

WPF Textbox changing validation

February 23, 2010

Here's how to ensure that databinding happens when the value of a textbox changes. (as apposed to loosing forcus for example) [code:c#] [/code]

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

February 22, 2010

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

Anonymous delegates and Lambdas

February 22, 2010

Just a sample that may catch you eye as unusual.. [code:c#] class WorkItem { public WaitCallback Callback; public object State; public ExecutionContext Context; private static ContextCallback _contextCallback = s => { var item = s as WorkItem; item…

Silverlight Multithreading and the UI

February 21, 2010

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? [code:c#] static bool IsUiThread() { return Deployment.Current.Dispatcher.CheckAssess(); } [/code]

Checked GroupBox

February 17, 2010

Here's a bit of code that i'm using in an application to give this result (Checked GroupBox) [code:c#] Validity [/code]

Data Validation in Silverlight (Method 1)

February 14, 2010

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 Cool) [code:c#] public string Name { get { return _name; } set { if ( value.Length…

Linq to SQL

February 02, 2010

Requirment: Nothwind Sql Database Advantages of Linq to SQL While everything with Linq to Sql ca be done with Ado.Net, there are a few advantages Less code: you don't need to write ADO.NET code for querying the database. You can use a tool to…

Anonymous delegates and event execution

February 02, 2010

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 [code:c#] public event CompleteTaskExecutionHandler…

WPF...Cool 3D browser

January 29, 2010

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

Extension Method for Wpf Window with Froms Owner

January 28, 2010

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

Sql Server Compact Edition

January 26, 2010

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 out of another little app I have…

WPF Grid splitters

January 15, 2010

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

WPF Routed events

January 07, 2010

Ever have a control on a window and want to be able to receive button clicks from this child control? More than one I've done this the hard way, but now..... [code:c#] public VariablesWindow() { this.InitializeComponent(); variables.AddHandler(Button…

Key modifiers

December 22, 2009

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 [code:c#] if((Keyboard.Modifiers & ModifierKeys.Shift) != ModifierKeys.None) Trace.WriteLine…

A Custom Diagramming Library

December 05, 2009

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 doing much with the…

WPF Data Triggers

December 04, 2009

Today I needed to control the enabled property of a button "Remove Item" on my form depending on weather there was a selected item in a Listbox. Here's how [code:c#] [/code]

.NET DateTime Webservices UTC

December 02, 2009

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 local time make sure to call…

Expression blend for WPF/Silverlight 4

November 25, 2009

Announced at PDC this week http://www.microsoft.com/downloads/details.aspx?FamilyID=6806e466-dd25-482b-a9b3-3f93d2599699&displaylang;=en Finally a version of blend that will open vs2010 projects (and of course handle Wpf4 and Silverlight 4) It will…

Configuring IIS to host WCF services

November 05, 2009

It's true what they say, to learn new technologies it's simple 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 the it sinks in. Like tonight while trying to host a…

BlogEngine and Silverlight

November 05, 2009

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 Silverlight3 needs an tag. So I created a user control with the object tag and some script…

Windows Forms Validation

November 05, 2009

One approach for validating child controls on windows froms 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 ensure the validation routine on…

WPF ErrorList

November 05, 2009

http://errorlist.codeplex.com/ ErrorList I recently wrote a control that tries to replicate the error list seen in Visual studio. The control is dependant on .NET 3.5 SP1. because it uses the WPFToolkit. I'm hosting a sample here. [Update August 201…

Inline XML Linq manipulation sample

November 04, 2009

A quick example of inline xml and Linq Code [code:c#] void LinqToXmlSample() { Console.WriteLine("{0} : Start", new StackTrace(0, true).GetFrame(0).GetMethod().Name); XDocument xDocument = new XDocument( new XElement("people", new XElement("person…

Blend Button Design

November 03, 2009

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. <http://electricbeach.org/apps/Silverlight Button Control Styling Tips/Default.html> Brian.

Resource Cleanup and Lambda Expressions

November 03, 2009

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

Visual Studio Project Dependencies

November 03, 2009

Adding project dependencies on Visual studio is done automatically with .NET projects when Add Reference dialog chooses another project from your solution. However you can get Visual Studio to add project dependencies if no explicit intra project…

Another www.briankeating.net

November 01, 2009

Hello and welcome. So I've started blogging... lets 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 to improve upon was my ASP.NET…

Test syntax highlight

November 01, 2009

Testing the syntax highlighting option with the blog engine. [code:c#] int test = 0; [/code]

Windows Workflow 4.0

November 01, 2009

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 enormous: custom activities take…

Testing Silverlight

November 01, 2009

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 controls/SilverlightControl.ascx]