Use .Any() in your LINQ to SQL queries
This article explains why you should use the Any()
method over Count()
in LINQ to SQL.
This article explains why you should use the Any()
method over Count()
in LINQ to SQL.
Say you have two (or more) Dictionary
objects and want their contents merged, this can be done with LINQ very conveniently like so.
There are a lot of questions on Stack Overflow, probably a lot than you realise. This is understandable when you consider over 7,000 questions are being asked every day. No I’m not just talking about the 5 million odd that you can access via the questions tab (4,930,418 and counting at time of writing). There are also a ridiculous amount of deleted questions which only users with at least 10,000 reputation can see.
Continue readingCheck out the deleted questions on Stack Overflow
The CSS property background-size:cover
is incredibly useful but due to the nature of it resizing in different directions, it’s difficult to pinpoint where a particular part of the image is on the background at any given time. Difficult but not impossible of course.
Continue readingAligning an element with background-size:cover
I wrote up a little JavaScript plugin over the weekend that has a <table>
’s header scroll with the page. What sparked this little endeavour was a question asking for this functionality on Stack Overflow. Since it was fun answering the question, I thought I’d go ahead and make a more general plugin type solution that worked for multiple tables.
This article introduces a way to clear floats using pseudo-elements on a wrapping element.
You may ask yourself why you would ever want to pass a reference type into a method using the ref
keyword, or why the C# compiler even allows this. Using ref
on a reference type is actually slightly different to not using it. The difference is that the ref
keyword makes it a reference (pointer) to the variable, not just the object. This allows assigning to the source variable of the parameter from within the method.
Here’s a pretty good method of creating a header that has a vertically-centered, horizontal line on the right-hand side of the header. There are a couple of caveats though: it requires a little JavaScript to set an attribute on the headings; and it cannot be used on tiled backgrounds.
Continue readingHeaders with a vertically-centered horizontal line