October 2nd, 2011 § § permalink
October 11th, 2008 § § permalink
An openFrameworks workgroup has started this week at Hangar. Every thursday until March, the wise Arturo will be there helping you with any doubt that you have. From 19 to 21 pm. +info
The equally talented Chris Sugrue will be doing the same in Madrid’s Medialab. Every friday from 19 to 21pm. +info
Last, and this has been going on for some months now, the incombustible Alba Corral has created an increasingly active spanish speaking processing community, with forum, wiki and more cool projects on the way.
Edit: I almost forget that there is also an introductory workshop to computer sound synthesis taught (with chuck) by Eduard Aylon. In a couple of weeks also in hangar.
May 3rd, 2008 § § permalink
Instruction set is a recently launched site that gives some instructions every month and asks for implementations in code. Think Sol Lewitt goes 2.0 (sorry I couldn’t resist). It is a beautiful simple idea and It’s stealing me lots of braincycles (see).
I’ve heard raindrops here and there about design by limitation lately. Number of chars in twitter, flickr video length, 1 photo/day in fotolog… There are a couple of limitations in instructionset which I missed at first but on a second thought I found interesting:
- There’s no clear way to post a result (images, applets, audio…).
You can always give a url, but it is not even suggested. I thought it might be an obvious improvement, but after trying to come up with solutions for the 2 first instructions, I’ve discovered that results could be a distraction. Instructions are about language and interpretation. I’ve found myself repeating the sentence, trying to define exactly every word, looking for a fold, or a flaw in which to introduce a deviation… Thinking how they relate to the programming language, how I relate to the programming language (specially with the first one “draw a straight line and follow it”)… I think that this relationship between everyday and programming language is a powerful one to explore.
- There is no form of comments/discussion other than the description of you implementation.
After seeing some of the contributions, I’ve found interesting approaches and I’d like to give feedback, but given the overwhelming noise ratio in today’s software playgrounds, I appreciate that there’s no way to do it. Paraphrasing Cage: just respond with your implementation.
Now, I don’t know if these are intended features or result of an early release, but if one could vote against new features… :)
September 24th, 2007 § § permalink
As I said last week, I’m also using robert penner’s easing equations in openFrameworks, so I’ve ported them to c++.
This has been relatively straightforward, but, as with the actionscript to java conversion, I’ve run into some nuances between languages and I’ve definitely learned the hard way (read “wasting some hours of my life”) why pre and post increment operators can be evil.
Grab them here
For usage, you can have a look at the openFrameworks app provided. If you want to have a quick glance at the types of movement, see the easing applet (p5 version).
Being this a programming exercise, it will have improvable things for sure. I’m thinking of some, but if you know anything, please let me know.
September 16th, 2007 § § permalink
Being an actionscript head, I’ve frequently used rober penner’s easing equations in processing*. To avoid copy/paste each time I’ve packed them as a processing library.
While I was at it, I discovered a couple of implementations (1, 2), but I was almost done, and wanted to learn how to make processing libraries anyway.
So in the hope that it is useful to somebody, here it is:
*I’m also using them in openFrameworks, so I’ve begun porting them to c++ too. They’ll be here when I’m done.
August 28th, 2007 § § permalink
Still happily living on jEdit for most of my scripting. I haven’t found an actionscript 3 edit mode, so I’ve made one. It is based on the original actionscript.xml and the Flash CS3 AsColorSyntax_3.xml file so it should have everything you can see colored on the IDE.
This edit mode doesn’t have any as2 specific keywords, so if you have to work on as2 don’t delete the original. Otherwise, you can just replace your original actionscript.xml file (you’ll find it problably in “c:\program files\jEdit\modes” if you’re on win xp) with this one. Make a backup of the original, just in case.
Grab the actionscript 3 edit mode for jEdit
April 13th, 2007 § § permalink
Just a quick code tip for working with dates in mysql and php.
I’m building a script to regularly mirror my last.fm recent tracks to a mysql database of my own. I’m interested in experimenting with daily and hourly statistics.
One problem that has taken me some head scratching has been the fact that the last.fm recentracks web service gives me the date a given track was played in a timestamp of my current timezone (+02:00 , Europe/Paris, as I’ve just learnt), but my web server is on a different timezone (-05:00, America/Los_Angeles), so when I try to insert a date in the database, even though I’m giving it a timestamp, it gets interpreted as being 7 hours less than it actually is. So a track played at let’s say 31 Mar 2007, 23:55 would be stored as having been played at 31 Mar 2007, 16:55. Not good.
Not wanting to fiddle with configurations or anything beyond my knowledge, I discovered that I could set the timezone in both php and mysql for a given script or db query.
Setting the timezone in php
If you want to know which timezone your server is in, you can guess it with
Which should give you a string like “America/Los_Angeles” or any other of the supported timezones list
If it is different than your desired timezone, look for the one you want in the list and before doing any time operation, call:
// set your timezone as gmt +02:00
From then on, all your php code should understand timestamps and dates in that timezone.
Then for mysql use CONVERT_TZ
Even though it is corrected in php, you’ll have to do it also when inserting information on you mysql db, because it will interpret timestamps again in its time zone. You can guess which is it by having a look at the system time zone variable.
In my case, after trying some hacky alternatives I discovered CONVERT_TZ in one of the latest comments in this post
From the mysql manual
CONVERT_TZ() converts a datetime value dt from the time zone given by from_tz to the time zone given by to_tz and returns the resulting value.
You have to pass it the timestamp, current timezone (‘SYSTEM’ is the server time zone) and target timezone and it happily converts between them.
So now my query would look like this:
$query = "INSERT INTO recenttracks (artist, name, url, date, type)
VALUES ( '$lastFmTrack->artist',
CONVERT_TZ(FROM_UNIXTIME('$lastFmTrack->playDate'), 'SYSTEM', '+02:00'),
Basically that’s it. Hope it is useful for someone.
Mind you, I’m nothing of an expert in php or mysql, this is just a method which worked for me. Corrections are welcome.