by Mwwhited
26. June 2009 22:06
A few months back, when I started working on the .Net Micro Framework “Dare to Dream Different” contest, I started thinking about Netbooks. The longest time before that I always wanted the biggest and fastest laptop I could get. But the thinking changed when I thought about the fact if I won the contest I would need to pack up my project and a laptop… and being the photo geek that I am I would want at least one of my cameras with me as well. Now stuffing a 15....
[More]
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
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]
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]
by admin
16. June 2009 15:06
Two chucks of code... both do the same thing. Why is the version with the goto so much worse? I would even debate that i
Dim password1 As String
While True
Console.WriteLine("Enter Password: ")
password1 = ReadHiddenString()
If String.IsNullOrEmpty(password1) Then Continue While
Console.WriteLine("Reenter Password: ")
Dim password2 As String = ReadHiddenString()
If String.IsNullOrEmpty(password2) Then Continue While
If password1 password2 Then Continue While...
[More]
bc61f6e3-3daf-42eb-a2bb-ae1a7f0dd4f1|0|.0
Tags:
by Mwwhited
16. June 2009 15:06
Two chucks of code... both do the same thing. Why is the version with the goto so much worse? I would even debate that it is clearner.
Dim password1 As String
While True
Console.WriteLine("Enter Password: ")
password1 = ReadHiddenString()
If String.IsNullOrEmpty(password1) Then Continue While
Console.WriteLine("Reenter Password: ")
Dim password2 As String = ReadHiddenString()
If String.IsNullOrEmpty(password2) Then Continue While
...
[More]
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]
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]
by Mwwhited
10. June 2009 22:06
After running across a "code golf" question this afternoon on stack overFlow I answered with a short answer...
using (var inFs = File.OpenText(args[0]))
using (var outfs = File.AppendText(args[1]))
{
outfs.Write("<table border="0">");
while (!inFs.EndOfStream)
outfs.Write("<tbody><tr><td>" + string.Join("</td><td>", inFs.ReadLine().Split(',')) + "</td></tr>");
...
[More]
by Mwwhited
9. June 2009 01:06
Okay... those guys over at MSR (Microsoft Research) as just INSANE. Photosynth is too cool. Here is a synth of a scupture I own. Dragon Egg Savannah Clipper ... Enjoy, Matt