Done some remodelling for our fishes. Ninja fish is hiding in the boat.
Cosmic Funnies

No title available
Game of Thrones Daily
Aqua Utopia|海の底で記憶を紡ぐ
Jules of Nature
$LAYYYTER

Discoholic 🪩

⁂
occasionally subtle
Three Goblin Art

Kiana Khansmith
Claire Keane
Alisa U Zemlji Chuda
wallacepolsom
dirt enthusiast

shark vs the universe
No title available

roma★
Acquired Stardust
trying on a metaphor
seen from United States

seen from Malaysia
seen from Germany

seen from United States

seen from Malaysia

seen from Malaysia

seen from Germany
seen from United States

seen from United Kingdom
seen from Japan
seen from Germany
seen from Malaysia
seen from Australia
seen from United Kingdom

seen from United States
seen from United States

seen from China
seen from United States
seen from United States
seen from United States
@chrispont
Done some remodelling for our fishes. Ninja fish is hiding in the boat.
Cowboy style chilli beef on the go. Strangely the recipe calls for coating the beef in coffee grounds. Lets see what it tastes like. #jamieoliver #FromScratch
Hate the Americanisms that come with writing CSS? Spiffing helps you write in the Queen's English... background-colour: grey !please;
New Siamese Fighter. Am yet to see him roundhouse.
Microsoft Certified C# Senior / Lead Developer For Hire
I'm currently available for hire as a C# Senior / Lead Developer (previously Lead .NET MVC Developer at Aviva in Norwich). Looking for contract roles in London and East Anglia.
I'm a Microsoft Certified Professional Developer (Web Developer .NET 4) and Microsoft Certified Technology Specialist (Web Applications, Data Access, Service Communication Applications)
See my CV here and contact me at [email protected]
Brighton weekend. Beautiful twilight... (Taken with Instagram)
"Adding manpower to a late software project makes it later."
Brooks's Law
My blog used to be self-hosted wordpress and things were running OK (aside from spam and necessary upgrades now and again). I purchased a dedicated server from Poundhost (www.poundhost.com) a while back and moved all of my clients sites across and my blog was one of the last things that needed migrating. I'd thought about simply moving the site and all the associated assets, but I stumbled across a technique for exporting posts from wordpress and importing to tumblr. [image: Inline images 1]
Tumblr is described as a free "micro-blogging" service with built in community and social networking features. I've chosen it for the following reasons...
1. Convenience: By using bookmarklets, mobile apps, phone posting, IM submissions and other tools to post content, it is very fast and very easy to get short-form content onto the blog
2. Customization: With Tumblr you can choose a theme as a starting point but customize it with almost limitless potential. This includes adding advertisements and a custom domain name (as here www.chrispont.co.uk using a CNAME record).
3. Built-In Community: Tumblr is also a network with built-in networking elements that lets you tap into its native audience.
4. Free: :-)
Ponty
56 Different Types of Geek
VMWare AppBlast = Photoshop on your iPad?
VMWare have given a sneak preview of what they will be announcing at VMWorld 2011 in Las Vegas, and one of the interesting products is AppBlast. The company says AppBlast will "provide the universal delivery of any application, including Windows-based applications, to any off-the-shelf browser or device supporting HTML 5", along with an image of what appears to be Adobe Photoshop running within Safari on the iPad. It will be interesting to see how this works exactly and how useable it is in the real world, especially with something as powerful and potentially fiddly as Photoshop. Also announced was Octopus, leveraging VMWare's aquisition of EMC's Mozy Data Protection service to "enable enterprise-grade collaboration and information/data sharing". Sounds (and looks) like DropBox to me, and I'm sure these guys aren't happy about the name.
Using packages in NuGet without commiting binaries to SCM using NuGetPowerTools
As you can probably see from previous posts, I've been using NuGet a lot lately and I definately see it as the way forward for managing dependencies. We've been using a private NuGet server to publish common assemblies build via our continuous integration server, and allows us to push updates out to projects.
The Problem
The issue we had though is that NuGet creates a "Packages" folder and stores the assemblies in there for all of the packages the projects use. This means binaries would likely get checked into source control, and using a system like Git for SCM this means the repository will get bloated really quickly. We needed a solution that would allow us to reference the packages and for Visual Studio to call NuGet to grab the versions of the packages it needed to build. The CI server would also need to do this from the command line or an MSBuild target.
NuGet PowerTools
NuGet PowerTools is the solution! You'll need to use the Package Manager withing Visual Studio (requires you to install Powershell 2.0 if using Windows Vista and below) and run the following...
PM> Install-Package NuGetPowerTools Successfully installed 'NuGetPowerTools 0.28'. ## Constraining Upgrades To Allowed Versions By default, when running the `Update-Package` command on a package (or updating the package using dialog), it will be updated to the latest version in the feed. With the new support for updating all packages, there may be cases in which you want to lock a package to a specific version range. For example, you may know in advance that your application will only work with version 2.* of a package, but not 3.0 and above. In order to prevent accidentally updating the package to 3, NuGet supports constraining the range of versions that packages can be upgraded to by hand editing the `packages.config` file using the `allowedVersions` attribute. For example, the following example shows how to lock the `SomePackage` package the version range 2.0 - 3.0 (exclusive). The `allowedVersions` attribute accepts values using the [version range format](../Reference/Version-Range-Specification). Currently, locking a package to a specific version range requires hand-edited the packages.config file. PM> Enable-PackageRestore Attempting to resolve dependency 'NuGet.CommandLine (≥ 1.4)'. Successfully installed 'NuGet.CommandLine 1.4.20615.182'. Successfully installed 'NuGet.Build 0.16'. Copying nuget.exe and msbuild scripts to D:\Code\StarterApps\Mvc3Application\.nuget Successfully uninstalled 'NuGet.Build 0.16'. Successfully uninstalled 'NuGet.CommandLine 1.4.20615.182'. Don't forget to commit the .nuget folder Updated 'Mvc3Application' to use 'NuGet.targets' Enabled package restore for Mvc3Application
This will remove all of the packages from your packages directory (except for the powertools package itself) and creates a .nuget directory (and as it states above, make sure you check this in). If you check out your project files now (in something like notepad), you'll see an extra MSBuild target is added to the project...
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" />
This references the targets in the .nuget directory, along with some command line cleverness that uses nuget.exe (also in the .nuget directory). You'll now find everytime you build your solution, the packages directory will repopulate itself (but you don't need to check these folders in). Hope this helps!
ASP.NET MVC4 Mobile Views
Whilst Scott Hanselman created a few mobile MVC views a while back, .NET MVC4 brings built in support for Mobile phones and tablets making it even easier to target these devices. Built on JQuery Mobile, these mobile views incorporate everything you'd expect such as collapsible panels and client side validation. To start, simply select MVC4 Web Application, and select the Mobile Application template. You'll see the project includes new jquery.mobile js and css files. Views use the HTML5 data- attributes on the divs to specify the usage and allow the JQuery Mobile template to function correctly. Other than that, this is a pretty standard MVC application. Run the project and you'll see there's a boilerplate .net web application template but optimised for mobile devices, with the usual "About", "Contact" and Login buttons. The login form contains the usual controls, and contains client side validation. You can download the MVC4 developer preview here. Keep it coming Microsoft! :-)
Creating a Private NuGet repository and Creating Packages (Part 2)
For creating a Private NuGet Repository - See Part 1
Creating the Packages
To create the packages themselves, you'll need the NuGet Command Line package installed on your system (this can be installed using NuGet). Next go to the command line and change to your project's directory. Issue the following command...
Nuget spec MyProject.sln
... where MyProject.sln is the name of you solution file. A nuspec file manifest should be created and look something like the following... The dollar placeholders are populated automatically when the package is created from the information given to the assemblies. You can replace these with static fields if you would like. From here, you can simply call the following command to generate a nuget package (a .nupkg file)...
nuget pack MyProject.sln.nuspec
.. however, this tends to generate a package with all of your assemblies and content, along with any third party dependencies. Not what you'd normally want! The way I now generate these packages is to list the files and dependencies in the nuspec file. This overrides everything and ONLY includes those files. At this point it's probably worth explaining the directories listed as the target attribute in the above XML. There are three main folders that NuGet uses in it's package structure - lib, content and tools. Content contains any content you'd like placed in the root of a project that implements your package. Tools contains powershell script files to be run when the package is installed for the first time, every time it is installed and when it is uninstalled. I'm not going to go into too much detail about the powershell scripts, but Init.ps1 will run the first time a package is run in a given solution, Install.ps1 will run every time a package is installed on a project within a solution and Uninstall.ps1 will run when a package is uninstalled. For more info on powershell within NuGet packages see http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package Lib contains folders with specific framework versions with dlls that will be added as a reference for projects implementing your package. Common framework versions are listed below
Tool Target Notes .NET 4.0 net40 Just using '40' also works. .NET 4.0 Client Profile net40-client .NET 4.0 Full Profile net40-full Requires full .NET profile .NET 4.0 Compact Framework net40-cf net40-compactframework also works. Silverlight 4.0 sl4 Windows Phone 7.0 sl3-wp Windows Phone 7.1 (Mango) sl4-windowsphone71 Now run the nuget pack command above and the nuget package will create a file containing only the files you specify. Give the nupkg file a .zip extension and open it and you can check out what's been created. I hope this has been helpful. Watch this space for more .NET info.
UPDATE: "Failed to download package correctly. The contents of the package could not be verified"
We've run into the issue where NuGet plugin for Visual Studio reports "Failed to download package correctly. The contents of the package could not be verified" whilst updating a package. There's a few comments on CodePlex, and I've come to the conclusion that this is because Nuget is requesting a version of the package, which has been cached by the client. Nuget performs some kind of hash check including the version number that it's expecting to receive and the actual package it got, along with a hash value in the package. To solve this issue, click on the Nuget server application in IIS and click on HTTP response headers. Select the option for "Set common headers" (in the side bar) and check "Expire Web Content" along with the "Immediately" radio button. This sets HTTP headers to tell the clients not to cache the packages. References: http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package
Creating a Private NuGet repository and Creating Packages (Part 1)
Most companies have some kind of "Common" framework that houses common pieces of functionality and encapsulates how things such as logging and caching are done at that particular organisations. This is fine if compiled into one or two assemblies, but can be much more troubling to integrate into new projects if other resources are required such as JavaScript files and images. One solution is to publish packages to NuGet, allowing projects to download and implement the package. Assemblies are automatically referenced (using the correct assemblies for the framework version used) and content is placed in the correct directory structure. Powershell scripts can even be used and executed on first install, update and uninstall, and developers are notified when they open a project where a package has an update available. However, if this is bespoke code it's probably not desirable to publish the package to a public NuGet repository. This is where a private NuGet repository comes in useful, and it's surprisingly easy to implement.
Creating the NuGet Server
Open up Visual Studio and create a new ASP.NET Empty Web Application Project. Assuming you have NuGet package manager installed, right click on the project and select Add Library Package Reference. Search for NuGet.Server and click install. You'll see a number of dependencies installed such as NuGet.Core, Ninject and Elmah (you'll need to accept the Ninject agreement), and once installed you'll see a few new folders in your project. The packages folder is where you place the packages you'd like to make available to people who can see your NuGet Server. That's it! Hit F5 and you'll see a webpage with info about the NuGet repository. Publish the project on a web server somewhere within your organisation, taking note of the URL displayed within the page (once published).
Configuring NuGet Package Manager
Now head back to Visual Studio and click Tools > Options. Scroll down to package manager and enter a name and the URL from your repository. When adding a new library package, your new server should show up in NuGet Package Manager. All done! I'll be blogging in the next few days about creating your nupkg files (including the package manifect or nuspec file) to place into the packages directory to allow projects to download and implement.
ASP.NET 4.5, Visual Studio 2011, MVC4 announcements
Some interesting announcements were made last week during BUILD2011, and here's some of the things I'm most excited about.
Changes in the way products are released
Scott Hanselman comments on his blog:
"It's also worth noting that while there is a bunch of stuff in the next version of Visual Studio, there's an equally compelling amount of stuff being released from the Azure/Web Team on NuGet."
It's great that's now so easy to add new packages to an existing project so easily. The days of searching for dll's, copy and pasting config sections around is over. This accommodates more granular releases for smaller pieces of functionality, and as Scott mentions, levels the playing field with other open source packages. Also Nuget is awesome, and I'll be blogging later on creating your own read-only Nuget repository (useful for Enterprise level distribution of "Common" assemblies and dependencies.
MVC4 and Web Pages 2
Support for Mobile Views (something Scott Hanselman had been working on) are part of MVC4, along with new HTML5 templates and new mobile JQuery templates. Web Pages 2 seems quite interesting - a new lightweight framework for data-driven websites where the View and the Controller live in the same file. This seems to be pushed as part of WebMatrix (Microsoft's lighter version of VS for developing with a number of open source frameworks).
Backwards Compatibility for Projects and Solutions (finally!)
I've always tried the latest version of Visual Studio soon after the developer preview is released, and it's always seemed pretty limiting that you can't just open an older project without having to convert it first. Whilst this limitation can be accepted during the previews and betas (as many organisations would frown upon using these for production code), once the RTM release is out it's often months before everyone on your team has upgraded and the projects and solutions can be converted and checked in. Finally Microsoft has listened! VS11 will have the ability to open and save projects and solutions without the need to convert. :-)
Asyncronous Tasks and the "Await" Keyword
I'd been given a sneak preview of this at the Guathon earlier in the year, as demonstrated by Steve Sanderson. The new await keyword allows .NET to do all the hard work when using long running pieces of code, without having to code event handlers etc. See what I mean with the code below...
private async Task ScrapeHtmlPage(object caller, EventArgs e) { WebClient wc = new WebClient(); var result = await wc.DownloadStringTaskAsync("http://www.microsoft.com"); // Do something with the result }
Easy huh? The framework will finish calling the rest of your code without blocking the thread, meaning you can handle more requests, quicker.
Bundling
I've often looked at google's PageSpeed tools and tried to improve the speed of my sites. One trick I've used is an http handler to bundle and minify the css and javascript into 2 compostite files (as this cuts down on HTTP requests). .NET 4.5 gives you this functionality built right into the Routing Engine. For example, to include all of the js files in the scripts directory into one minified file, simply add the following to your HTML source...
<script src="scripts/js"></script>
Similarly, to include all of the css files in the Styles directory...
<link href="styles/css" rel="stylesheet" />
In Summary
Other features are being drip fed on Scott Guthrie's blog, including HTML Editor Support for Smart Tasks and Event Handler Generation, Strongly Typed Data Controls, Model Binding Part 1: Selecting Data and Model Binding Part 2: Filtering Data. The Visual Studio 11 Developer Preview can be found here. There's some fantastic developments coming from Microsoft at the moment to make a developer's life easier and more thorough and I'm excited to see what's coming next.
RoundCube Mail - Configuring LDAP with Windows AD
Took me a while to figure this out today, so I'm posting in the hope that this helps someone out. Below is the config for Roundcube Mail (which is wicked by the way) within main.inc.php. One of the important things here was that without an OU, the search returned no results if left with the default LDAP port of 389. To search the whole organisation (without an OU) you need to change to the Global Catalogue port for Active Directory of 3268. Hope this helps someone! $rcmail_config['ldap_public']['MyLDAPAddressBook'] = array( 'name' => 'MyLDAPAddressBook', 'hosts' => array('192.168.1.1'), 'port' => 3268, // IMPORTANT!! - Change this from default to Global Catalogue Port 'use_tls'=> false, 'user_specific' => true, 'base_dn'=> DC=MYDOMAIN,DC=COM', 'bind_dn' => '[email protected]', 'bind_pass' => 'myLDAPPassword', 'writable'=> false, // Indicates if we can write to the LDAP directory or not. 'search_fields' => array('mail', 'cn'), 'name_field' => 'cn', // this field represents the contact's name 'firstname_field' => 'givenName', // this field represents the contact's first name 'surname_field' => 'sn', // this field represents the contact's last name 'email_field' => 'mail', // this field represents the contact's e-mail 'scope' => 'sub', // search mode: sub|base|list 'filter' => '(&(mail=*)(!(msExchHideFromAddressLists=TRUE)))' , // all mail, except the exchange hidden 'sort' => 'cn', // The field to sort the listing by. 'fuzzy_search' => TRUE); // server allows wildcard search
SQL Row_Number OVER and PARTITION BY
Below is something I've been using for a while now but is very useful code when you have a table containing multiple status records for a single object row (to use one example). The code below shows that you can create a numbering system (partioned by objectID) for each status record. You can then use this numbering system to select, for example, the top row and therefore get back the latest status record (and any associated details). Nothing new, but handy :-) SELECT ObjectID, ObjectName, Status FROM ( SELECT o.ObjectID, o.ObjectName, ,os.Status , (ROW_NUMBER() OVER (PARTITION BY o.ObjectID ORDER BY os.CreationDate)) AS Row FROM Object o JOIN ObjectStatus os ON o.ObjectID = os.ObjectID ) itm WHERE Row =1