Music Object Extension - Clip
|
|
The Clip extension provides a set of services for conveniently creating a music preview system on a Web page.
|
What's New in the Latest Version
|
There is a dedicated version history for this extension, where you will be able to find out about the new features and possible issues with the most recent version. The version history for this extension is independent of the version history for the core Music Object API.
To get the "music-object-x-clip.js" JavaScript file that implements this extension, simply right-click on this link (click-and-hold for Mac users). Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the file as "music-object-x-clip.js" into an appropriate folder of the local copy of your Web site.
In case you have problems saving the file using the above link, the "music-object-x-clip.js" file can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.
In order to use this extension, the following JavaScript file(s) must first be sourced in...
- music-object.js (version 3.3.0 or higher)
For more information on using extensions, consult the section About Music Object Extensions.
| Name |
Short Description |
| Music.Clip Object Constructor |
| Music.Clip |
An object constructor that lets you create a new Music.Clip object instance. |
| Music.Clip Instance Methods |
| insertUI |
Lets you insert the user interface for a Music.Clip object instance at the position within the document where this method is called. |
| play |
Lets you play the music file that is loaded into a Music.Clip object instance. |
| stop |
Lets you stop the music file that is playing for a Music.Clip object instance. |
| Music.Clip Instance Properties |
| musicObject |
A reference to the Music Object instance that is used by a Music.Clip object instance. |
| Music.Clip Static Properties |
| Music.Clip.fadeOutTime |
An integer variable, specifying the default value that should be used for the FadeOutTimeINT parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.hoverDelay |
An integer variable, specifying the default value that should be used for the HoverDelayINT parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.hoverResetDelay |
An integer variable, specifying the default value that should be used for the HoverResetDelayINT parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.imagePath |
A string variable, specifying the URL path that is used to prefix all image URLs used by all Music.Clip object instances. |
| Music.Clip.imageHeight |
An integer variable, specifying the default value that should be used for the ImageHeightINT parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.imageUrl |
A string variable, specifying the default value that should be used for the ImageUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.imageWhileLoadingUrl |
A string variable, specifying the default value that should be used for the ImageWhileLoadingUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.imageWhilePlayingUrl |
A string variable, specifying the default value that should be used for the ImageWhilePlayingUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.imageWidth |
An integer variable, specifying the default value that should be used for the ImageWidthINT parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.instances |
An array of references to all the Music.Clip object instances that have been created in the document. |
| Music.Clip.musicUrl |
A string variable, specifying the default value that should be used for the MusicUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.restartIfPlaying |
A boolean variable, specifying the default value that should be used for the RestartIfPlayingBOOL parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.triggerType |
A string variable, specifying the default value that should be used for the TriggerTypeSTR parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.stopOnMouseOut |
A boolean variable, specifying the default value that should be used for the StopOnMouseOutBOOL parameter, if this parameter is not specified when creating Music.Clip object instances. |
| Music.Clip.stubPath |
A string variable, specifying the URL of the stub RMF file that is needed to instantiate the player instances used by all the Music.Clip object instances. |
| Static Methods |
| Music.newClips |
Provides a convenient way of creating multiple Music.Clip object instances in one single step. |
|
|
|
Music.Clip Object Constructor
|
The Music.Clip object constructor (a static method of the Music object) lets you create a new Music.Clip object instance.
| |
Music.Clip (
ObjectNameSTR ,
MusicUrlSTR ,
ImageUrlSTR ,
ImageWhileLoadingUrlSTR ,
ImageWhilePlayingUrlSTR ,
ImageWidthINT ,
ImageHeightINT ,
TriggerTypeSTR ,
FadeOutTimeINT ,
StopOnMouseOutBOOL ,
RestartIfPlayingBOOL ,
HoverDelayINT ,
HoverResetDelayINT
)
|
| |
ClipOBJ |
- ObjectNameSTR
Lets you specify the name of the Music.Clip object instance that should be created as a property of the window object. For instance, specifying the string value "myClip1" would allow you to reference the object instance in your code as window.myClip1 or just myClip1, as in the statement myClip1.insertUI ().
If you specify a name for this parameter that does not conform to the valid syntax for a JavaScript identifer (for example, if it contains spaces, hyphens, or other illegal characters), then you will need to perform a string dereference of the window object in order to access the Music.Clip object instance. As an example, if you specified the string value "My Clip - 1" for this parameter, then the object instance could be accessed as in the statement window ['My Clip - 1'].insertUI ().
- MusicUrlSTR
Lets you specify the URL of the music file that should be played for the Music.Clip object instance. If the value of this parameter is prefixed with an asterisk ('*'), then a URL will be created by using the remainder of the value, excluding the asterisk, to replace all occurrences of the characters '[*]' in the value of the Music.Clip.musicUrl static property. If the value of the paramater is not prefixed with an asterisk, then a URL will be created by using the value of the ObjectNameSTR parameter to replace all occurrences of the characters '[*]' in the value of the MusicUrlSTR parameter.
- ImageUrlSTR
Lets you specify the URL of the image file that should be displayed for the user interface of the Music.Clip object instance. If the value of this parameter is prefixed with an asterisk ('*'), then a URL will be created by using the remainder of the value, excluding the asterisk, to replace all occurrences of the characters '[*]' in the value of the Music.Clip.imageUrl static property. If the value of the paramater is not prefixed with an asterisk, then a URL will be created by using the value of the ObjectNameSTR parameter to replace all occurrences of the characters '[*]' in the value of the ImageUrlSTR parameter.
- ImageWhileLoadingUrlSTR
Lets you specify the URL of the image file that should be displayed for the user interface of the Music.Clip object instance, only while the music file is still loading in. If the value of this parameter is prefixed with an asterisk ('*'), then a URL will be created by using the remainder of the value, excluding the asterisk, to replace all occurrences of the characters '[*]' in the value of the Music.Clip.imageWhileLoadingUrl static property (or the value of the Music.Clip.imageUrl static property, if the Music.Clip.imageWhileLoadingUrl property is set to null). If the value of the paramater is not prefixed with an asterisk, then a URL will be created by using the value of the ObjectNameSTR parameter to replace all occurrences of the characters '[*]' in the value of the ImageWhileLoadingUrlSTR parameter.
- ImageWhilePlayingUrlSTR
Lets you specify the URL of the image file that should be displayed for the user interface of the Music.Clip object instance, only while the music file is playing. If the value of this parameter is prefixed with an asterisk ('*'), then a URL will be created by using the remainder of the value, excluding the asterisk, to replace all occurrences of the characters '[*]' in the value of the Music.Clip.imageWhilePlayingUrl static property (or the value of the Music.Clip.imageUrl static property, if the Music.Clip.imageWhilePlayingUrl property is set to null). If the value of the paramater is not prefixed with an asterisk, then a URL will be created by using the value of the ObjectNameSTR parameter to replace all occurrences of the characters '[*]' in the value of the ImageWhilePlayingUrlSTR parameter.
- ImageWidthINT
Lets you specify the width (measured in pixels) of the images that will be used for the user interface of the Music.Clip object instance.
- ImageHeightINT
Lets you specify the height (measured in pixels) of the images that will be used for the user interface of the Music.Clip object instance.
- TriggerTypeSTR
Lets you specify the triggering mode for the Music.Clip object instance. There are two possible values for this parameter...
- "click" - means that the music file will be played only when the user clisk on the user interface for the Music.Clip object instance.
- "over" - means that the music file will be played only when the user mouses over the user interface for the Music.Clip object instance.
- FadeOutTimeINT
Lets you specify the amount of time (measured in milliseconds) that a Music.Clip object instance's music file should take to completely fade out, each time that the instance is stopped. For example, a value of 2000 would mean that the clip would fade out to a stop over a period of 2 seconds (2000 milliseconds). Specifying a value of 0 for this parameter would result in an abrupt stop.
- StopOnMouseOutBOOL
Lets you specify whether or not a Music.Clip object instance's music file should automatically be stopped when the user mouses out of the instance's user interface.
- RestartIfPlayingBOOL
Lets you specify whether or not a Music.Clip object instance's music file should automatically be started again from the beginning if the instance is retriggered while the file is still playing.
- HoverDelayINT
Lets you specify the amount of time (measured in milliseconds) that the user needs to keep the mouse over the Music.Clip object instance's user interface in order to trigger the music file to play. This parameter only has meaning when the "over" trigger mode is being used. As an example, a value of 1000 would mean that the user would have to keep the mouse over the user interface for 1 second (1000 milliseconds) before the music file would start playing. Specifying a value of 0 for this parameter would cause the music file to begin playing immediately on mousing over the user interface.
- HoverResetDelayINT
Lets you specify the amount of time (measured in milliseconds) that it should take, after the the Music.Clip object instance's music file has completed fading out to a stop, before the Music.Clip object instance no longer registers that the user is hovering over the user interface, and the user has to then mouse over the user interface once again and hover for the amount of time specified by the HoverDelayINT parameter before the music file can be retriggered. This parameter only has meaning when the "over" trigger mode is being used.
- When a value of null is specified for the ObjectNameSTR parameter, then a value is automatically generated for this parameter. In this event, there would be no way for you to determine the value that has been chosen for this parameter, so the only way you would be able to reference the newly created Clip instance would be to assign the return value of the object constructor to a variable, as in the statement...
myClip = new Music.Clip (null,'my-clip-file.rmf')
Then you would be able to call methods of the Clip instance using this variable, as in the statement...
myClip.play ()
- When a value of null is specified for the MusicUrlSTR parameter, then this parameter is set to the value of the ObjectNameSTR parameter prefixed with an asterisk ('*'). So, if the ObjectNameSTR parameter were set to the string value "myClip", then the value "*myClip" would be used for the MusicUrlSTR parameter.
- When a value of null is specified for the ImageUrlSTR parameter, then this parameter is set to the value of the ObjectNameSTR parameter prefixed with an asterisk ('*'). So, if the ObjectNameSTR parameter were set to the string value "myClip", then the value "*myClip" would be used for the ImageUrlSTR parameter.
- When a value of null is specified for the ImageWhileLoadingUrlSTR parameter, then the value of the ImageUrlSTR parameter is used for this parameter.
- When a value of null is specified for the ImageWhilePlayingUrlSTR parameter, then the value of the ImageUrlSTR parameter is used for this parameter.
- When a value of null is specified for the ImageWidthINT parameter, then the value of the Music.Clip.imageWidth static property is used for this parameter.
- When a value of null is specified for the ImageHeightINT parameter, then the value of the Music.Clip.imageHeight static property is used for this parameter.
- When a value of null is specified for the TriggerTypeSTR parameter, then the value of the Music.Clip.triggerType static property is used for this parameter.
- When a value of null is specified for the FadeOutTimeINT parameter, then the value of the Music.Clip.fadeOutTime static property is used for this parameter.
- When a value of null is specified for the StopOnMouseOutBOOL parameter, then the value of the Music.Clip.stopOnMouseOut static property is used for this parameter.
- When a value of null is specified for the RestartIfPlayingBOOL parameter, then the value of the Music.Clip.restartIfPlaying static property is used for this parameter.
- When a value of null is specified for the HoverDelayINT parameter, then the value of the Music.Clip.hoverDelay static property is used for this parameter.
- When a value of null is specified for the HoverResetDelayINT parameter, then the value of the Music.Clip.hoverResetDelay static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT , TriggerTypeSTR , FadeOutTimeINT , StopOnMouseOutBOOL , RestartIfPlayingBOOL , HoverDelayINT )
When no HoverResetDelayINT parameter is specified, then the value of the Music.Clip.hoverResetDelay static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT , TriggerTypeSTR , FadeOutTimeINT , StopOnMouseOutBOOL , RestartIfPlayingBOOL )
When there is also no HoverDelayINT parameter specified, then the value of the Music.Clip.hoverDelay static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT , TriggerTypeSTR , FadeOutTimeINT , StopOnMouseOutBOOL )
When there is also no RestartIfPlayingBOOL parameter specified, then the value of the Music.Clip.restartIfPlaying static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT , TriggerTypeSTR , FadeOutTimeINT )
When there is also no StopOnMouseOutBOOL parameter specified, then the value of the Music.Clip.stopOnMouseOut static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT , TriggerTypeSTR )
When there is also no FadeOutTimeINT parameter specified, then the value of the Music.Clip.fadeOutTime static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT , ImageHeightINT )
When there is also no TriggerTypeSTR parameter specified, then the value of the Music.Clip.triggerType static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR , ImageWidthINT )
When there is also no ImageHeightINT parameter specified, then the value of the Music.Clip.imageHeight static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR , ImageWhilePlayingUrlSTR )
When there is also no ImageWidthINT parameter specified, then the value of the Music.Clip.imageWidth static property is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR , ImageWhileLoadingUrlSTR )
When there is also no ImageWhilePlayingUrlSTR parameter specified, then the value of the ImageUrlSTR parameter is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR , ImageUrlSTR )
When there is also no ImageWhileLoadingUrlSTR parameter specified, then the value of the ImageUrlSTR parameter is used for this parameter.
- Music.Clip ( ObjectNameSTR , MusicUrlSTR )
When there is also no ImageUrlSTR parameter specified, then this parameter is set to the value of the ObjectNameSTR parameter prefixed with an asterisk ('*'). So, if the ObjectNameSTR parameter were set to the string value "myClip", then the value "*myClip" would be used for the ImageUrlSTR parameter.
- Music.Clip ( ObjectNameSTR )
When there is also no MusicUrlSTR parameter specified, then this parameter is set to the value of the ObjectNameSTR parameter prefixed with an asterisk ('*'). So, if the ObjectNameSTR parameter were set to the string value "myClip", then the value "*myClip" would be used for the MusicUrlSTR parameter.
|
Music.Clip Instance Methods
|
The insertUI instance method of the Music.Clip object lets you insert the user interface for a Music.Clip object instance at the position within the document where this method is called.
| |
insertUI ( LinkHrefSTR , LinkTargetSTR , LinkAltSTR ) |
- When a value of null is specified for the LinkHrefSTR parameter, then the icon for the Music.Clip object instance will have no action for when the user clicks on it.
- When a value of null is specified for the LinkTargetSTR parameter, then any link that is specified (by the LinkHrefSTR parameter) for the icon of the Music.Clip object instance will target the current window / frame.
- When a value of null is specified for the LinkAltSTR parameter, then the icon for the Music.Clip object instance will display no alternate text while its image loads in, and will also display no tooltip when the user mouses over it.
- insertUI ( LinkHrefSTR , LinkTargetSTR )
When no LinkAltSTR parameter is specified, then the icon for the Music.Clip object instance will display no alternate text while its image loads in, and will also display no tooltip when the user mouses over it.
- insertUI ( LinkHrefSTR )
When there is also no LinkTargetSTR parameter specified, then any link that is specified (by the LinkHrefSTR parameter) for the icon of the Music.Clip object instance will target the current window / frame.
- insertUI ( )
When there is also no LinkHrefSTR parameter specified, then the icon for the Music.Clip object instance will have no action for when the user clicks on it.
The play instance method of the Music.Clip object lets you play the music file that is loaded into a Music.Clip object instance.
This method can be useful if you are not using the insertUI instance method in order to create the user interface for a Music.Clip object instance, but are instead creating your own custom interface.
- A Music.Clip object instance can be stopped using the instance's stop method.
The stop instance method of the Music.Clip object lets you stop the music file that is playing for a Music.Clip object instance.
| |
stop ( ) |
This method can be useful if you are not using the insertUI instance method in order to create the user interface for a Music.Clip object instance, but are instead creating your own custom interface.
- A Music.Clip object instance can be triggered to play using the instance's play method.
|
Music.Clip Instance Properties
|
The musicObject instance property of the Music.Clip object is a reference to the Music Object instance that is used by a Music.Clip object instance.
This property can be useful if there are other ways you would like to control the playback of a clip while it is playing, or if you'd like to indicate playback state for clips using your own custom code. As an example, you could create custom code to hook into the onPlay and onStop callbacks for the Music Object instances of all Music.Clip object instances, so as to update the window's status bar to indicate when clips are playing.
The following sample code listing shows how this could be achieved...
for (var clipNo = 0; clipNo < Music.Clip.instances.length; clipNo++) {
var clipMO = Music.Clip.instances [clipNo].musicObject;
clipMO.addCallbackHandler ('onPlay','window.status = "audio preview clip playing..."');
clipMO.addCallbackHandler ('onStop','window.status = window.defaultStatus');
}
|
If this code is placed in the document after all Music.Clip object instances have been created, then the window's status bar will be updated each time any one of the clips starts or stops playing.
|
Music.Clip Static Properties
|
The Music.Clip.fadeOutTime static property is an integer variable, specifying the default value that should be used for the FadeOutTimeINT parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.hoverDelay static property is an integer variable, specifying the default value that should be used for the HoverDelayINT parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.hoverResetDelay static property is an integer variable, specifying the default value that should be used for the HoverResetDelayINT parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.imagePath static property is a string variable, specifying the URL path that is used to prefix all image URLs used by all Music.Clip object instances.
The Music.Clip.imageHeight static property is an integer variable, specifying the default value that should be used for the ImageHeightINT parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.imageUrl static property is a string variable, specifying the default value that should be used for the ImageUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.imageWhileLoadingUrl static property is a string variable, specifying the default value that should be used for the ImageWhileLoadingUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.imageWhilePlayingUrl static property is a string variable, specifying the default value that should be used for the ImageWhilePlayingUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.imageWidth static property is an integer variable, specifying the default value that should be used for the ImageWidthINT parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.instances static property is an array of references to all the Music.Clip object instances that have been created in the document.
This property can be useful if there is an operation that you would like to perform on all clips in the document. As an example, if you wanted to insert the user interfaces for all clips in an automated manner, you could simply iterate through all the elements of the Music.Clip.instances array, calling the insertUI method for each instance.
The following sample code listing shows how this could be achieved...
for (var clipNo = 0; clipNo < Music.Clip.instances.length; clipNo++) {
Music.Clip.instances [clipNo].insertUI ();
document.writeln ('<BR>');
}
|
Not only does such an approach save some code size, but nothing would need to be done to change this code in the future if more Music.Clip object instances were created or specific instances were removed.
In another example, if you were creating a preview page using the Clip extension and you also wanted to have background music playing on that page, then you could use the Ducking extension to wire the Music Object instances for all the clips to the Music Object instance that will be playing the background music. The code to do this might look as follows...
for (var clipNo = 0; clipNo < Music.Clip.instances.length; clipNo++) {
backgroundMO.addDuckingMasters (Music.Clip.instances [clipNo].musicObject);
}
|
In the above sample code snippet, it is assumed that the Clip extension and the Ducking extension have been sourced in, that all the Music.Clip object instances have been created, that the background music's Music Object instance has been created, etc.
The Music.Clip.musicUrl static property is a string variable, specifying the default value that should be used for the MusicUrlSTR parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.restartIfPlaying static property is a boolean variable, specifying the default value that should be used for the RestartIfPlayingBOOL parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.triggerType static property is a string variable, specifying the default value that should be used for the TriggerTypeSTR parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.stopOnMouseOut static property is a boolean variable, specifying the default value that should be used for the StopOnMouseOutBOOL parameter, if this parameter is not specified when creating Music.Clip object instances.
The Music.Clip.stubPath static property is a string variable, specifying the URL of the stub RMF file that is needed to instantiate the player instances used by all the Music.Clip object instances.
The Music.newClips static method provides a convenient way of creating multiple Music.Clip object instances in one single step.
| |
Music.newClips ( ObjectName1STR , ObjectName2STR , ... , ObjectNameNSTR ) |
Calling the Music.newClips method essentially amounts to calling the Music.Clip object constructor multiple times, each time passing the next ObjectNameSTR parameter specified in the Music.newClips method's parameter list.
So, for example, the statement...
Music.newClips ('saphiku','bhapthala','tituli','laghlaza');
|
...would be equivalent to the block of statements...
new Music.Clip ('saphiku');
new Music.Clip ('bhapthala');
new Music.Clip ('tituli');
new Music.Clip ('laghlaza');
|
- When creating Music.Clip object instances using the Music.newClips method, it is not possible to specify the additional parameters that can be accepted by the Music.Clip object constructor.


Level System
Officials play a vital role in the game, they are often
described as the third team on the ice. The basic role of the on-ice officials can be broken down into two simple words – safe and fair. For a referee to view and officiate the game with these two words in mind, they should be able to call a game that is acceptable to all of the participants.
The LRG training and development program is designed to assist young officials learn their role in the game and develop the skills necessary to ensure a safe and fair hockey game. This program consistently proves to be instrumental with guiding young officials for improvement of
As part of this program we assign experienced officials as
mentors to assist with the training and develop our younger officials. The on-ice mentorship and off-ice guidance brings practical and classroom style learning together with positive enforcement in order to build their self-confidence.
The Hockey Canada Officiating Program has opportunities for everyone from
the Initiation
at Level I, through to the Program of Excellence at Levels V and VI.
Select a level and start officiating!
| Level I |
| To prepare a young or new official to officiate minor hockey. |
| Level II |
| To further enhance the training and skills of minor hockey officials. |
| Level III |
| To prepare officials capable of refereeing minor hockey playoffs (league and regional) and women’s national championships, or being a linesperson in Junior B, Junior C, Junior D, Senior and U15 or U18 regional championships. |
| Level IV |
| To prepare officials capable of refereeing Senior, Junior A, Junior B, Junior C, Junior D, minor hockey regional and national championships, women’s national championships and designated IIHF competitions, or being a linesperson in Major Junior, Junior A, senior, U SPORTS, regional playoffs and IIHF competitions. |
| Level V |
| To prepare officials to referee Major Junior, Junior A, Senior, U SPORTS and regional playoffs. |
| Level VI |
| To prepare officials capable of refereeing at national championships and designated IIHF competitions (i.e. Memorial Cup, Centennial Cup, Allan Cup, David Johnston University Cup, IIHF world championships, Olympic Winter Games, FISU Games). |
General Certification Rules:
Certification at any level with the Hockey Canada
Officiating Program does not make an official automatically eligible for entry to the next level (except Level I). Demonstration of ability or potential ability is necessary to move to the next level.
Being certified at any one level does not necessarily mean an official will be able to officiate all categories of hockey defined at that level. Conversely, an official does not have to officiate all categories of hockey at a certain level in order to gain certification at that level.
Where it has been determined (through supervision) that an official is no longer able to officiate at a certain level, they will be certified at a new, lower level in line with their present ability.
An individual must be at least 16 years old to be certified at Level II or higher.
Contact Us to know more about certification


Cafe Altro Paradiso
South Village, 234 Spring Street New York, NY 10013
Café Altro Paradiso takes inspiration from most regions of Italy, and big windows that let in pleasant hues of light throughout the day and into the evening.
 It's our humble wish that this be another kind of paradise.
Average Price Per Person: $61
Here's the Menu~
Need More Info? Visit this page.


Power ON/OFF sequence
[Examples]
- Note:
- All examples assume that the ATMEL file system is initialized (see nav_reset())
Sequences to initialize ATMEL File System:
Sequences to execute before stop ATMEL File System:
- Note:
- If you have a system which shares disks between ATMEL File System and another File System, then you must stop ATMEL FS before jumping to other FS and reinit ATMEL FS after exit to other FS .
Example: In mode USB Device Mass Storage, it is a FileSystem from USB Host which is used.
You must stop ATMEL FS before start USB Device and reinit ATMEL FS after USB Device exit.


An interactive console program that allows traffic flows to be intercepted, inspected, modified and replayed.
Think tcpdump for HTTP - the same functionality as mitmproxy without the frills.
Crafted malice for tormenting HTTP clients and servers.
| See the latest release on Github for source, OSX and Windows builds. |
The mitmproxy forums are the right place to ask questions about using mitmproxy, propose changes to the project, and talk about the project as a whole.
Please report bugs on the Github issue tracker.
The mitmproxy developers use Slack to co-ordinate. Feel free to join us to chat, but keep support/how-to questions to the forums.
A privacy analysis and measurement service, built using mitmproxy - an example of a high-performance server-side application of the project.
A mitmproxy based devtools extension that lets you edit remote files locally and serve them directly to Chrome.
BackDoorFactory + mitmproxy - patch binaries with shell code on the fly.
A project from ustwo that offers an easy way to mock a service (e.g. API, Website).


Pagination
There are two ways to build pagination in Foundation 4: with our predefined HTML or with our mixin. Building pagination using our predefined classes isn't hard at all. You'll start with an unordered list and add a class of .pagination
to it. From there, you just need to add list items with links in them. Those list items have a few options you can use:
-
Add a class of
.unavailable
to a list item to make it not clickable, like for the ellipsis in the middle. - The page numbers and symbols are always inside of an anchor that you'll link to the page.
Centered Pagination
In some instances, you'll want you pagination to be centered within a container. We've got you covered! Just wrap your unordered list in something that has a defined width and add the class, .centered
.
Mix Pagination
In some instances, you'll want you pagination to be centered within a container. We've got you covered! Just wrap your unordered list in something that has a defined width and add the class, .pagination-mix
.


Alleged Norwegian spy returns home after Russian prison time
by The Associated PressHELSINKI — A Norwegian man convicted of espionage in Russia has returned to his native country after a Cold War-style spy swap in Lithuania.
Norwegian news agency NTB said Sunday that Frode Berg was flown by private jet from Vilnius, Lithuania, to Gardermoen military air base near Oslo late Saturday.
His lawyer, Brynjulf Risnes, told Norwegian public broadcaster NRK that the retired border inspector was relieved but “confused” to be back in Norway after been “in prison for two years in a foreign country under somewhat difficult conditions.”
Berg was arrested December 2017 in Moscow and handed a 14-year sentence on espionage charges for collecting information about Russian nuclear submarines.
On Friday, the 64-year-old was released as part of an exchange on the Lithuanian-Russian border together with two Lithuanians and two Russians.
The Associated Press


--- layout: default title: About | The Dork Knight Rises ---
Hello there!
My name is Samriddha Basu, known online as The Dork Knight. I am a CS grad student with a love of tech and a flair for code, interested in developing experiences for the new age of technology. I love tinkering with tech and I am also quite adept at weaving words into poetry. A couple of my poems have been published in anthologies by the British Council! You can find more details about me on this page, so feel free to look around! :)
Experience
Graduate Research Assistant, May 2023 - Present
Software Developer & Data Scientist (ENO), Jul 2021 - Jul 2022
Technology Analyst (ANL), Jul 2019 - Jul 2021
Education
Master of Computing (Computer Science), 2022 - Present
Bachelor of Engineering (Computer Engineering), 2015 - 2019
Junior College (Science), 2013-2015


We provide a realtime AI composer that can adapt to emotional cues, work from existing music and compose music in multiple styles.
The engine can generate music in over 16 different sub-genres. We group the sub-genres
into larger musical styles, which consist of the following.
Our ambient style is designed for functional music to accompany content or activities,
such as open-world games, relaxation, or meditation. It contains multiple sub-genres,
including Electro Ambient, Cinematic Ambient, and Dreamy Ambient.
An example of Electro Ambient in the Happy emotion:
Our House music style is designed as a contemporary dance style,
and is the style closest to popular music. It contains multiple sub-genres,
including Electro House, Funky House, Dreamy House, and Minimal House
An example of Funky House in the Happy emotion:
The AI engine doesn't only allow for electronic styles.
Our Piano style demonstrates this, as it is a simple style with only piano.
The style has sub-genres of Dreamy Piano, Dancey Piano, and Cinematic Piano
An example of Dancey Piano in the Happy emotion:
Another example of a more analog style is our Rock style.
This style has sub-genres of Classic Rock, Piano Rock, Epic Rock and Electro Rock
An example of Epic Rock in the Happy emotion:
The engine always has an emotional input, which defines how the music will be composed.
This happens continuously, on the fly
Each of the colored circles represents a particular emotion: Happy, Excited, Tense, Angry, Sad, Tired, Calm, Tender
(from top-right, moving counter-clockwise), and the music changes based on the instantaneous emotional input.
Under the hood, the engine generates a musical theme, and then constantly creates variations on that theme.
This means that a new song can be generated at the click of a button
In this video, new themes are generated (called "Seed 1", "Seed 2", etc.)
A theme is always "played" once through before creating variations on the theme
Amélie Anglade is a specialist in Music Information Retrieval–the application of AI to music. Her interests and background are in Music identification, recommendation and discovery. She received her PhD from Queen Mary University in London after doing 2 Master's degrees in Computer Science and Complex Adaptive Systems. She then went on to be the first MIR (Music Information Retrieval) engineer at Soundcloud, built their first recommendation engine, and evaluated their first finger-printing and search engines.
Ryan Groves is a composer, music theorist, and AI Music expert, in addition to being a curator and creator in the XR (Virtual/Augmented/Mixed Realities) space. He did his M.A. in Music Technology at McGill University. He then built the best music app of 2015 with over 6 million users, Ditty. He won the Best Paper award at ISMIR for his work on automated music theory.


Paradiso poster (2010)
Experimental Jetset, Erwin Brinkers, Marieke Stolk, Danny van den Dungen
About
This is a Poster. It was designed by Experimental Jetset, Erwin Brinkers, Marieke Stolk and Danny van den Dungen and made for (as the client) Paradiso. It is dated 2010 and we acquired it in 2015. Its medium is die-cut offset lithograph on paper. It is a part of the Drawings, Prints, and Graphic Design department.
In 2010, Experimental Jetset was asked to redesign a poster campaign that they had originally designed in 1996 for rock concert venue Paradiso. Paradiso has played a significant role in the Dutch rock- and counter-culture since its opening in 1968.
Experimental Jetset’s 1996 design for a tri-weekly poster series had used a series of capsule-shaped holes to reveal the surfaces on which they were hung. For their updated design, the designers transformed the capsule-shaped holes into circular ones, which were die-cut to overlap or eclipse the printed circles beside them, reminiscent of the popular calendar posters showing the different phases of the moon. The design team appreciated this lunar parallel for its relationship to the nocturnal schedule of the concert venue. They streamlined some of the poster’s elements, eliminating the arrows surrounding the venue’s name, but they incorporated a second color into the final design.
It is credited "Gift of Experimental Jetset."
Dimensions
59.5 × 42 cm (23 7/16 × 16 9/16 in.)


API Reference¶
Reference implementation of the Gemina specification.
For more details see the section Description.
The initialization vector for CBC, the keys, and the salt for HMAC
are created with os.urandom()
.
The key
argument for the functions encrypt_with_key()
,
decrypt_with_key()
, and verify_with_key()
should be created
with create_secret_key()
.
Overview¶
Raised if data could not be decrypted. |
|
Version enum. |
|
Create a secret key. |
|
Decrypt data using a secret key. |
|
Decrypt data using a password. |
|
Encrypt data using a secret key. |
|
Encrypt data using a password. |
|
Verify the encrypted data. |
|
Verify the encrypted data. |
-
class
gemina.
Version
(value)[source]¶ Version enum.
-
V1
= b'\x8a'¶ version 1
-
V2
= b'\x8b'¶ version 2
-
V3
= b'\x8c'¶ version 3
-
V4
= b'\x8d'¶ version 4
-
-
gemina.
create_secret_key
(*, version=<Version.V1>)[source]¶ Create a secret key.
It can be used with the functions
encrypt_with_key()
,decrypt_with_key()
, andverify_with_key()
.- Returns
secret key
- Return type
-
gemina.
decrypt_with_key
(key, data)[source]¶ Decrypt data using a secret key.
The data must have been encrypted with
encrypt_with_key()
.- Parameters
- Returns
decrypted data
- Return type
- Raises
TypeError – if
key
ordata
are notbytes
ValueError – if size of
key
is not correctDecryptError – if data could not be decrypted
-
gemina.
decrypt_with_password
(password, data)[source]¶ Decrypt data using a password.
The data must have been encrypted with
encrypt_with_password()
.- Parameters
- Returns
decrypted data
- Return type
- Raises
TypeError – if
password
ordata
are notbytes
DecryptError – if data could not be decrypted
-
gemina.
encrypt_with_key
(key, data, *, version=<Version.V1>)[source]¶ Encrypt data using a secret key.
- Parameters
- Returns
encrypted data
- Return type
- Raises
TypeError – if
key
ordata
are notbytes
ValueError – if size of
key
is not correct
-
gemina.
encrypt_with_password
(password, data, *, version=<Version.V1>)[source]¶ Encrypt data using a password.
The data will be encrypted with a key derived from the password and signed.
-
gemina.
verify_with_key
(key, data)[source]¶ Verify the encrypted data.
This function verifies the authenticity and the integrity of the data with the given key. This is also done during decryption.
The data must have been encrypted with
encrypt_with_key()
.- Parameters
- Returns
True
if secret key, authenticity and integrity are okay- Return type
- Raises
TypeError – if
key
ordata
are notbytes
ValueError – if size of
key
is not correct
-
gemina.
verify_with_password
(password, data)[source]¶ Verify the encrypted data.
This function verifies the authenticity and the integrity of the data with the key derived from the password. This is also done during decryption.
The data must have been encrypted with
encrypt_with_password()
.


Gecode::Iter::Ranges::Array Class Reference
[Range iterators]
Range iterator for array of ranges More...
#include <ranges-array.hpp>
Classes | |
| class | Range |
| Ranges for array More... | |
Protected Attributes | |
| Range * | r |
| Array for ranges. | |
| int | c |
| Current range. | |
| int | n |
| Number of ranges in array. | |
Constructors and initialization | |
|
| |
| Array (void) | |
| Default constructor. | |
| Array (Range *r, int n) | |
| Initialize with n ranges from r. | |
| void | init (Range *r, int n) |
| Initialize with n ranges from r. | |
Iteration control | |
|
| |
| bool | operator() (void) const |
| Test whether iterator is still at a range or done. | |
| void | operator++ (void) |
| Move iterator to next range (if possible). | |
| void | reset (void) |
| Reset iterator to start from beginning. | |
Range access | |
|
| |
| int | min (void) const |
| Return smallest value of range. | |
| int | max (void) const |
| Return largest value of range. | |
| unsigned int | width (void) const |
| Return width of range (distance between minimum and maximum). |
Detailed Description
Range iterator for array of ranges
Allows to iterate the ranges as defined by an array where the ranges must be increasing and non-overlapping. The ranges can be iterated several times provided the iterator is reset by the reset member function.
Definition at line 50 of file ranges-array.hpp.
Constructor & Destructor Documentation
| Gecode::Iter::Ranges::Array::Array | ( | void | ) | [inline] |
Default constructor.
Definition at line 98 of file ranges-array.hpp.
| Gecode::Iter::Ranges::Array::Array | ( | Range * | r, | |
| int | n | |||
| ) | [inline] |
Initialize with n ranges from r.
Definition at line 101 of file ranges-array.hpp.
Member Function Documentation
| void Gecode::Iter::Ranges::Array::init | ( | Range * | r, | |
| int | n | |||
| ) | [inline] |
Initialize with n ranges from r.
Definition at line 105 of file ranges-array.hpp.
| bool Gecode::Iter::Ranges::Array::operator() | ( | void | ) | const [inline] |
Test whether iterator is still at a range or done.
Definition at line 114 of file ranges-array.hpp.
| void Gecode::Iter::Ranges::Array::operator++ | ( | void | ) | [inline] |
Move iterator to next range (if possible).
Definition at line 110 of file ranges-array.hpp.
| void Gecode::Iter::Ranges::Array::reset | ( | void | ) | [inline] |
Reset iterator to start from beginning.
Definition at line 119 of file ranges-array.hpp.
| int Gecode::Iter::Ranges::Array::min | ( | void | ) | const [inline] |
Return smallest value of range.
Definition at line 124 of file ranges-array.hpp.
| int Gecode::Iter::Ranges::Array::max | ( | void | ) | const [inline] |
Return largest value of range.
Definition at line 128 of file ranges-array.hpp.
| unsigned int Gecode::Iter::Ranges::Array::width | ( | void | ) | const [inline] |
Return width of range (distance between minimum and maximum).
Definition at line 132 of file ranges-array.hpp.
Member Data Documentation
Range* Gecode::Iter::Ranges::Array::r [protected] |
Array for ranges.
Definition at line 59 of file ranges-array.hpp.
int Gecode::Iter::Ranges::Array::c [protected] |
Current range.
Definition at line 61 of file ranges-array.hpp.
int Gecode::Iter::Ranges::Array::n [protected] |
Number of ranges in array.
Definition at line 63 of file ranges-array.hpp.
The documentation for this class was generated from the following file:
- gecode/iter/ranges-array.hpp (Revision: 8109)


Switch cluster
Cluster
Custom cluster
Password
Reset to client defaults
Campaign override
Language
Country
Remote ip
Operator
Install referrer
Branding
Platform
Product
Major version
Home country
Clear SDV2
Operator override
Reset override
Generic request


{% if user.volunteerprofile.is_pending_review and user.volunteerprofile.is_edited %}
Your application to volunteer is being reviewed by our staff. You will be notified
as soon as you are approved and can start applying to volunteer in projects.
{% elif not user.volunteerprofile.is_edited %}
Your need to fill out your volunteer profile to be able to apply to volunteer in projects.
{% elif user.volunteerprofile.is_rejected %}
Your application to volunteer was reviewed by our staff and it was not accepted, so
you cannot apply to volunteer in projects at the moment.
{% elif user.volunteerprofile.is_accepted and not my_tasks %}
Congratulations! Your application to volunteer was accepted. You can now help any project in the site.
{% endif %}
{% endif %}
{% if my_tasks %}
{% for project_task in my_tasks %}


---
layout: post
title: 12/9
date: '2012-12-10T08:45:00.000-07:00'
author: Jacob .
tags:
modified_time: '2012-12-10T10:26:59.976-07:00'
blogger_id: tag:blogger.com,1999:blog-6400085873105072120.post-2224774098459631492
blogger_orig_url: http://www.svlark.com/2012/12/129.html
---
We've been doing some planning and boat research in spare moments.
As you know, I'm pretty well certain that Americans (among others) have lost their way, however we've decided that we really wanted to stick to happy thoughts on Windward Reach, so I've started another blog as an outlet for crying in the wilderness. When I complete the raison d'être essay for that one I'll post a link. I know you're all waiting on tenterhooks.
The darn scale kept producing different reading today so who knows? I'm definitely up a bit though.


This application lists the current number of cases reported across the globe
Total cases reported as of today
New cases reported since previus day:


Coding Theory in Sage#
Author: David Joyner and Robert Miller (2008), edited by Ralf Stephan for the initial version. David Lucas (2016) for this version. Marketa Slukova (2019) for the latest version.
This tutorial, designed for beginners who want to discover how to use Sage for their work (research, experimentation, teaching) on coding theory, will present several key features of Sage’s coding theory library and explain how to find classes and methods you look for.
During this tutorial, we will cover the following parts:
what can you do with generic linear codes and associated methods,
what can you do with structured code families,
what can you do to encode and recover messages, correct errors and
what can you do to easily add errors to codewords,
what can you do with codes in general.
The goal of this tutorial is to give a quick overview of what can be done with the library and how to use the main functionalities. It is neither a comprehensive description of all methods nor of specific classes. If one needs some specific information on the behaviour of a class/method related to coding theory, one should check the documentation for this class/method.
I. Generic Linear codes and associated methods#
Let us start with the most basic code one can build: a generic linear code without any specific structure.
To build such a code, one just need to provide its generator matrix, as follows:
sage: G = matrix(GF(3), [[1, 0, 0, 0, 1, 2, 1],
....: [0, 1, 0, 0, 2, 1, 0],
....: [0, 0, 1, 2, 2, 2, 2]])
sage: C = LinearCode(G)
With these lines, you just created a linear code, congratulations! Note that if you pass a matrix which is not full rank, Sage will turn it into a full-rank matrix before building the code, as illustrated in the following example:
sage: G = matrix(GF(3), [[1, 0, 0, 0, 1, 2, 1],
....: [0, 1, 0, 0, 2, 1, 0],
....: [0, 0, 1, 2, 2, 2, 2],
....: [1, 0, 1, 2, 0, 1, 0]]) #r3 = r0 + r2
sage: C = LinearCode(G)
sage: C.generator_matrix()
[1 0 0 0 1 2 1]
[0 1 0 0 2 1 0]
[0 0 1 2 2 2 2]
We now have a linear code… What can we do with it? As we can a lot of things, let us start with the basic functionalities.
In the example just above, we already asked for the code’s generator matrix. It is also possible to ask the code for its basic parameters: its length and dimension as illustrated thereafter:
sage: C.length()
7
sage: C.dimension()
3
It is also possible to ask for our code’s minimum distance:
sage: C.minimum_distance()
3
Of course, as C
is a generic linear code, an exhaustive search algorithm
is run to find the minimum distance, which will be slower and slower as the
code grows.
By just typing the name of our code, we get a sentence which briefly describes it and gives its parameters:
sage: C
[7, 3] linear code over GF(3)
As the aim of this tutorial is not to give a comprehensive view of the methods, we won’t describe any other methods.
If one wants to get all methods that can be run on a linear code, one can:
either check the manual page of the file Generic structures for linear codes over the Hamming metric
or type:
C.<tab>
in Sage to get a list of all available methods for
C
. Afterwards, typing:C.method?
will show the manual page for
method
.
Note
Some generic methods require the installation of the optional package Guava for Gap. While some work is done to always propose a default implementation which does not require an optional package, there exist some methods which are not up to date - yet. If you’re receiving an error message related to Gap, please check the documentation of the method to verify if Guava has to be installed.
II. Structured code families and an overview of the encoding and decoding system#
II.1 Create specific codes in Sage#
Now that we know how to create generic codes, we want to go deeper and create specific code families. In Sage, all codes families can be accessed by typing:
codes.<tab>
Doing so, you will get the comprehensive list of all code families Sage can build.
For the rest of this section, we will illustrate specific functionalities
of these code families by manipulating
sage.coding.grs_code.GeneralizedReedSolomonCode
.
So, for starters, we want to create a Generalized Reed-Solomon (GRS) code.
By clicking on the link provided above, or typing:
codes.GeneralizedReedSolomonCode?
one can access the documentation page for GRS codes, find a definition of these and learn what is needed to build one in Sage.
Here we choose to build a [12, 6] GRS code over \(\GF{13}\). To do this, we need up to three elements:
The list of evaluation points,
the dimension of the code, and
optionally, the list of column multipliers.
We build our code as follows:
sage: F = GF(13)
sage: length, dimension = 12, 6
sage: evaluation_pts = F.list()[:length]
sage: column_mults = F.list()[1:length+1]
sage: C = codes.GeneralizedReedSolomonCode(evaluation_pts, dimension, column_mults)
Our GRS code is now created. We can ask for its parameters, as we did in the previous section:
sage: C.length()
12
sage: C.dimension()
6
sage: C.base_ring()
Finite Field of size 13
It is also possible to ask for the evaluation points and
the column multipliers by calling
sage.coding.grs_code.GeneralizedReedSolomonCode.evaluation_points()
and
sage.coding.grs_code.GeneralizedReedSolomonCode.column_multipliers()
.
Now, if you know some theory for GRS codes, you know that it’s especially easy to compute their minimum distance, which is: \(d = n - k + 1\), where \(n\) is the length of the code and \(k\) is the dimension of the code.
Because Sage knows C
is a GRS code, it will not run the exhaustive
search algorithm presented in section I to find C
’s minimum distance
but use the operation introduced above. And you instantly get:
sage: C.minimum_distance()
7
All these parameters are summarized inside the string representation of our code:
sage: C
[12, 6, 7] Generalized Reed-Solomon Code over GF(13)
Note
Writing proper classes for code families is a work in progress.
Some constructions under codes.<tab>
might thus be functions which
build a generic linear code, and in that case are only able to use
generic algorithms.
Please refer to the documentation of a construction to check if it
is a function or a class.
II.2 Encode and decode in Sage#
In the previous part, we learnt how to find specific code families in Sage and create instances of these families.
In this part, we will learn how to encode and decode.
First of all, we want to generate a codeword to play with. There is two different ways to do that:
It is possible to just generate a random element of our code, as follows:
sage: c = C.random_element() sage: c in C True
Alternatively, we can create a message and then encode it into a codeword:
sage: msg = random_vector(C.base_field(), C.dimension()) sage: c = C.encode(msg) sage: c in C True
Either way, we obtained a codeword.
So, we might want to put some errors in it, and try to correct these
errors afterwards. We can obviously do it by changing the values at
some random positions of our codeword, but we propose here something
more general: communication channels.
sage.coding.channel.Channel
objects are meant
as abstractions for communication channels and for manipulation of
data representation. In this case, we want to emulate a communication channel
which adds some, but not too many, errors to a transmitted word:
sage: err = 3
sage: Chan = channels.StaticErrorRateChannel(C.ambient_space(), err)
sage: Chan
Static error rate channel creating 3 errors, of input and output space Vector space of dimension 12 over Finite Field of size 13
sage: r = Chan.transmit(c)
sage: len((c-r).nonzero_positions())
3
If you want to learn more on Channels, please refer to section IV of this tutorial.
Thanks to our channel, we got a “received word`, r
, as a codeword
with errors on it. We can try to correct the errors and recover the
original codeword:
sage: c_dec = C.decode_to_code(r)
sage: c_dec == c
True
Perhaps we want the original message back rather than the codeword. All we have to do then is to unencode it back to the message space:
sage: m_unenc = C.unencode(c_dec)
sage: m_unenc == msg
True
It is also possible to perform the two previous operations (correct the errors and recover the original message) in one line, as illustrated below:
sage: m_unenc2 = C.decode_to_message(r)
sage: m_unenc2 == msg
True
III. A deeper view of the Encoder and Decoder structure#
In the previous section, we saw that encoding, decoding and unencoding a vector can be easily done using methods directly on the code object. These methods are actually shortcuts, added for usability, for when one does not care more specifically about how encoding and decoding takes place. At some point, however, one might need more control.
This section will thus go into details on the mechanism of Encoders and Decoders.
At the core, the three mentioned operations are handled by
sage.coding.encoder.Encoder
and
sage.coding.decoder.Decoder
.
These objects possess their own methods to
operate on words. When one calls (as seen above):
C.encode(msg)
one actually calls the method sage.coding.encoder.Encoder.encode()
on the default encoder of C
.
Every code object possess a list of encoders and decoders it can use.
Let us see how one can explore this:
sage: C = codes.GeneralizedReedSolomonCode(GF(59).list()[:40], 12, GF(59).list()[1:41])
sage: C.encoders_available()
['EvaluationPolynomial', 'EvaluationVector', 'Systematic']
sage: C.decoders_available()
['BerlekampWelch',
'ErrorErasure',
'Gao',
'GuruswamiSudan',
'InformationSet',
'KeyEquationSyndrome',
'NearestNeighbor',
'Syndrome']
We got a list of the available encoders and decoders for our GRS code. Rather than using the default ones as we did before, we can now ask for specific encoder and decoder:
sage: Evect = C.encoder("EvaluationVector")
sage: Evect
Evaluation vector-style encoder for [40, 12, 29] Generalized Reed-Solomon Code over GF(59)
sage: type(Evect)
<class 'sage.coding.grs_code.GRSEvaluationVectorEncoder'>
sage: msg = random_vector(GF(59), C.dimension()) #random
sage: c = Evect.encode(msg)
sage: NN = C.decoder("NearestNeighbor")
sage: NN
Nearest neighbor decoder for [40, 12, 29] Generalized Reed-Solomon Code over GF(59)
Calling:
C.encoder(encoder_name)
is actually a short-hand for constructing the encoder manually,
by calling the constructor for
sage.coding.grs_code.EncoderGRSEvaluationVector
yourself.
If you don’t supply encoder_name
to
sage.coding.linear_code.AbstractLinearCode.encoder()
you get the default encoder for the code.
sage.coding.linear_code.AbstractLinearCode.encoder()
also has an important side-effect: it caches the constructed encoder
before returning it. This means that each time one will access the same
EvaluationVector
encoder for C
, which saves construction time.
All the above things are similar for Decoders. This reinforces that Encoders and Decoders are rarely constructed but used many times, which allows them to perform expensive precomputation at construction or first use, for the benefit of future use.
This gives a good idea of how the elements work internally. Let us now go a bit more into details on specific points.
III.1 Message spaces#
The point of an Encoder is to encode messages into the code.
These messages are often just vectors over the base field of the code
and whose length matches the code’s dimension.
But it could be anything: vectors over other fields, polynomials, or even
something quite different.
Therefore, each Encoder has a sage.coding.encoder.Encoder.message_space()
.
For instance, we saw earlier that our GRS code has two possible encoders;
let us investigate the one we left behind in the part just before:
sage: Epoly = C.encoder("EvaluationPolynomial")
sage: Epoly
Evaluation polynomial-style encoder for [40, 12, 29] Generalized Reed-Solomon Code over GF(59)
sage: Epoly.message_space()
Univariate Polynomial Ring in x over Finite Field of size 59
sage: msg_p = Epoly.message_space().random_element(degree=C.dimension()-1); msg_p #random
31*x^11 + 49*x^10 + 56*x^9 + 31*x^8 + 36*x^6 + 58*x^5 + 9*x^4 + 17*x^3 + 29*x^2 + 50*x + 46
Epoly
reflects that GRS codes are often constructed
as evaluations of polynomials, and that a natural way to consider
their messages is as polynomials of degree at most \(k-1\),
where \(k\) is the dimension of the code.
Notice that the message space of Epoly
is all univariate polynomials:
message_space
is the ambient space of the messages, and sometimes an Encoder
demands that the messages are actually picked from a subspace hereof.
The default encoder of a code always has a vector space as message space,
so when we call
sage.coding.linear_code.AbstractLinearCode.decode_to_message()
or
sage.coding.linear_code.AbstractLinearCode.unencode()
on the code itself,
as illustrated on the first example, this will always return
vectors whose length is the dimension of the code.
III.2 Generator matrices#
Whenever the message space of an Encoder is a vector space and it encodes using a linear map, the Encoder will possess a generator matrix (note that this notion does not make sense for other types of encoders), which specifies that linear map.
Generator matrices have been placed on Encoder objects since a code
has many generator matrices, and each of these will encode messages differently.
One will also find
sage.coding.linear_code.AbstractLinearCode.generator_matrix()
on code objects, but this is again simply a convenience method which forwards
the query to the default encoder.
Let us see this in Sage, using the first encoder we constructed:
sage: Evect.message_space()
Vector space of dimension 12 over Finite Field of size 59
sage: G = Evect.generator_matrix()
sage: G == C.generator_matrix()
True
III.3 Decoders and messages#
As we saw before, any code has two generic methods for decoding, called
decode_to_codeword
and decode_to_message
.
Every Decoder also has these two methods, and the methods on the code
simply forward the calls to the default decoder of this code.
There are two reasons for having these two methods: convenience and speed. Convenience is clear: having both methods provides a useful shortcut depending on the user’s needs. Concerning speed, some decoders naturally decode directly to a codeword, while others directly to a message space. Supporting both methods therefore avoids unnecessary work in encoding and unencoding.
However, decode_to_message
implies that there is a message space
and an encoding from that space to the code behind the scenes.
A Decoder has methods message_space
and connected_encoder
to inform the user about this. Let us illustrate that by a long example:
sage: C = codes.GeneralizedReedSolomonCode(GF(59).list()[1:41], 3, GF(59).list()[1:41])
sage: c = C.random_element()
sage: c in C
True
#Create two decoders: Syndrome and Gao
sage: Syn = C.decoder("KeyEquationSyndrome")
sage: Gao = C.decoder("Gao")
#Check their message spaces
sage: Syn.message_space()
Vector space of dimension 3 over Finite Field of size 59
sage: Gao.message_space()
Univariate Polynomial Ring in x over Finite Field of size 59
#and now we unencode
sage: Syn.decode_to_message(c) #random
(55,9,43)
sage: Gao.decode_to_message(c) #random
43*x^2 + 9*x + 55
IV. A deeper look at channels#
In Section II, we briefly introduced the Channel objects as a way to put errors in a word. In this section, we will look deeper at their functionality and introduce a second Channel.
Note
Once again, we chose a specific class as a running example through all this section, as we do not want to make an exhaustive catalog of all channels. If one wants to get this list, one can access it by typing:
channels.<tab>
in Sage.
Consider again the
sage.coding.channel.ChannelStaticErrorRate()
from before.
This is a channel that places errors in the transmitted vector
but within controlled boundaries.
We can describe these boundaries in two ways:
The first one was illustrated in Section II and consists in passing an integer, as shown below:
sage: C = codes.GeneralizedReedSolomonCode(GF(59).list()[:40], 12) sage: t = 14 sage: Chan = channels.StaticErrorRateChannel(C.ambient_space(), t) sage: Chan Static error rate channel creating 14 errors, of input and output space Vector space of dimension 40 over Finite Field of size 59
We can also pass a tuple of two integers, the first smaller than the second. Then each time a word is transmitted, a random number of errors between these two integers will be added:
sage: t = (1, 14) sage: Chan = channels.StaticErrorRateChannel(C.ambient_space(), t) sage: Chan Static error rate channel creating between 1 and 14 errors, of input and output space Vector space of dimension 40 over Finite Field of size 59
We already know that a channel has a
sage.coding.channel.Channel.transmit()
method which will
perform transmission over the channel; in this case it will return
the transmitted word with some errors in it.
This method will always check if the provided word belongs to
the input space of the channel.
In a case one is absolutely certain that one’s word is in the input space,
one might want to avoid this check, which is time consuming - especially
if one is simulating millions of transmissions.
For this usage there is
sage.coding.channel.Channel.transmit_unsafe()
which does
the same as
sage.coding.channel.Channel.transmit()
but without checking the input, as illustrated thereafter:
sage: c = C.random_element()
sage: c in C
True
sage: c_trans = Chan.transmit_unsafe(c)
sage: c_trans in C
False
Note there exists a useful shortcut for
sage.coding.channel.Channel.transmit()
sage: r = Chan(c)
sage: r in C
False
A channel for errors and erasures#
Let us introduce a new Channel object which adds errors and erasures. When it transmits a word, it both adds some errors as well as it erases some positions:
sage: Chan = channels.ErrorErasureChannel(C.ambient_space(), 3, 4)
sage: Chan
Error-and-erasure channel creating 3 errors and 4 erasures of input space Vector space of dimension 40 over Finite Field of size 59 and output space The Cartesian product of (Vector space of dimension 40 over Finite Field of size 59, Vector space of dimension 40 over Finite Field of size 2)
The first parameter is the input space of the channel.
The next two are (respectively) the number of errors
and the number or erasures.
Each of these can be tuples too, just as it was with
sage.coding.channel.StaticErrorRateChannel
.
As opposed to this channel though, the output of
sage.coding.channel.ErrorErasureChannel
is not the same as its input space, i.e. the ambient space of C.
Rather, it will return two vectors: the first is the transmitted word
with the errors added and erased positions set to 0.
The second one is the erasure vector whose erased positions contain ones.
This is reflected in sage.coding.channel.output_space()
:
sage: C = codes.random_linear_code(GF(7), 10, 5)
sage: Chan.output_space()
The Cartesian product of (Vector space of dimension 40 over Finite Field of size 59, Vector space of dimension 40 over Finite Field of size 2)
sage: Chan(c) # random
((0, 3, 6, 4, 4, 0, 1, 0, 0, 1),
(1, 0, 0, 0, 0, 1, 0, 0, 1, 0))
Note it is guaranteed by construction that errors and erasures
will never overlap, so when you ask for e
errors and t
erasures,
you will always receive a vector with e
errors and t
erased positions.
V. Codes in General#
So far we have talked only about codes which are linear and over the Hamming metric. Sage also supports codes which are non-linear and/or over a different metric. Since working with these usually involves creating new classes, they are covered in detail in How to write your own classes for coding theory.
For this tutorial, we include a small example of a linear code over the rank metric. Unlike the Hamming metric, where the distance between two words is the number of positions in which their differ, rank metric takes distance to be the rank of the difference of two codewords, which are represented as matrices.
We are going to create a generic linear code over the rank metric without any additional structure. To build such a code, we only need a generator matrix:
sage: G = Matrix(GF(4), [[1,1,0], [0,0,1]])
sage: C = codes.LinearRankMetricCode(G)
We can do all the things that we did with our example of a linear code over the Hamming metric. Therefore we are going to focus on the different metric.
Take a word in our code:
sage: c = C[1]
sage: c
(1, 1, 0)
Over the usual Hamming metric, the weight of this word would be \(2\). However, over the rank metric, we get a different result:
sage: C.rank_weight_of_vector(c)
1
The weight of a word in the rank metric is simply the rank of the matrix form of the word:
sage: C.matrix_form_of_vector(c)
[1 1 0]
[0 0 0]
As we said before, the distance between two words is the rank of their difference:
sage: d = C[2]
sage: d
(z2, z2, 0)
sage: C.rank_distance_between_vectors(c, d)
1
Even though the words \(c\) and \(d\) differ in two positions, their distance over the rank metric is \(1\):
sage: C.matrix_form_of_vector(c - d)
[1 1 0]
[1 1 0]
For more details on the linear rank metric code, see Generic structures for linear codes over the rank metric.
VI. Conclusion - Afterword#
This last section concludes our tutorial on coding theory.
After reading this, you should know enough to create and manipulate codes in Sage!
We did not illustrate all the content of the library in this tutorial. For instance, we did not mention how Sage manages bounds on codes.
All objects, constructions and methods related to coding theory are hidden
under the prefix codes
in Sage.
For instance, it is possible to find all encoders you can build by typing:
codes.encoders.<tab>
So, if you are looking for a specific object related to code, you should always type:
codes.<tab>
and check if there’s a subcategory which matches your needs.
Despite all the hard work we put on it, there’s always much to do!
Maybe at some point you might want to create your own codes for Sage. If it’s the case and if you don’t know how to do that, don’t panic! We also wrote a tutorial for this specific case, which you can find here: How to write your own classes for coding theory.


Our website address is: https://harvesterseasons.com. We are information service practitioners lead by the Finnish Meteorological Institute.
When visitors send us feedback using the form on the site, we collect the data shown in the feedback form, the coordinates of the locations shown on the map and time series, and also the visitor’s IP address to help spam detection.
The site uses JavaScript components loaded from other locations that may use cookies. The site itself does not save any cookies.
The site contains embedded data from other FMI servers and map information from Thunderforest and National Land Survey of Finland.
If you send feedback, the message and its metadata are retained indefinitely.
Finnish Meteorological Institute FMI, Arctic Space Center, Erik Palménin aukio 1, FIN-00560 Helsinki.
FMI is a governmental institute of Finland and fulfills Finnish and EU standards for data protection as prescribed.
FMI has appointed a security manager, that handles breach situations according to Finnish law requirements.
Visitor’s IP address is gathered using ipify API at https://www.ipify.org/.
We are not profiling our users.
Reproduction of the publicly available content of this website is authorised, provided the source is acknowledged, save where otherwise stated.
FMI maintains this website to enhance public access to information about the European Union’s Copernicus Programme. Our goal is to keep this information timely and accurate. If errors are brought to our attention, we will try to correct them. However, FMI accepts no responsibility or liability whatsoever with regard to the information on this site.
While abiding by the highest scientific and technical standards, FMI cannot warrant that any information provided by the service will be entirely free from errors or omissions or that such errors or omissions can or will be rectified entirely. This applies particularly to information, tools and data from projects that continue to be developed, but are made publicly available for the purpose of feedback and testing.
It is our goal to minimize disruption caused by technical errors. However, some data or information on our site may have been created or structured in files or formats that are not error-free and we cannot guarantee that our service will not be interrupted or otherwise affected by such problems. FMI accepts no responsibility with regard to such problems incurred as a result of using this site or any linked external sites. EC, ECMWF and FMI can’t be hold responsible for decisions based on the information presented in the application.
FMI may change material on the site without prior notice.


'Where is your million-dollar shirt?' I'm like, 'It's underneath these $25 Hanes T-shirts I've got on.'
First text
Secondary text
Third text


--- layout: post title: .mobi emulator date: 2006-08-24 00:00:00 categories: interfaces-&-interaction mobile ---
I was quite chuffed to see that the .mobi site which we built for Three, for their 3GSM awards entries, works nicely in the new .mobi emulator... which Carlo has given a bit of a panning to. A hearty slap on the back to Mr Skinner and Mr Ribot at FP for their work on the site.
I'd share his scepticism about the value of emulators - we did real testing on a huge range of devices to get www.three.mobi working as well as it does (after all, we were briefed by our client that it should work on any handset which a 3GSM attendee might use). That said, I guess some tools are better than no tools...