C#
In this post: SoundEx in Sql Server SimMetrics Adding string Metric functions in MS Sql Server Evaluating metric accuracy and comparing Metrics Conclusion + code Quite often we come across a requirement where we may need to perform some sort of fuzzy string grouping or data correlation. For example, we may want to correlate the customer records of a database by identifying records that are similar but not necessarily exactly the same (due to spelling mistakes for example). Obviously a simple group by, will not successfully group such data. We will need to employ what...
I recently found myself in the situation where I had to loop through all the days from a StartDate to an EndDate. Sure easy, all you need to do is something like this: DateTime startDate = DateTime.Now;
DateTime endDate = DateTime.Now.AddDays(3);
DateTime curDate = startDate;
while (curDate <= endDate)
{
//Do Something with curDate ...
curDate = curDate.AddDays(1);
}
Does the job, but it is not very intuitive in my opinion. It is not that easy to read.
Wouldn't it be so much nicer if we could do something like this:
DayIterator dayIterator =...
Given a file, we would like to check if it is a valid .Net assembly file.
How would you go about it?
1. A couple of words about the PE file format
.Net assemblies are valid PE files. A PE file consists of:
* MS-DOS header
* Stub Program
* PE file signature
* PE file header (This is where we position our stream)
* PE optional header
* Section headers (This is where the RVA15 is)
* Section bodies
The PE file header is where we position our file stream at byte offset 60. The 32 bits at this position are the...