Posts
  • Matthew Manela's Blog

    Lambda Expressions are more fun in Visual Basic .NET

    • 8 Comments
    I love C# and I would never want to do anything to make it seem any less amazing but I have to give credit where credit is due ... to Visual Basic .NET. Yes, I said it. Both languages have been adding features inspired by the functional and dynamic programing...
  • Matthew Manela's Blog

    FastSharp - Write it, Execute it

    • 7 Comments
    UPDATE: New version on FastSharp that includes a Windows 7 Gadget! Learn more here. Last year I wrote this program which I named FastSharp. It is a text editor which lets you compile and run C# code that would normally exist inside a method. The...
  • 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

    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

    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

    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

    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

    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

    Prime Factorization using Unfold in Haskell

    • 3 Comments
    I randomly yesterday started thinking about the unfoldr function in Haskell while working out at the gym (how nerdy is that, I am lifting iron but thinking of functional programming). Unfoldr take a single and an unfolding function and turns it into a...
  • 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

    Floating Point, Why are you so buoyant?

    • 3 Comments
    Floating point precision can often be confusing to people. The following code block should illustrate some important things to keep in mind about floating point numbers. In this block I am attempting to get the value 64,000,000 in two different ways....
  • 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

    Visual Basic .NET Late Binding Explored

    • 3 Comments
    In a previous post I mentioned how Visual Basic .NET's lambda expressions are more fun and easy to use than C#'s. My inspiration for this statement was the fact that in VB .NET you are able to implicitly define a lambda expression in this way: Dim f ...
  • 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

    Lazy Prime Number Sieve in C#

    • 3 Comments
    In my last post I talked about a Stream class for creating efficient lazy lists in C#. In addition, I showed several classic functional methods I ported to C# to be used on the lazy lists. As I mentioned in that post, I will now talk about an example...
  • Matthew Manela's Blog

    Understanding Variable Capturing in C#

    • 2 Comments
    With the addition of anonymous delegates in C# 2.0 and with lambda expressions in C# 3.0 you might have been hearing a lot about variable capturing. This is the mechanism in which the delegate/lambda which was defined inline is able to hold on to any...
  • 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

    I was on DotNetRocks!!!

    • 2 Comments
    A couple week ago I had an interview with the DotNetRocks folks.  In this interview I discussed the MSDN Code Gallery and I also discuss ed my time as an intern at Microsoft.  It was really fun recording this and my interviewers Carl and Richard...
  • Matthew Manela's Blog

    Combining Silverlight and JavaScript

    • 2 Comments
    Silverlight 2 is currently in Beta 1 but even in this early stage it has many amazing features. One of these features which I was toying around with today was its ability to integrate with its host page's DOM . What this means is that from Silverlight...
  • 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

    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

    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

    Converting RTF to HTML

    • 2 Comments
    Have you ever had the desire to convert some RTF text into HTML? Probably not. But if you do, then you are in luck! I recently had the need to do this conversion and after some searching found out a way to do it by enhancing a sample distributed in the...
Page 1 of 6 (130 items) 12345»