Sep 22

junkImade is some useless stuff I make. Small demos, experiments, subproducts of ActionScript learning. Showcase of my skills. Random crap like XML based gallery, SQL based gallery, gallery with thumbnails, SQL based gallery with XML descriptions and cool mouse over effect, etc.

wordFishEye is sth like tagCloud but in 3d and without tags ;] It grabs top 50 fav artists from given Last.fm profile.

If you don’t have Last.fm account just click textfield and press enter – it’ll use my login.

Red bar is mode(list, spindle, warp, ball, wormhole).
Blue controls focal.
Green is radius.
Orange? is words scale.
Circles are presets so you don’t have to play with bars on your own – how kind of me ;]
Hold mouse to speed up rotation.
Press letter to filter artists by… first letter(enter clears).
Double click to search artist on YouTube (pretty much useless).

wordFishEye <-- click here for live demo


If anybody is interested i’ll clean up and post code for scroolbars.

Sep 12

Well I don’t feel much like a programmer, but writing this was proposed by my laziness. Anyway it’s good opportunity to write small code that could be actually useful:

function getYearDay():int {
var n:int = 0;
var td:Date = new Date();
var d:Date = new Date (td.getFullYear(), 0, 1);
while ( d.getTime() < td.getTime() ) {
d.setDate( d.getDate() + 1 );
++n;
}
return n;
}
if ( getYearDay() != 2 >> 8 ) {
trace(“WTF?!”);
}

getYearDay() function was highly based on this stuff by tvmiller

Another thing around this is Wikipedia article or rather lack of it. It was deleted by some Wikipedia Nazis ;] Read the discussion. I have no idea why they are so pushy towards deleting it since, as someone mentioned, there is place on Wikipedia for such things as Pi Day, Mole Day, Square root day, Towel Day, System Administrator Appreciation Day.

Anyway I better get back to work.

Sep 11

Processing rev146 came out a few days ago(since then r148 showed up). Till now, I’ve been using rev135-expert, so it’s about time to upgrade. Since there really weren’t any good new games on the horizon, I dove into revisions.txt(I will marry my procrastination one day). As usual some changes and bugfixes were made.
Here are some of the interesting functions I found there, that haven’t been added to the reference yet:

Dialog boxes
Functions that prompt the user for a file to open, a location to save a file, or select a folder:

String loadPath = selectInput(“What file ya want?”);
String savePath = selectOutput(“Save this masterpiece as…”);
String folderPath = selectFolder(“Which folder has the good stuff?”);

Couldn’t make it work in browser because of

java.security.AccessControlException: access denied

Oh well you can’t have everything. It works in P5 environment and exported application (at least in Windows)

requestImage(filename);
This function load images on a separate thread so that your sketch does not freeze while images load during setup(). While the image is loading, its width and height will be 0. If an error occurs while loading the image, its width and height will be set to -1. You’ll know when the image has loaded properly because its width and height will be > 0.
Wouldn’t it be nice if the height parameter would store the percentage of the loaded data?

PImage.resize(int width, int height)
Allows you to resize a PImage in place. Setting width or height to zero will resize that dimension in proportion to the other.
Keep in mind that this won’t work if called right after requestImage()

textAlign(ALIGN, YALIGN);
Added vertical param fo textAlign for text(str, x, y, w, h)

there’s also
imageMode(CENTER);
so Hasta la Vista for

image(gfx, -gfx.width*0.5, -gfx.height*0.5);

but it doesn’t work for me. Neither in r146 nor r148.

Download source code that uses all of the presented functions