Older blog entries for tnt (starting at number 38)

26 Aug 2005 (updated 3 Sep 2005 at 11:24 UTC) »
Tags: Microformats , XHTML , HTML , XML

Until just now I didn't really get Microformats. The following section from their website is what made me understand it:

What are microformats?

Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.
This is what made me realize that Microformats are implemented using existing XHTML or HTML elements. That way they are something that can always be viewed by humans (since they're implemented using existing HTML elements) but can also be parsed by software (like web crawlers) to extract semantic knowledge.

I used to think Microformats were simply a new name for things like:

  • XML Namespace based extensions. (Like RSS modules.)
  • Attribute based extensions. (Like Atom link extension mechanism.)
And other things such as that. (But they are not.)

In some cases I think Microformats work great. Things like rel-license and rel-tag are examples of great Microformats. However, I see problems with some. (Although maybe I'm missing something.) For example things like the hCalendar and hCard Microformats are identified by the class attribute. That seems to like a bad idea to me. Here's an example hCard:

    <div class="vcard">
        <a class="url" href="http://changelog.ca/">
            <span class="n" style="display:none"> <!-- hide this from display with CSS -->
                <span class="family-name">Krempeaux</span>
                <span class="given-name">Charles Iliya</span> 
           <span class="fn">Charles Iliya Krempeaux</span>

You can't force people not to use your magic class name. It's common practice to apply the class attribute everything to apply CSS styles to them. And this may confuse we crawlers and any other type of software trying to obtain semantic knowledge.

Instead of using the class attribute I think what I'd do is bring in a new attribute through a new namespace. (Although that will only work for XHTML and not HTML.) For example:



<div vcard:name="vcard"> <a vcard:name="url" href="http://changelog.ca/"> <span vcard:name="n" style="display:none"> <!-- hide this from display with CSS --> <span vcard:name="family-name">Krempeaux</span> <span vcard:name="given-name">Charles Iliya</span> </span> <span vcard:name="fn">Charles Iliya Krempeaux</span> </a> </div>

Also, this nice thing about this is that if you follow the normal RSS Module style of doing things, the URL for the XML Namespace will point to a document that details the extension.

But, strictly speaking, that wouldn't really work with HTML. (Although I wonder if it would break web browsers to use it anyways.)

24 Aug 2005 (updated 3 Sep 2005 at 11:28 UTC) »
Normal People Won't Take DRM Being Forced On Them

Tim Bray put what I've been saying for a while into eloquent words. That normal people aren't going to take DRM being forced on them.

For time to time I tell my friends and clients about things like DRM and what it will do and means. About some of the things that people have patented (with software patents and life patents) and they're disgusted. Without someone like me telling them about it, they just don't know about this kind of stuff. I think if more people knew about some of the stuff that goes on, that things would change. But they don't. This kind of information doesn't get to them.

But DRM is going to be right in the face of normal people. Even if supporters of DRM lobby politicians to get laws in place to enforce it, all that is going to do is turn the majority of the people into pirates and criminals. And in a democracy, should laws be created that turns the majority of the population into criminals? Shouldn't laws be created that reflect the will of the people?

27 Jul 2005 (updated 3 Sep 2005 at 11:37 UTC) »
Why Can't I Hear The Music I Like on the Radio... Bribing, Payoffs, and Scandals... WiMax/802.16 May Be the Answer

In the past, for the Vancouver area in BC, Canada, the music radio landscape has been dominated by 2 radio stations. The Fox for rock music and Z95 for pop music. Fans of rap and r&b music had no station to call their own. Some listened to Z95 until they played a rap or r&b song (which was rare). Some listened to CDs. And some put up with the staticy signal and listened to the Seattle based rap and r&b station Kube93 (that is, if they were in a location where they got any reception at all).

In 2001 or 2002 (I think) a couple of warehouse workers, knowing that there was a large rap and r&b fan-base, became entrepreneurial and created a new rap and r&b radio station called The Beat. (At least, that's the story I heard.) The move shook up the airwaves. Listeners from Z95 flocked to The Beat. Z95 was forced to completely change what their motif, and became a 80's and 90's soft-pop station. Obviously The Beat was playing what a lot of youth, teenagers, and adults in their 20's and early 30's wanted to hear. There was obviously a large fan-base for rap and r&b music (in addition to the very large rock fan-base that the pacific northwest is known for).

Not too long ago though -- earlier this year (I think) -- The Beat completely changed its tune. In what shocked many rap and r&b fans, they became a pop station; claiming to play "all the hits". Exactly what Z95 was. Exactly what many music fans demonstrated they didn't want to really hear, when they made their switch to The Beat. Why did they do this‽ Why can't I hear the music I like on the radio‽ Why have rap and r&b fans been forced to go back to listening to CDs and trying to listen to Kube93 (when we can get a strong enough signal)‽ The answer, I'd conjecture, seems to have a lot to do with the current state of the music industry. The bribing, payoffs, and scandals that various players in the music industry are using to get radio stations to play their artists music. It would seem that it can be lucrative for radio stations and DJ's to play pop-music.

Although radio stations and DJs don't admit to these payoffs, many have been suspected them. (And some in privileged positions have known about them.) These payoffs have even made news headlines recently.[1]

While The Beat made this switch, alot of weird and annoying things went on. Rap and r&b songs have been weeded out. And have continued to get less and less airtime. (Which has alienated much of The Beat original listeners.) Also, The Beat has something called "Battle of the Beats", where 2 songs will compete against each other; and listeners call in and vote for the winner. (The winner then gets onto the regular playlist.) Some of the winners of this have left listeners thinking "what the f---" or "you've gotta be f---ing kidding me". Some of these supposed winners generated so many complaint calls that they actually put the songs up for a re-battle,... which is really unheard of. And some of the contenders have left listeners saying, "I want to vote no for both of these". (But generally people are voting against the one they dislike the most.)

So where does this leave us‽ Some stations do infact play music to their fan-base. Some don't; and are more like one long commercial for record labels. And you may or may not be able to listen to the music you want to listen to. Will things change‽ They might.

There is disruptive technology coming that has an opportunity to change things. The technology is WiMax.

Like Wi-Fi, WiMax is a wireless networking technology. However, WiMax operates on a much much larger scale. Where Wi-Fi gives wireless networking to a house. WiMax gives wireless networking to a city. Specifically, WiMax can give city wide broadband wireless Internet access.

WiMax opens up the door for an explosion of "radio stations" that you can listen to in your car. Imagine this. Instead of having a regular radio in your car, you have a device -- an IPradio -- that is connected to the Internet via WiMax. With this IPradio you can connect to any of the tens of thousands Internet radio stations. And listen to the music you want to listen to. You could even listen to music stored on your home computer. Or music from other places.

There is something that could hold this back though. WiMax may be held back by large teleco's who don't want WiMax to succeed for various reasons. Also, music licensing organizations so far have not given Internet radio stations the same kind of "fair" licensing deals they offer classic radio stations. And music licensing pricing has been set to, in effect, kill Internet radio. (Which seems to be the intent.)

I'd like in-car IPradio to get mass adoption though.

PHP SimpleXML CDATA Problem... and My Solution
PHP5 has a new built in way of handling XML. It's called SimpleXML.

Using this object for "working with" XML can make development alot faster. SimpleXML parses an XML document, and turns it into an object. So if we had a document like:

<?xml version="1.0"?>

<tvshows> <show> <name>The Simpsons</name> </show>

<show> <name>That '70s Show</name> </show>

<show> <name>Family Guy</name> </show>

<show> <name>Lois &amp; Clark</name> </show> </tvshows>

Then SimpleXML would give us a (PHP) object something like:
object(SimpleXMLElement)#1 (1) {
  array(4) {
    object(SimpleXMLElement)#2 (1) {
      string(12) "The Simpsons"
    object(SimpleXMLElement)#3 (1) {
      string(14) "That '70s Show"
    object(SimpleXMLElement)#4 (1) {
      string(10) "Family Guy"

} [3]=> object(SimpleXMLElement)#5 (1) { ["name"]=> string(12) "Lois & Clark" } } }

(The output above would be what you get if you called var_dump() on the object. It probably looks more complex than it really is. Basically, to get at "The Simpsons" part, we would write "$simplexml->show[2]->name".)

This is useful because: #1 we save alot of time not having to use the old XML parsing methods (... which isn't difficult, just time consuming), #2: we can "use" this in a "foreach" structure, and #3 it's easier for newbies to learn with.

The one big problem is, SimpleXML does not handle CDATA!

(If you don't know what XML CDATA Section is, look at: http://en.wikipedia.org/wiki/CDATA_section)

Look at the last entry:

        <name>Lois &amp; Clark</name>

What if we used CDATA instead to represent this, and had:

        <name><![CDATA[Lois & Clark]]></name>
Well then too bad! SimpleXML just skips all that. It just pretends that it wasn't even there! (Note that when we put the text in the CDATA block, we were able to change the "&amp;" to a "&".)

So in other words, if we had:

<?xml version="1.0"?>

<tvshows> <show> <name>The Simpsons</name> </show>

<show> <name>That '70s Show</name> </show>

<show> <name>Family Guy</name> </show>

<show> <name><![CDATA[Lois & Clark]]></name> </show> </tvshows>

Then we'd get:
object(SimpleXMLElement)#1 (1) {
  array(4) {
    object(SimpleXMLElement)#2 (1) {
      string(12) "The Simpsons"
    object(SimpleXMLElement)#3 (1) {
      string(14) "That '70s Show"
    object(SimpleXMLElement)#4 (1) {
      string(10) "Family Guy"
    object(SimpleXMLElement)#5 (1) {
      object(SimpleXMLElement)#6 (0) {
Note that the "Lois & Clark" part isn't even there!

So, what's the solution. Well, we can turn the CDATA into XML "escaped" text before giving the "XML data" to SimpleXML. In other words, take to CDATA and do the following conversions...

&    becomes    &amp;
"    becomes    &quot;
<    becomes    &lt;
>    becomes    &gt;
(And of course, drop the "<![CDATA[" and "]]>" too.)

I tried doing this with regular expressions but just couldn't figure out the proper way to represent "not a string". (I tired it with POSIX regular expressions are Perl-compatible regular expressions. But couldn't get anything to work.) So, eventually I just decided to write a function for it. (Which is tedious.) So, here it is. Hopefully it will help everyone else to not get frustrated with SimpleXML being too simple:

    function uncdata($xml)
        // States:
        //     'out'
        //     '<'
        //     '<!'
        //     '<!['
        //     '<![C'
        //     '<![CD'
        //     '<![CDAT'
        //     '<![CDATA'
        //     'in'
        //     ']'
        //     ']]'                                                                                                                                                            
        // (Yes, the states a represented by strings.) 
        $state = 'out';
        $a = str_split($xml);
        $new_xml = '';
        foreach ($a AS $k => $v) {
            // Deal with "state".
            switch ( $state ) {
                case 'out':
                    if ( '<' == $v ) {
                        $state = $v;
                    } else {
                        $new_xml .= $v;
                case '<':
                    if ( '!' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                 case '<!':
                    if ( '[' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![':
                    if ( 'C' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![C':
                    if ( 'D' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![CD':
                    if ( 'A' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![CDA':
                    if ( 'T' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![CDAT':
                    if ( 'A' == $v  ) {
                        $state = $state . $v;
                    } else {
                        $new_xml .= $state . $v;
                        $state = 'out';
                case '<![CDATA':
                    if ( '[' == $v  ) {

$cdata = ''; $state = 'in'; } else { $new_xml .= $state . $v; $state = 'out'; } break; case 'in': if ( ']' == $v ) { $state = $v; } else { $cdata .= $v; } break; case ']': if ( ']' == $v ) { $state = $state . $v; } else { $cdata .= $state . $v; $state = 'in'; } break; case ']]': if ( '>' == $v ) { $new_xml .= str_replace('>','&gt;', str_replace('>','&lt;', str_replace('"','&quot;', str_replace('&','&amp;', $cdata)))); $state = 'out'; } else { $cdata .= $state . $v; $state = 'in'; } break; } // switch } // // Return. // return $new_xml; }

So to use this, you'd do something like:

    // Get the XML data, with possible CDATA sections in it.
    $xml_data = file_get_contents('http://changelog.ca/feed/rss/');

// Convert the CDATA sections using the un-cdata function. $xml_data = uncdata($xml_data);

// Create the SimpleXML object (not having to worry about loosing info due to CDATA) $simplexml = simplexml_load_string($xml_data);

Just an extra note. I'm not sure how efficent this is with the use of the str_split() function (to turn a string into an array of characters). But if you are using SimpleXML, you're probably not really worried about that. (Or at least not at that stage of development.)

Hopefully someone will find this useful. (If you find any errors or bugs with it, send me an e-mail and let me know.)

The Proper Way to Use PHP's eval()
Many people say it is bad practice to use the eval() procedure in any language. That there is always a better way to do it. I disagree.

I think that some situations can warrent the use of the eval() procedure. Esspecially if you use it properly and carefully.

The PHP eval() procedure is no different. There are two important rules to remember when using PHP's eval().

  1. Always check the the return value from eval().
  2. Make it so you "code" returns an "OK" signal when it is done.

Let me explain this more. Since you are using "executing" unknown code and really don't know if the code has any syntax errors, or and other errors. You should be making an effort to check for this.

The PHP eval() procedure will return FALSE if there us an error. Therefore, you should check to see if it returns FALSE. So, you should be doing something like:

    if (  FALSE === eval($code) ) {
        // Error.
        // ... handle the error ...
However, it is possible that eval() could return FALSE, even if it did not have this kind of error. So, you must set up your code so returns something other than FALSE when there is no error. I suggest it returns TRUE. You can do this by doing something like:
    $code .= 'return TRUE;';

if ( FALSE === eval($code) ) { // Error. // ... handle the error ... }

That way you know if everything went OK, then it will return TRUE.

So, for a fuller example we might have something like:

    // This procedure returns a string that is legal PHP expression.
    $variable_code = get_variable_code();

$code = '$a = ' . $variable_code . ';'; // $code = "\$a = $variable_code;";

$code .= 'return TRUE;';

if ( FALSE === eval($code) ) { // Error. // ... handle the error ... }

You can do alot more interesting things with eval() too.

HTTP Authentication... the forgotten paradigm
When I first really started developing sophisticated web sites, I immediately found that I needed to create user authentication systems. Users needed to be able to "login" and "logout" of the site.

The immediate answer to this, at first, seemed to be to use HTTP authentication -- RFC 2617. However, there is one glaring problem with using HTTP authentication. None of the web browsers (that I know of) provide you with a way to "logout".

Web Browsers need to fix this "usability" problem they have with their use of HTTP Authentication. Although I think "fixing" this should probably be a 2 step progress. I suggest that they first do a "quick fix" and then do a "proper fix".

The "quick fix" is to make it so web browsers provided some method -- a button or something -- that the user can use to "clear" the HTTP Authentication info. (The browser should also communicate to the user, through the user interface, when they are "logged in". I.e., when the browser has and is sending HTTP Authentication info for that site.) Of course, this isn't optimal, which is where the "proper fix" comes into play.

The "proper fix" is a little more involved. What really needs to happen is there needs to be a standard "hand shake" between the client and the server, that tells the server when the client it logging out. Something along the lines of:

  1. The client sends a "log me out" message to the server.
  2. The server receives the "log me out" message and "cleans up".
  3. The server sends a "you are logged out" message to the client.
  4. The client receives the "you are logged out" message, and "clears" the "HTTP Authenication" data.
Also, with the "proper fix" there needs to be a way to let the web developer put the "logout" button inside of his web pages (or web applications). The web developer should be able to check, via JavaScript, whether the browser has "HTTP Authentication" info or not. And the web developer should be able to initiate the "logout" "hand shake" via JavaScript.

And while we're at it, the "proper fix" should let the web developer control the "login" as well. Letting them create and use their own "login" window (or whatever). And let them do it via JavaScript.

HTML 5's Canavas
I've been looking at the coming HTML 5 <canvas> tag. This is something that has been long coming to HTML. (I've wanted something like this for a long time. Even when doing XUL development, I wanted something like this.)

(BTW, the HTML 5 standard isn't defined yet. This is something that is coming. However, it is already implemented in Mozilla-based browsers like FireFox and Apple's Safari.)

For those that don't know, there is a new tag coming to HTML 5 -- the <canvas> tag. What it does it allow you to "draw" pixmap images using JavaScript (using an "immediate mode" API). So you do stuff like:


<head> <title>HTML 5 Canvas Example</title> <script type="application/x-javascript">

function drawit() { var c = document.getElementById('the-canvas').getContext('2d');

// Draw the image... }

</script> </head>

<body onload="drawit();">

<canvas id="the-canvas" width="640" height="480"> Your browser does not support the HTML 5 canvas. Upgrade now. Do it!... DO IT!

You could also use this space, inside the "canvas" tag, to put in something like an "img" tag, so that you have a graceful fallback. </canvas>



You can even get a "data URL" from this canvas, after you've drawn to it. (See RFC 2397 if you don't know what a "data URL".) So, you can "save" your drawings! (Possibly by uploading them to the server.)

I don't think Flash would have ever had a chance if we'd had this back in the day. But Flash has traction among artists and designers, so we're probably going to have a battle on our hands. To be honest though, I think public standards are going to win.

OSFlash, Open Source Flash, and Macromedia

Things keep on going good for OSFlash. Alot of good people have joined the community! The mailing list is quite active, the wiki is becoming a very valuable resource, and people from Macromedia are even making an appearance on the mailing list.

To quote Macromedia's Mike Chambers:

I know a lot of people [from OSFlash] see this as an us vs Macromedia, but we are really excited about everything that has been happening over the past couple of months.

It also seems like Macromedia will be putting some of their own projects up on OSFlash and releasing them under an open source license. (Hopefully it is GNU GPL compatible.)

Also, I registered the dot-com version of the domain, and pointed it to the dot-org website. So:


Now both go to:


I did this to prevent anything offensive from appearing on the dot-com. And because I know alot of people don't know there are any other domains other than the dot-com domains. (So having these too will help people to get to our website.)

Free and Open Source Flash Player

Recently people have been talking about Free and Open Source Flash Players. Slashdot was running the article The Return of GPLFlash. And the FSF has made a call to arms regarding Free Flash (and Free Java). (Remeber, we're talking about "Free as in Freedom" here.) I think Macromedia is somewhat concerned over this. And I can tell you why... here's a another quote from Macromedia's Mike Chambers:

just fyi, we don't just make our money by selling authoring tools. We make quite a bit of money by licensing the player source code for devices.

I dont have the exact numbers handy, but if you check our financial statements you can find a breakdown.

Furthermore, there is not much growth potential in selling tools, but there is huge future potential in licensing the player for devices (to manufactures, not end users), especially as mobile devices explode in the coming years.

So, you can see that a Free and Open Source Flash Player could really cut into their revenue stream. If (for a Mobile Phone or Device manufacturer) the cost of using an Open Source Flash Player is less than the cost of licensing Macromedia's Flash Player, then you'll see Mobile Phone and Device manufacturers switching over to Open Source Flash Players (and Macromedia loosing an amount of this revenue stream).

That's unfortunate. But I think Macromedia is at risk of loosing this revenue stream, even without an Open Soure Flash Player, much sooner than they expected. (I.e., even before the boom with mobile devices slows down.) Consider this. What are Macromedia's risks in the business of licensing Flash Players to Mobile Phone and Device manufacturers? To understand this I think you need to figure out why Mobile Phone and Device manufacturers want a Flash Player on their phones and devices in the first place?

  1. Is it so uses can view Flash web sites, applications, etc off of the Web on their phone or mobile device?
  2. Is it so Mobile Phone and Device manufacturers can create their own in-house (Mobile Phone or Device) application systems using Flash, for their users?
  3. Is it so consultants and in-house development teams can create custom-applications for companies or industry-specific application system using Flash?

If anyone knows of any other reason that Mobile Phone or Devices manufacturers would want a Flash Player on their phones or devices, let me know. But assuming those are the only relavernt reasons... let's look at each.

If it is #1 -- Mobile Phone and Device manufacturers want a Flash Player on their phones and devices so users can view Flash web sites, applications, etc off of the Web on their phone or device -- then this "want" is dependent on how popular Flash is on the Web. In other words, it is dependent on how many Flash web sites are out there, and how many people continue to create Flash web sites. So, the risk here is that people may stop creating as many Flash sites (on the Web), and Mobile Phone and Device manufacturers may no longer see a compelling reason to put Flash Players on their mobile phones and devices anymore.

If it is #2 -- Mobile Phone and Device manufacturers can create their own in-house (Mobile Phone or Device) application systems using Flash, for their users -- then there is a large risk here. A Mobile Phone or Device manufacturer -- a single entity -- can always re-write their application system using another platform. And what if someone gives away their application platform for free (and makes money off some other product, like licensing their operating system, or something else), then Macromedia may face a big problem. (The switch, away from Flash, could even be part of their normal development cycle.)

If it is #3 -- Mobile Phone and Device manufacturers want Flash Players on their phones or devices so that consultants and in-house development teams can create custom-applications for companies or industry-specific application system using Flash, using their phone or devices -- then Macromedia still has ALOT of work to do. (Even though artists and designers love Flash) currently most software engineer do not perceive Flash as a real development platform.

So, what are the conclusions. You need people to keep on creating Flash stuff on the Web. (Flash website, Flash online games, Flash online applications, etc.) Also, you need to make Flash popular among software engineers.

So, what are your strategies for doing this?

For making Flash popular among software engineers, I can suggest a few things.

  1. Development Tools - Developers need proper development tools. Using Macromedia's Flash IDE is NOT sufficient! Now there's alot of development tools appearing on OSFlash. But more needs to be done. (Actually, while I was still writing this, Macromedia announced that they would be supporting Eclipse. So, that's a step in the right direction.) You may also want to assist the open source developers out there making tools and libraries for the Flash platform. (By giving the "info" they need.)

  2. Open Up The Server End - Now, Macromedia's Flash Communication Server is great and all. But I don't want to be forced to use it. The Web would have never taken off if HTTP servers were only made by one manufacturer. And neither will RTMP.

    Now, I can appreciate that you are trying to create a market for your RTMP server by making it integral to Flash. But, you can gain so much more, through the network effect, if you were to make the RTMP protocol as public as HTTP.

  3. Get University Students to Learn Flash - You know, there are ALOT of Java programmers out there because alot of Universities used Java to teach first year Computer Science students how to program. Microsoft realizes this, and worked at switching this to C#. If you want to popularize your platform, then popularize it at the Universities.

    But, before you do that, you'll need a better language than ActionScript! Now, I like ECMAScript based languages (like ActionScript and JavaScript), but I don't think they are suitable languages for teaching (or even that great for software engineering). You're going to need a better language. If you want a hint, create a language with true Functional Programming capabilities. As well as OOP stuff. Take a look at Nemerle if you want an excellent example. And it's even Open Sourced. So you could take this, and make it target the Flash virtual machine. (Note that I am NOT saying to get rid of ActionScript. Only to make other languages target the Flash virtual machine.)

Say No to DRM!
Well, it seemed like Intel had added DRM technology to their new processors. But later, Intel claimed they had No DRM

If you would have read my original draft of this diary post, I had some pretty strong and angry words about this. I had a pledge to no longer buy Intel based computers. And a pledge to make sure none of my clients purchase any Intel based computers either.

I hope Intel (and AMD, and VIA, and all the other hardware manufactuers) realize that there are alot of people who do NOT want DRM. And we will NOT take it being forced upon us. And some of us even have alot of influence in the decision making process with some large companies.

And even if these companies don't publicly come out and say they are against it. The decision makers in the companies are. And we won't purchase any DRM-encumbered hardware.

Open Source and Flash
I've been getting into the Flash world lately. Although Flash is basically a proprietry environment (that Macromedia did a good job of getting onto almost every browser in the world), there seems to be an open source tool set developing for it. ( If you build it, we will come :-) )

Typically, one develops Flash web applications, by using Macromedia's tool called "Flash". It is a GUI editor for building Flash Animations -- SWF files -- that lets you use drag & drop style developing, and lets you do programming through an ECMAScript based language called ActionScript. This might remind you a little of tools like VisualBasic and Delphi. Although, Macromedia's tool is designed more for artists, and is made to be "usable" and geared for them. It does this by using the conceptual model of -- making you think in terms of -- a timeline, clips, etc instead of windows, buttons, menus, etc. (Which is probably why so many artists I know just love this tool.) (I've never actually used it myself. But I've seen others use it.)

Although Macromedia's Flash software comes with a (commerical and proprietry) ActionScript (command line) compiler. There is now an open source ActionScript compiler called MTASC. One of the best things about it (besides the fact that it is open source software) is that it is much much faster than Macromedia's ActionScript compiler! (Just to get rid of any confusion I think some people might be having right now, reading this, these ActionScript compilers compile ActionScript code into SWF files. Not into native code. I.e., not into .exe's or elf files, or whatever the native code format on you system is.)

The open source Flash world seems to be "coming together" now, under the umbrella of OSFlash.org. The open source Flash community is "living" within its mailing list (and on the Wiki on the website). (If you're interested in the open source Flash world at all, go and join the OSFlash mailing list.) This site and mailing list actually was born of all the "off topic" posts on the MTASC mailing list. (There was clearly a need for OSFlash.)

Another interesting open source Flash tool is swfmill. The desription of it from its website says:

swfmill is a tool to process Shockwave Flash(TM) (SWF) files. It can convert SWF from and to an XML-dialect called "swfml", which is closely modeled after the SWF file format.

Apart from this xml2swf and swf2xml functionality, it also provides a libxslt-based XSL transformator that supports an extension ("swft") which helps with generating IDs for SWF objects and can import an SWF as XML using an XPath command (swft:document()).

The interesting part to me is that it lets you create Flash animations (SWF files) via an XML markup language.

To understand why swfmill is important, I should point out that, when making your Flash animation -- SWF file -- you can NOT accomplish and do everything in ActionScript (no matter how much you want to). There are some things that can only be accomplished via the Macromedia's Flash GUI tool.

This is probably somewhat frustrating to people coming at Flash from and Computer Science and software engineering background. (For me, my development tool of choice is nano. I can't stand IDE's and GUI tools. They just get in my way, and slow me down.)

Besides swfmill giving you another paradigm to do Flash development. swfmill also fills in the missing pieces of doing Flash development (using only open source tools) when using MTASC. (swfmill can basically be used to replace Macromedia GUI Flash tool. Although artists might not like this... since swfmill is NOT a GUI tool... but those who like to development they I do development will probably like it. It's like hand coding HTML.)

I'm working on developing (or encouraging others to develop) an open source RTMP server. Right now, I'm trying to understand the AMF data format (used in .sol files and for Flash remoting). It's been suggested that RTMP uses this format somehow. So learning this should help in reverse engineering the protocol. As of this writing, the AMF Specification is NOT done yet. But, if you want to see the work in progress document, it is at: AMF @ OSFlash. (Hopefully, I'll have enough free time to see this project through, and be able to produce an open source alternative to Macromedia's Flash Communications Server.)

New Netscape Browser
The new Netscape browser is out. I actually got a job offer to work on this, because of all my XUL experience and knowledge. (And probably also because the development was being done in Victoria, BC. And I live pretty close to that. In Surrey, BC.) It would have been a really interesting project to work on. Unfortunately, other responsibilities prevented me from being able to accept the offer. (Not to mention that, at this point in my life, I really don't like the idea of having to move to Victoria. It's too far from the Surrey area,... where all my friends and family are.)

We Need an Alternative to URLs
I've been thinking lately that we need an alternative to URLs.

URLs are great in that they let you "reference" or "point to" things. (Such as webpages, files, objects, people, procedures, e-mail boxes, etc etc.)

(Really URLs are the computer equivalent of a "name" in human language.)

However, I think URLs have some failings.

#1: It's integrated with domain names. "Why is that a problem", you might be asking. ("Domain names are alot easier to remember than IP addresses after all.") Well, first off domain names cost money. (Which isn't really the bad part.) The bad part is that people often don't keep on paying for domain names, and they loose them, and "great" websites, or webpages with little "gems" on them disappear. Things like Archive.org help. But, I think a better solution is needed. (Also, Archive.org doesn't get everything.) Perhaps if URLs, or a URL alternative, didn't use domain names or IP address then we wouldn't have websites and webpages disappearing. (Maybe if we used a "free" identifier that anyone could generate. Maybe something like a UUID. And have that mapped onto IP addresses, "hashes", or something else.)

#2: The protocols that a URL can use (as far as I know), technically, must be built on TCP. This makes for a problem. I'll give you an example.

I want to create a desktop application system that used UNIX/POSIX named sockets. And I wanted to "point to" the server for the application using a URL. How do I do that? How do I use named sockets in a URL? It's similar to a TCP port. However, I can't just stick in a "path" to a named socket where the port for the URL would go, since it would include slashes. I guess I could use some method of "escaping" the slashes. However, in using "named sockets" I'm no longer using TCP. And thus, it's not really a URL.)

Got a reply from James Andrewartha -- trs80 -- via e-mail, to my previous post , in regards to me wanting all browsers to have a open, standard, cross-browser, and cross-platform way to creating TCP connections.

James Andrewartha (trs80) replied:

xmlhttprequest is now the de facto standard for this sort of thing. Now with the buzzword name of AJAX http://www.adaptivepath.com/publications/essays/archives/000385.php it's a big feature of so-called "Web 2.0" applications. Also, if you read the recentlog, two entries below yours is a post talking about JSON which is a highly useful encapsulation to get data from the server to the client.

James Andrewartha (trs80), thanks for the reply. I am already aware of XmlHttpRequest, JSON, and AJAX. Been aware of them for a while now actually, even before the terms JSON and AJAX were coined.

There was a time when XmlHttpRequest was one of the best kept secrets of web development. I used to tell people, "alot of the the really cool stuff on the web is done with XmlHttpRequest". (When you make XUL applications, you typically make heavy use of XmlHttpRequest.)

However, I don't think XmlHttpRequest is good enough. Sure, it lets your webpage do things without having to "reload" the page. But that's only one of the problems we faced. (Not the only one.)

The problem with XmlHttpRequest is that it uses HTTP. And the problem with HTTP is that it uses the request-response paradigm. And this results in applications constantly having to poll the server. Which is bad. And it also has the client creating and tearing down TCP connections all the time. Which is also bad.

We need true asynchronous communication. And XmlHttpRequest only gives the illusion of asynchronous communication (because the webpage is not reloading).

I just can't get the performance I need from an XmlHttpRequest. (But I can get the perfomance I need from a TCP connection, using a custom protocol though.)

Complaints about MySQL Replication
It's great that MySQL supports replication. However, more needs to be done to make it work properly. (Or maybe I should say work "better".)

MySQL replication works by essentially sending SQL commands, from the master to the slaves, when the SQL command changes something in the master. Which seems like a good idea. And if nothing ever got screwed up and nothing ever went wrong, then this would be fine.

However, things do get screwed up and things do go wrong, so you need to write your software assuming this. Your software should either be able to detect when things screw up or go wrong, or check for it on a regular basis. And when your software finds out it did happen, your software should either try to fix it, or notifiy someone about it.

Here's some things that MySQL Replication should do:

#1 Check that all the tables have the same structure. (This should be pretty easy to do.)

#2 Check that the data in each table is the same. (At first this might seem like it would be difficult to do, in an efficient way, but it really isn't. You don't have to check every field in every row. If you were to keep a running "check sum" or "hash" for each table, then you could just compare those to detect a problem.)

"Why would any of these problems ever happen", you ask. Sometimes it's from human error. And sometimes if is for reasons beyond the MySQL database server's control. (Like a power failure, or hardware problems.) For example, people sometimes write to slaves when they shouldn't. Backups are sometimes out of sync. (So when you restore things from a backup, and you think everything is OK, it really isn't.) Hard drives have problems. Etc. I've even seen weird problems with replication synchronization that we just can't explain.

It's been a long time since I posted here. About 2 1/2 years. How time flys. (Still need to finish updating my profile though.)

I see that Advogato still does NOT allow people to post comments in your diary (or blog as they call it now). That's unfortunate. People typically post replies in their own diary. But, unless you are consistent about reading other's diaries, you won't see them. Even if you stick with the idea of replying in your own diary, there should be an automatic way of telling the author that there is a reply there. And an automatic way of telling people "blogging" that there is a reply there too.

For a little more than a year now, I've been the lead software engineer at BidClix. I really enjoy working there! Really nice and moral people. Family atmosphere. LAMP based. And, most of all, I like the people I work with.

I could tell you alot about how people really make money on the Internet. About just how big business online advertising is. I had no idea how much money was involved with those simple banner ads, tower ads, etc before I started working at BidClix.

OK, I'm going to start to rant now. I've been working on a project that has a simple goal of sending webcam images (and audio from a microphone) to a server via a persistent TCP connection. And I wanted to do this using common technologies found in most browsers.

I searched various technologies and found out that Flash has built in support for webcams and microphones. I thought, "great, flash might have everything I need". So I spent a day and learned ActionScript. And even found an open source ActionScript compiler called MTASC so I could do all my development on Linux. (BTW, did everyone else know that ActionScript 2.0 is JavaScript/EcmaScript. Because I didn't know that.)

Eventually I found out that using the webcam is tightly bound to the Flash Communications Servers. This server uses a protocol called RTMP -- Real Time Messaging Protocol. I searched to see if there was an open standard for this. There wasn't. I searched to see if anyone had reverse engineered it. No one has yet.

Thus, it doesn't seem like I can use Flash. The system cannot rely on closed protocols. And I have to be able to modify any server.

So what is RTMP really. IMO, it seems like a glorified TCP connection. Macromedia has a good business strategy with this (since browsers don't really let you create TCP connections). (Macromedia guards this business strategy by not letting you directly "get at" images from the webcam. Or else, you could export them to the webpage, and bypass the Flash Communications Server.)

Don't get me wrong. I'm not knocking Macromedia! I think they are smart for doing this. I suppose I'm knocking the browser makers. Well,... maybe I'm not really knocking the browser mackers, but I guess I'm imploring the browser makers to create an open, standard, cross-browser, and cross-platform JavaScript API for making TCP connections. If we really want Rich Internet Applications, then this is a must! Of course there are security issues to worry about. So, you should probably only be allowed to make TCP connections to the same host you came from. (Or, better yet, a host should have a mechanism where it can specify what hosts you can connect to.)

(BTW, if anyone is interested at all. The defacto mailing list for Flash coders is: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders. Just remember though, when posting, that most people on that list are NOT Computer Scientists or Software Engineers.)

Trying to get back into GStreamer. (Was quite knowledgeable about it at one time. I'm sure nobody there remembers me anymore though.) Started off by trying to install it. Tried following what was posted on the GStreamer Fedora Download page. Did a:

    yum install gstreamer-universe
and got a:
    Gathering header information file(s) from server(s)
    Server: Fedora Core 1 - i386 - Base
    Server: Dag RPM Repository for Fedora Core
    Server: Fedora Core 1 - i386 - GStreamer
    Server: Fedora Core 1 - i386 - GStreamer dependencies
    Server: Fedora Core 1 - i386 - Released Updates
    Finding updated packages
    Downloading needed headers
    Resolving dependencies
    .......Unable to satisfy dependencies
    Package gstreamer06-plugins-extra-dvd needs libdvdnav.so.0, this is not available.
    Package gstreamer-plugins-extra-dvd needs libdvdnav.so.0, this is not available.
    Package gstreamer-plugins-extra-video needs libfame-0.9.so.0, this is not available.
    Package gstreamer-plugins-extra-video needs libswfdec.so.0, this is not available.
    Package gstreamer-plugins-extra-video needs libswfdec.so.0(v0.1.4), this is not available.
    Package gstreamer06-plugins-extra-video needs libfame-0.9.so.0, this is not available.
    Package gstreamer06-plugins-extra-video needs libswfdec.so.0, this is not available.
    Package gstreamer06-plugins-extra-video needs libswfdec.so.0(v0.1.4), this is not available.

Really don't want to have to compile everything. Last time I did it, it was really time consuming, and had all sorts of dependecies. Hopefully someone on the GStreamer mailing list will be able to help.

Everyone seems to be creating avatars for themselves now. Well, if you are a South Park fan, then you can use South Park Studio to create yourself as a South Park character. Maybe Advogato can allow people to upload avatar images :-)

Well, posted my first article here: http://www.advogato.org/article/574.html. Curious to see what kind of response it will get.


Continued the work on VNC to add printing support. (The work continues.)

As part of my VNC work, I intend to create a library for VNC clients. It's purpose it to make the creation of VNC clients much easier. (Of course the library will handle the printing stuff too.) Which means that I should be able to use the same library to create the GNOME VNC Client, as the Windows VNC Client. (Of course, this is source code compatibility across platforms, and not binary compatibility.)

29 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!