Flex/Flash/Actionscript, Maps

Not Your Mamma’s Maps

My most recent work at Universal Mind has been focused on developing data analysis tools for geospatial and temporal data. Basically that means making sweet Flex mapping apps. Our current project has been dubbed LaunchPAD, and you can read more on the Universal Mind website.

Analysis through space and time
The time element of a dataset is an important piece that we’re focusing on. In nearly all mapping applications I see on the web the time aspect is completely ignored. There are some exceptions to this (the Oakland Crimespotting site being a great example), but overall time gets the shaft. We’re trying to expose time as a powerful method to drill down into a dataset. About halfway through the video below I talk about what we’re doing with the timeline in LaunchPAD.

Data Analysis Framework
We’re building a framework to analyze data in space and time. We’re not building an application to analyze police data (although the tools we’re developing work really well to analyze police data). The demo video mostly focuses on the police scenario because that’s one that we’re most actively pursuing, but the idea is that LaunchPAD can apply to any dataset that has spatial and temporal aspects. Near the end of the video I show an example of pulling in current earthquake data from a GeoRSS feed and using the same toolset to analyze that data.

AS3 Mapping APIs
I’ve been working with a few of the AS3 mapping APIs, in my previous post about MapMyPix I mention working with the MapQuest API. I’ve also been working heavily with the ESRI API, and this is what we’ve used to create LaunchPAD.

Video Demonstration
I did a video demo walking through some of the features we’ve been working on. It’s kind of long, close to 6 minutes, so feel free to skim it and jump around if your ADD kicks in (I added some bookmarks to the video so you can jump to specific parts). And yes, I know I had the mic too close to my mouth, I was going for the sensual phone-sex operator voice, but I don’t think that turned out quite right.

Live Demo
You can play with a live demo version of the software. So if you’re too cool for school to watch explanatory videos, just pull up the demo app and start playing around. You’ll figure it out. Make sure to turn on the heatmap option 🙂

Standard
Flex/Flash/Actionscript

Writing Flex for Dummies!

I’m happy to announce that together with Deepa Subramaniam I’m writing Flex 3.0 for Dummies! We’ve begun writing and the tentative publication timeframe is “late spring/early summer” of 2008. The book will be published by Wiley and is the first Flex book in the For Dummies series. This is our first full-length book writing experience, and I’m both excited and nervous to take on the project. As things progress I’ll try to document the writing process here on my blog a bit. The book will be a beginner’s guide to learning Flex, and we hope it will fill an important gap in the currently available learning resources. We’re trying to make it easier than ever for new developers to jump into Flex.

For a little fun, here’s a random collection of Dummies books you can toss around:

This movie requires Flash Player 9.
Standard
Flex/Flash/Actionscript

My writeup of Ely Greenfield’s MAX session

Ely Greenfield’s session at MAX was, in my opinion, the best session of the conference… although I didn’t really attend many sessions at the conference (with so many people walking around who has time to sit in sessions?). But Ely’s was frickin’ awesome. Video recordings of his presentation in Barcelona have been posted by Joao on his blog. If you missed Ely’s session at MAX or you missed MAX entirely, go watch these videos. Seriously, go watch them now. The session was called something like “Flex Roadmap”, which was basically Ely talking about experimental directions they’re going while thinking about Flex 4.

Praising Ely
If you use Flex you know Ely. He’s formerly the charting master on the Flex team. I heard he wrote most of the charting framework with his eyes closed in 3 days. He’s one of the smartest guys I’ve ever met. His blog was an amazing resource while I was learning Flex. If you’ve been dabbling in Flex chances are you’ve seen some example code that he posted on his blog. Maybe you’ve seen this, this, this, this, or this. Turns out he’s been busy and hasn’t been blogging, which I’ve thought was a horrible idea. I think Ely’s blog posts are some of the most inspiring code examples out there, and his blog alone has probably convinced more people of the value of Flex than any other single source (this is all very biased, I learn extremely well from reading good source code). But Ely hasn’t posted a blog entry since March 19. WTF? I’ve often wanted to write a letter to Adobe on behalf of the Flex community and say “I don’t know what you have Ely working on, but give him some time to blog cool shit again. Whatever he’s doing can’t possibly help Flex more than his blog.”

Ely’s session at MAX was the first time I got a look at what he’s been doing, and it was the first time I thought to myself, “Oh, THAT’S what he’s doing? OK, you win. Keep him doing that.”

Creative Thinking from a Blank Slate
I want to try to get to why I thought this session was so good. To get a little perspective: we’ve got the Flex framework, which is something close to 300,000 lines of Actionscript code. That’s a big code base. That includes some monster classes like ListBase and DataGrid. So with that in mind, Ely gets up there and basically says: Let’s start over and really think about these components. Boil them down to the core functionality. What IS a list? Who cares that we have this ListBase class of over 7,000 lines of code. Maybe it’s not right. Let’s make it the right way. Let’s really figure out what the core functionality of a list is (and it doesn’t involve laying out scrollbars or clipping content or laying out items vertically or horizontally). He goes over a dramatically different way of creating a core list component in the session (see the last couple video segments).

There’s a really important (and dangerous) thing happening here. Most people would look at the current state of Flex, which includes a proven, stable, large code base and they would take that as a given. What I mean by that is that most people would think about how to take the framework and tweak it slightly to make it better (kind of like the improvements from Flex 2 to Flex 3). It takes balls (and brains) to be able to look at such a code base and say “Let’s rethink this. Knowing what we have learned from the past few years of Flex’s life, is this the right way to make a framework?”

That’s a leap that I think is more difficult than it sounds, and it’s something that I think is important for all software development. Too often we can start taking existing ways of doing things as the only way of doing things. Say you’ve been working on a project for months (or years) and the product now does a bazillion more things than you ever thought it would. Maybe the actual core use for the software is now dramatically different. I think it’s hard to back up and really think about the project with a fresh perspective. Question the architecture, question the fundamental design. Maybe the way it worked was right for the time, but doesn’t make sense any more.

Danger
This is obviously dangerous, because you can’t simply rewrite your entire code base over and over again (well, you could, but you’d never ship a product). And Ely constantly restated his disclaimer throughout the session, which basically went like so: they’re committed to backwards compatibility, nothing he shows or talks about is decided on, and all your old code that uses the Flex 2 or 3 framework will not be useless. He has to say this over and over because people get freaked out when they see such fundamental changes (which has important implications for all Flex applications ever created). I’m sure that this discussion comes up a lot internally at Adobe, and I’d love to hear more about how that conversation goes.

I’m glad Adobe is keeping backwards compatibility in mind, but what makes me even more excited is to see that Ely’s able to think about the Flex framework with a fresh, innovative perspective. This was what I really took away from MAX: the concept of stripping your code down to core functionality, thinking about it in a fresh light, and not being afraid to change everything.

I hope I didn’t sound like too much of a kiss-ass in this post.

Standard
Flex/Flash/Actionscript, Maps

What I’ve been working on: MapMyPix

universal_mind.jpg

One of the recent projects I have been working on with a team at Universal Mind is the MapMyPix AIR application that allows you to take data from a handheld GPS device and mash that together with pictures from a digital camera and automatically geocode your photos.
128.png

What it does
You drop a GPX file (which is what you get from your GPS device) onto the application and it shows your route. Then you drop a bunch of pictures onto the route and it automatically analyzes your pictures and figures out where along the route they were taken. Now you’ve got a geocoded photo set that you can view on the map and upload to Flickr to share. When the photoset is uploaded to Flickr the geocoded data is uploaded as well, so you can view your photos on a map. You can share the uploaded photoset with other people by sending out a link, or you can embed your mapped photos in a blog post or web page.

mapmypixscreensnapz002.jpg

Who this is for
Primarily this application is for someone who has a handheld GPS device and likes taking pictures on hikes, or ski trips, or other outdoor activities. The application also has broader implications in the business realm where large sets of photos need to be combined with GPS data (scenarios like real estate brokers, insurance investigators, etc come to mind). If you’re a backpacker and you take pictures along a hike and you carry a GPS device, then this app is right up your alley.

If you don’t have a GPS device you can still use the application to geocode and upload your photos. You can manually drag individual photos to set their geo locations. Further enhancements to the application are in the works to make the application more friendly to people without GPS devices, since for this initial release we were really focusing on users who have GPS data.

mapmypixscreensnapz003.jpg

Why this is cool
There are other ways to geocode your pictures. Flickr allows you to geocode pictures that you’ve already uploaded. But the process involves dragging each individual picture onto a location on the map. When you’ve got a hundred pictures from a hike you took this is painful. Not to mention that you’ve got to upload your photos first from your computer, then do all this manual gecoding one by one after the photos are online. Lame.

With MapMyPix we’ve combined the geocoding and uploading process into a smooth interface. Since this is an AIR app you get all the slick mapping capabilities that you can get with a Flex app. And since it’s a desktop application we allow you to simply drag a whole folder full of hundreds of images straight from your computer onto the map and boom, they get geocoded. Sweet.

mapmypixscreensnapz004.jpg

Some technical details
The app is a Flex application using the MapQuest AS3 API. Universal Mind made the MapQuest AS3 API (you can read the businessy sounding case study here). I’ve worked with both the ESRI AS3 API and the MapQuest API. Without making any comparisons I will say that the MapQuest API is great to work with. It’s fast, simple, and does everything I’d expect a map API to do (I’m not trying to kiss ass here, it actually is a very solid API).

The core application is a desktop AIR app. However, we also used almost entirely the same code base to create an online viewer application that is used to display photosets once they’ve been uploaded. After a photoset is uploaded we provide a unique URL and embeddable code that uses a Flex application to display the images on a map for sharing. Since the whole thing is a Flex app it took almost no work to spin off the online viewer after we had made the AIR desktop version.

Where we had issues

  • Time
    We had 3 developers. We thought we had 3 weeks. We had a blank canvas (ie we were able to brainstorm and come up with the ideas behind the app from the ground up). Awesome. We brainstormed like mad and came up with far more ideas than we could implement in 3 weeks. So we identified core functionality and then stuff that we hoped to have time for (got a bunch of that in there) and stuff that we would like to see (got some, but most of that is still waiting for the next version). Then after a week of work it turned out that there had been a mistaken assumption about the deadline and we lost 2 days. That’s like 10% of the total time. So that meant that the last week and a half were kind of a mad rush to accomplish as much as possible. I actually enjoyed this a lot, but it was definitely a bit stressful.
  • AIR suckiness
    This was Flex 3 Beta 1 and that meant we had a completely asynchronous SQLLite implementation. That sucked. Lots of time was spent coming up with ways of doing complex database transactions in an asynchronous environment. That wasn’t my job on this project so my life wasn’t too bad, but if you ever meet John Yanarella ask him how much he likes asynchronous SQLLite work. In addition to the DB stuff, I ran into lots of AIR memory issues. Our app dealt with very large images (multi-megabyte photos) and lots of them. We wanted the user to be able to quickly browse between hi-res images. But it turns out that if you load a few hi-res images in an AIR app one after the other the garbage collector decides to go on strike and you hit memory errors and the app crashes. Great. Adding in the localConnection GC hack fixed this.
  • Timezones! Argh!
    So GPS units save their time in UTC time, which is awesome because that means we don’t have to worry about time zones. If we have a date from a GPS we always know what universal time that means. The problem comes when you add in a camera. Cameras typically store images in JPEG format with EXIF data to store metadata. One field in the EXIF data is the data and time the photo was taken. Cool. But what ISN’T stored in the EXIF data is a friggin timezone to let you know the real time. So we have to make some assumptions about the camera timezone. We allow the user to adjust the UTC offset for their camera (which means which timezone the camera is set for) and then the syncing with the GPS can work as it should. If only the stupid EXIF data told us timezone…

A few more pretty pictures:

mapmypixscreensnapz005.jpgmapmypixscreensnapz006.jpg
mapmypixscreensnapz007.jpgmapmypixscreensnapz008.jpg

Links:

And here’s an example of an embedded MapMyPix geocoded photoset that was uploaded using the app:

Standard
Flex/Flash/Actionscript

Synthesizer Developer – Dan McWeeney’s thoughts on the future of software development

Here’s an interview from Dan McWeeney that he did for RedMonk.tv at the SAP TechEd conference last week. Dan and Eddie Herrmann are Flex developers that work at Colgate or SAP, depending on how you define “work”. They did a sweet demo, which you can see in the second video below, but the thing that really struck me was Dan’s interview where he discusses the “synthesizing” process of developing, which involves taking bits and pieces from the open source community and mashing it all together to make something cool.

There’s a whole new group of people that’s being created right now. Which are people that are really synthesizing things. And they’re programmers at heart but they’ve realized that there’s way more smart people in the open source community that they can tap and now build these things together. So it’s like mashups for programmers, where you’re taking all these little bits and you’re synthesizing all this crap together to create this whole new thing.

Dan gives a really cool shout out to me during the interview, so yes, I’m half posting the vid just for an ego boost 🙂 But seriously, I think he articulates a really important idea. So check out what he has to say.

Dan and Ed created a friggin sweet-ass demo for the SAP TechEd conference. Unfortunately that was scheduled in direct conflict with MAX, so they couldn’t make it to Chicago. Ryan Stewart already covered their demo a little, and you can read more at the RedMonk writeup. I’ve been talking to Dan and Eddie for a while and I’ve been seeing their progress on the demo they eventually showed. Without going into too much detail I’ll summarize what they did: take PaperVision 3D, add in full 3D physics, throw in fully interactive materials in the 3D space, then control the whole thing with a Wiimote. Did your head just explode?

I think one of the coolest things about this demo is how they went about doing 3D physics. I was talking to them about how I did physics in TileUI (which is really only 2D physics faked for 3D space). They wanted true 3D physics, and there isn’t anything like that available for Actionscript yet. So what to do? They got a non-Actionscript open source (I think) physics engine written in C (or C++, I think?). Then they run the physics simulation and pipe coordinates that represent all the objects and movement in 3D over a local socket connection that gets read by their Flex app. Fucking a. This is the kind of thing that’s awesome. Someone says “But we can’t do 3D physics in Actionscript” and they just say “Well fuck it then, we’ll do it anyway.”

Boys, I salute you.

Standard
Flex/Flash/Actionscript

View differences between Flex 3 Beta 2 SDK and Beta 1 SDK

UPDATE: Well shit, turns out that posting the source of the almost-open-source-but-not-quite-yet Flex SDK is a no-no for now. I assume once the Flex 3 SDK officially goes open source this will be OK, but for now I’ve been asked by Adobe to take it down. As you say master.

I’ve posted the Flex 3 Beta 2 SDK that can be compared using Trac to the previous Beta 1 SDK files. This lets you easily see what changed from Beta 1 to Beta 2.

View the changest from Beta 1 to Beta 2 here.

Check out the main Trac site here.

New files:

  • ButtonBar.png
  • mx.controls.dataGridClasses.DataGridHeaderBase
  • mx.controls.dataGridClasses.DataGridLockedRowContentHolder
  • mx.controls.menuClasses.MenuListData
  • mx.core.EmbeddedFont
  • mx.core.EmbeddedFontRegistry
  • mx.core.IConstraintClient
  • mx.core.IEmbeddedFontRegistry
  • mx.core.IFontContextComponent
  • mx.core.ITextFieldFactory
  • mx.core.TextFieldFactory
  • easing_readme.txt
  • mx.styles.IStyleManager2
  • mx.styles.StyleProxy

Some other things to note:

  • Lots of the files have a very basic change in the copyright notice: from “2003-2006 Adobe Macromedia Software LLC and its licensors” to “2003-2007 Adobe Systems Incorporated”. That unfortunately means a lot of “false positives” show up in the changeset.
  • I guess joining Adobe means Robert Penner gets to pimp his own book (even with a direct link to the page on Amazon) within the SDK source code.( 😛 I’m just busting balls)
  • There are lots of trace statements commented out, giving us an insight into the Flex team’s debugging mind. ListBase has 40 such statements that haven’t been removed from the code. DataGrid has 54. ProgressBar line 1631 has the wonderful “Move indeterminate” trace statement.
  • There’s some new stuff for styling. It looks like they’ve added a class called StyleProxy (note: at the moment completely undocumented and has large blocks of commented-out code), and that you can use that to set the default styles on custom components. I don’t really know much about this (Juan, want to chime in?) but check out the changes in TabNavigator to see a little how they’re using StyleProxy.
Standard
Flex/Flash/Actionscript

Move indeterminate

Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate
Move indeterminate

A little jab at the Flex 3 SDK team. This is about a bug in the Flex 2 Beta 2 release. Looks like someone forgot to remove a trace statement. Woops.

If you want to get overwhelmed with “Move indeterminate” trace statements then debug this app in the latest Flex Builder:





 

This bug has been fixed, although not scheduled to be rolled out until next beta. I assume you can grab a nightly build and install a newer version of the SDK if you want to make these trace statements go away.

I’ll be bitching more fairly soon about some other pain points when upgrading an app from Flex 3 Beta 1 to Flex 3 Beta 2.

Standard
Flex/Flash/Actionscript

3D Glasses Goodness at MAX

I took some pictures of a room full of dorks rocking the 3D glasses. Awesome. Last night we had the PaperVision 3D birds of a feather session and we handed out 3D glasses to everyone for a little nerdy fun. A huge pat on the back to Ben Stucki, who couldn’t make it to MAX, for his awesome work with a) writing the code for PV3D that allows us to render things in “3D-glasses-enabled” mode, and b) for sending me a big ass box of 3d glasses to hand out during the session. I believe Ben will be blogging about how you can integrate 3D glasses support into your PV3D projects, so stay tuned on his blog for more on that.

Also, I *think* John Grden will be showing some more 3D glasses stuff at his PaperVision inspire session on Wednesday at 3pm here at MAX. So if you didn’t get a chance to try out the 3d glasses, go to his session and you can look as cool as the people in these pictures.

3d_glasses_1.jpg

3d_glasses_2.jpg

3d_glasses3.jpg

3d_glasses_4.jpg

You’re all a bunch of dorks.

Standard
Flex/Flash/Actionscript

Come to the Custom Flex Components Birds of a Feather session at MAX!

I’m part of a panel that’s running the Flex Custom Component Development birds of a feather session at MAX. We’ve got an allstar group together: Deepa Subramanian, Tony Hillerson, Chafic Kazoun, Adam Flater, and Andy McIntosh. We’re all going to be hanging out and talking about component development in Flex. But we don’t know what to talk about. We’ve got a tentative list of topics we think people might want to discuss, but we want suggestions for things to cover.

When: Monday October 1 @ 9:30 pm
Where: Room 179 A

Here’s what we’re thinking so far:

  • Invalidation/validation model
  • Application components vs. custom components
  • Performance/Memory Optimization
  • Coding Conventions (naming conventions, mostly)
  • Code Behind
  • Component development in Cairngorm
  • Underriding or Monkey Patching
  • Where to go drinking after we’re done

So come by the BOF session on Monday night and we’ll talk about component development. I know it’s late, but seriously, come by or we’re going to cry. Bring your questions and ideas on what you want to cover. Leave comments about what we should try to cover or just email me directly (doug@dougmccune.com). See you there!

Standard