A Timid Defense of Flash

Posted by knorby on May 5, 2010 under Android, Apple, Linux, coding, facebook, firebug, firefox, flash, google, internet, javascript, media, mozilla, rants, video | Be the First to Comment

First off, I hate flash. I use linux, and I have a netbook; I know very well how bad it can suck. For reasons beyond my comprehension, flash audio just breaks occasionally on me, including in AIR. On top of that, I have done a lot more web app development in javascript in an attempt to  push browsers to their limits than I ever have flash. Aside from Sound Manager 2 (which doesn’t really count), I think the last time I did everything in flash was flash 7, so aside from some side knowledge, I know very little about flash. I really hope HTML5 is successful, but I don’t think it is a direct replacement for flash, no matter how much  Steve Jobs bullshits. Here’s why:

Content Control

In the mad rush to move any web video over to flash, a serious point has been overlooked. Youtube may be able to set up backends for HTML5 video formats, but can Hulu? It is possible to save hulu apparently, probably though some strange use of rtmpdump, but from what I could see, those methods were convoluted at best. The question comes down to how something like Hulu, which must have ads on each video to survive, use something other than flash. I know from experience that ad block can stop the streaming of hulu ads, but hulu forces a longer black screen on you otherwise. I haven’t looked into the specifics of what goes on in the whole process, but it is safe to say that it is easier to restrict how content is handled on flash than the standard browser environment. The problem comes down to this: if uncompiled code is sent to clients, the client has the final control on how content is rendered. I wrote up a now broken approach to eliminating some facebook ads with simple css in firefox a while ago, but such approaches have only become more widespread. Site owners are starting to take notice of things like ad block, and some take serious offense. Facebook went as far to send a C&D to a firefox extension that modifies facebook rendering, of course they are pretty evil at this point (I am thinking of deleting my account, but that is a different story). I predict that in the near future, the question of how clients are allowed to modify the rendering of content will become a central issue to many web apps. The simple truth is that a compiled flash swf provides better code security than javascript obfuscation by several magnitude.  Both on the front of audio and video and on just general content, flash provides content control that a browser just can’t match.

Standards are Slow to Adapt

If you have been following any of the debate over H.264 vs. Ogg Theora (better format vs. open), something will be apparent: content hosters have a bad deal. Which standard will prevail (probably H.264)? Is it worth doubling the number of videos to accommodate firefox? The questions go on. When flash introduced video, it was simply a matter of “run this version” on all platforms. The thing with browsers is that they are big projects. Chrome, which doesn’t even have the task of maintaining a full rendering engine, suffers from problems already as a result of being too big. I submitted a bug to Chromuim about 6 months ago for an SVG issue in the developer tools; I submitted the same bug to firebug first, and what I have seen says a lot about chromium. The firebug issue was tagged (for triage) on the same day I submitted it, and the fix was in a beta 4 months later. It took 3 months for chromium to do what it took a day for firebug to do (look at it), and all I have seen in about 6 months is a couple extra tags, and a few irrelevant comments. Mozilla is quicker with firefox bugs, but it is also safe to say that chromium  has focused more on performance. These stats don’t even consider the number of developers on each, many of which professionally work on firefox and chromium, which can’t be said for firebug. I am not trying to raise questions in how open source development goes, but once HTML5 features lose focus, what will happen with bugs? What will happen when a better video standard exists? You can’t just fix standards; that’s why javascript and css are what they are.  There is something to be said for keeping stuff in third party apps.

Maturity

Flash games have a special place. Traditional games don’t fill that niche; mobile games can’t fill that void; the truth is that it will take a while for javascript + canvas to substitute. It is a new technology, and one with interesting potential, but it is new, not mature. You can’t expect normal flash game developers to all of a sudden start writing stuff for the pure browser, especially when it gets harder, not easier. That doesn’t even consider SVG+javascript, which is actually a more near equivalent of flash, and even as that is more widely deployed, I will just say that it is even farther from being in a real production state. I wrote a web app on it, and I encountered, and still encounter, all sorts of weird browser bugs. To keep it short, it isn’t better to develop on an immature standard on 5 different platforms on 3+ different OSs than flash.

Conclusion

I think there are a lot of pros and cons in both directions of Flash vs. HTML5, and I hope and think that HTML5 will take over many of the uses of flash now. I think my defense of flash is rather incomplete, and my love of the browser environment is hardly expressed. Regardless, java, flash, or other plugins have served as the innovators of new approaches for a long while, and there is something to that. I hope third party methods don’t disappear, as I think the web ecosystem will suffer as a result.

I realize this post was mostly a rant, so if you have anything to add, please leave it as a comment, or send something to me.

My Project Ideas for Google Wave

Posted by knorby on November 10, 2009 under Python, coding, doit, google, internet, wave | 3 Comments to Read

Silly:

  • fortune/doit – Implemented. See Wave Fortune. You can use it be adding wavefortune@appspot.com to your contacts. I mostly made this bot to satisfy my fortune lust, and to get more familiar with app engine and the wave bot api.
  • wompus/adventure – Not sure I am actually going to do this one. If I do, it will be the wompus. Basically, the problem to solve is effectively storing state for such games. Wompus is tiny, and the games are short, so it wouldn’t take much thinking. Adeventure/zork would require a lot more work, and I honestly don’t care that much.

Tools:

  • logging interface – It occurs to me that wave might work great in a situation where I think e-mail falls short now: data/msg dumps. I see this sort of thing at my jobs a lot. I get a log messages I generally don’t care about, and I filter them out, and as a result I sometimes miss something. A similar case is something like a bug tracker, where so many replies can be generated that the thread is easy to ignore. Centralization would help a lot I think, but again, I am not sure I care.
  • RPN calculator - Nothing really to explain here. Could do save the calculator’s state in past blips, and make them editable. The end result would be a collaborative calculator of sorts. Could be interesting.
  • something with jMol – Not too much thought here. When I was a student in the Computational Material Science group at ORNL, I ended up playing with jMol a bit from javascript. Some sort of gadget/bot combo could do some interesting stuff, but again, I don’t care.

I will post more about my thoughts on wave later on, as I have many mixed thoughts on it. Google has a lot to do, both on wave itself and extensions that they should provide. I am hesitant to work on large projects, as I don’t want to have google copy my work, or experience some odd situation with app engine. I don’t think anyone, google included, has any remote idea of what to expect from wave yet.

Something I Want: Simple Environment Setup

Posted by knorby on November 29, 2008 under IT, Linux, Python, Solaris, coding, shell scripting | Read the First Comment

I am mostly jotting this down so I can work on this later and to see if anyone has any suggestions.

I was thinking last night that I need to setup my own personal environment on new systems quite a bit, and that isn’t going to change anytime soon. I do not want to work off of something too centralized, as I really don’t have that option. I need to be able to maintain a setup on my home machines, various UChicago machines, and various other machines. In some cases, I just need a work environment for a short term period, such as on maclab machines (although I usually just ssh into one of the linux cluster machines and use X11 forwarding to load up XEmacs GUI goodness). sshfs isn’t an option, as it sucks, and FUSE isn’t always installed everywhere (for good reason). Subversion might serve nicely, but I can’t assume that it is installed, as it often isn’t; I tend to think Subversion or other repository systems shouldn’t be used for much beyond software development. I also need to worry about various differences in systems. I can always install software to the system or to my home directory, and various UNIX flavors have their own quirks, especially Solaris. So what I want is an initializing setup script that downloads and extracts a basic environment from some central server. Everything in this set of scripts should be sectionalized. There should be some decent metadata format (probably some XML format) to store information about these sections and on the sections installed. There should be some update system on top of that. In the case that a package management system is available, the system should be able to use it, and as fall back, download and install a few specific packages into my home directory. Things like python would use already existing systems for setting this sort of thing up. Given that the system would assume almost nothing, most of the initial system would probably need to do processing on the server side. Other than that, the only software that the system would assume would be ssh, bash, and tar (maybe). This thing will take time, but I think it would be useful for a long time to come.

Fun with One-liners

Posted by knorby on October 23, 2008 under Python, coding, javascript | Be the First to Comment

I have always enjoyed putting as much work as possible into a line, especially in higher level languages. In the crazy javascript (speaking of which, MochiKit 1.4 was finally release!) system I wrote (still need to put the final touches on that….), I was thrilled when I was able to combine all of the parts of my system into one one line. Since I mainly program in python, list comprehensions and generator expressions make it pretty easy to use one liners a lot, and at least with generators, it often means that is efficent too. Basically, what I am trying to say is that I love the one liner. Last night, while I was bored while doing my discrete homework, I came up with a memoized factorial function one liner. The standard, niave version is straightforward:

fac = lambda n: int(n==0) or n*fac(n-1)

Since I was bored, I wanted to see if I could memoize that expression, and still keep it in one line. Here is what I came up with:

fac_dict, fac = {}, lambda x: ((x in fac_dict or fac_dict.update({x:(lambda n: int(n==0) or fac(n-1)*n)(x)})) and False) or fac_dict[x]

which can be simplified slightly to:

fac_dict, fac = {0:1}, lambda x: ((x in fac_dict or fac_dict.update({x:(lambda n: fac(n-1)*n)(x)})) and False) or fac_dict[x]

There are still issues with recursion depth for large values, but a helper function could probably solve that.

I needed to write something for my blog, as I have gotten out of the habit, and this thing seemed as good as anything.

Fixing Facebook with userContent.css

Posted by knorby on August 5, 2008 under coding, css, facebook, firefox | 6 Comments to Read

I posted something previously on blocking social ads in facebook with greasemonkey, where I came to the conclusion incorrectly it could not be done with css. I apparently remembered what “! important” did in userContent.css and userChrome.css; I read “! important” as “not important,” but it aparently means the opposite, and overrides any webpages css. I corrected my post on userContent.css and userChrome.css customization as well. Stupid logic. Anyway, if you add the following block into your userContent.css file, you should be able to block most annoying stuff on both the new facebook design and old.

@-moz-document url-prefix(http://www.new.facebook.com/) {
.sponsor, .invitefriends, .findfriends, .gifts_received, .pymk, .social_ad, .adcolumn{
display: none ! important;
}
}

@-moz-document url-prefix(http://www.facebook.com/) {
.sponsor, .invitefriends, .findfriends, .gifts_received, .pymk, .social_ad, .adcolumn{
display: none ! important;
}
}

There may be a way to combine these two, but I don’t know the more mozilla-internal css well enough to know. If you use facebook, most of these should be clear. I blocked gifts, as I find them annoying, and I am glad to just not be aware of them. I also blocked the person finding features like “people you may know” (‘.pmyk’) or the email search things. I also blocked ads of course. Facebook seems to have to idea that everyone will love ads if they are more specifically targeted at you, based on data they have on file. I can’t stop them from doing that (other than by closing and deleting my account), but I shouldn’t have to see ads if I don’t want to IMHO. Also notice that the new facebook design and the old one use the same css classes for everything; the redesign isn’t that extensive apparently.

I’m on the Google Open Source Blog!

Posted by knorby on June 6, 2008 under ACM, Chicago, GSoC, OpenBSD, blogs, coding, globus, google, personal, uchicago | Read the First Comment

It’s true! Borja wrote up a summary of the GSoC lightening talk event, including pictures. If you don’t know what I look like, I am in both the GSoC student one and the ACM officer one. I really wish I got a haircut before this thing….

Borja linked to our website, which hopefully won’t get too much traffic. It is currently at 359 days of uptime, and I have shooting for a year of uptime before upgrading to the latest and greatest version of OpenBSD.

The Last Little Bit

Posted by knorby on April 22, 2008 under Apple, Solaris, coding, google, personal, rants, uchicago | Be the First to Comment

I haven’t been posting a lot recently, so I thought I would just kind of outline a little of what has been going on recently.

Some members of the RAS installed the weather station on the roof of Ryerson today (I wasn’t involved in the efforts today unfortunately). In addition, the web view now works (not me again), which I started on. It is still temporary, but it is currently up. I will be assembling a better website, which will be more permanent. I was fearing we wouldn’t be able to get it onto a POSIX operating system, but then wview came to the rescue. I will put up some pictures soon. It was really great to see it finally on the roof. It was some random idea I had a while ago, and it finally materialized.

The biggest news for me today is that I was accepted to Google Summer of Code on the Globus Toolkit. I will be working on a diagnostic administrator interface framework; essentially, it is more Python+XML work, but with Globus. This will also be the third summer in a row that I have done XML work with people based at a national lab (Globus is based at Argonne–not the same as actually working there for the summer, but I will be visiting soon). I will also be working at the Maclab, which should be fun and a chance to do some real work on projects there.

A lot of people are leaving the maclab at the end of the quarter, so I will end up with quite a bit more on my plate it looks like. After the last two weeks or so, I look foreword to that less. Over the last break, I converted many of the servers to Leopard Server, Apple’s latest rendition in bloated bad design. From that experience alone, I lost all respect for Apple (there wasn’t much there in the first place). What kind of upgrade on a server edition of the Operating System overwrites the most basic of configuration and files on upgrade? This last week, our web/dhcp server went down at the same time as our print system, our two most vital systems. From what it looks like now, DirectoryService, the LDAPesque utility that Apple now uses for local accounts as well. epically failed, and I do mean epic. There are some other problems as well; the actual cause is still allusive, but we at first presumed hackers, which can’t be ruled out. The print system? As far as we can tell, the problem is that Leopard is a horrid piece of shit that ruins every piece of software it touches. The implementation of CUPS on it is horribly broken (to a vast extent), despite the fact Apple owns it! I will spend more time in the short future on a series of posts that outlines my points of hatred for it. Dealing with the problems rated pretty high on my rankings of stressful events, and there is still work to be done.

Together with another failure, this time from NSIT, I think I know fully grasp an important life lesson: assume incompetence. NSIT made a pathetic effort to announce that they were going to switch the LDAP server from OpenLDAP to a Sun-based implementation . Apparently, they had a test server, but they neglected to give the address out, or test it on their own machines. NSITE/USITE has its own Macs, even another Maclab (I think of it as the bazarro Maclab; the imaging work is handled remotely, the none of staff know much computers from what I hear, there are few users, and the software is up to date), of which at least some run Tiger. No one tested these to see if logins would, you know, work. Anyways, all our tigers failed to login after the switch. It turned out to be some check box on some security page (in fact the only check box on the security page), for which it took 7 people 48 hours (I think that’s with few breaks in it) to find the fix. We decided to let them deal with it as it was their problem. Incompetence really explains this whole thing well. When we were switching to Leopard on the servers, the ServerAdmin presented us with a catch-22; it was impossible to save setting on one page without saving the settings on another, but it was impossible to save settings on the other one without first saving the changes on the first. What accounts for this flagrant error in the GUI? Why incompetence of course! I experienced a similar sort of situation on a Sun box I work on; everything program I used seemed broken. I e-mailed the sysadmins for a while at which point this golden rule struck me. I ended up compiling any program that failed to work on something. For example, there was some weird error with make. so I compiled and installed gmake to my home directory, and it solved all my problems. I suppose it is not fair to just call this incompetence; laziness should be added in there somewhere.

Some other stuff has been happening, but that makes for a decent mind-purge. It’s nice out again! I can where sandals and shorts comfortably!

Playing With Ctypes and Ghostscript

Posted by knorby on March 25, 2008 under C, Python, coding, postscript | Read the First Comment

I have been playing around with the ctypes library in python recently. It is a foreign function interface for dynamic linked libraries(DLL)/shared libraries. It works back to python 2.3, and it was added into the standard library in python 2.5. Anyway, it provides a much nicer way to access C libraries then using one of the various methods to create a C extension, though it is a bit slower. As I learned at pycon, one of the benefits is that PyPy (one of the craziest things I have ever seen) can use ctypes. I was thinking of staying for the PyPy sprint at pycon, but I think they were going to work on a pure python implementation of the library, which was far too intimidating to me. I will post about pycon at some point soon.
I guess I find ctypes so special just because it is the first thing in recent history with python where I was really amazed. I first saw it with µTidylib, which is a python wrapper around the HTML tidy library. What got me was just playing with it on the interpreter:

>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> libc.printf("Hello, World!\n")
Hello, World!
14
>>>

Obviously, it is a lot more powerful than this example illustrates, but you get the idea. I have been fixing up some of the filters in the print system at the Maclab over spring break, so I have been working with ghostscript a bit. There is an API for ghostscript, so I have started writing a wrapper library for it in my free time to practice using ctypes, and, well, because one doesn’t exist. I am trying to think of a name that somehow combines ghosts, snakes, and desktop publishing….