Posts
  • 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

    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

    Model Binder

    When working with a multi-tier application I often find myself converting from one of the tiers object models to my own similar (but often different) model.  I often write code that would set one by one each property from a web tier object to my...
  • 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

    Rough draft of a new JQuery method

    • 1 Comments
    I have run into issues recently with the browsers' implementation of the resize event on the window. Opera, Safari, IE and Firefox all have different behaviors when this event is fired. Firefox only fires it when you release the mouse. IE fires this event...
  • 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

    What annoys me when writing generic functions in Visual Studio...

    • 6 Comments
    When writing a generic function I start from left to right (the same way I write most things except when I took Yiddish in college).  For example, Lets say I am writing a simple generic method which return the first element of a generic list. I want...
  • 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

    The Snippet Designer is Released!!!!

    • 4 Comments
    Some History The Snippet Designer was started as an intern project of mine during the Summer of 2006. The idea was to make snippet files (which were introduced to Visual Studio in 2005) a first class entity. Following this idea I created a Visual Studio...
  • Matthew Manela's Blog

    SQL CE 3.5 with LINQ to SQL

    • 2 Comments
    Using LINQ to SQL with SQL CE 3.5 can be a bit of a challenge. First off, the LINQ to SQL Visual Studio designer doesn't support SQL CE so you need to run sqlmetal from the command line to create the object model (or write it by hand). Once you get past...
  • Matthew Manela's Blog

    CollectionView.DeferRefresh() : My new best friend

    • 2 Comments
    Well, maybe not best friend but its a nice function.  When working with bound collections in WPF you often end up dealing with a CollectionView .  This is the MSDN documentation description of a CollectionView : You can think of a collection...
  • Matthew Manela's Blog

    I started playing with F#...

    I decided to do some Project Euler problems using F#.  So here is my first one, Problem # 31.  Nothing in this solution really shows off anything special about F# but you have to start somewhere ;)   1: #light 2:   3: let...
  • Matthew Manela's Blog

    Generic Insert and Update for LINQ To SQL

    • 2 Comments
    Quick code snippet time! The following are generic methods for inserting and updating a detached entity into a database using LINQ to SQL. 1: /// <summary> 2: /// Updates the database with item. 3: /// </summary> 4: /// <typeparam...
  • 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

    The two most important WPF Tools

    I have been working a lot with WPF and I found the following two FREE tools to be extremely helpful. The first is: XamlPadX - ( http://blogs.msdn.com/llobo/archive/2007/12/19/xamlpadx-v3-0.aspx ) This is an enhanced version of XamlPad which comes...
  • Matthew Manela's Blog

    Foreach is Duck Typed!

    • 5 Comments
    I thought I know how the foreach construct worked under the covers. I figured the compiler would check if the type being iterated over implement IEnumerable or IEnumerator. And if so it will call MoveNext and Current to loop over the elements. But then...
  • 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

    Writing a Regular Expression parser in Haskell: Part 3

    • 1 Comments
    The third module in the simple regular expression parser is called: NFAtoDFA.  Which as you might have guessed, takes the NFA that resulted from the first module and converts it into a DFA.  The structure that the DFA uses is the same that the NFA uses...
  • 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

    ArgumentNullException vs ArgumentException

    • 2 Comments
    Both ArgumentNullException and ArgumentException have a constructor which takes two strings. One is the name of the parameter (or argument) in question and the other is a string describing the exception. The funny/odd/interesting thing about them is that...
  • Matthew Manela's Blog

    Intro to LINQ to SQL Optimistic Concurrency

    After some investigation I feel I have a decent understanding on how LINQ to SQL concurrency works. LINQ to SQL uses optimistic concurrency which means that it never takes an exclusive lock on a table.  It caches the information you are working with and...
  • Matthew Manela's Blog

    Breadth First Tree Traversal in Haskell

    • 1 Comments
    As my interest in functional languages has grown, I have become increasingly interested in using them to implement algorithms which I can already write with imperative languages. For example, I was taught to implement (and I assume most other people as...
  • 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

    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...
Page 4 of 6 (132 items) «23456