Wednesday, 19 December 2012

Further Review of Cue Identifier Unit Tests

I changed all the tests to use public domain text instead of what was presumably copied from Wikipedia. I also change the language tests to actually use the stated language instead of junk characters and use the BOM character. I changed the string comparisons to use the Unicode escape sequences. All the text is from public domain poetry and novels. I'll leave it to the reader to figure out what they are.

All the string comparisons cause crashes when running the tests. I've disabled all the cue identifier tests.

Saturday, 15 December 2012

WebVTT Cue Identifier Unit Test Reivew

Updated: Removed second cue tests. It is the same as the first.

I changed all the comments.

The default value for the identifier is an empty string.

A number of tests had to be duplicated and changed to test the first and second cue because the parsing rules are different after the first cue.

All test have a new assert to make sure the identifier was set (or not set) correctly. However since I can find no way of comparing with a webvtt string all the string asserts are disabled by comments.

It is vital that some way be found to compare strings for tests. I spent about 8 hours trying to find a way via every possible method I could think of including extensive modification of the cue and string C++ wrappers, testing for number of cues, testing for exceptions, and others.

I appears that the parser cannot handle more than one cue. Also, a number of these tests are failing for very basic reasons such as there being 0 cues when there should be 1.

Crashing Test

  • CueIdGeneral.LongString2
  • CueIdGeneral.IdOnly2
  • CueIdGeneral.IdOnly2TrailingNewline

Failing Tests

  • CueIdArrow.Arrow
  • CueIdArrow.ExtraArrowhead
  • CueIdArrow.ExtraMinusSign
  • CueIdArrow.LongStringWithArrow
  • CueIdGeneral.BasicPass2
  • CueIdGeneral.IdOnly
  • CueIdLineEndings.TwoBetweenIdAndTimestamp
  • CueIdLineEndings.MissingBetweenPayloadAndId
  • CueIdLineEndings.LongStringLF
  • CueIdLineEndings.LongStringCRLF

Friday, 14 December 2012

WebVTT Reviewing

I cannot compare strings. There is something wrong with the parser and I just can't do it. It says there are cues but they don't work and I can't check for nulls and checking for exceptions doesn't work. I've tried going at it from half a dozen directions.

I'm not going to continue with reviewing the tests when almost none of them work in the first place and half the stuff can't even be tested for. I've wasted 8 hours today on this.

Thursday, 13 December 2012

WebVTT Settings Reviewed Unit Tests Part 2

Part 1: http://kyle.barnhart.ca/2012/12/webvtt-setting-unit-test-reivew.html

When I tried to rebase with the latest from the main repo all my work vanished.
So I merged it and that went find. Then I coped the relevant files, deleted everything, forked anew, cloned, and then copied my files back. The changes were detected and detected only the differences between the latest revision in the main repo and my changes.

The tests listed below do not include those that were already disabled. These are tests the changed I made are causing them to fail. This is likely due to the tests being new or that I made the tests stricter by making sure the values were set properly (or default).

Failing Test

  • [  FAILED  ] CueSetting.BadDelimiter
  • [  FAILED  ] CueSetting.BadDelimiter2
  • [  FAILED  ] CueSettingLine.BadKeyword
  • [  FAILED  ] CueSettingLine.BadDelimiter
  • [  FAILED  ] CueSettingLine.BadValue
  • [  FAILED  ] CueSettingLine.BadValueSuffix
  • [  FAILED  ] CueSettingLine.WhitespaceDelimiter
  • [  FAILED  ] CueSettingLine.BadWhitespaceBeforeDelimiter
  • [  FAILED  ] CueSettingLine.BadWhitespaceAfterDelimiter
  • [  FAILED  ] CueSettingVertical.BadKeyword
  • [  FAILED  ] CueSettingVertical.BadDelimiter
  • [  FAILED  ] CueSettingVertical.BadValue
  • [  FAILED  ] CueSettingVertical.BadWhitespaceBeforeDelimiter
  • [  FAILED  ] CueSettingVertical.BadWhitespaceAfterDelimiter
  • [  FAILED  ] CueSettingAlign.NoDelimiter

Tuesday, 11 December 2012

WebVTT Setting Unit Test Reivew

I delayed this a few days so that more pulls would be finished on the repo. I went over the settings again and included the errors. Errors do not need to be passed to the browser when implemented, but they are useful for validation. However, it must return cues correctly according to the parse specifications.

No real changes were made. Failing tests are disabled.

Failing Tests

  • [  FAILED  ] CueSetting.SameCueSetting
  • [  FAILED  ] CueSetting.BadDelimiter
  • [  FAILED  ] CueSetting.BadDelimiter2
  • [  FAILED  ] CueSetting.NoDelimiter
  • [  FAILED  ] CueSetting.DigitDelimiter
  • [  FAILED  ] CueSettingLine.ManyDigitLowBoundary
  • [  FAILED  ] CueSettingLine.ManyDigitPercentage
  • [  FAILED  ] CueSettingLine.ManyDigitPercentageHighBoundary
  • [  FAILED  ] CueSettingLine.ManyDigitPercentageLowBoundary
  • [  FAILED  ] CueSettingLine.DoubleDigitPercentage
  • [  FAILED  ] CueSettingLine.DoubleDigitPercentageHighBoundary
  • [  FAILED  ] CueSettingLine.DoubleDigitPercentageLowBoundary
  • [  FAILED  ] CueSettingLine.SingleDigitPercentage
  • [  FAILED  ] CueSettingLine.SingleDigitPercentageHighBoundary
  • [  FAILED  ] CueSettingLine.SingleDigitPercentageLowBoundary
  • [  FAILED  ] CueSettingLine.BadKeyword
  • [  FAILED  ] CueSettingLine.NoKeyword
  • [  FAILED  ] CueSettingLine.NoDelimiter
  • [  FAILED  ] CueSettingLine.BadDelimiter
  • [  FAILED  ] CueSettingLine.BadValue
  • [  FAILED  ] CueSettingLine.NoValue
  • [  FAILED  ] CueSettingLine.BadValueSuffix
  • [  FAILED  ] CueSettingLine.WhitespaceDelimiter
  • [  FAILED  ] CueSettingLine.BadWhitespaceBeforeDelimiter
  • [  FAILED  ] CueSettingLine.BadWhitespaceAfterDelimiter
  • [  FAILED  ] CueSettingLine.UppercaseKeyword
  • [  FAILED  ] CueSettingLine.PercentNegative
  • [  FAILED  ] CueSettingLine.PercentOver100
  • [  FAILED  ] CueSettingSize.NoDelimiter
  • [  FAILED  ] CueSettingSize.NoKeyword
  • [  FAILED  ] CueSettingSize.NoValue
  • [  FAILED  ] CueSettingSize.NoPercentSign
  • [  FAILED  ] CueSettingSize.BadDelimiter
  • [  FAILED  ] CueSettingSize.BadKeyword
  • [  FAILED  ] CueSettingSize.AsciiDigitBeyondHighBoundary
  • [  FAILED  ] CueSettingSize.AsciiDigitBeyondLowBoundary
  • [  FAILED  ] CueSettingSize.PercentNegative
  • [  FAILED  ] CueSettingSize.PercentOver100
  • [  FAILED  ] CueSettingSize.UppercaseKeyword
  • [  FAILED  ] CueSettingPosition.NoDelimiter
  • [  FAILED  ] CueSettingPosition.NoKeyword
  • [  FAILED  ] CueSettingPosition.NoValue
  • [  FAILED  ] CueSettingPosition.NoPercentSign
  • [  FAILED  ] CueSettingPosition.BadDelimiter
  • [  FAILED  ] CueSettingPosition.BadKeyword
  • [  FAILED  ] CueSettingPosition.AsciiDigitBeyondHighBoundary
  • [  FAILED  ] CueSettingPosition.AsciiDigitBeyondLowBoundary
  • [  FAILED  ] CueSettingPosition.PercentNegative
  • [  FAILED  ] CueSettingPosition.PercentOver100
  • [  FAILED  ] CueSettingPosition.UppercaseKeyword
  • [  FAILED  ] CueSettingVertical.BadKeyword
  • [  FAILED  ] CueSettingVertical.BadDelimiter
  • [  FAILED  ] CueSettingVertical.BadValue
  • [  FAILED  ] CueSettingVertical.BadWhitespaceBeforeDelimiter
  • [  FAILED  ] CueSettingVertical.BadWhitespaceAfterDelimiter
  • [  FAILED  ] CueSettingVertical.NoKeyword
  • [  FAILED  ] CueSettingVertical.NoValue
  • [  FAILED  ] CueSettingVertical.NoDelimiter
  • [  FAILED  ] CueSettingVertical.UppercaseKeyword
  • [  FAILED  ] CueSettingVertical.UppercaseValue
  • [  FAILED  ] CueSettingAlign.Left
  • [  FAILED  ] CueSettingAlign.Right
  • [  FAILED  ] CueSettingAlign.BadKeyword
  • [  FAILED  ] CueSettingAlign.NoKeyword
  • [  FAILED  ] CueSettingAlign.BadValue
  • [  FAILED  ] CueSettingAlign.NoValue
  • [  FAILED  ] CueSettingAlign.BadDelimiter
  • [  FAILED  ] CueSettingAlign.NoDelimiter
  • [  FAILED  ] CueSettingAlign.UppercaseKeyword
  • [  FAILED  ] CueSettingAlign.UppercaseValue

Saturday, 8 December 2012

Adam Curtis

Adam Curtis is one of my favourite journalists and documentary film makers, and has made another post on his BBC blog. Anyone interested in history, politics, or the Middle East should check it out. While you're there you can take a look at his previous posts, all of which are good and cover a wide array of topics all dealing with power and society.

While some articles seem overtly right or left, I don't think it's true. Adam Curtis see's himself as more of a progressive libertarian, and his real interest is in "... power and how it works in society". I find what he is really doing is giving real political and historical context to current events, and always asking why society and politics is the way it is. I know of few others who even approach these kinds of subjects, let alone dig as deep as Curtis does (perhaps another is Malcolm Gladwell).

Several of his documentaries are available here on archive.org.

HOW THE MUSLIM BROTHERHOOD, HAMAS AND THE ISRAELI RIGHT BECAME CO-DEPENDENTS IN AN ABUSIVE RELATIONSHIP


Last week there was yet another cycle of horrific violence in the Gaza strip. This week there are demonstrations in Cairo driven by fears that the revolution is being hi-jacked by the Islamists. Liberals in the west look on baffled and horrified. What they thought was a glorious revolution in the Arab world is morphing into something they don't understand. While Gaza is like some brutal other planet forever possessed by hi-tech assassinations and bearded aliens dragging corpses around the streets on motor cycles.

All this is comprehensible though - but only if you look at it in a wider context. A context that western liberals really don't like to think about because it makes them very depressed. It is the great shift of our time - the collapse of the dream that politicians could change the world for the better. A dream that was replaced by a conviction that politicians were untrustworthy and always become corrupted by power.

The collapse of that optimistic vision of what politics could achieve then left the way open for powerful, reactionary forces to take power who...

http://www.bbc.co.uk/blogs/adamcurtis/

Friday, 7 December 2012

Explaining the Transformers Movies

I'm not going to say a lot but if you're interested in movies and like theories that make them make sense check out this amazing one on the Transformers movies. I wasn't going to post this but the following sentence made me do it.

Two robot blackface actors find the corpse of god, whereupon the embodiment of capitalism blows a hole in it so it can find his ancient treasure... Which is a useless pile of dust. I think that even tops the space scene in terms of sheer, hilariously brazen nihilism.

Terry van Feleday


Link: Terry van Feleday's "I actually kind of appreciate the Transformers movies".

The first thing you need to know about Transformers is that it hates you.

Terry van Feleday

Thursday, 6 December 2012

Change to HTML Specification

I made a comment concerning whether lists are ordered or not. As a results Ian Hickson made a change to the HTML Specification in the section Splitting a String on Spaces.

This is the commit.

My name is now in the acknowledgements.

This is the original post.

Hello. I'm part of the Seneca College student who are implementing the
WebVTT spec for Mozilla.

The syntax rules state, "Each component must not be included more than once
per WebVTT cue settings string." The parsing rules allow for duplicate
settings implicitly because it makes no such check. The splitting on a
space creates a list, not an ordered list. That means a cue with duplicate
settings will parse but with unpredictable results.

Question. Should this simply be left as unpredictable behaviour? Or should
the parser make the behaviour predictable? If the settings could be
tokenized in to an ordered list then either it could use the first or last
duplicate setting (last should be easier).

My feeling is that it should remain unpredictable because the syntax states
only one is allowed and therefore duplicate settings should not be
supported. If this is the case, it might be useful to have a note in the
setting paring section stating that while duplicate settings will be
parsed, the behaviour will be unpredictable.

http://dev.w3.org/html5/webvtt/#parse-the-webvtt-settings
http://dev.w3.org/html5/spec//common-microsyntaxes.html#split-a-string-on-spaces

Thank you,
Kyle Barnhart

http://lists.w3.org/Archives/Public/public-texttracks/2012Nov/0013.html

My second post.

Let me point out why I asked this question.

Twice in the WebVTT specification it is explicitly pointed out that an
"ordered list" is used.
-  WebVTT Internal Node Objects have an ordered list of child WebVTT Node
Objects [1]
-  WebVTT Internal Node Objects also have an ordered list of class names [1]

In addition the word "append" is used 27 times in the specification
indicating that order is important.

In the parse WebVTT settings algorithm [2], it only states that there is a
list of setting token. There is no reference to order.

In the split a string on spaces algorithm [3], it specifies only that a
list is created. It also states "add" to the list and not "append". The
common micro syntax document [3] uses the word "append" 9 times. In
addition there are explicit instruction for ordered and unordered sets of
tokens.

The order of a list is so often explicitly stated or implied through the
phrases "ordered list" and "append" it appears to be the precedent that
lists which must be ordered must use those phrases. I looked very hard for
some sort of clarification that lists are ordered by default but I could
not find any.

If explicitly stating or implying that something is ordered is the
precedent, then when it is not explicitly stated or implied, I must assume
that it may not be ordered.

What it means is that I could create the list from adding to the start or
inserting to the middle or some other method. Or use some complex data
structure that adds key value pairs by some means that does not preserver
order. All of this would be perfectly valid according to the
specifications, but would mean that the order of the
list across implementations is unpredictable.

[1] http://dev.w3.org/html5/webvtt/#webvtt-cue-text-parsing-rules
[2] http://dev.w3.org/html5/webvtt/#parse-the-webvtt-settings
[3] http://dev.w3.org/html5/spec//common-microsyntaxes.html#split-a-string-on-spaces

http://lists.w3.org/Archives/Public/public-texttracks/2012Nov/0018.html

Ian Hickson's response.

I've made it clearer that these lists are ordered, just so that there's 
no ambiguity here.


> http://dev.w3.org/html5/spec//common-microsyntaxes.html#split-a-string-on-spaces

See http://whatwg.org/html#split-a-string-on-spaces for the most up to 
date copy of this text.

(In particular, WebVTT references the terms as defined in the WHATWG HTML 
spec; I make no guarantees that the references make sense if you use the 
W3C HTML5 spec for the HTML terms.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

http://lists.w3.org/Archives/Public/public-texttracks/2012Nov/0019.html