.NET Hobbyist Programmer

Staying Confused in a Busy World
posts - 271, comments - 284, trackbacks - 660

My Links

News

Neat Stuff Read all my hurricane entries While you are here, visit the Geeks With Blogs main feed
Advertising
Links Status of the Navy
Channel 9

Tag Cloud

Article Categories

Archives

Post Categories

Programming

Thoughts on how a hobbyist programmer approaches the .NET framework.
String.Truncate
After my previous post on truncating a .NET String at the end of a word, I thought that the simpler problem of just truncating a string to a specific length, while retaining all the rest of the code’s features, would have been obvious, but I got a couple of email requests. So here it is. /// <summary> /// Truncate a string to the specified length. /// </summary> /// <param name="value">The input string.</param> /// <param name="length">The maximum length of the returned...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, August 28, 2010 10:32 PM | Feedback (0) | Filed Under [ Programming ]

String.TruncateAtWord
I recently worked with a friend on a small C# teaching project. We started with the premise of writing a String Truncate function for .NET 3.5 SP 1. At its simplest, this is trivial to create. public String Truncate(String input, int length) { return input.Substring(0, length); } After a review of the weaknesses of this implementation, we went in search of a more meaningful challenge. We expanded on this first effort with a few additional requirements: Input validation Do not truncate in the middle...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, August 23, 2010 7:15 PM | Feedback (0) | Filed Under [ Programming ]

WPF: A Simple Color Picker With Preview
I am working on my first significant WPF application and found myself in need of a simple visual color picker. I quick trip to Bing linked me to a Sacha Barber CodeProject project that met most of my requirements. His associated blog post is here. My biggest unfilled need was the ability to set the initial color, so I set about adding that to the original code. I made a few changes along the way. The revised code can be downloaded here. I made the following changes to the ColorPicker control: Set...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, January 03, 2010 6:35 AM | Feedback (0) | Filed Under [ Programming ]

Blogiversary
Wow. Five years of posts. Of course, the last eight months have been pretty empty, but I am starting a new WPF project at work that looks to be very interesting. I hope to get back into the posting routine as the work evolves. We are working on the design right now. More to follow on that. I may also be posting on management of a distributed software development team
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, March 21, 2009 6:01 PM | Feedback (0) | Filed Under [ Programming ]

Custom Forms Designer: Toolbox and ToolboxService - Part 1
Reminder: All posts in this series can be found here. The Toolbox and the DesignSurface work together to allow a developer to add new components and controls to the design surface. There are two interfaces that implement this functionality: IToolboxService and IToolboxUser. IToolboxService defines an interface that provides methods and properties to manage and query the Toolbox capabilities in a development environment. All forms designer systems must implement the IToolboxService in their Toolbox...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, October 25, 2007 11:41 PM | Feedback (1) | Filed Under [ Programming ]

Custom Forms Designer: ServiceContainer
Reminder: All posts in this series can be found here. Simply, it is a container for services. Services are classes that have a well-known interface, that have instantiations which be stored in service containers, can be obtained from a service provider, and are addressable by type. The ServiceContainer class is a service provider and implements IServiceProvider. You obtain a service by supplying the Type of the service you want to the service provider's GetService method. The ServiceContainer.GetService...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, October 22, 2007 10:15 PM | Feedback (0) | Filed Under [ Programming ]

Custom Forms Designer: Name Creation Service
Reminder: All posts in this series can be found here. The first code I will look at is from one of the simplest services supporting the Windows Forms designer. The Name Creation Service is called each time you drop a control/component onto the visual design surface. Your job is to return a unique name for the new control that also means something. The standard process, per convention, is to take the control/component Type name, camel case it (lower case the first letter) since it will be a member...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, October 18, 2007 6:12 PM | Feedback (0) | Filed Under [ Programming ]

Custom Forms Designer: A Restart
Reminder: All posts in this series can be found here. Some time ago, I started work on hosting the Windows Forms design surface in a project. Since that was nearly three years ago, I believe it was in the early .NET 2.0 days. My priorities got redirected and the project languished. A new project is clearly targeted at achieving the same goal, so I am back to building a solid implementation to get a beta front end out the door. Those old posts are still of good use to remind me of everything I have...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, October 17, 2007 9:02 PM | Feedback (0) | Filed Under [ Programming ]

Tafiti Search
Microsoft announced the availability of a new Tafiti experimental search front-end based on Silverlight. I tried out the Halo 3 branded system, and it is visually very nice and functionally very smooth. However, as a search engine front-end, it is currently a failure. I sent the team the following feedback: Sorry guys, but I have to grade it as a complete failure. 1) You completely fail to operate under a common setting (popup blocker set at medium) in your own browser (IE7) 2) You cannot bypass...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, September 21, 2007 11:02 AM | Feedback (0) | Filed Under [ Programming ]

More About a Generic Range Class
Technorati Tags: generic range class, C# First there was Jay Bazuzi and his article and follow-up with a simple Range class. I referred to those postings when I did a generic range class for a project I had. Now Sean Hederman has posted a CodeProject article with his generic range class. Very nice...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, June 02, 2007 2:41 PM | Feedback (1) | Filed Under [ Programming ]

.NET Naming Debacle - 2
Almost five months ago, I wrote that "Microsoft screwed up big for customer confusion" with the whole .NET 3.0 naming thing. I got a few defensive comments about how the whole effort was great. Well, let's see. Today I read a post from a member of the Microsoft Architecture Editorial Board (whatever that exactly is). You know it is not going well when the post starts out with, "There has been considerable confusion about the differences between various versions of the .NET framework." My point exactly....
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, December 03, 2006 7:23 PM | Feedback (3) | Filed Under [ Programming ]

Windows PowerShell Jump Start
There are several friendly pages to help you get going. Assuming you are starting with VBScript, Microsoft has a Converting VBScript Commands to Windows PowerShell Commands page which will be your friend as you explore. Learn from their Task-Based Guide to Windows PowerShell Cmdlets. Get working examples from the Script Center Script Repository, and do not forget the Tools and Utilities. Download the latest version here...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, November 30, 2006 5:45 AM | Feedback (0) | Filed Under [ Programming ]

Google Code Search - Finding Hidden Evils
It is sometimes amazing what those crazy programmers put in their comments! Bad programmers! Bad! I personally try to not use “Hard K” words. Again /. is on it...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, October 11, 2006 3:50 PM | Feedback (0) | Filed Under [ Programming ]

Google Code Search - Use and Misuse
I have been playing around with this new (test) feature and have a few more comments. First, it is irritating that it does not yet respect your search customizations. I like 100 results per page, but Code Search puts up 10 whether you want it or not. Second, it is evident that quite a bit more of the published source code from books is now easily findable. The publishers switched from floppies to CD-ROM and later removed CD-ROMs from books to cut costs. They probably did not think their book code...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, October 08, 2006 8:18 AM | Feedback (0) | Filed Under [ Programming ]

Google Code Search - Finding Source Code
Google Labs has come out with a new means to find source code online. Google Code Search is a feature that returns hits from within posted source code. It did not take long for me to ignore the main page and set the advanced search page as my shortcut. So far, it seems heavily weighted towards Java (not surprising), with less available from C-based sites. The results layout also needs more differentiation between each separate result -- things blend together too much. More to follow as I use the...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, October 05, 2006 6:09 PM | Feedback (0) | Filed Under [ Programming ]

Vista Hates Developers
I have been posting infrequently, but it seems that a new pronouncement by Somasegar always stirs me up. The last time, it was about the .NET 3.0 Framework naming debacle. This time, it is about how the new Microsoft flagship operating system breaks with .NET 1.0/1.1 production support. Specifically, Microsoft will not support Visual Studio 2002 and 2003 on Vista. This is another ludicrous slap in the face. It is impossible to spin this in a good manner. Buzzwords like “compatibility“,...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, September 27, 2006 5:30 PM | Feedback (0) | Filed Under [ Programming ]

.NET Naming Debacle
Microsoft screwed up big for customer confusion on this one. First it was the attempt to explain the "red and green" model for compatibility in .NET 3.0. Now, it is announcing that .NET 3.0 will not include C# or VB 3.0, but will be an "additive release". Do you understand that? Even with pictures, you have to wonder what they were thinking. Everyone Microsoft is just bubbling over with support and entheusiasm. Customers are much less so. The general belief is that .NET is now heading down the evil...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, June 11, 2006 11:57 AM | Feedback (6) | Filed Under [ Programming ]

VS05 Recent Projects List
I have been moving projects around, so most of my recent projects list pointed to locations which were wrong. I wanted to clean things up, but I should of thought of this. Start RegEdit. Go to HKEY_CURRENT_USER\Software\... Delete what you do not want. Disturb nothing else. Leave no tracks. (I also renumbered the entries.)...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Wednesday, May 31, 2006 3:42 PM | Feedback (0) | Filed Under [ Programming ]

C# 3.0 (Orcas)
Some neat stuff coming. From the summary of the C# 3.0 Overview. Most of these revolve around lambda and query expressions. Update: What to read a really bizarre explanation of the "red and green model" for compatibility in .NET 3.0? Check out Somasegar's strange backflips about promising binary compatibility without really promising it. I agree with the first two commenters to that post: do not try for compatibility, but rather work towards building the very best framework possible. Perhaps Hejlsberg...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, May 19, 2006 4:14 PM | Feedback (0) | Filed Under [ Programming ]

Designing a Generic Range Class: Take 3
After a few more minor tweaks, I have completed work on the generic range class and moved on to the other support classes required for my project. Of course, not wanting to keep thinks simple, I restructured my source tree and broke all my references such that the unit tests no longer work. Now I have to fix those as well...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, May 16, 2006 8:10 PM | Feedback (1) | Filed Under [ Programming ]

Designing a Generic Range Class: Take 2
My previous post talked about the layout for a generic range class I was working on. I have now settled on the nomenclature and have filled out the properties and methods. I think I'll post this to CodeProject some day. [Serializable()]public class Range<T> : IRange<T> where T : IComparable<T>{ [Flags] [Serializable] public enum RangeCompareResult { ... } // Constructors public Range() public Range(Range<T> range) public Range(T Start, T End) // Properties public T Start public...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Sunday, April 23, 2006 8:16 PM | Feedback (2) | Filed Under [ Programming ]

Designing a Generic Range Class
It has taken awhile, but I have finally started on a C# project using VS2005. For the moment, VB6 has been retired. My initial actions have been porting some utility classes forward to a new library. One of the first ones I tackled is a generic range class to support the many ranges the project will be tracking. Things went well until I got to the part about defining the interaction while comparing two generic ranges. My current (partial) definition is: public class Range : IRange where T : IComparable...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Monday, April 17, 2006 4:44 PM | Feedback (0) | Filed Under [ Programming ]

Writing .NET v2 Apps With Free Stuff
I love free stuff. I especially love free stuff that has been tested and debugged. I hope to be starting a new app using VS2005 (if I can sell it) instead of VB6. As part of some quick research, I came up with this quick list of program parts that are already done. There are likely more. I would not use them all, but this can lead to a significant reduction in time and effort. They come with lots of adaptable samples. Enterprise Library for .NET Framework 2.0 Caching Application Block Configuration...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Tuesday, April 04, 2006 6:31 PM | Feedback (0) | Filed Under [ Programming ]

SSCLI/Rotor 2.0
Now this is neat -- it is only 22MB download and 154MB uncompressed! The ultimate .NET Framework programming toy. New features in the SSCLI/Rotor 2.0 release include: Generics Lightweight Code Generation (LCG) Open static and closed instance Delegates Relaxed Delegates Loader and System.Reflection re-writes [\sscli20\clr\src\bcl\syste... Metadata format updates New C# features like Anonymous Methods, Anonymous Delegates and Generics support [\sscli20\clr\src\bcl\syste...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Friday, March 24, 2006 6:40 PM | Feedback (0) | Filed Under [ Programming ]

Ordering Code Construction Tasks
This is a great post on Ordering Code Construction Tasks by Jeremy Miller. In it he answers the question of what order do you build an application? It shows good reasons to implement agile development. (Hat Tip: Roy Osherove)
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Saturday, November 26, 2005 6:47 PM | Feedback (0) | Filed Under [ Programming ]

Full Programming Archive

Powered by: