I have to ask, though: did you have a very good reason for writing your own regexp parser, or you did it as an exercise? Well to be a bit pedantic my code does not do any parsing. It fluently produces a series of continuations (functions) that test portions of an string. As to your question, I am t...
You may want to consider setting the default values for max and min in the Term function to -1 and 0 respectively by default. Do you really think it should be greedy like that? There also seems to be no support for "." and other such meta-characters. Yep, I'll be adding those eventually. ...
After reading the spec for ECMAScript regular expressions I put together some code in C#4 that produces immutable, functionally pure character matcher sequences. Here is a simple example that will match a social security number. public static class Example { public static readonly Matcher SsnMatcher...
It actually crossed my mind that you might've been joking (or trolling). But I figured it was better to take a joke post seriously than to take a serious post as a joke. I have seen code that was this bad out in the real world. And I'm not joking when I say this! Let this post be a reminder to you ...
I actually should have given a little background on this method. It will be used to scale the size of an image to fit into a constant sized field. This is not a homework problem unless you consider efforts to optimize multimillion dollar piece of crap homework. The reason I used Math.Round is becaus...
I just finished writing this algorithm. It clocks in at about 8us, which is pretty good. Can you think of any way to improve the performance? One thing I don't like about it is the rather large if statements. Do you think the sacrifice in clarity is worth the slimming of the code? It makes sense for...
Hello eveyone, I've just finished optimizing a function I wrote a while back. I'd like to get opinions/criticism from anyone who is interested. Language: C# Approximate Runtime: 9-14 ms public static Byte[] ToTrueSyncSignalBytes(this Int32 value) { ByteAssembler assembler = new ByteAssembler(4); Bit...
Segmentation fault. Pete - play a faster paced sport that doesn't have pricey equipment. Preferably on a more obscure side so you aren't up against people who've done the sport since they were wearing diapers. Nice catch I didn't really think anyone would scrutinize my half-hearted attempt at being...
I just thought up a great starter project for learning C#. Why don't you create a personal database of ninjutsu techniques with a nice interface to view step by step photos etc. This will develop your layout techniques and reinforce the knowledge you might have already about managing a database. (an...
Take a night course to challenge your mind and to meet new people. Make sure it is something your interested in. (I am not exactly the pinnacle of wisdom (20 years old) but I can say that taking a class would add a breath of fresh air to your life) or program in C# (love that language) public class ...