text:
/**
 * Test-cases for the Viewport Compliance Test.
 *
 * @file testcases.js
 * @author Rune Lillesveen <rune@opera.com>
 * @author Oyvind Stenhaug <oyvinds@opera.com>
 */

/**
 *
 * The test fields:
 *
 * "opera-only": Set to true if the test only should be run in Opera.
 *
 * "server-only": Set to true if the test needs to be run from a server.
 *
 * "url": The url to the test document to use.
 *        This document should either have a #test-container element for measuring viewport dimensions (see e.g. test-docs/viewport-test.html),
 *        in which case the test result will be determined by the given expected computed values for 'width'/'height' etc,
 *        or a #last-x element for determining text wrap behavior (see e.g. test-docs/text-wrap-test.html),
 *        in which case the test result will be determined by the given expected value of "text-wrap-enabled".
 *
 * "meta-content": The content attribute of the viewport meta tag to test.
 *
 * "css-rules": The declarations of the @viewport rule to test.
 *              The at-rule will be put in a style element. If a meta tag is also written, the meta tag comes first.
 *
 * "min-width": A function returning the expected computed value of the min-width property, assuming no UA style sheet.
 *          This should return a number which is a length in pixels,
 *          undefined which means not specified, or null which means explicitly
 *          set to "auto".
 *          This can be a function, and will then be called with a ViewportDeviceObject parameter. That object
 *          can be used to resolve relative/absolute lengths, percentages and keywords
 *          to pixel lengths. See framework.js for available methods.
 *
 * "max-width": A function returning the expected computed value of the max-width property, assuming no UA style sheet.
 *          This should return a number which is a length in pixels,
 *          undefined which means not specified, or null which means explicitly
 *          set to "auto".
 *          This can be a function, and will then be called with a ViewportDeviceObject parameter. That object
 *          can be used to resolve relative/absolute lengths, percentages and keywords
 *          to pixel lengths. See framework.js for available methods.
 *
 * "min-height": A function returning the expected computed value of the min-height property, assuming no UA style sheet.
 *           This should return a number which is a length in pixels,
 *           undefined which means not specified, or null which means explicitly
 *           set to "auto".
 *           This can be a function, and will then be called with a ViewportDeviceObject parameter. That object
 *           can be used to resolve relative/absolute lengths, percentages and keywords
 *           to pixel lengths. See framework.js for available methods.
 *
 * "max-height": A function returning the expected computed value of the max-height property, assuming no UA style sheet.
 *           This should return a number which is a length in pixels,
 *           undefined which means not specified, or null which means explicitly
 *           set to "auto".
 *           This can be a function, and will then be called with a ViewportDeviceObject parameter. That object
 *           can be used to resolve relative/absolute lengths, percentages and keywords
 *           to pixel lengths. See framework.js for available methods.
 *
 * "zoom": The expected computed value of the zoom property, assuming no UA style sheet.
 *               This property should either be a number which is the scale factor,
 *               undefined which means not specified, or null which means
 *               explicitly set to "auto". (E.g.: Represent 100% as 1.)
 *
 * "min-zoom": The expected computed value of min-zoom, assuming no UA style sheet.
 *              A value of undefined means not specified and null means explicitly set to "auto".
 *              This can be a function, and will then be called with a ViewportDeviceObject parameter.
 *              That object has information on e.g. default UA zoom values.
 *              See framework.js for available methods.
 *
 * "max-zoom": The expected computed value of max-zoom, assuming no UA style sheet.
 *              A value of undefined means not specified and null means explicitly set to "auto".
 *
 * "mimetype": The mimetype to be checked.
 *             This value is not used in the actual test. It's just an annotation.
 *             The actual mimetype for the test is set in the .htaccess file.
 *
 * "text-wrap-enabled": Expected enabled/disable status of ERA TextWrap.
 *                      true if enabled is expected, otherwise false.
 *
 * "description": A textual description of the test.
 *
 */

var viewportTests = [

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport Meta with \"width=device-width\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=device-height",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport Meta with \"height=device-height\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=1.0",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "Viewport META with \"initial-scale=1.0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=2.0",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 2,
      "description" : "Viewport META with \"initial-scale=2.0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=0.5",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 0.5,
      "description" : "Viewport META with \"initial-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=1.6",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1.6,
      "description" : "Viewport META with \"initial-scale=1.6\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0",
      "max-zoom" : 0.1,
      "description" : "Viewport META with \"maximum-scale=0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0, initial-scale=0.5",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 0.1,
      "zoom" : 0.5,
      "description" : "Viewport META with \"maximum-scale=0, initial-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0, initial-scale=3",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 0.1,
      "zoom" : 3,
      "description" : "Viewport META with \"maximum-scale=0, initial-scale=3\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0, initial-scale=10",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 0.1,
      "zoom" : 10,
      "description" : "Viewport META with \"maximum-scale=0, initial-scale=10\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0.5",
      "max-zoom" : 0.5,
      "description" : "Viewport META with \"maximum-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0.5, initial-scale=4",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 0.5,
      "zoom" : 4,
      "description" : "Viewport META with \"maximum-scale=0.5, initial-scale=4\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0.5, initial-scale=0.2",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 0.5,
      "zoom" : 0.2,
      "description" : "Viewport META with \"maximum-scale=0.5, initial-scale=0.2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=1, initial-scale=2",
      "min-width" : null,
      "max-width" : null,
      "max-zoom" : 1,
      "zoom" : 2,
      "description" : "Viewport META with \"maximum-scale=1, initial-scale=2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=1",
      "min-zoom" : function(deviceObject) { return Math.min(deviceObject.getDefaultMaxZoom(), 1); },
      "description" : "Viewport META with \"minimum-scale=1\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=8",
      "min-zoom" : function(deviceObject) { return Math.min(deviceObject.getDefaultMaxZoom(), 8); },
      "description" : "Viewport META with \"minimum-scale=8\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=10",
      "min-zoom" : function(deviceObject) { return Math.min(deviceObject.getDefaultMaxZoom(), 10); },
      "description" : "Viewport META with \"minimum-scale=10\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=8, initial-scale=6",
      "min-width" : null,
      "max-width" : null,
      "min-zoom" : function(deviceObject) { return Math.min(deviceObject.getDefaultMaxZoom(), 8); },
      "zoom" : 6,
      "description" : "Viewport META with \"minimum-scale=8, initial-scale=6\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=1, minimum-scale=2",
      "min-width" : null,
      "max-width" : null,
      "min-zoom" : function(deviceObject) { return Math.min(deviceObject.getDefaultMaxZoom(), 2); },
      "zoom" : 1,
      "description" : "Viewport META with \"initial-scale=1, minimum-scale=2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=10, maximum-scale=0.1",
      "min-zoom" : 10,
      "max-zoom" : 0.1,
      "description" : "Viewport META with \"minimum-scale=10, maximum-scale=0.1\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=0.1, minimum-scale=10",
      "min-zoom" : 10,
      "max-zoom" : 0.1,
      "description" : "Viewport META with \"maximum-scale=0.1, minimum-scale=10\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=10, maximum-scale=1",
      "min-zoom" : 10,
      "max-zoom" : 1,
      "description" : "Viewport META with \"minimum-scale=10, maximum-scale=1\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=3, maximum-scale=2",
      "min-zoom" : 3,
      "max-zoom" : 2,
      "description" : "Viewport META with \"minimum-scale=3, maximum-scale=2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=3, minimum-scale=4",
      "min-zoom" : 4,
      "max-zoom" : 3,
      "description" : "Viewport META with \"maximum-scale=3, minimum-scale=4\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=10, minimum-scale=10",
      "min-zoom" : 10,
      "max-zoom" : 10,
      "description" : "Viewport META with \"maximum-scale=10, minimum-scale=10\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=8, maximum-scale=9",
      "min-zoom" : 8,
      "max-zoom" : 9,
      "description" : "Viewport META with \"minimum-scale=8, maximum-scale=9\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "",
      "description" : "Viewport META with empty content (\"\")." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-height",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport META with \"width=device-height\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=700",
      "min-width" : 700,
      "max-width" : 700,
      "description" : "Viewport META with \"width=700\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=200",
      "min-width" : 200,
      "max-width" : 200,
      "description" : "Viewport META with \"width=200\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=700",
      "min-height" : 700,
      "max-height" : 700,
      "description" : "Viewport META with \"height=700\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=200",
      "min-height" : 200,
      "max-height" : 200,
      "description" : "Viewport META with \"height=200\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, initial-scale=2",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "zoom" : 2,
      "description" : "Viewport META with \"width=device-width, initial-scale=2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, initial-scale=0.5",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "zoom" : 0.5,
      "description" : "Viewport META with \"width=device-width, initial-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=480, initial-scale=0.1",
      "min-width" : 480,
      "max-width" : 480,
      "zoom" : 0.1,
      "description" : "Viewport META with \"width=480, initial-scale=0.1\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=700, initial-scale=1.6",
      "min-width" : null,
      "max-width" : null,
      "min-height" : 700,
      "max-height" : 700,
      "zoom" : 1.6,
      "description" : "Viewport META with \"height=700, initial-scale=1.6\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=device-height, initial-scale=1",
      "min-width" : null,
      "max-width" : null,
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "zoom" : 1,
      "description" : "Viewport META with \"height=device-height, initial-scale=1\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=200, initial-scale=0.5",
      "min-width" : null,
      "max-width" : null,
      "min-height" : 200,
      "max-height" : 200,
      "zoom" : 0.5,
      "description" : "Viewport META with \"height=200, initial-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=200, height=700",
      "min-width" : 200,
      "max-width" : 200,
      "min-height" : 700,
      "max-height" : 700,
      "description" : "Viewport META with \"width=200, height=700\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=700, height=device-height",
      "min-width" : 700,
      "max-width" : 700,
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport META with \"width=700, height=device-height\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=1000, height=device-height, initial-scale=0.5",
      "min-width" : 1000,
      "max-width" : 1000,
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "zoom" : 0.5,
      "description" : "Viewport META with \"width=1000, height=device-height, initial-scale=0.5\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, height=1000, initial-scale=2",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "min-height" : 1000,
      "max-height" : 1000,
      "zoom" : 2,
      "description" : "Viewport META with \"width=device-width, height=1000, initial-scale=2\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=0",
      "min-width" : 1,
      "max-width" : 1,
      "description" : "Viewport META with \"width=0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=15000, height=20000",
      "min-width" : 10000,
      "max-width" : 10000,
      "min-height" : 10000,
      "max-height" : 10000,
      "description" : "Viewport META with \"width=15000, height=20000\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=0, maximum-scale=0",
      "min-zoom" : 0.1,
      "max-zoom" : 0.1,
      "description" : "Viewport META with \"minimum-scale=0, maximum-scale=0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=11, maximum-scale=13, initial-scale=12",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 10,
      "min-zoom" : 10,
      "max-zoom" : 10,
      "description" : "Viewport META with \"minimum-scale=11, maximum-scale=13, initial-scale=12\"." },

    /*
     *
     * Tests for extending width and height to fill viewport at given initial-scale below
     *
     */

    { "url" : "viewport-test.html",
      "meta-content" : "width=10, height=3000, initial-scale=1.0",
      "min-width" : 10,
      "max-width" : 10,
      "min-height" : 3000,
      "max-height" : 3000,
      "zoom" : 1,
      "description" : "Check that width is increased to fill the visual viewport." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=3000, height=10, initial-scale=1.0",
      "min-width" : 3000,
      "max-width" : 3000,
      "min-height" : 10,
      "max-height" : 10,
      "zoom" : 1,
      "description" : "Check that height is increased to fill the visual viewport." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=10, height=10, initial-scale=1.0",
      "min-width" : 10,
      "max-width" : 10,
      "min-height" : 10,
      "max-height" : 10,
      "zoom" : 1,
      "description" : "Check that both width and height are increased to fill the visual viewport." },

    /*
     *
     * Tests for Viewport META property parsing below
     *
     */

    { "url" : "viewport-test.html",
      "meta-content" : "width=-100",
      "description" : "Check that negative width is translated to auto." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=-1.5",
      "description" : "Check that negative height is translated to auto." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=garbage",
      "min-width" : 1,
      "max-width" : 1,
      "description" : "Check that unrecognized keyword translate to 0 for width." },

    { "url" : "viewport-test.html",
      "meta-content" : "height=y20",
      "min-height" : 1,
      "max-height" : 1,
      "description" : "Check that unrecognized keyword translate to 0 for height." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width;",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Check that ';' is not included in keyword" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=yes, height=no",
      "min-width" : 1,
      "max-width" : 1,
      "min-height" : 1,
      "max-height" : 1,
      "description" : "Check that 'yes' and 'no' translate to 0 for width/height." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=-1",
      "description" : "Check that negative initial-scale is auto." },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=yes",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "Check that initial-scale=yes is 1.0." },

    { "url" : "viewport-test.html",
      "meta-content" : "minimum-scale=no, initial-scale=0",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 0.1,
      "min-zoom" : 0.1,
      "description" : "Check that minimum-scale=no is 0." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=yes, initial-scale=2",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 2,
      "max-zoom" : 1,
      "description" : "Check that maximum-scale=yes is 1." },

    { "url" : "viewport-test.html",
      "meta-content" : "maximum-scale=device-height, initial-scale=10",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 10,
      "max-zoom" : 10,
      "description" : "Check that maximum-scale=device-height is 10." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that space is a valid separator." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100,initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that comma is a valid separator." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 ,initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that comma is a valid separator (space before)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100, initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that comma is a valid separator (space after)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100;initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that semi-colon is a valid separator (no spaces)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 ;initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that semi-colon is a valid separator (space before)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100; initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that semi-colon is a valid separator (space after)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100x initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that alpha character after number is ignored and space acts as a valid separator." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 xinitial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "description" : "Check that xinitial-scale property is dropped after space." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 x initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "description" : "Check that property name without a value does not cause synchronization on following space." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 x,initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that a comma forces synchronization after property name with no value." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 x;initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that a property name without a value synchronize on following semi-colon (no space)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 x; initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that a property name without a value synchronize on following semi-colon (space after)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 x;  initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Check that a property name without a value synchronize on following semi-colon (multiple spaces after)." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=10 x; maximum-scale=10 initial-scale=10",
      "min-width" : 10,
      "max-width" : 10,
      "zoom" : 10,
      "max-zoom" : 10,
      "description" : "Semicolon is a valid separator." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=10 maximum-scale=10 initial-scale=10",
      "min-width" : 10,
      "max-width" : 10,
      "zoom" : 10,
      "max-zoom" : 10,
      "description" : "Three properties with values separated by spaces." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=10 ;,initial-scale=yes;",
      "min-width" : 10,
      "max-width" : 10,
      "zoom" : 1,
      "description" : "\"yes;\" means \"yes\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 a= initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "description" : "Space is consumed before property value." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100 a=; initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Semi-colon is a valid separator in place for a property value." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=100,,,initial-scale=1",
      "min-width" : 100,
      "max-width" : 100,
      "zoom" : 1,
      "description" : "Multiple commas allowed." },

    { "url" : "viewport-test.html",
      "meta-content" : "width====3000",
      "min-width" : 3000,
      "max-width" : 3000,
      "description" : "Multiple equals-signs are accepted." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=400%",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "width=400% gives 400 pixels." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=height=830",
      "min-width" : 0,
      "max-width" : 0,
      "description" : "Value can contain equals sign." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=,height=480",
      "min-height" : 480,
      "max-height" : 480,
      "description" : "Comma separator terminates empty value." },

    { "url" : "viewport-test.html",
      "meta-content" : "width = 540",
      "min-width" : 540,
      "max-width" : 540,
      "description" : "Space can occur before and after assignment operator" },

    { "url" : "viewport-test.html",
      "meta-content" : "initial-scale=.7",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 0.7,
      "description" : ".7 is a valid initial-scale" },

    { "url" : "viewport-test.html",
      "meta-content" : "width 500",
      "description" : "Space is not an assignment operator" },

    { "url" : "viewport-test.html",
      "meta-content" : "width:680",
      "description" : "Colon is not an assignment operator" },

    /*
     *
     * Tests for mobile DOCTYPEs below
     *
     */

    { "url" : "xhtmlmp10.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "XHTML Mobile Profile 1.0 document that should trigger width=device-width." },

    { "url" : "xhtmlmp10.html",
      "meta-content" : "width=700, initial-scale=0.5",
      "min-width" : 700,
      "max-width" : 700,
      "zoom" : 0.5,
      "description" : "XHTML Mobile Profile 1.0 document with viewport meta" },

    { "url" : "xhtmlmp10-oma.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "OMA XHTML Mobile Profile 1.0 document that should trigger width=device-width." },

    { "url" : "xhtmlmp11.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "XHTML Mobile Profile 1.1 document that should trigger width=device-width." },

    { "url" : "xhtmlmp12.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "XHTML Mobile Profile 1.2 document that should trigger width=device-width." },

    { "opera-only" : true,
      "url" : "xhtmlbasic10.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "XHTML Basic 1.0 document that should trigger width=device-width." },

    { "opera-only" : true,
      "url" : "xhtmlbasic11.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "XHTML Basic 1.1 document that should trigger width=device-width." },

    { "opera-only" : true,
      "url" : "compact.html",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "Compact HTML document that should trigger width=device-width." },

    /*
     *
     * Tests for mobile document mimetypes below
     *
     */

    { "opera-only" : true,
      "server-only" : true,
      "url" : "mobdoc-http-vnd.wap.html",
      "mimetype": "application/vnd.wap.xhtml+xml",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 1,
      "description" : "Document with mime-type (application/vnd.wap.xhtml+xml) that should be recognized as a Mobile Document and set width to device-width.\n\nThis test must be run from a server." },

    /*
     *
     * Tests for ERA text-wrap below
     *
     */

    { "opera-only" : true,
      "url" : "text-wrap-test.html",
      "meta-content" : "width=600, maximum-scale=10, initial-scale=2",
      "text-wrap-enabled" : true,
      "description" : "Check that ERA TextWrap is enabled for pages with a Viewport META tag.\n\nThis is an Opera-only test. It will be skipped for other browsers." },

    { "opera-only" : true,
      "url" : "text-wrap-test.html",
      "text-wrap-enabled" : true,
      "description" : "Check that ERA TextWrap is enabled for pages without a Viewport META tag.\n\nThis is an Opera-only test. It will be skipped for other browsers." },

    /*
     *
     * More tests for Viewport META property parsing
     *
     */

    { "url" : "viewport-test.html",
      "meta-content" : "= width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Empty property name not allowed (\"= width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : "== width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Empty property name not allowed (\"== width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : " = width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Empty property name not allowed (\" = width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : " == width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Empty property name not allowed (\" == width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : "x= width=400",
      "description" : "Width is value in \"x= width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "x== width=400",
      "description" : "Width is value in \"x== width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "x = width=400",
      "description" : "Width is value in \"x = width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "x == width=400",
      "description" : "Width is value in \"x == width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "=x width=400",
      "description" : "Empty property name not allowed (\"=x width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : "==x width=400",
      "description" : "Empty property name not allowed (\"==x width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : " =x width=400",
      "description" : "Empty property name not allowed (\" =x width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : " ==x width=400",
      "description" : "Empty property name not allowed (\" ==x width=400\")" },

    { "url" : "viewport-test.html",
      "meta-content" : ".=: width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "'.' and ':' are not separators" },

    { "url" : "viewport-test.html",
      "meta-content" : "=x hei og hopp width=400",
      "description" : "Width not recognized in \"=x hei og hopp width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "x hei og hopp width=400",
      "description" : "Width not recognized in \"x hei og hopp width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "width width=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Width recognized in \"width width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "width height=400",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Width recognized in \"width height=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "height width=400",
      "min-height" : 400,
      "max-height" : 400,
      "description" : "Height recognized in \"height width=400\"" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width=",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Width recognized in \"width=device-width=\" because '=' is a separator" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=	device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Check that horizontal tab is a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=
device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Check that line feed is a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width",
      "min-width" : 1,
      "max-width" : 1,
      "description" : "Check that vertical tab is not a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=�device-width",
      "min-width" : 1,
      "max-width" : 1,
      "description" : "Check that form feed is not a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=
device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Check that carriage return is a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width= device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Check that the space entity is a separator" },

    { "url" : "viewport-test.html",
      "meta-content" : "width= device-width",
      "min-width" : 1,
      "max-width" : 1,
      "description" : "Check that EM SPACE is not a separator space" },

    { "url" : "viewport-test.html",
      "meta-content" : "width",
      "description" : "Just a property name is dropped" },

    { "url" : "viewport-test.html",
      "meta-content" : "width=",
      "description" : "Empty property value is dropped" },

    { "url" : "viewport-test.html",
      "meta-content" : "height=2000",
      "min-height" : 2000,
      "max-height" : 2000,
      "description" : "Viewport META with \"height=2000\"." },

    /*
     * Viewport at-rule tests
     */

    { "url" : "viewport-test.html",
      "css-rules" : "width: device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"width: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: auto",
      "min-width" : null,
      "max-width" : null,
      "description" : "Viewport at-rule with \"width: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: device-height",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"width: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 600px",
      "min-width" : 600,
      "max-width" : 600,
      "description" : "Viewport at-rule with \"width: 600px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 200%",
      "min-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*2; },
      "max-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*2; },
      "description" : "Viewport at-rule with \"width: 200%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: auto",
      "min-height" : null,
      "max-height" : null,
      "description" : "Viewport at-rule with \"height: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: device-width",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"height: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: device-height",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"height: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 800px",
      "min-height" : 800,
      "max-height" : 800,
      "description" : "Viewport at-rule with \"height: 800px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 200%",
      "min-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*2; },
      "max-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*2; },
      "description" : "Viewport at-rule with \"height: 200%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: auto",
      "zoom" : null,
      "description" : "Viewport at-rule with \"zoom: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 1",
      "zoom" : 1,
      "description" : "Viewport at-rule with \"zoom: 1\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 0.5",
      "zoom" : 0.5,
      "description" : "Viewport at-rule with \"zoom: 0.5\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-zoom: auto",
      "min-zoom" : null,
      "description" : "Viewport at-rule with \"min-zoom: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-zoom: auto; zoom: 0.2",
      "zoom" : 0.2,
      "min-zoom" : null,
      "description" : "Viewport at-rule with \"min-zoom: auto; zoom: 0.2\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-zoom: 1.0",
      "min-zoom" : 1,
      "description" : "Viewport at-rule with \"min-zoom: 1.0\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: .5; min-zoom: 1.0",
      "zoom" : 0.5,
      "min-zoom" : 1,
      "description" : "Viewport at-rule with \"zoom: .5; min-zoom: 1.0\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-zoom: auto",
      "max-zoom" : null,
      "description" : "Viewport at-rule with \"max-zoom: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 6; max-zoom: auto",
      "zoom" : 6,
      "max-zoom" : null,
      "description" : "Viewport at-rule with \"zoom: 6; max-zoom: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 2; max-zoom: 1",
      "zoom" : 2,
      "max-zoom" : 1,
      "description" : "Viewport at-rule with \"zoom: 2; max-zoom: 1\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 700px; zoom: 5; max-zoom: 2; min-zoom: 1; width: auto;",
      "min-width" : null,
      "max-width" : null,
      "zoom" : 5,
      "max-zoom" : 2,
      "min-zoom" : 1,
      "description" : "Viewport at-rule with several properties set." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 50em",
      "min-width" : function(deviceObject) { return deviceObject.getEM()*50; },
      "max-width" : function(deviceObject) { return deviceObject.getEM()*50; },
      "description" : "Viewport at-rule with \"width: 50em\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 100.0ex",
      "min-width" : function(deviceObject) { return deviceObject.getEX()*100; },
      "max-width" : function(deviceObject) { return deviceObject.getEX()*100; },
      "description" : "Viewport at-rule with \"width: 100.0ex\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 10in",
      "min-width" : function(deviceObject) { return deviceObject.getIN()*10; },
      "max-width" : function(deviceObject) { return deviceObject.getIN()*10; },
      "description" : "Viewport at-rule with \"width: 10in\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 7.62cm",
      "min-width" : function(deviceObject) { return deviceObject.getCM()*7.62; },
      "max-width" : function(deviceObject) { return deviceObject.getCM()*7.62; },
      "description" : "Viewport at-rule with \"width: 7.62cm\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 101.6mm",
      "min-height" : function(deviceObject) { return deviceObject.getMM()*101.6; },
      "max-height" : function(deviceObject) { return deviceObject.getMM()*101.6; },
      "description" : "Viewport at-rule with \"width: 101.6mm\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 300pt",
      "min-width" : function(deviceObject) { return deviceObject.getPT()*300; },
      "description" : "Viewport at-rule with \"min-width: 300pt\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-width: 12pc",
      "max-width" : function(deviceObject) { return deviceObject.getPC()*12; },
      "description" : "Viewport at-rule with \"max-width: 12pc\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: auto",
      "min-width" : null,
      "description" : "Viewport at-rule with \"min-width: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"min-width: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: device-height",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"min-width: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 500px",
      "min-width" : 500,
      "description" : "Viewport at-rule with \"min-width: 500px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-width: device-width",
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"max-width: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-width: device-height",
      "max-width" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"max-width: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-width: 220px",
      "max-width" : 220,
      "description" : "Viewport at-rule with \"max-width: 220px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 2px; max-width: 200%",
      "min-width" : 2,
      "max-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*2; },
      "description" : "Viewport at-rule with \"min-width: 2px; max-width: 200%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 150%; max-width: 50%",
      "min-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*1.5; },
      "max-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*0.5; },
      "description" : "Viewport at-rule with \"min-width: 150%; max-width: 50%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 900px; max-width: 200px; width: device-width",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"min-width: 900px; max-width: 200px; width: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 900px; max-width: 200px",
      "min-width" : 900,
      "max-width" : 200,
      "description" : "Viewport at-rule with \"width: 900px; max-width: 200px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 200px; max-width: 900px",
      "min-width" : 200,
      "max-width" : 900,
      "description" : "Viewport at-rule with \"width: 200px; max-width: 900px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 900px 200px",
      "min-width" : 900,
      "max-width" : 200,
      "description" : "Viewport at-rule with \"width: 900px 200px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 20em 20em",
      "min-width" : function(deviceObject) { return deviceObject.getEM()*20; },
      "max-width" : function(deviceObject) { return deviceObject.getEM()*20; },
      "description" : "Viewport at-rule with \"width: 20em 20em\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: auto 200%",
      "min-width" : null,
      "max-width" : function(deviceObject) { return deviceObject.getAvailableWidth()*2; },
      "description" : "Viewport at-rule with \"width: auto 200%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 1mm device-width",
      "min-width" : function(deviceObject) { return deviceObject.getMM(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"width: 1mm device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 200px 4000px; min-width: 1000px",
      "min-width" : 1000,
      "max-width" : 4000,
      "description" : "Viewport at-rule with \"width: 200px 4000px; min-width: 1000px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-width: 1000px; width: 200px 4000px",
      "min-width" : 200,
      "max-width" : 4000,
      "description" : "Viewport at-rule with \"width: 200px 4000px; min-width: 1000px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-height: auto",
      "min-height" : function() { return null; },
      "description" : "Viewport at-rule with \"min-height: auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-height: device-width",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"min-height: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-height: device-height",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"min-height: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-height: 500px",
      "min-height" : 500,
      "description" : "Viewport at-rule with \"min-height: 500px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-height: device-width",
      "max-height" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport at-rule with \"max-height: device-width\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-height: device-height",
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"max-height: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "max-height: 220px",
      "max-height" : 220,
      "description" : "Viewport at-rule with \"max-height: 220px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-height: 2000px; max-height: 3000px; height: device-height",
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "description" : "Viewport at-rule with \"min-height: 2000px; max-height: 3000px; height: device-height\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: device-height; min-height: 150%; max-height: 200px;",
      "min-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*1.5; },
      "max-height" : 200,
      "description" : "Viewport at-rule with \"height: device-height; min-height: 150%; max-height: 200px;\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 200% 300%",
      "min-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*2; },
      "max-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*3; },
      "description" : "Viewport at-rule with \"height: 200% 300%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 3000px 2000px",
      "min-height" : 3000,
      "max-height" : 2000,
      "description" : "Viewport at-rule with \"height: 3000px 2000px\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "height: 3000px; height: auto auto",
      "min-height" : null,
      "max-height" : null,
      "description" : "Viewport at-rule with \"height: 3000px; height: auto auto\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 700px; width: -500px;",
      "min-width" : 700,
      "max-width" : 700,
      "description" : "Viewport at-rule with negative width." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 700px; width: 0px;",
      "min-width" : 700,
      "max-width" : 700,
      "description" : "Viewport at-rule with zero width." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 2; zoom: -1;",
      "zoom" : 2,
      "description" : "Viewport at-rule with negative zoom." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 2; zoom: 0;",
      "zoom" : 2,
      "description" : "Viewport at-rule with zero zoom." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 650em; height: 5000%",
      "min-width" : function(deviceObject) { return deviceObject.getEM()*650; },
      "max-width" : function(deviceObject) { return deviceObject.getEM()*650; },
      "min-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*50; },
      "max-height" : function(deviceObject) { return deviceObject.getAvailableHeight()*50; },
      "description" : "Viewport at-rule with large width and height." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 6",
      "zoom" : 6,
      "description" : "Viewport at-rule with large zoom." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 16; min-zoom: 20",
      "zoom" : 16,
      "min-zoom" : 20,
      "description" : "Viewport at-rule with large zoom and min-zoom." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 2; zoom: inherit",
      "zoom" : 2,
      "description" : "Viewport at-rule with 'inherit' value." },

    { "url" : "meta-and-style-test.html",
      "meta-content" : "height=-1",
      "css-rules" : "width: auto; zoom: 1;",
      "min-width" : null,
      "max-width" : null,
      "min-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "max-height" : function(deviceObject) { return deviceObject.getDeviceHeight(); },
      "zoom" : 1,
      "min-zoom" : 3,
      "description" : "Viewport at-rule > meta > at-rule." },

    { "url" : "media-and-style-test.html",
      "min-width" : 200,
      "max-width" : 200,
      "description" : "Viewport at-rule inside @media." },

    { "url" : "css-link-test.html",
      "min-width" : 200,
      "max-width" : 200,
      "description" : "Viewport at-rule via link element." },

    { "url" : "two-viewport-at-rules.html",
      "min-width" : 400,
      "max-width" : 400,
      "min-height" : 700,
      "max-height" : 700,
      "description" : "Viewport at-rules, two in one style element." },

    { "url" : "viewport-test.html",
      "css-rules" : "width: 400px !important; width: 900px",
      "min-width" : 400,
      "max-width" : 400,
      "description" : "Viewport at-rule, !important declaration." },

    { "url" : "mixed-case-at-viewport.html",
      "min-width" : 900,
      "max-width" : 900,
      "description" : "Viewport at-rule, mixed case for at-keyword." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 100%;",
      "zoom" : 1,
      "description" : "Viewport at-rule with \"zoom: 100%;\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 600%; zoom: -100%",
      "zoom" : 6,
      "description" : "Viewport at-rule with \"zoom: 600%; zoom: -100%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "min-zoom: 150%; zoom: 100%",
      "zoom" : 1,
      "min-zoom" : 1.5,
      "description" : "Viewport at-rule with \"min-zoom: 150%; zoom: 100%\"." },

    { "url" : "viewport-test.html",
      "css-rules" : "zoom: 0.8; max-zoom: 50%",
      "zoom" : 0.8,
      "max-zoom" : 0.5,
      "description" : "Viewport at-rule with \"zoom: 0.8; max-zoom: 50%\"." },

    { "url" : "multiple-at-media-at-viewport.html",
      "min-width" : function(deviceObject) { var aw = deviceObject.getAvailableWidth(); return (aw <= 400 ? 700 : (aw >= 800 ? 400 : 100)); },
      "max-width" : function(deviceObject) { var aw = deviceObject.getAvailableWidth(); return (aw <= 400 ? 700 : (aw >= 800 ? 400 : 100)); },
      "description" : "Viewport at-rules and multiple @media rules." },

    { "url" : "at-viewport-media-height.html",
      "min-width" : function(deviceObject) { return (deviceObject.getAvailableHeight() <= 500 ? 300 : undefined); },
      "max-width" : function(deviceObject) { return (deviceObject.getAvailableHeight() <= 500 ? 300 : undefined); },
      "min-height" : 900,
      "max-height" : 900,
      "description" : "Viewport at-rules in @media depending on height." },

      /* target-densityDpi */

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=device-dpi",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(deviceObject.getDPI()); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(deviceObject.getDPI()); },
      "target-densitydpi" : function(deviceObject) { return deviceObject.getDPI(); },
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=device-dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=low-dpi",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(120); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(120); },
      "target-densitydpi" : 120,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=low-dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=medium-dpi",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "target-densitydpi" : 160,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=medium-dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=high-dpi",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(240); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(240); },
      "target-densitydpi" : 240,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=high-dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=70",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(70); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(70); },
      "target-densitydpi" : 70,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=70\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=200",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(200); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(200); },
      "target-densitydpi" : 200,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=200\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=400",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(400); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(400); },
      "target-densitydpi" : 400,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=400\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=69",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=69\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=100, target-densityDpi=300",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(300); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(300); },
      "target-densitydpi" : 300,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=100, target-densityDpi=300\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=160, target-densityDpi=401",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "target-densitydpi" : 160,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=160, target-densityDpi=401\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=100.9",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(100.9); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(100.9); },
      "target-densitydpi" : 100.9,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=100.9\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=120dpi",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(120); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(120); },
      "target-densitydpi" : 120,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=120dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=160garbage",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(160); },
      "target-densitydpi" : 160,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=160garbage\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=140, target-densityDpi=0",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(140); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(140); },
      "target-densitydpi" : 140,
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=140, target-densityDpi=0\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densityDpi=-100",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(); },
      "description" : "Viewport Meta with \"width=device-width, target-densityDpi=-100\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=device-width, target-densitydpi=180",
      "min-width" : function(deviceObject) { return deviceObject.getDeviceWidth(180); },
      "max-width" : function(deviceObject) { return deviceObject.getDeviceWidth(180); },
      "target-densitydpi" : 180,
      "description" : "Viewport Meta with \"width=device-width, target-densitydpi=180\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "width=300, target-densityDpi=130",
      "min-width" : 300,
      "max-width" : 300,
      "target-densitydpi" : 130,
      "description" : "Viewport Meta with \"width=300, target-densityDpi=130\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "target-densityDpi=low-dpi",
      "target-densitydpi" : 120,
      "description" : "Viewport Meta with \"target-densityDpi=low-dpi\"." },

    { "url" : "viewport-test.html",
      "meta-content" : "target-densityDpi=medium-dpi, initial-scale=2",
      "min-width" : null,
      "max-width" : null,
      "target-densitydpi" : 160,
      "zoom" : 2,
      "description" : "Viewport Meta with \"target-densityDpi=medium-dpi, initial-scale=2\"." }
];


text:
{% extends "_post.html" %}
{%hyde
    title: "give credit where credit is due"
    created: 2003-08-17 05:18:38
%}

{% block article %}
{%article%}

I’ve been listening to music for like 12 hours straight now using the latest Rhythmbox from CVS.  I’m happy to say that it hasn’t crashed even ONCE during this time.  The UI feels snappy, and everything Just Works (with the exception of it not playing a couple of my mp3s, but whatever).  MAD PROPS TO WALTERS AND THE REST OF THE RHYTHMBOX TEAM!

So, what I’m trying to say is, if you gave up on Rhythmbox back in the day, give it another chance.  Oh, here’s a screenshot.

{%endarticle%}
{% endblock %}

redpajama_set_name: RedPajamaGithub


text:
         use XML::Writer;
         use IO::File;

         my $output = new IO::File(">output.xml");

         my $writer = new XML::Writer(OUTPUT => $output);
         $writer->startTag("greeting",
                           "class" => "simple");
         $writer->characters("Hello, world!");
         $writer->endTag("greeting");
         $writer->end();
         $output->close();


text:
public interface CarElementVisitor {
	void visit(Wheel wheel);

	void visit(Engine engine);

	void visit(Body body);

	void visit(Car car);
}


text:
package com.laserfiche

import org.apache.predictionio.controller.Evaluation
import org.apache.predictionio.controller.MetricEvaluator

object CompleteEvaluation extends Evaluation {
  engineEvaluator = (
    RFClassificationEngine(),
    MetricEvaluator(
      metric = Accuracy(),
      otherMetrics = Seq(Precision(0.0), Precision(1.0), Precision(2.0)),
      outputPath = "best.json"))
}


text:
<!DOCTYPE html>

	<meta charset=utf-8 />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<title></title>
  <link rel="shortcut icon" href="/images/favicon-unlock-alt.ico">
	<link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" />

    <link rel="stylesheet" type="text/css" media="screen" href="/css/captcha.css" />

        <form class="register-form">
          <input type="text" placeholder="name"/>
          <input type="password" placeholder="password"/>
          <input type="text" placeholder="email address"/>
          <button>create</button>

Already registered? Sign In

        </form>
        <form class="login-form captcha-form" action="" method="post">
          <input type="text" name="user" placeholder="username"/>
          <input type="password" name="pw" placeholder="password"/>
          <button class="captcha-button">login</button>

Not registered? Create an account

        </form>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Lichenologist 2: 144 (1963)

#### Original name
Variolaria flavida DC.

### Remarks
null


text:
This test code shows how to configure gpio

## GPIO functions:

 * GPIO15: output
 * GPIO17: output

## Test:
Each press of boot button toggles 1/0 on both output


text:
***

## **Summary**
 * Add some skills about game programming.


text:
#ifndef __SCHEDULER_H
#define __SCHEDULER_H

#include "DRAM.h"
#include "Request.h"
#include "Controller.h"
#include <vector>
#include <map>
#include <list>
#include <functional>
#include <cassert>

using namespace std;

namespace ramulator
{

template <typename T>
class Controller;

template <typename T>
class Scheduler
{
public:
    Controller<T>* ctrl;

    enum class Type {
        FCFS, FRFCFS, FRFCFS_Cap, MAX
    } type = Type::FRFCFS;

    long cap = 16;

    Scheduler(Controller<T>* ctrl) : ctrl(ctrl) {}

    list<Request>::iterator get_head(list<Request>& q)
    {
        if (!q.size())
            return q.end();

        auto head = q.begin();
        for (auto itr = next(q.begin(), 1); itr != q.end(); itr++)
            head = compare[int(type)](head, itr);

        return head;
    }

private:
    typedef list<Request>::iterator ReqIter;
    function<ReqIter(ReqIter, ReqIter)> compare[int(Type::MAX)] = {
        // FCFS
        [this] (ReqIter req1, ReqIter req2) {
            if (req1->arrive <= req2->arrive) return req1;
            return req2;},

        // FRFCFS
        [this] (ReqIter req1, ReqIter req2) {
            bool ready1 = this->ctrl->is_ready(req1);
            bool ready2 = this->ctrl->is_ready(req2);

            if (ready1 ^ ready2) {
                if (ready1) return req1;
                return req2;
            }

            if (req1->arrive <= req2->arrive) return req1;
            return req2;},

        // FRFCFS_CAP
        [this] (ReqIter req1, ReqIter req2) {
            bool ready1 = this->ctrl->is_ready(req1);
            bool ready2 = this->ctrl->is_ready(req2);

            ready1 = ready1 && (this->ctrl->rowtable->get_hits(req1->addr_vec) <= this->cap);
            ready2 = ready2 && (this->ctrl->rowtable->get_hits(req2->addr_vec) <= this->cap);

            if (ready1 ^ ready2) {
                if (ready1) return req1;
                return req2;
            }

            if (req1->arrive <= req2->arrive) return req1;
            return req2;}
    };
};

template <typename T>
class RowPolicy
{
public:
    Controller<T>* ctrl;

    enum class Type {
        Closed, Opened, Timeout, MAX
    } type = Type::Opened;

    int timeout = 50;

    RowPolicy(Controller<T>* ctrl) : ctrl(ctrl) {}

    vector<int> get_victim(typename T::Command cmd)
    {
        return policy[int(type)](cmd);
    }

private:
    function<vector<int>(typename T::Command)> policy[int(Type::MAX)] = {
        // Closed
        [this] (typename T::Command cmd) -> vector<int> {
            for (auto& kv : this->ctrl->rowtable->table) {
                if (!this->ctrl->is_ready(cmd, kv.first))
                    continue;
                return kv.first;
            }
            return vector<int>();},

        // Opened
        [this] (typename T::Command cmd) {
            return vector<int>();},

        // Timeout
        [this] (typename T::Command cmd) -> vector<int> {
            for (auto& kv : this->ctrl->rowtable->table) {
                auto& entry = kv.second;
                if (this->ctrl->clk - entry.timestamp < timeout)
                    continue;
                if (!this->ctrl->is_ready(cmd, kv.first))
                    continue;
                return kv.first;
            }
            return vector<int>();}
    };

};

template <typename T>
class RowTable
{
public:
    Controller<T>* ctrl;

    struct Entry {
        int row;
        int hits;
        long timestamp;
    };

    map<vector<int>, Entry> table;

    RowTable(Controller<T>* ctrl) : ctrl(ctrl) {}

    void update(typename T::Command cmd, const vector<int>& addr_vec, long clk)
    {
        auto begin = addr_vec.begin();
        auto end = begin + int(T::Level::Row);
        vector<int> rowgroup(begin, end); // bank or subarray
        int row = *end;

        T* spec = ctrl->channel->spec;

        if (spec->is_opening(cmd))
            table.insert({rowgroup, {row, 0, clk}});

        if (spec->is_accessing(cmd)) {
            // we are accessing a row -- update its entry
            auto match = table.find(rowgroup);
            assert(match != table.end());
            assert(match->second.row == row);
            match->second.hits++;
            match->second.timestamp = clk;
        } /* accessing */

        if (spec->is_closing(cmd)) {
          // we are closing one or more rows -- remove their entries
          int n_rm = 0;
          int scope = int(spec->scope[int(cmd)]);
          for (auto it = table.begin(); it != table.end();) {
            if (equal(begin, begin + scope + 1, it->first.begin())) {
              n_rm++;
              it = table.erase(it);
            }
            else
              it++;
          }
          assert(n_rm > 0);
        } /* closing */
    }

    int get_hits(vector<int>& addr_vec)
    {
        auto begin = addr_vec.begin();
        auto end = begin + int(T::Level::Row);

        vector<int> rowgroup(begin, end);
        int row = *end;

        auto itr = table.find(rowgroup);
        auto entry = table[rowgroup];
        if (itr == table.end() || entry.row != row)
            return 0;

        return entry.hits;
    }
};

} /*namespace ramulator*/

#endif /*__SCHEDULER_H*/


text:
[type-definitions]: https://github.com/facebook/jest/blob/main/packages/jest-types/src/Circus.ts

jest-circus

The next-gen test runner for Jest

## Overview

Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend.

Circus allows you to bind to events via an optional event handler on any [custom environment](https://jestjs.io/docs/configuration#testenvironment-string). See the [type definitions][type-definitions] for more information on the events and state data currently available.

```js
import {Event, State} from 'jest-circus';
import NodeEnvironment from 'jest-environment-node';

class MyCustomEnvironment extends NodeEnvironment {
  //...

  async handleTestEvent(event: Event, state: State) {
    if (event.name === 'test_start') {
      // ...
    }
  }
}
```

Mutating event or state data is currently unsupported and may cause unexpected behavior or break in a future release without warning. New events, event data, and/or state data will not be considered a breaking change and may be added in any minor release.

Note, that `jest-circus` test runner would pause until a promise returned from `handleTestEvent` gets fulfilled. **However, there are a few events that do not conform to this rule, namely**: `start_describe_definition`, `finish_describe_definition`, `add_hook`, `add_test` or `error` (for the up-to-date list you can look at [SyncEvent type in the types definitions][type-definitions]). That is caused by backward compatibility reasons and `process.on('unhandledRejection', callback)` signature, but that usually should not be a problem for most of the use cases.

## Installation

> Note: As of Jest 27, `jest-circus` is the default test runner, so you do not have to install it to use it.

Install `jest-circus` using yarn:

```bash
yarn add --dev jest-circus
```

Or via npm:

```bash
npm install --save-dev jest-circus
```

## Configure

Configure Jest to use `jest-circus` via the [`testRunner`](https://jestjs.io/docs/configuration#testrunner-string) option:

```json
{
  "testRunner": "jest-circus/runner"
}
```

Or via CLI:

```bash
jest --testRunner='jest-circus/runner'
```


text:
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand

from refreshtoken.models import RefreshToken
from refreshtoken.settings import api_settings as jwt_refresh_settings

class Command(BaseCommand):
    """
    Generate a token for all users in all databases.

    The refresh token 'key' is automatically generated by the 'refreshtoken'
    app.
    Refresh tokens are only generated for a user if the user does not have one.
    """

    help = 'Generate refresh tokens for all users without refresh tokens.'

    def handle(self, *args, **kwargs):
        for user in (
                get_user_model().objects
                .filter(refresh_tokens__isnull=True)):
            RefreshToken.objects.create(
                user=user, app=jwt_refresh_settings.JWT_APP_NAME).save()
            self.stdout.write('Created refresh token for {}'.format(user))


text:
<link rel="import" href="../../bower_components/polymer/polymer.html">

<dom-module id="more-info-default">

  <template>

      <template is='dom-repeat' items="[[computeDisplayAttributes(stateObj)]]" as="attribute">

[[attribute]]

[[getAttributeValue(stateObj, attribute)]]

      </template>

  </template>
</dom-module>


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content="Evernote Mac 6.3 (452849)"/><meta name="altitude" content="478.5169982910156"/><meta name="author" content="petergoldsborough@hotmail.com"/><meta name="created" content="2015-09-21 22:52:14 +0000"/><meta name="latitude" content="48.25686248814288"/><meta name="longitude" content="11.65509006337584"/><meta name="source" content="desktop.mac"/><meta name="updated" content="2015-09-21 22:55:50 +0000"/><title>std::generate</title>

You can fill a range with a value using std::fill:

std::vector<std::size_t> v(10);

std::fill(v.begin(), v.end(), 5); // fills the range with fives

But if you have a function that returns different values at each subsequent call, use the std::generate:

std::size_t foo()

{

     static std::size_t count = 0;

     return count++;

}

std::generate(v.begin(), v.end(), foo); // sets *itr = foo() at each call

or assign to only a certain number of elements with std::generate_n:

template<typename Itr, typename Function>

std::generate_n(Itr destination, std::size_t count, Function function);

std::generate(v.begin(), 3, foo); // assign foo() to three elements starting at v.begin()


text:
using global::System;
using global::System.Threading;
using global::System.Reflection;
using global::System.Diagnostics;
using global::System.Collections.Generic;

using global::Internal.Runtime.Augments;
using global::Internal.Reflection.Execution;
using global::Internal.Reflection.Core.Execution;
using global::Internal.Runtime.CompilerServices;

using TargetException = System.ArgumentException;

namespace Internal.Reflection.Execution.MethodInvokers
{
    //
    // Implements Invoke() for non-virtual instance methods.
    //
    internal sealed class InstanceMethodInvoker : MethodInvokerWithMethodInvokeInfo
    {
        public InstanceMethodInvoker(MethodInvokeInfo methodInvokeInfo, RuntimeTypeHandle declaringTypeHandle)
            : base(methodInvokeInfo)
        {
            _declaringTypeHandle = declaringTypeHandle;
        }

        public sealed override Object Invoke(Object thisObject, Object[] arguments)
        {
            MethodInvokerUtils.ValidateThis(thisObject, _declaringTypeHandle);
            return RuntimeAugments.CallDynamicInvokeMethod(
                thisObject, MethodInvokeInfo.LdFtnResult, null, MethodInvokeInfo.DynamicInvokeMethod, MethodInvokeInfo.DynamicInvokeGenericDictionary, MethodInvokeInfo.DefaultValueString, arguments,
                invokeMethodHelperIsThisCall: false, methodToCallIsThisCall: true);
        }

        public sealed override Delegate CreateDelegate(RuntimeTypeHandle delegateType, Object target, bool isStatic, bool isVirtual, bool isOpen)
        {
            if (isOpen)
            {
                return RuntimeAugments.CreateDelegate(
                    delegateType,
                    new OpenMethodResolver(_declaringTypeHandle, MethodInvokeInfo.LdFtnResult, 0).ToIntPtr(),
                    target,
                    isStatic: isStatic,
                    isOpen: isOpen);
            }
            else
            {
                return base.CreateDelegate(delegateType, target, isStatic, isVirtual, isOpen);
            }
        }

        private RuntimeTypeHandle _declaringTypeHandle;
    }
}


text:
namespace Aspose.Tasks.Examples.CSharp
{
    using System.Collections.Generic;
    using System.IO;
    using NUnit.Framework;

    [TestFixture]
    public class ExOleObjectCollection : ApiExampleBase
    {
        [Test]
        public void WorkWithOleObjectCollection()
        {
            // ExStart:WorkWithOleObjectCollection
            // ExFor: OleObjectCollection
            // ExFor: OleObjectCollection.GetEnumerator
            // ExFor: OleObjectCollection.ToList
            // ExSummary: Shows how to work with collection of OLE objects.
            IDictionary<string, string> extensions = new Dictionary<string, string>
            {
                { "RTF", "_rtfFile_out.rtf" },
                { "MSWordDoc", "_wordFile_out.docx" },
                { "ExcelML12", "_excelFile_out.xlsx" }
            };

            var project = new Project(DataDir + "Embedded.mpp");

            // by using index access
            // List<OleObject> list = project.OleObjects.ToList();
            // for (var index = 0; index < list.Count; index++)
            // {
            // var oleObject = list[index];
            // }

            // or enumeration one can iterate over OLE objects
            foreach (var oleObject in project.OleObjects)
            {
                if (string.IsNullOrEmpty(oleObject.FileFormat) || !extensions.ContainsKey(oleObject.FileFormat))
                {
                    continue;
                }

                var path = OutDir + "EmbeddedContent_" + extensions[oleObject.FileFormat];
                using (var stream = new FileStream(path, FileMode.Create))
                {
                    stream.Write(oleObject.Content, 0, oleObject.Content.Length);
                }
            }

            // ExEnd:WorkWithOleObjectCollection
        }
    }
}


text:
#include <et-ext/rt/integrator.h>

namespace et {
namespace rt {
#define ET_RT_USE_RUSSIAN_ROULETTE 1

float4 evaluateNormals(Scene& scene, const Ray& inRay, Evaluate& eval) {
	KDTree::TraverseResult hit0 = scene.kdTree.traverse(inRay);
	if (hit0.triangleIndex == InvalidIndex)
		return float4(1.0f); // TODO : sample light? env->sampleInDirection(inRay.direction);

	const auto& tri = scene.kdTree.triangleAtIndex(hit0.triangleIndex);
	return tri.interpolatedNormal(hit0.intersectionPointBarycentric) * 0.5f + float4(0.5f);
}

float4 evaluateAmbientOcclusion(Scene& scene, const Ray& inRay, Evaluate& eval)
{
	float4 result(1.0f);

	KDTree::TraverseResult hit = scene.kdTree.traverse(inRay);
	if (hit.triangleIndex != InvalidIndex)
	{
		++eval.pathLength;

		vec4simd randomSample(fastRandomFloat(), fastRandomFloat(), 0.0f, 0.0f);

		const Triangle& tri = scene.kdTree.triangleAtIndex(hit.triangleIndex);
		float4 surfaceNormal = tri.interpolatedNormal(hit.intersectionPointBarycentric);
		float4 nextDirection = randomVectorOnHemisphere(randomSample, surfaceNormal, uniformDistribution);

		float4 origin = hit.intersectionPoint;
		hit = scene.kdTree.traverse(Ray(origin, nextDirection));

		if (hit.triangleIndex != InvalidIndex)
			result = float4(0.0f);
	}

	return result;
}

float4 evaluateGlobalIllumination(Scene& scene, const Ray& inRay, Evaluate& eval) {
	if (eval.maxPathLength == 0)
		eval.maxPathLength = 0x7FFFFFFF;

	float4 result(0.0f);
	float4 throughput(1.0f);

	Ray currentRay = inRay;
	for (eval.pathLength = 0; eval.pathLength < eval.maxPathLength; ++eval.pathLength)
	{
		KDTree::TraverseResult intersection = scene.kdTree.traverse(currentRay);
		if (intersection.triangleIndex == InvalidIndex)
		{
			for (const Emitter::Pointer& em : scene.emitters)
			{
				if (em->type() == Emitter::Type::Uniform)
				{
					float pdf;
					float4 nrm;
					float4 pos;
					float4 l = em->evaluate(scene, currentRay.origin, currentRay.direction, nrm, pos, pdf);
					result += throughput * l;
				}
			}
			break;
		}

		const Triangle& tri = scene.kdTree.triangleAtIndex(intersection.triangleIndex);
		const Material& mtl = scene.materials[tri.materialIndex];
		float4 nrm = tri.interpolatedNormal(intersection.intersectionPointBarycentric);
		float4 uv0 = tri.interpolatedTexCoord0(intersection.intersectionPointBarycentric);

		BSDFSample bsdfSample(currentRay.direction, nrm, mtl, uv0);

		result += throughput * mtl.emissive;
		throughput *= bsdfSample.evaluate();

		currentRay.origin = intersection.intersectionPoint;
		currentRay.direction = bsdfSample.Wo;

	#	if (ET_RT_USE_RUSSIAN_ROULETTE)
		if (eval.pathLength > 16)
		{
			ET_ALIGNED(16) float local[4] = {};
			throughput.loadToFloats(local);
			float maxComponent = std::max(local[0], std::max(local[1], local[2]));
			float q = std::min(maxComponent, 0.95f);
			if (rt::fastRandomFloat() >= q)
				break;
			throughput /= q;
		}
	#	endif

	}

	return result;
}

}
}


text:
package us.dot.its.jpo.ode.plugin.j2735;

public enum J2735LightbarInUse {
	UNAVAILABLE,
	NOTINUSE,
	INUSE,
	YELLOWCAUTIONLIGHTS,
	SCHOOLBUSLIGHTS,
	ARROWSIGNSACTIVE,
	SLOWMOVINGVEHICLE,
	FREQSTOPS

}


text:
package com.google.cloud.dataproc.v1.samples;

// [START dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_paged_async]
import com.google.cloud.dataproc.v1.AutoscalingPolicy;
import com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClient;
import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest;
import com.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse;
import com.google.cloud.dataproc.v1.LocationName;
import com.google.common.base.Strings;

public class AsyncListAutoscalingPoliciesPaged {

  public static void main(String[] args) throws Exception {
    asyncListAutoscalingPoliciesPaged();
  }

  public static void asyncListAutoscalingPoliciesPaged() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (AutoscalingPolicyServiceClient autoscalingPolicyServiceClient =
        AutoscalingPolicyServiceClient.create()) {
      ListAutoscalingPoliciesRequest request =
          ListAutoscalingPoliciesRequest.newBuilder()
              .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
              .setPageSize(883849137)
              .setPageToken("pageToken873572522")
              .build();
      while (true) {
        ListAutoscalingPoliciesResponse response =
            autoscalingPolicyServiceClient.listAutoscalingPoliciesCallable().call(request);
        for (AutoscalingPolicy element : response.getPoliciesList()) {
          // doThingsWith(element);
        }
        String nextPageToken = response.getNextPageToken();
        if (!Strings.isNullOrEmpty(nextPageToken)) {
          request = request.toBuilder().setPageToken(nextPageToken).build();
        } else {
          break;
        }
      }
    }
  }
}
// [END dataproc_v1_generated_autoscalingpolicyserviceclient_listautoscalingpolicies_paged_async]


text:
#include <TFile.h>
#include <TList.h>
#include <TNamed.h>
#include "AliQA.h"

void AnaQA(Int_t run)
{
// Macro to analyse the output of the QAChecker

  // Open the file that holds the AliQA object
  const char * resultFileName = "QA.root" ; //AliQA::GetQAResultFileName() ;
  const char * msgE = "QA ERROR: " ;
  const char * msgS = "QA SIGNAL: " ;

  TFile * inputQAFile = TFile::Open(resultFileName) ;
  if ( ! inputQAFile ) {
    printf("QA ERROR: File %s not found\n", AliQA::GetQAResultFileName()) ;
    exit(1) ;
  }
  // Get the AliQA object from the file
 // inputQAFile.ls() ;
  AliQA * qa = dynamic_cast<AliQA*>(inputQAFile->Get(AliQA::GetQAName())) ;
  // Show the status of all Detectors
  for (Int_t det = 0 ; det < AliQA::kNDET ; det++) {
    for (Int_t task = 0 ; task < AliQA::kNTASK ; task++) {
      if (qa->IsSetAny(AliQA::DETECTORINDEX_t(det), AliQA::ALITASK_t(task))) {
        qa->ShowStatus(AliQA::DETECTORINDEX_t(det), AliQA::ALITASK_t(task)) ;
        // found a bad detector, open the QA data file and search for the faulty histogram
        TFile * dataQAFile = TFile::Open(AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
        if ( ! dataQAFile ) {
          printf("%s File %s not found\n", msgE, AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
          exit(1) ;
        }
        dataQAFile->cd(AliQA::GetDetName(AliQA::DETECTORINDEX_t(det))) ;
        TDirectory * saveDir = gDirectory ;
        switch (task) {
          case AliQA::kNULLTASK:
            break ;
          case AliQA::kRAW:
            Bool_t dir = saveDir->cd(AliQA::GetTaskName(AliQA::kRAWS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kRAWS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kRAWS).Data(),
                           obj->GetName());
                }
              }
            }
            break ;
          case AliQA::kSIM:
            dir = saveDir->cd(AliQA::GetTaskName(AliQA::kHITS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kHITS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kHITS).Data(),
                           obj->GetName());
                }
              }
            }
            dir = saveDir->cd(AliQA::GetTaskName(AliQA::kSDIGITS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kSDIGITS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kSDIGITS).Data(),
                           obj->GetName());
                }
              }
            }

            dir = saveDir->cd(AliQA::GetTaskName(AliQA::kDIGITS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kDIGITS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kDIGITS).Data(),
                           obj->GetName());
                }
              }
            }
            break ;
          case AliQA::kREC:
            dir = saveDir->cd(AliQA::GetTaskName(AliQA::kRECPOINTS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kRECPOINTS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kRECPOINTS).Data(),
                           obj->GetName()) ;
                }
              }
            }
            break ;
            case AliQA::kESD:
            dir = saveDir->cd(AliQA::GetTaskName(AliQA::kESDS)) ;
            if ( ! dir ) {
              printf("%s Directory %s not found in %s\n", msgE, AliQA::GetTaskName(AliQA::kESDS).Data(), AliQA::GetQADataFileName(AliQA::GetDetName(det), run)) ;
            } else {
              TList * listofkeys = gDirectory->GetListOfKeys() ;
              for (Int_t key = 0 ; key < listofkeys->GetEntries() ; key++) {
                TNamed * obj = dynamic_cast<TNamed*>(listofkeys->At(key)) ;
                if (obj) {
                  Bool_t rv = obj->TestBit(AliQA::GetQABit()) ;
                  if (rv)
                    printf("%s QA bit set in %s/%s/%s\n",
                           msgS,
                           AliQA::GetDetName(det),
                           AliQA::GetTaskName(AliQA::kESDS).Data(),
                           obj->GetName());
                }
              }
            }
            break ;
            case AliQA::kANA:
            break ;
          default:
             break ;
        }
        dataQAFile->Close() ;
      }
    }
  }
  inputQAFile->Close() ;
}


text:
using SpecialtySelector.Data.SpecialtySelectorEnums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SpecialtySelector.Data
{
    public class Teacher
    {
        private ICollection<Subject> subjects;

        public Teacher()
        {
            this.subjects = new HashSet<Subject>();
        }

        public virtual ICollection<Subject> Subjects
        {
            get { return this.subjects; }
            set { this.subjects = value; }
        }

        public int Id { get; set; }

        public Degree Degree { get; set; }

        public AcademicTitle AcademicTitle { get; set; }

        [Required]
        public string FirstName { get; set; }

        public string SecondName { get; set; }

        [Required]
        public string LastName { get; set; }

        public string TeacherInfo { get; set; }

        public DateTime? FiredOn { get; set; }

        public string AdminId { get; set; }

        public virtual User Admin { get; set; }
    }
}


text:
@echo off

setlocal
title Install Additional Tools for Node.js

cls

echo ====================================================
echo Tools for Node.js Native Modules Installation Script
echo ====================================================
echo.
echo This script will install Python and the Visual Studio Build Tools, necessary
echo to compile Node.js native modules. Note that Chocolatey and required Windows
echo updates will also be installed.
echo.
echo This will require about 3 Gb of free disk space, plus any space necessary to
echo install Windows updates. This will take a while to run.
echo.
echo Please close all open programs for the duration of the installation. If the
echo installation fails, please ensure Windows is fully updated, reboot your
echo computer and try to run this again. This script can be found in the
echo Start menu under Node.js.
echo.
echo You can close this window to stop now. Detailed instructions to install these
echo tools manually are available at https://github.com/nodejs/node-gyp#on-windows
echo.
pause

cls

REM Adapted from https://github.com/Microsoft/windows-dev-box-setup-scripts/blob/79bbe5bdc4867088b3e074f9610932f8e4e192c2/README.md#legal
echo Using this script downloads third party software
echo ------------------------------------------------
echo This script will direct to Chocolatey to install packages. By using
echo Chocolatey to install a package, you are accepting the license for the
echo application, executable(s), or other artifacts delivered to your machine as a
echo result of a Chocolatey install. This acceptance occurs whether you know the
echo license terms or not. Read and understand the license terms of the packages
echo being installed and their dependencies prior to installation:
echo - https://chocolatey.org/packages/chocolatey
echo - https://chocolatey.org/packages/python
echo - https://chocolatey.org/packages/visualstudio2017-workload-vctools
echo.
echo This script is provided AS-IS without any warranties of any kind
echo ----------------------------------------------------------------
echo Chocolatey has implemented security safeguards in their process to help
echo protect the community from malicious or pirated software, but any use of this
echo script is at your own risk. Please read the Chocolatey's legal terms of use
echo as well as how the community repository for Chocolatey.org is maintained.
echo.
pause

cls

"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command iex ((New-Object System.Net.WebClient).DownloadString(''https://chocolatey.org/install.ps1'')); choco upgrade -y python visualstudio2017-workload-vctools; Read-Host ''Type ENTER to exit'' ' -Verb RunAs


text:
package org.ndexbio.model.object;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class RestResource //extends NdexObject
{
    private String _methodName;
    private List<String> _parameterTypes;
    private String _requestType;
    private String _route;
    private String _data;
    private String _returns;
    private String _apiDoc;
    private boolean _authentication;
    private boolean _isOpenFunction;

    /**************************************************************************
    * Default constructor.
    **************************************************************************/
    public RestResource()
    {
      //  super();
        this._parameterTypes = new ArrayList<>();
        this._authentication = true;
        this._isOpenFunction = false;
    }

	public String getMethodName() {
		return _methodName;
	}

	public void setMethodName(String methodName) {
		this._methodName = methodName;
	}

	public List<String> getParameterTypes() {
		return _parameterTypes;
	}

	public void addParameterType(String _parameterType) {
		this._parameterTypes.add(_parameterType);
	}

	public void setParameterTypes(List<String> parameterTypes) {
		this._parameterTypes = parameterTypes;
	}

	public String getRequestType() {
		return _requestType;
	}

	public void setRequestType(String requestType) {
		this._requestType = requestType;
	}

	public String getPath() {
		return _route;
	}

	public void setPath(String _path) {
		this._route = _path;
	}

	public String getConsumes() {
		return _data;
	}

	public void setConsumes(String _consumes) {
		this._data = _consumes;
	}

	public String getProduces() {
		return _returns;
	}

	public void setProduces(String _produces) {
		this._returns = _produces;
	}

	public String getApiDoc() {
		return _apiDoc;
	}

	public void setApiDoc(String apiDoc) {
		this._apiDoc = apiDoc;
	}

	public boolean getAuthentication() {
		return _authentication;
	}

	public void setAuthentication(boolean authentication) {
		this._authentication = authentication;
	}

	public boolean getIsOpenFunction() {
		return _isOpenFunction;
	}

	public void setIsOpenFunction(boolean _isOpenFunction) {
		this._isOpenFunction = _isOpenFunction;
	}

}


text:
Yet another post

[meta:author]: <> (Jonas Colmsjo)
[meta:title]: <> (Subversion-administration.md)
[meta:date]: <> (2012-01-01)
[meta:nested:key]: <> (Metadata value)

##!!truncate

[[Wiki]]

h1. Subversion administration

h2. Create new repository

ssh into s2.gizur.com

svnadmin create /var/www/svn/<NAME_OF_REPO>
chown -R apache.apache /var/www/svn/<NAME_OF_REPO>
ls /var/www/svn/<NAME_OF_REPO>

# Add a new group for the repository and assign priviledges for the new group
vi /etc/svn-access-control

Verify the new repository on another server or the locally

sudo svn co https://s2.gizur.com/svn/<NAME_OF_REPO>

h2. Add new user

The LDAP directory is used for authentication so the same username and passwords are used.

Access also needs to be setup in subversion:

vi /etc/svn-access-control