jaredpar's WebLog

Code, rants and ramblings of a programmer.

Browse by Tags

Tagged Content List
  • Blog Post: BclExtras Library

    I published a .Net utility library on Code Gallery today called BclExtras .  It’s a set of classes meant to be used in addition to the standard .Net base class libraries (BCL).  The main focuses of the library are functional programming, multi-threading, LINQ extensions, unit testing and API...
  • Blog Post: Is IntPtr(long) truncating?

    The short answer is: No, not when it matters A colleague and I were discussing a particular scenario around IntPtr,PInvoke and 64 bit correctness.  Eventually our discussion lead us to the IntPtr constructor which takes a long.  To my surprise the code for the constructor is the following....
  • Blog Post: RantPack - A utility library

    I often post code examples, samples and snippets on this blog. Many of these samples are a part of a utility library I've been writing and maintaining for many years now. Essentially since I got involved in DotNet programming. I write a lot of code for internal apps, demos and hobby projects. Having...
  • Blog Post: IEnumerable and IEnumerable(Of T) 2

    Quick follow up to my earlier post . Fixing this issue in C# is even easier because of the existence of iterators. public static IEnumerable < object > Shim(System.Collections. IEnumerable enumerable) { foreach ( var cur in enumerable) { yield return cur; } }
  • Blog Post: .Net Framework Source Code

    If you haven't heard the news yet, you can read the full article on ScottGu's Blog . In summary Microsoft has released the source code for the .Net Framework in such a way that you can step into the Framework while debugging. IMHO this is great for users because it allows us to get a lot of insight into...
  • Blog Post: Closures in VB Part 6: Limitations

    For previous articles in this series please see ... Part 1: Introduction Part 2: Method Calls Part 3: Scope Part 4: Variable Lifetime Part 5: Looping As powerful as closures are in the language they do have a few limitations. We worked hard in Orcas to put as few limitations in Orcas as possible. Below...
  • Blog Post: Detecting if you are an Admin

    This came up on an internal alias. A customer wanted to know how to determine if there were running as an admin in a tool. Below is a sample program that will print out whether or not you are the machine admin or a member of the machine administrators group. This is essentially the same as the code in...
  • Blog Post: Coding Quiz: Anonymous Type Types

    Question: How can you create a variable in VB which is typed as an anonymous type but not actually create an instance of that type? Answer in comments. Note, doing this is not particularly useful it came about while I was playing around with a feature a few days ago.
  • Blog Post: IMetaDataImport::GetParamForMethodIndex

    While investigating a recent bug I found about an interesting return for GetParamForMethodIndex. On a perfectly verifiable assembly, a call to GetParamForMethodIndex was returning a failure code. After some searching I found the return code was CLDB_E_RECORD_NOTFOUND. I was surprised at first because...
  • Blog Post: Closures in VB Part 5: Looping

    For previous articles in the series please see Part 1: Introduction Part 2: Method Calls Part 3: Scope Part 4: Variable Lifetime Once again sorry for the long delay between posts. Looping structures can cause unintended consequences when used with Lambda expressions. The problem occurs because lambda...
  • Blog Post: Closures in VB Part 4: Variable Lifetime

    For previous articles in this series please see Part 1: Introduction Part 2: Method Calls Part 3: Scope Sorry for the long delay between posts here. We're getting Orcas out the door and getting this series completed takes a back door to shipping. Originally I wanted to talk about looping structures next...
  • Blog Post: Closures in VB Part 3: Scope

    For previous articles in this series please see Part 1: Introduction Part 2: Method Calls Thus far in the series we've only lifted variables that are declared in the same block/scope. What happens if we lift variables in different scope? The answer is that one closure class will be created for every...
  • Blog Post: Closures in VB Part 2: Method Calls

    For previous articles in this series, please see Part 1 - The basics This part of the series will focus on how method calls are handled in closures. As stated in the previous article, the purpose of closures is to allow all operations inside a lambda or query expression that would normally be available...
  • Blog Post: Closures in VB: Part 1

    One of the features I implemented for VB 9.0 is lexical closure support. This a great addition to the VB language and I wanted to do a series of blog posts to describe this feature and how it will impact your code. Lexical Closures (more often referred to as simply Closures) are the underpinnings...
  • Blog Post: CoSetProxyBlanket and Managed Code

    When running FxCop on any managed code that uses CoSetProxyBlanket you will see an error message saying the method cannot be called reliably from managed code. I've hit that message before was frustrated by my attempts to find an explanation on the web. Part of the reason is I'm not the most efficient...
  • Blog Post: Debugging Managed Code with Object ID's

    Just found out about a neat way to keep track of managed object references while debugging. Check out this blog entry http://blogs.msdn.com/greggm/archive/2007/01/17/setting-conditional-breakpoints-using-object-ids.aspx
  • Blog Post: Readonly TextBox that doesn't look funny

    When you make a WinForm TextBox ReadOnly, it aquires a distinctive look because it changes the background. Users often want the appearance of the TextBox to stay the same, they just don't want it to be mutable. Here's a snippet to make a TextBox ReadOnly and not change it's appearance. Dim saved As...
  • Blog Post: Serialization, understanding the problem

    Writing a proper serialization mechanism is ofter very difficult. The problem is most people don't realize this because it just works in their application and .Net makes it very easy to do. A lot of the problem is not understanding what factors you need to consider when writing a serializer. Failures...
  • Blog Post: Publishing Web Application Projects via FTP

    Web Application projects are a new project type in Visual Studio 2005 SP1. It almost all of the niceties of the web projects with the semantics of being contained within a class library project. I like the feel of them and do all of my web app development in them now. I just ran into a small problem...
  • Blog Post: Boolean Parameters

    An item I try to avoid in any API I create are methods which ... Take more than one parameter One of the parameters is a boolean Typically this pattern indicates a True/False option on an operation type. This boolean value turns on or off some type of scenario for that operation. The reason...
  • Blog Post: Passing data between ASP.Net pages

    When developing an ASP.Net page I tend to pass a lot of data between pages. A lot of it comes from being fairly OO natured and wanting to have a page that displays a particular type of content. There are lots of articles detailing how to pass data between pages that have a 1-1 relationship using the...
  • Blog Post: Windows Forms Event LifeCycle

    When deveploping windows forms app, it's important to understand the event lifecycle of a form. That way you know what code to put where to ensure it's loaded at the appropriate time. That being said I wrote a small app to detail the events in a basic windows form application. Greater indentations indicate...
  • Blog Post: Dispose vs Delete

    Programs allocate resources for use during execution. The problem with resources is that they are limited and often times need to be recycled. Languages devise constructs and patterns for developers to periodically free up resources so that their programs can continue running. In Native C++ you typically...
Page 1 of 1 (23 items)