ginger’s thoughts

Silvia’s blog

So you think you deserve an award…

Posted in Open Source, Stuff by silvia on the July 20th, 2008

…because of your outstanding contributions to Australia’s computing sector, but haven’t had the chance to put yourself out there? Or you have a friend who really deserves an award for his excellent work? Here’s your chance.

This year’s NSW State Pearcey Award is open for applications and nominations. It is one of the only Australian awards that singles out individuals and their contribution to the Australian ICT profession early in their career (where “early” is used rather flexibly to mean anyone who has not yet reached the end of their career).

If you have made any outstanding technical innovations or created novel commercial businesses in IT in NSW, you should consider sending in your CV.

Previous award winners can be seen here. There are some excellent people - even some from the open source community. In 2006, James Dalziel of MELCOE won the award. Jeff and Pia Waugh won last year. And I was myself highly commended in 2006 for the Annodex work we did at CSIRO.

You’ll need to send in the completed nomination form and your CV before the end of August. Good luck! :-)

Date & Time selection plugins for Rails

Posted in Open Source, code, rails by silvia on the July 17th, 2008

I just tried comparing the different date & time selection plugins that are available for Rails and because the wiki page at rubyonrails.org is dated and I cannot edit it, I decided to write this brief blog post to save you the 20 min it took me to locate the currently available plugins and their demos:

So now you can compare and pick the one that suits you best. Enjoy! :-)

UPDATE: John just told me that there is a list of other plugins at the bottom of the CalendarDateSelect plugin page - doh!

W3C Video in the Web activity

Posted in Digital Media, Open Source, code, vquence by silvia on the July 4th, 2008

The W3C has just released a set of proposed charters for a new W3C Video in the Web activity with a request for feedback.

The following working groups are proposed:

  1. Timed Text Working Group
  2. Media Fragments Working Group
  3. Media Annotations Working Group

Two further ones under investigation are:

  1. Codecs and containers
  2. Best practices for video and audio content

It is worth checking out the site and the three different working groups they are planning to create. Sure - the codec discussion is a big one. But it’s not as big as some of the other activities as to new functionality for video on the Web.

to_bool rails plugin

Posted in FOMS, LCA, Open Source, analytics, code, rails by silvia on the June 29th, 2008

In our rail application we do a lot of string conversions to other data types, including Boolean. Unfortunately, ruby does not provide a conversion method to_bool (which I find rather strange, to be honest).

Based a blog post by Chris Roos in October 2006, we developed a rails plugin that enables the “to_bool” conversion.

“to_bool” works on the strings “true” and “false” and any capitalisation of these, and on numbers, as well as on nil. Other strings raise an ArgumentError.

Examples are as follows:

'true'.to_bool #-> true
'TrUe'.to_bool #-> true
true.to_bool #-> true
1.to_bool #-> true
5.to_bool #-> true
-9.to_bool #-> true
nil.to_bool #-> false
'false'.to_bool #-> false
'FaLsE'.to_bool #-> false
false.to_bool #-> false
0.to_bool #-> false

You can find the plugin here as a tarball. To install it, simply decompress the to_bool directory into your vendor/plugins directory.

Dodgy Telstra Sales Practices

Posted in Stuff by silvia on the June 28th, 2008

I don’t usually complain about companies and their sales approach, since I know how hard it is to sell things. But today I had a house call by a Telstra person and his sales practice was so dodgy - it’s just not something I would have expected by such a respected company as Telstra.

He came with a clipboard, had a name tag, and was on the verge of running away again when I got to the door - he really made the impression of a busy technician and took notes in his clipboard while we were talking.

He asked me whether I was with Telstra and I said no. He further asked who my phone line was with and I said iiNet. He then asked whether iiNet was looking after our physical phone line connection and I said probably no, but rather that it still belonged to Telstra - I found that a strange question to be asked by a technician who should really know, but then he might be new from India and not know everything yet.

He then said that in this case his information would be interesting for me and said that on Monday and Tuesday between 9am and 5pm Telstra would be undertaking work on the phone cables in my street and that I would be without connection, both Internet and Phone. I said ok, if it cannot be helped and thought that was it.

But that wasn’t it. Out of seemingly personal curiosity, almost as if he was making a decision for his own personal home, he asked how I was going with iiNet. I said good. He asked how much I was paying and how many phone calls that would include. I stated the rough amount and that my phone charges were really low and that amount almost covered all my phone calls and Internet connection. He then went on asking how much bandwidth I had. I stated the summary of peak and off-peak bandwidth to which he asked how much was peak and how much was off-peak. At this point I was getting slightly annoyed, since he could as well look up all these details on the Internet and really doesn’t need to get them from me.

But then came the really weird part. He then said that with this bandwidth I could barely surf the Internet and my phone line would be really crappy. He then started trying to sell me a Telstra ADSL service. This is where I got really annoyed and almost loud. I said that I knew what I was doing and that for what I am getting from iiNet I would have to pay 10 times as much with Telstra and that under no circumstances would I switch back to Telstra services.

He seemed to understand that he wasn’t going to sell me any phone or Internet services today, so he switched topic: what about a Foxtel account then? I said no thank you and good bye and closed the door.

So, now, I am actually wondering whether his initial statement that our street will have an outage on Monday and Tuesday is actually correct or whether that was just a way to get his foot in the door. I am really pissed off with Telstra for such dodgy sales practices. Unfortunately, their complaints department does not answer calls on a weekend and their technical department was not willing to confirm an outage on Monday and Tuesday since I am not a Telstra customer.

Telstra: I really wished your sales people would play fairly in the market. I could see so many neighbours talking to your sales guy and considering his offers that I almost felt like going over and uncovering his lies. He is making false claims about other Network’s services, he is making false claims about technical details and he is trying to open the door with a possibly false claim on a technical outage. Plus: I have to wait until Monday before I can tell you about it. How much worse can it get?

“Commercialising Video” conference in Sydney

Posted in Digital Media, analytics, vquence by silvia on the June 27th, 2008

On Tuesday 24th June I attended the “Commercialising Video” conference held in beautiful Jones Bay Wharf in Sydney’s harbour. AIMIA and Claudia Sagripanti from VentureOne organised it together.

It was a mixture of case studies and panels. The case studies were talks by successful digital media companies, including Sony, Bebo, Viocorp, Clear Light Digital and Fox Interactive Media (really: mySpaceTV). The panels constituted each a moderator and a small number of industry experts that briefly presented on their knowledge on a specific topic and then discussed this topic led by questions from the audience.

I thought the format was very successful and the conference covered a broad range of current topics of interest in digital media. Panel topics included:

  • mobile: challenges for getting video onto mobile and making a return on it
  • business models: how to make money from online video
  • sports video: what business models work with sports content
  • metrics: why we need to measure video and what and how
  • innovations: what innovative products are to be expected in the near future in video

I was one of the panellists on the metrics panel - my slides are here. The very last slide provides a very basic preview of the video metrics service that is in development at Vquence right now. Expect the final product to look much more professional, once I’ve included the awesome designs that we have just received from Chiz.

One thing that I took away from the conference is that the online video market is finally maturing and we are seeing business models that work. While they can roughly be classified into ad-supported, sponsored, and user-paid, there are many details that you have to take care of dependent on the service that you are providing. Ad-support can be inside the video e.g. in pre-roll, post-roll, mid-roll, overlay, or accompanying ads e.g. in dynamically loaded roll-outs, banners etc. Sponsorship is mostly used for non-profit sites. User-paid models are e.g. subscriptions, pay-per-view, pay-per-download. General video sites work not so well for ad-support as specialised sites. There is a lot of money for videos in specialised areas where your community is very keen to receive the latest video content fast, e.g. in sports.

In mobile in Australia, video business is still hard going, because the bandwidth costs are high, extra production cost is high, and because of challenges to get video into a usable form on such a small screen (e.g. soccer-ball is too small to be more than a pixel). This also means that the cost for consumers to get video is high, while the quality is still low. This obviously does not make for a very good market. The size of the iPhone screen, combined with the slow realisation by mobile phone providers that they have to drop prices for video transfers, may however totally change this situation.

Finally, I noticed that there was a large call for metrics. Measurement of the use of video and tracking the distribution of videos around the Internet, as well as measurement of advertising that relates to videos are all being requested to get more transparency into the business and mature the market. Initial services are available, in particular from existing Web Analytics and Internet Market Intelligence companies. However, the technology is new and we have a long way to go online and even more on mobile. This is a great opportunity for Vquence!

Thanks very much, Claudia, for organising this event and I hope there will be more to come in this space.

Google Developer Day in Sydney

Posted in code, vquence by silvia on the June 19th, 2008

Today’s Google Developer day in Sydney was quite impressive. There were about 500 developers (and other random folks) there, curious to learn more about the services Google offers. With three parallel breakout rooms for the talks / code labs, there was plenty to choose from.

The introduction was well done, providing a quick overview of all the services and APIs that were the topic of the day - enough to understand what they are and tempt you to attend the in-depth talks.

I attended the Google App Engine talk first - not because I am a fan of python, but because I have an AppEngine account and my son Ben codes in python. I’d really like to play with AppEngine and get Ben to develop something useful (and me to learn some more python on the side). The talk gave a great introduction, which really enthused me. They build this little shout-out app on the fly and published it within the first 10 min. Now, I am collecting ideas for Ben to code up - if you have a neat little one, leave me a note.

I then went on to attend the YouTube talk. It was touted as a 201 presentation, but in the end just provided a cursory overview of the YouTube API. It was a good overview, but since we’ve been working with the API for a long time at Vquence, there was nothing new for me.

At the end of the talk, a developer requested YouTube to provide an API to access the new annotation feature. Since that is still in beta, they will be waiting to harden the technology for a bit before introducing the API. I suggested to them to look at CMML as the XML API. I explained that it would hold any annotation at any time point in any language. The on-screen placement is not currently covered by a tag in CMML, but could be added to the meta tags of the clips. I also suggested that if they found anything to improve on CMML, it would be possible since it’s not a finalized standard. I really hope they will check it out.

After lunch, I attended the two sessions about OpenSocial. I was considering using it for the new Vquence metrics site to do the widget layout. I quickly understood that this is not about layouts, but really about social applications. It would be cool if Ben would think up a social application that he could implement in python and OpenSocial and host in AppEngine. Something that him and his friends could share, maybe? Any ideas for an 11-year-old who learnt python on the OLPC?

At the end of the day, I was curious to learn a bit about Android before having to head home. But I only had a few minutes and the speaker had a slow start (repeating his slides from the introduction session) such that I quickly decided to leave and rather make sure I was at after school care on time!

Overall a worthwhile day - I met some friends, made some contacts, got to ask some questions, and had an awesome lunch with fresh sushi, hmmm. Google really knows how to spoil their developers!

FOMS Workshop - Call for Participation is OPEN

Posted in Digital Media, FOMS, LCA, Open Source by silvia on the June 11th, 2008

The Foundations for Open Media Software workshop will take place in January 2009 for the third time before LCA. Yay!! This year in beautiful Tasmania!

At 17:33pm on Wed 11th June on irc #foms, the Call for Participation was declared open.

If you have any engagement with the development of open standards and open source software in the digital media space, consider attending. To attend, all we ask for is an email to the committee. Really simple!

We will have travel sponsorship for some key people and if the last two years are anything to go by, we will see some serious improvements to open media technology coming out of FOMS - an event that always stretches over the whole duration of LCA.

I can’t wait till Christmas is over…

Talk at SLUG on Vquence’s use of open source software

Posted in Open Source, vquence by silvia on the May 31st, 2008

Yesterday, I gave a talk at SLUG (the Sydney Linux Users Group) about the open source software that we’re using in Vquence. The talk was basically structured into three areas: open source software in business operations, in software development, and in system operations. John joined in for the harder questions on the systems operations. We also explained how we’ve set our systems up so we are scalable on data (in particular on video slices, images and video use statistics) at a minimum cost - which includes the use of Amazon’s EC2 and S3 services. We also use reverse proxies to be scalable with bandwidth cost. Here are the talk slides.

Rails Authorization Plugin

Posted in code, rails by silvia on the May 21st, 2008

The Rails authorization plugin is a really nice way of providing role management and restrict access to specific features. It also works nicely with the RESTful authentication plugin which manages user login and authentication.

However, there is a serious lack of documentation of how to use this plugin - the README.txt inside the plugin and the source code is the best I have found. I also learnt some from the slides for the Railsconf 2006 on “Metaprogramming Writertopia”. This blog entry is collecting what I have learnt and also freely copies some text from the different sources.

Assuming you have installed the authorization plugin, you need to extend your models with the plugin. In particular the User model and the model(s) that you would like to use multiple user roles for.


class User < ActiveRecord::Base
# Authorization plugin
acts_as_authorized_user
...
end


class Account < ActiveRecord::Base
# Authorization plugin
acts_as_authorizable
...
end

The acts_as_authorized_user part of the plugin creates the following methods for the User model:

  • has_role? role_name [, authorizable_obj]: finds out if a user has a certain role (for a certain object)
  • has_role role_name [, authorizable_obj]: creates the role if non-existant, and assigns the role to the user (for a certain object)
  • has_no_role role_name [, authorizable_obj]: remove role from user (for a certain object), and the role if not in use any longer

As some background information, the plugin creates 2 tables - one for the roles (name, authorizable_type, authorizable_id, timestamps), and one that maps roles to users roles_users (user_id, role_id, timestamps). The authorizable_type and authorizable_id map the role to the authorizable_obj.

The acts_as_authorizable part of the plugin creates the following methods for the Account model:

  • accepts_role? role_name, user: finds out if the user has the role on the model
  • accepts_role role_name, user: sets the user to have the role on the model
  • accepts_no_role role_name, user: removes the user from having the role on the model

In the code, you can now use the following methods to create roles for users and accounts. Assuming we have a user ‘u’ and an account ‘a’, we can do one of the following to create the role ‘admin’:

  • u.has_role ‘admin’, a
  • a.accepts_role ‘admin’, u
  • u.is_admin_for a
  • u.is_admin (gives user the role ‘admin’, not tied to a class or object)

To check on roles, you can use the following:

  • u.has_role ‘admin’, a: return true/false if the user has the role ‘admin’ on the account
  • u.is_admin? a: return true/false if the user has the role ‘admin’ on the account
  • u.is_admin_of? a: return true/false if the user has the role ‘admin’ on the account
  • u.has_role ‘admin’: return true/false if the user has the role ‘admin’ on anything
  • u.is_admin?: return true/false if the user has the role ‘admin’ on anything
  • u.is_admin_of_what Account: returns array of objects for which this user is a ‘admin’ (only ‘Account’ type)
  • u.is_admin_of_what: returns array of objects for which this user is a ‘admin’ (any type)
  • a.accepts_role? ‘admin’, u: return true/false if the account has the user with the role ‘admin’
  • a.has_admin(s)?: return true/false if the account has users with the role ‘admin’
  • a.has_admin(s): returns array of users which have role ‘admin’ on the account

There are more dynamically generated methods and they are created through the method_missing hook. There is a whole domain-specific language behind this creation of methods. Just about everything that sounds like proper English will work.

An interesting twist is that roles can also be set on model classes: u.has_role 'admin', Account. So, roles can be set on one of the following three scopes:

  • entire application (no class or object specified)
  • model class
  • an instance of a model (i.e., a model object)

In your controller, you can now use two methods to check authorization at the class, instance, or instance method level: permit and permit?. permit and permit? take an authorization expression and a hash of options that typically includes any objects that need to be queried:


def index
if current_user.permit? 'site_admin'
# show all accounts
@account = Account.find(:all)
else
@account = current_user.is_admin_for_what(Account)
end
end


class AccountController < ApplicationController
permit "site_admin and admin", :except => public_page

def secret_info
permit “site_admin” do
render :text => “The Answer = 42″
end
end
end

The difference between permit and permit? is redirection.

permit is a declarative statement and redirects by default. It can also be used as a class or an instance method, gating the access to an entire controller in a before_filter fashion. permit? is only an instance method, that can be used within expressions. It does not redirect by default. You will find more information on the boolean expression of the permit or permit? methods here.

Next Page »

Bad Behavior has blocked 586 access attempts in the last 7 days.