Roland Weigelt

Born to Code

  • Need a New Year's Resolution? What about User Groups?

    You are a developer by passion. You are interested in new technologies, even in your spare time. You are driven to keep your skills up-to-date. You are reading blogs, maybe you are writing a blog yourself.

    But something is missing.

    The developers around you are different, and you can’t even blame them. Maybe they are busy building a house, their children are keeping them on their toes, a non-computer hobby eats away their spare time – or they are simply working crazy hours and need a well-deserved rest when they get home.

    You would like to get in touch with other developers. The Internet offers a huge number of possibilities to get connected to people all over the world, but let’s be honest, nothing beats meeting “real” people.

    Have you thought about joining a .NET user group?

    At a .NET user group, you’ll find a wide variety of people, coming from different backgrounds, with vastly different skills and experience levels, all united by the common interest in .NET technologies. Most user groups are having regular (e.g. monthly) meetings, where talks are given by members or external speakers – this is were you meet real people, not online personae.

    A good place to find out whether a user group exists in your area is the website of the International .NET Association (INETA) at www.ineta.org. Choose your region and start looking for a nearby user group. If you find a group in your area, things are really easy: go to their website, get in contact and visit one of their meetings.

    If you are wondering whether you are a “user group person”: Don’t be shy or too critical of your own skills – a user group meeting is not a place where you have to prove yourself in any way. If you prefer sitting quietly in the back, you can do just that. Nobody will force you to become a speaker the minute you enter the room.

    Here are a few tips for your first meeting. These are pretty obvious, but being a user group leader myself I have my fair share of experience with first time visitors:

    • Don’t be late (yes, duh). Note that coming late can be a major annoyance, e.g. if the meeting takes place in a company meeting room, where somebody may have to pick you up at the entrance.
    • Come a bit earlier so you can talk to the user group leader or the person you had contact with, or other members. Don't be way too early as that will most likely disturb the preparations (setting up equipment etc). The best thing is to ask your contact for when other members usually start to show up.
    • Prepare a short introduction you can use when talking to other people – who are you, what are you doing, what are your interests. You don’t want to drive home thinking “dang, I should have mentioned I’m very interested in technology X” given the chance that somebody else could have started a conversation “hey, I’m using X, too… what tools are you working with?”.
    • Avoid being under time pressure. Depending on the user group and their meeting location, group members may go to a bar or a restaurant after the “official part” of the meeting. Plan for enough time to join them, it’s the best thing you can do to get in contact with other people.

    But what if the next user group is too far away?

    Have you thought about founding a .NET user group?

    So you didn’t find a user group near where you live. Of course you could wait until a group is founded by somebody else. That’s what I did for almost a year before I eventually founded a group myself in Bonn, Germany called Bonn-to-Code.Net (yup, pun intended, all credits go to my buddy Jens Schaller) – that was exactly one year ago on January 1st, 2006.

    A couple of tips for building a user group:

    • Find a meeting location. Sure, you can found a group first and take care of the location later on (maybe hoping that somebody else has a room to offer), but obviously you are in a much better position with a proper location. I had luck that I could convince my employer (Comma Soft AG) to provide the meeting rooms complete with beamers and a sound system. To convince your employer, write up a list of
      • risks, e.g.
        • Developers from other companies could benefit from specific internal know-how that took a long time to develop
        • Skilled employees are more visible outside the company and thus could be lured away
      • and opportunities, e.g.
        • Generating an influx of know-how and new ideas
        • Providing a venue to show that this company is a cool place to work at, and getting it known among developers (especially developers that share a certain level of “energy” in contrast to people with a 9–5 mindset) 
      Furthermore, ask and answer questions that surely will come up to show that you are acting responsibly:
      • How to determine which topics of everyday work company employees can talk about at meetings (if you find it easily on Google, it's not a trade secret)
      • How to make sure nobody can wander freely inside the company building (e.g. accompanying people to the restrooms)
      • How to make sure no computer of an external person is hooked up to the network
    • Build a website. Lots of what can be done wrong here…
      • For a start, keep it simple. Don’t dream up what could be done with forums, wikis and blogs; you’d need a critical mass that’s hard to reach on the Internet, let alone in the context of a local user group.
      • It’s all about content. It doesn’t matter if you start with a website consisting of a single page whipped up in FrontPage if it’s updated on a regular basis – even if it’s just a blog-style report describing the process of founding a user group. Long-term solutions can be searched for after the first meeting(s). 
      • Remember that user groups are about people. Too many user group websites make it hard to see that. Who are you? What are your interests?
      • Don’t try to “sell” too hard. Yes, there are benefits for the members of a user group (e.g. rebates on software licenses and/or books, see the INETA website for more on that), but that shouldn’t be the focus. You are not looking for customers you have to convince, you are looking for a bunch of devs coming together and having some fun. 
    • Advertise the group.
      Use everything at your disposal: your blog (if you have one), community websites like codezone.com/de, etc. Create flyers, posters – whatever comes to your mind.
    • Take a look at what INETA offers
      On the website you’ll find information on how to start a .NET user group, how to apply for (free) membership, etc. Don’t expect miracles from INETA, but founding a user group and not contacting INETA is plain dumb.
    • Plan the first meeting. There are multiple approaches to a first meeting, two I have witnessed myself (in Bonn and at the neighbour group in Cologne, DNUG Köln) are:
      • Let people introduce themselves and get to know each other
        In Bonn, the first meeting consisted mainly of short introductions on two or three PowerPoint slides. Obviously, this approach doesn’t scale well beyond let’s say 15 people, but looking back this really gave the group a jump start in terms getting to know each other. The evening did not offer any technical content, but dealt with planning future meetings, deciding on topics, etc.
      • Start with a “big bang”
        In Cologne, the first meeting had a well-known conference speaker giving a talk. There was no time for really speaking about organizational issues, and after the event, the speaker was the focus of attention. Nevertheless, the Cologne group is now running successfully. Starting “big” attracted people who otherwise wouldn’t have shown up (by their own honest account), many of them still being members.
      A third approach would to split the time between a talk (given by a speaker that will be a member of the user group) and an organisational part of the evening. People could introduce themselves without support by PowerPoint slides, but that tends to less “sticky” than text and speech.
    • Make sure you have a rough idea for the second meeting. Maybe you are lucky to you have a bunch of “natural born speakers” in your group, eager to give talks. If that is not the case (or if you don’t find enough material for a full evening), have a plan B up your sleeve, i.e. a talk that you could give. Note that your primary goal must be to get other people involved as quickly as possible, which brings us to the next point.
    • Lower the entry barrier for contributions. Preparing a talk takes time and effort, which may put people off. There are things you can do to encourage contributions:
      • Offer a PowerPoint template
        Make it easy to author PowerPoint slides that “fit in”, i.e. have a certain “official user group feel” for those that are not comfortable developing their own design or using a stock template shouting “look at me, I’m a PowerPoint n00b”.
      • Introduce the concept of a “QuickTip”
        Don’t require each talk to be of same length and depth. Sometimes just a hint on a single hotkey, a small tool or a cool website can be enough for the visitors of the meeting to drive back home with a positive feeling. At Bonn-to-Code.Net, a “QuickTip” consists of just a few slides: what’s the problem, what’s the solution, and a short demo (sometimes maybe even just a screenshot).
      There are so many hidden talents out there that could be speakers for you user group, you only have to find them. The most important thing is to get them speaking for the first time – it’s usually less of a problem to convince them to give a second and a third talk.

    New year’s resolutions are about changing something in your life. If you get involved in a user group, you life will change – be it just a little bit (just coming to meet other developers), a little bit more (taking the plunge and contributing a talk here and there), or a whole lot more (founding and running a user group). Whatever you do, be assured you’ll have lots of fun.

  • How to Delete an WinForms Control Event Handler Quickly

    Recently a long-time user of Visual Studio looked over my shoulder when I deleted an event handler from my source code, and he said “uh, wait… how did you do that?”. If you are like him, not using the keyboard for this task, and would like to speed up things a bit, you may find this tip useful.

    Imagine you have an event handler in a file MyForm.cs, e.g.

    private void myButton_Click( object sender, EventArgs e )
    {
       // ... some code ...
    }

    Deleting only this method obviously results in a compiler error as there’s a line

    this.myButton.Click += new System.EventHandler( this.myButton_Click );

    in the file MyForm.Designer.cs that has to be deleted as well.

    To delete the event handler properly in Visual Studio 2005, using only the keyboard, perform the following steps:

    • In the MyForm.cs file, move the cursor on the name of the method file (i.e. myButton_Click) and press Shift-F12 (command Edit.FindAllReferences), which will bring you to the Find Symbols Results window.
    • press the Cursor Down key to move to the second line showing the occurrence of myButton_Click in the designer-generated code that connects the event with the handler method*
    • press Enter to jump to the MyForm.Designer.cs file
    • delete the current line by pressing Ctrl-Shift-L (command Edit.LineDelete)
    • jump back to the MyForm.cs by pressing Ctrl-Tab
    • and finally delete the code of the event handler method.

    The description of the steps may sound a bit complicated at first, but you’ll find that the actual keystrokes come naturally pretty soon.

    _____________
    *) Note that this is only the case when the form was actually created in Visual Studio 2005 – keep your eyes open when working with forms in older projects that were started in Visual Studio .NET 200x.

  • Thank You!

    There’s a time for complaining about issues, and there’s a time for telling when things are great.

    I’m right in the middle of writing custom column and cell types for a DataGridView and I had a problem with adding a custom column to an existing grid – the DataGridView threw an exception in design mode, obviously a bug in my new code.

    It took me only a couple of minutes to

    • start a second instance of Visual Studio for debugging*
    • open the current solution a second time
    • open the designer for the dialog the DataGridView was on
    • add the custom column
    • watch the first Visual Studio instance point me to the source code location where the resulting exception was thrown
    • edit the code (after letting Visual Studio unwind the exception)
    • and continue with a now working custom column.

    Some of you out there may shrug their shoulders and ask “so what?”, but I must admit that even though I have used edit and continue for code running in Visual Studio before (when developing managed add-ins), I never cease to be freaking amazed! So to whoever contributed his/her part to making this work: Thank You!

    _____________
    *) Project Properties – Debug – Start Action – Start external program – enter the full path of devenv.exe

  • WPF/E CTP - Nice, but...

    I just downloaded the WPF/E CTP bits (a good starting point for all things WPF/E is the new Dev Center). If you are a C# dev who has waited for the CTP as eagerly as I did, be prepared for a slight disappointment: right now you can only use Javascript, but no managed code – yet. Fortunately a blog post by Scott Guthrie gives a hint of things to come: “…We'll also be providing "WPF/E" integration with .NET managed code next year ”.

    Regarding the roadmap, the WPF/E FAQ says “Microsoft plans to deliver a customer-deployable release in the first half of 2007”, with Joe Stegman mentioning upcoming CPTs in this blog post: “Our next milestone is scheduled for February 2007 and the feature set for this is in development and mostly fixed. The milestone after that will be driven largely by customer feedback”.

  • How to Set the CSS Class on an HtmlElement Instance from C#

    I’m currently using the WebBrowser control in a WinForms application as a simple layout engine, as it’s much faster when rendering texts in front of a background image than WinForms (and I need it by the weekend, so I don’t want to take the risk of using it as a learning project for WPF). For my purposes I only need to manipulate some texts – and the CSS class of specific elements on the page.

    Now let’s assume you have an DIV tag in your HTML like this:

    <div class="someClass">Hello World</div>

    and you want to change the CSS class from your C# code. It’s pretty easy, you just have to get a HtmlElement instance representing the tag and use the SetAttribute method. What took me some time to figure out is the problem that if you call

    myHtmlElement.SetAttribute("class", "anotherClass");

    nothing will happen in the display of your page. The reason for this is that SetAttribute does not actually “set an attribute of a tag”, but a property (representing the attribute) on an object (representing the tag) in the Document Object Model (DOM) – and the property’s name is “className”, not “class”. So the correct code is

    myHtmlElement.SetAttribute("className", "anotherClass");

    (If you're wondering why SetAttribute didn't complain about using the name "class": the DOM was primarily designed to be used from Javascript, which is a language where any object can be extended by simple setting a property. Sounds a bit strange, but it’s also a feature that can be used for seriously cool stuff)

  • Firefox 2.0 : Going Back to 1.5 Style...

    Ok, I really tried, but after working with Firefox 2.0 for a few days I still don’t like the Close buttons on the tabs (I know IE7 has them, too, but that doesn’t make things more usable for me personally). Fortunately it’s simple to go back to 1.5 style:

    • Enter about:config in the address bar
    • Set browser.tabs.closeButton to 3
    • Restart Firefox

    And if you prefer the icons of Firefox 1.5, there’s a theme for you on Mozilla.org.

  • Article "Introduction to GhostDoc" up on DotNetSlackers

    Some time ago Sonu Kapoor, webmaster of dotnetslackers.com, asked me to write an article about my Visual Studio add-in GhostDoc. It took me some time to find an empty spot in my busy schedule, but the article is now finally online. It is an introduction to GhostDoc that may be interesting for those who haven’t tried GhostDoc yet and would like to read a bit more about the features before actually downloading and installing it.

  • Whoops... I Just Asked a Question and Now I Won a Prize...

    Ok, the title sounds like what happens on developer conferences when you ask a technical question and suddenly the speaker pulls out a t-shirt or a book and hands it over to you. No, this one’s bigger… much bigger.

    Back in summer, I participated in the Microsoft Visual Studio Extensibility Contest with my add-in GhostDoc (did I just hear somebody yawn in the background? I’m sorry ;-). I thought to myself “Hey, GhostDoc is a valid entry according to the rules, it has a working setup, nice documentation and people like it, why not give it a try. Version 1.9.5 is almost finished, entering the contest shouldn’t be much effort”.

    Ok, forget about the “not much effort” part. The organizers wanted the projects as source code, to compile the projects and pass the result to the judges –  I guess to be able sort out at least some of the more obvious trojans that jokesters would send in. Releases of GhostDoc are built using a combination of a commercial tool (Visual Build) and a couple of custom-built tools and I couldn’t/didn’t want to give out my complete build environment, template-based documentation generation, CHM-builder, etc.. So most of the work consisted of building a package that could be copied on a fresh machine and would successfully build the MSI. Sounds easy, but it’s the small details that cost way too much time.

    Please don’t get me wrong, I’m not complaining; my colleague Jens Schaller wrote an add-in (SonicFileFinder) specifically for the contest from scratch and he definitely pulled some all-nighters and others have invested a lot of time as well.

    Anyway, when I was notified I didn’t win I wasn’t too disappointed – I was happy that I received an USB stick for participating and left the contest behind me.

    But of course I wanted to know which cool add-ins won, so I visited the website from time to time. Yesterday I saw the winners were announced. The projects of the participants that didn’t win (including me) were listed on the site as well, but without a description, just with a download link. Interested in the other add-ins I wrote a mail to the organizers suggesting to add description texts as I didn’t feel like downloading all add-ins just to find out what they are doing. And out of curiosity I asked what had happened to the third place in the add-in category, suspecting some sort of mixup during the authoring of the page.

    Well, some time later I received a mail telling me that one of the first three contestants was “no longer eligible” and that the next of the runner-ups moved up on third place – and that was me! Wow, what a surprise… An hour later the website was updated, with GhostDoc now on third place. Unfortunately the list of the runner-ups are still without description texts, but I guess that’s coming later.

     

  • GhostDoc meets Google Code Search

    Even though it has been fixed in version 1.3.0, the infamous "Toes the string" comment generated by GhostDoc remains a running gag among long-time users. So let's use Google Code Search to see if there's somebody out there who has used (an early version of) GhostDoc to create comments without even bothering to give them a quick look: Search Now*

    ______________________
    *) Note that this is a live search; at the time of this writing there were indeed three results, but this may of course change in the future.