Blog

How to use Fiddler as an Ad Blocker

By Fernando Mendoza. I’ve been using Fiddler a lot these days. To test how requests and responses go to and come back from the server, being HTML responses, SOAP responses or custom responses from web services. One website I like a lot is StackOverflow; I use it to find answers when I’m stuck with a programming or configuration issue. I like this site, and even though they don’t have too many ads it still bothers me a bit. So one day I was thinking if it was possible to use Fiddler to modify the HTTP response from the StackOverflow server before it’s rendered by the browser. Turns out it’s possible, Fiddler has something called Rules that allows you do that. Let’s see how to do that st...

Beware of RequestUri when exposing WCF REST services through HTTPS

By: Alejandro Villarreal   We recently implemented a WCF REST service which authenticates the caller before executing any of the operations it exposes. It also has help page (so users can see the supported operations and the expected inputs) which we want to expose to any user, regardless of authentication. In principle this is very easy: we just needed to identify requests to the “help” section of our service (http://myServiceUrl/help) and allow them to go through without further validation.   We have a method that returns “true” for requests that should go through, and “false” for those that shouldn’t, so originally our code to solve the problem looked like this:   if (requestUri....

SQL Server: Fix duplicate values for uniqueness constraint.

By: Alejandro Villarreal During database development, unique indexes (or constraints) are very important part of the design. There’s always data for which you do not want to have repeated values, like usernames or email addresses. Different applications might have their own uniqueness requirements, but they all usually have at least one. It’s great when we can identify those requirements from the start and create the appropriate indexes up front. But what if your application now needs to enforce uniqueness on the values of a million-row table which has tons of duplicates in the production environment? A naïve solution (and definitely not appropriate for a production environment) wou...

SQL Server: Tip for Setting up replication in Virtual servers

By: Alejandro Villarreal Debugging replication-related problems can be extremely hard if you do not have access to an environment with the exact same replication architecture where the problem occurred in the first place. As consultants working for several clients, it is not feasible to have an exact replica of each of their environments, so a feasible solution is to set up a copy of the desired environment “on demand”, on virtual machines. This is exactly what we did a couple of weeks back, and although we finally got replication to work, we had to deal with this error first: Error 18483: Could not connect to server '<Server>\<Instance>' because '<login>' is not define...

Powerful Javascript

By Guillermo Cedillo   C# is becoming more like a functional language in every release; by the other side Javascript is a functional language that was treated as a misunderstood-object-oriented-script language ¬_¬. I hope in the next years these two languages become so closer that they share the same basic principles of the functional languages.    Right now I'm looking closer to two technologies that I think they are going to be something extraordinary: RX and LINQ.   LINQ is already a powerful extension to C#, but also there's an extension for Javascript. LINQ gives you a lot of freedom in data manipulation, together with jQuery gives you flexibility and lightness in reports o...