//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(); });});
Category:Uncategorised
Windows welcome screen slow
After I log in to Windows 7 the welcome screen stays on for ages, in the past it was almost instant. I’ve tried various suggestions from forums and none of them worked, then it struck me what it was! Windows was trying to reconnect network drives after I had logged in, but one of them …
Continue reading Windows welcome screen slow
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
Decorating Unity extension
First I want to give credit where it is due, the code in this post is based largely on the code I found in this post by Jim Chrisopher.The original code required me to register my decorators before registering the type I wanted to decorate. I didn’t like this because I prefer to register all …
Continue reading Decorating Unity extension
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
C# scripting in .NET
Based on a couple of days of experimenting it seems that I now have C# scripting working in my application to a level that I am satisfied. Because I couldn’t have achieved this without looking at other people’s examples I thought it was only fair that I share what I now have. Firstly I want …
Continue reading C# scripting in .NET
Why I dislike DLR
It took me hours last night to work out why I was getting a null result from the Value property in the following code when accessed via IronPython public interface ISomeInterface{ decimal Value { get; }} How could a non nullable type possibly return a null (or “None”)? It turns out that when I set …
Continue reading Why I dislike DLR
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
