Click here to Skip to main content

Articles by Morten Nilsen (Tip/Tricks: 5)

Tip/Tricks: 5

RSS Feed
No articles have been posted.
No blogs have been submitted.

Average tips rating: 4.50

HTML / CSS
General
Posted: 22 Nov 2010   Updated: 22 Nov 2010   Views: 5,189   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
From what I understand of best practices in the JS world, one should not use the new keyword very often.For this example, I would suggest this as an alternate approach:Create a new script file arithmetic.jsvar Arithmetic = function(){ var obj = { add: function(a,b) { return a +...
Database
General
Posted: 24 Nov 2010   Updated: 24 Nov 2010   Views: 1,119   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Unless you are placing this code in a stored procedure, you could just as well do this:SELECT *FROM ( SELECT 'A1' AS String1,'B1' AS String2, GETDATE() AS DateCol UNION ALL SELECT 'A2','B2', GETDATE()) AS dORDER BY And then append the sanitized column name to sort...
Algorithms & Recipes
General
Posted: 22 Nov 2010   Updated: 21 Dec 2010   Views: 3,780   Rating: 5.00/5    Votes: 5   Popularity: 3.49
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Here is my take on the same, using Lambda expressions and slightly more advanced regular expression features:I have not tested this code, so errors may exist.This implementation will ignore unrecognized tokens. namespace Postfix { class Parser { static Dictionary<string,...
Programming Tips
General
Posted: 22 Nov 2010   Updated: 22 Nov 2010   Views: 6,255   Rating: 3.50/5    Votes: 2   Popularity: 1.05
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
Shows you how you can attach a viewmodel to your WPF window using attached properties, rather than setting the DataContext to a static resource or in code-behind
Posted: 22 Nov 2010   Updated: 22 Nov 2010   Views: 1,856   Rating: 0.0 / 5    Votes: 0   Popularity: 0.0
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
I also have implemented a MarkupExtension to set the DataContext, which looks like this:[MarkupExtensionReturnType(typeof(ApplicationControllerBase))]public class ApplicationDataContext : MarkupExtension{ private Type dataContextType; public ApplicationDataContext(Type...
No reference articles have been posted.

Morten Nilsen

Norway Norway
No Biography provided


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 22 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid