Blog

  • Programmer Productivity

    It’s been almost 4 years since I last programmed professionally with C++. C++ was my language of choice from 1994 through the end of 2000. It is a language that, once upon a time, I knew REALLY well. How well? I could read template errors and code the fix based on the build output—if you are a .NET developer, that’s kind of hard to do. Since then, I’ve done a lot of development with three languages: VB.NET, C#, and F#. Most recently, I was doing my hobbyist development in F#. I was impressed by the incremental boost in development productivity in F# over C#. The productivity boost at first was just noticeable and has recently become something where I can express F# algorithms in significantly less time that the C# equivalent. Since mid November 2009, I started using C++ because a hobby project I wanted to work on required it. ...

    Comments0

    Full story

  • Speaking Calendar: January 26-February 25

    I’m going to be assisting the Microsoft office by doing some presentations of the PDC Roadshow. January 26, 6 PM: Rockford .NET Users Group February 3rd, 6 PM: Madison .NET Users Group February 25, 6:30 PM: Lake County .NET Users Group   If you have a user group in the Wisconsin/Illinois/Indiana area and want to see this content, let me know. I can either come out to your group or help find a presenter who can deliver the content.

    Comments0

    Full story

  • Incorporating Video into a Silverlight 4 Application

    html, body { height: 100%; overflow: auto; } body { padding: 0; margin: 0; } #silverlightcontrolhost { height: 100%; text-align:center; } Over the past week, I spent some time with Silverlight 4. I’m really impressed by how easy it is to incorporate video into an application. This post shows how to capture video from the camera and display the video on the screen. The post also handles grabbing single frames of video. You might use this type of arrangement to allow users to upload images, hold impromptu web casts, and to do video conferencing. I’ve uploaded a barebones application that turns on video capture and displays the video:   To understand how this works, you need to be familiar with the following objects: CaptureSource CaptureDeviceConfiguration VideoBrush The CaptureSource type encapsulates the methods needed to interact with audio and video devices. CaptureDeviceConfiguration acts as gatekeeper to the webcam and microphone. ...

    Comments1

    Full story

  • F# is Changing My Style

    Tonight, I was writing some code that made use of transactional WCF bindings. I wanted to do some experimentation with all the bindings available to see which ones support flowing transactions. The pre-built bindings that do this will create a TransactionFlowBindingElement when you ask them to call CreateBindingElements(). The types I’m interested are concrete (no abstract methods) and have a zero-argument constructor. A few years ago, I would have done a bunch of looping constructs to look at each element. However, I’ve been doing a lot more work with F#. While doing this experiment in C# for a project, I wound up writing the following instead:   static void Main(string[] args) { var bindings = from bindingType in typeof (MessageContractAttribute). Assembly.GetTypes() where typeof (Binding).IsAssignableFrom(bindingType) && !bindingType.IsAbstract && (from constructorInfo in bindingType.GetConstructors() where constructorInfo.GetParameters().Length == 0 select constructorInfo).Count() > 0 select bindingType; var ...

    Comments3

    Full story

  • The Sieve of Eratosthenes and F#

    There is a problem on the Euler project, www.projecteuler.net, which asks to find the sum of all values under a given number. Problems on the Euler project have a range of solutions, where at least one solution has a runtime of under 1 minute. A popular, time efficient algorithm that finds all primes in a given range is the Sieve of Eratosthenes. The basic algorithm is: Create an array that contains all values from 2 up to the final maximum value Starting at 2, For each value in the array, mark all items that have indices of the current value that are multiples and NOT equivalent to the current index as 0 (eg. index mod [current value] == 0). March forward until you hit a non-zero value in the array, then mark all multiples as 0. Halt condition: stop when you cross the midpoint of the ...

    Comments0

    Full story

  • Greatest Prime Factor in F#

    Today I was reading an article in The Onion, Conquerors You May Have Missed,  and noticed that the number for the ant looked like it might be a big old prime, or at least have a large prime divisor. (For reference, the ant is # 43,168,974,563,247.) There are a number of algorithms for finding this answer, but my favorite is a little brute force algorithm that keeps dividing the big number by some other value until the two numbers are equal. Yes, I know I can short circuit a bunch of testing via a square root function, but BigInteger doesn’t have a sqrt function (yet…). Anyhow, I cobbled this together and it worked right out of the gate: let rec largestFactor x y = if (x = y) then y else let z = x % y if z = 0I then largestFactor (x/y) y else largestFactor x ...

    Comments0

    Full story

  • Moved hosts, so my blog is back

    I was unusually quiet over the last couple of weeks. Why? My former host apparently packed too many sites on one machine and caused this page to experience OutOfMemoryExceptions galore. I run a number of sites for various purposes and decided it was time to move up to a VM host. I’m currently on MaximumASP and am using a MaxV server. Setup was pretty simple, support was helpful for a few of my questions, and I’m happy to have my blog engine up and running again.

    Comments0

    Full story

  • Slides and Code from Chicago Alt.NET meeting

    I want to say thanks to everyone who came out to watch me speak about OpenSocial at the Chicago Alt.NET meeting. Thanks for inviting me to present and for making the time so enjoyable. I’ve posted the slides and the code for the Canvas page here.

    Comments0

    Full story

  • Speaking at Chicago Alt.Net Meeting

    This month, I’ll be speaking at the Chicago Alt.Net user group meeting. Please check out the details here and register here. And, here is the blurb on the talk: November 2009 Meeting Building OpenSocial Applications 6:00 pm Pizza and networking time 6:30 pm From its official web site: Friends are fun, but they're only on some websites. OpenSocial helps these sites share their social data with the web. Applications that use the OpenSocial APIs can be embedded within a social network itself, or access a site's social data from anywhere on the web. OpenSocial is the platform that MySpace, Orkut, Ning, LinkedIn, Hi5, and pretty much every social network but Facebook supports for creating games and other applications that run on these social network sites. In this talk, we focus on the MySpace platform and how one builds a MySpace application. This involves ...

    Comments0

    Full story

  • Iowa Code Camp November 2009 Slides Up

    I want to send out a big thank you to the team who put together the Iowa Code Camp. You people did an awesome job!!! I had a great time giving my talks and really enjoyed hanging out with the crowd in Iowa. For those of you who attended my talks, or just want to see the materials, I’ve posted things. WCF Diagnostics Talk and Materials WinDBG Talk and Materials See you next year…

    Comments0

    Full story

  • Speaking at nPlus1 ArcSummit- Chicago

    On December 7, I’ll be speaking at the nPlus1 ArcSummit for the optional morning session. I’d love to see the place packed! Here are the details: https://www.clicktoattend.com/invitation.aspx?code=142763 About nPlus1.org nPlus1.org is a site dedicated to helping Architects, aspiring Architects and Lead Developers learn, connect and contribute. On this site you’ll have access to great first party content written by some of the most skilled and experienced Architects working today. You’ll also have access to, and be able to contribute to a nexus of content from around the Internet aimed at keeping Architects up to date on all the new developments in their fields of interest. When Monday December 7, 2009 – 10:00PM to 5:00PM Where Microsoft MTC - Aon Center 200 E. Randolph Suite 200 Chicago, IL 60601 driving directions Free Lunch Provided Agenda Morning Session (Optional): An Introduction to Object Oriented Programming 10:00 AM - 12:00 PM Are you ...

    Comments0

    Full story

  • Lambdas aren’t just for managed code

    A long time ago, I was a C++ developer. I actually thought of myself as a pretty darn good C++ developer and got way too excited when I finally got to meet folks like Scott Meyers and actually landed a job working with Bobby Schmidt—same team on MSDN. (If you know Bobby’s name, well, you were pretty deep into C++ circa 1999.) Then, like many C++ devs, I moved over to a garbage collected language. I’ve done more than my fair share of professional .NET and Java development. C++ has been left by the wayside. Today, I finally downloaded and installed Visual Studio 2010 Beta 2. I dug into the “What’s New” and, out of curiosity, decided to look at C++ first (I already know about many of the C# and VB changes). I saw two cool things: 1. C++ now has an auto keyword. For you C# devs, it ...

    Comments0

    Full story

  • New F#/WCF Article up at InformIT

    My article on programming REST services with F# and WCF went up at InformIT. Please go read it! http://www.informit.com/articles/article.aspx?p=1394625

    Comments0

    Full story

  • Quiet lately

    Things have been quiet around here lately because of a large volume of stuff I’ve been handling elsewhere. I recently was forwarded a nice review of the REST book. Feel free to take a gander and see if this pushes you to buy the book!

    Comments0

    Full story

  • Tethering Samsung BlackJack II (SGH-i617) on Windows 7, x64

    I recently upgraded my laptop to Windows 7 x64 RTM bits. I also tether my BlackJack II (aka Samsung SGH-i617) to the laptop so I can get work done pretty much anywhere. To help others who will be going through the same thing, here is how to make this work until AT&T or Samsung come out with a proper setup for Windows 7. I suspect that these instructions also work for x86 (32-bit) Windows 7, but I haven’t tried it out and no one has confirmed yet. Step 1: Download and install the Communicaton Manager Software for XP/Vista. They only have a 32-bit version. Step 2: The newly created desktop icon for the at&t Communincation Manager has now appeared. Right click on the icon and select Properties. Select the Compatibility tab and, under Compatibility Mode, check Run this program in compatibility mode for: and select Windows XP ...

    Comments1

    Full story

  • Solution for Daily WTF Praxis on 8-5-2009

    Over at The Daily WTF, they’ve started posting programming puzzles. The latest one is a puzzle where a set of locker doors are toggled, starting from the closed state, to the open state. Starting at a step size of 1 and stopping at a step size equal to the number of lockers, one toggles each door. At a step size of 1, all doors are opened, step size of 2, all the even doors are closed. At a step size of 3, door 3 is closed, door 6 opened, and so on. Many of the solutions observe that only perfect squares remain opened when the algorithm is complete. That option is easy, but I wanted to do one that mimics the jocks effort of brute force solving the problem.   // Init the lockers to the initial state // and mark all doors as closed (false) let sw = ...

    Comments0

    Full story

  • Calling an STA COM Object from a WCF Operation

    One of the things that many people are still doing is making use of old COM objects that run in STA (single threaded apartment) threads. Back in October, 2006, Jeff Prosise wrote how to do this from ASMX. Not too long after that, I had a chance to teach for Wintellect and Jeff asked me to show him how to do the same in WCF. That information went up on a post for a consulting company that didn’t make it through the latest recession. For better or worse, that post was referenced a fair number of times and now, folks are writing to me, asking for the code again. In general, any time you receive a message via WCF, the message itself will be processed on a MTA (multi-threaded apartment) thread. Normally, this is just fine. Sometimes, you might be calling out to a COM object. COM objects will ...

    Comments1

    Full story

  • Slides and Presentation from CNUG, July 15 meeting

    The slides and code have been posted for both the back to basics and the REST Server side talk. Click here to get them. I’d like to thank everyone for showing up. I’ll be presenting the same talk again for the Rockford .NET Users Group. You can register for the talk here.

    Comments2

    Full story

  • Article on using Google AppEngine + Silverlight

    I wrote an article on how to integrate Google AppEngine with Silverlight. If you understand how to use REST, this integration is really easy. http://www.informit.com/articles/article.aspx?p=1354698 has the full article!

    Comments0

    Full story

  • Speaking at the Madison .NET User Group

    The Madison, WI .NET User group has asked me to speak at their July 8 meeting. I’ll be talking about the technologies that .NET makes available for writing RESTful .NET Services: ASP.NET/IIS MVC WCF ADO.NET Data Services I’ll be skipping the Azure/Cloud specific choices since I only have an hour to cover things. My feeling is that the audience will be hosting all of their own services for the time being, so the above 4 items will be the most interesting to them. If you are interested in seeing the talk, please sign up here. I hope to see a few of you out there.

    Comments0

    Full story

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. »