Matt Manela's Blog
Farblondzshet in code.
Browse by Tags
All Tags
»
C#
(RSS)
CLR
Downloads
Haskell
HTML
LINQ
MSDN Code Gallery
Programming
Random Thoughts
Regular Expression
RTF
Snippets
SQL CE
Visual Basic
Visual Studio
WHAT!
Windows
WPF
XAML
Converting RTF to HTML
28 September 09 11:28 AM
|
MattManela
|
0 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
Read More...
I finally got fed up with Enum.Parse
24 July 09 09:02 AM
|
MattManela
|
3 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 string type to make
Read More...
My xUnit.net Visual Studio Code Snippets
02 March 09 03:58 PM
|
MattManela
|
1 Comments
The xUnit .Net codeplex page lists one useful Visual Studio code snippet for creating a Fact. As you can tell I am fairly fond of code snippets so I created a few more which I use when writing xUnit.net facts. These are one line snippets that I find very
Read More...
Inline Regular Expression Options
01 January 09 12:10 PM
|
MattManela
|
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
Read More...
Model Binder
15 December 08 10:45 PM
|
MattManela
|
0 Comments
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
Read More...
SQL CE 3.5 with LINQ to SQL Revisited
26 September 08 08:26 AM
|
MattManela
|
4 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
Read More...
SQL CE 3.5 with LINQ to SQL
09 September 08 02:04 PM
|
MattManela
|
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
Read More...
CollectionView.DeferRefresh() : My new best friend
28 August 08 02:23 PM
|
MattManela
|
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
Read More...
Generic Insert and Update for LINQ To SQL
12 August 08 02:46 PM
|
MattManela
|
1 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 name="T">Type
Read More...
Foreach is Duck Typed!
22 July 08 10:04 AM
|
MattManela
|
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
Read More...
ArgumentNullException vs ArgumentException
28 May 08 09:17 PM
|
MattManela
|
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
Read More...
Intro to LINQ to SQL Optimistic Concurrency
22 May 08 08:40 PM
|
MattManela
|
0 Comments
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
Read More...
Closures and Pass by Reference
30 April 08 07:15 PM
|
MattManela
|
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
Read More...
Covariance and Contravariance
30 March 08 04:21 PM
|
MattManela
|
0 Comments
I just finished reading the series of ten blog posts by Eric Lippert about covariance and contravariance . These topics were new to me but after reading this blog series it all made sense. It finally explained to me why some things which I thought I should
Read More...
Lazy Prime Number Sieve in C#
16 March 08 11:28 PM
|
MattManela
|
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
Read More...
More Posts
Next page »
Search
This Blog
Home
About
Email
Tags
Applications
ASP .NET
C#
CLR
Codeplex
Comic
Downloads
F#
Funny
Games
Haskell
HTML
Internet Explorer
J
JavaScript
JQuery
LINQ
MSDN Code Gallery
PC
Personal
Powershell
pro
Programming
Project Euler
Random Thoughts
Regular Expression
RTF
Silverlight
Snippet Designer
Snippets
SQL CE
testing
Tools
Ubuntu
Visual Basic
Visual Studio
WHAT!
Windows
WPF
XAML
Archives
September 2009 (1)
July 2009 (2)
May 2009 (1)
April 2009 (2)
March 2009 (3)
February 2009 (1)
January 2009 (2)
December 2008 (2)
November 2008 (2)
October 2008 (1)
September 2008 (3)
August 2008 (5)
July 2008 (1)
June 2008 (4)
May 2008 (3)
April 2008 (4)
March 2008 (8)
February 2008 (3)
January 2008 (3)
December 2007 (7)
November 2007 (4)
October 2007 (3)
August 2007 (2)
Sites of Interest
XKCD
Mallory Emerson's Blog
Dori Manela's Blog
Peter Langsam's Blog
Joe Morel's Blog
Technical Blogs
Sara Ford's Blog
Beth Massi's Blog
Syndication
RSS 2.0
Atom 1.0
Farblondzshet