Arian Kulp's Blog
opinion, insight, and occasional code

Very cool news

I got an email yesterday from Microsoft letting me know that I’ve been awarded MVP status for Visual C#!  I was nominated, but honestly I didn’t hold out much hope that I would get it.  There are many people much more active in the community than I am.  I’ve done some fun things, but not enough to expect this.  So I’m very happy!  There are some cool perks, but the best part is being a part of the greater MVP community.  These are people who have done some very great things and to be part of that group is the greatest honor.

Got any ideas?

From time to time I get emails from people looking for ideas for projects.  Often they are from students needing a project, but other times it’s just someone looking to try their hand at coding and want something to start with.  Sorry to say this, but good ideas don’t just grow on trees!  You wouldn’t email Stephen King and ask for a story idea would you?  Obviously it’s not exactly the same, but coming up with ideas is a big deal.

Most great projects don’t come out of someone sitting around brainstorming about something to write!  There’s a need to fill, so someone with the right skill set, creativity, and time digs in and loses much sleep implementing it.  In the end, the project is judged based on the usefulness of the idea, and obviously the skill of the implementation.

I see the problem though.  When a professor gives you an assignment to create something original, it’s a pretty tall order.  What hasn’t been done yet?  It seems like there is little room for innovation in the field of software.  On the other hand, though you may not be able to come up with a truly original concept, it’s the implementation where you can shine.  If you can come up with a fully functional word processor in 50kB, you’ll probably get an A!  Innovation these days comes from two areas: new approaches to existing ideas, and hybrid presentation (mashups).  Facebook was just taking a student directory and putting it online.  Original?  Not really, but it broke the mold for a web application.  Mashups are seen everywhere now.  Viewing a map of a business used to mean a static image on a web site or a link to MapQuest.  Nowadays, you can embed Virtual Earth or Google Maps right in the page, even showing store locations and photos without writing much custom code of your own.  It’s not really new, but combining these things together was revolutionary!

The best way to come up with ideas is to always be looking for them.  If you are really serious about computers, you probably spend a lot of time in front of them.  What bugs you?  What could be done better?  What’s in your room/dorm that isn’t represented on the computer?  Take notes of these annoyances and brainstorms, so when you get that assignment you already have a few things to try.  If you don’t have any ideas, you could spend half of your allotted time to coming up with the idea.  That’s time wasted that you could be programming!

While I won’t leave you with any actionable ideas, here are some places to look that might inspire someone:

  • Converting a real-world game to a computer game
  • A fun idea for a screensaver
  • Using web services to interact with some shopping sites
  • Cataloging a collection of some items (bonus points for using shopping site API’s)
  • Using open-source imaging libraries and being creative with a webcam/scanner
  • Analyzing files and generating some kind of report(s)

Another fertile area is plugins:

  • Windows Live Writer (lots of things here!)
  • Vista Sidebar
  • Firefox
  • An uploader for Google’s Picasa
  • Wordpress (blogging engine)
  • Microsoft Office (somewhat advanced)

Good luck!

New gadgets!

I'm always into gadgets and just thought I'd share two new things I picked up recently.  I nabbed a mini-USB Bluetooth adapter from eBay for around $12 and it is just the coolest (like this one)!  It fits into the slot and only sticks out a half-inch or so.  Unfortunately, my stupid laptop (I hate it, I hate it) is very flaky with USB and keeps thinking that USB devices are being removed and re-inserted, but this device's size helps since it gets bumped less.

The other device that I'm loving is my new PC Card smart card reader that was about $15 on eBay (cheaper version of this one).  I had a full-size USB reader before with a several foot cord.  This one completely hides in the card slot, and when my smart card is inserted it only comes out about two inches.  Without the card I don't even see it.

IMG_9674 IMG_9677

The best part with both devices is that I don't need to remove them when I throw the laptop into its bag for a trip.  I don't need to carry devices around and insert/remove them all the time.  I'm so likely to forget things, so this is a great improvement for me!

Restarting WPF Applications

How can this be so difficult?  In Windows Forms applications, you just call Application.Restart() and your app goes away and restarts.  What could be easier!  In WPF, not only is the Restart method removed from the Application object, apparently the feature is just completely unsupported.  Forum responses from Microsoft suggest disassembling the BCL code to see how the Application implements it, but the poster points out that it's non-trivial, and even at that it's not correct.  Not that I ever noticed before, but the command line arguments don't get passed into the restarted process.  How wild is that!  Another message suggests creating a second application.  Call Process.Start() on it, exit, and the second application would then restart the first.  That's certainly a pretty simple solution, but it seems kludgey to me.  Considering WPF applications still support ClickOnce, who made the decision to pull Restart, and why?  Inquiring minds want to know...

Sources:

A $30 million driving simulator in Iowa?!?

Before the end of the school year (a few weeks ago already!) I took the kids from my Robotics Club to the National Advanced Driving Simulator in Coralville, Iowa.  This is a pretty amazing place with the coolest driving game you'll ever see!  We went through the control room and there were eight monitors displaying the various views around the vehicle.  The vehicle itself is an actual car body inside of a half-dome with six projectors creating a seamless view around the car.  Speakers, cameras, and instruments are everywhere to create a perfect simulation and capture every element of the driver's performance.  They test the effects of alcohol, sleep deprivation, cell phone usage, people in the back seat, various ages of drivers, road conditions, and other things to see what happens -- but without any risk.  Unfortunately they wouldn't let us actually sit in the car for a simulation, but we were able to enter the dome and look around.  Very cool!

It was fascinating for me to see their software and hardware setup.  The dome is actually sitting on a two-dimensional track to allow it motion and inertia for road handling and accident sensations.  The dome can tilt in various ways to create the last part of the motion.  Each vehicle that they simulate (we saw three car bodies and a John Deere tractor!) is painstakingly recreated with a physics model captured from the real vehicle.  They know every aspect of its handling so they know that they are getting good feedback info.

IMG_9632

The computer room was full of servers for the actual simulation, in addition to data capture and analysis systems.  Everything was built in-house and certainly looked to rival any game out there.  All computer hardware was commodity with rough-looking Java UI's for admin needs.  I can only imagine the gigabytes of data that they need to process after a simulation!

I have a feeling that playing Test Drive or Need For Speed in a multi-projector dome setup like that would feel amazing too.  Being totally immersed in any simulator is probably more important than the actual quality of the simulation itself.  If the simulation is too laggy you can get sick, but even a blocky world, if smooth and responsive, will feel like your reality with sufficient immersion.  I'm going to be watching the papers now to see when they put out their next call for volunteers.  I'll get a ride in that eventually!

More Info: http://www.nads-sc.uiowa.edu/

June 2008 CTP - Parallel Extensions to the .NET FX

Dividing up work to run in separate threads can be really challenging.  Proper division of labor, synchronization, scheduling, and all that is just a tough job.  I've gotten pretty well-versed in Windows concurrency using the standard Windows.Threading classes (many of them wrapping the Win32 entities).  Understanding semaphores, mutexes, locks, wait queues and other related concepts takes some real work and head stretching.  Once you understand them though, you may still struggle with actually fitting them into your code properly.  In many cases, you just need to run some code in parallel with your UI.  Much of this doesn't even apply then.  A BackgroundWorker object will serve your needs just fine in many cases.  On the other hand, if you are batch processing and want to divide up a large quantity of work items to multiple threads (especially when the work is network-bound rather than CPU-bound), it's easy to make a fatal mistake that will overwhelm your system resources, lock up your application, or worse still -- corrupt data.  I worked with the Intel Threading Tools some time ago and really liked the idea.  I also played with OpenMP a bit and I could really see the advantage.  Both are libraries that make it substantially easier to divide up work for concurrency by "marking up" your standard serial code in various ways.  Unfortunately, these are not managed code tools.

Microsoft just released the second CTP of Parallel Extensions to the .NET Framework.  This supports task parallelization, data parallelization (using LINQ), and shared state coordination facilities.  I haven't actually written any code with it yet, but it looks very promising.  Microsoft has been starting to push the idea of parallel code, and I've blogged about it in the past.  Even large-scale commercial projects don't do enough to execute tasks in parallel.  I shouldn't have to wait for my media player while it's indexing.  I shouldn't need to wait for my photo software to tag images.  Apps shouldn't lock up while synchronizing with a server.  Even if I'm locked out of making changes, the application itself should never freeze, and I should always be in control.  Writing for concurrency from the start solves this problem. Hopefully these extensions, once mature, will make it easier for people to bake in parallel processing from the start.

More info: http://msdn.microsoft.com/en-us/concurrency/default.aspx

Source: http://blogs.msdn.com/somasegar/archive/2008/06/02/june-2008-ctp-parallel-extensions-to-the-net-fx.aspx

AJAX Widgets

Looking to add some AJAX goodness to your site?  I came across some great widgets on AjaxDaddy.com.  There are calendars, editable text boxes, fish eye effects (a la Mac OS X), chat boxes, sortable tables, slideshow tools, and more.  All free, all with demos and code examples right there on the site.  Much of it's really DHTML rather than AJAX since it's all client-side, but it's really useful stuff.  It seems to be largely based on jQuery, which is a lightweight library that takes much of the pain out of Javascript.  Before you start digging into the script yourself, it's worth a check to see if what you need is already out there.  This is a good place to start.

More info: http://www.ajaxdaddy.com/

Forms without code

Well, this is definitely what I'm talking about when I talk about programming losing some of its mystique and non-techies being able to whip up their own applications.  In this case, it's for web apps.  We have so many sites making widgets to embed that someone with zero coding experience and minimal, if any, HTML experience can make a very cool web site.  One thing that gets in my way at times, though, is the overhead for crafting a simple form for a site.  I don't want to create a database table, forms, validation, and data access code for a simple, often throwaway, list entry.

There are a few sites out that offer DIY lists (like http://www.formdiy.com), but I tend to shy away from them.  Even a very cool site with a very cool product doesn't cause me to jump right away since I've been burned too many times by flash-in-the-pan sites.  I don't want a site to disappear all of a sudden when I'm relying on it for some functionality.  Especially a free site where they really don't have an obligation to keep serving me or even to notify me.

Google Docs now supports embedding forms to insert data into a spreadsheet.  On the surface, what an easy concept.  Similar to features of Excel Services, but available for free to anyone.  Unlike other free sites, I'm not too worried about Google disappearing tomorrow (though anything can happen...).  Of course Google could abandon just the feature at some point, but at least I'm more confident that it won't be going anywhere soon.

Having an API would be great for developers to create better user interfaces (including getting rid of the "Powered by Google Docs" and the silly confirmation message (I don't want people to know the data is in a spreadsheet now!).  On the other hand, having an API would defeat the purpose here.  If I'm going to code, I'll probably do it myself.  Having a spreadsheet back-end is no substitute for a custom SharePoint list or database.  This is for quick-and-dirty data capture for me, or for a non-technical person to create a data-capture form that they never thought was possible before.

As more of these types of products/features/widgets appear, the landscape will change and change until at some point programmers are creating only the most esoteric, system-level stuff (and of course the embeddable widgets themselves), and most users don't even think twice about creating a new composite application from what's out there.  What a new face we'll have on software!

More info: http://documents.google.com/support/spreadsheets/bin/answer.py?answer=87809