Skip navigation

Category Archives: Math and Information Theory

Some really interesting things are happening at andCulture these days. In addition to rocking the CSS/HTML/jQuery/AJAX suite of technologies, we’re building libraries for Flex like never before–using Flex for both back-end application-y RIA software and also as the framework for very rich UIs that look nothing like an app.

We’ve been consuming data from .NET, both SOAP and AMF, and from PHP via AMFPHP. Jason Kichline (@jkichline) has been doing some really interesting things with building abstraction classes in a project codenamed SudzC (SOAP classes for Obj-C / iPhone).

For most (ok, basically all) of our Flex projects we use PureMVC, which is elegant, language agnostic, and quite minimal. However, it’s not without its drawbacks. Being language agnostic is nice when you want to develop for multiple platforms and not have to switch out your paradigm-parser, but not so hot when you actually want to take advantage of a platform’s stuff–like for instance, Flex’s event model. PureMVC rolls their own Observer pattern, which is really nerdy and wot not, but sometimes, you just want to use event bubbling / capture. And not have to implement Pipes.

Another interesting challenge of extracting a framework is finding the balance of modularity in encapsulation, and ease of use, so your team can actually build stuff quickly with it. For instance, we’ve got some solid application logic in our MVC, but you might want to switch out where the data actually comes from and not have to trust the developer to ensure that the Notifications are all where they need to be.

Screengrab showing basic package structure of AdeptivMVC

Screengrab showing basic package structure of AdeptivMVC

Our answer was kind of a crazy synthesis of a solution for each of these problems. First, we wrote a Plugin / Provider methodology for our framework, not unlike the Provider metaphor in .NET. So, our Model (Proxies) tell the data where to *go*, and *how* it interacts with the application, but Providers interact with the Proxies to actually *get* the data. Pretty nifty. Oh, and while we were at it, we kinda just rewrote PureMVC.

We’ll see if it works out. Basically, you know those times where if you have to trip over that creaky stair *one more time* you’re going to go totally ape and remodel the entire downstairs? That’s exactly what happened.

My mission was to take out all the annoying things about PureMVC and keep all the cool things. Kinda like Palm did with Pre and the iPhone.

Testing it basically involved taking an existing PMVC application and seeing A. how difficult it was to retrofit the new framework and, B. make sure it still works. So far, retrofitting the “AdeptivMVC”, as I’m calling it, is totally easy to do, and regression testing seems to prove that stuff still works.

Now, we also get the added niceties of being able to use Singleton proxies if you want, and have multiple observers in a many-to-many relationship within the app. I added a “Relay” pattern in the mix verus the Multion thing that is used in PMVC, which basically makes things a hierarchy which allows for some neat event bubbling tricks.

I’ll try to get some demos and things up, maybe work on the Adeptiv framework initiative on adeptiv.com, and maybe even have some time to sleep in between doing billable work! Afterburners, engage.

Screenshot

This weekend I threw together an algo to generate Aurora for a holiday ecard. I was really happy with the outcome. You can see the card here.

I’ve been experimenting with building fractally trees as a branch (no pun intended) of a visual effect I needed to achieve in a presentation I’m building. I really love the output of this simple 2D tree example. It could have been built in Flash 5 probably, but it’s really cool anyway. Then, realizing that anything you can do in 2D you can do in 3D (*smile*), I built some happy little trees in Papervision3D. Again, nothing earth-shattering, but interesting enough to share.

This is an output from the 2D tree. Click here to test it out for yourself. If you get a little tree, it’s because the branches just decided to not grow anymore (it’s all random). Just refresh the page.

2d Trees

This is the tree visualization in PV3D. There’s not too much too see, but I think it has potential. Warning: It will totally cook slower processors. Click here to check it out.

3d Trees

Ok, I guess I don’t need to post *every* version, but this one’s really nice.

Check it out.

Screenshot

I think I like this better than the last one, because it’s so much more graceful, and really corresponds with the music…although the last one was much more visually big.

Check it out.

Screenshot

I absolutely love Bach on the violin, and I wanted to try to visualize it in PV3D. The logic is that it averages the amplification and frequency over 100 and 500 frames, respectively. This allows those modifiers to gracefully control the shapes. I am setting the size of the shape to respect the amplification at the sample time. I really like how fluid it turned out for a few hours of play time.

Screenshots

Click here to view the demo.

Hey, I’ve received several requests for the C# counterpart to the Flash 8 BitmapExporter class. andCulture has agreed to allow me to post the entire source under an Open Source license. The download includes the updated AS2 class and the C# solution. Please realize that it won’t “just run” as it stands and will involve some configuration. However, it should be all the code you need to yank a bitmap out of Flash 8. Enjoy!

Download here: http://www.lukesh.com/files/BitmapExporter.zip

Although this is essentially deprecated already, as you can easily export PNGs and JPEGs in AS3, this class allows you to encode a BitmapData object in AS2 so it can easily be accepted by a POST page or Web Service and converted to a PNG or JPEG on the server side.The class allows you to convert a BitmapData object from 24-bit to 16, 15, and 8-bit, and encode it as hex, or Unicode. For what we used the class for, we settled on 15-bit encoding to Unicode, with a 32-character offset. In other words, the color value for each 15-bit pixel, plus 32, is stored as the equivalent Unicode character. We needed the offset because there are some control characters that were causing some trouble. Decoding the string on the server side, at least in C#.NET, was relatively straightforward.

UPDATE: Click here to get the complete source, including the C# server-side code.