Response to Steve Jobs’ Open Letter to

http://www.engadget.com/2010/04/29/steve-jobs-publishes-some-thoughts-on-flash-many-many-thou/

I mostly agree with most of the technical issues he raises and I think the lesson here is that it does, in fact, pay to use open standards. However, there are some things he says that I take issue with as a developer:

Replacing flash with H.264 is not an option right now for several reasons. Firstly, flash isn’t simply a way to view video. At present there is no way to have interactive elements in a web page that work on desktop and iP* other than javascript, which has its interoperability problems (though the jQuery and prototype folks usually do a good job at sorting that out for you). Second is the notion that H.264 already is the default format for HTML5. No, it is not. That has not been decided yet. Hopefully H.264 doesn’t win since it, too is proprietary, the very thing Jobs takes issue with for Flash! I even notice that at Apple stores, the employees are basically told to tell this tale to customers who are web developers that they should just replace everything with HTML5 and H.264. I hope that Google does open-source VP8 and that it becomes the format that wins, or VP8 and Ogg and that Apple doesn’t kick and scream in protest when they win the HTML5 video format wars. We don’t want .gif part 2!

Jobs also has a disdain for 3rd party development tools. Here I see the motivation as business, not technical. We developers have only so much time-money and Jobs knows that making it difficult to support multiple platforms with the same source tree more or less will make a lot of developers chose to develop only for Apple’s products. Jobs knows this very well and I believe it was behind the decision not only to not allow Flash but also to not allow Java. Jobs even boldly chided Java as something no one uses anymore. No one? Well, except for their mobile devices’ biggest upcoming competitor, the Android platform. That’s all.

When developing C++ desktop applications, I don’t want to waste my investment. I use Qt. It doesn’t block me from using the latest innovations in Windows, Mac OS X or Linux’ desktops (KDE and Gnome), but it gets me most of the way easily. 90% of the time for 90% of the people making business apps (not games), OS specific GUI code shouldn’t be necessary. I believe the same is true for mobile devices. Without writing with the iphone in mind, I believe you can have your tool translate your menus, form items, etc. into the appropriate code for different platforms. Apple won’t allow this. My understanding is they won’t even allow this if such a tool (including the tool Adobe made earlier to translate Flash into Obj-C) even if you hand-edit the code after generation or make your own regexp to modify after generation (so at least minor edits won’t require a rewrite to remove wasteful routines, etc.) This is a shame. It’s bad for developers and consumers, but good for Apple. It also directly affects me as I was planning on making an XUL to iphone gui converter.

So again, I absolutely agree with Jobs’ assessment of Flash’s shortcomings. If he is serious about them, though, I trust that he will allow Flash once they are addressed? If Adobe fails to correct these issues and it may be impossible without breaking backwards compatibility, their prize platform may go the way of the Dodo, with or without Apple’s sabotage. At the very least, I believe something that creates obj-c from an AS3/Flex project should technically address the issues.

Newscientist: Horizontal and vertical: The evolution of evolution

http://www.newscientist.com/article/mg20527441.500-horizontal-and-vertical-the-evolution-of-evolution.html?full=true&print=true

Lately, I’m increasingly thinking, especially after reading this article, that evolutionary computing would benefit greatly from using a more bacterial type of evolution, where genes are shared between often unrelated organisms, rather than brute inheritance. Another way of looking at it, is it might be good to deal with the complexities of subroutine sharing (which functional programming would make easier) than the complexities of sexual reproduction which make my eyes glaze over to read the solutions offered for. Maybe I’m just not clever enough (my earlier post on genetic programming had a little ruby script and it only uses asexual reproduction).

I am skeptical of the article’s claim that the shared genetic code of all organisms must mean that genes were shared between organisms like bacterium do today. Firstly, bacterium don’t all share some common genes due to the passing of genes between species as it is. Secondly, clade evolution – where clades that are just better at evolving edge out others over time could be sufficient explanation. Surely DNA-based life had immense advantages over life with less fault-tolerant code. Just the same, the article makes a good point that biologists are, being human macro-centric – they focus on multi-cellular organisms even though most of the biomass, even more of the variety, along with the vast, vast majority of the history of life on this planet, is prokaryotic.

Exercise 3-6: Sorting Lists & 3-7 Using Library Modules

It looks like there’s one other guy on the internet who’s posting his answers for the exercises in this book. So, I’ll be linking to his so you (and I) can compare our answers. He knows what he’s doing. In his posts, he talks about, e.g., what he’d do in Haskell. I’m not a functional programming guy (lisp gives me the heebie-geebies, my earlier post on evolutionary programming where I used it notwithstanding). So, below are my answers (click to see more if you’re looking at the blog and not this post by itself) and here is the Japanese guy’s answers.

Continue reading

Erlang Exercises – Chapter 3

I learn by doing much more than by reading or listening, so as I go through O’Reilly’s Erlang Programming, I take the exercises at the end seriously. Generally, when I learn a new programming language, while I read, I’ll make a program of my own choosing, perhaps something that will be useful to me or that I could sell. However, with Erlang, I don’t even know where to begin using it yet. I want to get really, really good at it before I even attempt to make anything with it (I think remembering the mistakes I made with my first Ruby on Rails project caused this shift in attitude.. and let’s not forget the triumphs of reading Mastering Regular Expressions in its entirety).

I will be posting my attempts at the exercises, in case others might find it useful or seasoned Erlang programmers might tell me what I may be doing wrong. I’ll be spacing out my answers to chapter 3 over the week to keep things interesting. Here are the first three exercises from Chapter 3:
Continue reading

I Created Life!

Here is a ruby script I quickly whipped up to teach myself genetic programming/evolutionary programming, and also to demonstrate basic principles of biology (please see below to see how it works.. if you’re on my front page, click to read more first). I think I’m going to write something more sophisticated in erlang (I don’t know erlang, but I’m intrigued) after I get further down the road in gp, but here’s what I quickly whipped up. Since writing it, I have started reading A Field Guide to Genetic Programming and already notice some things I should have done a little different. But in some respects, having a simple string of characters change their role in different modes is elegant and I think I prefer that way of doing things, despite shortfalls in statistical bias. Here are some observations I have at this point:

I know the people researching gp are really smart, so there’s probably something I’m missing, but I don’t see how genetic programming is supposed to quickly find solutions. Evolution is as slow as molasses. You need to dig through millions of years of dirt to see actual changes. I can only see gp quickly finding solutions if the process is being run continually, with multiple challenges or “resources”. I was glad to see, after having this thought, mention of multi-objective (5.1.3) and coevolution (5.4) in the book. It makes me think I’m on the right track. I also remember a while back reading in the article Discover had about Avida that when there was only one resource, one species would quickly capitalize on that and then the evolution would stagnate, but having multiple resources would create diversity and even better solutions at attacking that one resource. The ability of organisms to repurpose adaptations is important in evolution and without it, most complexity would not have been possible.

This leads me to another point. It seems gp works best when it works the most like evolution in the real world works. The rate of mutation is low and, despite my initial intuitions that a high mutation rate would lead to a good solution more quickly, I found that it was actually harmful to do so. Even though, in this script, there is a bias towards shorter programs (the longer the chromosomes, the more calories it takes to create just one offspring), when I had a higher mutation rate, like, say, 1 out of 5 copies, the length of the genes would get really, really long as a defense against mutations. This could happen because if the last parenthesis of the mini-lisp program is closed prematurely, the rest of the genes are ignored. Junk dna. In my program, at least, junk dna was a defense against mutation since I would get really short programs that have long tails of junk after them, but decreasing the mutation rate shrunk those tails down to almost insignificant. Weird. Please try downloading this and edit it to see for yourself.

While mutations should be rare, it helps to have variety. I did just substitutions at first and it worked, but it took a while. I also added stutters, insertions and deletions. Once I added stutters, it helped a lot! Even before adding stutters, I found that, when the “challenge” was 6 * x, I would get x + x + x + x + x and something like 7 * x competing with each other for a long time (5x or 7x often becomes the leading candidate after a few generations and it takes forever for any 6x to show up). Adding the stutters seemed to get multiplication through addition happening faster, though.

Download yeasties or copy/paste from below (requires ruby and clisp):

Continue reading

fucking malloc()!

I am RETARDED! I spent most of today trying to get this app using OpenAL to work with a manually generated buffer (ie, not using a wave-loading function). I kept on trying to figure out why the damn program wouldn’t run without segfaulting. Finally, only after looking in the sources for ALUT, I realize that I should be using malloc instead of new like some sort of C++ baby.

stupid bug

there’s a bug in magpie, which this site uses to print out content from blogger. at least it’s a bug as far as I’m concerned. basically, it seems to convert the html entities into the actual characters (unless the actual php xml parser classes do this..) and as a result, the example wml file in the post below this one doesn’t appear. stupid!

Serving pages to cell phones

If you are bored on the train, never fear! Ugly, slow-loading websites on your cell-phone to the rescue! Seriously, kids. You can make a portable version of your website so easily.

Basically, you make the pages (index.wml) and throw them up. Easy, right? Below is a sample wml:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="c1" title="Thomas J. Webb" >
        <p>
        <a href="news.wml.php">blog</a>
        </p>
</card>
</wml>

Most webmasters like to put the WAP version of the site in a different subdomain (such as wap.yahoo.com), but I don’t know why they bother. We have a wonderful thing in Apache called content negotiation. Throw everything up there and let the webserver sort it out. First, enable multi-views in httpd.conf:

MultiViews on

Then set the directory index as simply index. This way, the webserver selects from index.html (or index.php or whatever) for regular browsers and index.wml for cell-phone browsers.

DirectoryIndex index

Another higher-performance alternative to MultiViews is to simply use a .var file for the index. See Apache’s documentation for details…

携帯のサイト

つまらなくて電車に乗ってる時、つまらないサイトを見られる。楽しいね!まじめに小さいバージョンを作りやすいだよ。

まず、index.wmlを作ってアップロードして。やさしいね。

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="c1" title="Thomas J. Webb" >
        <p>
        <a href="news.wml.php">blog</a>
        </p>
</card>
</wml>

ウェブマスタはほとんどサブドメーンを作る。たとえばwap.yahoo.com。でも、何でか分かんねえ。ApacheのContent Negotiationはスーパーである。サーバは頭が言い。まずhttpd.confにコレを入れて。

MultiViews on

すると、始め見るページがindexにさせて。サーバはindex.htmlとindex.wmlの中に決心出来る。

DirectoryIndex index