Posts
  • Matthew Manela's Blog

    The best game EVER

    • 1 Comments
    Note: This post may be subject to gross use of hyperbole. By far the best game in the history of man is: Fuel Pipe on Skype Skype has a bunch of built in games which you can play with the person to whom you are talking. These games are good since they...
  • Matthew Manela's Blog

    Worst Case Scenario for QuickSort

    • 2 Comments
    Take a look at the following code: 1: var sw = new Stopwatch(); 2: sw.Start(); 3: Enumerable.Range(0, 3).SelectMany((i) => Enumerable.Range(0, 50000)).OrderBy(i => i).ToList(); 4: Console.WriteLine(sw.ElapsedMilliseconds); 5...
  • Matthew Manela's Blog

    Writing a Regular Expression parser in Haskell: Part 2

    • 1 Comments
    The first module in my simple regular expression parse is called RegexToNFA.  This module exposes the types that make up a finite state machine and also the functions to convert a regular expression string into a finite state machine. My structure for...
  • Matthew Manela's Blog

    Writing a Regular Expression parser in Haskell: Part 1

    A few weeks ago I read this article about writing a simple regular expression parser. That article does a really good job of explaining the theory behind regular expression. It then goes step by step into how to write a program (he uses C++) to parse...
  • Matthew Manela's Blog

    DRY and Unit Tests don’t mix well

    When reading source code, I sometimes come across unappealing code(sometimes even my own).  However, there is one kind of “bad code” I see quite frequently.  It is a set of unit tests which have had the DRY (Don't Repeat Yourself) principle...
  • Matthew Manela's Blog

    Palindrome Creator in Haskell

    The past few days I have been solving problems at this site called Project Euler . This site contains many seemingly simple math programming problems. I have been using Haskell to solve the problems on the site and in order to help solve one of the problems...
  • Matthew Manela's Blog

    Best Internet Explorer Plug-in

    • 3 Comments
    There are many features which Opera and Firefox (through extensions) have that I can't live without. Features like advertisement blocking, mouse gestures and custom site JavaScript. Internet Explorer doesn't have these features but I found a plugin which...
  • Matthew Manela's Blog

    I finally got fed up with Enum.Parse

    • 4 Comments
    I don’t know why I didn’t do this long ago, but I am done writing this: var val = (SomeEnum)Enum.Parse( typeof (SomeEnum),”someString”); I have typed this too many times and it annoys me.  I wrote a small extension method on the...
  • Matthew Manela's Blog

    Closures and Pass by Reference

    • 5 Comments
    What do you think the following code will do? Compile time error Run time error Work fine 1: static void Main( string [] args) 2: { 3: int x = 10; 4: int y = 5; 5: Swap( ref x, ref y); 6: } 7: 8: 9: static void Swap( ref int x, ref int y) 10: { 11: int...
  • Matthew Manela's Blog

    SQL CE 3.5 with LINQ to SQL Revisited

    • 5 Comments
    A few days ago I made a post about using SQL CE 3.5 with LINQ to SQL . I described a way to use connection pooling with SQL CE. A gracious blog reader (Mike Brown) pointed out a way I could make my solution much simpler by using the [ ThreadStatic ] attribute...
  • Matthew Manela's Blog

    Regex based Lexer with F#

    • 2 Comments
    This lexer allows you to define your regular expression based rules in a very declarative way using F# computation expressions. open Lexer let definitions = lexerDefinitions { do ! addNextlineDefinition " NEWLINE " @" (\n\r)|\n|...
  • Matthew Manela's Blog

    Snippet Designer 1.3 Released!

    • 2 Comments
    I just released Snippet Designer 1.3. CodePlex Page : http://snippetdesigner.codeplex.com/ Visual Studio Gallery Page: http://visualstudiogallery.msdn.microsoft.com/en-us/B08B0375-139E-41D7-AF9B-FAEE50F68392 The key features of this release are support...
  • Matthew Manela's Blog

    Useful Moq Extension Method

    I have been working with ASP .NET MVC and I use the Moq mocking library to help test the code I write. Often in ASP MVC anonymous objects are passed around as function arguments. This is especially common in calls to RouteUrl. Since I want to be able...
  • Matthew Manela's Blog

    Self Documenting Code

    • 4 Comments
    I have come across many developers who believe that comments are not necessary to make code readable. They argue that code should document itself. By this they mean that the code you write should be clear and have good enough naming conventions such that...
  • Matthew Manela's Blog

    Parameterized State Transformer Monad in F#?

    • 2 Comments
    I have have been playing around with F# and I decided to create a state monad. This worked out really well since I was able to leverage the F# computation expressions . I then decided to try to extend this and make it more general by creating a parameterized...
  • Matthew Manela's Blog

    Foray into LINQ

    • 3 Comments
    With the release of .NET 3.5 I started playing around with one of the cool new technologies called LINQ.  LINQ brings SQL like querying syntax for performing operations on data sources like collections into , files or databases into .NET.  The LINQ website...
  • Matthew Manela's Blog

    Updated JQuery ResizeComplete method

    • 1 Comments
    I made 2 slight changes and I think it works pretty well now. I now detect if the browser is Firefox and use the regular resize event since its resize behaves like a resizeComplete. I also modified the timeout a bit since I think 100 ms might be too small...
  • Matthew Manela's Blog

    Inline Regular Expression Options

    • 1 Comments
    I was using attributes from the System.ComponentModel.DataAnnotations    namespace for model validation.  This namespace includes a few very useful validation attributes such as Required Attribute – Validates the field has a value Range...
  • Matthew Manela's Blog

    A functional take on console program loop in F#

    • 1 Comments
    Often when learning a new technology I start with a simple console application in which the program is run in a loop it continues to prompt you for more input until you give some command like quit or exit or whatever you choose: Enter input: someInput...
  • Matthew Manela's Blog

    Writing a Regular Expression parser in Haskell: Part 4

    • 1 Comments
    With the previous two modules in place we are now set up to use a DFA to match against a string.  In my implementation I support either a greedy match or an short match.  In a full featured regular expression engine this ability to choose greedy or not...
  • Matthew Manela's Blog

    JavaScript Rich Text Editors

    • 1 Comments
    While in college I worked on several websites for my school ( Binghamton University ). One of my main tasks in developing websites was to create a easy to use system which would let non-developers be able to update and modify web content. I wrote these...
  • Matthew Manela's Blog

    OpenWithTest released on Visual Studio Gallery

    • 2 Comments
    Download Either download from the extension manager by searching OpenWithTest or go to the project page here . Summary Open with Test is a Visual Studio extension which serves one simple task: To always open your test files and implementation...
  • Matthew Manela's Blog

    Snippet Designer 1.1 Released

    • 3 Comments
    I just released Snippet Designer 1.1.  This is not a major release but just some bug fixes and often requested changes to make the snippet designer more useful.   Some of the most notable changes are: Languages Service are turned OFF by default...
  • Matthew Manela's Blog

    The J Language

    • 2 Comments
    I have been experimenting with this programming language called J . J is a full featured programming language capable of doing anything your more conventional language do. What makes J different is how it approaches solving problems. All functions (called...
  • Matthew Manela's Blog

    Did you know.... Generic Methods

    • 1 Comments
    Did you know that you can call a generic method with out supplying the type argument. The C# compiler will fill in the type parameter for you at compile time since the language is strongly typed. static void MyMethod<S>(S myParam) { Console...
Page 2 of 6 (130 items) 12345»