Doubleclick tags – how it works
Quite note, more to myself really, about how Doubleclick ad tagging works. – ad set up in DFP – targetingcriteria set using various key-value pairs – server side calls marketing service provider web service to get data about customer, passing in user ID from cookie – server side component written to dynamically generate javascript code; [...]
HTTP Slow Vulnerability
A relatively new vulnerability is the appropriately named HTTP slow attack that exploits how HTTP works. HTTP slow vulnerability is a DDos attack based on the way HTTP works. HTTP will only process requests once it has received a full header. If an attacker sends this in chunks over a large period of time then [...]
Multiple submit buttons in a single ASP.NET MVC Form
Thanks to Andrey Shchekin for this, copied below in case his blog disappears. public class HttpParamActionAttribute : ActionNameSelectorAttribute { public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo) { if (actionName.Equals(methodInfo.Name, StringComparison.InvariantCultureIgnoreCase)) return true; if (!actionName.Equals(“Action”, StringComparison.InvariantCultureIgnoreCase)) return false; var request = controllerContext.RequestContext.HttpContext.Request; return request[methodInfo.Name] != null; } } How to use it? Just have [...]
MVC Mailer and Specified Pickup Directory
MVC Mailer will complain about SMTP settings, even when using SpecifiedPickupDirectory settings that appear that they should work. The following code snippet will work with MVC Mailer: <smtp from="some-email@gmail.com" deliveryMethod="SpecifiedPickupDirectory"> <network host="localhost" /> <specifiedPickupDirectory pickupDirectoryLocation="c:\temp\"/> </smtp>
mySQL Entity Framework driver and LazyLoading problem
Just experienced an issue with the Entity Framework driver for mySQL – it appears that simple operations such as iterating over a lazy loaded list will result in a “There is already an open DataReader associated with this Connection which must be closed first” error. The reason for this is that the mySQL driver does [...]
jsTestDriver & WebStorm
Following up on the previous post, I was trying to test my new prototype.js based classes without any success. The error I kept getting was “TypeError: myClass is not a constructor”. Thanks to the JetBrains community, a fix was at hand quickly. I had to make sure that a test-config.jstd config file was in the [...]
JS Unit Testing
I’ve been using the superb WebStorm 4.0 EAP recently, and started to dabble in some JS unit testing, using the jsTestDriver that is integrated with the IDE. On looking at some of the tutorials I found this article. Have copied some of it here for future reference. Automate, automate, automate! By moving from a logging [...]
MVC and TempData
Couple of gotchas/HOWTOs with TempData: Use TempData when you want to display a notification to a user. When MVC accesses the TempData dictionary, it will delete the corresponding key-value pair. In order to determine if a TempData value has been set, don’t check for null (!) but use ContainsKey. You can’t pass TempData values to [...]
N-tier Entity Framework and debugging WCF problems
Our latest project involves a number of different app clients, for example Web, Phone, Tablet, Facebook app etc. This calls for an n-tier architecture, where we split the code base into logical modules. We can then swap in a different application client and re-use all of the same business and data access code. The architecture [...]
Entity Framework 4.1, Repository and Specification patterns
Working on a new long-term project, and we need a data access layer that will be extensible over a number of years. There are plenty of resources available for the Repository and Specification patterns, although each one seems to be slightly different. So keeping with tradition I’ll take you through my version! I want two [...]
Blog