Skip to main content

Posts

Showing posts from December, 2013

Channel 9 series: What’s new in Visual Studio 2013

If you get bored, during the Christmas holidays, have a look at the Channel 9 series: What’s new in Visual Studio 2013 . Developers, are you trying to figure out what Visual Studio 2013 has to offer you? Whether you develop for the web, Windows, or Windows Phone, and whether you are using C#, XAML, HTML, or Visual Basic, this course is for you. It focuses on some of the key new features, addressed individually in sessions throughout the day, so that you can tune in to the specific tools that will help you develop more quickly and easily. Start by learning about the integrated development environment (IDE), and then attend sessions including improved IntelliSense, easier debugging, and better tools for application lifecycle management (ALM).

OpenSSL: Creating an ADFS certificate

Just as a quick reference for myself, here are the required statements to create your own certificate using OpenSSL: Create the ADFS certificate: openssl req -x509 -nodes -days 3650 -newkey rsa:1024 -keyout adfs01.pem -out adfs01.pem-extensions v3_ca Pack the certificate and the key into a pfx file so we can easily import it into the Windows Certificate store: openssl pkcs12 -export -out adfs01.pfx -in adfs01.pem -name "adfs01"

OpenSSL: Unable to load config info from /usr/local/ssl/openssl.cnf

When trying to create a new certificate using OpenSSL, it failed with the following error message: “unable to load config info from /usr/local/ssl/openssl.cnf” This error was an easy one to solve. Just restarting the computer fixed it. Jippie!

Angular.js: Combining $index and orderBy filter

When creating an application with Angular.js, I was using the $index variable inside an ng-repeat to track the index of the current item. The problem was that the moment I start combining this with an orderBy filter, the $index value was no longer correct. I worked around the issue by passing the item itself around instead of the index.  In my function I used the indexOf method of an array. Anyone with a better solution?

NHibernate: Unrecognised method call:Boolean Contains(Int64)

A colleague asked me for help with a complex NHibernate query. He had written a query using the NHibernate Linq support but when he tried to execute the query, NHibernate complained with the following error message: ‘'Unrecognised method call: System.Int64:Boolean Contains(Int64)” Let’s have a look at his query first: It seems that NHibernate cannot translate the Contains() call in a related NHibernate query. To fix this, we switched from the Linq syntax to the QueryOver syntax:

Angular.js: Simple orderby sample

In the Angular.js documentation you can find a sample of how to use the orderby filter. The problem is that this sample is already quite complex and allows you to specify a custom filter based on a predicate value. Here is a simple sample that applies the order filter based on a specific column:

Combining oData and a custom authentication module

If you are looking for a way to integrate oData and custom authentication, I can recommend the following article: Securing OData services using Basic Authentication . There is one thing that you should notice: The moment you start using a custom authentication module, it’s important that you configure IIS for Anonymous Access. Otherwise the built-in authentication modules will kick in even when your own custom authentication module is called. We forgot to change this and it took us some time to figure out why we always got a login dialog although the authentication module authenticated us successfully.

Visual Studio 2013: RunSettings vs TestSettings?

After creating some tests, I wanted to exclude some assemblies from the code coverage. In Visual Studio 2010 this could be done through the .testsettings file. In Visual Studio 2013you’ll notice that a .testsettings file is no longer included in a unit test project. The newer test framework, introduced in Visual Studio 2013, can be configured using a .runsettings file. If you use a .testsettings file, the MSTest test framework will be used to run your tests. This runs more slowly and does not allow you to run tests from third-party test frameworks. The stupid thing is that, although the .runsettings file is the recommended solution, Microsoft only added a .testsettings template to Visual Studio 2013. In the MSDN documentation they mention creating a custom XML file and renaming it, but there is a better solution. In the Visual Studio Gallery , you can find a solution item template that creates a default runsettings file under Solution Items, and saves you from having to do th

Things I learned at NDC London: ElasticSearch River Plugin

After the first 2 days of workshops, NDC London continued with lots of great speakers and sessions. I was planning to share some information during the conference itself but due to technical difficulties I had to postpone it. For the next few days I will be sharing some of the great content. I’m already using ElasticSearch , so one of the sessions I didn’t want to miss was Full Text Searching & Ranking with ElasticSearch . It was a great session overall. One of the things that was new to me was the concept of a ‘River’.  The ‘River’ is a metaphor for the stream of constant data. That constant data stream can come in different forms and from different sources. Rivers in elasticsearch provides you with functionality that listens for changes in another data source and apply them to elasticsearch. Rivers are allocated to nodes within the cluster. They are provided with automatic failover in case of node failure, and allow to store state associated with them. There are multi

Things I learned at NDC London: OAuth integration in ASP.NET SPA template

After the first 2 days of workshops, NDC London continued with lots of great speakers and sessions. I was planning to share some information during the conference itself but due to technical difficulties I had to postpone it. For the next few days I will be sharing some of the great content. Security was one of the hot topics at the conference. With sessions about Layered Security, OAuth, OWASP, Security of ASP.NET Web API, and so on… there was no excuse to follow at least one security related session. One of the things that was shown to us by Dominick Baier was the new OAuth integration in the Visual Studio 2013 SPA template. The SPA template has been completely rewritten and uses OAuth with a bearer token and  OWIN for authentication purposes. Have a look at following blog posts to learn more about it: http://blogs.msdn.com/b/webdev/archive/2013/09/20/understanding-security-features-in-spa-template.aspx http://leastprivilege.com/2013/11/25/dissecting-the-web-api-i

Things I learned at NDC London: The Future of C#

After the first 2 days of workshops, NDC London continued with lots of great speakers and sessions. I was planning to share some information during the conference itself but due to technical difficulties I had to postpone it. For the next few days I will be sharing some of the great content. One of the sessions that got a lot of traction, was ‘The Future of C#’ session by Mads Torgersen. Here is a list of some of the language features the C# team is considering: Primary constructors - public class Point(int x, int y) { } Read-only support for auto implemented properties - public int X { get; }=x; Using statement support for static types - using System.Math; Sqrt(X); Support for Property Expressions - public double Distance => Sqrt(X * X + Y * Y); Improved null checking - if (points?.FirstOrDefault()?.X ?? -1) { } Support for Method Expressions - public Point Move(int dx, int dy) => new Point(X + dx, Y + dy); Inline declarations for out parameters - public void Foo(out

Things I learned at NDC London: Reactive Extensions Training Camp

After the first 2 days of workshops, NDC London continued with lots of great speakers and sessions. I was planning to share some information during the conference itself but due to technical difficulties I had to postpone it. For the next few days I will be sharing some of the great content. I’m a big fan of reactive extensions although I still have a hard time to grab my head around it. During one of the Rx sessions I heard that Netflix contributed a great series of interactive exercises for learning Microsoft's Reactive Extensions ( Rx ) Library for JavaScript as well as some fundamentals for functional programming techniques: This is a series of interactive exercises for learning Microsoft's Reactive Extensions (Rx) Library for Javascript. So why is the title "Functional Programming in Javascript"? Well it turns out that the key to learning Rx is training yourself to use functional programming to manipulate collections. Functional programming provides d

Things I learned at NDC London: Azure Friday

After the first 2 days of workshops, NDC London continued with lots of great speakers and sessions. I was planning to share some information during the conference itself but due to technical difficulties I had to postpone it. For the next few days I will be sharing some of the great content. Today we start with Windows Azure Friday . Every Friday Scott Hanselman tries out some stuff on Windows Azure and shares his experiences. This video series was new to me but I started watching it yesterday and I’m already hooked. You can bookmark the link or add a reminder to your calendar.

NDC London–Day 2

Yes, we survived day 2 of NDC London . With our heads filled with AngularJs, SignalR and Web API knowledge we spent the evening shopping in the Westfield mall after enjoying a delicious meal at one of Jamie Oliver’s Italian restaurant .  I’m still digesting the great food and all the new things we learned.  You can find my sample code here: https://github.com/wullemsb/NDC-London---Angular-Day-2 And here are my notes of day 2 of the workshop. Overriding Services You can overwrite any service bij creating a new factory registration Last registration wins… Decorating Services Add pre- and post processing logic Use $provide.decorator() Service Providers Different way to create services(there are multiple, remember) Use $provide Configure the service during the configuration phase(2 phases as you should know; configuration and run phase) Service Constants Inject primitives as a service Service Values Similar to Constants, can also

NDC London–Day 1

Day 1 at NDC London is over. Learned a lot about Angular.js and looking forward for the next day. You can find my sample code here: https://github.com/wullemsb/NDC-London---Angular-Day-1 If you are interested, I added all my notes during the workshop. You’ll see that we learned a lot Introduction More like MVVM & Silverlight building experience Very extensible framework Forward looking Takes into account future evolutions in JavaScript & HTML Getting started Use Nuget Multiple modules available Angular.core is the only one required Angular does not have any dependencies(!) 'ng-app' : bootstrap element Other starting points Yeoman: does scaffolding(more designed for MAC, Linux) Angular-Seed: gives you an example of how to structure your app https://github.com/angular/angular-seed Ng-directives Default directive syntax is not HTML compliant Will not pass through an H