Adam Hooper (the blog)

Tags

Showing blog posts with tag: Code Show all blog posts
Sep, 2010 back to Feb, 2010: (nothing)
Jan, 2010

Beginning of the End for Flash?

The iPad Apple announced today is, from what I understand, an oversized iPhone—which is great, in my opinion, especially considering it's cheaper than analysts expected. But web developers have already noticed that this mega-iPhone is missing one tool: Adobe Flash.

What's Flash? Only the most ubiquitous proprietary format on the Web. It plays videos on YouTube, handles file attachments in GMail, tells interactive stories on the New York Times, energizes punch-the-monkey online ads, and….

And, it's proprietary. Adobe owns the file formats and the only tools that produce and play Flash files properly. That means YouTube, GMail, New York Times, and just about every web browser on the planet depend on Adobe to function, because Adobe has the right to dictate what happens with Flash files.

Flash isn't the only proprietary software out there. Mac OS is proprietary, as is Microsoft Windows. Internet Explorer is proprietary. Microsoft Word is proprietary. But here's the thing: they're commodities. You can replace Microsoft Word with a Google Doc; you can replace Mac OS with Linux. You can't replace Adobe Flash with anything.

That's a problem: when Adobe Flash, a thirteen-year-old piece of software, lets any website you visit take control of your computer (as in last December's security fiasco), all you can do is phone Adobe and complain. Adobe isn't liable to you, and Adobe doesn't stand to lose any market share because there is no market. Either you use Flash and benefit from its features, or you disable Flash, crippling your favourite websites.

There's a shift coming, and it's called HTML5. HTML is the standard language of the World Wide Web: every page you visit online uses HTML to tell your web browser what to show you. Most pages use HTML4, which was officially standardized in 1999, toward the end of the browser wars, incorporating the features Internet Explorer and Netscape had pioneered so that any alternative web browser could clone them (as Apple's Safari did). HTML4 is ten years old and it's missing some key features of today's World Wide Web: features YouTube, GMail and even the New York Times need.

And that's Flash's niche: it was made when competing web browser makers couldn't agree upon what features a web browser should have, and it supplies the features nobody else has.

HTML5, which isn't finished yet, is being hammered out by Google, Microsoft, Apple, Mozilla (Netscape's successor, which makes Firefox) and any number of web geeks. Their latest browsers break the Flash dependency: even without Flash, they can play videos, upload file attachments and handle interactive animations. When HTML5 is ubiquitous, browsers won't need Flash, since they'll be able to do all those advanced features of YouTube, GMail and the New York Times on their own.

And here's where the proprietary bit comes into play. Flash was created in the wild-west days of the Internet, before people realized how dangerous the Web could be. Those were dark times: evil Flash-reliant web pages could wipe out your computer and steal all your data if their authors wanted. Back then, people were innovating too quickly to worry about security.

Obviously Adobe has plugged most of the leaks, but it's hard to erase a program's origins completely. Maybe that's why a computer-compromising Flash vulnerability was uncovered last December. It left over 98 per cent of people browsing the Web in serious trouble: just by browsing to the wrong web page, they could give away passwords and personal information without realizing.

HTML5 won't be the same. It's not a piece of software: it's just a set of specifications. The web browsers have their own free market, so if one browser causes problems, its users can jump ship and use another browser.

Another browser like the ones being used on smartphones today. Smartphones don't have Flash. Google's new Nexus One smartphone might get it soon, but Apple's iPhone doesn't have it and we found out today it's likely not on the horizon.

Google and Apple phones both support the features in HTML5, though.

As iPhones, iPod Touches and the new iPads gain market share, the people who produce websites will have to consider how many of their users won't have Flash. We ought to see fewer and fewer Flash-reliant websites in the future. And who knows? Maybe ten years from now Flash will be gone altogether.

Without Flash, the Web would be a better place. Here's hoping.

1 comment
Jan, 2010 back to Dec, 2008: (nothing)
Nov, 2008

Engineering Blog-y Thing

There seem to be two aspects to my world these days: real life and engineering. Both vary from stressful to challenging to, at times, rewarding.

Most people who read this blog, I suspect, read it to find out about real life, not about engineering. But I feel I have a fair amount to contribute in the latter category, so I hereby announce the grand opening of The Engineering Section of my website, catering to a new potential group of readers with wildly different interests.

My engineering section is blog-like, but is completely separate from this, my actual blog. I encourage interested software engineers to subscribe to the feed in my Engineering section, as I encourage my current readers to stay tuned here while I write my next proper blog post involving a guy wearing a cat as a hat.

0 comments
Nov, 2008 back to Aug, 2008: (nothing)
Jul, 2008

My Code

Though I have not spent much effort recreating my old website, one small accomplishment is my "My Code" section. This lets you view some source code I have written for school projects and pet projects. It is ideal for university students and people interested in learning to program. Most of the code was written in C, Java, and Python; and at the time I write this, all of the code was written at least two years ago.

Check it out at http://adamhooper.com/code.

0 comments
Jul, 2008 back to Jun, 2008: (nothing)
May, 2008

Website 2.0

<p>I am busy rebuilding my website. The new version is better. It is built using <a href="http://rubyonrails.org">Ruby on Rails</a>, which deserves a plug. The hacker in me couldn&#8217;t resist writing a blog engine from scratch.</p> <p>Don&#8217;t mind the mess. Not all links behave as they ought to, and I will be putting more content in soon. I figure a website like this is better than one of those animated &#8220;Under Construction&#8221; websites from the 1990&#8217;s.</p>
0 comments
May, 2008 back to Apr, 2006: (nothing)
Mar, 2006

WebCT auto-login

Even more stuff about McGill's network that I hate! WebCT (the worst classroom management web system thingy) at McGill has a really stupid sign-in page. I used to be able to bookmark the login page and enter by pressing Enter; but when they upgraded to WebCT Vista they removed that feature.

I wrote a Greasemonkey script which automatically clicks the Submit button on the sign-in page. It assumes your password is auto-completed.

It eliminates one of those little things that makes life just a teeny bit worse.

I've only tested it with the Epiphany Greasemonkey extension but I expect it works with Firefox as well.

0 comments

McGill Wireless - if-up script

Last blog entry I displayed an Epiphany plugin to solve one of my McGill wireless woes. Today I spent about 45 minutes playing with wget and bash, and I came up with a much better solution. It's quite McGill-specific, and unfortunately for many of my friends it won't work on Windows, but here it is:

Dump the following into /etc/network/if-up.d/00mcgill-wireless-login:

 /dev/null
[ $? -eq 0 ] || exit 0

# Bizarre variables for the authentication page
LOGIN_PAGE=https://wireless-login.mcgill.ca/wireless/webpages/noc-authenticate.php
NAS_HOST=www.noc-cn3000.com
NAS_IP=`host $NAS_HOST | sed -n -e '/^.*has address (.*)/{s//1/;p;q;}'`

# Pretend we're a web browser
wget "$LOGIN_PAGE" -o /dev/null -O /dev/null 
        "--post-data=username=$USERNAME&password=$PASSWORD&button=Login&ipaddress=$ADDR&CN3000_INT_IP=$NAS_IP"]]>
0 comments

McGill Wireless

At McGill, our wireless network requires a web-based log-in. That is, the first web request results in an authentication web page being presented to the user. After the user types in a valid username and password, some voodoo is performed, and an authentication succeeded page is displayed.

There are two enormous annoyances:

  • No Internet is available over any port until the web page has been visited. I'm constantly frustrated: email, VNC, ssh... none work. I haven't looked into how feasible it is to write an if-up.d script to automate the log-in.
  • After typing in a web page and hitting Enter, the authentication web page intercepts; the original web page the user typed in is never presented. This is especially annoying because the URL of the authentication succeeded page actually contains the originally-typed web page as a GET parameter. Why don't they just use a simple HTTP redirect and save thounsands of students the trouble?

One day a flash hit me, and I realized I could solve the second problem (which I'll admit only exists because of the first, which is still annoying) in ten minutes, using an Epiphany extension. It had been a shameful while since I'd last written one, but my sample-python-location.py example was extremely close to what I wanted.

I just created the following in my ~/.gnome2/epiphany/extensions, and enabled the extension through the extensions manager:

redirect-mcgill-wireless.py:

redirect-mcgill-wireless.xml:



        Redirect McGill Wireless
        Redirects from McGill's wireless page
        Adam Hooper <adamh@densi.com>
        http://www.gnome.org/projects/epiphany/extensions.html
        1
        epiphany-extensions-1.6
        /opt/mozilla-1.7/share/locale
        
                redirect-mcgill-wireless
        
]]>
0 comments

Multiple Projects

Back when I started at university, I'd be able to immerse myself in projects. I accomplished quite a few things, one project at a time.

Now things are different. I'm taking only four courses this semester, but three of them have semester-long projects. I am currently working on:

  • An Internet version of the game Pit, using the Twisted Python framework for the Internet part and client. The end goal: code an AI player for the game (language undecided: either C++ or Python, probably).
  • A simulation of a distributed computing network. This involves a simulated local network of processes (using an event queue) as well as a real network component (using MPI). Language: C++.
  • A sticky-notes application. I really like this one. Language: Java.
  • (Work, not school:) A medical-imaging application, using Qt, VTK, and ITK. Language: C++ (and each of the libraries has a different idea of how C++ should be written, leading to acute pains in my neck.)

Switching between projects takes a change in mindset. As soon as I get immersed in one, I discover I've neglected another. It's a real pain. Not only that, but I strongly dislike C++.

Also, I've had to shelve some projects I would have enjoyed. If I had more time, I would code the following:

  • A Java applet (complete with AI player) for Black & White, a game I had to code (in C++) for a recent AI assignment. Apparently my cousin Corey visited my web and was disappointed; I figure putting a game on it would gain his interest. Language: Java.
  • Integrating SQLite with Epiphany's History and Bookmarks. It would give speedup and code cleanup. It would also make extensions easier to write and more powerful. Language: C.
0 comments
Mar, 2006 back to Dec, 2005: (nothing)
Nov, 2005

Blog category list

Ironically, the only time I actaully blog is when I'm hacking at my blog.

I wanted a simple HTML category list for my Pyblosxom blog. I hacked something up quickly, without much regard to maintanability or portability.


'
        for d in dirs:
                rd = os.path.split(d)[-1]
                html += '   
  • %s
  • ' % (rd, rd) html += ' ' data['categoryList'] = html]]>
    0 comments

    XHTML compliance

    I just set up this blog with PyBlosxom. The installation was completely smooth, and it was trivial to get the style the way I wanted it (like the rest of my website, that is).

    But getting XHTML 1.1 compliance took a long time, because of of the Content-type header. I ended up having to write a plugin, which meant learning how PyBlosxom renderers.

    My default flavour is called adam; with that in mind, here is my plugin:

    0 comments
    (admin stuff here)