HTML5 – Audio tag cross domain

I heard a lot of about HTML5 that this specification will maybe replace Flash in next years. This is really promising specification because I really hate of using a very, very heavy Flash control each time when I want to see a video clip and listen to an audio file. Therefore today I would like to learn how HTML5 works with audio file. It’s pretty simple to host an audio file in my HTML. Open Notepad, copy and paste this code below, replace my audio file with yours or you can download it here , save file.

<html lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title> HTML5 Audio Example</title>
	<audio autoplay="autoplay" controls="controls">
		<source src="Le Hieu & Phuong Vy - Yeu Em Dai Lau.ogg"/>


OK, let’s browse this HTML, it works like a charm

– Firefox 3.6

– Chrome

– Internet Explorer 8

Nothing??? Yeah because IE has no native audio support.

More than 50% users around the world use IE and all of them can not hear this audio because nothing will appear at their browser. It’s OK, HTML5 is new and still being developed. There is no surprise that IE 8 still does not support it. Just skip and go forward. OK, I can simply embed an audio which is stored at my host. Can I host an audio file from external website. Let’s try it

<html lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title> HTML5 Audio Example</title>
	<audio autoplay="autoplay" controls="controls">
		<source src=""/>


– Firefox 3.6 and Chrome

So it is completely clear that I can not host audio from other domain. Cross domain usage can be enabled by sending headers along with the file being requested. The header explicitly says ‘this resource can be used cross domain’. The protocol for doing this is described in this Access Control ( document. I really do not understand why HTML5 prevents loading audio from cross domain. Does an audio/a video like an image (in aspect of media file)? I can host an image from cross domain why it does not work with audio/video. To load audio/video file from cross domain, I write a small PHP proxy so that I can load its content to my host and play it back to user.

// Set your return content type
header('Content-type: audio/ogg,mp3');

// Website url to open
$daurl = $_GET['url'];

// Get that website's content
$handle = fopen($daurl, "r");

// If there is something, read and return
if ($handle) {
    while (!feof($handle)) {
        $buffer = fgets($handle, 4096);
        echo $buffer;

And my HTML turns to be

<html lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title> HTML 5 Example</title>
	<audio autoplay="autoplay" controls="controls">
		<source src="" />


However using this proxy is a pretty “stupid” idea because I load the audio twice. First from external host to my host and then from my host to browser. Moreover that proxy above works only with Firefox. So the question is “Can HTML5 really replace Flash player in next years?”. An example of audio control you can see here

A Captcha system was applied

Everyday i received about 80 spam comments at my blog. It makes me really annoyed because I must take a look to see if there is a real comment in that mess. As consequence I am tired of reading all of them and therefore some real comments which are false recognized may be deleted too. So today I decide to apply a Captcha system at comment section to reduce spam. I hope that most of spammers will be stopped by this system.

A CAPTCHA or Captcha (it is a contrived acronym for “Completely Automated Public Turing test to tell Computers and Humans Apart.”) is a type of challenge-response test used in computing to ensure that the response is not generated by a computer. The process usually involves one computer (a server) asking a user to complete a simple test which the computer is able to generate and grade. Because other computers are unable to solve the CAPTCHA, any user entering a correct solution is presumed to be human. Thus, it is sometimes described as a reverse Turing test, because it is administered by a machine and targeted to a human, in contrast to the standard Turing test that is typically administered by a human and targeted to a machine. A common type of CAPTCHA requires that the user type letters or digits from a distorted image that appears on the screen.

The captcha system which I used is Simple Catpcha. It is easy to use, just install and everything works. There is a small problem that we can not install it through available Plugin Browser/Installer functionality of WordPress because the archive of installation has a false structure. It has a folder too much. Therefore I recommend that you should download the installation packet and install it manually.

I hope this captcha will help me preventing spam comments. Because during installation of this plugin, I must delete more than 4000 spam users with more than 20000 spam posts at the forum of my high school classh. This forum is phpBB forum and activated with a captcha system but I think the captcha system was broken.

Axum – safe and productive parallel programming model for .net

Today I read an interesting news on PcworldVn . It relates to a new programming language of Microsoft which can work with Visual Studio 2008 and .Net framework. This new is called “Axum, “a language that builds upon the architecture of the Web and principles of isolation, actors, and message-passing to increase application safety, responsiveness, scalability, and developer productivity”.

So what is the meaning of parallel programming? I quote parallel programmings definition from other website.

  • Parallel programming involves:
    • Decomposing an algorithm or data into parts
    • Distributing the parts as tasks which are worked on by multiple processors simultaneously
    • Coordinating work and communications of those processors
  • Parallel programming considerations:
    • Type of parallel architecture being used
    • Type of processor communications used

An obvious motivation for writing a parallel program is to make it run faster. Closely related to that is  a  desire  to  make  the  program  do  more  while  it’s  running.    This  is  especially  important  for interactive applications that must process user input while performing a background task.

Very often, responsiveness of interactive applications is hindered by long-latency components such as  I/O or user  input. For  example,  an  email  client must wait  for  the data  from  the  server, which might be behind a slow network. It is desirable that such an application remains responsive while requesting data from the server.

All describation above seems like to a well-know concept Multi-Threading. If you know a platform for Multi-Threading in C++ “OpenMP”, you will understand what Axum is for. They all support multi-task and parallel programming. However there are a big differences between OpenMP and Axum. OpenMP is a library and it is very easy to use with your source code but you can really not define the way it work. You can only configure it, not define it. Axum provides another way for you. With Axum you control most everything because it is only a programming language.

For more information about Axum you can read at its Programmer’s Guide and Language Specification.

.Net Id

When I reversed a .net assembly which is packed and obfuscated, I always confuse myself to define which of packer is being used to protect that assembly. So I would like to have a tool like PEiD to identify the signature of an assembly. I waited for a long time so that someone will write such tool but it seems that no one has time to do that. So yesterday I decided to write myself a small tool to identify the signature of assembly (not exact signature but the pattern which helps to identify the packer or obfuscator). It was written only for .net (not native code). I will try support to identify more signatures.

This tool is now on beta version. Use it on your risk, you can help me to improve it by sending a muster assembly with a comment telling me which packer or obfuscator is applied on that assembly.

* Requirements : .NET Framework 2.0

* Version:
* Supported version of Assembly
o All versions
* All comments for this tool. Post directly below.

NOTE: If this tool doesn’t work with your system, post here your errors.



* [] : Drag and Drop Support. Add more signatures.
* [] : Beta Version

.Net Id

Super Mario Brothers Frustration

Today I read a thread on Updatesofts which leads to a very funny video. This video records the playing process of a gamer. He plays game Mario.

Mario is a fictional character in video games, created by video game designer Shigeru Miyamoto. Serving as Nintendo’s mascot, Mario has appeared in over 200 video games since his creation. Though originally only appearing in platform games, starting with Donkey Kong, Mario currently appears in many video game genres, such as racing, puzzle, role-playing, fighting and sports games, and others.

Mario is depicted as a short, pudgy, Italian plumber who lives in the Mushroom Kingdom. In the Mario series, he repeatedly stops the plans of Bowser to kidnap Princess Peach and subjugate the Mushroom Kingdom. He also has other enemies and rivals, including Donkey Kong and Wario. Mario is currently voiced by Charles Martinet.

As Nintendo’s mascot, Mario is one of the most famous characters in video game history, and his image has become synonymous with video games. Mario games, as a whole, have sold more than 201 million units, making the Mario series the best-selling video game series of all time. Outside platform games, he has appeared in video games of other genres, including the Mario Kart racing series, sports games, such as the Mario Tennis and Mario Golf series, and role-playing games. Outside the original games, television shows, film and comics, he spawned a line of licensed merchandise.

And before showing you the video, I would like to say more info about it. This video was made by a Japanese. He modified the original one and recorded his training and posted in Internet. Someone downloaded this video and made sound so that it turned to be more interesting and funny. So there are 2 producers for this video: The player and the reader. I would like to post a statistic made by another man too.

– The reader says F*ck for 133 times.

– The players dies for 77 times.

– The reader says F*ck every 18 seconds.

– The players dies every 11s.

– The reader says F*ck three times each death.

Ok, let’s see it. I can not stop myself from laughing when watching this video. Oh just forget to post an important thing. Here is the game : .

A – start
S – select
D – run
F – jump