TAG: c#

Software Engineer, somewhere between irritated and annoyed.

C# logo for stickers + stuff

Back in early 2013 I was pasting stickers all over my acer, as if it was some sort of third rate thermal insulation, and I thought to myself, wouldn't it be nice if I could have a C# one. Annoyingly all the C# ones were god awful. But Jeremy Kratz and had kindly made it clear he wasn't bothered about the licence something confirmed recently. Anyhoo I liked it and decided to try and replicate it…

Handy MongoDB C# Tools

Just a few bits and bobs I've collected up lately. Aggregation is a neat feature in MongoDB and as with most mongo c# stuff it's often a small hurdle to implementing the same query you perform in BSON in the driver language… Sooo just to get you started https://chrismckee.co.uk/mongo-aggregation-in-c/ Quite a good idea to mix this with Profiling so you can watch how it's querying etc... Pipeline Requests I like the…

Simple MongoDB Aggregation in C#

Grouping Data with Count Note: This starts with the 1.10.1 version of the mongo driver; https://www.nuget.org/packages/mongocsharpdriver/1.10.1 the v2 driver wraps the Async methods to syncronous to stay 'compatible' and as such is slower. So running 'synchronous' using v2 would be disadvantaged by the new driver while async with the async driver may have a minor benefit. The async is covered further down using Driver 2.1.…

Validating UK Credit & Debit Cards With LUHN to Type

Note: The regex here is pretty worthless; bin's are listed as ranges and should be handled as such, at the time of writing the ranges were relatively limited and this LUCKILY didn't cause any issues Credit Card validation is a Pain in the Arse *Updated April 2010 But its not going anywhere fast. So I’ve combined two of the scripts I’ve found to meet my needs, added UK credit card data (Maestro/VisaDebit etal)…

Curl HTTP 417 – Expectation Failed

WordPress XML RPC – HTTP/1.1 417 Expectation Failed I was nocking up a client script to drag down a news-feed and post it to a WordPress blog; the script ran fine, no posts appeared and no errors occurred… irritating. So I figured I’d share this pain in the arse issue fix to the “HTTP/1.1 417 Expectation Failed Error” HTTP/1.1 417 Expectation Failed $title="Test"; $body="<b>Test<…

Setting up ASP.Net MVC 2 on IIS6 with IISRewrite

This will also work in ASP.net MVC, as in the first one. It’s a somewhat well known fact, (by somewhat I mean for amongst web devs, my mum wouldn’t understand any of that), that IIS6 is the IE6 of Servers, its slow, dim-witted, annoying, crap and here to stay. So to make life a little more bearable and to save the rest of the web-society from a life of .net 2 webform’s,…