mike hodnick

Point your browser to www.hodnick.com for Mike's latest content.

Notice:

You are viewing Mike's old, archived site. For new content, navigate to hodnick.com

Latest From Twitter...

The Blog

Code

I've been working on a fluent interface API for producing synthesized audio in Silverlight. Keith Dahlby originally suggested this idea to me, and as I've been testing my own complex signal chains in code I decided it was time to implement the idea. Setting up signal chains using a more conventional syntax was just getting too tedious. I've been using Charles Petzold's Simple Sequencer as a base and have tweaked and modified the code to include support for frequency modulation, amplitude modulation, and panning. To set up a simple signal chain with a mixer, here is what the...

I’ve been seeing many variants these days in high-level architecture diagrams concerning where Silverlight apps are placed.  Often they look something like this: Now, this is just a picture.  As they say in football, you can look at lineups and stats all you want, but football isn’t played on paper, it’s played on the field (or as I believe Don Cherry said of hockey, it’s not played on paper – it’s played on television sets [1]).  Similarly, the picture above is just a picture.  Anyone writing a Silverlight app knows that it does not execute on...

I just completed work on another Silverlight audio project that I’ve named kSynth.b.  A short while back I released kSynth.  kSynth.b isn’t really a new version of kSynth – it’s just something a little different. Click here to try out kSynth.b Click here to read the help page Here is a screen shot: Some of the unique features of the app include: Polyphony (you can play more than one note at the same time) A drum sequencer that plays wave file drum samples.  Four...

I’ve been working on some new ideas for another Silverlight-based audio synthesizer and sequencer.  I’ve been able to achieve some key goals in my latest efforts: Make the sequencer polyphonic (e.g. play more than one note at the same time) Account for multiple notes played at the same time to prevent clipping or distortion – and do this dynamically rather than pre-load or hard-code a fixed possible number of notes that can be played simultaneously. Add the ability to play and sequence wave file samples. ...

Source Code: Sine.zip (12 kb) I haven’t really found a nuts-and-bolts explanation of how to produce (synthesize) sound with Silverlight 3.  Through trial and error and referencing other more complex examples I was able to finally figure it out.  My hope here is to lay things out so that folks can get their hands on the “boilerplate” Silverlight 3 code required to get an audio stream working and how to also assemble the audio stream bytes into something coherent (such as a sine wave). First, let’s talk about the definition of the audio stream.  The audio stream has...

For the past 1-2 weeks I’ve been working on an audio synthesizer in Silverlight 3.  The app is in enough of a stable state that I decided to throw it out into the world. Try it out:  http://kindohm.com/ksynth Source code: http://code.google.com/p/kindohm-ksynth/ kSynth is a synthesizer. I’ve been caught off guard when people ask me where I got the audio for the app.  I have to explain that the app is generating the audio from scratch (thus, a synthesizer). The app generates raw sound waves from sine, saw, square, and triangle wave calculations.  It then...

I introduce to you TANKS - a web-based game built on Silverlight with C# and the Farseer Physics engine: http://www.kindohm.com/tanks Here are a few screen shots: Some highlights and facts of the game: Single player, real-time.  The enemies shoot at you while you shoot at them. You score points by making hits and kills.  You get more points for shooting efficiently and flipping over enemies. You can shoot down powerups and increase your ability to destroy enemies or stay alive.  Powerups stay with you as you progress through the game. The game has...

This week I picked up the Farseer Physics Engine, which Neil showed me a while back.  In my efforts to create an interesting data visualization experience (e.g. Connectable Lines, Radial Network Graph), I've wanted a UI that could "distribute itself" on the screen.  I wanted something that looked natural that could space itself out.  I needed the ability to introduce forces (attraction and repulsion) between UI elements. By picking up Farseer I was able to accomplish what I wanted and created what looks like a "molecule" of UI elements: http://www.kindohm.com/sl/molecules/molecules.htm This may sound a little surprising - but...

Neil mentioned to me that Google just released a charting API. I decided to check it out today and was very impressed - I didn't expect it to be completely URL-based! The tinyurl below converts into a very, very long Url, and it's just too long to paste in here. But if you click on it you'll see all of the text-encoded data that supports the chart data, which generates the chart below. http://tinyurl.com/6z26s7 The data above represents the gas mileage for my Honda Accord over the past few months. But the Google charting API... it can do quite an array...

This is arguably one of the easiest tasks you can perform in code as a SharePoint developer, but not very well known or documented.  Start off by referencing the Microsoft.SharePoint.Publishing assembly.  The rest is cake: // assume we're using the // Microsoft.SharePoint.Publishing.Administration namespace ContentDeploymentJobCollection jobs = ContentDeploymentJob.GetAllJobs(); foreach (Job job in jobs) { Console.WriteLine(job.Name); job.Run(); } The ContentDeploymentJob class also has a GetAllQuickDeployJobs() method to return only Quick Deploy jobs. The ContentDeploymentJob class hosts the expected methods and properties you'd find on a job, such as Name, Description, LastStatus, Run(), and Test() (among others). Technorati Tags: sharepoint code

In my last post about connectable nodes in Silverlight, my code had an annoying problem where if you moved the mouse too quickly the selected shape would fall behind and stop moving.  I corrected this problem by moving the move logic to the containing Page rather than keep it inside the shape user control.  The containing Page is aware of mouse movement outside of each shape, and therefore can control shape movement when the mouse speeds ahead outside of a shape while dragging it around.  New code and example app are available: Source: nodeconnect2.zip Example App: http://www.kindohm.com/sl/nodeconnect/testpage.html Technorati Tags: code silverlight programming

This is strictly just a UI concept at this point, but it's a very simple Silverlight implementation of drawing some shapes on the screen, connecting them with lines, then clicking and dragging the shapes around while maintaining the line connections.  UPDATE 1/6/2009: The demo page and source code have been updated and compiled for Silverlight 2. Source Code: nodeconnect2.zip [12 kb] Example App: http://kindohm.com/sl/NodeConnect/TestPage.html It's hard to explain the highlights with only small code snippets (I don't want to paste the entire source code into this post), but here is a shot at some of the key features... The nodes/shapes were implemented...

Download Source Code: SilverlightRadialGraph.zip [582 KB] Recently I've been looking into some challenges with data visualization - particularly with viewing relationships between a large number of entities.  Social Networking is a classic example.  A great example of how to visualize a large network of "friends" on Facebook is to use the Nexus application (developed by Ivan Kozik): Click to enlarge This is very close to what I know as a "radial graph".  I couldn't find a good definition of a radial graph anywhere, but here is an academic publication that at...

Thanks to everyone who attended my talk on extending the MOSS Search API today.  Slides and code are available here: Slides (PowerPoint 2007) Slides (PowerPoint 2003) Code Technorati Tags: code sharepoint presentation

If you are writing code using the SharePoint migration API (e.g. using the SPExport/SPImport classes, which Stefan Goßner has blogged in detail about), you'll want to be careful about the scope of your exports when exporting custom layout pages in MOSS.  In short, custom layout pages get copied to the wrong folder when performing an export scoped at the site collection level.  Make sure you use an export scoped at the top-level web rather than the site collection in order to get layout pages in their proper place. Let's start with a scenario - let's build a custom content...

For "Publishing" sites In Microsoft Office SharePoint Server, you have the ability to specify a master page that all pages in the web should use: Optionally, you have the ability to inherit the master page of the parent web (if a parent exists): Setting these two values programmatically is easy, but not necessarily intuitive. First, to set the master page, it is as easy as setting the value of an SPWeb object's CustomMasterUrl property to the server-relative path of the master page: SPSite site = new SPSite("http://myserver"); SPWeb web = site.OpenWeb("/some/web/path"); web.CustomMasterUrl =...

Robot tanks trying to kill each other.  Well, at least that's what I'm aspiring toward :) git clone git://github.com/kindohm/kindohm-artillery.git http://github.com/kindohm/kindohm-artillery/tree/master Right now it's super stripped down and simple.  No real UI or interactivity yet.  Just some stationary guns that don't move and some output messages to the console.  The guns fire projectiles at each other in a parabolic arc.  Since the projectile path and firing solution are both predictable, I introduced some randomness so that the first gun to shoot doesn't automatically "win".  Basically my work so far was just to get the trajectories down.  This article was most helpful: http://en.wikipedia.org/wiki/Trajectory. Next...

posted @ Monday, May 12, 2008 4:04 PM | Feedback (0) |

The latest changes/enhancements to my home-grown simulation have been committed.  I've also made the latest source available as its own downloadable zip archive (view the downloads page to download the archive): http://code.google.com/p/kindohm-life/ It's a C# project - you'll need to build the code to run the exe. UPDATE: compiled binaries have now been uploaded (2008.05.07) The changes include: Improved "free will" AI for carnivores and herbivores.  They aren't so rigid in their ways any more.  The old "hunt-at-all-costs-or-die" mentality has been replaced with an algorithm that looks for the nearest food/mate/prey at...

posted @ Tuesday, May 06, 2008 11:44 PM | Feedback (0) |

I've been working on a home-grown AI simulation for the past week or so.  The code is posted here: http://code.google.com/p/kindohm-life/ If I get some free time tonight I'll post some more interesting details about it.  Basically it's an environment with herbivores, carnivores, and plants that carry out their short lives walking, eating, mating, and then dying (usually of starvation - at least up to this point).  The motivation for this?  Just because. What have I learned so far?  A little bit about threading (in the user interface), and that adding one variable to your AI...

posted @ Saturday, April 26, 2008 4:08 PM | Feedback (0) |

Thanks to everyone who attended the MODIG tonight on the MOSS Search API.  Slides and code are posted here: http://tinyurl.com/6y5hc7 Technorati Tags: sharepoint MODIG code MOSS

The schedule for the Spring 2008 Twin Cities Code Camp has been posted: http://www.twincitiescodecamp.com/TCCC/Spring2008/Schedule.aspx I'll be speaking at the end of the day on Extending SharePoint Search with the Search API.  Technorati Tags: sharepoint code

posted @ Wednesday, March 05, 2008 9:16 AM | Feedback (5) |

Version 1.1.0.0 of SharePoint Search Bench has been released: http://www.codeplex.com/SPSearchBench There are a few new features in this release: Full Text query generation tools.  If you're not familiar with the syntax of Full Text search queries, there is a FullTextBuilder class (and some other supporting classes) that can build the queries for you.  Something like this:FullTextBuilder text = FullTextBuilder.Select("Title, Author").Where(Condition.FreeText("dog, cat"));Any number of conditions may be "and'ed" and "or'ed" together. Support for verbose logging with log4net. A CHM help file with API documentation.  The documentation goes a little beyond listing the types and members in the assembly by...

There are lots of questions out on forums and blogs about how to programmatically create an InfoPath form from an InfoPath XSN template, but they all suggest the same thing: use the InfoPath application (or the Forms Server hosting page) to fill out a new, blank form by hand and then save the empty form xml somewhere.  Use the empty xml as a blank placeholder form that you can copy programmatically whenever you want. This approach is valid, but it's a pain in the arse for deploying an InfoPath forms solution on a project.  Imagine you have ten InfoPath forms...

I attended a pre-conference session on Silverlight almost immediately after getting off the plane.  Unfortunately it wasn't a very good session for me.  I'm finding that most Silverlight sessions are about XAML - not the fine details about Silverlight.  This session covered the basics of setting up a Silverlight project in Visual Studio from scratch, which was good.  So far I've only seen Silverlight projects created from project templates.  I like being able to see stuff get set up without any smoke and mirrors and to see the raw code.  But after about 10 minutes of that, it was nothing but creating...

Download SharePoint Search Bench from www.codeplex.com/SPSearchBench SharePoint Search Bench is a WPF application used to run full-text SQL and keyword queries against Microsoft Office SharePoint Server (MOSS) search.   This project is something I've had in the works for a little while.  Extending MOSS search is a common task among SharePoint developers, yet there aren't really any tools available to test, try, or develop queries against MOSS search.  Unlike SQL Server, MOSS doesn't ship with a "Query Analyzer".  On projects where I was extending MOSS search, I found myself writing my own app to write and test queries.  Here...

In the object-oriented world, when I hear the word "sealed" I think of preventing inheritance.  If I create a sealed class named Car, it means that I don't want anyone else to inherit or derive from Car.  In WSS 3.0, you can create new Content Types that derive from a parent Content Type (e.g. a Car Content Type that derives from a parent Vehicle Content Type).  You can also create sealed Content Types.  You can refer to the Content Type Definition Schema and the SPContentType class for details.  So what does it mean to create a sealed Content Type?  Not as much...

Here's the script I use to generate tags for my Subtext posts. It writes the tag HTML to the screen and also copies it to the clipboard for immediate pasting: if ($args.Length -ne 2) { write-host 'Two arguments (site and tag list) expected' write-host 'Example: tags del.icio.us "scripts tags llama"' return } $site = $args[0] $input = $args[1] $delim = ' ' $splits = $input.Split($delim.ToCharArray()) $header = '<p class="tags">tags: ' $footer = '</p>' $format = '<a href="http://' + $site + '/tag/{0}"' $format += ' target="_blank" rel="tag">{0}</a> ' $html = new-object System.Text.StringBuilder [void]$html.Append($header) for ($i = 0; $i -le $splits.Length; $i++) { if ($splits[$i].Length -ge 1) { ...

posted @ Friday, May 25, 2007 10:13 AM | Feedback (0) |

Tonight, at random, I decided to upgrade my site and create a new design for it. It's 12:30 AM and it's done. No it's not. I'm kidding. The latest release of Subtext now supports tagging and identicons. Subtext uses a microformat for tagging, and I actually haven't quite figured out how to best integrate Subtext tagging in my site yet. It just doesn't work as cleanly as I'd like. tags: subtext web kindohm.com tags tagging blog

posted @ Wednesday, May 16, 2007 12:34 AM | Feedback (3) |

Download the source code for this post: Normals3D.zip (100 KB) One of the questions brought up during my WPF 3D talk at the Code Camp this weekend was what happens when you don't use normals in your meshes. The answer is that it depends. When you use a complete, discrete set of points for each flat surface in your mesh, the the effects of not using normals isn't that significant. However, if you are "lazy" and use the fewest amount of points possible for all triangles in your mesh, then the effects of not using normals is more...

Thanks to everyone who attended my talk at the Twin Cities Code Camp. Here is a list of stuff related to the talk that you can download: The PowerPoint slide deck: TCCC-WPF3D-slides.zip (contains both Office 2007 and Office 2003 versions) The demo code: CodeCamp.Wpf3D.zip (1 MB) The "Moving Camera" application: MoveCamera.zip (8MB - includes media files) The Cartography application (USA states map): Cartography3D-v2.zip (500 kb) The Cartography database in SQL backup form: CartographyDB.zip (37 MB) I uploaded the entire Cartography database so that you can actually execute the code against the real data. You...

Creating your own custom field types in Windows SharePoint Service v3 is an awesome thing. Instead of relying on the out-of-the-box types (text, number, Url, etc), you can create your own fields that incorporate whatever logic and data you want. You can derive from the SPField class or a specific type of field (such as SPFieldText, SPFieldNumber, etc). A custom field can have some custom properties. For example, if you have a custom field named Car, you could have a custom property named Color on the Car field. The user could select a color from a...

This app started out as an experiment with animating a PerspectiveCamera in a WPF 3D scene. Basically, I wanted to achieve the effect of "flying" through a model. WPF's 3D animations are just too tempting to me though, and after achieving the camera animation I couldn't help but busy-up the app with rotating videos, a background Edgey track and some extra keyboard commands to have fun with. I haven't done anything useful in a WPF app yet :) Anyway, here's the source code: MoveCamera.zip (8MB). The zip file is big because the media files are included. And here's...

The session list for the upcoming Twin Cities Code Camp has been posted. Your truly is first on the list :) Make sure you go and sign up - it's on April 28th. tags: codecamp code presentation

posted @ Tuesday, April 03, 2007 11:49 AM | Feedback (0) |

I stumbled across a great .Net class library and article posted on codeproject.com: .NET random number generators and distributions. It's a library that allows you to generate random numbers based on well-known statistical distributions: //EXAMPLE //Generate a random number based on a //normal distribution centered //around 50 with a standard deviation of 7... NormalDistribution normal = new NormalDistribution(); normal.Mu = 50; normal.Sigma = 7; double nextValue = normal.NextDouble(); Piece of cake to use, and from what I've seen it performs well. The code author supplies a test/demo app which gives an indication of how well it performs - not to mention demonstrating all of the distributions it can...

posted @ Wednesday, March 21, 2007 8:52 PM | Feedback (1) |

I've updated the WPF 3D Tutorial to work with the latest WPF code in .Net 3.0. The update is long overdue, as the .Net 3.0 bits have been out for some time now. Both the tutorial text and source code are now up to date. This was partially motivated by the fact that I'll be giving a talk on 3D construction in WPF in a few months. My old WPF code needs to be dusted off a bit. tags: wpf 3d code tutorial programming

I recently installed Windows Vista on my new work laptop, and have been having trouble getting Visual Studio 2005 Team Edition with the Team Foundation client to work correctly. Without installing some required service packs and updates, I encountered Package Load Failure errors - or VS 2005 decided to not work at all. Here's a list of steps you need to take to get VS 2005 with the Team Foundation client working on Vista: Install VS 2005 Install VS 2005 SP1: download Install VS 2005 SP1 Update for Vista: download Install the Team Foundation...

The Subtext upgrade to v1.9.2 pretty much went without a hitch. And as for the new skin - now that I've had some time to live with it I'm not sure how happy I am with it. Nikki mentioned that "kindohm.com" isn't very noticeable right away on the home page, and now that's bugging me. I may make a few small changes to account for that. tags: subtext site web blog upgrade

I may be brave and attempt to upgrade my site to the latest version of Subtext. It'll involve an upgrade to ASP .Net 2.0, a database schema change, and some web.config merging. With luck, there'll be little downtime. At worst, I won't get a good chance to fix any major problems until Tuesday if I run into anything I can't solve tonight. The change will also coincide with a new site skin, which is not the same as this new skin that I previewed before. I ended up hating that design :) tags: subtext site web blog upgrade

The next Twin Cities Code Camp is on April 28th, 2007. Visit www.twincitiescodecamp.com for all the details. I'm actually going to present a topic this time: 3D Construction Basics in Windows Presentation Foundation. That's assuming my topic gets approved :) They're still looking for presenters, so if you want to give a talk go ahead and visit the site for information about how to submit a topic. I didn't go to the last one but the event was a success last time and it looked like a lot of fun. tags: codecamp code presentation wpf 3d

When I use a custom configuration section in a .Net app, I usually use an implementation of the Singleton pattern to create a class that accesses my custom configuration data. In other words, there is only one class and one instance of that class in my app that accesses my settings. That way once the settings are loaded into memory they don't need to be loaded again by my app. I usually implement my Singleton settings reader so that it only loads settings once. e.g. if it already loaded the settings then don't load them again: private MyConfigData...

posted @ Friday, January 12, 2007 8:37 AM | Feedback (0) |

I can't sit still every time I think about Pete's post about leaving Microsoft. I don't see anything wrong with the main purpose of going to work to be to bring home a paycheck. If I were to only go to work to do the things I'm most passionate about, then I'd be broke and not be able to afford to do the things I'm most passionate about. I don't know any employers who are looking for a person to experiment with recording equipment, write experimental songs that nobody else wants to listen to, go to hockey games, host LAN...

If you're a developer, you've probably heard of or visited The Daily WTF. It's a site where developers can post really poor code that they've come across for the development community to laugh about. I swear, someone needs to come up with TheDailyClientWTF.com. Here's the scenario: Customer: "Hey Mike, can we have the News list removed from the News and Events page of the website? We only use the Events items and the News list is always empty." Mike: "Sure no problem. I'll remove the list for the next deployment." [Mike deletes the control from the News and Events page and deploys...

posted @ Tuesday, July 25, 2006 2:22 PM | Feedback (0) |

I haven't used Linux since college (1994 - 1998). I attempted getting it running on a spare box at home a few years back but had some issues with the installation. Now I'm at it again and got the Ubuntu distro installed on a Virtual PC on my laptop. I'm not sure why I decided to try out Linux again... sheer morbid curiosity I guess. Part of me is interested in learning the Apache web environment and the related development technologies. But what really hit me aftear installing it was the benefit of open-source applications. From Ubuntu's package manager I was suprised to...

posted @ Friday, July 21, 2006 8:13 AM | Feedback (2) |

Rory recently posted about two software developer types: 1) the kind that takes everything seriously and lacks a sense of humor or fun and 2) the kind that has fun while programming. I think he's right on, but I would say that this applies generally to almost any type of profession. I've seen and worked with musicians, manufacturing engineers, truck drivers, software developers, and retail clerks who all either take their job and lives way too seriously or try to have fun while doing good work. I don't think it only applies to developers. There's also a sub-type of the...

posted @ Friday, July 14, 2006 10:40 AM | Feedback (0) |

This has been a long time in the works, but I now have a significantly improved music library: http://www.kindohm.com/MusicLibrary. My old "library" was basically a bunch of static content. The new library offers: Tags. Yeah, I got trendy and implemented tags. Tracks might be tagged "heavy" or "weird" so you can listen to all my "heavy" and "weird" stuff. Simple track searching. Search by tag or by title. Track and album browsing. Get your mouse on and click click click away. Dynamic playlist generation. After performing a search or while viewing an album, you can download or start playing an m3u...

There's a new release for Subtext out there. This is hardly new news, but wanted to post it because Subtext is cool. I'm glad that they've implemented a provider model for the text editor for writing blog entries. I absolutely hate the FreeRichTextBox control that .Text and Subtext started with. The new version of Subtext ships with a plain text editor, and I'll be all over that once I upgrade.

posted @ Tuesday, June 20, 2006 8:19 AM | Feedback (0) |

Nikki and I launched EnduringBlooms.com last night. It's a site for Nikki's mom, who is a watercolor artist. Right now it's a simple site to showcase some work and provide information about how to buy paintings. She ultimately would like to allow people to buy prints directly from the site, but she wanted to keep it simple to start with. Her work is amazing, and the website doesn't do it justice. In person her paintings are very vivid, and much much larger. We have a few in our house and they are beautiful. The site itself was...

posted @ Thursday, June 15, 2006 10:49 AM | Feedback (0) |

I have too many websites. Some were whipped up to have a little fun with development and to see how much traffic I could generate, others are large apps with lots of data, and others I'm "hosting" for other folks. I can't do much about the stuff I'm hosting for other people, and those sites don't cost me anything anyway. All of the other sites begin to add up over time though. e.g. $30/year for the domain, plus $15/year to host an additional domain with my web host. I'm thinking of dumping three of my domains and their associated sites: Halo2NameGen.com...

posted @ Monday, May 22, 2006 8:25 AM | Feedback (2) |

I whipped up this latest design tonight. I just wasn't enjoying the last dark theme so much. This one brightens things up a bit and also uses the original header image that I used when I started this so-called "blog". Enjoy.

posted @ Friday, May 05, 2006 10:15 PM | Feedback (0) |

Over VPN Get latest operation Taking way too long I'd do anything do be on the office's network right now.