AngularJS – Triggering code whenever ng-view updates

//Create the modulevar app = angular.module(‘someapp’, [‘ngRoute’]);//Config the routesapp.config(configRoutes);function configRoutes($routeProvider) { $routeProvider .when(‘/’, { templateUrl: ‘/angular/viewtemplates/admin/index.html’, controller: ‘AdminController’ }) .when(‘/categories’, { templateUrl: ‘angular/viewtemplates/admin/categories/index.html’, controller: ‘CategoryIndexController’ })}//Make sure we are notified whenever the ng-view is updatedapp.run(function($rootScope) { $rootScope.$on(‘$viewContentLoaded’, function() { $(‘table[data-toggle=”table”]’).bootstrapTable(); });});

Installing Ruby on Rails, RubyMine and MongoDB on Ubuntu Linux

Here are some really basic instructions which should work on a virgin installation of Ubuntu Linux.  I tried following some instructions in a book but they were awful, these are what I ended up with. Install some installation helper tools etc sudo apt-get install build-essential git-core sudo apt-get install curl bash -s stable < <(curl …
Continue reading Installing Ruby on Rails, RubyMine and MongoDB on Ubuntu Linux

SpinLock SynchronizationLockException – The calling thread does not hold the lock

Here is the code from a console app. using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace ConsoleApplication48{ class Program { static readonly SpinLock SpinLock = new SpinLock(); static void Main(string[] args) { bool lockTaken = false; try { SpinLock.Enter(ref lockTaken); if (lockTaken) Console.WriteLine("Lock taken"); } finally { if (lockTaken) SpinLock.Exit(); } Console.WriteLine("Done"); } }} So why would …
Continue reading SpinLock SynchronizationLockException – The calling thread does not hold the lock

How many times does a day occur within a date range?

Given two dates I need to know how many times each day of the week occurs within that range, so that I can calculate a value where the factor varies by day.  So I wrote the following code which returns an array of integers, position 0 will tell you how many Sundays there are, position …
Continue reading How many times does a day occur within a date range?

ASP MVC Silverlight control not appearing–404 not found

Just a quick tip in case you have deployed your ASP MVC app with silverlight controls in it which are not appearing.  I experienced this recently when deploying to IIS6.  The solution is Open the IIS manager app (Start->Admin->Internet Information Services (IIS) Manager) Expand the local computer node Then expand the Websites nodes Right-click your …
Continue reading ASP MVC Silverlight control not appearing–404 not found

Creating a pooled lifetime manager for Unity

My application has a child container per request, this is because there are a lot of services used in each request which depend upon an IUnitOfWork.  I thought it would be nice if I could define a pool of these IUnitOfWork instances so that any cost involved in creating them is reduced, they can just …
Continue reading Creating a pooled lifetime manager for Unity