latest tweets:

Jump to content.

More on Roomie’s website rewrite

December 11th, 2011

As stated in my previous post about Roomie, I’ve been using a lot of brain juice to rewrite Roomie’s website.  I wrote the original website in ASP.NET with Web Forms, which was pretty standard for the time.  Although technology like ASP.NET MVC and the Entity Framework existed in some form, they weren’t even on my radar.  So after some coding and hacking and pushing through unfamiliar problems, I eventually got a workable website.  (This website, though not the final version, is pictured in this post.)

After merging all of Roomie’s desktop and web components into one self-aware Visual Studio solution, learning a ton of new technology, and a little trial and error, I now have the Roomie desktop client talking directly to the new website.  Best of all, I can locally debug everything which means that I can get quicker feedback on code changes and (shrug?) even develop offline.  Below I have a simple example pictured.  A more impressive example is when I tell the Roomie desktop client to say something using text-to-speech, but obviously that would not convey over a screenshot.

Roomie MVC3 Tasks working

(Read on …)

Hey! Roomie is still here.

November 22nd, 2011

Woooh!  I have not blogged about Roomie in a looong time!  Just like I came to a dead-end with Roomie’s desktop client component and re-wrote it, I came to a dead-end with Roomie’s web component.  I started out using ASP.NET, C#, and Web Forms.  Web Forms made it really easy for me to do web development using my experience programming desktop applications with WinForms.  Last year I reached the limits of what WinForms would offer, and I needed something more powerful.  I discovered ASP.NET MVC, which was totally new and strange and awesome.  But woes, the darn thing updates all the time!  That’s great, except that I was learning MVC2 while MVC3 was in development.

Needless to say, I was daunted by the huge task of migrating the whole Roomie website over from an old technology.  I also wanted to take the opportunity to learn more about CSS, and JavaScript, jQuery, AJAX, LINQ, the .NET Entity Framework, and anything else that I didn’t know I needed to know.  All of that is still in progress, but I am not to the point where I have started a new website, though it is not live yet.

Pretty!
Roomie MVC3

(Read on …)

Use C#’s regular expression library to Convert TimeSpan and DateTime to and from strings. (Named capturing groups!)

December 20th, 2010

Well that title is a mouthful.  Long story short, as an exercise in regular expressions I wrote a utility class to convert strings to TimeSpans and DateTimes in C#.  This made great usage of named capturing groups.  (The download to the source code is at the bottom of this post.)

Here is the DateTime regular expression.  Note that when I new the regular expression object, I set whitespace and casing ignoring.
image

Named capturing groups allows code like this:
image

In the end, the utility class allows code like this:
image

fun!  Download all of the code here.

Have any suggestions about the code?  Any neat C# features I should have used?  Comment below!

Another novel (and silly) use for Roomie

October 11th, 2010

I’ve been working (rather obsessively) on Roomie for the past week.  In specific, I have rewritten the XML-based protocol that allows the desktop client to communicate with the web service.  (Say “hi” to it here.)  The new library (which I call WebCommunicator) is sooo much easier to use than my old one, but still has all the nifty (and important) encryption and anti-hacking features.  I will eventually publish the protocol as an independent library.  (Give me a bit to use it more and work out all the kinks.)

But enough technical talk.  Lets get to serious business.  Here I have a little RoomieScript that I wrote, just as a proof of concept.

<RoomieScript>
  <ZWave.PowerOff DeviceName="Coffee Pot" />
  <Core.Loop>
    <ZWave.WaitForChange DeviceName="Coffee Pot" PollInterval="5 Seconds" />
    <ZWave.PowerOff DeviceName="Coffee Pot" />
    <RoomieBot.TextDavid Text="No coffee!" />
  </Core.Loop>
</RoomieScript>

(Read on …)

Simple Multithreading example in .NET and WPF

March 28th, 2010

After lots of googling, trying to figure out how to multithread properly in .NET and modify a WPF GUI from another thread, I’ve finally figured a lot of stuff out.  I have created a simple multithreading example project in Visual C# 2008 Express.

WPF Multithreading demo app

You can download the project here, but since I know most people just want to get some quick answers, here’s a few code snippets:

(Read on …)

Next Page »