Geeks With Blogs
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes.
I just published my personal website. Check it out.

Just found out - very easily - a simple way to add logging (via log4net) to my .Net Web API. Thanks to a "code friendly" post.The whole article is full of useful information, though in this instance I focused on global logging alone.This was accomplished (again, easily) by adding the following to global.asax.cs at app-start or a function called from ......

Over the past couple of months I've added more and more customization to my development machine. So much so, that I'd like to write down what I did in case I'll need to re-implement it - and maybe also help some others who might be interested.

I was sad to find out the "codingwithoutcomments" site was taken down. For the sake of a specific post from there, I went to waybackmachine.com and got that post, and I'm pasting it here.I have no rights on this article, I just think it's important to keep this online for people to read. -so if by doing so might be brake any law or offend any person, ......

Did someone in your company change the port number of your SVN repository, and told you only after the fact?Well, there's a simple solution, to connect existing TortoiseSVN directories to the same place.Use the "Relocate" action of the TortoiseSVN to add the port number, as illustrated at How to change the URL of your SVN repository ......

A short but important talk about ReST, -why we should make our client simpler, how do we do it?Sebastien Lambla talks about "secret agents, assassination attempts and ReST" at Oredev.https://vimeo.com/37... can also watch just the slides, at http://www.slideshare.net/s... Lambla's blog is at http://codebetter.com/sebas... ......

This is long overdo... Just a short and simple example of Partial Function Application. For some good explanations, which also include the difference between Currying and Partial Function Application, check out: http://msmvps.com/blogs/jon... and also this answer on stackoverflow: http://stackoverflow.com/a/... ......

(Credit: Image used is from http://fav.me/d2pz3om, if the author objects, I'll remove it immedietly)As I understand it, Ninject 2.3 will have a .Bind<T>().ToFactory() Method. In the mean time, though, what do we do when we need to bind at run time? Let's say we have a Ninja class, which we want to send off to... well, 'off' someone. The problem ......

Note: This post was edited on 21st December 2011, after the first comment was left by Remo Gloor .Using Ninject in a classic DI scenario, means that only the entry point of you code should have knowledge about Ninject. This is different than using it as a Service Locator, where either all classes know about the IoC Container (Ninject, in this case) ......

Well, after reading the following article, I figured the case Paul Hiles makes is not bad. Not every one wants or needs DI, and granted, in many cases moving from a "IoC Container used as a Service Locator" solution to a "real dependency injection" solution might just be not worth it, I believe that it's a better structure, especially if you're writing ......

This method is a demonstration for use of C# (csharp) Tasks and the Cache object together, to create a nice thread-safe behavior for calculations, and be efficient in the simple don't-repeat-any-action way. public AdsFileInfo GetFileFingerPrint(string filename) { Log.DebugFormat("Trying to get cached file finger print for '{0}'", filename); //First, ......

I hope this link stays up: http://tekpub.com/view/conc... This video explains in a very clear way, how to use Ninject and what IoC (inversion of control) and DI (dependency injection) are. Recommended for anyone who doesn't know anything about those (yet). I wish I'd have found the video back when I was first trying to lace up Ninject into my code. ......

So I've read "Singleton I love you, but you're bringing me down" at http://www.codingwithoutcom... and the articles it refers to. And it makes sense, basically. In my latest code, I created one Singleton (see http://geekswithblogs.net/A... ) and had it hold the ......

*Make sure you read Don't Use Singleton before using a Singleton at all...Go read the whole post at http://geekswithblogs.net/B... 1: public class LazySingleton3 2: { 3: // static holder for instance, need to use lambda to construct since constructor private 4: private ......

12
Jul 11
Functional programming and Monads are a bit complex, and took me a while to understand. Surely, they're very different than OOP. So, I'd like to recommend Mike's World-O-Programming's "Yet Another Monad Tutorial" (http://mvanier.livejournal... as one of the best explanations for Monads. The step-by-step approach allows the reader to decide ......

from http://lanitdev.wordpress.c... Rename Applications and Virtual Directories in IIS7 September 2, 2010 — Brian Grinstead Have you ever wondered why the box to change the name or “Alias” on an application or virtual directory is greyed out (see screenshot below)? I found a way to change ......

A simple and straight forward article taken from http://christopherdeweese.c... which uses WCF REST Service Template 40(CS) Drop the Soap: WCF, REST, and Pretty URIs in .NET 4 Years ago I was working in libraries when the Web 2.0 revolution began. One of the things that caught my attention about ......

public static string ByteArrayToString(byte[] bytes) { return String.Join(string.Empty, Array.ConvertAll(bytes, x => x.ToString("X2"))); } ......

I took this particular code from http://weblogs.sqlteam.com/... a good read. Shows you what to avoid and why. The recommended technique is the following: GROUP BY dateadd(month, datediff(month, 0, SomeDate),0) By the way, in the "select" clause, you can use the following: SELECT month(dateadd(month, datediff(month, ......

Use this when you need to open multiple windows on a regular bassis, such as when deploying manually.


%SystemRoot%\explorer.exe "D:\dev\Trunk\web\Mysite\PrecompiledWeb"



The company I work with had it's DB double its size lately, so I needed to find out which tables were the biggest. I found this on the web, and decided it's worth remembering! Taken from http://www.sqlteam.com/arti... the code is from http://www.sqlteam.com/down... /**************************... ......

The following code is from Ralph Whitbeck's blog. This is really a "cut and save" for me :) When restoring an SQL Server Database, you'll often need to kill existing connections to it, before starting the task. Change databaseName To the actual database name. Use Master Go Declare @dbname sysname Set @dbname = 'databaseName' Declare @spid int Select ......

I ran into a problem where the CustomValidator OnServerValidate not Firing. After a lot of trial-and-error checking, I found out, the problem was that it didn't tolerate the yellow brackets. No errors were thrown, which was very frustrating. This is what didn't work, to make it work, all i had to do was move the error to the code-behind: Normal 0 false ......

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; ......

This regular expression isn't standard, it's Visual Studio syntax-specific, it should invert simple statements such as: Language.Text = record.Language; into record.Language= Language.Text ; The expression itself is: ^{.+}={.+}; ......

Copyright © AngelEyes | Powered by: GeeksWithBlogs.net | Join free