Encyclopedia, or a systematic dictionary of the sciences, arts, and crafts

Encyclopédie, ou dictionnaire raisonné des sciences, des arts et des métiers (English: Encyclopedia, or a systematic dictionary of the sciences, arts, and crafts) was a general encyclopedia published in France between 1751 and 1772, with later supplements and revisions in 1772, 1777 and 1780 and numerous foreign editions and later derivatives.

Have a look at http://diderot.alembert.free.fr/ for loads of nice and old images, like the one above.

htaccess trickery

I was looking the other day for a way to make a directory that is behind a .htaccess password protected directory accessible for anybody. Does that make any sense? For instance: www.somedomain.com/protected is password protected directory. I wanted anybody to be able to access www.somedomain.com/protected/notthisone/ without a password. After a little searching I found the following trick:

AuthType Basic
AuthName “Anybody”
AuthUserFile /path/to/some/autfile

Require valid-user

Allow from All
Satisfy Any

I’m actually not sure if I need all of the above or if I can just get away with “Allow from All” and “Satisfy Any”.

So basically by adding “Allow from All” you say anybody is allowed to access this directory. The “Satisfy Any” makes sure that you can access it either when you have already entered the password or when you don’t have a password.

A nice way to circumvent .htaccess directory protection.

AS3 Version Injection + Flex PMD + TDSI = Rock ‘n Roll! \m/

AS3 Version Injection

Ever been annoyed by Project Managers telling you that a bug you fixed is still in the latest release you did and after some investigation find out that they forgot to clear their cache? Well, fear not! An AS3 Version Injection script is here! 😛
I’ve created a simple AS3 class called Version that will add a time stamp to the context menu. All you need to do is instantiate the Version class once and pass it a reference to you Document Class. On top of the AS I’ve written a little Ant script that will take a template of the Version class, insert the current date and time and write out the Version class. This way you can just make it part of your Ant build and don’t need to worry about manually updating the version number. Also, now you’ll have a way of quickly identifying what version somebody is looking at. 🙂

Flex PMD

This is great for auditing your own code as well as other people’s code. I’ve written a small Ant task that can be ran as part of a build that will run your project through Flex PMD and create a PMD file for you. The PMD file will have a time stamp suffix so you don’t overwrite your old file and you can compare issues. To use this Ant script make sure you’ve downloaded PMD for Ant.

TDSI

Another piece of very useful technology. Up to 20% performance increase just by passing your SWF through it. I downloaded the Apparat source (where TDSI is part of) from Google Code and compiled it. Built another little Ant script to use TDSI with Ant. Just specify the input and the output file and you’re done!

Bringing it all together

All the above Ant scripts are saved in a separate file. This way I can import whatever piece I want in my build script, example:

  1. <import file="as3_version.xml" />

TIP: Place the import after you have defined your properties in the build script, this way the imported scripts can use the properties set in the build script.

Links

Flex PMD

Nice! A Flex (automated) auditing tool! 🙂

FlexPMD is a tool that helps to improve code quality by auditing any AS3/Flex source directory and detecting common bad practices

Would be interesting to start using this.

Gotcha:
The PMD Violations Viewer only accepts files that are named “pmd.xml”, all other files will not be recognized. I run an Ant task to rename the generated pmd.xml to pmd_[insert timestamp here].xml. When I tried uploading the renamed file the PMD Violations Viewer wouldn’t accept it. 🙁

Links:

Flash on the Beach 09 – Links

Below is a list (and some brief explanation) of links with interesting stuff found at Flash on the Beach this year.

Joa Ebert (from hobnox) talked about one of the geekiest subject known to man : Compiler optimization. Good to know some people care about those  things. This is how you can get cooler stuff on the screen. It have the potential to made our work run 10 times faster.
http://code.google.com/p/apparat/
http://blog.joa-ebert.com/2009/08/05/turbodieselsportinjection/

Some good optimization techniques from Grant skinner too: http://gskinner.com/talks/quick/

Contrast’s presentation about breaking design convention:
http://www.contrast.ie/blog/
Some good arguments here. Especially about the end of portal pages and brand over sale (yes we don’t need a massive logo on every single page).

Live feed visualization by Trevor Boyle during the elevator pitch:
http://blog.trevorboyle.com/wp-content/uploads/twittersphere/Twittersphere-Visualizer.html

What can be done with sound from various presenters:
http://www.hobnox.com/index.1056.en.html
http://www.frogdesign.com/
Ruben’s tube + propane: http://www.youtube.com/watch?v=HpovwbPGEoo
http://blog.drwoohoo.com/
designmind.frogdesign.com
www.openframeworks.cc

We saw some really cool live drawing session from James Jarvis:
http://www.youtube.com/watch?v=oZHBSBG7RSs
http://www.amostoys.com
James Patterson: www.presstube.com

And Art made with flash:
http://www.joshuadavis.com/
http://hype.joshuadavis.com/

As well, Joel Baumann from Tomato introduced us to some early century artists who being playing with generative art way before flash came about. And shown us us some of his work, some of it still remain really cool like the TV-Asahi indent – sound generated logo !

Stacey Mulcahy, talked about how devs and creatives can work together
better: www.bitchwhocodes.com
Some good technologies that can facilitate that:
– SVN: http://versionsapp.com/
– Version Cue: http://www.adobe.com/products/creativesuite/versioncue/
– Catalyst: http://labs.adobe.com/technologies/flashcatalyst/ (Though I don’t believe in it too much…)

Learn OOP in Flash: www.lostactionscriptweekend.com
And Automate publishing of .fla files: www.deleteaso.com
Koen de Weggheleire: www.newmovieclip.com

Union multiuser Flash platform: www.tryunion.com
– documentation + tutorials: www.unionplatform.com
– cool example: http://clockmaker.jp/blog-en/2009/08/union/
Multi user experience cheap and easy

MegaPhone, using mobile phones as controllers for billboards:
www.playmegaphone.com

Flash on the Beach 09 – Play with Vectors

This year I was only able to go to Flash on the Beach on the very last day. Never the less it was once again a really awesome experience and I learned a lot and got a lot of inspiration as well. I’ll try and post my notes from all the talks I’ve seen, but it might take a while…

23-09-2009 9.00 Koen de Wieggheleire – Play with Vectors
Koen did a very in depth talk about the Vector class in AS3.

The Vector class is a dence array which means that it can’t have any gaps, so something like the below would throw an error:

ActionScript

  1. myVector[0] = 'bla'; // See how we're skipping positions 1 and 2?
  2. myVector[3] = 'something else';

You can you an array as a ‘data provider’ to populate a Vector:

ActionScript

  1. myVector = Vector.<String>(myArray);

Using the Vector class will give you a performance boost of about 40 to 60%.
Unfortunately you can’t directly bind to a Vector in Flex, you can however write a wrapper class and bind to that. 😉

How to use in 3D

The Matrix3D class is somewhat complex to understand, but the image below should clarify it a bit

You can use myDisplayObject.transform.matrix3D to retrieve a DO’s Matrix3D or assign a new matrix3D to it. There are also build in methods to user rather than creating a new Matrix3D all the time, see http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/Matrix3D.html

Nice thing I only found out now about matrixes: You can skew objects with it! Rock on!!! \m/

How to use with 2D

Pretty much the entire graphics API in Flash relies on Vectors. The drawPath() method below (which is pretty much the core of drawing vector shapes) takes two Vectors (the Vector data type) as arguments.

ActionScript

  1. graphics.drawPath(commands, data)
  • the commands argument is a Vector containing GraphicPathCommands
  • the data argument is a Vector containing x and y pairs that determine the path to draw.

The new Illustrator can export to FXG and you can actually import this FXG data on the fly in Flash, parse it and draw the exact same.

Some notes on UVT (texture) mapping:

  • U matches up with the x location
  • V matches up with the y location
  • T determines the focal length

The right value for T can be calculated with the following formula: T = focalLength / (focalLength + z)

Useful links:

MXML and code behind

I’m a big fan of keeping MXML files clean by not having any code and style information in them. You can get rid of the style information by using a style sheet. A nice way to get all of your code out of the MXML is by using the code-behind method.

Code-behind encourages developers to build applications with separation of presentation and content in mind. In theory, this would allow a web designer, for example, to focus on the design markup with less potential for disturbing the programming code that drives it.

There is a good article by Aral Balkan at the Adobe Devnet on using the code-behind method with Flex.

Links: