I gave a presentation on data visualization at Ignite Salt Lake last night, and I thought it went pretty well. (I wasn’t hiding my face and sneaking out of the theater afterward.)
Slide 13 (Location Visualization Example): Map of flights in the US in a 24 hour period. This actually uses color to indicate altitude (darker is higher, lighter is lower, but I didn’t have time to go into that in my talk.
Amazon Web Services Data Sets – Including the human genome, DNA sequences, chemical databases, census information, DOT databases on transportation (aviation, highway, bike, maritime, etc)
New York Times developer site: the NYT has easy APIs for articles, best sellers, campaign finance, user comments, congress, movie reviews, and the New York State Legislature
Yahoo Developer Network – APIs for finance, traffic, weather, Flickr, Del.icio.us, and many others
I will have no time to write real blog posts (I’m actually writing this during Robby Ingebretsen’s fantastic session: “Design Fundamentals for Developers”), but I will be updating on Twitter like a maniac. You can see my twitter feed here.
I’ll try to tweet something from every session I attend.
I’ve been meaning to totally overhaul my Wiimote WPF visualizer for weeks now and I simply haven’t been able to find the time. But in the meantime, people keep having problems with my old version.
So… my solution is to get my semi-updated version out there. This version works with the latest version of Brian Peek’s Wiimote Library (as of March 10, 2009).
Warning: This project WILL break if you try to use the Wii Fit balance board with it. That’s one of the things I’m trying to fix.
Let me know if you have any problems. I will try to address them, but with MIX coming up in a week, it might be a little while. In the meantime, I’m trying to do a complete revamp of all this stuff.
When are we going to get rid of Daylight Savings Time? It makes no sense at all.
Besides, then I’ll be able to sound like Grandpa Simpson when I’m older. “When I was your age, we had these great American traditions. We changed the time around just cause we wanted to and we put people with no dramatic experience on TV and called it ‘reality’. Oh, yeah, and we had TV… it was like a computer except you couldn’t really do anything except choose between the four things that were on at that exact moment. And the world didn’t revolve around you… if you missed the beginning of the show, tough beans!”
I was working on a project recently and I wanted one of my layout controls to have a different margin based on a certain piece of data.
(It’s a long story… let’s just say that this is a good post if you want to change properties of a control based on a piece of data of a different type.)
So… for the sake of the argument, let’s say that I want my control to have a margin of “4,4,4,4″ if my data returns “dog” and I want it to have a margin of “2,2,2,2″ if my data returns “cat” and a margin of “0,0,0,0″ if the data is anything else.
Normally, I would use a value converter for this. My problem was that I was sick of using value converters for things so specific and using them only a couple times in my application. So I decided I wanted to do this one with styles and triggers.
First thing I did was bind my data to the “Tag” field.
Then, I created a style for my Border layout control. If you’re in Blend, go to Object –> Edit Style –> Create Empty…
Create a new property trigger by clicking on the “+ Property” button and change the property to “Tag”.
I couldn’t find a way to type “dog” into the field value, so I did it in the XAML (full XAML sample below, for those of you who want to cut to the chase… you know who you are).
With the property trigger highlighted, you’ll see a “Trigger recording is on” sign in the corner of your canvas.
Just change all the properties you want. Of course, in this case, I’m just going to change the Margin property. If we do the same thing for the “Cat” contingency, we get the following style.
And we end up with a layout that changes its properties based on a bound value. And we don’t have to write endless value converters. Pretty handy… or at least I thought so.
How to create your own commands and bind them in WPF – Edward Tanguay's piece on commands and WPF… I know that they are supposed to be awesome, but I haven't taken the time to sit down and figure them out yet.