Articles from October 2006

Fun with Code Analysis Regex

By Michael Flanakin @ 7:57 AM :: 3100 Views :: .NET, Patterns & Practices :: Digg it!
Well, "fun" might be stretching it, but it's interesting, at least. As I've mentioned before Mobile-ready link, I'm doing a lot of work with code analysis problems. Because a lot of these things are so repetitive, I've started thinking about how regular expressions might be able to help speed up my work. I've been fairly happy with the results, but the real answer is that there needs to be more refactoring support around code analysis. I'm interested in this, but doubt that I'll have enough time to dedicate to pulling a complete add-in together. If anyone else is interested in it, let me know. For the time being, I've decided to keep track of the regex for fixing code analysis warnings Mobile-ready link I'm coming up with. In part because it might be useful if/when I decide to create an add-in, but mostly because I just want to keep track of it. As usual, I welcome any comments or suggestions for these. Anything that might make a developer's life easier.

DSL Tools Teaser

By Michael Flanakin @ 6:27 AM :: 1995 Views :: .NET, Development, Architecture :: Digg it!
If you haven't seen it yet, check out the domain-specific language (DSL) tools video Mobile-ready link on Channel 9 Mobile-ready link. I admit, the video isn't all that exciting, but the capability is. The simple fact that we can now build designers so easily is astounding to me. I've never been one to care enough to learn some of the advanced graphics stuff you can do in .NET, but I've always wanted a complete model-driven architecture (MDA) Mobile-ready link environment. This is a means to that end. I'm excited about it. I can't wait to dig in and create my own! Then again, there's always that pesky time thing...

Google Goes Solar

By Michael Flanakin @ 2:27 PM :: 2898 Views :: Technology :: Digg it!
I've been interested in solar power for quite some time. I think the idea of such a clean, seemingly limitless power source could be hugely beneficial. The fact that Google is planning on powering an entire campus Mobile-ready link is very exciting. This is one trend I hope Microsoft and other corporations will follow.

Microsoft May Become a Chip Maker

By Michael Flanakin @ 12:43 PM :: 1736 Views :: Technology, Microsoft :: Digg it!

Here's an interesting tidbit Mobile-ready link. I guess Microsoft is looking to get into the chip-making business for the Xbox. I have to admit that I don't think it's a smart idea. I can understand why Microsoft is thinking about it -- by controlling the core hardware Xbox will depend on, Microsoft will be able to focus the future of the product-line in whatever direction it sees fit. For anyone who sees this as an old school Microsoft move to use it's wide software usage to drive into hardware, I don't think you have anything to worry about. When it comes to creating the next generation gaming experience, Microsoft will need to play all the cards it can, which includes the hardware it's built on. Of course, this is assuming Microsoft can pull it off. Don't get me wrong, if anyone is capable of doing it, Microsoft is. We have some brilliant people here. My real concern is that, as a company, we haven't done the best job in the hardware arena. I admit that I don't know a lot about the financials; however, if my intel is correct, the Xbox has been a loss since it started. Granted, this has nothing to do with the product's consumer value. Xbox is and will remain to be a major contender in the gaming market. Microsoft's position is that it would rather be competing in the market and be losing than not competing at all. Besides, Microsoft has a lot of staying power, which is why it's become such a good competitor in so many areas. We'll have to see how it turns out; but I don't think we'll really hear anything for sure for another few years.


Code Analysis in .NET

By Michael Flanakin @ 7:25 AM :: 4927 Views :: .NET, Patterns & Practices :: Digg it!

I just started working on a project that needs a lot of clean-up work done. It's one of those systems that's grown over the years and nobody has ever really gone thru and cleaned out the closets. To give you an idea, running the latest standalone copy of FxCop Mobile-ready link on the assemblies in the web app produce 12,020 messages.

When I first loaded the project in Visual Studio 2005, I tried to run the built-in code analysis feature, but didn't know where to find it. Eventually, I found out that code analysis is only available on a project-by-project basis. This means I'd have to run it on each project independantly. There's no way I was going to do that! Eventually, I found out about a macro Mobile-ready link created by Daniel Fisher Mobile-ready link that would enable code analysis for all projects (I am hoping to release this as a VS add-in in the future). Executing this and re-running code analysis is what I needed. That gave me 9320 warning messages. Of these, I noticed 50 were not code analysis messages (i.e. updated libraries, deprecated methods, and several other typical compilation warnings). Having this list was just what I wanted... well, almost. I ultimately plan on getting these items imported into Team Foundation Server as development tasks, so I needed to save this list to a file. Of course, when you run code analysis on a project, an XML file is created. Great, right? Not quite. Each project created its own XML file, so I had to dig thru the unorganized directory structure to find all of the files (actually, I just seached for all XML files with "codeanalysis" in the name). After looking at these files, tho, I noticed that they only accounted for 6932 messages -- assuming I was reading them correctly -- which, as far as I'm concerned, is a far cry from the original list.

I dug around trying to find a way to save the error list to a file to no avail. The best I could find was to simply select all of the items, copy them, and paste them in some editor to manipulate. If I have time, I will see about creating the ability to export this list to XML in that VS add-in I mentioned. For the meantime, tho, I needed another way to get the list.

I ultimately resigned myself to the standalone version of FxCop, Visual Studio's code analysis predecessor. The latest version Mobile-ready link, 1.35, was released in June 2006, 8 months after Visual Studio. This, of course, led me to see if there was a way to update Visual Studio's built-in code analysis capabilities. Unfortunately, there isn't Mobile-ready link. So, I decided to just keep it simple and stick with FxCop 1.35.

I plan on keeping my eyes open for a resolution to this issue. The best I can see for now, tho, is that we'll have to wait for the next release of Visual Studio, which I'm hoping will be available in very early 2007.


Additional Code Analysis Warnings or Errors Cannot be Displayed

By Michael Flanakin @ 7:40 AM :: 2166 Views :: .NET :: Digg it!

Symptoms

When running code analysis from Visual Studio 2005, you receive the following error as the last item in the error list:

Additional code analysis warnings or errors cannot be displayed

Cause

By default, only 200 code analysis warnings and errors are displayed. This is done for performance reasons.

Resolution

NOTE: Rumor has it that VS 2005 SP1 will fix this error; however, I have not tried that, yet.

There are two options to get around this. First, if it iyou can fix the first 200 and re-run code analysis. Obviously, if you want to see the true impact of code analysis to determine where to focus your efforts, this won't really help. So, the best option is to apply a quick and simple registry change to specify how many warnings/errors you'd like to see.

  1. Start > Run...
  2. Type regedit, click OK
  3. Traverse the tree and select the following item: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\EDev
  4. In the right pane, double click the CodeAnalysisErrorListViolationLimit and change the value to the desired number of warnings/errors to display

More Information


If Apple Made Cars

By Michael Flanakin @ 10:19 AM :: 4138 Views :: Technology, Other :: Digg it!

I'm sure everyone's heard the "if Microsoft made cars" joke, but a recent photo contest Mobile-ready link submission by Josephus to Woot Mobile-ready link definitely tops it -- ok, maybe I'm biased. Despite the third place ranking, I think it was the best out of these finalists.

If Apple made cars - By Josephus c/o Woot.com

For anyone who doesn't get it, Apple uses a one-button mouse for Macs. This has been widely disputed over the years, but Apple never changed anything. Actually, I heard that there was going to be a change, but I'm not sure if that has happened, yet. Either way, this is great.


Of the Past and Future: A Moment in Science

By Michael Flanakin @ 1:12 PM :: 1717 Views :: Other :: Digg it!
And now for something completely different... I just notice two articles on Slashdot Mobile-ready link that I thought were quite interesting. First, remnants of a "gigantic monster" Mobile-ready link were found near Norway. The 150-year old fish-like reptile find is supposed to be the most important in the past few decades. I can't speak for that, but I can say that the story is interesting. I only wish I had some pictures. If that wasn't enough, it seems as tho scientists have discovered a way to turn air into water Mobile-ready link. Now this is very interesting. I can only start to imagine some of the ways this can be used. Better yet, where this research might lead to is even more interesting.

Google Reaches Out to Developers

By Michael Flanakin @ 8:14 AM :: 1718 Views :: Development, Technology :: Digg it!

Here we go again... Google is doing what it does best: reaching developers. This time, by providing a code search Mobile-ready link. This is one thing that Microsoft doesn't seem to understand, which is odd when you take into consideration the fact that a developer focus is how Microsoft won the desktop OS wars. Well, maybe it wasn't a war, but more of a gradual push into a new market. Google, on the other hand, has rooted itself in the concept that, if you gain a strong-hold in the developer mindset, they will proliferate their tool usage throughout their contact list like a virus. And, it truly is like a virus (in terms of spreading, at least).

Think about how you heard about the Google search engine. I first started using it on a daily basis in 2000. I'd seen it before then, but never really thought about how much I really searched for content online. When I was re-introduced in early 2000, tho, the benefits finally sunk in. A developer showed me and what did I do? I told all of my developer buddies. Not only did I stop there, I told my friends and family. I would slowly start to convert girlfriend after girlfriend to Google. I did pretty good as a mindless bot, if you ask me ;-)

Google takes this and exploits it to the fullest. I can't say whether Google realized this in the beginning -- or even now, for that matter -- but Microsoft is still playing catch-up and just hasn't done a lot to surpass Google. Live Search Mobile-ready link is good. I admit that it isn't quite as good as Google Search sometimes, but my life after Google has been pretty satisfactory. I can honestly say that I haven't had the urge to look back once... in the text search realm, anyway. Microsoft did introduce the idea of macros to online searching, which was an attempt to reach the tech-savvy, but I don't think that capability has really reached everyone. Part of that might be due to the fact that the concepts behind search macros aren't widely known. I, for one, looked into it and lost interest fairly quickly due to a lack of documentation. I didn't know where to start and since I clicked a link out of sheer curiosity, I didn't care enough to figure it out more. Perhaps one day I'll go back and check it out, but from what I saw, it was merely a way to perform scoped searches slightly easier. Not really something I'm all that interested in, but the idea is nice. Microsoft needs more, tho. Microsoft needs a wiz-bang feature that no search engine has. I don't know that this will happen anytime soon. I have one idea, but it's so specialized, it might not be worth the efforts. I've passed it along, but don't expect to see much out of it.

We'll see where Google's new code search goes, tho. The concept isn't new, but this is the first major search engine to pick it up. I used a couple of the previous code search providers, like Krugle Mobile-ready link and Koders Mobile-ready link, but it was never something I could get into. I would only need something like that once in a blue moon. My problem with them is that you have to know the code you want to look for. If there was more documentation that would lead you to the code you wanted, then that'd be a different story. Until that day, I just don't see this being an industry-changing capability. Well, unless there was an integration into the development environment that could alert a developer that they're typing code that's been created before. Sort of a context-sensitive, auto search capability that would display similar code. That could be useful, but would require a drastic change to how development is currently done. I almost think that any such effort would be doomed from the start.


I Want This Elevator

By Michael Flanakin @ 9:23 AM :: 1754 Views :: Other :: Digg it!

I remember seeing a bunch of sidewalk paintings a while back that were realistic. This one is even better, given the context. I wish I had a floor mat like this to lay out in any elevator. That would be the perfect prank. Imagine, you're walking to work, not paying attention to the floor of the elevator, you start to step in, look down, and grab for dear life... well, that's probably what you'd be thinking, anyway. Honestly, I don't think most people would see it until after they're in, but even those reactions would be good. I can only imagine...

Elevator with no floor
Elevator with no floor? Mobile-ready link