Stripes 1.3 for Windows Phone

I uploaded the latest version of Stripes (1.3) to the Marketplace last night. This version brings a few improvements, including:

Right now, I am constrained by the very limited camera API on all Windows Phone devices. Microsoft has promised regular updates to the platform and I am hopefull that direct camera access will become available in a future release. However, until then, a "live" barcode scanner (one in which the video from the camera is examined until a barcode is found) is impossible. Also, there is no way to modify the camera settings or save them for future use, either. Believe me when I say I am anxiously awaiting an update to this particular API. Are you listening, Microsoft?


Windows Phone 7 Launch

Microsoft officially luanched its new smartphone brand "Windows Phone" today. While I usually don't re-blog / link-blog I do want to mark the occasion and I can't really add much to the following content:

http://www.tested.com/news/windows-phone-7-hardware-revealed-the-rundown/1120/


Slides and Demos from Lincoln Users Group Super Laptop Meeting

I had a great time speaking at the “Super Laptop Meeting” last night. My 20-minute talk was “Best Practices for Custom WF Activities.” I even won the grand prize, so thanks to all of you that voted for me!

If you are interested in the slides and the demo I showed, you can download them by clicking here. If you want to know more about the Lincoln .NET Users Group, you can do so at http://www.lincolndev.net


Dynamic Control Layout With WPF

If you are even a little bit familiar with the Model-View-View Model pattern and its implementation in WPF, you have probably run into the ItemsControl control. Actually, even if you haven’t used MVVM, you may have used it. Somewhat like the Repeater control in ASP.NET, this control allows you to bind to a data source and do something in XAML for each of the items in that data source. In any case, let’s play around with the ItemsControl element in WPF a little bit.

[more]


Selecting Multiple Rows as a Single Column in SQL

Recently, I was writing a report that selected some data out of a normalized SQL Server database. For one of the queries, I needed a “flattened” form of the rows in one of the tables. In essence, what I needed to do was turn several rows of data into a single column.

[more]


Using LINQ To Find Duplicates

I recently ran into a situation that has come up plenty of times for plenty of people. I had an array of integers and I needed to figure out if any of the numbers were in the array more than once.

A variety of solutions ran through my head: sorting, looping, searching, etc. However, LINQ seemed like the most elegant solution. Here’s what I finally settled on:


A Web Server In Less Than 100 Lines of Code

Last night at the Lincoln .NET User’s Group, we had our second laptop meeting. A few people brought some code, a dev tip, or a fully working program to demo. I choose to show my "100 Line Web Server" I created to perform some unit testing on an app that was HTTP-centric, lately.

So, here is the entire program. I hope it’s useful to some and at least interesting to most.


Using Command-line Parameters In WPF

If you need to read command-line parameters within your WPF application, your first inclination (if you are like me) might be to go looking for the Main method. Of course, you won't find a "Main" method in a WPF application. Instead, start looking at the App.xaml file.

By the way, for the rest of this post, I'll presume you will be using command line switches like the following:


Save WPF Ink Strokes To a Database

In my previous post about creating a bitmap from an InkCanvas in WPF, I mentioned that you could easily save the ink strokes for later. I wanted to post a code example for writing those strokes to a database and de-serialized them back into memory.

The first step in saving to a database is to get an array of bytes from the strokes in the InkCanvas. To do this, the StrokeCollection provides a convenient Save method:


Consuming JSON Services Without AJAX

JavaScript Object Notation (JSON) is one of the technologies used by AJAX and other "Web 2.0" technologies. It is a way to communicate in an object-oriented fashion between the web server and a client-side, JavaScript-based application. Every now and again, you might find yourself in a situation where you would need to consume a JSON service, but without a JavaScript endpoint. I ran into this situation when I needed to talk to an application that exposed a web interface, but has no other API hook. My mind first jumped to "screen scraping" the web pages in the exposed web interface. However, when I started to dive into the HTML, I found a very rich JSON service behind those pages.

An example message that I saw coming back from the application looked like this: