ISO Images from .Net

by Mwwhited 1. November 2009 17:24
I put together a quick framework for reading ISO disk images from .Net.  This was written in C#.   Again it is a quick demo framework so it does not have any exception handling and should probably not be used in production code. It has been written to use any stream but really it needs to support seeking.  I would suggest only MemoryStreams and FileStreams, but you can have fun with anything you like. ISO9660.zip

Tags: , , ,

Programming

Unmanaged Exports...

by Mwwhited 31. October 2009 14:20
I prefer to write mostly in .Net and C# these days.  But sometimes you need to work with external systems.  On particular system I have been working with supports COM interop but the deployment model leaves much to be desired.  In my typical net surfing I found a IL hack to export method calls from .Net assemblies and expose them as Unmanaged references.  The handy part about this it you can use the exports anywhere you may call unmanaged interfaces.  The need for me w... [More]

Tags: , , , , ,

Programming

Strong Name Unsigned Assemblies

by Mwwhited 16. September 2009 11:09
Some times when you have create .Net applications you get carried away and get them in production without signing them with a Strong Name Key.  This may not be an issue at first but can really limit the security later when you try to deploy the app to more locations. Part of the security in .Net is from the Code Access Security and a very important part of that is Strong Named assemblies. If you get far enough along you might not be sure what version of source code is currently in produ... [More]

Tags: , , , , , , ,

Generic Control Builder in ASP.Net

by Mwwhited 29. August 2009 12:08
In response to a question on StackOverFlow I posted a response about possibly using the ControlBuilder class in ASP.Net to get around the lack of generic control support in the ASP.Net designer.  While it may be possible to use the ControlBuilder to dynamically generate controls based on inputs.  Having it work as simply as a generic wrapper seem like it will require a pretty in-depth dive in reflection and the ASP.Net control model.  Because the person asking the question was pri... [More]

Tags: , ,

Programming

Invoking Generic Methods using Reflection

by Mwwhited 11. August 2009 10:08
Using reflection to create classes and invoke methods can be tricky. Worse still can when you try to invoke methods with generic arguments. This is a short and quick example static void Main(string[] args) { var flags = BindingFlags.Static | BindingFlags.NonPublic; var t = typeof(Program); var mi = t.GetMethod("Loopback", flags); var gargs = mi.GetGenericArguments(); var pargs = new object[] {"input value"}; var gargIn = pargs.Select(a =&g... [More]

Tags: , ,

Programming

Some people just arn't right in the head...

by Mwwhited 19. June 2009 11:06
While not as bad as calculating PI in BF this LINQ statement is pretty impressive. Being able to define a full ray tracer in a single, complex, fuctional, recursive statement is very interesting. Ray Tracing in LINQ

Tags: , , ,

Programming

The Good, The Bad, and the DAMN that code is ugly!!!

by Mwwhited 18. June 2009 01:06
  In the sprit of playing with a string chop question on stackoverflow… I somehow got myself into the middle of some fun code profiling.  So this is a report of the code and results. (this is related to a previous most I made as well http://hackersbasement.com/?p=134) Charted Short String Results Person Version Run 1 Run 2 Run 3 Str SB J Str SB J ... [More]

Tags: , ,

Programming

Do the .Net Chop (Chop a string at a fixed length and insert line feeds)

by Mwwhited 17. June 2009 23:06
In coming across this question on StackOverflow I  inspired to write my own version for the question.  I started to think about using a List<string> but decided to create sized array up front.  My version was taking longer than I hoped (mainly because I kept refreshing the site) but I did create a version that used string.Join and Array.Copy.  Wanting to compare the speed differences between a few of the answers I put together this little test of code. (as a side note... [More]

Tags: ,

Programming

Generics + IoC Container = Good bed fellows?

by Mwwhited 15. June 2009 00:06
After playing a little with Inversion of Control Containers... and being annoyed by the backing of a Hash Table or Dictionary, I decided to use some generic magic. And just for giggles I tossed in some .Net 3.5 Extension method love. Oh, as a warning... I build this on VS2010 Beta 1 so the Range object's constructor has optional parameters. Please feel free to leave questions and comments. -Thanks, Matt using System; using System.Collections.Generic; using System.Linq; using System.Collect... [More]

Tags: , ,

Programming

Visual Studio 2010 Beta 1 and .AsParallel()

by Mwwhited 13. June 2009 16:06
I decided to play around with VS2010 Beta 1 this weekend. While talking with one of my dev friends, I was asked what I thought about the Parallel extensions. Having not used them yet I figured I'd give them a go... [More]

Tags: , , ,

Programming

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen