CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

October 2004 - Posts

  • Electric current boosts brain power...

    From Nature via Elliot Back:

    Connecting a battery across the front of the head can boost verbal skills, says a team from the US National Institutes of Health.

    A current of two thousandths of an ampere (a fraction of that needed to power a digital watch) applied for 20 minutes is enough to produce a significant improvement, according to data presented this week at the annual meeting of the Society for Neuroscience, held in San Diego. And apart from an itchy sensation around the scalp electrode, subjects in the trials reported no side-effects.

    Okay.  I definitely need one of these.  I'll probably try to make one over the weekend. I have some 9 volt batteries hanging around somewhere I think.  I could scotch tape them into a baseball cap or something.  I'll keep you posted.

    -Brendan

  • FreePop3 - Connect and Pop All Messages

    I wanted to show some sample code for receiving messages with FreePop3:

    // Create the client
    Pop3Client freePopClient = new Pop3Client("popserver.yourcompany.com", "user", "pass");

    // Pop off all of the messages, this will also connect and disconnect
    // the TCP session
    Pop3Client.Pop3MessageCollection messages = pop3.PopMessages();
    foreach(Pop3Client.Pop3Message message in messages)
    {
         
    // Do something cool here
    }

    Could it be any simpler?

    -Brendan

  • Announcing: FreePop3 Project

    A recent project here at the Port sent me looking for a .NET Pop3 client.  It turns out that for what I needed, I couldn't really see purchasing a full blown Pop3 component.  I just needed simple Pop3 email message retrieval.

    As an aside, I often find myself weighing the benefits of purchasing vs. rolling my own components. I know all about the dangers of rolling your own.  There are some things that definitely have the complexity to merit purchasing.  Report generation, charting, tree controls are just a few things that come to mind.  But, what if what you need to do is very very simple?  What if you're on a budget? You'd never purchase a component that manages file IO within your code, would you?  It turns out that the Pop3 spec is very simple. In fact, there's only about 10 commands total. 

    So, rather than purchase a component that did Pop3, I coded one.  Not before I did some research.  The component I came up with borrows heavily from this article here from Duncan Mackenzie at MSDN.  His example is in VB (FreePop3 is C#) so there was some porting to do, as well as some additional coding, and some polishing here and there.

    It needs a few things, most lacking is the message that is returned.  I only added the To, From, Subject and Message fields. I've created a GDN workspace for the project here.  If you'd like to lend a hand, I'd welcome any help!

    Brendan

  • Bush Site Rejecting Non-US Visitors

    From Netcraft:

    Bush Campaign Web Site Rejects Non-US Visitors

    The official campaign web site for U.S. President George W. Bush appears to be rejecting web requests from outside the United States.

  • MS Developer Division Blogs

    From ensight, a good list of blogs from the MS Developer Division.

    Many members of the Developer Division leadership team are blogging their plans for the division, and the products they are responsible for. This page gives you the ability to see what they are planning and insight into the direction for Visual Studio and the related products from now, through Whidbey and Burton, and to the future.
    Subscribed!
  • Has Java Jumped the Shark?

    Comments from some folks at O'Reilly on the “State of Java” are pretty depressing.  It seems that some are saying that Java is the new COBOL. Well, even though that sounds bad, it's actually quite an accomplishment for anything to become the new COBOL.  However, NO one wants to be a COBOL programmer, do they?   Don't get me wrong.  I have mixed feelings, and a soft spot for Java, after all, it taught me nearly everything I know about C#. 

    But this and the dismal reports from this years Java One conference, where the presenters where supposedly falling asleep during their own presentations, makes me glad that I'm doing .NET development. Has Java Jumped the Shark

    - Brendan

  • De-serialization and Class Versioning

    I'm usually  late to the party, but I just found a February article by Neil Davidson (of RedGate) Nine reasons not to use serialization.  If you read the article, points 2, 3, and 4 have to do with serialization not being future-proof.  I really haven't digested the whole article yet, but Neil knows his stuff, which makes me inclined to listen to what he has to say on the topic.

    I'm currently running into big problems with serialization of objects to XML not being future-proof.  As he says, even small changes to your objects can break things.  Often, after refactoring a class I find that I have to clean up some serialized objects, or code around the changes. In the Java world, there's a solution to this.  Basically, it involves versioning the serialized data, so that you can safely de-serialize the class.  Does anyone know of a way to version objects like this with .NET?  I figure one of the folks that just got back from XMLDevCon might have some good ideas about this..

    -Brendan

  • OT: New Snoop Dogg is the next "Hey Ya"

    I just heard the new Snoop Dogg song, “Drop it like it's Hot.” You can hear a bit of it here, although it's a very short clip.

    Listen Again
    Snoop Dogg - Drop It Like It's Hot

    It's going to be the next big thing.

    -B

  • ReSharper as a TDD Tool

    One of the things I've been thinking is awkward in the Test Driven Development process was the step where you write a test that for a method that doesn't yet exist.   If you follow the TDD process as laid out by James Newkirk, you're supposed to write your test case, code as if the method exists, then compile.  Of course your code won't compile, since you haven't yet implemented the method.  This is your “GO“ ticket for actually implementing the method.

    This just seems broken, mainly because I  have to use my compiler, not NUnit as a part of my TDD process. Compiling is slow, especially compared with running a test. And compiling when I know it's going to break seems like a waste of time.   TDD has reduced the number of times I have to compile in a day, and I want to keep it that way.

    But, if you've used ReSharper, it offers a great feature that eliminates this compile step.  This is really cool, and it actually makes TDD much easier.  Here's how it goes. Write your test for your method (the one that doesn't exist yet).  ReSharper will give you an option to implement this method.  Choose this option.

    ReSharper will open the code file and add the method, using the types from your calling code. It even raises the System.NotImplemented exception for you!

    This is cool stuff, and gets rid of this awkward step!

    -Brendan

  • Crystal finds a Scapegoat...

    Word of mouth is that Service Pack 2 for Windows XP breaks the Crystal Reports Designer.  Indeed, there's a long list of the things that SP2 breaks.  But on Crystal's site, we see this little gem:

    Status:

    Not a Crystal Problem

    Product:

    Crystal Enterprise Professional

    Reported Version:

    10.0.0.0 Crystal Enterprise Professional

    Applies to:

    All versions

    Bit Version:

    32 Bit

    Assuming that they are blanket passing the blame, which kind of seems like they are, the funny thing about this is most developers realize that stuff like this breaks because it wasn't coded according to the best practices at the time. I would venture to guess that if we could peek at the code, the underling problem is BAD CODE.  Now, who's fault is it in the end?  Of course the majority of the blame lies with Microsoft.  Shame on them for breaking such an important application.  But, is this “Not a Crystal Problem”?  I'd say that it's a BIG Crystal problem. I've never seen the Crystal code under the covers, but I've seen it break enough to know that the underlying code base is probably a mess.

    -Brendan

  • The Podcasting Backlash...

    Man, it was just a couple of weeks ago that I first heard about Podcasting.   Carl Franklin Started even started a company around it.  If you want to know more, you can read 20 posts a day from Scoble, including his take on the backlash.  Maybe it's because I don't have an IPod or other device.  I don't really commute either.  So I can't really say whether this thing will take off.  But, it's interesting that Scott Hanselman appears to have stuck his neck out and started a backlash

    “Sorry folks, PodCasting = Verbal Incontinence.  I'm just not feeling it.  You can't speak as fast as I read.  I don't like it when you read your PowerPoints to me, and I REALLY don't like it when you ramble on.”

    I can see listening to a couple of podcasts.  And often times listening is better than reading.  I'd rather listen to than read much of the long MSDN content that I read.  Especially if the content is about general concepts and I'm not trying to solve a specific problem.  I do agree with Scott that blogs are better read than listened to for the most part. 

    The roots of this topic have actually been around for a long time in the field of Educational Psychology.   Do people learn better by reading, watching, doing, listening?  It turns out that the answer is “it depends.” There, I had to pay for a master's degree to find that out and I gave it to you for free.  It's said that there are different learning styles: Auditory learners learn best by listening, Kinesthetic learners learn by touching, blah blah blah.  Actually, I have my own theories about learning:

    Everyone learns best by doing. Teaching someone one on one or in a classroom is best.  Distance learning sucks, but some distance learning sucks less than others.  Way to much money is wasted on distance learning.  Much of it is because of crappy software.  It's a vicious, parasitic cycle.

    I think the same principles (if you can call them that) can be said for Podcasting.  Some people will love it, if their brains are set up right for learning, and understanding that way.  Others, will probably hate it because their brains are not wired for that kind of learning. 

    -Brendan

     

     

  • SQL Server 2005 Delay Holding Back VS 2005 Too...

    According to Frans, the announcement that SQL Server 2005 will be delayed until the end of 2005 also means that VS 2005 will be delayed until then as well... I guess this could have been predicted...

    -Brendan

  • Think first, THEN Edit and Continue...

    I agree with DonXML when he questions the value of making Edit and Continue a part of your development process.  To add my $.02 to the debate, I can see this being misused in a number of ways.  Take this for example:  You're debugging, you encounter a bug.  So, you inspect an object in the Immediate window, find the property with the value you're looking for, add it to your code, and voilà.  Your code runs! 

    The big problem I can see here is coding to some value of some field at runtime!  Now hopefully most developers won't do this, and will actually use it to say “Oh yeah, dumb mistake, I need to fix this.”  But I have a feeling that many developers will begin to use the debugger instead of intellisense or framework documentation to find out what interface to code against.

    I've been guilty of this myself.  I wrote a bunch of pathing code to determine runtime paths for ASP.NET.  I figured much of this out by inspecting the Request object's properties at runtime.  What happened?  The shit broke, that's what happened.  The problem was I didn't understand the objects I was using, I was just programming to what looked good at runtime.   When the runtime environment changed, it broke my app.

    Now,  Microsoft doesn't seem to be interested in fundamentally changing the way we develop code.  They're never going to develop tools that support agile methods first.  To do this would be to alienate 95% of the developers out there.  They want VS to fit into your existing development process, no matter how screwed up it is.   And you can't blame them.  They're trying to make everyone happy - they're selling software. 

    So, I guess what I'm saying is we can't really blame them for adding features that are going to be mis-used.  Keep yourself disciplined.  Use these things only when you really really need them, like right before a deadline.  ;)

    -Brendan

  • I'm a Slight Team System Skeptic

    Wow! I spent the better part of today listening to the latest DNR episode all about Whidbey.  All around great episode.  They mention a video of a TechEd presentation by Team System group, and I just spent the last hour watching it..

    I'm really blown away by the ambition of Team System.  This thing looks like it's going to try to address all kinds of problems we developers face, from source control headaches, to team communication, to unit testing to code coverage, to project management to deployment management.  It looks like it'll replace NUnit, NCover and a handful of other tools.  Holy cow. 

    On one hand, I can't wait to get my hands on the release.  On the other, I can see so many points of failure in a big interconnected system like this.  Don't get me wrong, it looks soooo good, but knowing how buggy VS.NET can get, especially over time with bigger projects and more plugins, and service packs, etc.  I can see this great all in one place integrated system turning into an all in one place integrated broken piece of software.

    I hate to be this pessimistic.  But currently there are a hand full of things that seem to be permanently broken on my workstation's VS 2003 that I just work around every day.  It's nice to know that I can fire up NUnit, and it's not going to tell me that it won't run for some strange reason. You know what I mean? 

    So, anyhow, it looks very cool. And I'll certainly be using it, but I hope it all works! 

    -Brendan

  • Pablo Picasso was Never Called an Asshole, but he Never Wrote DNR Either...

    As I'm listening to the “Ask Rory” segment on this weeks DotNetRocks, I hear Rory respond to a listener's “Ask Rory” letter, by saying “I think you're an asshole.”  So then everyone has a big laugh at this guy's expense... I'm wondering if anyone else is laughing.  I'm sitting here thinking, do they think this is a good idea to alienate a loyal listener?  Is this kind of like Pink Floyd's Roger Waters spitting at a fan

    I mean, when I think about it, the guy who wrote this letter must have been a pretty big fan.  His letter was pretty funny, and was obviously written so that the DNR guys would think it was funny too.  So, what gives? 

    I'm still a DNR fan.  I listen every week.  I've learned a ton of great stuff from listening and I'm not at all turned off by any of the stuff on the Weird Wide Webb segment, or anything else for that matter.  But now, I'd actually never write in, for fear of being called an asshole.  In fact, Rory may call me an asshole just for posting this... Who knows? What  I'm really wondering is if I'm alone in being bothered by this?

    -Brendan

More Posts Next page »