Defragmenting flash memory
If you write and delete extensively from a storage medium, it gets fragmented. To solve this, you should use a defragmentation tool like Windows’ Defrag. This makes a lot of sense when using hard...
View ArticleNamespace inheritence difference between VB.NET and C#
Recently, I’ve been involved in a .NET project that uses both VB.NET and C# projects in the same Visual Studio solution. Personally, I prefer C#, but VB.NET isn’t that hard to switch to, except that...
View ArticleCustom identities (classes that implement...
A few days ago, I spend almost a day figuring out what went wrong with an application I was writing. Apparently a SerializationExeption can occur when executing ASP.NET code in the ASP.NET Development...
View ArticleResolving relative to absolute path in ASP.NET
Resolving relative paths to absolute paths isn’t that hard when you’re working with normal system paths. You can simply use System.IO.Path.GetFullPath("./relative_path"); However when working with...
View ArticleGetting CSV file from FTP with C#
Recently I had to write a console application that periodically downloaded a file from an FTP server and parsed into items. Those items went into a database. Now the parsing and inserting them into a...
View ArticleReflection GetValue of bool? is bool
After several hours looking for a bug, I finally found it. This is the code that housed the “bug”. PropertyInfo info = obj.GetType().GetProperty("SomeProperty"); object value = info.GetValue(obj,...
View Article5 principles of Object Oriented Class Design
SRP (The Single Responsibility Principle): A class should have one, and only one, reason to change. OCP (The Open Closed Principle): You should be able to extend a classe’s behavior, without modifying...
View ArticleRead/Write action vs ReadAll/WriteAll
Recently I needed to go over a lot of files located inside a directory and its subfolders. This is a fairly easy something to implement and without much thinking I wrote some code to loop through the...
View ArticleAdd Multi-line support to OpenXmlPowerTools’ SearchAndReplacer
When editing Microsoft Word files in a web-environment like ASP.NET, the OpenXML API is a must! I recently needed to create a new document based on a template. There are to my knowledge 2 ways of doing...
View ArticleWCF over SSL
WCF is a powerful way to create web services. However getting it to work over SSL can be tricky. The problem is in the configuration. After quite some searching I came across this awsome article on SSL...
View Article