I was digging through some old code and found one of my first openFrameworks music visualizations. Not quite sure what to make of it now but I figured I’d post an image up here for the heck of it :)
you know…
This is a beautiful project which deals with urbanism and imagery, or, in it’s own words:
Some cities (for example Las Vegas and Venice) do seem to be photographed almost entirely by tourists. Others seem to have many pictures taken in piaces that tourists don’t visit.
Blue points on the map are pictures taken by locals (people who have taken pictures in this city dated over a range of a month or more).
Red points are pictures taken by tourists (people who seem to be a local of a different city and who took pictures in this city for less than a month).
Yellow points are pictures where it can’t be determined whether or not the photographer was a tourist (because they haven’t taken pictures anywhere for over a month). They are probably tourists but might just not post many pictures at all.
The maps are ordered by the number of pictures taken by locals.
Here’s London:

These are released under Creative Commons. Anyone can use them. Anyone can build, modify, appropriate, or manipulate them for fun or for profit. If you need help building any one of these feel free to contact me.
-
- Title: The Most Boring Interactive Installation Ever
- Concept: An interactive installation that generatively seeks to create the most boring interactive installation possible. As visitors enter the space they are observed by a computer vision system that attempts to determine their reactions to the piece by monitoring their posture, their facial expressions, the amount of time that they spend in the installation, how close they move to any one of the screens, whether they wave or gesture at any of the screens, how much they speak and the volume of that speech. Each visitors reaction would be stored and weighted to attempt to evolve the visual and auditory combination that invokes the least amount of reaction and time spent in the installation space.
- Implementation: This would be done using 3 cameras to track viewers, openFrameworks, openCV, and the rtNEAT library.
-
- Title: Time Will Wipe That Smile Off Your Face
- Concept: An installation that seeks to evoke first a smile and then a frown in the viewer using videos culled from YouTube. As a viewer enters the space the program will attempt to track their face and display videos that will evoke a smile on the viewers face by retrieving and displaying “funny” or “cute” videos from YouTube. Once a large smile or even laughter has been evoked the installation will begin to seek out videos that mitigate that smile and finally videos that may evoke a frown in the viewer. Once the viewer has frowned the installation will become inactive. The installation will be provided with an initial list of videos that have certain weightings from -1.0 (frown) to 1.0 (smile) but will also evolve a database of its own. At the end of each day the installation will upload the video that has evoked the best fit for a quadratic smile-to-frown arc.
- Implementation: This would be done using 2 cameras to track viewers faces, openFrameworks, openCV, the rtNEAT library, and YouTube. A small SQLite database would be used to store the urls of videos.
-
- Title: Empty Orchestra
- Concept: A conductor is shown on three screens awaiting. When three people stand in front of each screen and makes the same pose at the same time the conductor begins to conduct a symphony that becomes more harmonic the more that the users movements synchronize. If the users movements do not synchronize the music becomes discordant. If any user stops moving in sync with the other users the music stops. If there are not three users positioned each in front of each screen the installation simply displays the word Empty in front of each screen that does not have a user in front of it.
- Implementation: 3 cameras to track viewers, openFrameworks, openCV, Maximillian audio generation library, MP3 files.
Though you can always just stop by and say hello, I may be rather bored :) More info on where the booth is here
from Platform 13:
Platform 13 starts from the premise that our current global society, with its prevailing techno-political system, faces challenges of an unprecedented scale. We are asking ourselves how Design can contribute to alternative models of living and production by engaging with, commenting on, and addressing issues currently beyond the usual scope of design – political, social, technological or ecological.
Nomadic Sound System from Chris K Jones on Vimeo.
I’ve been playing around visualizing the interconnections between the speakers at this years FlashBelt conference. The NLP stuff to parse their actual connections is still a bit heavy going (I’ve been playing with some of the same stuff to make maps of Surrealism, Abstract Expressionism, and the early Communist party in the USSR (funny I know)) so I’ll get those posted soon, but I thought these were cute.
Ok, so I just saw a comment on the O’Reilly review that said there was a compile time error in 17.14. I took a look, and sure enough, Mr. Charlie Kelly (I’m guessing you’re not a fan of It’s Always Sunny in Philadelphia?) of Boulder Colorado was right:
....
private function init():void {
XML.ignoreWhitespace = false; textFlow = TextConverter.importToFlow(textXML, TextConverter.TEXT_LAYOUT_FORMAT);
textFlow.flowComposer.addController(new ContainerController(this.topText, 500, 400)); // < --- NOTE
textFlow.flowComposer.addController(new ContainerController(this.topText, 500, 400)); // <--- NOTE
textFlow.interactionManager = new EditManager(new UndoManager());
textFlow.flowComposer.updateAllControllers(); invalidateDisplayList();
}
private function setFontSize():void {
textFlow.setStyle('fontSize', comboBox.selectedItem);
textFlow.flowComposer.updateAllControllers();
}
]]>
<s :RichEditableText y="20" id="tSprite"/>
<s :RichEditableText x="500" y="400" id="bSprite"/>
<s :ComboBox id="comboBox" dataProvider="{new ArrayList([10, 12, 16, 20, 24])}" change="setFontSize()"/>
So, apologies for any confusion and thank you to Charlie Kelly for pointing that out. It’s fixed in the code downloads and will be in any future edition.
It’s cheap(er) today and today only (cheaper being $9.99 if you’re interested).
Why? Well, my site is really simple, but not so simple that I don’t want some help with it. Nanoc is pretty much the easiest way to generate a bunch of static html pages that I know of and it also offers a whole bunch of dead-simple layout, tagging, and content organizing tools.
A few words of advice: 1) Most of the time you want to use partials instead of trying to do anything tricky in your YAML files.
2) If you do want to do something clever in your data source write a custom DataSource instead of making a mess of your erb files.
Other than that, it’s awesome and easy.
Will Diaspora really catch on? I’m quite curious to see what happens to this project. At it’s worst it’s a great idea and it proves the viability of Kickstarter as a real way to get funds for a project. I personally know about 5 people who’ve funded projects via the site and I’ve helped fund 3 myself. It also does express a certain distrust of the facebook/google model, a growing realization that you might not want to give away your data, you might want to control it, and, beyond that, a wide recognition of it amongst people who might not have any idea how data encryption actually works or how something like this might be designed. That’s just long hand for “the non-technical” and the fact that the non-technical are interested in this gives me pause to think: are we now really aware of how data works? Are we now, as a culture, really aware of what the implications of living in public might really mean? Not just businesses or entitiites, but non-security minded users. The same people who put everything on myspace/facebook now, what happens when they really want to own their data, both culturally, legally, and technologically? It’s a curious question and it’s one that has some fairly serious implications because if controlling your data really becomes a culturally important thing, then it’s also going to become a business important thing and a design important thing, and making solutions for all the problems that will arise around people needing to control their data is going to be a big part of what people might be doing for the next (wild guess) 5 years.
On OSX Hex Fiend is your friend.
I run into a problem when writing because often I write and it includes code. That’s right: prose and code. Now, the thing about prose is that there’s lots of tools for it. Word, OpenOffice, Google Docs, the list goes on. The thing about code is that there’s lots of tools for it (begin long long list of IDEs which I don’t even want to get into). The rub comes when you try to put those two things together. If you’re like me, you’re not a genius programmer. You generally need to run things to make sure that the code you wrote looks like and acts like you think it will, which means you have code in IDE/compiler friendly formats. Then you have some documents which your publisher wants you to keep in a certain format (Word, PDF (shudder), whatever). What you need is to put those two things together. You need code live inserted into documents. That sounds like documentation, right? So a program like sphinx seems like a good idea. Zed Shaw used it to write this and it’s really well written, probably better than anything I’ve written. But is how he wrote it a reasonable way to write a bunch of stuff? Like a few hundred pages? That’s really the question I wanted to pose here: have you ever used a documentation system to write anything? How’d it work? Have you ever tried to write anything like that? If so, are you used to writing with a documentation system (i.e. you do a lot of docs (confession: I don’t really) or you’re a QA person).
I just have to say, I’m so happy to see Medellin Colombia getting more attention because the architectural and design projects underway there are inspiring, fascinating, and fascinatingly homegrown. A glowing article by Christopher Hawthorne in the LATimes sums it up nicely:
Medellín is one of the few cities where these two very different sets of priorities have come seamlessly together — where buildings meant to uplift poor neighborhoods and offer residents a new range of social services are also strikingly inventive as works of architecture. In that sense its hard-won improvements are meaningful not just for its own residents but for architects and planners elsewhere, even if they never have the chance to set foot in Medellín.

Do what? I’m told now that both Microsoft and Apple say that the future is HTML5 and that Flash is dead. I’m fine with that. Really. Business decisions are for businessman and I’m the first to admit (quite readily) that I’m not a remarkably savvy businessman and that many of the sophisticated business moves that all of these companies are making may be a little over my head. I’m fine with that, I’m perfectly willing to admit that all the cleverness may be beyond me and these titans of industry and technology are playing at a game that I’m not at all interested in and that I probably don’t understand at all. Just to get that out of the way, because I want to think about this from the perspective of someone who has to make things for clients and a lot of those things have traditionally been in Flash. That may not be the case in the future and, as I said, I’m fine with that. HTML5? It’s not earth-shatteringly different than HMTL4. It’s not as though I’m chugging along in Java and suddenly everyone says “Oh, that’s dead, the future is Haskell” (note, I think a lot of people did say that at some point). It’s not like I have to learn an entirely new syntax, mentality, and library set. I already know JavaScript. And I like it. So that’s not why I’m worried about this. I’m worried about this because everyone is saying: “This is dead, use this” but this isn’t ready. Really. It’s not. I swear. So what does that leave me to do? I’ll go to my people and clients and they’ll say: “We want this; Isn’t Flash dead? Let’s use HTML5″ and I’ll think: “Hmm. Well, we’ll just need two/three versions of this with wildly different UX to get this to work or I’ll have to tell them that there are things we can’t do”. So while the future might be HTML5 (probably? hell, I don’t know) the present is going to suck a little. And Joe Hewitt is right (I hate linking to TechCrunch because they’re so obnoxious but whatever) on one point: you can just launch another browser, but I know from experience that most people aren’t going to buy that for a while (if ever).
So, in an effort to keep this blog from dying, I should keep folks updated as to whereabouts and whatabouts. I’m in Buenos Aires Argentina right now, doing some work and getting ready to go meet some of the people of the hacker community down here at LAB on April 10th. Then, I’m heading over to Santiago Chile to give a talk at the Centro Cultural de España and then a pair of workshops on openFrameworks and Arduino at…well, I’m pretty sure they’re going to be at Universidad del Pacífico in Santiago but I’m not totally sure. Anyways, if you’re down here and you want to hear me make an ass of myself in Spanish, come on by.
I often hear designers say: “all design is problem solving” or some variation on that as if that explains what the activity of “design” actually is and it’s always puzzled me. When I was a bike messenger approaching an intersection was “problem solving”: one would have to evaluate all the crossing traffic, police presence, pedestrians, how fast one felt, what one was carrying, how slick the streets were, and so on. No one would really describe messengering as problem solving though. Planning a route was problem solving: 30 minutes package to this address, 2 1 hour packages to this address; it was almost like the travelling salesman. In fact, most things can be interpreted as problem solving. Police problem solve who to arrest in a fight, teachers problem solve how to quiet their class, canvassers problem solve how to get you to donate money to save the environment, painters problem solve how to correctly get a color effect, and so on. The critical difference between these modes of “problem solving” and what designers do when they’re doing interesting design is that all the examples I mentioned are solving problems for oneself. A designer most often solves problems for other people: they put themselves in the place of someone else, maybe a client, and imagine how a third person, perhaps a user, reader, or viewer, will react, expect, think. Fundamentally they’re using what Keats called “negative capability”, imagining themselves to be someone else and analyzing that. Problem solving itself is sort of a mis-categorization of what that activity is, but it fits because problem solving is such a fundamental mode of human activity. In fact, it’s one of the few things that almost every activity can be interpreted as being. But then, that leaves the classic questions of what we think that designing actually is doing.
We’re doing this all on the command line.
1) Stop the server
sudo /sbin/SystemStarter stop postgresql-8.3
2) Remove menu shortcuts:
sudo rm -rf /Applications/PostgreSQL 8.3
3) Remove the ini file
sudo rm -rf /etc/postgres-reg.ini
4) Removing Startup Items
sudo rm -rf /Library/StartupItems/postgresql-8.3
5) Remove the data and installed files
sudo rm -rf /Library/PostgreSQL/8.3
6) Delete the user postgres
sudo dscl . delete /users/postgres
7) Remove the LaunchDaemon .plist
sudo rm /Library/LaunchDaemon/com.edb.launchd.postgresql-8.4.plist
If you’ve seen errors that look like this when building large and complex projects:
[compc] _SomeClass_mx_core_FlexModuleFactory.as(15): col: 14 Error: Interface method get preloadedRSLs in namespace mx.core:IFlexModuleFactory not implemented by class _SomeClass_mx_core_FlexModuleFactory.
or maybe this:
[compc] _SomeClass_mx_core_FlexModuleFactory.as(15): col: 14 Error: Interface method allowDomain in namespace mx.core:IFlexModuleFactory not implemented by class _SomeClass_mx_core_FlexModuleFactory.
It’s time to upgrade or downgrade your SDK to match what everyone else is using because somewhere, somehow, your SDKs are colliding unhappily. Probably you’ll need to update from something like 3.3 to 3.4 or 3.5.
These are the slides from a talk I gave last week at Lycoming College in Williamsport PA. Enjoy!
I gave a presentation on Flex 4 at PDXRIA last night and it was pretty fun (despite my getting the time wrong and showing up 20 minutes late for my talk). The slides are here.
I’m looking for interesting projects to work on. That interesting can be the UX, the concept, your company itself, or the people that you have working on the project already. If you have one or more of those things, let’s talk. We might get along well :)
That new Google programming language looks great doesn’t it? Just look at the promotional text:
Go attempts to combine the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++.
Sounds great right? So I’m on 10.6 and I want to start playing with this thing! In trying to do so I learned that if you’ve installed Macports, you’ll need to uninstall and reinstall everything, following these instructions. You might see a warning like:
Python support for SSL and HTTPS is not installed
when you try to hg the Go code. You’ll want to do:
sudo port install py25-socket-ssl
but you won’t be able to because you need to uninstall and then reinstall every port you put on your computer in 10.5. Once you do that though (and it’s lengthy, I know) you can get mercurial working properly and install Go. I realize that this post is misnamed and is actually about how to get you Mercurial install working and upgrading MacPorts, but I ran into all this trying to get Go working.
And I like it. A lot. Just in case you all were wondering.
Jim has sent you an InMail:
.net / WPF/silverlight/C# consulting position in NYC
Hi Josh,We have you in our database, but unfortunately your number goes to some poor woman who says in her voicemail, “I am not Joshua Noble”. You might already know this. LOL…
I really wish Google voice had been around earlier. Or that I’d just hired a secretary. Instead, I intentionally wrote my phone number down wrong on my Dice resume because I didn’t want people calling me. Guess we all know how that turned out. Oops. Sorry ma’am.
Are tricks good? Sometimes, yeah. Are tricks bad? Sometimes, yeah. So when are they good and when are they bad? Totally depends on the coder, the context, and the trick. Take this one from last weeks Portland Ruby Brigade:
while gets prints if ($_~/^Igal:$/)..($_=n/^$/) end
What do you see there? If you didn’t shrug then you’re either a) the guy who wrote it or b) a genius. What’s in there is not the range operator but the little known flip flop operator. Check it out;
irb(main):010:0> items = [3, 9, 5, 2, 2, 8, 5, 9, 2, 2]
=> [3, 9, 5, 2, 2, 8, 5, 9, 2, 2]
irb(main):011:0> puts items.collect {|item| item if (item < 4)..(item > 4)}
3
9
2
2
8
2
2
Those blank spots are where the flipflop operator has been set to false. Still, I’m not a huge fan of that for readability reasons. It’s kind of like someone going Iron Chef at breakfast. Sometimes I just want toast, you know? Anyways, back to Peter Cooper and his bag o Ruby tricks. Some of them are pretty good. I like this:
# [*items] converts a single object into an array with that single object # of converts an array back into, well, an array again [*items].each do |item| # ... end
Didn’t know that. Actually, that’s only the one I like most because I like a lot of them. 16 is good, 12, most of them. #8 though, that one gives me the heebie-jeebies.
does = is = { true => 'Yes', false => 'No' }
does[10 == 50] # => "No"
is[10 > 5] # => "Yes"
He admits it’s not the best example, but still, I’d hate to come across that. The nested ternary stuff freaks me out a tiny bit as well. So that brings me to another thing: I spend a lot of time reading code and writing code, but more reading it than writing it and more time using it than reading it. That gives me an order of preference: if you really are doing it for performance (note the quick discuss of the !! operator in the comments of Peters blog post, or some crazy ass inline ASM blitting code or whatever) then by all means have at it, homes. I will assume that you know your stuff backwards and forwards and that if I want to dig into what you’re doing I’ll be rewarded with sweet sweet nectar of performance gains. If you’re not getting a performance gain, because reading is #2 on my list of things, I’m inclined to say that maybe you should make it easier for me to read and understand. Not just me in particular, but me as in anybody else. Everybody has to know lots of programming languages today and it’s nice to speak in a way that everyone can understand given the multiple things they have to have floating around in their heads. Let’s try a not-entirely-accurate metaphor: everyone (pretty much) has to know English to do science. Now, I know English really well, does that mean I should go to the conference and start speaking to everyone in Joycean type punnery just because I can? Nah, probably won’t make many friends doing that. I should go and assume that it’s better to say: “Would you like to go for a walk around the campus after lunch?” than “Fancy a campus circumnavigation post-prandially?” or “Walkabout post-nosh?”. See, one’s more letters and words, but isn’t difficult for those who aren’t in my particular little group, my group being either people who know that I like to say things like “walkabout” for “walk around wherever we happen to be” and so on, or people who know I like fancy Latinate words (I actually don’t). That’s actually part of the sociological function of slangs and specialized languages: to tell you who’s in and who’s out. Back to programming languages, I’m not in on the Ruby world, and I’m definitely not in on the Perl world, so lots of the super-idiomatic things that can be done to condense without performance gain strike me as a bit funny, the same way parlor tricks strike me as funny: funny in the parlor, not in the not-parlor.
So the time has come for me to Re-Ruby myself. What, you may ask, OpenFrameworks, Arduino, and Processing not enough for you? Hacking around with Erlang, teaching myself some electrical engineering, and learning low-level C not good enough? Well, maybe. Maybe not. Anyways. I need a better web language. I’d like to say that it should be Python, and Python is awesome. But I know some Rails and I’m partial to it. And there’s a ton of fun friendly goofy silly stuff in Ruby. Were I a more serious person I’d be all over Django et al for everything I need but I’m not. So in order of name-dropping messing around for a day I started with:
Sinatra: I love you. I’d stop loving you if I actually had to do anything. I’d love you even more if I had a good idea for a nanosite.
Tokyo Cabinet: You and CouchDB. Are you CouchDB’s little brother? Not really. You’re different. I think you’re faster though that could just be me.
HAML: Nice. Stop freaking out about my indentations though. It’s lame.
MongoDB: TBD. Will I trade out TC for you?
Merb (again): Still like you a lot. Even though you’re less feature packed than Rails. That’ll all change soon though. Soon, all shall be…interesting.
DataMapper: Also TBD (note the .php at the end of their homesite, just for the irony of it)
So I’m definitely not making something important or even interesting to anyone else. Just a simple site to grab mentions of bikesnob from around certain places in the web. Like facebook. Totally silly, I know, but fun fun fun, and it’s a good learning exercise and that’s what I’m really looking for right now: some learning. And some fun. Oh, and by the way, I live in Oregon now. Go…em, Trailblazers (?) Whatever. It’s nice here.
I love that _why vanished. I also love this and that Zed Shaw is Twitter-in on it. I guess I don’t think Whys name was Jonathan Gillette. I also don’t really care. It is a bit lame that all his stuff is gone, but I’m not sure that many people were really using it anyways.
I remember talking to him for a little bit at the Art && Code conference and he seemed nice. I also remember that he also got kicked out of the bar for not having ID which is interesting. Who doesn’t carry an ID around with them? I know a few people who don’t and they’re all pretty punk rock. By which I mean they don’t have IDs bank accounts or anything else that ties them to anything. I’m sure Why had all the things “responsible” people are expected to have, that’s not what I mean to suggest. I’m just enjoying that the one time I actually met him in person he was wearing sunglasses at night and got kicked out of a bar for not being to prove who he was :)
“Ruby makes easy things trivial and hard things fun.” — “Erlang makes easy things _possible_ and impossible things trivial.”
from #erlang-otp
Which I entirely agree with in all points. It’s an interesting read, and it’s here.
Thanks to Peter Dehaan for posting this. In case you want to stay on the bleeding edge of things (like, say you’re updating a book on Flex that you wrote a couple of years ago, or you’re really curious). I actually just tried to do this earlier today by hand, got some stuff screwed up, then read Peters post and remembered that there’s a far easier way to do it. As with many things in the Java world: don’t do it yourself, let the tool do it. That extends beyond the Java world as well, but it’s particularly relevant there.
The Swedish military. They know how to recruit :)
“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian Kernighan
Hiiiiilarious.
Snow Leopard? Jaguar, Tiger? Stop. Seriously, just call it 10.5 or 10.6 or 10.4 or whatever. I can never keep these straight and every time I run into some blog post detailing some weird library linking issue I have to go look up on Wikipedia which one is which. The dev SDKs are all named 10.4u and 10.5 and so on, can’t we just talk about those? I mean, if it’s some little kid who’s into cats then, fine, call it whatever you want, Funny Bunny, Cuddle Monkey. But some of these are pretty hard core C/C++ developers talking about linking in unix libraries and and frameworks, I want something a little more exact, you know? Same goes for you Ubuntu.
Welcome to funtown.
Step 1: Get Fink.
Step 2: Install glib.
Step 3: download GNU PCB.
Step 4: download GNU gettext (http://lists.apple.com/archives/unix-porting/2006/Feb/msg00094.html)
Step 5: configure, make, install gettext
Step 6: download LibDG
Step 7: configure, make, install libDG
Step 8: Add these lines to /sw/include/glib-2.0/glib/gutils.h (http://mmt.me.uk/blog/2008/12/31/ld-duplicate-symbol-mac-osx/)
#elif defined (__APPLE__)
# define G_INLINE_FUNC static inline
Step 9: go into GNU PCB and configure, make, install
Step 10: type pcb into a command line, away you go.
update –
Just use EAGLE
In my “yes, I’m sort of still reading Flash type news” it seems you can now use XMPP in an awesome way with Hemlock. And….em, that’s it. They made a really nice website for the name. And a few pictures. And a video. And lots of promises of gooey goodness. Sweet. So what is it? Check this:
Hemlock is a new web development framework, focused on allowing easy development of real-time, many-to-many apps. Hemlock follows the inspiration of Ruby web frameworks like Rails and Merb. It can be used for applications such as games, workspace collaboration and education.
Note Merb aka was-Merb-is-now-Rails-3.0 and Rails aka Rails. This leads me to deduce that this is a Ruby framework. Were I not so lazy, I would show you how to do XMPP with Merb right now, but instead I’ll point you to bablyon. There’s other options as well, but none that have as nifty a site Hemlock and none that are as Flash-ready-to-go, well, except OpenFire, or whatever it’s called now. Anyways, yay, Flash+XMPP for everyone! Using either Java, Ruby, or (shh) Erlang backends!
== edit -
I have misunderstood things, as shown in the comment below Hemlock is AS3. I’m guessing that means it’s an AS3 framework for parsing and sending XMPP. So that’s nice and I retract any snarkiness I may have projected.
Well, I’m in France on vacation. Semi-irregular service will resume sometime around mid-June. Cheers!
I have sooo many other things to be working on, but I just can’t stop reading all these posts from Reg Braithwaite on combinatory logic. They’re seriously well written, interesting, and mind-expanding. I’m just going to list them all here:
http://github.com/raganwald/homoiconic/tree/master/2008-11-07/from_birds_that_compose_to_method_advice.markdown
http://github.com/raganwald/homoiconic/blob/master/2008-10-29/kestrel.markdown#readme
http://github.com/raganwald/homoiconic/tree/master/2008-10-31/songs_of_the_cardinal.markdown
http://github.com/raganwald/homoiconic/tree/master/2008-10-30/thrush.markdown#readme
http://github.com/raganwald/homoiconic/blob/master/2008-11-23/recursive_combinators.md#readme
http://github.com/raganwald/homoiconic/blob/master/2008-11-26/practical_recursive_combinators.md#readme
Enjoy, seriously, especially if you’re at all interested in functional programming or Ruby.
– update, Reg sez there’s more! Woo-hoo!
A quite impressive application built in Flash that does something I’ve been pondering doing for a long time: play music from sheet music. It’s very much worth checking out at noteflight.com
I was reading this: Cool Things in Rails 2.3 and this Rails Metal makes me think that Rails Metal and Rack are pretty interesting things to me. That’s cool, for something highly trafficked, you can write a Rack endpoint with a call method and off you go and since they’re slotted in before Rails picks it up there’s no overhead on the Rails framework, and apparently Rails Metal is “2.8x faster than a Controller“. So that’s neat. Maybe I’ll get back to web development soonish, because Nitro, and Mochiweb, Django, and now the new Rails make me want to get back to work :)
If you haven’t heard the great mumuring of Haskell, you haven’t been listening. I’ve heard it and I’ve heard it loud and clear. Now, let me be clear, I’m a bandwagon jumper. Not a bandwagon jumper in the “Oh no, the CTO has another stupid idea” kind of bandwagon jumping, or the “salesguy with no idea what he’s talking about but has a love of buzzwords” kind, but the “where there’s smoke there’s fire” kind. When lots of smart people get excited about something it’s usually because there’s a good reason to get excited. It was that with Ruby, my first and probably lamest bandwagon jumping exercise. Why is Ruby great? Because it’s simple, lightweight, friendly, and makes scripting easy, and had a very nice friendly community around it. You can learn a lot from Ruby, both in the do and don’t register. There was smoke, and lo, there was fire. I learned a lot from learning Ruby. Did it save the world, my startup, my relationship with my girlfriend, make me rich, cure cancer? Nope. But it was fun. And I learned a lot. And learning it helped me a meet a lot of smart people and see a lot of things happen that I wouldn’t have been party to had I not studied up on it. Did I learn it superwell? Nope. Am I a super-Ruby hacker? Nope. But I know it, and I like it, and I still think that, flaws aside, it does what it’s supposed to do and makes me happy.
Erlang. Same story. Lots of smoke, lots of fire: concurrent programming is good. Functional programming is good, um, to learn. Good for everything? I’ll let people smarter than me handle that one. I learned a lot about multicore, about concurrency, about hotswappable code, and about how to construct systems. These are all good things to learn, and they’re pretty hard in C++. I wouldn’t have learned about them if I had to learn them in C++ honestly and I actually like C++. But I did learn about them, and about a lot of other things, because of Erlang and because when a lot people said: “this is the next big thing” I followed along and said: “maybe”. Now, did I look like a fanboy? Yep. Did I care? Nope. I’m not waving flags or fighting language or OS wars or any of that stuff. I’m just learning things and trying to keep my fingers on the pulse of things. Save the world? Nope. Am I level 9 hacker? Nope. Did I have fun learning it, reading newsgroups, going to talks, and seeing what it enabled people to do? Yep. That’s a win for me.
Alright, so is Haskell the next big thing? Plenty of people say so. There’s buzz, sessions, books, blogs, burgeoning newsgroups and irc channels. That’s smoke. Plenty of smoke. You have two options: dismiss the smoke as smoke (and you’d be right) or consider the smoke as emanating from a fire (you’d also be right). I’m not going to make another “you should learn this obscure strange hip language” kind of post here. I’m just going to point to a few things and say “there’s some smoke, draw your own conclusions”.
Learn you a Haskell – It’s funny and it has cartoons. Lolspeak abounds. And so does information.
Real World Haskell – It’s hard to write a really good tech book. Really hard. I know. And so do these guys. Because they’re actually done it. This is a really well written thoroughly community vetted book. If nothing else, if you’re interested in what makes a good tech book, it’s here.
Make friends while reading RWH – You can make friends, and friends are good.
So what is this all? Well, it’s something that’s going on. Is it going to make you rich, famous, thin, em, pimpin’, etc? Maybe. Maybe not. But maybe you wanted to know what was going on. And now you know one more thing that’s going on.
What I like best about it is that it’s a conceptual approach to git, which sounds a little arty, but he knows his stuff:
The conclusion I draw from this is that you can only really use Git if you understand how Git works. Merely memorizing which commands you should run at what times will work in the short run, but it’s only a matter of time before you get stuck or, worse, break something.
This tutorial, then, will take a conceptual approach to Git. My goal will be, first and foremost, to explain the Git universe and its objectives, and secondarily to illustrate how to use Git commands to manipulate that universe.
check it out http://www.eecs.harvard.edu/~cduan/technical/git/
I’m sure a lot of people have already heard about this, but I’m going to blogosphere it up anyways. The Ardunio MEGA. And man, Is That Thing Mega. The official Arduino data is here
* 53 I/O Pins
* 8K RAM
* 4K EEPROM
* 128K Flash space
* 4 Hardware Serial interfaces
* 14 PWM pins
* 16 analog input pins
It even looks serious.

You could get them here: http://store.makerbot.com/featured-products/arduino-mega.html but I think they’ve already sold out. So snoop around and see what you can do. They’re worth it. Really worth it. Really.
I spent this last weekend down in Pittsburgh at the Art and Code conference and found myself excited about all manner of things once again. This was a symposium and online community focused on programming environments for artists, young people, designers, and hackerish types of all stripes. It featured tutorials on PureData, openFrameworks, Processing, Hackety-Hack, Max/MSP, Scratch, and some other stuff. There were presentations, and a Dorkbot presentation that had probably the most inspiring thing I’ve seen in a little while by Hans Christoph-Steiner on the reware project. He also gave a really great Pure Data demo.
Closer to home, for me at least, the oF crew launched oF 006. I got to meet Todd Vanderlin, Casey Reas, and a bunch of very interesting other artists, designers, geeky types of many stripes, and generally feel the love. I was really happy to see how many people knew about and were excited about Programming Interactivity, which got me triply motivated to make sure it’s up to the standard of these projects.
I also read the Done Manifesto by Bre Pettis, which I found immensely fun and which I’ll quote here:
The Cult of Done Manifesto
1. There are three states of being. Not knowing, action and completion.
2. Accept that everything is a draft. It helps to get it done.
3. There is no editing stage.
4. Pretending you know what you’re doing is almost the same as knowing what you are doing, so just accept that you know what you’re doing even if you don’t and do it.
5. Banish procrastination. If you wait more than a week to get an idea done, abandon it.
6. The point of being done is not to finish but to get other things done.
7. Once you’re done you can throw it away.
8. Laugh at perfection. It’s boring and keeps you from being done.
9. People without dirty hands are wrong. Doing something makes you right.
10. Failure counts as done. So do mistakes.
11. Destruction is a variant of done.
12. If you have an idea and publish it on the internet, that counts as a ghost of done.
13. Done is the engine of more.
I love this site for the topics and people there. As much as I like the weird infighting and hysteria of comp.lang.c I have to say I prefer the philosophical and theoretical bent of these guys. If I were actually smart enough to design programming languages (which is quite unintentionally one of the things that my education and interests to this point have geared me to do) I would be doing it, and I would be commenting vigorously here. You can learn a lot, get yourself sucked into any one of numerous wormholes of philosophy, cybernetics, language design, computer science, or mathematics, wile away many an hour on a quiet friday night indeed.
I’m also getting started on a new little project with an interesting company that, of course, I can’t talk about and had to sign an NDA to even have tell me their name. I’ve come to realize that in business one of the most important things is to feel as though you’ve got a really interesting and important idea and nothing does that better than the NDA. “We’d love to tell you how amazing we are, but, due to our amazingness, we can’t, until you sign you promise to never tell anyone how amazing we are, thereby proving our amazing-ness”. I should start asking for NDAs just to talk to me. You never know when I’ll say something in casual conversation that’s so amazing that it might just be the next big thing. In fact, I’m going to need to ask you, the blog reader, to sign an NDA just to read this blog. There’s got to be something worth protecting in here…well, maybe not, but then, isn’t your signing of NDA proof that something in here is worth it? Enough side-tracking, I’m going to finally build out my first commercial Flash project using PureMVC and see how I like it. I’m thinking it’s going to be ok at the very least since the project isn’t monumentally difficult and an chance to learn a little bit about the “other framework”. I’ll post on how I like it.
So, most of the readers of this blog are via the Macromedia mailing list, which means that most of them are familiar with Actionscript and hence have probably seen this:
function fun(foo:Type, args...)
And you may have seen something similiar in Javascript via the use of the arguments variable available inside any function:
function makeFunc() {
var args = Array.prototype.slice.call(arguments);
var func = args.shift();
return function() {
return func.apply(null, args.concat(Array.prototype.slice.call(arguments)));
};
}
which lets you Lisp-y like things in Javascript and is, I suspect, a great part of its appeal to CS-heads (e.g. Steve Yegge). But how are these getting handled under the hood you wonder? I did too. So I did a little research and discovered the concept of the variable list in C and C++:
Think about printf() for a minute. It actually looks like this: int printf( char * format, … );
See that … Those magical 3 dots? You’ll remember these from Actionscript. They mean a variable number of arguments. Now, something to keep in mind is that there are lots of kinds of C. In GCC C, which is what I tend to use, there a few different macros you can call:
va_start() – i.e. create a va_list of all the variables in the …
va_arg() – i.e. get the value of a particular argument in the …
va_end() – i.e. get rid of my va_list and bail the whole operation
void omnivore(int num_args, ...)
{
va_list val;
int loop;
va_start(val,num_args);
for(loop=0; loop < num_args; loop++) {
printf("%s ", va_arg(val, char*));
}
va_end(val);
}
So I can call this like:
omnivore(3, "hi", "there", "man");
In fact, if you look up variadic functions in Wikipedia, you’ll see that lots of languages support these. Why point this out? Because I hear people ActionScript people talking about “args”, “elliptical args” and a few other silly terms to describe variadic functions. You guys are better than that, use the correct terms :)
–>
On another note, I saw today that there’s a new abstraction layer for databases and Erlang: Amnesia. That was what the Ericsson crew originally wanted to call Mnesia but someone told them that calling a DB after an affliction popularized by soap operas probably wasn’t a good idea. So what does Amnesia do? It’s an abstraction layer for interfacing relational DBMSs written entirely in Erlang. No more SQL statements, no more DB-specific stuff, just Erlang. It looks ok and whats more it means that Erlang is one step closer to actually being Java, which is, em…good for someone? To my un-educated eye it looks much like any other abstraction layer:
{ok, Emp1} = amnesia:add_new (Pid, #employee { name = "Bob", address = "Bob Address", email = "bob@system.com"})
and
amnesia:fetch(Pid, Emp)
So that’s not anything all that new if you’ve used Rails or Hibernate or, well, pretty much any other ORM. Nice to know it’s there, the march of progress continues :)
I’m taking a sabbatical from work and from NYC and heading to the frozen hinterlands of Wisconsin for a little bit to get some writing (Programming Interactivity) and research done. Hopefully I’ll have some exciting stuff to show when I emerge. I’ll be looking to leverage the C++, OpenGL, and Java that I’ve been learning and shoe-horn a little ActionScript in there somewhere.
Before I go I’d like to provide a link to the following hilarious idea from the idiki, that is, the wiki of ideas. Pure anarchistic hilarity. Take care and watch this spot (well don’t really just ‘watch it’, that’d be boring and you have more exciting things to do).
Alright, so I built my Sanguino, with the Atmel 644p, which is a pretty serious chip, for those interested in chips, and I’ve been having a lot of fun playing with it. Then I see another board has been released by the excellent gentlemen at Liquidware, the Illuminato:

Just look at that thing: Atmel 645, beautiful, 42 pin, 16Mhz magic. Not all that different than your Sanguino, but with a few more pins. 54 to 32. The EEPROM memory and the SRAM are the same. The Sanguine runs the Atmel644, which actually runs up to 20Mhz, so that takes the cake there but it doesn’t have a USB connection which is not a particularly big deal most of the time. I think they’re both a) beautiful b) powerful and c) so wonderfully useful. These are the two big boys but there’s also the Freeduino, the Bare Bones Arduino, the Boarduino, iDuino…you know, enough ‘duinos for anyone. I think this is just a testament to the relevance of the idea spawned by the core Arduino team and just the start of a brand new way of thinking about hardware, hacking, and community.
On another note (I always do this don’t I?) I’ve been working with Git, which I have found to be vastly superior to SVN. I mean vastly superior. For those interested there’s already so many excellent tutorials and screencasts out there that instead of trying to tell you what to do, I’ll just point you to some of the resources that I’ve used:
http://gitcasts.com/
crash course for SVN users
gitmagic
My advice to you: get git. Have more fun. Stop messing with conflict errors. Be happy.
Because they are a wonderful example of what you can do with the interweb that is not the promotion or sale of knock-off Viagra, Rolexes or penny stocks or the propagation of Yet Another Meme (I can haz you shutit?). No, instead, Kiva make it possible for you to loan (yes, loan for those you still clinging fiercely to the one-true-way-ideology of unfettered capitalism) money to third world entrepreneurs who want to build businesses but don’t have access to the channels of money that many of us in the third world do when we need 100-2000$ dollars. These people do things like farm rice, run small stores, make clothing, manufacture shoes, and so on, nothing spectacular, but potent and vibrant sources of employment, income, and exchange in their community, and plain evidence of human ingenuity and dedication. Their businesses aren’t big enough to allow them access to any international sources of aid, large multinational banks don’t want anything to do with them, and their governments don’t have the resources to help, and, until now, you had no way of knowing who they were or what they needed or how to get it to them. Well now you do. You can find someone who needs $100 for a sewing machine and who will pay you your money back. Someone who needs $500 to fix a tractor. These sorts of things. I’ll stop writing, post a video, and call it a day here and don’t forget: if things keep going the way they have been, you might be asking for a loan from an International NGO yourself one day, so, you know, think karma.
Sometimes, you just don’t have what anything that pressingly requires an entire blog post. Back in the day, when I was pushing the boundaries of what I knew with Flash/Flex and Ruby every day, and picking up Erlang, I was bubbling over with joy every time I figured out some hidden magic about the Flash player or some little tidbit about gen_tcp in Erlang. Everything was all new and exciting. And not that it’s old hat, but the things that I’m learning are, well, more subtle, less thrilling and more a matter of recollecting and reconfiguring knowledge that I already had rather than new knowledge. It’s not as exciting, and it feels a little strange to say: “Well, I was thinking about doing it this way, but then I realized that I already knew that was the wrong way to do it, so I started doing it another way, but then I remembered this, and read this, and then I got it right.” Lots of things are like that though. When you mess around with multiple languages and multiple idioms in multiple problem domains (service, server, client, desktop) a lot of what you’re doing is recalling and recontextualizing. It’s that recontextualizing that’s most important I think. I can recall something semi-obscure about Erlangs gen_fsm or about rtAudio playback or about some tuple values in Python, but recalling them at the right time, when they’re actually useful, is trickier. Knowledge is contextual: I find myself getting muddled up now and again when people ask me things, not because I don’t know it, but because I’m not thinking around that sort of thing, or in order to think of that sort of thing, I have to have myself thinking of something slightly off topic. Mnemonic devices are great, but if you’re sort of mumbling “Bad Boys Ruin Our Young Girls, But Violet Goes Willingly” when someone asks you something point blank, you look like a lunatic. So that’s what I’ve been doing: getting things in their right places, seeing the relationships between things, and figuring out what’s important to know when and what isn’t so important to know. I still find lots of interesting little tidbits here and there during my daily browsing and reading, and I just put those things up on my tumblr account. Maybe once I really have to learn the new Flash Player 10 APIs a little better I’ll get more re-bloggy. Or maybe once I start building some things out with merb or django or mochiweb or any one of the other frameworks that I love to mess around with. But for the time being, I’m writing plenty on Programming Interactivity and I’m thinking plenty on many an other thing, so the blog remains fairly quiet.
Oh, and Happy New Year.
What is Pachube? Well, it’s just a webservice. That said though, a webservice, just like a data format, is only as interesting as the data it streams out and the processor processing it. Pachube sends out what they call EEML (which is just XML) of real time sensor data from objects, devices, buildings and environments all around the world. That makes it a slightly more interesting project, because the big problem with getting this kind of data is not that it’s hard to find, but that it’s hard to find lots of it all in one place. I can get the surf report from Melbourne, the temperature of a house in SF, and the water level of the Colorado river. Moreover, if i wanted to report this sort of data, I would have to set up my server and my service to receive and the publish (not that this is particularly difficult), determine a data protocol, and probably never know what anyone was doing with it. Pachube just centralizes this, makes it searchable, and provides tools like an Processing library, Sketchup plugin, OpenFrameworks integration, and a few other nice addons.
As with many things I’ve been writing about and thinking about in the past few months, the trick of this is not the technical sophistication of the project, but rather, what it simplifies and by simplification, what it brings into view. Big problems often obscure what their solution provides. Pachube makes publishing and accessing data about the physical world easier, which means that the things you can do with data come into sharper focus.
Check it out here
On another note, the rough cuts for Programming Interactivity are making their way onto the O’Reilly Rough Cuts site. I’m not sure when they’ll be up but it should be rather soonish.
Glancing at the Rough Cuts page, there’s some pretty cool stuff up there: Hadoop, CouchDB, the High Performance Python all look interesting. Guess I’ll have some reading to do over the christmas break.
Well it did. And it’s here And just to get you ready for the joy:
Python 3.0 (a.k.a. “Python 3000″ or “Py3k”) is a new version of the language that is incompatible with the 2.x line of releases. The language is mostly the same, but many details, especially how built-in objects like dictionaries and strings work, have changed considerably, and a lot of deprecated features have finally been removed. Also, the standard library has been reorganized in a few prominent places.
Sounds like fun, don’t it :) The docs are here and the “what’s new”, by the bdfl, is here
Interactive Video Object Manipulation from Dan Goldman on Vimeo.
update –
thesis is here: http://www.danbgoldman.com/uw/goldman_thesis.pdf
“a board that is more powerful, yet still compatible with the Arduino software.”
Let’s see those specs:
- atmega644P core
- 32 total general purpose I/O pins (some are multipurpose)
- 8 analog pins
- 6 PWM pins
- 64K flash memory
- 4K RAM
- 2K EEPROM
- completely through-hole construction
- breadboard compatible
- 100% open source
- compatible with Arduino 0012 with minimal hacking
On OSX it can, you bet. Thanks to the Apple Type Server, which some people will know from the wierd ATSServer related error loops that they see when their OS refuses to start up, spinning instead at the happy little beach ball right after Finder starts up, any bad fonts loaded in any files, but particular in PDFs, will kill your OS. So if you download a mangled PDF from a website like I did an hour ago, get ready for the fun to start (I’m typing this on my Linux machine, btw). These things all seem to start from PDFs, so if you’ve just downloaded one and had your whole computer die, here’s what you can do:
1) Turn off indexing for Spotlight. That’s part of why you’re getting the crashes. Editing /etc/hostconfig and adding the line:
SPOTLIGHT=NO-
and then doing
sudo mdutil -i off /
sudo mdutil -E /
should help a lot.
2) Find the file and delete it. You’ll probably have to be booted into safe mode to do this, so restart your Mac and hold down the shift key the whole time. Once you’ve done that you can trash any and all PDF files out of your downloads and make sure you delete them. Then restart and you should be good.
This apparently only happens on 10.5.5 and not the earlier versions, so I guess it might get fixed soon-ish.
It only took 162 tries and ~8 years :) But they did it. Congrats guys!
The Processing software runs on the Mac, Windows, and GNU/Linux platforms. With the click of a button, it exports applets for the Web or standalone applications for Mac, Windows, and GNU/Linux. Graphics from Processing programs may also be exported as PDF, DXF, or TIFF files and many other file formats. Future Processing releases will focus on faster 3D graphics, better video playback and capture, and enhancing the development environment. Some experimental versions of Processing have been adapted to other languages such as JavaScript, ActionScript, Ruby, Python, and Scala; other adaptations bring Processing to platforms like the OpenMoko, iPhone, and OLPC XO-1.
Processing was founded by Ben Fry and Casey Reas in 2001 while both were John Maeda’s students at the MIT Media Lab. Further development has taken place at the Interaction Design Institute Ivrea, Carnegie Mellon University, and the UCLA, where Reas is chair of the Department of Design | Media Arts. Miami University, Oblong Industries, and the Rockefeller Foundation have generously contributed funding to the project.
I had a good time at MAX, learned a few new things about some Flash Player 10 internals, learned some new things about performance tuning from Sean Christmann, and found out that there’s a lot of stuff going on with getting the Flash Player to run on ARM, which you should read as “on powerful Mobile phones”, which you can read however you would like.
I’m also going to lay out a quick note of how I solved the “AIR communicate with the System” problem. I wrote a wrapper application that launched the AIR app when it was started up, nothing new or exciting there. Then I just wrote commands that looked like:
“ls -a {0}”
where I would just fill {0} with the value passed from the AIR app. I encrypt those so that the command can’t be tinkered with and unencrypt them at runtime. Then, in a very lightweight (i.e. ~4kb) process I just check the file to see if it exists and whether it’s locked, if it’s not locked, then we read it, fill the command with the parameters, and then pass it to the system to be executed.
The meat of the OSX version of this looks more or less like so:
// this is the threaded method
void *process( void *data )
{
while(run) {
checkFile();
usleep(500000);
}
char buffer[1024];
sprintf(buffer, "rm -f %s", f->cfile);
system(buffer);
return (void*) 1;
}
int main(int argc, char *argv[])
{
char* lockFile;
char* commFile;
char* result;
//
printf(" starting up ");
commFile = (char*) malloc(1024 * sizeof(char));
lockFile = (char*) malloc(1024 * sizeof(char));
result = (char*) calloc(1024, sizeof(char));
//
pthread_t thread;
int threadi;
//
// you'll want to encrypt your system commands just in case
// so you could do
// xorUnencrypt(addToSafe);
// start up the air app, if it works we'll create the thread
if(startAIRApp(commFile, lockFile) == 1)
{
run = true;
// thread identifier
threadi = pthread_create(&thread, NULL, process, NULL);
// go ahead and make the thread
pthread_join(thread, NULL);
//
free(commFile);
free(result);
free(lockFile);
}
}
Is this beautiful C? Nah, not really. But it works. The rest of the OSX version (extremely sanitized for the sake of my future employment) is here.
The hardest part of all of this was finding where the app wasn so that I could launch it. On OSX that requires that you make use of the FSRef object. Essentially, you do the following:
1) create a FSRef object
2) pass is to LSFindApplicationForInfo along with the name of the bundle from the plist file of your app
3) call FSRefMakePath along with a string that the path can written into
that looks pretty much like so:
OSStatus err;
FSRef appRef; // this is the OSX application object that you can get the app path from
char *appPath = (char*)malloc(1024); // just go ahead and do the max
//
err = LSFindApplicationForInfo(0, CFSTR(TARGET_APP_BUNDLE_ID), NULL, &appRef, NULL);
if (err != 0) { return err; }
appPath = NULL;
// note the wierd cast, ick
err = FSRefMakePath(&appRef, (UInt8*) appPath, appPathSize); // now your application path is written to appPath
And that’s really all there is to it.
Should be fun, we (by which I mean myself, Todd Anderson, Chafic Kazoun, and (tentatively) Yakov Fain), will be talking about Flex Architectures and architectural strategies for developing Flex applications. I can’t deeplink into the session locator, but it’s here on Monday at 2pm and it should be a very interesting presentation. Swing by if you’re interested, and, I’ll be bringing my bike, so if you’re attending and interested in going for a little ride up to Marin County or somewhere else interesting one morning drop me a line.
Looking through the trac source today and I needed to find a good example of where trac uses the TemplateLoader…so how do I do that without setting up a new project in Komodo and all that? Grep. You just grep it:
$ grep -r "TemplateLoader" *
And that gives me back
web/chrome.py:from genshi.template import TemplateLoader, MarkupTemplate, TextTemplate
web/chrome.py: self.templates = TemplateLoader(self.get_all_templates_dirs(),
Binary file web/chrome.pyc matches
web/main.py:from genshi.template import TemplateLoader
web/main.py: loader = TemplateLoader(loadpaths, variable_lookup='lenient')
Binary file web/main.pyc matches
How nice is that. There are sooooo many tools that I just don’t make good use of, and I’m trying to get better about that. You can regex in grep, which menas conditional matches, wildcarding, all kinds of goodness. Of course, this is all kind of irrelevant if you’re on Windows but, well, whatever, I’m sure you can figure something out.
On another note, I got a 15″ MacBook last week and I like it. A lot. It’s a really nice computer and I’ve enjoyed it a ton. So much lighter than my 17″, so much faster, and the 10.5 XCode is a really welcome upgrade to the old one, as I’ve been doing a lot of C++ on my nights and weekends working on my book. Speaking of the book, I’ve sort of started a blog for my book where I’ll be putting more and more stuff as the writing progresses. It’s at programminginteractivity.com. There’s not really anything there, but it’s coming soon, so check it out if you’re interested (publication is roughly scheduled for April of next year, from O’Reilly again)
I think this looks really good. Kind of like erlyweb, but different, and a little more erlang-ish. Take a look at it here.
Seriously I’d almost rather be having to use Brainf*ck. How anyone uses this is completely beyond me. I’ve never seen anything so unintuitively designed. It’s almost as if they just decided to have wacky and completely undocumented fun with the english language because, well, hell, someone can just figure out the difference between ‘run’ and ‘tell’ on their own. Right? Of course you know the difference between those don’t you? Because good luck figuring that out, all the tabbing and line ending crap, wierd parsing rules, and all the other stuff that makes doing pretty much anything in applescript a several hour process of trial and error.
LadyAda has all the info. Sounds pretty cool though I really don’t miss messing about with avrdude and bootloading and so probably will not be upgrading myself. Still, I suppose if I had a complex gps logging project up my sleeves I might be more tempted.
From the Active Vision Laboratory at Oxford in the UK
I’m excited for people to get excited about OF (aka OpenFrameworks) so here’s a little something made with it at the Venice Biennale Props to Zach Gage, The Rockwell Group and “Jones | Kroloff”.
Found at Best of Craigslist, San Francisco Bay area:
I’ve been trying to think of ways to spice up my life. I’m 35 years old, happily married with two kids and I have a good job in insurance. But something’s missing. I feel like I’m old before my time. I need to inject some excitement into my daily routine through my arm before its too late. I need a challenge, something to get the adrenaline pumping again. An addiction would be nice, but, in short, I need a nemesis. I’m willing to pay $350 up front for your services as an archenemy over the next six months. Nothing crazy. Steal my parking space, knock my coffee over, trip me when I’m running to catch the BART and occasionally whisper in my ear, “Ahha, we meet again.” That kind of thing. Just keep me on my toes. Complacency will be the death of me. You need to have an evil streak and be blessed with innate guile and cunning. You should also be adept at inconspicuous pursuit. Evil laugh preferred. Send me a photo and a brief explanation why you would be a good nemesis.
British accent preferred.
Oh yeah, there’s this too.
and this
Disco is an open-source implementation of the Map-Reduce framework for distributed computing. As the original framework, Disco supports parallel computations over large data sets on unreliable cluster of computers.
The Disco core is written in Erlang, a functional language that is designed for building robust fault-tolerant distributed applications. Users of Disco typically write jobs in Python, which makes it possible to express even complex algorithms or data processing tasks often only in tens of lines of code. This means that you can quickly write scripts to process massive amounts of data.
Well then. Guess that’s a few more problems solved for people; i.e. the problem where you want to use Hadoop, but want to do it in Python.
vademecum (va•de•me•cum Latin “go with me”) – A handbook or other collection of instructions, that is intended to be carried about and provide ready reference
All the magic is here.
That’s right folks, it’s basically an Arduino processor (ok, it’s not really, he slowed his processor down by messing with how it was clocked (something that to be honest with you, I barely understand) but still). It’s a contest that starts at 75Mhz and goes down to 8Mhz:

The award they were competing for?

Check it all out here
Because it’s something that I know about, but not that I know…I think that’s the challenge. I’ve mentioned in certain places, on my facebook account, that I’m working on a book called Programming Interactivity for O’Reilly that is going to focus on tools and techniques for interactive design and interactive art. I’ll probably be writing more about this, but I’ll just say that right now, it’s very challenging and exciting and a little scary. My last post was a real random blurb, so here’s a little Keith Fullerton Whitman, to try and smooth out that random-ness:
And I’ll be bringing my bike, if anyone wants to tag along along around San Francisco and a little beyond :)
More details to come.
On another note I found Instruction Set
Every month some instructions appear on instructionset.org.
Instructions may be vague or specific. Your challenge is to write software to carry out the instruction.
You may pick any programming or patching language you wish, and may stretch the definition of ‘programming language’ and ‘software’ if you like.
I’m stuck in nyc while OSCON is going on in everyones darling favorite city of the moment (Portland (remember when it was Seattle?), Oregon) and I’m wishing I was there. I’ll just be furtively searching blogs for news from the conference for the next few days, and on that note:
on practical erlang programming 1
on practical erlang programming 2
on practical erlang programming 3
That’s a talk being given by Francesco Cesarini, who along with Jan Henry Nystrom is working on the Practical Erlang book for O’Reilly, which I’m quite excited about getting my hands on. That’s all I’ve heard from now. I’m quite looking forward to news and notes from the Beautiful Concurrency talk as well, but I’ll just have to sit on my hands here in nyc :(
The most fun awesome thing happened to me last night, overnight, this morning, and today.
Look here:
http://digg.com/programming/recruiter_stupidly_CC_s_400_coders_and_one_replies_all
here:
http://groups.google.com/group/pradiptas-rolodex?hl=en
and finally:
It’s been fun :)
It’s here. Not to do stupid blog-o-mongering, but it is pretty important. Thank you Señor Moock.
Pretty exciting; from abstractmachine; friendly processing + opencv badassness. This is definitely going in the book.
We got some big old slick monitors at work, the huge Apple Cinema displays, which are splendid to use. The only catch I ran into is that when I get back home and fire up Eclipse the window size is still 1900×1200, which is too big for me to be able to get access to the handle at the bottom of the screen and resize the window. So it would appear that I’m stuck, except that I’m not:
cd {workspace}/.metadata/.plugins/org.eclipse.ui.workbench/
open workbench.xml file
change height, width, x, and y values
save and close file
voila.
code downloads
Ok, so we’ve gotten the assets from the cookbook published for the most part. There are some things that are not in there. Those things that are not in the download are left out because they’re either not important (i.e. something like a reference to “MySampleData.xml” which is just there for reference) or because they’re not Flex, (i.e. “MyPHPScript.php”). Other than that, everything is available for download here. If you are so inclined I can send you the other stuff, but you’ll have to ask for it.
typos
Are there typos and errors in the Flex Cookbook? You bet. Do I want to know about them? Absolutely. Please please please submit them to the errata site. Errors that are in the cookbook are not in there because we’re malicious or trying to rip you off, we want to know about them so we can fix them, we like you, we want to help you as much as we can.
target skill level
Is the Flex Cookbook chock full of super framework hacking tips? Not really. We had to decide whether to make something more intermediate to serve the market or something super advanced to show off, hack, have fun, etc. Guess which won? That said, I think even for people who are pretty knowledgeable, you’ll find things you can learn. If not, if you totally knew everything in there and are mad that we wasted your time and money, let me know, I’ll give you your money back and buy you a beer.
extra chapters
Why is there no charting? There is. When we handed the book in the first time it was 770 pages. There was a misunderstanding, and we realized the book could only be 650-ish. Ooops. A few chapters had to get turned into PDFs that you can download on the O’Reilly site here. I think you can download them even if you haven’t bought the book. So check them out, if you’re interested. Yes, we went overboard, yes, I wish we hadn’t, no, there really wasn’t anything we could do about it given the publication date.
I hope this answers some of the questions that people have had and informs you better as to whether to invest your money and time in the Flex Cookbook or makes you a little happier that you did, if you already have :)
I’m finally back from two and a half weeks in Switzerland and it was amazing. Really really amazing. I keep meaning to post up all my silly tourist snapshots, but I haven’t gotten around to it yet. On another note, I’m still getting my Ubuntu lappy all tricked out. Something I ran into today:
/usr/bin/gem:23: uninitialized constant Gem::GemRunner(NameError)
Ever see that error? If so, just open up /usr/bin/gem in vim, nano, whatever you use, and add this line
require 'rubygems/gem_runner'
right after the first require statement. Tada. It’s good to be back at work :)
This one is worth clicking through to the vimeo site to see the video full screen, here, trust me, or don’t and watch it here :)
code_swarm – Python from Michael Ogawa on Vimeo.
People have been talking about “Flash Killer” again and I suppose it’s logical that they are Apple people, since Apple hasn’t tried to do this before, so it’s novel to them, and they’re very excited about having ‘their team’ beat out Flash. Well, ok, so aside from the silliness of the ‘team” thing what do we really have here? We have sproutcore, and that’s a really cool name. And what is it? Well, it apparently is something that will: “replace Flash without requiring any secondary plugin runtime”. Ooh, tell me more! Well: “Cocoa for Windows + Flash Killer = SproutCore”. Oh! Wow! So, what is it? What is this revolutionary new technology? It’s….prototype. The classic and pretty damn awesome javascript library used damn near everywhere. It’s what ships with Rails. What else? Well, some other pretty sweet javascript libraries! And? Merb+ActiveRecord! And…that’s about it. Ok. So, really, what it is, is a nice, pretty lightweight Ruby library with a large Javascript library to facilitate building out UIs. And, that, well, I’m not sure what that’s supposed to prove. Is that really going to be a Flash Killer? Meh, me thinks probably not. Why? Well, because if these tools were going to “kill Flash” they already would have done it because they’ve been around for a while. Now, I do believe in an open web, I do believe in Javascript, I like merb, and while, you know, it’s pretty silly to have ‘a team’ I guess it’s fine to get all excited about what ‘your team’ does, seriously, I watch Microsoft and Adobe guys do it all the time. (Seriously, really, people, “your team” is your clients and your co-workers, not the companies that build your tech stacks). But seriously, guys, “Flash Killer”? That’s just silly.
Ok, so I was reading this “Flash killing” news from this post at roughlydrafted and while he said some kind of silly things, one thing he said that I agree with is this:
“…RIAs haven’t really taken on the world by storm. Instead, Flash, Silverlight and other proprietary tools and their required runtime plugins are all still aiming at some future date when they can claim the status of being the platform monopoly in RIA development. (EDIT this line is just silly, and not what I was interested in this quote :) However, many of the most popular rich web apps today are from Google, including Maps, Reader, Docs, and Sheets. Google’s rich web apps take on Microsoft Office desktop apps without needing Flash, Silverlight, or Java.”
which I’ll give him, is a fair point, and something I’ve said before as well. Food for thought. Anyways, even though I tease it here, I might even use sproutcore on something, I like Merb, and the ORM in it seems nice. And, of course, if you want to make iPhone apps, well then, one knows what they need to do.
What is it? A semi-accurate Greek term to describe morphing something based on it’s position in time. Yay classics class. You were worth it after all! Now, back to the coding; the video is here
Chronotopic Anamorphosis from Marginalia Project on Vimeo.
and you should look at that first to see what this is and how it works. Next, you can go to the processing exhbition space and check out the code:
Hooray open source. And congrats to Andre Mintz for making something awesome.
I’ve been wondering about the technology atmosphere in NYC. It’s certainly here, to a certain degree, there are a great number of intelligent people here, and there are a great number of very interesting people working with art and code here because there’s a lot money around art here, and that’s very cool. But there isn’t a real technology buzz per se, because there’s more of a money buzz here that drowns and subverts other things. Not in a real insiduous way, but in a sort of “wouldn’t it be better if…” sort of way. You know how when you’re talking to someone who’s say obsessed with ice cream, and you say: “let’s get some strawberries” and they say “yeah, strawberrys, but wouldn’t it be better if it was strawberries with ice cream?”. Everything gets melded with ice cream for them. New York is like that with finance and money: wouldn’t it be better if it was your idea plus the stock market? Or plus a marketing scheme? Or etc…? Which is great for some ideas, but not that great for others. I was wondering about that, and then I read Paul Grahams newest essay. And it started to make sense to me. Having lived in Boston and New York and Seattle (not that Seattle is really like SF, since it’s way more of a company town, but it kind of is, so I’m going to do that) I think he’s really really on to something.
Erlang/OTP R12B-3 with new bug fixes, yahoo.
mine:
http://www.erlang.org/download/otp_src_R12B-3.tar.gz
yours:
http://www.erlang.org/download/otp_src_R12B-3.tar.gz
http://www.erlang.org/download/otp_win32_R12B-3.exe
and docs (for both of us):
http://www.erlang.org/download/otp_doc_html_R12B-3.tar.gz
http://www.erlang.org/download/otp_doc_man_R12B-3.tar.gz
enjoys it.
I like this quote:
“Computational thinking is a fundamental skill for everyone, not just for computer scientists. To reading, writing, and arithmetic, we should add computational thinking to every child’s analytical ability. Just as the printing press facilitated the spread of the three Rs, what is appropriately incestuous about this vision is that computing and computers facilitate the spread of computational thinking. Computational thinking involves solving problems, designing systems, and understanding human behavior, by drawing on the concepts fundamental to computer science. Computational thinking includes a range of mental tools that reflect the breadth of the field of computer science….Thinking like a computer scientist means more than being able to program a computer. It requires thinking at multiple levels of abstraction.”
Is computational thinking fundamentally different from the 3rd ‘R’ in the three R’s? Yes and no. Yes, because classic arithmetic didn’t focus as heavily on formal logic, the sorts of things that we find in discrete/continuous math, and certainly not protocols (given old teaching methodologies, i.e. rote memorization and recitation, I’d say ‘reading’ was probably not much different than memorizing the HTTP or IPv4 or etc). And no, because algorithms are algorithms, be they pythagorean, mergesort, some wacky design pattern, or implementing message passing. But anyways, it’s a very interesting paper from ACM posted up at the CMU website
Q: “If I send you questions on code in the O’Reilly Flex 3 Cookbook, will you answer them?”
A: “Yes.”
Now, don’t go crazy, there are lots of things that I can’t help you with, due to time, etc. But I do try to answer all the questions that come my way and I’d like to continue doing that because I think it’s the right thing to do, and I genuinely do want to help people with problems, questions, concerns, and most importantly, with any errors or anything misleading in the cookbook. Just so you know :)
O’Reilly Media announced the Flex Cookbook Cook-Off contest to celebrate/publicize the “Flex 3 Cookbook” as well as the Adobe Flex Cookbook site.
Prizes include:
-Grand prize: A ticket to Adobe MAX in San Francisco, California and $500 (US) in O’Reilly Media books
-Community choice award: $350 (US) in O’Reilly Media books
-Second prize: Every Adobe Developer Library book published by O’Reilly Media
-Third prize: Five O’Reilly Media books of choice
Contest runs June 2–August 1, 2008
Winners will be announced Sept 1, 2008
The rules are posted here: http://www.insideria.com/flex-cookbook-rules.html so if you’re interested, take a look, and send in a recipe.

I’ll be honest, I didn’t know who Leah Culver was, other than that I knew there some connection between that name and Pownce. Google search and, yeah, ok. Yep. I get it. Ha. Ok.
If you’re seeing this error:
/opt/local/lib/ruby/1.8/drb/drb.rb:865:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open'
from /opt/local/lib/ruby/1.8/drb/drb.rb:865:in `open_server'
because you’ve just upgraded OSX, the issue is in the actual Socket call:
Socket.getaddrinfo(Socket.gethostname, 0, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
This is the origin of the error. If you change the param at 1:
Socket.getaddrinfo(Socket.gethostname, nil, Socket::AF_INET, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)
OSX goes on, happy as can be. The process of dealing with OS upgrades is pretty interesting and so is the discussion around it, from a community/coding standpoint. You can check out this thread here.
http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/ccf6510ee91c21ac?hl=en
Yes, I know where the website is; it’s here. Yes, I read through the website and some of the documentation. No, I don’t understand it. No, I’m not an idiot. No, I’m not really that smart. Yes, I’d love it if someone could explain it to me. Thanks!
love,
josh
This is definitely worth checking out not only for historical purposes, but also simply for reference: that’s a fine UI, in 1962 or 2008, which makes it all the more impressive:
On an unrelated note, if you haven’t read this paper which is tellingly titled “Do Formal Intellectual Property Rights Hinder the Free Flow of Scientific Knowledge? An Empirical Test of the Anti-Commons Hypothesis” and you’re at all interested in commons/copyright and the exchange of information it’s an enlightening one. I came to it by reading an article on Juan Freire at “we make money not art”.
Well I guess there is support for snippets in Flex Builder already, spotters badge to Dustin, thank you very much. I’m realizing my decision to use the stand-alone FB3 install was a poor one (I mean, I knew that already when I was doing it but I can’t be expected to be thinking all the time, right?). So following some info here at nwebb.co.uk, I tracked down the snippets grail. Now I just have to rework a few things on my dev setup I suppose.
I just couldn’t resist re-posting this here because it’s just so dang pretty:
Interactions of the form tell X to do Y then send the result to Z are impossible to express in a standard RPC framework (like SOAP) but are simple in Erlang:
rpc(tell,X,toDo,Y,replyTo,Z) ->
X ! {Z, Y}.
from armstrongonsoftware, from Joe Armstrongs blog.
I second Leif Wells request for snippet support in Flex Builder. I use TextMate a fair amount for development on my Mac and once I learned how to use snippets and write templates, I couldn’t stop using them and it helped me concentrate on the parts of development that I really wanted to concentrate on. I do a lot of writing in Microsoft Word and once I learned how to write macros, I couldn’t stop, it helped me concentrate on the parts of writing that I really wanted to concentrate on. I do a lot of coding in Eclipse using Flex Builder and…that’s kind of where that ends. When uber-coders wax poetic about emacs I get jealous, because the IDE that I work on a lot in my day job doesn’t allow me to use templates or snippets. It does a lot of other cool things, but it doesn’t help me out there, and being able to write out switch/case, for, do/while, getter setter declarations, or any of the other things you can do easily, in three keystrokes, is pretty sweet. So vote for FB-11842. And, oh, go to Leifs blog.
Seriously, the folks at Parsons really walk the line between brilliance and insanity. I personally can attest to the joys of OpenFrameworks (a Parsons-related product) among other things, and I just found this project, “Computer Skills” by Charles Broskoski, that just, well, blows me away. I like code. I like books about code, hence, I like O’Reilly. But this guy took it way further: he read 365 O’Reilly Books in 400 days. Check it out.
Now that it’s out, I’d be really curious to know what people think of the Cookbook, now that it’s at Amazon and on Safari. You’re certainly not under obligation to say nice things, mostly I’m interested in peoples thoughts. I know it’s not a super-advanced whitepaper or groundbreaking research by any means, but I’m wondering if that’s what people were wanting, rather than something aimed at intermediate Flex developers. If you’ve got an opinion, let me hear it. Thanks,
The answer is….aside from having a pretty amazing dev team of course, yep, Erlang. It’s basically a Comet HTTP server, with a C++ app handling the log of chat messages, and an Erlang based server to handle the polling and HTTP requests:
For Facebook Chat, we rolled our own subsystem for logging chat messages (in C++) as well as an epoll-driven web server (in Erlang) that holds online users’ conversations in-memory and serves the long-polled HTTP requests. Both subsystems are clustered and partitioned for reliability and efficient failover. Why Erlang? In short, because the problem domain fits Erlang like a glove. Erlang is a functional concurrency-oriented language with extremely low-weight user-space “processes”, share-nothing message-passing semantics, built-in distribution, and a “crash and recover” philosophy proven by two decades of deployment on large soft-realtime production systems.
It’s all here
The other really interesting thing that this mentions here is Thrift, which is the Facebook platform for enabled simple RPC communications between different apps. It’s available open source here, and if anyone has used it definitely let me know how it worked out for you.
Am I first? Am I first? Am I first? No? You mean all the other thousands of Adobe bloggers beat me to it? Aw. Drat. Anyways: link. Click on my ads and buy stuff. Just kidding. I write this blog out the sheer love of blogging and no other discernible platform on which to express myself. :)
If you don’t read Steve Yegge’s blog, you totally should. Because this post, which is the transcript of a talk he gave at Stanford, is awesome. Almost all of his posts are awesome, the only ones I exclude from the ‘awesome’ category are those which are merely ‘pretty damn good’. This quote in particular has given me pause:
In Java 1.0, when you pulled a String out of a Hashtable you had to cast it as a String, which was really stupid because you said
String foo = (String) hash.get(…)
You know, it’s like… if you had to pick a syntax [for casting], you should at least pick one that specifies what you think it’s supposed to be, not what it’s becoming – obviously becoming – on the left side, right?
But, but, but…isn’t that what all languages are supposed to do? Well? Think about it. Is it?
Open, free, fabrication laboratory. Too bad it’s right in the heart of my least favorite city in America. Well, maybe I dislike Miami more. Tough call. Anyways, if you’re not as averse to Boston as I am, check this out: Fab Lab
What two things have I been thinking about in the last 24 hours? Aside from how to get GL_SELECT to work properly with OpenFrameworks (!) and where a good optometrist can be found in Brooklyn that is. It’s 1) fmodex versus openal. I posted up my little openal + OF example and found that no one was particularly impressed. Why is that? Oh, because OF already includes fmod, which is, afaict, the 3d and gaming sound library. Looking through the API it’s slightly less friendly, but way more powerful. I promptly set about whipping up a small example of 3d sound using 3d spheres to position the listener and sound source in OF (which was how I got lead into the GL_SELECT problems). So I guess I’m gonna drop the openal stuff and start learning the fmodex C++ api a little better, which, if there’s better documentation out there than what I could find on their site and the fmode.h file, somebody lemme know.
On the web side of things, I found a really cool article on using mochiweb, the erlang web framework built out by Bob Ippolito and the gang at MochiMedia, with ErlyWeb. It’s short, but I think it could be promising. I’ve played around a little bit with ErlyWeb and I think it’s quite promising. I haven’t played around much with MochiWeb, but I’ve read the source and found it impressive. Do they need to get put together? Not really, since erlyweb is built on YAWS, while Mochi is not, so you’re mixing and matching with some weirdness there, but I think it’s nice nonetheless that there are already two usable web server frameworks out there for people who want an introduction to working with Erlang.
For the XCode savvy (and OF possessing as well) out there: Simple little example using OpenAL and OpenFramework together, the only really interesting part here is the following mouse callback in the ofApp mouseMoved callback:
void OpenALApp::mouseMoved(int x, int y ){
float fx = (float) x;
float fy = (float) y;
SourcePos[0] = (fx - 512) / 10;
SourcePos[1] = 0;
SourcePos[2] = (fy - 384) / 10;
alSourcefv(Source, AL_POSITION, SourcePos);
}
The alSourcefv call sets the location that the sound appears to originate from using the mouse position.
The zip is here for download and includes the XCode project.
If it’s true. That’s. Um. Big. Isn’t it? But wait, here’s someone saying the opposite? Does it matter? Um. Kind of? I don’t know. I’m really confused when I think about Rails these days.
And in particular I like this post on optimizing MySQL. Really though this could be applied to almost any DB system, design your DB schema correctly, use profiling and benchmarking tools, use vertical partitioning of tables (this is one I don’t think of enough, generally), use indices correctly (i.e. where they’re needed). All in all, pretty sound advice and a pretty good blog. These tips may not be much good for you if you can’t change the schema you’re using (i.e. you’re in maintenance-ville like me currently, sigh) but still, I’d bet that by benchmarking and profiling all the queries you could find the slowest ones and improve them somehow.
http://humani.st/scalable-web-apps-erlang-python/
Mentions mochiweb and how py+erl helps solve multiple problem domains and over multiple languages. Interesting stuff, for reals.
The article is here, and the gist is here:
The ability to use different languages when they suit the task at hand is a sign of a good coder. The more languages you learn, the easier it is to pick up a new one. Eventually, you start thinking of every new language as just a set of modifications to a language you know already. So what languages should you learn that will help you to quickly build up the set of basic concepts and let you pick up other languages easily? The rest of this article contains my answer to this question. Note that I’m not necessarily advocating using any of these languages for a real project, but I believe that learning them will make you a better programmer in whatever language you do use.
So what does he recommend. Pretty usual suspects for the most part, with one exception:
- C (standard)
- Smalltalk (yep)
- Lisp (yep)
- Erlang (newish, but MP and Concurrency)
- Haskell (I hear this a lot, maybe that’s where I hang out though)
- Prolog (this one stands out)
It’s also worth remembering that you don’t have to use a language to benefit from knowing it. If you know assembly language for the processor on which you’re working, this knowledge will help you in writing high-level code, since you’ll be able to keep in mind what’s actually going on when you execute your code. Similarly, familiarity with a higher-level language will help you to write better-structured code in a lower-level language.
I’d agree with that. The little bit of Lisp and Erlang that I learned have helped me (and frustrated the hell out of me when I have to maintain old semi-OOP legacy code) immensely in thinking about problems and code structure.
I think Python is ok. I’ve come around, I know I trashed on it a little, but I scribbed something up today to calculate my hours from the lame way that I keep track of my time on freelance projects and I thought: hey, this really isn’t so bad. I still like Ruby a lot, but the “one true way” approach has some real advantages: it’s easier to remember API stuff. And I can learn all kindsa new languages (as long as they’re not functional ones, the Erlang/Lisp thing is still kind of intense for me), but I really can’t handle too many APIs, so it’s nice to look through the docs see the one way it’s done. One real oddity is that Python doesn’t support ++ or –. I’m sure this is something that new python users always comment on, I’ll join in on that chorus as well. But other than that, I liked it a lot. A lot of the things that I liked about Ruby with a little (or “a lot” depending on what you’re talking about) more power to it.
What was I writing? Just this:
import sys
import re
def calcHours(fileName):
fileIn = open(fileName, "r")
p = re.compile("[\d](?=hr)")
hrSum = 0
for line in fileIn:
hrSum += int(p.search(line).group(0))
fileIn.close()
print hrSum
#grab from the args
calcHours(sys.argv[1])
Nothing special at all, but it was kind of fun, and very easy, and after spending my nights and weekends working with Sphinx and C++ (more on this later), I’ll take a little fun and easy any time :)
I also realized what someone meant when they said my recent articles are getting clobbered. Fixing that right now.
It’s here. Enjoy.
- edit
Totally messed this up. Put the wrong URL and didn’t explain what lm3g2dmp is for. It’s a helper for training models for voice recognition using the Sphinx voice recognition system from Carnegie Mellon. It didn’t compile on OSX, so I fixed it up a bit so that it would. Hope that helps someone.
now they’re in DC, in addition to Philly and NYC. Nice’d
I just got this comment:
Hi, nice site! I couldn’t find an email otherwise I would’ve emailed you: Your ‘recent articles’ content is somehow getting clobbered by your page contents. FYI! :)
I don’t see it on FF or IE. Do you?
edit:
I really should have linked to nycresistor I was there tonight and learned a lot, laughed a lot, and had some cupcakes.
Ah yes, the video of the Erlang talk. Already there are two really excellent videos out there, now a third by Bob Ippolito of Mochi, who I interviewed with once, and with whom I probably should have pushed a little harder for the job (i.e. come back to the US for a real interview). But I didn’t. Sigh. Anyways, it’s an excellent talk.
This is pretty intense. As is this (if only I completely understood it, I mean, I kinda get it, but not nearly enough). It’s already patched anyways. Now, according to this, getting at that vulnerability was really tough, and the way the guy did it is pretty neat. I’m sure the Silverlight promoters of the world will be all over this.
DIFM being do-it-for-me from emperor linux versus DIY do my own and just do it myself. What should I do? Save myself prolly a cool grand but I’d put myself on the forums…So, what do I do?teen in tights
lolita toy
nude erotic
scranton facial plastic surgery
massage miami school student
bondage sex rape
teen first anal
mil hun
Asian Slits-2 CD-1
free paris hilton porno
sexy gangbang
hardcore pantyhose
amature video blog
whip pain bondage tgp brazil
girl give me head
beastiality men
nun sex
girl using toys
big tits public sex
busty blog
too young lolita
mature old women
penis picture
lesbian cartoon
sleep voyeur
Supercore-Backroads CD-2
baby butts
celeb upskirts
bad girls short skirts
bikini sexy
tickling teen feet
dangerous side effects celebrex
I Dig ‘em in Pigtails-3 CD-1
discounted ladies exotic cowboy boots
office girls wearing short skirts
drunk horny girls
ebony ass clapping porn
teen topanga username and password
navicular foot vascular supply images
rich boy good things
big tit secretary sex
hentai cartoon
indian sluts
free male celebrity sex tapes
teen femdom
monsters fucking
costume jewelry stud earrings
bi sixuual strapon
squirt mouth
black facials
natural penis enlargement excercises
amateur pussy pics
free midget porn
slutty chicks
squirt lessons
black chick fucking
hidden toilet vids
Anal Massaker-4 CD-1
erotic fairies
wife hidden cam
tight black ass
briana banks lesbian
used toy haulers
lesbian swallows girl squirt
boys in white briefs
ebony masturbation
first time virgin sex
throat infection
hello kitty gothic lolita
olsen twins hot
official military personnel files
hardcore throat jobs
Volgari Punizioni Anali CD-2
paxil withdrawal side effects
anal sex shemale
shit asian
free streaming erotic video
incest post
ebony throat job
secretary sexy sucks boss dick
pink teen lips
drunk vip girls
school girl sluts
nude japanese schoolgirls
boys spanked
ebony spankings
hard money loan personal unsecured california ca
korean girl girl
indian girls sex
Big Boob Party-4 CD-1
fat men masturbating
destin log
venus pornstar
jizz swallow
birthday party for ninety years old
sexy lesbians kissing
5 inch rubber deisel intake hose
boys taking showers
free lesbian porn movies
dog lover tee shirt
aldine isd tax office
cfnm free video clips
my girl korean tv series
cheerleader strips
twinks pics
handjobs magazine
ballhoneys please fuck my roommate wmv
skinny myspace layout generator
naked coeds hard core
sex with teacher
romantic erotic stories
deep river mp3
females with hairy arms
tiny titty
slutty teen cheerleader
milf interracial
better ways to masturbate
moms that fuck young men
free live sex
pantyhose hentai
deep vaginal contractions at 35 weeks
personal fitness trainer jobs tampa florida
young teen thongs
lesbian dildo fucking
phx zoo
girls tied in bikini
sexy toys
hot blondes in stockings
slutty sammi nylon blog
ex wives
Naughty Nanny CD-1
ebony milf porn
thick booty black girls
asia brazil whore cum bitch fuck
sexy nude celebrities
anorexic girls
rachel weisz paparazzi
teachers pet hentia
camping sex
pregnant xxx
huge dildo monster big
sexing chicks
milf ruby
free gay sex galleries
shower boobs
free foot fetish chat rooms
reality tv nudity
verizon lg vx3300 download realtones
ex-girlfriend oral sluts
femdom spit
bukkake video clips
virgin asians
anal facial
galleries teens bbs
archos 504 personal media player
sexy piercing
coloring pages for adults
boy cam
local adult chat
brasilia brazil travel fly dirt flight airline flight
Turns out the end of June/beginning of July is a really bad time to go to Switzerland. Not only am I missing a friends wedding (they call ‘em save the dates because you send them like 8 months in advance!!) but I’m also missing the eyebeam OF workshop. There’s a lot more info here:
http://eyebeam.org/production/onlineapp/join_detail.php?program_id=472096
The general gist is this: The two week program, a hybrid workshop and exhibition, takes place June 26-July 12, 2008. In addition to the workshop, Interactivos? encourages deeper exploration of the chosen theme through lectures and local events led by some of New York City’s finest. Interactivos? New York was initiated by current R&D OpenLab fellow Zach Lieberman, and will be curated and produced by Eyebeam staff, fellows and residents. They’re looking to put together teams of Artists, engineers, musicians, programmers, designers, architects, and hackers, Interactivos? seeks a set of previously unrealized projects for collective interdisciplinary development.
The theme of this workshop is centered around exploring the tension of real versus fake. What is authentic in the realm of the digital? Can something be so fake that it moves into the realm of the real?
deadline for project proposals is April 25, 2008.
applicants will be notified May 15, 2008.
Sigh…I’ll be from CH just in time to catch the end of it, so I’m definitely going to try to help out with what I can, but it’s super-sad. I’d love to be a bigger part of it. However, my loss is your gain. Go for the gold. If you’re in the NYC area there’s also an OF knitting circle this Saturday which I also can’t attend as I need to check out apartments, though I might swing in to the end of it.
I’ve heard some rumors about this in the last few days. Very similar to EC2, which brings up some interesting thoughts: I, as a developer, theoretically working on a very large application, do not any longer need an IT department. I just need a google app or EC2 account. Which is interesting to see how it’ll play out. Google App Engine
Check it out here: willough by baltic : Robotics for Artists. As it says: Want to make art pieces that are interactive? Ready to take your kinetic works to the next level? Or just want to learn the basics of robotics? Well then here’s your place. There is also, on the 19th of April, an Arduino users group meeting that will include. Pretty damn sweet, eh? It’s going to include David Mellis who (name-drop name-drop) is one of the people working on the core project. So that ensures that you’ll get some solid info. Were I still in Boston I’d check it out. Hell, I might go check it out anyways.
On another note I found a really fantastic article on mapreduce at hamlet darcys blog which includes a groovy description of the implementation of mapreduce…
Does it sound so great? Probably not as described here. The real benefit is when you have multiple processors and multiple machines that are each able to do a portion of the work of the mapFunction. If each visit to a dictionary entry takes one second, and there are 26,000 words in the English language, then this mapReduce is going to take over 7 hours to perform. But if you have 26,000 computers that can each analyze a single word, then the problem takes one second to solve (plus the overhead of distributing the work, of course). That does sound great.
And that’s why I like the erlang version a wee bit better, but that’s just me ;)
See, it’s not April Fools day so I had let my guard down, and I browsed over to his blog, and then drooled some coffee on my desk. You can check out why here. So there’s that, but then there’s also that I’ve just installed the Silverlight beta 2 and compared to getting Silverlight 1.1 installed it was pretty easy. Why do that you ask? I’m glad you asked. I did it because it’s out there, and because I’m kind of curious. It really wasn’t too painful, though the only site I can use to check whether it’s working is the silverlight install site I think. What’s the appeal of Silverlight to me? Um, it’s limited, but I like C#, I’ve always said that, the first ‘serious’ programming I did was in C# (i.e. getting paid, big project, etc) and it’s always had a special place in my heart even though I barely use it any more. I still find doing humdrum tasks in it very easy, and the idea of being able to properly use it to create an RIA rather intriguing. Now, I don’t know whether that’s really going to pan out. I’ve glanced at the Silverlight docs, seen some ok stuff done with it, and thought, “maybe that’ll work”, but I have no compelling reason to use it. Begin semi-unprofessional side note: actually, as soon as I punch out at the end of the day I compel myself to write C/C++ on OSX but that’s another story (see below), most RIA based things are monetarily compelled for me, so that’s probably what would compel me to start learning it. And it being MSFT at some point or another money will start flowing. End semi-unprofessional side note. However, the ability to send “data objects”, aka, your VO, straight from service layer to client (ie no ‘registerClass’) is exciting as is the possibility of having real control and power in a mobile device, and you generally can’t argue that the full integration that MSFT provides from DB to Client is nice. So those might all be good things. But I really don’t think this will do anything all that much different than you can do with an intelligently constructed j2ee/Flex-Flash application. I’m seeing lots of chatter about Silverlight and I suspect it’s because (hate me now) it’s new and when things are new there’s a bit of a market void which allows people to benefit financially from whatever small amount of knowledge they have. There are a lot of Flex experts, there are exponentially more Java experts, this means that you are not that special and valuable as a Java expert as you are as a Silverlight expert (let’s just ignore market demand and assume that at some point it will arrive). Maybe I’m wrong, maybe everyone (by everyone I mean the development community) really is excited about Silverlight because it’s gonna be awesome, but I’m a skeptic.
Continuing on the .NET track I seem to have started here, I’ve been reading up on Subsonic, which looks really great if you’re working on a .NET based project (note, and I like this, Subsonic also supposedly works with MySQL, though I don’t know how well).
On another note, there have been some complaints about the AS3 Bible, and chapter 27 in particular. There is a class missing from the code posted there and it is my fault. Yes, I take the blame. My bad. It was just a button that dispatched an event and I left it out thinking people would just make their own. I was wrong and I got in trouble for it. I apologize to everyone who bought the book and had trouble with that chapter, go to the Wiley site for book and you can get it fixed up, or you can contact me and I’ll do what I can to help you.
Finally, I’m working a lot with openframeworks and liking it more and more every time. I also am getting together the opportunity to really publicize and contribute to that project as well as some other amazing projects. I’ll be asking people for advice and suggestions on this publicity very shortly (gotta tie up a few things first).
blonde handjobs
chubby asian girls
forced gay blowjobs
goat whore
skinny dip girl
used zildjian a series cie vintage ride cymbal
teens in bikinis
mature wifes
naruto fighting dirty
stephanie mcmahon sucking cock
free nude midgets pics
stripped stockings
lesbian sex orgies
snake bite lip piercings
pt reality models
facial video preview
brunette maid fucking
devils own foot infantry
drunk dorm sex
gothic sex slave
bronco bull sex machine
public whore
effects of driving drunk
free lesbian download
big fat ass
hairy bums
free wives gallery
cream sex
free webcams adult chat line
tiffany towers mpeg
gay erotic drawings
girls who swallow forum
free code sexcam
naruto hentai free
instruments of self bondage
hardcore couples outdoors
schoolboy spanking
grannies stripping
shagging beach music lyrics
angel fire wife lovers
hot blondes in stockings
sonny new found glory mp3
handjobs magazine
girls urinating outdoors
hentai cartoon
sexcam gratis
free naked celebrities
cam chat adult face to face
my heart tongue fall out boy
sexy facials
naked coed beach
dick sizes
Supercore-Backroads CD-2
first anal teen
free hand job
pic lover porn granny
the bitch of living
kalamazoo college
bondage mouth ring
naked teen lesbians
lesbian bikini babes
ebony cohf
mil hun
hogtied in nylons
pre teen fuck
lesbian pussy
Manhammer-5 CD-2
free college sluts
anal orgasms
lady marmalade parties
skinny black girls
mature saggy tits
kick boxing gloves
thumb in her ass mouth fuck
hot chicks sex
school sluts
horniest twinks
nude female celebs
what causes strep throat
elvis presley burning love
teenie fuck
chubby girls having sex
lolita toy
burn fat fast weight loss program lose weight tone muscles
pressure treated tongue groove
girl wearing tight jeans
cute sluts
masturbation video
hardcore porn movies
bdsm sex videos
human to animal transformation
pee hole insertion
female erection
jizz on her glasses
brazilian trannies
filipina amateur
milwaukee county zoo ala carte
young bisexual porn
eraser nipples
shower twinks
Naughty Nanny CD-1
dildo domination
blonde amateur sex
free spanking live clips
free sample mpegs of sex
salma hayek nude
big horny brazil
alyssa doll camel toe
gallery of shamrock tattoos
victoria paris fucking
big white butts
squirt mouth
women in tight pants and sheer tops
tit fucking movies
puke on cock
navicular foot vascular supply images
discount latex gloves
plump cunt
tight black ass
latex cosmetic sponges
big tit lesbians
men ass holes
retro slut
illegal extreme preteen sex
thong skirt
redhead maature porn galleries
enema lovers forum
male oral sex
jerk me
sandra teen micro bikini
sylvia boots movie
busty chubby girls
wonder woman naked cartoon
springs creative products group
kikizo games news splinter cell double agent impessions
dominatrix facesit
interest rate swaps accounting
pregnant gyno
public orgies
squirt lessons
Asian Slits-2 CD-1
really funny shit
naughty lesbian nurses
destin log
hot latins
erotic fairies
fuck the bitch lyrics
amateur breasts
fucked hard brunette
fitness personal professional training
free download sex videos
celebrity male cocks
college nudity
cfnm mpeg
fetish swinger
pantyhose hentai
adult thumbnail post
newport beach breast reconstruction
anal cream pie
mature women having sex
They have them all over in Europe, in Milan (because that’s where Massimo is of course), in England, Amsterdam. We’ve got ITP here, we’ve got Eyebeam, we’ve got Zach Lieberman, we’ve got whatever the hell goes on at Pratt, we’ve got Buglabs, we should be able to get something together, no?
Well we are/do: at NYCResistor Not just Arduino, but also circuit and soldering tutorials, GameBoy hacking workshops, parties, lots of stuff. How I didn’t know about this earlier, I don’t know. Maybe too busy writing a book to do cool stuff I guess. I’m going tomorrow. I might even go to the party as well. Should be a lot of fun.
So it’s Adobe developer week, which means they have plenty of presentations going on. I’d recommend checking out the Christoph Conraets on BlazeDS one when they post it up. It was pretty excellent and it should be available in a few days.
There’s also a pretty interesting little article here describing doing a CGI benchmark test in YAWS.
And finally, I got hacked because I was slow updating to WordPress 2.3.3. There’s a vulnerability that allows hackers to add themselves as administrators and then fill your posts with crap. Learned my lesson.
Sometimes framework hacking is about the dullest thing you could do…Let’s say that I have an AdvancedDataGrid with a custom HierarchicalData object that you need to sort according to type. Sometimes, you’d do something like this:
var fooSort:Sort = new Sort();
var sortField:SortField = new SortField(null, true);
fooSort.compareFunction = compareFooAssets;
fooAssetsADG.dataProvider.sort = fooSort;
fooSort.fields = [sortField];
fooAssetsADG.dataProvider.refresh();
private function compareFooAssets(data1:Object, data2:Object, fields:Array = null):int
{
// the sort needs to be Foos, then Goos, then Bazs
trace(" data 1 "+flash.utils.getQualifiedClassName(data1)+" data2 "+flash.utils.getQualifiedClassName(data2));
if (data1 is Foo)
return -1;
if(data2 is Foo)
return 1;
if (data1 is Goo)
return -1;
if(data2 is Goo)
return 1;
return 0 ;
}
and it wouldn’t work. So you’d change the “name” property of the SortField. And it wouldn’t work. Then you’d read through the documentation some more, maybe look at the source for the Sort, see if there was something in there, and it wouldn’t really help that much. And finally after an hour, when you’re kind of cranky, you’d go into your custom HierarchicalData class and change this:
public function getChildren(node:Object):Object
{
if (node == null)
return null;
var children:*;
if (node is myBigDataType)
{
children = new ArrayCollection();
// I just switched these around...duh
for each(var foo;Foo in node.foos) {
children.addItem(foo);
}
for each(var goo:Goo in node.folders) {
children.addItem(goo);
}
return children;
}
//no children exist for this node
if(children == undefined)
return null;
return children;
}
And this works because the SortField doesn’t call the compareFunction if it doesn’t have a name, and for some reason it doesn’t do anything with the compare function even when it does call it. Go figure…I’m guessing I messed up how my HierarchicalData object returns it’s children? I’m not sure…Anyways, this is easier, and it doesn’t involve trying to get all these Sort objects to do what they’re supposed to do, rather than what they actually do (that is, sort on String or Number). Anyways, I feel bad, because I probably wasted a bunch of my clients money just trying to get this one little thing done. Ah, time time time.
On another note, I’m totally stumped why a Mac microphone won’t, that’s right just won’t support 16000hz single channel audio. rtAudio barfs when I try it, PortAudio says it works, but for some reason doesn’t properly, what a nightmare. I’ve been working with the CMU Sphinx voice recognition libraries and OpenFrameworks together and everything was going pretty smoothly until I ran into this. Why do I need 16bit Mono audio you ask? Because the only trained libraries are from 1994 and use…you guessed it 16bit Mono audio. Why don’t I train my own libraries using a more up to date audio format? Well, because my options there are two: read a few hours of text and then painstaking write up a utterance map of each sound I make (i.e. “chair” needs to have a file that has “ch EH er” written in it), or I can pay about a grand to get a DVD of kids from CMU reading the NYTimes and the accompanying sound file. Drag. Hopefully I can figure this out. Or maybe I just need to not use my mac….Dunno. We’ll see.
Alright, I think I’m going to say that Continuum bikes might be the bees knees. Jeff is a really really nice guy, the shop is tiny, everything is honest and well-done, and the vibe in there is nice. I had to get a rim trued, a new wheel, and a new crankset and he set me, gave me some pointers, pointed me to a nice restaurant, and even entertained me while I was waiting. 5 stars in my book:
I also read a really nice little article on Garbage Collection in Erlang as well, which was enlightening.
3/14…Have at it. Do something that may or may not be infinite…well, that’s actually beyond human capacity since an intrinsic aspect of humanity is it’s finitude, but I digress…
Learning OpenCV which I’m prolly going to buy, now that I can really use OpenCV with Open Frameworks and actually build things with it :)
There’s a really great article from Joel Reymont on his blog about adding in outside functions to Erlang. The word out there, that I’ve heard, is generally this is a bad idea because you put the stability of the Erlang VM at risk, but it’s almost inevitable that one will need to do this at some point or another.
From the wonderfully titled website: Lets make robots!
http://letsmakerobots.com/node/17
Another thing I’ve been digging on is this screensaver: http://i.document.m05.de/?p=459 Creepy, but beautiful.
Also, looking to kill a little time? Head to fffound.com It’s like soul parking, just cooler:

He links to my blog, I link to his. What do we have to say about each other? Well, that we’re working (very soon to be worked) on a book together, and that we generally think the other is a swell guy (ok, fine, he thinks I’m a nitwit sometimes, but what can you do?). Todd’s working at Infrared5, home to some of the coolest RIA developers alive/around (those dead not included) among them Keith Peters, Andy Zupko, John Grden, a group in which I have included Todd for some time now. All in all, I’ve got to say, quite an honor to know him.
Now that Flex 3 is officially released, I’ve been noticing a slight upsurge in the number of Silverlight v Flex posts, and I have three thoughts on this that apply to all people whose checks do not say Microsoft or Adobe at the top (of which I am one). 1) This is great, these guys are going to push each other to make better and better products, 2) this sucks, all this propaganda is going to get these products crammed into places they don’t really belong and get corporate politics involved where it shouldn’t be, i.e. project planning and selling to clients, at some point I personally will have to work with one when it’s not a good fit because of someone else’s fanboy-ism, and there’s a fairly good chance that this could get all lock-down-y to try while both sides try to be really “open” while they shut the other guy out, and 3) my god, is yammering on each others blogs really a part of the job description for “tech evangelist”? You know who I’m talking about in particular. I don’t want to pick sides and I don’t want to have to pick sides. I don’t want to pick browsers and I don’t want to have to pick browsers. I don’t want to pick OSs and I don’t want to have to pick OSs. Listening to all these pissing matches makes me wonder why I work with RIAs at all.
I can read this which now perhaps you can too. Pretty good notes.
Here is phun and here’s the video of Phun (awful music)
Runs on Win/Linux, doesn’t work perfectly, but hey, I’m not complaining.
RIP Hardcore Erlang. My publisher has been notified. I will not be the Erlang expert sought for web apps. Trading systems are my future.02:39 PM January 30, 2008 from web
Well, I guess O’Reilly is coming out with something to fill the void and feed the hype.
I started reading The Structure And Interpretation Of Computer Languages. I made it to page 70 last night. I’m now taking wagers on how far I will in fact make it in this book. I have time to start doing things like this again because I finally finished all my chapters. Hooray for me! Author reviews ahoy.
Because it’s well designed, because it allows you to meta-program, because it’s intuitive, because the core development community around it is pretty cool, because for most, yes *most* tasks, it’s simplest most elegant language to use. Ruby is not Rails. People who don’t like Rails are saying things like: “I don’t like Ruby”. That’s saying essentially, I don’t like the underlying language because I don’t like a framework built in it. I don’t like Java because I don’t like JBoss or Swing or Tomcat or ‘foo’ or ‘etc’. I don’t like PHP because I don’t like CakePHP. I don’t like C++ because I don’t like Boost. Silly. People are making a lot of money doing Rails work. Because people are making a lot of money doing Rails work there is money involved in publicly hyping or bashing Rails. Hence, people will do both. Adding money to discussions changes the discussion. If I say: you can have 20$ if you say this, and 50$ if you say this, either way, there’s 30$ in negative or positive terms hanging over what you say. That makes it different. So it is with Rails. Not everyone is like that, not by a mile. The vast majority of people working with Rails are working with Rails because it’s the best option for what they need to do or because they genuinely believe it’s the best option for what they need to do. The small minority are people cramming it into a place that doesn’t work, collecting consulting fees, selling books, doing all the things that people seem to hat. At least as far as I’ve seen anyways.
That doesn’t have much bearing on Ruby though. Nor does it have much bearing on people interested in Merb or any of the other ways to do things in Ruby really. But things get conflated. So it goes. I’m too young and too naive to have experience with Smalltalk. For me Ruby is the Smalltalk of my time, that is, it’s an excellent, friendly language, that allows eloquence and clarity. I’d rather read an algorithms book in Ruby than C or Java. I don’t work with Ruby professionally, so I don’t care whether people will pay lots of money for it or not or think it’s enterprise ready or think it’s a joke or think whatever, and in a way that lets me be very relaxed about these things. Read Reg Braithwaites blog. He uses Ruby because it’s eloquent. Everything else is a different discussion all together.
Nice use of papervision and a clever use of “useless” data: spamology
Tough call, I know I know. I got 4 out of 10. I recognized Phil Wadler (I don’t know why, I just did, I mean I didn’t think ‘Phil Wadler’, I thought: Haskell guy, but whatever) and David Berkovitz (aka The Son Of Sam). Have at and good luck: http://www.mattround.freeserve.co.uk/files/killerquiz.swf
FSM being the Finite State Machine, also called the finite automata. And why do we need to learn about these? Two practical reasons relevant in my little life. First, all Regex matching is modeled on Finite State Machines. In fact all parsers, XML, HTML, etc, make heavy use of the FSM concept, as does any kind of string matching (for info on this, as well as a pretty coherent explanation of DFA (Deterministic Finite Automata) and NFA (Non-Deterministic Finite Automata) check out this). This leads me to my second reason: since parsing headers and requests is a large part of serving requests and handling protocol requests, it’s pretty relevant to my ‘learn erlang and systems development better’ fantasy. The FSM is everywhere, know it or not, as I vaguely did (thanks to Roger Braunstein explaining how Regular Expressions actually worked in one of those lengthy all@company.com sorts of discussions), and it’s a very under-appreciated but important concept. Usually this is talked about in compiler design, but as Zed Shaw points out in the excellent post/article that I’ve read twice now on his site:
When you design a server there’s several places where you have to control determinism to make sure things stay sane:
1. lexical elements (lexemes).
2. syntactic structure (grammar)
3. semantic meaning and analysis (logic)Typically you see these terms used in the design of compilers but not really in designing servers. The thing is clients and servers do much of the same work that compilers do, it just has to do it dynamically and with malicious user inputs from untrusted sources. Why not leverage the decades of theory and practice in compiler design to make servers more robust?
Zed’s explaining how he uses Ragel for his Utu um, disrupter (?). He wrote a pretty damn cool article that explains what an FSM is, what it does, and why I should be interested (not me in particular, I’m pretty sure he doesn’t much care who I am, but it had that effect on me). It’s a cool article, but all the better because you can use Ragel to generate diagrams of what your little machine will do, and for people like me, that’s a huge bonus. See, like this:
I’m not super interested in Ragel, not because it’s not cool, but because I’m not smart enough to mix and match my tools so much, even if they are the best fit for the job, so I’m reading up on the Erlang gen_fsm method.
Fundamentally the finite state machine, is the following set of relations:
State(S) x Event(E) -> Actions(A), State(S')
This means: If the current state is S and E occurs, do actions A and use the new state S’.
So that’s really it in a nutshell right there. Nothing spectacular, but for anyone interested in making something that serves up information it’s a really fascinating concept. The OTP design docs are pretty damn good as well and they’re right here. Worth a peruse. I’m going to try and write some more on this and write something actually useful after I get out from under this book.
Make Blog Man am I glad I left Boston…still, good to see the kids are still keeping their senses of humor up there ;)
See? I mean, guess he’s been working with it for a while. This is how things really take off I ‘spose. The internet buzz is seriously gathering y’all.
Sometimes you understand why things are the way that they are, just not why it was done the way it was. Let’s take the selectedData of an AdvancedDataGrid. It’s a protected property, which is a tad annoying. It’s also returns an object with one property, the UID of the object in the dataProvider of the DataGrid in which it’s displayed. How’s that you say?
Inside this object is what you really want: the ListBaseSelectionData object. But to get to it, you need to know that’s it’s the value to a key of the UID. How do you do that? You do this:
private function checkFileClick( event:ListEvent ) : void {
var tmp = ( event.target as CustomDroppableGrid).selectedDataPublic;
for(var prop:String in tmp) {
var fdata:ListBaseSelectionData = tmp[prop];
}
Now you get the ListBaseSelectionData and from there, the data object.
They’re even offering a discount to ‘early-adopters’, aka, QA people :) Still, I say it’s worth it.
![]()
By analogy, stealing cars and joyriding does not provide one with an
education in Mechanical Engineering, nor does pouring sugar in the gas tank.
– Gene Spafford, on using crackers as security experts
Guess so: here or /. or more officially. Does this mean anything? Or nothing? I like MySQL a lot though I don’t know enough to have anything to hate about it, so that could be one reason why I’m a little apprehensive about what might change, because all change with it seems bad. Are there lots of things that Sun can do for MySQL, improvements, looking forward? Not so sure. Your thoughts?
I’ll just say, I found the Bicycle Station and it’s pretty nice. No website, but if you just need some pieces or something tuned, they’re pretty friendly and they have some decent frames hanging in the window as well:
View Larger Map
One more small things I’ve figured out. I love figuring those things out in new cities. And seriously, I’ve been trying to write about the FSM, why it’s interesting, and how to work with it in Erlang for a little while now…a little while being like a week. Going slow slow slow.
What I did well:
- used more Ruby and more Rails, which is good for me
- learned more about Apache
- learned more about Linux
- starting using OpenFrameworks more, which means C++, is good for me, especially with OpenFrameworks
- Did a hell of a lot of Flash and Flex…
- stopped using AS2, .NET, and PHP, not that they’re bad at all, I just wanted to stop using them
- learned a pretty good amount about Erlang and started learning functional programming styles (also good for me)
What I did not do so well:
- Hardly touched all my micro-controllers at all
- hardly did any openGL
- didn’t make much art
- Didn’t do anything with Processing, aside from read the book on one of my numerous plane flights
- Did almost nothing in pure C
- messed about a bit with JBoss and Hibernate, but not enough to have any idea what I was doing.
- Didn’t do anything in C# (which is a pretty handy language to learn, seriously)
- didn’t learn too much about systems programming, which is something I really want to learn more about, learn more protocols, etc
ArtSoftware Lots of links but it needs a little bit of love. Go ahead and add some stuff, I did. I put the OpenFrameworks reference up there.
I always seem to find out about these things after they’re over…kind of a drag. C.Stem is:
An event devoted to the exploration of the applications of electronic systems in cultural and artistic fields
and here’s a vimeo from the opening night. All the processing guys seem to looooooove vimeo, I don’t quite understand why, but they sure do, maybe it’s that the encoding quality is so much higher on Vimeo than anywhere else?
I guess it’s time for me to get myself another one for Christmas now that I’m spending lots of time watching these
So starting at 7am in New York on Sunday, I arrived in Black River Falls, Wisconsin at 2pm Monday. It’s one of the most fantastic consolations about working with code, is that when you’re doing something like, say, laying on the ground at O’Hare airport for a few hours, it gives you something abstract and potentially mathematically elegant to daydream about that has little or no relation to what’s going on around you. I weighing whether my present to myself this year should be this workshop:
http://pragmaticstudio.com/erlang/
Go learn Erlang with Joe Armstrong? Sounds good to me. The only problem is that is overlaps a Bang on a Can event that I want to go to: bang on a can peoples commissions and that it’s really expensive and I’d be paying for it out of my own pocket….hmm…so I’ll figure it out in the next few days.
Ok, even though it’s not Ruby 2.0. I’ll take it. There’s an absurdly thorough change listing here for perusing. Nothing drastic. All word on Ruby 2.0 has…well, stopped a little bit. Try google searching for it in the last 3 month, nary a peep. What does that mean? Means everyone was busy making 1.9 I would assume. Am I wrong?
In other news Programming Ruby the 3rd is coming out. Funny side note, when Dave Thomas announced the book he wrote:
Ruby 1.9 is just around the corner, so it looks like a good time to
create a new edition of Programming Ruby. So, I’m pleased to announce
that the Third Edition of the PickAxe has just entered beta.The book’s home page is at http://pragprog.com/titles/rails3
Note the typo’ed end of that URL. Seems like maybe Ruby is inextricably linked with Rails, eh?
Well, I was going to work with WebORB to provide amf based rpc for a Java project but on a word of advice I tried went with Granite DS, integrated it w/JBoss in about a night, and have it up and running now with a simple test project. Should be exciting. Anyone have any experience with GDS for good or for bad? Have any fun, hellishness, joy, using it with JBoss? lemme know if you do, otherwise, over and out here :)
I began having a argument with a company that I had done some freelance work with for around 9 months. I had originally thought that the project would be a 2 month 15 hour a week project that would be a small cool project. I agreed to a small fee for that time. However, the project turned into a 10 hour a week 8 month long haul going through numerous design changes, long conference calls, all the while, my hourly payoff for this was winding down into fast-food worker territory. I keep going with it, thinking that in the end that all would be well. However, finally at a point in October I had to get working on the Flex Cookbook and had to stop the project. Since this was going to come out to about 10$ an hour for me I thought just asking for my money and getting out wouldn’t be a problem. Wrong. They’re now saying they’re not going to pay me the full amount, so I suppose I’m going to have to sue them. I’ve never had to do that before, but there’s a first time for everything I guess.
I spent a few days in Nashville looking at integrating JBoss/Hibernate with WebORB to get Flash Remoting going, as well as getting off the ground with a project I’m going to be working on in my freetime in the evenings (as if I really have any). Once I get that all sorted I’ll put a post up on it. Getting WebORB integrated in particular should be an interesting little side project.
I spent this morning at a workshop and met up with one of the principles of this excellent project Siftables and got to play around a little bit with one of the controllers. It seems like a pretty amazing little project.
I also went and checked out the OpenFrameworks workshop at EyeBeam. I’m not sure what else to say about OpenFrameworks other than: join the mailing list and you’ll see what it’s all about. It really is one of the most exciting projects I’ve seen.
And there’s new Erlang release. Some fairly substantial changes in there.
Well, we’re about 1/2 way done, which means we’ve been going at breakneck speed. I’ve got a few people I want to thank: Ben Clinkinbeard, David Vexler, and in particular Daniel Rinehart for contributing so much to this book and to the Flex community. If you’ve got stuff you want to contribute please do so at the Flex cookbook site.
It’s here at the eswf project and in particular here. Thanks to the guys at Mochimedia for open sourcing this. Makes for some good reading.
I’m pasting this from the Erlang mailing list, made me feel a little less original, but good for me at least that people are interested in working with Flash and Erlang:
a little background: the suggestions from Joe Armstrong for improving Erlang a little:
> 9 ++++ interface to flash using flex 2. Solve the GUI problem once and
> for all as follows
>
> repeat after me: client = flash in the browser, server = erlang.
> Intermediate protocol = flash AMF
drew this response:
This is early information, but just for information we have a very advanced Flash server developed in Erlang :)
(I know you know Joe, as I made a demo ;)
This was something I started working on last weekend, an AMF server in Erlang, doing the encoding into AMF was going a little slow for me. Suppose I should hustle up with it, except that I’m going on vacation all next week, dang. Things move so fast these days man,
Wow, it’s been a while since I’ve hung on IRC channels, but let me tell you, I’ve learned a ton since I started again about two weeks ago. I had a brief romance with IRC a few years ago when I was still mucking about with PHP more, but it kinda slipped away from me recently, even though I’ve been looking into lots of things with super active IRC channels, but it took me a bit to think: “hmm…i’m a little isolated at the moment, maybe this would be good to check out again”. I’ve learned loads. Not to say that I haven’t been witness to some of the most idiotic flame battles you can imagine, but they’ve been more far and fewer than I would have imagined. So yeah, #ruby, #erlang, #rubyonrails, all pretty high signal to noise ratios (in case you’re interested I’m metprof, a nick I’ve used for a long time, since way back in the day when I was teaching parttime at a college and working at a company with the initials M.E.T.) and all worth checking out if you wanna learn more stuff. If there was an AS3 dedicated channel I’d hang there too, but there isn’t one that I know of and plus, I don’t need any more flash or flex in my life :)
this article at the Cooper Insights is definitely worth a glance through
In the software world, anyone who writes code is typically referred to as an “engineer” and this word has lost much of its precision and all of its usefulness. However, it is still the name of the profession by which many thousands make their livelihoods, so discarding it or denigrating it is counter-productive. Instead, I will prepend descriptive words to “engineer” to differentiate between those programmers who like to build and those who like to design. I call them “Production Engineers” and “Design Engineers” respectively. Production engineers are good programmers who are personally most highly motivated by seeing their work completed and used for practical purposes by other people. Design engineers are good programmers who are personally most highly motivated by assuring that their solutions are the most elegant and efficient possible.
Sharpen your interaction design skillsInteraction designers’ motivations are very similar to those of design engineers, but interaction designers are not programmers. Although most programmers imagine that they are also excellent interaction designers, all you have to do to dissuade them of this mistaken belief is to explain that interaction designers spend much of their time interviewing users.
[snip]
First, as stated earlier, we need to segregate engineers who like to design software from engineers who like to build software. Second, we need to give those design engineers a cheap, disposable, high bandwidth, easy-to-iterate design medium that happens to be source code. Third, we need to give those production engineers sufficient design support (both technical and interaction) so that when they begin crafting their masterpiece in the expensive, cherished, obscure, and ponderous medium that is production code, they never have to iterate, back-track, redesign, wonder, or guess at what the correct decision might be as they laboriously erect the huge code ziggurat of which a product of shippable quality consists.
Ok, I swear, I’ll start putting regular posts again, i.e. tech tutorials, etc, soon, but for the time being, seriously, does the idea of “art about surveillance” get mashed up any better than combining it with “surveillance about art” than as it’s done by Jill Miller in “Collectors”?
From January to March 2007 San Francisco-based artist Jill Miller trained with a licensed private investigator. She worked on real cases, learning various components of the profession, from vehicle outfitting to location reconnaissance to moving surveillance (vehicular and pedal). Miller began this project out of her interest in the ways that the legal system protects (or challenges) an individual’s right to privacy. Driven by this curiosity, she learned how to conduct surveillance within the legal limits of the law. Once familiar with the field, Miller (and a team of two artist assistants) executed her own plans for surveillance under the advisement of the private investigator. Only this time, instead of working on randomly assigned cases, Miller turned an eye onto the art world itself, spending six months undercover doing surveillance on the San Francisco art world’s most elusive community: art collectors. Miller estimates she did surveillance on ten houses, focusing on five of them in depth.
The exhibition, Collectors, is an installation of video, photography, text and sculptural elements made during Miller’s six months of undercover surveillance.
And it’s here. Thank you University of Wisconsin.
Some of these recommendations for fighting brain drain on lifehacker are, um, no-brainers, but this one made me crack up:
Reboot your brain with a caffeine nap. University studies show that drinking a cup of coffee and then immediately taking a 10-15 minute catnap gives you an energy boost. This is called a caffeine nap. I’ve found it works equally well for brain drain. (Just make sure you have something to do when you wake up, because you are going to be ready to rock and roll.)
I can’t count the number of times I’ve done this completely inadventently.
This is from the Ruby forums.
Hello fellow rubyists,
I’m sending rough translation of a message posted on the brasilian ruby forum rubyonbr.org. I hope you like it as much as we did.
“Good morning to the participants of RubyOnBr. Yesterday I watched Shairon’s talk on an event. In fact, I didn’t go there to learn Ruby. I’m a psychologist and public servant of the federal government. I went there to watch a friend’s talk. I arrived earlier and saw a guy talking about a human and programming language, the act of thinking, linguistics, grammar, “semiotics”, cognitive systems, and other sciences I had no idea computing studied. He said “you learn ruby without even wanting,” I didn’t understand, and he complemented with an analogy that parodies Descartes “you think on the program, therefore it exists.”
I then asked my son to install the program that understands ruby the “irb,” I grabbed a manual on the internet and started reading, thinking and “programming.” I got very happy for not knowing to program and “playing” of being a programmer, I am 53 years old felling capable, and as the speaker said “expressing the thought on a program.”
I’m only saying this here because I got very excited and reading the forum I saw that programmers can “be humans and nice.”
A hug to all and thanks for this experience.”
Not just “don’t be evil”, how about “just be good”?
So the google factory is starting up on the phone thing based on legal work by Tim Wu (who I just heard of now) and a bunch of notes on what the google factory has in mind for the phone with the Open Handset Alliance. Yeah, the iPhone looks cool, but I’m not paying for one of those things if it requires me to stay with ATT. No way buster. I think I can wait until 2008.
Man, that’s a really great blog post title, if I do say so myself. Could be the plot summary of a post-modern novel I suppose.
I jetted up to Iguazu this weekend and it gave me some time to re-read Programming Erlang and now that I have a better grasp on the basics of Erlang to see what I can really glean from it. My main notes are:
- Tail recursion is a really beautiful thing, simple, elegant, beautiful.
- mapreduce isn’t really all that complex, but man is it beautiful
- setting up true concurrency on multiple cores in a dumb way is really easy, I thinking that setting it up intelligently is far harder, however, even those first few dumb steps are pretty difficult in any other platform
- Erlang gets less ugly the more you work with it. Ruby is pretty the instant you see it. Erlang…not so much, takes some time to grow on you.
- Message passing really is the most logical way to do any kind of serious multicore programming and were I working in C# still, I would take the time to figure out how to do it in the .NET framework.
- Functional programming is really interesting because it models problems in a totally different way than OO programming. This is, to be fair, spoken by someone with pretty much zero experience in functional programming, so I may change my mind once I get some more experience under my belt, but right now I’m really blown away by it
- Communicating with external modules (i.e. C) seems a little bit painful and kind of ugly. It’d be nice to try and make a slightly more simplified library for dealing with this (I know there’s some efforts to do this already)
The falls were amazing, the free time was good, and when I got back to Buenos Aires I got a bunch of emails complaining that the code for the Actionscript 3 Bible wasn’t posted properly. For people interested in buying the book we’re getting the code up there in the next few days, just a little glitch we ran into, no worries.
Eric Merritt is an interesting guy in a couple of different respects to me, one, he’s one of the principles in Erlware, a library of Erlang projects (currently getting an overhaul), and he’s also really interested in language and cognition and the relationship to programming. Lots of really good insights and thinking in here. I can vouch for what working with a functional language (erlang) has done for my thinking: shaken it up, swished it around, changed a lot, made me look at things differently.
what a language allows and does not allow affects how you think about problems. This is an extremely important realization because it means that, with certain caveats, the more programming languages you know the more insight you may have into the solution to a particular coding problem. So, if you accept the fact that languages tend to mold your way of thinking about problems then you can easily see how languages can be compared to these body modification devices we spoke of earlier. If Programing Languages can be compared to these devices then we, the users of programming languages, can be compared to the subjects that undergo modification.
One of the troubling things about being me is that the way that a problem is approached and solved is usually more interesting than actually solving the problem, which makes the routine of programming a little difficult sometimes. But hopefully it’s making me a better thinker, engineering-wise, which would be a good thing for me, since I think ultimately being a good engineer is better for you than just being a good programmer. Or at least, that’s what I’m hoping.
YOU CAN HAS CHEEZEBURGER?
YOU HAS A FLAVUR?If so, you may be the right fit for this Midtown Manhattan Web Design Startup! We are a small company looking for a Senior LOLCode Developer, preferably with at least 1 month experience developing LOLapps. Please send a resume, along with links to any web-based LOLapps you have developed.
KTHXBYE
And they actually posted this on CL NY
Boy oh boy. I love port configuration on two different OS’s. To get started get that port for EPMD (that would be Erlang Port Mapper Demon, not the rappers) opened up. EPMD allows your nodes to communicate with each other over a range of different ports you specify at erl startup. That comes in a second though, first:
iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 4369 -j ACCEPT
Open port 4369, which is was EPMD always runs on. Now start erl with a min and max port number for communication set:
erl -sname "away" -setcookie abc123 -kernel inet_dist_listen_min 4001 inet_dist_listen_max 4001
Now I check that EPMD is running properly:
netstat -an | grep "LISTEN"
and lo and behold I see:
tcp 0 0 0.0.0.0:4001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
ok. good for me! Now onto the local. I’m on my mac, so I can be dumb about this and allow traffic on 4369 in Sharing/Firewall, setting up a new service and assigning it port 4369. Now when I start erl on my mac using:
erl -sname "base" _setcookie abc123 -kernel net_dist_list_min 4001 inet_dist_listen_max 4001
and then netstat, I can see:
tcp4 0 0 *.4369 *.* LISTEN
which means EPMD is up and running and we’re ready to start communicating between nodes. Yippee.
Doubt it…Good that someone really understands working with binary in Erlang. In the little world I’ve been living in binary is usually something you try to avoid working with a ton. Actually, now that I think about, having to put strings to bytes is a design flaw in the language I think. Needs a little time and a little more community involvement to get a little more friendly I think.
Seriously, 6 new releases with bugfixes in the past 12 days. Go fry go! Go reas go! I still have faith in processing and I still have faith in Java. I don’t love working with Java any more and it’s not going to save the world, but it’s solid, it’s familar, and we all know it works, it runs, compile it to native code it’s fast, there’s nothing to be afraid of. Would I rather write something in Ruby or Java? Depends on what it is. For myself I’d pick Ruby. For the project, I’d probably have to pick Java. That’s the way things go. But I digress. Processing chugs along while similar efforts, like the immensely promising openframeworks, seem to get a case of stagnations. Open Source is hard. Really really hard because you have to make the time yourself. Not an easy thing at all. Something I barely know anything about. I always get gummed up with pay stuff and it’s my own fault. Seriously, I swear, when the Flex Cookbook is done, I give my nights and weekend to you OS. I will do something with all that knowledge gleaned from the OS community. Promise.
You wanna unmount your ipod on the terminal. Why? Because something is broken and you don’t wanna mess around too much with it right now. Ok. So, terminal and:
[localhost]$ disktool -l
***Disk Appeared ('disk1s2',Mountpoint = '/Volumes/BASEPOD', fsType = 'msdos', volName = 'BASEPOD')
***Disk Appeared ('disk1',Mountpoint = '', fsType = '', volName = '')
***Disk Appeared ('disk0',Mountpoint = '', fsType = '', volName = '')
***Disk Appeared ('disk0s1',Mountpoint = '', fsType = '', volName = '')
***Disk Appeared ('disk0s2',Mountpoint = '/', fsType = 'hfs', volName = 'Macintosh HD')
[localhost]$ disktool -e disk1s2
Enjoy
If so, this http://buglabs.net/products looks like about the coolest thing ever.
For those who haven’t noticed it or haven’t checked it out in a little while, and who are interested in Flex, check out the Flex Community site. There’s a lot of good information there and we’re looking to get more info in there for two reasons: one, it’s a great resource and a chance to show off your chops and help your people ( yeah, that ‘give to the community thing’, more on that later) and two, your stuff might go into the Flex 3 Cookbook with a full credit to your genius and a short little blurb you can add about yourself. We’re reviewing all the entries and looking for good ones. I have the privilege of working on the print version of the Flex 3 Cookbook with the team from O’Reilly and Adobe as well as with two of my favorite developers and people, Abey George (who doesn’t have a site or blog to link to, hint hint) and Todd Anderson. We’re not putting this out there to try and get you to do our work for us, we’re putting this out there because there’s a pretty good chance that you know something that we don’t, and there’s nothing more fun than learning something new and being able to share that knowledge both in print and online. Sharing that knowledge is important because, as you may know, the more people know, the more good stuff they can do, and the more good stuff they can make with Flex and AS3, the more people will see excellent RIA’s made with Flex and that means they’ll want their project built in Flex, and that’s good for all of us: more work means more bread and more opportunities to work with Flex, no?
So, if you’ve got something you’d like to share, a tip, a trick, something interesting, head over to the Community cookbook site and add it there and make sure to indicate that you’d like it to be considered for the Flex 3 Cookbook book version if you’re interested.
So I’ve been in the house all weekend sick, reading and daydreaming and of course, wishing I wasn’t sick because it’s been raining for the last week and will rain all of next week. Sick as a dog for the two days the weather is nice…bleh. This has given me a chance to read around on some news and find some really interesting and fun stuff.
First up: reading a file in parallel. What’s interesting about this, you ask? Well, it’s a very very fundamental problem: you want to do tasks in parallel so you can take advantage of the hard work of those folks at Intel making you a 2, 4, 8 core processor. And for things like certain kinds of computations, serving requests (especially serving requests), systems managent, parallel processing models fit like a dream, and fit very nicely into the erlang model of “break the problem up, spawn lots of processes, pass messages when you start or finish something”. File reading/processing doesn’t really lend itself all that well to this approach, one process reads the disk, and, well, that’s about the end of your parallelism right there. It would be really cool to be able to read and parse extremely large files in parallel (what Tim Bray was getting at with his widefinder question) and it’s something that, as far as I know now, hasn’t been explored extensively for the nascent Erlang community. Caoyuan Deng has been working at it a little bit and came up with a pretty cool way of approaching this:
pread_file_1(FileName, ChunkSize, ProcNum, Collector) ->
[spawn(fun () ->
%% if it's the lastest chuck, read all bytes left,
%% which will not exceed ChunkSize * 2
Length = if I == ProcNum - 1 -> ChunkSize * 2;
true -> ChunkSize end,
{ok, File} = file:open(FileName, [read, binary]),
{ok, _Bin} = file:pread(File, ChunkSize * I, Length),
Collector ! {seq, I},
file:close(File)
end) || I < - lists:seq(0, ProcNum - 1)],
Collector ! {chunk_num, ProcNum}.
spawn a process to read a chunk of the file and pink the collector with the amount completed. The whole code is here at Caoyuan's blog which is really worth a read for this and for some other things to do with erlang.
One of the things I've been thinking a lot about this weekend, after reading some more of Beautiful Code is this little snippet that I came across in the first chapter (I've been reading it way out of order):
int matchhere(char *regexp, char *text)
{
if(regexp[0] == '/0')
return 1;
if(regexp[1] == '*')
return matchstar(regexp[0], regexp+2, text);
if(regexp[0] == '$' && regexp[1] == '/0')
return *text == '/0';
if(*text != '/0' && (regexp[0] == '.' || regexp[0] == *text))
return matchhere(regexp+1, text+1)
return 0;
}
That’s elegant. Really elegant. And I think that elegance is because of the recursion and the use of pointer math in that last ‘if’. And that’s one of the reasons that I think Erlang looks so good to me and Ruby sometimes too and functional languages in general: recursion is a really efficient elegant way to approach a problem, well organized recursive processing is beautiful to follow through, and list processing is usually one of the simplest (mathematically, I think) ways to deal with most any low-level problem. All hail recusion. It’s beautiful.
The last thing I found today that gave me a kind of ‘wtf’ pause what this: The parallel browser The post says, essentially, that having a lot of low power cores is more power efficient than a single main core and so for phones, the future phones, our future primary computing devices, everything will be parallel, because of the nature of the processor architecture. So, the browser will be parallel. In fact everything on the phone will probably be parallel. Pretty interesting no? Makes getting the basics of parallel programming right now seem a little more important.
== UPDATE ==
I rewrote this post pretty heavily after re-reading it and realizing how completely incoherent it was. Apparently I cannot write a coherent sentence when I’m sick.
This quote from Grant Skinner is pretty priceless:
The one market I don’t want to see using Thermo is the one that Adobe currently seems to be promoting. I do not want to see professional interactive designers building applications with Thermo. I guarantee they will get it 80% of the way done (the last 15% of which will be through sheer hackery), then run into functionality that they simply can’t implement in Thermo. At that point they will hand the now bastardized code over to some poor code monkey like Greg, with the expectation that they can “quickly plug in” the last 20%. The reality is that the developer will either waste a ton or time wading through the gencode (regardless of how good it is), or will simply scrap most of it, pull it into FB, and start coding from scratch. This will lead to the same des/dev friction that I think Thermo should help relieve.
I hate workflow problems. I hate being handed PSDs and spending days on end submitting swfs to developers who look and say “What is wrong with you? This obviously a pixel too high. This isn’t remotely correct.” which sends me back to the PSD with a screen ruler and generally wastes my time and theirs and makes us hate each other. If I wanted to do that shit I’d be a designer. I’m not a designer because I hate doing that stuff. How’s that for syllogistic thinking? If there’s a tool that will help me out, then I’ll take it and not complain a bit. But is this going to put me out of business? No, it means I don’t have to do crap I hate doing anyways. Ok, enough ranting. What should Thermo be doing? Fixing this problem. It’s a problem at EVERY company. It’s a problem in the schizophrenic minds of the very few people who really are designer-developers. Every time you get a design and you have to code it, something is going to get weird. No way around it. Minimizing the weirdness is priority #1, especially now that doing Flex development means integrated w/Java, Javascript, AIR, whatever else. If I’m a developer on a big project I probably want to make sure I’m architecturally sound, scaleable, bug free etc. Pixel perfect is low on my list of priorities.
On another note, after reading the Tim Bray blog post on the Erlang string grepping problems he was running into I thought, what’s wrong with this:
-module(ecr).
-export([call_ruby/3, send_ruby/2, start/0]).
start() -> spawn(fun() -> loop([]) end).
call_ruby(Pid, F, M) ->
Pid ! {self(), os:cmd(io:format("ruby ruby_proc.rb ~p ~n", [F]))}.
send_ruby(Pid, M) ->
io:format(" received ~p ~n", [M]).
loop(X) ->
receive
{From, {F, M}} ->
call_ruby(From, F, M),
loop(X);
{From, {M}} ->
send_ruby(From, M),
loop(X)
end.
is this some kind of sin? Because I’d do it in a heartbeat. Actually, I’d probably write a C script to do it, but since Tim’s example was in Ruby, I’ll stick with that. Purity is nice, great ideal, but when it comes to time to get something really working, I’ll go with a mutt any time.
==UPDATE==
Or so I thought until I actually read Tim’s original problem again and realized what he actually wanted to do: parse 10 gigs of log files. Ruby won’t really cut it on something like that. You want to do that in parallel. My bad.
I love cookbooks/recipes books (pick your company). I figured I’d just come right out and say that before anything else because I’m really prejudiced in favor of these books, so unless they’re really terrible (I can’t think of one I didn’t like at all, but there are some that have been a little lacking) I like them. That said, this is a really good set of recipes, lots of things that I didn’t know how to do (especially view related stuff and Rails internals related stuff) and stuff that I was doing acceptably, but not in the best style (Model, Unit testing stuff). I feel ok with Rails, fairly comfortable with a lot of aspects of it, and incompetent with other aspects of it and this is inevitable, but I think I know enough to not need the basics and Rails Recipes skips the basics and goes right for the stuff that’s really useful, tricky, unintuitive. That’s what you want from one of these. I’ve been thinking a lot about the whole ‘level of detail’ thing because I’m working on a cookbook (that could be with a capital C) right now and I’m trying hard to find the best level of detail for it. Fowler gets it right, I have to say, it’s an excellent book and an excellent collection of recipes and info for anyone interested in learning more about Rails and getting more out of their development experience with it. There’s another pretty good cookbook for Rails out there (Rob Orsini’s Rails Cookbook for O’Reilly) but I have to say I think I prefer this one. Worth the $20 for the download (getting anything shipped to be in BsAs is a truly hellish experience, but that’s another matter entirely).
There’s a lot of noise about Amazons s3 service in, well, Rails-world. There’s a AWS library that’s a cinch to install and get started with (you just do ‘gem install aws-s3′ and off you go) and people seem to be using for just about everything, but I haven’t heard much discussion of it on the MXNA list (still my primary list). It’s something that, it seems like, any smaller company would want to look at for image/video storage or at least that’s what I’ve seen people use it for so far. If you have any AWS-S3 experiences let me know, I’d be really curious to see what people think of it.
A really nice list of 77 resources to simplify your life as a designer or as someone thrown into occasionally doing some design or as someone who fears ever needing to do any design because of your lack of aptitude with it (the last would be me).
Remember the Rails vs PHP post I was talking about yesterday? Didn’t take long for a analysis in the form of a rebuttal, or a rebuttal in the form of an analysis. One of the two. Here.
Nice to get OpenCV working for the processing crowd. Thanks Jaegon and good work. Check it out here
Derek Silvers wrote a really interesting post on Rails and PHP that got me thinking about three things:
1. You should play with a framework, work with a framework, and learn a framework, for a long time before you decide to use it in a project.
2. Sometime a language makes all the difference in the world, sometimes it doesn’t. I love Ruby, it is the best designed language I’ve ever come across. That doesn’t mean I want to use it for everything. I don’t like PHP. That doesn’t mean I don’t use it.
3. Frameworks are built to give people things they might need. That doesn’t mean the framework is necessarily for you and it doesn’t mean the framework has everything you need and it obviously means the framework has a ton of things you don’t need. I’m not against frameworks, I’m just aware of what they are.
Rails is amazing and I love it and I’m dying for the day when I get to start working with it for real. However, that doesn’t mean that I would use it in the wrong place.
Speaking of wrong place I read a really interesting post on design and fit and appropriateness, where the writer says to Erlang, quite humorously:
I like you. Really, I do. But until you can read lines of text out of a file and do basic pattern-matching against them acceptably fast (which most people would say is faster than Ruby), you’re stuck in a niche; you’re a thought experiment and a consciousness-raiser and an engineering showpiece, but you’re not a general-purpose tool. Sorry.
Erlang gets a lot of attention because, as this guy points out quite rightly: “The one thing that Erlang does right is so important that I’d like to get past its problems. So far I can’t.” And that’s a really valid point. The thing is, it’s a language that was designed to do telecom apps and distributed node processing, and nothing else. It isn’t really an engineering showcase, it’s a fairly new-to-the-rest-of-the-world language that came from a very specific field and that means that it really doesn’t do a ton of other things well. Some parts of it are really well designed, some aren’t as ready for prime time. That’s ok. I wouldn’t start using Erlang in a project right now. When I learn it better I’d like to try and help contribute to some of the areas that it’s lacking. The thing is, the guys right in this: the one thing erlang does right is so important. Sort of like an Indy 500 car, useless for getting groceries, but…you know. And I understand the complaints: this is supposed to be the really hot new thing? Why can’t I use it for more stuff? And that’s the catch and the challenge with it and I think, since I’m not really bound to and don’t have anything invested in it, the really interesting thing: what will happen with this? Everyone has been talking about this thing, now people are starting to use it, some people are loving it and an equal number aren’t. This is kind of inevitable. It’s not Java, it’s not Ruby, it’s not Python. It’s not a general purpose language right now. Will it be? Probably, because like the guy says: the one thing it does right is important.
Are you kidding?
Guess not. Man, I hated lingo with a ferociousness. I made a 3d game in it, one of the first things I programmed, and it was absolute hell (probably compounded about my inability to differentiate between any of the different programming languages I was learning (at that time C++, lingo, and AS1, I know, weird)). It could be great. I have a feeling it won’t be though, but maybe that’s my inner pessimism, I really thought it was getting phased out.
Very annoying that this:
<guid>tag:blog.leetsoft.com,2007-09-13:4265</guid>
is inserted into some (all? I don’t know) feedburner feeds, particular in my case for planet ruby on rails which i love to read, and cannot w/o browsing to the page and clicking on the links b/c PROR, unlike feedburner, can generate a page that my browser can use. Seems pretty commonsense no? In feedburners defense google reader works fine with this, but I don’t care because I don’t like using google reader. I like using my browser and checking feeds that way :( Commence pouting.
You know capistrano and so do I, in fact, you may know it a lot better than me, and because I don’t know it as well as you, I’m attracted to things like webistrano. After watching the screencasts though and looking through some of the documentation I realize that webistrano just helps you keep cap files and recipes organized, not actually creating them. You still have to read the documentation for that :) (I’m not being serious at all in implying that this is somehow a bad thing). It actually looks like it could be a very nice tool for keeping deployments organized and logged, but I wonder how it would work with more complex recipes (not like I actually know how to do anything particularly complex with cap recipes). Still, I think it might be worth looking at for people interesting in working with capistrano but without a clue where to start.
webistrano
webistrano mandatory screencast
On another note I spent a bunch of time today trying to get my slice on slicehost set up to be be an active erlang node to communicate with a node on my lappy here and it’s been going a little rough. I not trying to do anything complex, just a little something to get my feet wet with making a simple distributed app with erlang. I’m kind of bouncing between the ‘Programming Erlang’ book and the documentation to understand how this works. Setting up multiple nodes on my computer was a cinch, but getting multiple nodes running on multiple machines, (one of the jewels of erlang) is a little trickier, not so much on the erlang side, though you do need to pass ‘cookies’ around, which is a little different, mostly just getting the nodes setup correctly to accept and send messages. I was a little bummed when I was setting up OTP-R115B this morning to find that Hipe wouldn’t compile on my slice, so I had to ./configure w/o hipe and work with that. There’s a floating point problem in there apparently (at least this is what I gathered from digging around in the mailing lists)…drag. Also, make sure you have make, automake, and of course, everything in the README, before you compile (perl5, gcc, openssl).
I’ve never been a huge Javascript fan in the sense of enjoying working with Javascript. I respect what it can do and it’s an integral part of, well, almost everything at this point, but I’ve never enjoyed actually working with it. I don’t blame javascript for this, I blame it’s platform, or platforms and in particular I blame Microsoft. To be fair I haven’t played around with IE7 a lot so I don’t know if it plays more nicely with CSS and JS, but that’s beside the point. A few months ago my friend Andrew Rodgers, showed me JQuery and I was pretty impressed. Working with Rails means working with Prototype and I’m totally fine with working with Prototype, but working with JQuery is, well, fun and really pleasant, the same way that working with Ruby for the first time tends to be really fun and pleasant. Things work as expected, you spend less time thinking about language specifics and more time thinking about implementation specifics, which is good.
JQuery 1.2 comes with a few pretty nice additions. I like the map() and slice() methods particularly because they allow you traverse the DOM more easily, which is something I’ve always had a lot of trouble with. Generally my options were thus: try to ‘id’ everything (hopeless), write bad code to get the elements, change them, and get this crap over with (lame). Not that you can’t write bad code with all the JQuery traversal tools, but it helps you keep things cleaner, and in my opinion cleaner is better. Something like this:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function buttonClick(){
var output = '<data><node>'+$("input").map(function(){
return $(this).val();
}).get().join("</node><node>")+'</node></data>';
}
</script>
to output some quick and dirty XML is a breeze. There are a ton of apects of the JQuery library that I haven’t even thought of touching; jQuery.noConflict( extreme ), plugin development, I don’t know how efficiently the effects run when there are a lot of them, lots of practical things that I would know if I had spent some serious dev time working with it. However, the nice thing about JQuery is that the fundamental DOM traversal, event handling, and array functionality is, well, pretty intuitive, and these are the things that I spend the most time doing. So the newest release adds a few new things, comes in three sizes (micro, small, normal) and is generally, I’d say, my fav. And for people in Boston, this is from the JQuery blog:
We’re going to be having the first all-day jQuery mini-conference October 27th, here in Boston, MA. Already, a large portion of the jQuery team will be attending and giving talks – so if you’re interested in meeting some of the people who’ve helped to make jQuery possible and chatting with fellow developers, then this is a fantastic place to do it!
So, you know, that might not be a bad thing to check out.
Ok. Here it is:
And something not so goofy, but far more worthwhile:
How YouTube scaled. Pretty interesting. I mean, it’s something I’ve always wondered about.
Why? Cause it’s simple, it works, and it’s free (as in I love you guys so I kicked you 10$). Check it out
– edit
Now I take it back. I’ve heard lots of people are having problems with it. Two years ago it was great, now, well, maybe not so much. Please take note.
Exciting? Yes? Really easy? Not so much, but possible on a distributed system.
A very nice and interesting post on one of the more exciting things about Erlang, which is live code replacement, right here. The author very rightly points out that on a multinode system live code replacement is far easier than on a single node system. I’m really trying to not get away from studying up on Ruby, Rails, and Erlang, even though I’m most certainly stuck in a Flash/Flex cycle for the next few months at least. That’s all I can really say about that at the moment, but I’ll explain more later. Nevertheless, if I let Erlang and Ruby slip away from me, I have a feeling I’ll regret it for years and years to come :)
This is quite interesting: a language with 118 words called Toki Pona, invented by a Canadian linguist who was in a deep depression and decided to create a simple language about joy and happiness. It’s a really fascinating exercise and has a certain amount of relevance for any programmer who’s considered creating a language (not me) or who has developed an API for other people to use (that’s me): it has to be somewhat intuitive, it has to be flexible, it has to allow a certain amount of creativity, and it has to allow the people using it to function effectively with it. Toki Pona apparently does all these things, looking at the word list is kind of a mindbender considering the number of words we have in English (several hundred thousand) but you can get a feel for the way that constructing thoughts would go in Toki Pona, lots of verbs used as adjectives, lots of somewhat imprecise descriptions of things, lots of cute sounds.
Settling into my new house and city and country and language, a not insubstantial task let me tell you. Also, relaxing a little bit. I was working lots of really long weeks for a while on the Actionscript Bible, teaching, freelance, and work at my regular job which burned me out and took quite a toll on my personal life. Luckily, I don’t know anyone here and so don’t have to worry about the toll on my personal life :) Now I just need to catch up on 3 weeks of blog posts, news, discussions, and all that. Should be a cinch, right?
I’m pretty excited about the xmoov streaming FLV via PHP update that got posted. I haven’t had a chance to try it out fully yet but I’m going to figure something out. Probably, once again, clear off my Slicehost and start over with it, which is almost as much fun as actually putting anything on it :) The xmoov player is here and a demo is here
I’ve added a different place where I’m going to put photos, stuff in my crappy castellano, and other ephemera of my life. It’s here.
And lemme tell ya, I wasn’t just swappin apartments. No sir, I went to a whole different continent. Hola Buenos Aires, estoy aquÃ, muy cansado, pero aquÃ. Now, voy a comprarme pasta dentifrica (toothpaste, that is, I had to look that one up).
I started writing my ring benchmark last night (for those interested check out p.139 of Programming Erlang). I’ll put the whole problem here:
Write a ring benchmark. Create N processes in a ring. Send a message round the ring M times. So that a total of N * M messages get
sent. Time how long this takes for different values of N and M. Write a similar program in some other programming language you
are familiar with. Compare the results. Write a Blog and publish the results on the Internet!
I made the ring in Erlang, but I’m not sure what else to make the ring in…what do I know well enough to really do justice to? C#? Ruby? Joe himself did Java here on a (at the time super amazing) PII processor. On my Mac I spawned half a million threads after adjusting the memory allocated to the Erlang VM in about 40ms (I’ll have to run this again to check, it was something I did to pass the time on a train to NY) so I’d be really curious to see what the performance would be on for the ring on my dual core 2.66ghz MacBook. Now that I think about it, I’m going to do Java too (I’d do C# but I gave up my Win machine) when I get done packing, Ruby results would be kind of a no-brainer. I’ll post the results a lil later.
Your request to reship the PDF for Programming Erlang has been entered into our fulfillment system. Teams of PDF-aware gerbils are this very moment limbering up to deliver your content.
Once they’ve finished, and we’ve cleaned the sunflower seed husks off your document, our system will be sending you an e-mail containing the download link.
Given the current backlog, we estimate that the time to create PDFs is about 1 hour. Please contact PragProg Support if your PDF isn’t available by then.
Return to the main book page
Getting Ruby and Rails setup on your Mac is super simple because you can use MacPorts, however, if you, like me, know little to nothing about bash, then remember: if you want your macports install of good Ruby (i.e. not 1.8.2, but 1.8.6) to run properly on your Mac, change your /etc/profile like so:
# System-wide .profile for sh(1)
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
to
# System-wide .profile for sh(1)
PATH="/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
Now, this does mean that anything that you install via MacPorts will be available to all users, but hey, who’s worried about that? Right? And, installing all kindsa wierd stuff via MacPorts is a cinch. And anything that makes wierd stuff a cinch (Erlang anyone?) is a good thing in my book!
A Boston icon, Mister Butch, has passed on as a result of injuries from a scooter accident. From the Globe or from Neatorama. Of far less consequence, though still sad for me, my bonsai tree has passed on as well, or, well, become permanently dormant.
Despite all my best efforts to keep this a work and programming only blog, I keep getting off topic. I suppose it could have something to do with being busy and ready to move. I know that there are tons of DJs out there doing really great work, but is there anyone better than Diplo? I thinks not. That man should be sainted not only for bringing the best music in the whole wide world together, but for making it sound so absolutely amazing. If you’re at interested in the world of music and not only the culture but the history behind music from Brazil, Angola, Cuba, Paris, NY, Israel, please go check out maddecent radio. This is, without a doubt, one of not only the best, but the most important things going on in music right now, and nobody’s doing it better!
I used to love reading about evolutionary psychology and the relationship of language to the development not only of the human mind within a lifetime but within the development of the human being:
According to Dunbar, no such strong correlation exists between neocortex size and tasks like hunting, navigating or creating shelter. Understanding one another, it seems, is our greatest cognitive challenge. And the only way humans could handle groups of more than 50, Dunbar suggests, was to learn how to talk.
“The conventional view,†Dunbar notes in his book “Grooming, Gossip and the Evolution of Language,†“is that language evolved to enable males to do things like coordinate hunts more effectively. . . . I am suggesting that language evolved to allow us to gossip. . For we are all gossiped about, constantly evaluated by two criteria: Whether we can contribute, and whether we can be trusted.
This is from the article on Williams syndrone in the New York Times magazine tomorrow which, if you’re interested, is here
Two thoughts, copy and pasted from the skydeck blog
A lot of frameworks seem to be motivated by a handful of interrelated fallacies:
* Abstraction is always a good thing.
* All applications have common functions that can be usefully abstracted out.
* There are details you don’t have to think about.It is natural and valuable to seek abstractions when programming. A well-chosen abstraction can eliminate pages of similar code, and make the program easier to understand. But abstraction has a cost: it is a layer between you and what is actually going on, so it can also impede understanding.
and second:
The worst possible use of abstraction is as a fig leaf. These frameworks, with their menagerie of strategies, managers, and delegators, seem to ascribe no cost to complexity. “You just write your application,†they seem to say, “and we’ll take care of the detailsâ€. You can hide arbitrary amounts of complexity, confusion, and bad design behind a nice-looking interface. The problem is that it won’t stay there. When your application isn’t fast enough, or you have a bug that doesn’t seem to be in the code you wrote, either you play Black Box, or you dive into the framework code. At that point, the layers of abstraction start to really hurt. Ultimately, there are no details in a program that you don’t have to think about—all programming is detail-oriented programming.
Hmm. So, apart from the silly java bashing (that’s a very popular thing to do right now, btw, and that’s both awesome and idiotic), there’s a very interesting idea in here.
Go ahead, mess it up, cause all you’ve got to do is rebuild it :)
It’s the LogVisualizer done in AIR. Nice. Quit nice.
Check it out here: http://onrails.org/articles/2007/07/03/railslogvisualizer-meets-adobe-air
You can see all the steps of that here at anandtech. I love it when people tear things apart because I always want to but usually am scared to (b/c I’ll probably break it and void the hell out of my warranty). And I always want to know what kind of microcontroller is in anything even remotely cool. From the looks of it it’s an ARM based Samsung controller, very nice and exciting…just looking at this makes me want to pick up some new microcontroller toys to fiddle with.
This weekend I went to the Richard Serra show at the MoMA which was absolutely jaw-droppingly fantastic. In particular “Sequence” which has a walkthrough on youtube:
and the “Delineator” which was just a wonderful and delicate thing (something not normally said about 5 tons of lead). I’m quite happy I went.
(12:13:22) metprofessor: how’s the Conn?
(12:13:36) AndrewRWS006: ferry was cool, hamptons was expensive
(12:13:49) metprofessor: oh right, you went to the hamptons
(12:13:50) metprofessor: nice
(12:13:57) AndrewRWS006: only went out one night there though, then went to Bayport
(12:13:59) metprofessor: you see a lotta really rich ladies?
(12:14:20) AndrewRWS006: yeah, and they were all uber hot, meaning i think we are naturally programmed to be attracted to wealth
(12:14:47) metprofessor: leisure and lack of worry is hot
(12:14:58) metprofessor: hard working stressed out people, not hot
This kicks off my new ‘write more fun code, worry less, listen to more music’. I’m going to have start worrying less because, as I recall from my time living in Taiwan: you have to be in a good mood when you’re stumbling around in your second and third languages. And since my Spanish is not particularly amazing, I gotta lighten up.
It seems now there is some discussion with people wondering about the claims of the author of the “700%” speedup story. I feel like I should try and write up some test but I’m struggling to find good examples of erlang xml parsing that I can hack from since I am still in the ‘pidgeon-erlang’ learning phase (much like someone is when the don’t conjugate verbs properly and talk around words they don’t know in a human language).
Henry’s gone and now maybe Wenger’s going too…good thing I can get wrapped up in going to River Plate games live so I don’t have to suffer without respite the mess that the next season is probably going to be :(
If your friends are like me and don’t have ‘require password on wake from sleep’, do them a favor, set their laptop up with a sweet porn desktop. They’ll totally appreciate it when they go to a meeting with someone else and open their computer. They’ll appreciate it a lot. I didn’t really, but you know, maybe your friends have better senses of humor than I do. On second thought, I suppose it was funny. Yeah. It was funny. Ok.
I spotted this on the erlang-questions list, the hallmark of goodness, a blog entry from a guy who rewrote an XML parsing engine in erlang. 700% speedup. Now there are tons of reasons to explain why that could be, bottlenecks in the original code, or bottlenecks in the original code, bottlenecks in the original code could also be a problem as well :) However I think it interesting where erlang seems to work well for people.
It’s not as easy as you thought it was, is it? Well, if you can use the FLVPlayback component it is, because much of this is taken care of for you. However, if you’re not using the FLVPlayback component in the CS3 library you’ve got a few surprises ahead of you. Luckily, they’re easy to deal with if you know what’s going on.
First, the server; the NetConnection needs to know the name of the server and the application that it’s going to getting videos from. That means that
rtmp://server.com/app/video.flv
needs to be parsed into ‘server.com/app’ and then the ‘app/video’ to call from the ‘server/app’. If you take a look at all the components that make up the FLVPlayback component you’ll see the url being parsed into two distinct pieces. We’ll cover the second of them in a moment.
The server name and application name go to the NetConnection:
var filename = url.substring(url.lastIndexOf("/"))
var serverAndApp = url.substring(0, url.lastIndexOf("/")-1);
var appName = serverName.substring(serverName.lastIndexOf("/"));
if(filename.search(".flv") != -1){
filename = filename.substring(0, filename.length-4);
}
So why clip the “.flv”? Because we don’t want it. Further questions? I point you to livedocs. Now we set up the NetConnection.
var client:Object = new Object();
//this should be familiar enough
client.onMetaData = onMetaData;
//I'll explain this in a little bit :)
client.onBWDone = onBWDone;
nc.proxyType = "best";
nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.client = client;
nc = new NetConnection();
nc.connect(serverAndApp);
All right. So we’re passing in a server and application name to the NetConnection so that we’re pinging the actual application that’s serving up our flv. Now, I’ve cheated a little bit to show what it looks like when we have both a server name and an application that we’re calling but to be safe we’d want to do a little more string magic to ensure that we’re still going to be ok if we don’t have an app name that we’re calling. We also should be checking for a port number just in case. These are things I leave to myself for another time or to you.
The proxyType = “best” is not necessary, but is recommended, in case someone is behind a firewall, just for that extra flexibility. The default is “none”, and why, I do not know.
If you’re like I was you didn’t expect the ObjectEncoding to be set to AMF0. FMS and FCS only understand AMF0 at present. Why this hasn’t been updated? I can’t say. If anyone knows and would like to post a comment please do.
Now, let’s take a look at the listener for the NetConnection event.
private function nsEvent(event:NetStatusEvent):void
{
trace(nc.uri);
if(event.info.code == "NetConnection.Connect.Success")
{
ns = new NetStream(nc);
ns.bufferTime = 1;
ns.client = client;
ns.addEventListener(NetStatusEvent.NET_STATUS, nsEvent);
ns.play(appName+"/"+filename);
video.attachNetStream(ns);
}
}
We have to make sure that we’re only trying to use the NetStream if we’ve successfully connected to the NetConnection. Note that we need to put the application name and the filename. This threw me off for a little while but it is necessary if you’re getting your content served from an application because, if I’m not mistaken, and I certainly may be, the application is in fact just a directory that FMS needs to be able to direct to (I’m getting this from livedocs here and here) This example is obviously crying out for a timer to report that we haven’t successfully connected after a time-out and some friendly user messages, but again, that’s for another time. We’ve got one last unfinished thread:
public function onBWDone(... rest):void {
}
You need to define an onBWDone function because in the classic FCS and FMS set up the server will try to determine the amount of bandwidth that this connection will handle and potentially offer different FLV files based on that. The server will try to call onBWDone and throw a runtime error if it can’t find it since this sort of asynchronicity is outside of the realm of strong typing. You can read about this at the AdobeDev Now, this isn’t to say that this will always be called, but that it’s likely that it will and since it’s like, we should expect it. I’m not doing anything with it, but you certainly could if you wanted to.
I hope everyone enjoyed this and if there’s something in here that I’m being un-necessarily vague about please let me know and I’ll update it and give you the credit. For those interested there is another tutorial here with someone similar instructions, though it includes much more information about dealing with Shared Objects and syncing.
-josh
Ok. So I found out the answer to my question thanks to JabbyPanda
The problem is that the event dispatcher clones the event that it sends along by calling the clone method. The clone method, defined in flash.events.Event, returns an instance of flash.events.Event, unless you override it. This is why the event was causing problems: the dispatcher passes it along by calling the clone method and confuses the listener when the object is of type Event and not SpecialEvent. I should have remembered this! In fact, I wrote about it a few months ago, and still spaced it out.
Let’s look at the modified SpecialCustomEvent class:
package com
{
import flash.events.Event;
public class SpecialEvent extends Event
{
public var foo:String;
public function SpecialEvent(type:String, foo:String, bubbles:Boolean=false, cancelable:Boolean=false){
this.foo = foo;
super(type, bubbles, cancelable);
}
// Override the inherited clone() method.
override public function clone():Event {
return new SpecialEvent(type, foo);
}
}
}
and voila, no more problems. Thanks JabbyPanda!
I’ve noticed some real AS wierdness with dispatching custom events. Let’s say I make my custom event “SpecialEvent”.
package com
{
import flash.events.Event;
public class SpecialEvent extends Event
{
public var foo:String;
public function SpecialEvent(type:String, foo:String, bubbles:Boolean=false, cancelable:Boolean=false){
this.foo = foo;
super(type, bubbles, cancelable);
}
}
}
Ok. Now when I dispatch this from a little dispatcher class, all is well:
addEventListener(MouseEvent.MOUSE_DOWN, sendEvent);
}
private function sendEvent(mouseEvent:MouseEvent):void
{
var special:SpecialEvent = new SpecialEvent("special", "bar");
dispatchEvent(special);
}
and when I listen for it in a dispatcher all is well:
public function set dispatcher(d:Dispatcher):void
{
_dispatcher = d;
_dispatcher.addEventListener("special", onSpecialEvent);
}
//I'll listen for the event
private function onSpecialEvent(evt:SpecialEvent):void
{
//i just want to send this along, but I can't :(
trace("REDISPATCHER::: i hear the special event ");
dispatchEvent(evt);
}
However, when I listen for that re-dispatched special event in a class that has a Redispatcher:
var redisp:Redispatcher = new Redispatcher();
redisp.dispatcher = disp;
redisp.addEventListener("special", onSpecial);
}
//this will listen to the Redispatcher
private function onSpecial(evt:SpecialEvent):void
{
trace("EventBugTest ::: i heard the special event");
}
I get the following error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@1264cf39 to com.SpecialEvent.
I’m just trying to send the event from my dispatcher, through my re-dispatcher, to my EventTestSprite. If you change the SpecialEvent to a flash.events.Event, all goes well. Very interesting. You have to read info out of the event and create a new event to redispatch at every call to “dispatchEvent”. Anyone run into this before? The files are here: eventbugtest.zip
Thanks Mike Bailey, Slicehost, and whoever wrote this tutorial and my advice, earned over a grueling two days? Don’t specify a port for ssh access for security reasons and then forget that you set it. Well, at least that little boo-boo got me a lot more knowledge about my Apache + Mongrel + MySQL setup than I would have needed otherwise even if it did feel like I was chasing my tail a bit. Maybe I shouldn’t be confessing to total space-out moves in the blogosphere…eh, estoy descuidado.
To anyone interested in Argentine indie rock may I introduce Casco. Stay classy…
Man, I thought capistrano deployment was gonna be easy. Not so. I’ve learned a lot about key setup and deprec so far, but still, it’s been two nights spread out over the week and still no love for me and my slicehost. I’m going to look at it a little bit more today and if I can’t get it sorted soon, start posting a lot to the mailing lists.
If you’ve built erlang from source you’ll find this amusing. If not, you probably won’t.
Checking whether the initial PLT exists and is up-to-date... no
Creating initial PLT (will take several minutes; please be patient)
Done building PLT in 39m54.27s
done (passed successfully)
So I finally got my slice from Slicehost! For anyone wanting to install Erlang on Ubuntu (yeah, I’m probably the only one, but just in case) you should do
apt-get install ncurses-dev
and then run ./configure I’m not sure if the SUSE servers need that or not, but the Ubuntu does. Installing Ruby, Rails, GCC, MySQL is a breeze. I got a little trick to figure out with Erlang and I’ll post it as soon as I get it figured out.
This is going to be my extremely simple APE tutorial because APE is there for those of you who need a physics engine and don’t want to spend days digging through documentation. For those who don’t know APEngine is a simple, elegant, and powerful physics engine written in actionscript 3 by Alex Cove. Here I’m going to walk over the very bare bones of creating a particle, adding the particle to the APEngine, and adding a force to the Engine. First, the particle, which has one method of real note right now:
public class Square extends RectangleParticle
{
public var graphic:Sprite;
public function Square(x:Number, y:Number, width:Number, height:Number, rotation:Number, fixed:Boolean, mass:Number=1, elasticity:Number=0.3, friction:Number=0)
{
graphic = new Sprite();
graphic.graphics.clear();
graphic.graphics.beginFill(0xff0000, 0.5);
graphic.graphics.drawRoundRectComplex(0, 0, 100, 100, 5, 5, 5, 5);
graphic.graphics.endFill();
super(x, y, width, height, rotation, fixed, mass, elasticity, friction);
}
override public function paint():void
{
graphic.graphics.clear();
graphic.x = px; // this is the position of the particle
graphic.y = py;
graphic.graphics.beginFill(0xff0000, 0.5);
graphic.graphics.drawRoundRectComplex(-50, -50, 100, 100, 5, 5, 5, 5);/*I want to have the particle in the
graphic.graphics.endFill();
}
}
The paint method is the important one. This is what needs to get called every step (frame or timerEvent, pick your poison) to keep your graphics in the same position as the particle. Here we’re using a Rectangle Particle. The APEngine has two base particles, CircleParticle and RectangleParticle, and methods are provided for circle to circle collisions, rectangle to circle collisions, and rectangle to rectangle collisions. Generally you should stick to either rectangles or circles and make objects out of combinations of them. I tried to make my own special particle and found it far less than pleasant, but hey, maybe you’re smarter than I. Enough of my yammering, back to APE. When you set the height and width you don’t actually move the particle, you just set the properties of the vectors that are used to determine collisions.
Now to my super simple main class:
public class APETest extends Sprite
{
public var sqOne:Square;
public var sqTwo:Square;
public var sqThree:Square;
private var wind:Vector;
private var windChangeTimer:int = 0;
private var _paintQueue:Array = new Array();
//Constructor
public function APETest()
{
stage.scaleMode = 'noScale';
stage.align = 'TL';
APEngine.init(100);
graphics.lineStyle(15, 0xffffff, 1);
graphics.drawRoundRectComplex(0, 0, 1000, 800, 5, 5, 5, 5);
graphics.endFill();
APEngine.container = this;
APEngine.damping = 0.2;
wind = new Vector(0.001, 0);
APEngine.addForce(wind);
sqOne = new Square(400, 300, 100, 100, 0, false, 1);//i'm giving them different masses so they're affected differently by forces
sqOne.collidable = true;
APEngine.addParticle(sqOne);
sqTwo = new Square(600, 400, 100, 100, 0, false, 0.6);
sqTwo.collidable = true;
APEngine.addParticle(sqTwo);
sqThree = new Square(500, 300, 100, 100, 0, false, 2);
sqThree.collidable = true;
APEngine.addParticle(sqThree);
sqFour = new Square(500, 300, 100, 100, 0, false, 2);
sqFour.collidable = true;
APEngine.addParticle(sqFour);
_paintQueue = APEngine.getAll();
addChild(sqThree.graphic);
addChild(sqTwo.graphic);
addChild(sqOne.graphic);
addChild(sqFour.graphic);
var timer:Timer = new Timer(50);
timer.addEventListener(TimerEvent.TIMER, step);
timer.start();
}
//The step event
public function step(event :TimerEvent) :void {
APEngine.step();
// paint every particle and constraint
for (var i:int = 0; i < _paintQueue.length; i++) {
_paintQueue[i].paint();
}
windChangeTimer++;
if(windChangeTimer == 30)
{
wind.x *= -1;
wind.y *= -1;
APEngine.addForce(wind);//this is important - to nullify the wind i need to add it's inverse, the engine doesn't maintain pointers to vectors, so i can't just change the wind
wind.x = (Math.random()/500) * ((Math.random()>0.5) ? 1 : -1);
wind.y = (Math.random()/500) * ((Math.random()>0.5) ? 1 : -1);
APEngine.addForce(wind);
windChangeTimer = 0;
}
}
Note the step event, which calls “APEngine.step();” and the “APEngine.addForce(wind);” where I add a vector to blow these things aside. I keep track of all the particles in the APEngine through the paintQueue to call their paint methods at the same time I call the APEngine.step(). And off I go, checking to give my particles a random wind force every 30 steps or so. It’s nothing spectacular, but it shows off the APEngine. The files are here : Ape Files and when you go to download the APEngine you’ll find a far more comprehensive demonstration to follow along with if you’re interested. Stay happy.
Spotters badge to Gordon Guthrie, who pointed me to http://wiki.trapexit.org/index.php/Category:CookBook with a terse “try the proper cookbook”. Will do. In other exciting news erlang has also been added to gotapi which is good news, raising its profile a little more.
I’ve been slogging away refactoring my Rails app to be “properly” RESTful, utlizing acts_as_authenticated properly, and discovering the wonder of the APE engine. Actionscript Physics Engine is a simple physics engine written by Alex Cove that does just enough to be really useful and be an incredible time saver, without being overbearing, slow, or requiring too much puzzling through API docs. We’re using it thanks to the eagle eye and forward thinking of one Gabriel Montagne, with whom I have the privledge of working. Setting up the standard particles is a cinch, getting the engine integrated with a pre-existing framework isn’t too difficult, and creating specialized particles with custom rendering routines (aka “using the paint method”) isn’t too terribly difficult either. I’m going to put a lil tutorial up here one of these days, maybe tomorrow, if I have a long lunch and feel like writing Actionscript instead of Ruby.
Also, I’m wondering, when we can really integrate Ruby with Erlang, what will people stop doing with DRb? I don’t mean this in a snotty way and I realize of course that DRb will always be useful, I’m just wondering (not knowing a lot about DRb) just what kinds of things in DRb we can replace with Erlang? Or how frequently this will be the right thing to do? I know that from my experience working with distributed apps (limited and strictly with .NET) it’s a deeply unpleasant experience and although DRb is full of Ruby-ish goodness I’m sure it’s not all that much more pleasant than the .NET version of working with distributed apps. So what would we replace?
As soon as I saw the Joe Armstrong book announced on Pragmatic Programmers I knew this was coming. Maybe not this particular ruby+erlang brige, but some kind of greater inter-relation between these two technologies for two reasons. Ruby is great, Erlang is great. Ok. That’s one reason. And second, they seem to fill in gaps for one another; Ruby needs to be able to scale better (i.e. green threads won’t cut it for long) and Erlang could use a friendly string manipulating face. I don’t know much about the Erlang runtime, but I’m trying to learn (I got Programming Erlang in beta and I’ve been slowly reading bits and pieces here and there). Here’s the announcement of an alpha ruby+erlang bridge.
The bridge, called erlectricity, is really, if I understand correctly, message passing from Ruby to erlang and passing binary data back to ruby, (I think). Here’s the quote:
The goal of Erlectricity is two-fold: expose ruby code to erlang, such that erlang applications can take advantage of the breadth of ruby libraries, and secondly, expose the OTP to ruby such that fault-tolerant distributed systems will be easier to develop. Neither of those goals are realized in Erlectricity’s current form, but it is a good base to work from towards those goals.
It’s coming. Should be a fun few months, if I can get away from Actionscript a little more and have some more freetime to work with this.
So, I had a lil conundrum. I was completely redoing a project for multiple reasons with the original intent of doing it in good ol’ RESTful Rails (well, not that old) and then I came across Hobo. For those who don’t know what Hobo is, it’s a RAD (as in rapid app dev, but also RAD as in 80s Rad) suite of tools for Rails. I know, right? More rapid than rails? How? Well, through four things: some tighter integration with Acts as Authenticated, i.e. Authentication is built in, which is pretty nifty. Right out of the box, from the moment you type “hobo project”, you’ve got authentication. You build some models and you’re off to the races. Two: CSS. It looks nice right away, which, although people shouldn’t be thinking that their scaffolded code is there to stay, is in fact what they think. Hobo says “go ahead, keep your scaffolded code, we’ll pretty it up with CSS so you might want to keep it.” Lastly, and probably most importantly, through DRYML. DRYML is somewhat similar to ERB, they’re the same concept at least, but I have to say that off the bat, I like the look of DRYML a lot. It’s a really nice intuitive efficient tool.
Define a tag, reuse it, pass in
<def tag="my_name" attrs="first_name, last_name">
<p>My name is <%= first_name %> <%= last_name %></p>
</def>
<my_name first_name="Josh" last_name="Noble"/>
This is just scratching the surface of it, and there’s more info on the hobo site here. Four: even more contextual variable access. This is one of the things that took me a little while to get used to with Rails and it’s gone even further in Hobo. DRYML method tags like “repeat”, “table_for”, and “show” creatw scopes and use an “object” attribute to get data references to simplify your code even more. Now, what of this is really revoutionary? DRYML, without a doubt. The rest of the stuff is nice, but not necessary, and with experience you’d wind up doing that stuff in your rails apps anyways. DRYML though I find a little bit sweeter to work with than ERB. That might just be me though :)
What did I go with? Rails. Not that Hobo isn’t great, but I really want to work with eh, “the standard toolset” a little more before un-hooking yet more functionality from my attention. However, if I ever needed to do a rapid prototype, man, I’d be on it like white on rice. And it’s something that I suspect is going to mature and get better as time goes on. I’ll be keeping an eye out for it. I also want to give Camping a try as well, since not all projects that would benefit from the joys of ruby need to be Rails projects, some of them are better off as much more lightweight Camping projects. All in all though, I have to say that I’m, once again, really impressed with the Ruby community. Hobo ain’t revolutionary, but it is fun, and it’s yet another tool to do what you wanna do.
I was trying to figure out why I was getting an error in io:fwrite (I know, I’m a beginner) and I googled for it. O Google, illuminate for me the darkest corners of the internet. At any rate, here is the erlang cookbook which is a part of the scheme cookbook which ain’t exactly my flavor, but hey, I’m glad it’s there too. The cookbook doesn’t seem to have been updated in a little while, but there are some really practical things there as well as some useful information (a string is 8 bytes in Erlang. seriously. not 8 bits. 8 bytes. uh…ok). Now to figure out my wierd error :)
So one of my very favorite blogs is shutting it’s door. ‘why the lucky stiff’ is shutting down ‘redhanded‘ in favor of hackety hack, which is a semi-simplified ruby environment. I’ve always thought that teaching programming should be exactly the same as teaching basic algebra. Somehow though, until recently, not too many people agreed with me. Not so any more. Step forward egalitarian, elegance loving, Ruby-ists. I cherish and respect the Ruby communities desire to say “Hey, programming should be fun, intuitive, and no more complicated than necessary”. Long live hackety, processing, open framework, and anything else that helps give people tools to use.
May 1, 1978: Spam. And we don’t mean Monty Python.
The first piece of unsolicited bulk e-mail (what will come to be known as spam) is written. When it’s sent two days later, more than 400 people with an Arpanet address receive a promotional message sent by Gary Thuerk, a marketer for Digital Equipment Corporation. It’s been pretty much downhill from there.
Happy birthday Spam.
Easy. Use RMagick. Well, easy if you already have RMagick installed. If not, then not. However, if you’re interested: look here. Otherwise, follow along with rapt attention:
1. Get your image.
2. Write a Ruby script to rotate your image. This should do the trick:
require 'rubygems'
require 'RMagick'
cloud = Magick::ImageList.new("background.jpg")
cloud = cloud.rotate(180)
cloud.write('rotated_background.jpg')
(Note the seemingly redundant ‘require rubygems’ line? It’s not redundant, it tells the ruby interpreter to include all your gems. If you’re used to Rails then you never need this because Rails does it for you. If you’re not used to Rails you’re probably used to this or you’re not running RMagick).
3. type ‘ruby flipimage.rb’.
4. Post to server, realize image looks dumb flipped around, play with it for a little while, decide that you can live with the somewhat religous overtones of your current page.
5. Go to bed.
I made bunch of tech pledges earlier this year so I thought that 3 solid months after I had made them I would revisit them to see where they’ve changed and what I’ve learned since then. Here they are:
Things to keep doing:
- Using Actionscript 3. – did this and still agree
- Using Flex. See above. – did this and still agree
- Learning Java. - kinda did this, not really though. I still like the idea of Java, I just don’t like programming in Java very much. I know that’s not an objective answer, but hell, I don’t write much/any java code at work.
- Using Rails. - definitely keeping doing this in a serious way
- Learning Flex Data Services. - Not so much. Why? Because of the projects I’ve been working on and because it just doesn’t seem all that interesting any more honestly.
- Playing with C and Microcontrollers. – I haven’t been doing this as much as I wanted to because I’ve been so busy. It is still on my agenda though.
- Use my Ubuntu more. I use it some as it is, I just need to start doing more. For too many reasons to list : ) - I’m typing this on it right now!
Things to do more of:
- Try out frameworks like Hibernate, Spring, and servers like JBoss. - nope. Not at all. Just like Java, it’s kinda fading away a little.
- Play with openGL. It’s just so hard to be serious about working with graphics and graphical objects without knowing at least the roots of openGL. - eh, I read the Blue book sometimes when I’m in the bathtub (I know that’s wierd, but hey, I’m wierd) but I can’t seem to get around to actually doing anything, which is lame. So this is a wish I was but I’m not.
- Learn Python - I take this back. I can’t say why exactly, I just stopped being excited about working with it after a few little hobby projects with it.
- Play with processing. – still not doing this, still wishing I was. lame
- Play with OpenCV. - still not doing this, still wishing I was except that I just don’t want to do anything in C++.
Things to do less or just not do
- Use C#. - still agree. good call josh.
- Use C++. – still agree. good call josh.
- Work with Actionscript 2. - still agree. good call josh.
- Write any Javascript. - still agree although I have to say that learning some ajax to add to your rails is A Good Thing, so I’m gonna say I take this back.
- Use Ruby outside of Rails. - this is the one I regret. Ruby is really really awesome. I should have known and I didn’t. I’m sorry. Please forgive me.
ok. so any addendums? Yep. Two:
- Stop trying to do so many things at once. Very important.
- Read the Erlang book. Yep. It’s the future. I know it.
I’m noticing that there’s a real (as in actual) push to get Rails more enterprise ready. I think it all started with the complaint of the guys at Twitter that they were having scaling issues, which DHH responded to, which started a flurry of activity both idiotic and productive. The latest of this, and something I’m going to try out when I get home, is the Bleak House plugin by Evan Weaver which shows you the number of objects instantiated by their type in each controller (I think, I’ll check on it). This is really awesome not only because it provides people who like Rails but have unconvinced IT groups (i.e. me) a powerful profiling tool and it’s another step in the direction of having a more complete picture of where and how to optimize a Rails app. Along the same line there’s a cool post at InfoQ about using Dtrace to profile, the Magic Multi Connection plugin to help you scale multiple DB’s, the RailsBench which I know nothing about, and a general air of “how do we make it easier for people to make this better” that I for one find encouraging. Seriously Adobe, a profiler? How hard is that. I know that they have one in alpha, it’s just not ready yet, but this should have been around for a while. If we could peek into the play a little more I’m sure we could a better picture of what’s going on and roll our (our I mean the community) profiler…Any ways…I’ve been learning about Rails “Observable” mixin, and trying to get ready to start my Spanish class…Exciting times indeed.
After the tenth or so time of not being able to continue working on something because it’s not properly in SVN I decided to find a better way of adding all files that aren’t already in SVN. Doing
svn add *
only works for the current folder you’re in. But with a little shell scripting magic we can add all the file recursively:
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
then I realized that you could just do:
svn add --force.
which adds everything. Pretty simple.
— it’s coming out Thursday. I’ll
It’s “Programming Ruby”, aka, the Pickaxe book, from Pragmatic Programmers and though I’ll admit I was a little than thorough in reading the documentation in the Libraries (which is the last ~250pp) I was pretty transfixed. I did pick other things up as reference in between reading sesssions, but I never got completely distracted and actually set it down. Which is to say: this book is actually really well written.
I ran into something while working for an un-named company on an un-named project. The comp showed text that acted as a maskout of a shape to reveal the image behind. I puzzled about it for a while, approaching it wrong, until someone told me I needed to use bitmapping, and it occurred to me that I could grab the bitmapdata from the text field once I cached it as a bitmap. Below is the code, in all it’s glory:
//something to load an image
var load:Loader = new Loader();
load.load(new URLRequest('pic.jpg'));
addChild(load);
stage.scaleMode = "noScale";
//make our text field
txt = new TextField();
//we have to use embedded fonts
txt.embedFonts = true;
var tf:TextFormat = new TextFormat();
tf.font = "Verdana";
tf.color = 0x0000FF;
tf.size = 50;
txt.defaultTextFormat = tf;
txt.background = true;
//make background red so we have something to compare against in the copyChannel
txt.backgroundColor = 0xFF0000;
//we want to cache as bitmap? dunno...
txt.cacheAsBitmap = true;
txt.height = 300













