Trait-like CSS on HTML

Defining some CSS types One way of structuring the CSS is to define some types over the CSS classes. What these types might be may be is open, but one instance might be Behaviour, Layout and Roles. The types are not used explicitly in the CSS, but are there to help organize and abstract the… Continue reading Trait-like CSS on HTML

Reminders on Scala syntax

Reminders The companion object (both for own code and Scala’s API) Setter and getter functions are defined implicitly for val, var and referenced arguments in primary constructor. To set these manually Adding indexing operators Binding a variable during pattern matching Defining an extractor for pattern matching (example lacks validation) Imports can be grouped Types can… Continue reading Reminders on Scala syntax

Simple serialization with XML strings in Javascript

Introduction Included in this post are some quick and simple functions for doing XML serialization in Javascript through strings. Reserved XML characters < > & ‘ ” are escaped from input and if any invalid input are found an exception will be thrown. List of XML utility functions: toXmlHeader() – Creates the XML header. toXmlElem(name:… Continue reading Simple serialization with XML strings in Javascript

Comparison against null and undefined in Javascript

Values in Javascript can come from Object – object reference String – immutable, 16-bit USC-2 Boolean – true, false Number – only 64-bit floating point, IEEE 754 (double) null – empty object reference undefined – unassigned variables and function arguments, missing object properties Boolean evaluation of values using == and != operators Values that are… Continue reading Comparison against null and undefined in Javascript

Code documentation for Javascript and Actionscript 3

Prerequisites for Actionscript documentation Flex 2 SDK Prerequisites for Javascript documentation JSDoc For Windows users: ActivePerl HTML::Template – Perl module required by JSDoc For Windows users: Microsoft NMAKE – Build utility required by ActivePerl to install HTML::Template Actionscript 3 Code Documentation Example documentation: Extracting the documentation from the sourcecode: Javascript Code Documentation Example documentation: Extracting… Continue reading Code documentation for Javascript and Actionscript 3