2010-05-04

Sugestion: Scrap Javascript, use type="text/somethinggood"

I'm very excited and optimistic about html5 (just read http://diveintohtml5.org/ for instance).

Hoping for the same good feeling when catching up on EcmaScript 5, I'm left very disappointed.

For instance just look at what you have to do to create an somewhat ok behaving object:



function Point(x, y) {
  return Object.freeze(
    Object.create(Point.prototype, {
      x: { value: +x, enumerable: true},
      y: { value: +y, enumerable: true}
    }));
  }



That is not nice code!!

I understand that they are some very clever people working hard on this assignment, making it predictable and usable across platforms (browsers) and maintaining backwards compability. But it seems to me that it is the assignment that is plain wrong.
Leave javascript messed up as it is. The 'use strict;' is nice though (and a very appropriately chosen keyword, remembering from where it originates...).

There are tons of good languages out there today, and there is an attribute on the <script>-tag called "type". Why not use it?

My dreamteam:

type="text/groovy"
type="text/python"

Sure it will take time for the world to adopt. But all the more reason to move on from js and get started on something decent. NOW.


2010-03-15

Inbäddad webbtv

Här är ett inbäddat inslag från hd.se. Spelare: flowplayer

2010-02-12

The most beautiful thing

I can think of right now: http://open.spotify.com/track/78LNk4Elk106k22nb90ENS It's killing me

2010-02-11

Jersey in tomcat5.5

Just a quick tip. To get Jersey up and running on Tomcat5.5 without getting the
ClassNotFoundException: javax.persistence.PersistenceUnit
If running the same webapp on Tomcat6.0 works, but you still need it in a 5.5 environment you can copy the file $TOMCAT6_HOME/lib/annotations-api.jar into your webapp WEB-INF/lib directory, and everything should run.

This is the content of my WEB-INF/lib directory:

annotations-api.jar
asm-3.1.jar
groovy-all-1.7.0.jar
jersey-core-1.1.5.jar
jersey-server-1.1.5.jar
jsr311-api-1.1.1.jar
(yes I'm using groovy too, thanks to Creating RESTful services with Jersey and Groovy). This is the web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
  <display-name>JerseyTest</display-name>
    <servlet>
      <display-name>ServletAdaptor</display-name>
      <servlet-name>ServletAdaptor</servlet-name>
      <servlet-class>
        com.sun.jersey.server.impl.container.servlet.ServletAdaptor
      </servlet-class>
    <init-param>
      <param-name>load-on-startup</param-name><param-value>1</param-value></init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>ServletAdaptor</servlet-name>
    <url-pattern>/resources/*</url-pattern>
  </servlet-mapping>
</web-app>