Revolution, Indeed:

deezer logo

When I first read about it on Slashdot I thought it would be just another streaming radio service, just like last.fm and Pandora. But it seems that this new french site is nothing like the ones we have already seen on the web:

Deezer.com offers unlimited streaming of music tracks, by letting you organize your own playlists or by just letting you listen to your latest musical obsession, for more than, lets say, 1000 consecutive times. What’s more, you can upload your own tracks, to listen from wherever you go, provided that you have access to an internet connection, making them also accessible to everyone using the service. Giving the ability to share, it is probable that deezer is to become soon a huge powerful community on the world wide web. But what is it that makes Deezer even more special?

According to Deezer.com’s recent press release, Deezer is the first website to offer such services after making an official deal with SACEM ( Syndicat provisoire des Auteurs, Compositeurs et Editeurs de Musique, a french equivalent to RIAA) and to be considered to follow a perfectly legal policy. That is, of course, after its ancestor, Blogmusik.net (which now redirects to Deezer) has been shut down due to legal violations just a few months ago.

Of course, there are ways for one to download the songs. However the mp3 quality is rather low (only 64kbps). Well, one could see that as an alternative to listening the songs on the web, but generally, Deezer tries to promote legal music downloads and cd market (which is also its primary income source).

Will Deezer be the future of the on-line music communities?

I’d totally love the idea :)
Other posts:

To GET or to POST? Edit: Deezer.com example

It was some days ago when, working on my practice project - a simple file uploader in PHP, I wanted to unable the users to delete any of the files they had previously uploaded on the server.
My first thought was to create a “delete” link, after each file or folder on the list displayed to the user.
This implied of course using the GET method to send the file id, in order to appear a message asking the user either to confirm the deletion or to keep the file.

<a href="index.php?show_dltfile=4">[x]</a>

To do that I would be using another set of links and the GET method once again, this time sending the id of the file together with the confirmation for the action.

<a href="index.php?confirm_dltfile=4">Delete</a>
<a href="index.php?">Keep</a>

The first of these links would eventually result in the call of the appropriate functions to delete the file.

It’s simple and it works, but at the same time it’s quite wrong.

Whilst in the first case I used the GET method only to show the confirmation message, in the second one it was used to delete a file located on the server. This practice can be proved dangerous especially if used in procedures like file deletion or for the process of sensitive data.
GET is a safe method. It should be used only to retrieve data and never to alter it. GET will send the information given as part of the URL (making it visible to the user and but also giving him the capacity to bookmark the page). This is pretty useful when we want to display a specific content and we want the user to be able to quickly access the information.
However if there is a need for a user to request an action that is considered “risky” and that changes the state of the server, it is preferable to use the POST method. Makes it possibly easier to sleep at nights :P

This one is pretty old. I didn’t first publish it, thinking it was way too common and simple, but, now that it happened to re-read this text, I finally realised it actually contains some thoughts and information one could find useful. Credit goes once again to my friend Dionyziz for sharing his knowledge and experience with me.

Edit:

A while after I posted this text, it happened to find another great example to demonstrate my point above, a bit more simple this time:

When a user registers on www.deezer.com , he is soon prompted to activate his account through an email sent to the account he has provided (a standard procedure in most user registration procedures nowadays). On the email the user receives there is a link similar to http://www.deezer.com/confirm.php?email=name@mailserver.com

As you can see, they use the GET method to tell their script that the user has confirmed the existence of his email address.

Lets suppose now that one creates a new account, and that this time he provides a non-existent email. none@nowhere.com for instance. The confirmation mail will never arrive on a valid email address. However, if the user then visits the page http://www.deezer.com/confirm.php?email=none@nowhere.com, the script will still confirm his registration and email validity. In this case it might not seem as a real security risk, but there might be other cases where the same thing could prove destructive for a site’s security.

Well, that’s all for now.

Note that the information above is given for educational purpose only and is not to encourage anyone into acts of questionable decency. (Deezer.com will soon be notified about the issue)

For Great Justice!

[youtube=http://www.youtube.com/watch?v=qItugh-fFgg]

This is the intro from the old japanese game Zero Wing on Sega Genesis. Probably the art of translation in its greatest glory!
A friend of mine became kind of obsessed with the whole cult game thing, as I did, but probably a little more than me. He actually played the whole game. He wanted to see the ending movie and find if there was anything similar.
He told me it was a pretty scary experience. From what he described me, all there was, was a pair of “potatoes” that danced all around, some kind of huge lipped Hawaiian guys or something like that.

However, from what I’ve read on wiki, the arcade version had a correctly translated introduction movie but offered another glorious ending as well:

Congratulation !!
A.D.2111
All bases of CATS were
destroyed.
It seems to be peaceful.
but it is incorrect.
CATS is still alive.
ZIG-01 must fight
against CATS again.
and down with them
completely ! Good luck.

Good luck with your sanity check after you play the game :D
Other links:
All your base are belong to us.com
Official Video Site

Better make it disappear…

a.button:hover{
filter:alpha(opacity=50);
-moz-opacity: .50;
opacity: .5;
 }

Opacity doesn’t work for me in IE. Not even in IE7. It just won’t work. I searched the web for something else that would help me but no luck.
My current solution?

browser.ie{
opacity: .0;
 }

If anyone has anything else to propose I’d be glad to listen to other actually practical solutions.

Edit: Solution given by Dionyziz as follows:

(thank you a lot :) )

  1. dionyziz Says:
    July 12th, 2007 at 10:45 pm editTo set opacity to .5…For Internet Explorer:x {
    filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);
     }

    For Firefox:

    x {
    opacity: 0.5;
    }

Beware of the Strings

 

Today I learned a really useful lesson.

Currently I’m working on converting my practice project, a simple uploader program in PHP, into OOP.
Let’s take a look at the construct of the User class. For every instance of the class that is created, there is a check on whether the parameter provided is an id or a username, simply by checking if it’s a string or an integer. If it’s an integer it supposes that the variable given is a user id, and so continues by filling up the other properties.

class User {
private $mId;
private $mName;
......
function __construct( $construct ) {
if ( is_int( $construct ) ) { // mySQL query by user id
$this->mId = $construct;

…….

else { // mySQL query by username
$this->mName = $construct;

  ..........

 

In order to display the username which is a private property ($mName) I used a simple fuction

public function GetName() {

return $this->mName;
 }

So in my index.php I used to following code to display the user who owned a specific folder:

$owner = New User( $folder_owner['id'] );

$folder_owner['id'] was part of an mySQL fetched array which carried the owner’s id.

However, when I called to my previous method to display the username:

echo $owner->GetName();

the result was echoing not the username as expected but instead the user’s id.

foo.txt, created on 12-06-2007 by 2

The class’s methods seem correct, so what was it that went wrong back there?

 

Let’s look again the creation of my new User object.

$owner = New User( $folder_owner['id'] );

As I said before, $folder_owner['id'] came from a mysql_fetch_array function. When this function is called, the array created from each row is always an array of strings. So even if the cell that contains the requested id in my db contains an integer, the result will always be extracted as a string. As my constructor received a string and not an integer, $this->mName was set with the variable provided, which in our case was in fact the id and not the username, but still had the form of a string. So, calling at the method GetName() would always return the id.

 

The error was pointed out by my friend and tutor Dionyziz, who also suggested me the simple solution of converting $folder_owner['id'] to an integer before using it as a parameter for my method.

$owner = New User( ( integer ) $folder_owner['id'] );

 

What will definitely not be forgotten:

  • mysql_fetch_array() always returns an array of strings.
  • my fear that in the end I’ll never find what’s wrong, and the undistructable banana phenomenon will be repeated.
  • Thank you Dionyziz!

 

More info:

mysql_fetch_array()
 __construct()

Some Basic Things

 

splash

 

A great experience I had back in the beginning of junior high was the discovery of QBasic variant of the BASIC language and development environment. I didn’t know much about programming back then ( well at least compared to what I know now ). I found the file by chance while searching the dos directory out of pure curiosity. “Hey, what’s this?” So, I searched the net a little bit ( 56k dial-up connection back then in which I had access a couple of hours a month) , found some tutorials and references ( though I also remember getting much help from the help files too ) and started to make some simple little programs, just for the fun of it.

 

gorilla

 

Anyone remembers the gorilla game?

It was one of the QBasic example source codes, pretty smart and exciting back then, made you consider the possibilities the language could give you. Damn I loved those non-error-displaying blue screens.

 

QBasic was I think a really good first start. Taught you a basic logic in which high-level programming languages work, and introduced you to concepts like interpretation and debugging. I must have made uncountable little games and programs, I totally loved the idea of having that kind of control and not just using ready programs. Visual Basic 6 came afterwards, and a bit of Visual Basic.NET and Visual C++, which unfortunately I didn’t have the time to practice since I got into high school and things got a bit strict concerning my free time.

 

I remember reading about Object Oriented Programming in one of my VB.NET books, however I think I didn’t really get to understand how it worked into practice. Perhaps the examples given where too theoretical, I remember creating completely useless hypothetical classes, which didn’t have any practical value in any of my projects, so it was unlikely for me to understand, without any other help than books.

 

 

What will definitely not be forgotten:

  • My quadratic equation solver in QBasic
  • The undistructable burning banana phenomenon in VB.NET. Never understood why it kept on existing.
  • Someday I’ll come and find it. And I will destroy it for ever. Darkness shall not prevail!

 

Useless info of the day:

  • did you know that evil blue screens do exist in windows XP?

 

more info:

Wikipedia

QBasic

BASIC

Visual Basic .NET

The Monkey Experience

 

(and The Big Whoop finally Explained)

 

Shut up, or I’ll eat you.

 

The first adventure game I had the pleasure to experience as a child is probably the one that made me love this gaming genre for ever. Pirate lovers, here it comes, the Curse of Monkey Island.

 

Actually the third game of LucasArts’ Monkey Island series, it took a good tested idea and made a real diamond out of it. Wonderful cartoon-like graphics and smartly designed characters combined with the hilarious sarcastic humour that characterizes most of LucasArts adventure games. Zombie pirates, voodoo dolls, talking skulls, Shakespeare, barbers, curses, vegetarian volcano gods, devil chickens, man-eating snakes and of course, monkeys – all mixed together in a great plot that travels you throughout the mysterious and weirdly-named islands of the Caribbean.

 

Join me, Rosencrantz! I am your FATHER!”

That diamond belongs in a museum!”

 

The whole game probably contains more in-jokes than any other of the series. For all the movie geeks out there, with a closer look on the dialogues you will definitely find uncountable references to Star Wars, Indiana Jones and even to the Princess Bride and the Jaws.

 

“The Cook, the thief, his wife, and her lover.”

So, let’s take a closer look at the game (worry not, no spoilers for now, at least nothing you don’t read in the game’s description or watch at the opening scene).

The adventure starts when Guybrush Threepwood, pirate, the main character of the first two games, arrives at Plunder Island, floating on a bumper car. Our hero finds himself in the middle of a battle between the thought-to-be-dead zombie pirate LeChuck, and his crush, Governor Elaine Marley. LeChuck is soon killed once again, but as usual, this is not the end of the story. Guybrush proposes to Elaine with a huge diamond ring he previously found in LeChuck’s ship treasure hold, only to discover the ring is cursed when it turns Elaine into a solid golden statue. So starts Guybrush’s journey to find a cure for the curse and to fight the revived zombie pirate LeChuck, who has returned once again to try and make Elaine his undead bride and recover the dreadful power of the Big Whoop.

 

<SPOILER>

(also concerns monkey island 2)

 

I see…ye do not yet know the dreadful power that be Big Whoop.”

 

For the ones that have also played the previous games, it is of great significance that the mystery of the Big Whoop is finally revealed. However many players got pretty confused on that matter. Everyone surely remembers the awful and disappointing ending of LeChuck’s Revenge (at least I won’t ever forget how it felt after so many hours of playing such a magnificent game only to arrive at this). It seems that finally we get to understand how MI2 and 3 are connected to each other. When LeChuck is being killed by Guybrush using his voodoo doll, and asks for him to come closer to take off his mask, it seems that Elaine’s comment about the “spell” comes actually true. While the Big Whoop is actually a gateway to hell and the way LeChuck became a powerful undead, it is at the same time also referred to as the Carnival of the Damned. As you might remember, at the 2nd game’s ending scene, Guybrush wakes up to discover he’s on a family trip to an entertainment park. Of course he thought his parents to be dead, and cannot believe that everything was actually a huge pick from his older brother.

At the beginning of the 3rd game, he is found once again as an adult, travelling on a bumper car and writing on his journal how he finally managed to escape the Big Whoop. At the end of the game, he returns to the Big Whoop, where LeChuck has taken Elaine after kidnapping her, and is recruiting his army of the undead. An interesting reference to the older game is made when Guybrush is once again coursed and turned into a child instead of getting killed by it (though his change is much funnier than the last time, but possibly also refers to LeChuck’s previous failure of teleporting Guybrush to another dimension, resulting him to teleport only a few rooms away).

 

Of course, one cannot see the real value of the Big Whoop, for there is none except from its great destructive power. Even the naming of the supposed-to-be-treasure is sarcastic.

 

</SPOILER>

 

Concluding:

LucasArts has once again done its miracle, producing a high quality adventure game, that you will probably be quoting for a long time to come. Though it was the last game to use the SCUMM engine, the result came out just wonderfully. A great plus is the excellent and hilarious voice acting and the game’s music and songs. The actual monkey island theme performed at its best version ever, and of course the unforgettable “A Pirate I Was Meant To Be”, sang by the three barbers (also a reference to the Princes Bride scene).

A great experience and a game that MUST be played by all adventure game lovers.

 

 

What will definitely not be forgotten:

  • The Skull *Bunny* Island

  • Murray, the invincible demonic skull. Try offering him a gum ;)

 

More info:

Wolrd of MI

Scumm Bar

The Legend of Monkey Island

Wikipedia

Extended list of in-jokes and references

Memorable quotes