This is interesting, a port scanner written completely in Javascript. It creates a series of image objects and points the URL to an image file which would be found on a default installation of some web servers. Once found, the script could be modified to do something malicious to that webserver using any well known [...]
using System;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace SocialAnimal.Web.UserControls
{
/// <summary>
/// If ControlToValidate has a value then DependantControl
/// must also have a value
/// </summary>
public class DependantFieldValidator : CustomValidator
{
private string _dependantControl = null;
private bool _showAlertBox = false;
[Description(@"If true, will show an alert box if the control validates false, otherwise will display an inline message"),
Category("Behavior")]
public bool ShowAlertBox
{
get { return _showAlertBox; [...]
The website I work on recently received a large increase in visitors due to a marketing drive. This caused IIS to start recycling the worker process very often as memory consumption was increasing out of control. The user experience wasn’t affected by this problem as we run a load-balanced system, however we had to fix [...]
Here’s a quick example of how we do layer seperation through interfaces to make each layer testable. Although the tests run, the UI section is untested. Download file.
using System;
using System.Web;
using System.Web.UI;
using NMock;
using NUnit.Framework;
using Socialanimal.Example.Business;
using Socialanimal.Example.Business.Implementation;
using Socialanimal.Example.Core.Entities;
using Socialanimal.Example.Core.Interfaces;
using Socialanimal.Example.SqlDatabase;
namespace Socialanimal.Example.Core.Entities
{
public class Employee
{
public string Forename;
public string Surname;
public Employee(string forename, string surname)
{
this.Forename = forename;
this.Surname = surname;
}
}
}
namespace Socialanimal.Example.Core.Interfaces
{
public interface [...]
It’s been a while since I wrote about the C# tools / frameworks i’m currently using, so here we go.
log4net – for all our logging needs.
nunit – automated testing.
nmock – for mocking interfaces and writing more testable code. (see my blogpost)
nant – automating our build cycles (although we’re looking at msbuild to replace Cruise Control, [...]
Announcing my first Google maps mashup – my Pub Finder. It integrates content from the great www.BeerInTheEvening.com site with maps, and then gives variably coloured icons denoting the rating of the pub.
To use it: move the map to an area you’d like to visit. If no pubs appear, then enter the placename of where you [...]
Posted in .NET, Computers, Programming on December 8th, 2005 No Comments »
Everybody is talking about AJAX nowadays since Google Maps and Google Suggest showed the world how cool it can be. We used this technology at a previous employer 3 years ago for displaying live gambling odds… but anyway I thought i’d take a look at what libraries are out there for doing this in .NET.
Top [...]
Posted in .NET, Computers, Programming on November 22nd, 2005 No Comments »
Having spent a couple of days trying to load a 30.5Gb Xml file, i’ve discovered that there is a problem in the XmlTextReader class in that is uses an integer to track the file position. Now, I guess that having massive Xml files isn’t really what they were intended for, but that’s why i’m using [...]
I’ve been working on a 30gb Xml file today, importing it into one of our systems. There are always problems working with files this big – how do you get just a small segment to test on? how can you view small regions of it, or search it?
Most tools available for Windows aren’t up to [...]
You will need…
NUnit
This lets you write test scripts / methods etc for your code. There is a tutorial on how to use it (word doc) on their website, and if you’d like to go a step further and use NCover with it, check out my previous blog article. (NCover will monitor your testing and tell [...]