Archive for February, 2007

Gearge Lucas in love

Friday, February 23rd, 2007

Ok, this isn’t a tech thing like the ones I usually wrote (but it is geeky):
a Star Wars remake like Shakespeare in Love, really funny!

I have a website

Thursday, February 22nd, 2007

Finally!
Since I’m looking for a job I realized that I need a personal website, so I’ve quickly made a simple one.
Nothing special, apart that you can see the mouse of the others guests and talk with them (just write, then press enter).
Enjoy!

Bruce Eckel on Flash

Sunday, February 18th, 2007

Here a great post of Bruce Eckel (author of “Thinking in…” books) on Java, Ajax and surprisingly: Flash.

So here’s my question. Allow for a moment the possibility that, after 10 years, Java is not going to take over the world of RIAs. Further allow that Ajax is just “how JavaScript was supposed to work in the first place,” but that the limitations imposed by browsers, HTML and CSS committees seem unlikely to let it expand beyond its current bounds. What are we going to use to build RIAs? [...] The only obvious solution is Flash.

Simon Brocklehurst pointed out that there are more ugly Flash interfaces than good ones, although I think he is talking about the old do-all-by-yourself hackery of Flash 7-8 since there isn’t many Flex 2 web apps out there yet. I wonder if he saw Picnik.

Eckel highlight a really interesting point: to use Flash as a domain specific language. Do in Flash the interface for your Java/Python/C application. We are waiting for you, Apollo.

Map of Web 2.0 startups in the world

Saturday, February 17th, 2007

Map of Web 2.0 startups in the world
(from readwriteweb)
I’ve found really interesting this map of Web2.0 startups in the world:
Europe and World

Sadly nothing in Italy…

CoComment

Saturday, February 17th, 2007

CoComment is a new tool that manage all your online conversations: install the firefox plugin and it will recognize every blog/forum you visit and track the comment you post.
It will also attach a toolbar to every comments textbox:
CoComment in madarco blog

Worth a try

Plick time tracker

Sunday, February 11th, 2007

Since I was looking for a way to organize my tasks, I’ve made:
Plick - Time tracker, a tool that help to keep track of what to do and the time spent on doing that.

The main features are the simplicity and that it help to stay in the schedule.

Using Plick is simple:
just specify a task and the time you think will be required to do that (eg: “clean room 15″ = clean the room in 15 minutes)
then, when you are doing that, just click on it and the timer will start.
Plick will keep track of the time spent on each task, in this way you can see if you spent much time than you expected, helping you to make better previsions.

plick.jpg

Memory leaks playing Shoutcast/Icecast streams in Flash

Saturday, February 3rd, 2007

Update: For those interested in an easy streaming solution, try haxeVideo.

Trying to play music on the Wii, I've encountered a problem in the flash Sound object.

While you listen to an mp3 in streaming mode: snd.loadSound(url, true), flash will keep in memory the music played.
A Shoutcast/Icecast stream like an Internet radio, is like a never ending mp3, witch take a large amount of memory, and eventually make the player crash. In the Wii this happen after few minutes.

After some googling, I've found that the only solution is to reload the stream after some time, freeing the buffer.
On a pc this can be made every 30 minutes, but on the Wii every 2 minutes.

To avoid the pause when flash reload the stream, is possible to preload in the background another Sound object, and then crossfade the two. In this way there is only an imperceptible glitch due to the lack of synchronization of the two streams.

So here how to do a radio player in flash without the memory leak:

  1. In a Sound object snd1 load the stream
  2. After some time (2 minutes on the Wii, depending on the bitrate), start loading another Sound object, snd2
  3. After a "buffer time" (depending on the connection, 10 second should be fine) fade the two Sound
  4. Free the fist sound snd1 = null
  5. Repeat from step 2

Remember that you have to pass a movieclip to the Sound object:

Actionscript:
  1. var snd1 = new Sound(_root.sndMc1);

And when you free the object you have to wait a frame for the garbage collector to free the memory:

Actionscript:
  1. snd1 = null;
  2. //next frame..
  3. snd1 = new Sound(_root.sndMc1);

Update: You can reload the same stream in another Sound object in this way:

Actionscript:
  1. snd2.loadSound("http://server:8000/;"+Math.random());

Without the ";"+Math.random() Flash will reuse the same connection

Here the source code of a proof-of-concept player:
Internet radio flash player

Listening to music on the Wii

Saturday, February 3rd, 2007

Update: Now it's needed only a shoutcast server, I'm working on removing the web server too

Wii I own a Wii!
And I'm playing more with the opera browser+flash than with Zelda...
My first experiment is to stream music from the pc to the Wii.

So here a quick how to:

Note: I've encountered some problems because of a weird bug in the flash Sound object, witch I'll explain in the next post. Update: here the post.
There are still some imperceptible "glitches" every two minutes, but the overall quality is good.

Notice that the player hasn't any interface yet and its required to run three(!) servers. In the next days I'll try to improve those things.

Requirements

You need:

It is possible to swap every item in the list with a Mac/Linux alternative, I'll leave it to google.

The server(s)

Download and install the SHOUTcast server.

In sc_serv.ini change the password and make it private:

CODE:
  1. Password=changeme
  2. PublicServer=never

Now start the server.

This has to run on the same machine of the webserver due to the security restrictions of the flash player.
We need two servers because flash refuse to open another connection to the same server. (And we need to do that to avoid memory leaks)

Stream

Download and install the Shoutcast winamp plugin.

Start winamp.

Select Options->Preferences->DSP/Effect->Nullsoft SHOUTcast Source DSP
and put the new password and the server port (8000 by default)

Shoutcat plugin settings
Now the music you listen will be streamed to the shoutcast servers.

The player

Now, get the swf player:
Shoutcast stream flash player

It hasn't any interface yet, I'll do that in the next days.

Put the swf in your web server and pass your ip as a flashVar in wiinamp.html:

HTML:
  1. <param name="movie" value="stream.swf" />
  2. <param NAME=FlashVars VALUE="stream1=http://192.168.1.33:8000/" />
  3. <embed src="stream.swf" FlashVars="stream1=http://192.168.1.33:8000/" />
  4. </object>

8000 and 8002 are the ports of 8000 is the port of the stream servers.

Listen

In the Wii Internet Channel open http://*yourip*/wiinamp.html and relax :)

To Do

  • An interface for the player
  • try Icecast to get rid of the second server and the webserver (for now it made flash unstable)