text:
module.exports = doJSON;

// Take the lexed input, and return a JSON-encoded object
// A module looks like this: https://gist.github.com/1777387

var marked = require('marked');

function doJSON(input, filename, cb) {
  var root = {source: filename};
  var stack = [root];
  var depth = 0;
  var current = root;
  var state = null;
  var lexed = marked.lexer(input);
  lexed.forEach(function (tok) {
    var type = tok.type;
    var text = tok.text;

    // <!-- type = module -->
    // This is for cases where the markdown semantic structure is lacking.
    if (type === 'paragraph' || type === 'html') {
      var metaExpr = /<!--([^=]+)=([^\-]+)-->\n*/g;
      text = text.replace(metaExpr, function(_0, k, v) {
        current[k.trim()] = v.trim();
        return '';
      });
      text = text.trim();
      if (!text) return;
    }

    if (type === 'heading' &&
        !text.trim().match(/^example/i)) {
      if (tok.depth - depth > 1) {
        return cb(new Error('Inappropriate heading level\n'+
                            JSON.stringify(tok)));
      }

      // Sometimes we have two headings with a single
      // blob of description.  Treat as a clone.
      if (current &&
          state === 'AFTERHEADING' &&
          depth === tok.depth) {
        var clone = current;
        current = newSection(tok);
        current.clone = clone;
        // don't keep it around on the stack.
        stack.pop();
      } else {
        // if the level is greater than the current depth,
        // then it's a child, so we should just leave the stack
        // as it is.
        // However, if it's a sibling or higher, then it implies
        // the closure of the other sections that came before.
        // root is always considered the level=0 section,
        // and the lowest heading is 1, so this should always
        // result in having a valid parent node.
        var d = tok.depth;
        while (d <= depth) {
          finishSection(stack.pop(), stack[stack.length - 1]);
          d++;
        }
        current = newSection(tok);
      }

      depth = tok.depth;
      stack.push(current);
      state = 'AFTERHEADING';
      return;
    } // heading

    // Immediately after a heading, we can expect the following
    //
    // { type: 'code', text: 'Stability: ...' },
    //
    // a list: starting with list_start, ending with list_end,
    // maybe containing other nested lists in each item.
    //
    // If one of these isnt' found, then anything that comes between
    // here and the next heading should be parsed as the desc.
    var stability
    if (state === 'AFTERHEADING') {
      if (type === 'code' &&
          (stability = text.match(/^Stability: ([0-5])(?:\s*-\s*)?(.*)$/))) {
        current.stability = parseInt(stability[1], 10);
        current.stabilityText = stability[2].trim();
        return;
      } else if (type === 'list_start' && !tok.ordered) {
        state = 'AFTERHEADING_LIST';
        current.list = current.list || [];
        current.list.push(tok);
        current.list.level = 1;
      } else {
        current.desc = current.desc || [];
        if (!Array.isArray(current.desc)) {
          current.shortDesc = current.desc;
          current.desc = [];
        }
        current.desc.push(tok);
        state = 'DESC';
      }
      return;
    }

    if (state === 'AFTERHEADING_LIST') {
      current.list.push(tok);
      if (type === 'list_start') {
        current.list.level++;
      } else if (type === 'list_end') {
        current.list.level--;
      }
      if (current.list.level === 0) {
        state = 'AFTERHEADING';
        processList(current);
      }
      return;
    }

    current.desc = current.desc || [];
    current.desc.push(tok);

  });

  // finish any sections left open
  while (root !== (current = stack.pop())) {
    finishSection(current, stack[stack.length - 1]);
  }

  return cb(null, root)
}

// go from something like this:
// [ { type: 'list_item_start' },
//   { type: 'text',
//     text: '`settings` Object, Optional' },
//   { type: 'list_start', ordered: false },
//   { type: 'list_item_start' },
//   { type: 'text',
//     text: 'exec: String, file path to worker file.  Default: `__filename`' },
//   { type: 'list_item_end' },
//   { type: 'list_item_start' },
//   { type: 'text',
//     text: 'args: Array, string arguments passed to worker.' },
//   { type: 'text',
//     text: 'Default: `process.argv.slice(2)`' },
//   { type: 'list_item_end' },
//   { type: 'list_item_start' },
//   { type: 'text',
//     text: 'silent: Boolean, whether or not to send output to parent\'s stdio.' },
//   { type: 'text', text: 'Default: `false`' },
//   { type: 'space' },
//   { type: 'list_item_end' },
//   { type: 'list_end' },
//   { type: 'list_item_end' },
//   { type: 'list_end' } ]
// to something like:
// [ { name: 'settings',
//     type: 'object',
//     optional: true,
//     settings:
//      [ { name: 'exec',
//          type: 'string',
//          desc: 'file path to worker file',
//          default: '__filename' },
//        { name: 'args',
//          type: 'array',
//          default: 'process.argv.slice(2)',
//          desc: 'string arguments passed to worker.' },
//        { name: 'silent',
//          type: 'boolean',
//          desc: 'whether or not to send output to parent\'s stdio.',
//          default: 'false' } ] } ]

function processList(section) {
  var list = section.list;
  var values = [];
  var current;
  var stack = [];

  // for now, *just* build the heirarchical list
  list.forEach(function(tok) {
    var type = tok.type;
    if (type === 'space') return;
    if (type === 'list_item_start') {
      if (!current) {
        var n = {};
        values.push(n);
        current = n;
      } else {
        current.options = current.options || [];
        stack.push(current);
        var n = {};
        current.options.push(n);
        current = n;
      }
      return;
    } else if (type === 'list_item_end') {
      if (!current) {
        throw new Error('invalid list - end without current item\n' +
                        JSON.stringify(tok) + '\n' +
                        JSON.stringify(list));
      }
      current = stack.pop();
    } else if (type === 'text') {
      if (!current) {
        throw new Error('invalid list - text without current item\n' +
                        JSON.stringify(tok) + '\n' +
                        JSON.stringify(list));
      }
      current.textRaw = current.textRaw || '';
      current.textRaw += tok.text + ' ';
    }
  });

  // shove the name in there for properties, since they are always
  // just going to be the value etc.
  if (section.type === 'property' && values[0]) {
    values[0].textRaw = '`' + section.name + '` ' + values[0].textRaw;
  }

  // now pull the actual values out of the text bits.
  values.forEach(parseListItem);

  // Now figure out what this list actually means.
  // depending on the section type, the list could be different things.

  switch (section.type) {
    case 'ctor':
    case 'classMethod':
    case 'method':
      // each item is an argument, unless the name is 'return',
      // in which case it's the return value.
      section.signatures = section.signatures || [];
      var sig = {}
      section.signatures.push(sig);
      sig.params = values.filter(function(v) {
        if (v.name === 'return') {
          sig.return = v;
          return false;
        }
        return true;
      });
      parseSignature(section.textRaw, sig);
      break;

    case 'property':
      // there should be only one item, which is the value.
      // copy the data up to the section.
      var value = values[0] || {};
      delete value.name;
      section.typeof = value.type;
      delete value.type;
      Object.keys(value).forEach(function(k) {
        section[k] = value[k];
      });
      break;

    case 'event':
      // event: each item is an argument.
      section.params = values;
      break;
  }

  // section.listParsed = values;
  delete section.list;
}

// textRaw = "someobject.someMethod(a[, b=100][, c])"
function parseSignature(text, sig) {
  var params = text.match(paramExpr);
  if (!params) return;
  params = params[1];
  // the [ is irrelevant. ] indicates optionalness.
  params = params.replace(/\[/g, '');
  params = params.split(/,/)
  params.forEach(function(p, i, _) {
    p = p.trim();
    if (!p) return;
    var param = sig.params[i];
    var optional = false;
    var def;
    // [foo] -> optional
    if (p.charAt(p.length - 1) === ']') {
      optional = true;
      p = p.substr(0, p.length - 1);
      p = p.trim();
    }
    var eq = p.indexOf('=');
    if (eq !== -1) {
      def = p.substr(eq + 1);
      p = p.substr(0, eq);
    }
    if (!param) {
      param = sig.params[i] = { name: p };
    }
    // at this point, the name should match.
    if (p !== param.name) {
      console.error('Warning: invalid param "%s"', p);
      console.error(' > ' + JSON.stringify(param));
      console.error(' > ' + text);
    }
    if (optional) param.optional = true;
    if (def !== undefined) param.default = def;
  });
}

function parseListItem(item) {
  if (item.options) item.options.forEach(parseListItem);
  if (!item.textRaw) return;

  // the goal here is to find the name, type, default, and optional.
  // anything left over is 'desc'
  var text = item.textRaw.trim();
  // text = text.replace(/^(Argument|Param)s?\s*:?\s*/i, '');

  text = text.replace(/^, /, '').trim();
  var retExpr = /^returns?\s*:?\s*/i;
  var ret = text.match(retExpr);
  if (ret) {
    item.name = 'return';
    text = text.replace(retExpr, '');
  } else {
    var nameExpr = /^['`"]?([^'`": \{]+)['`"]?\s*:?\s*/;
    var name = text.match(nameExpr);
    if (name) {
      item.name = name[1];
      text = text.replace(nameExpr, '');
    }
  }

  text = text.trim();
  var defaultExpr = /\(default\s*[:=]?\s*['"`]?([^, '"`]*)['"`]?\)/i;
  var def = text.match(defaultExpr);
  if (def) {
    item.default = def[1];
    text = text.replace(defaultExpr, '');
  }

  text = text.trim();
  var typeExpr = /^\{([^\}]+)\}/;
  var type = text.match(typeExpr);
  if (type) {
    item.type = type[1];
    text = text.replace(typeExpr, '');
  }

  text = text.trim();
  var optExpr = /^Optional\.|(?:, )?Optional$/;
  var optional = text.match(optExpr);
  if (optional) {
    item.optional = true;
    text = text.replace(optExpr, '');
  }

  text = text.replace(/^\s*-\s*/, '');
  text = text.trim();
  if (text) item.desc = text;
}

function finishSection(section, parent) {
  if (!section || !parent) {
    throw new Error('Invalid finishSection call\n'+
                    JSON.stringify(section) + '\n' +
                    JSON.stringify(parent));
  }

  if (!section.type) {
    section.type = 'module';
    if (parent && (parent.type === 'misc')) {
      section.type = 'misc';
    }
    section.displayName = section.name;
    section.name = section.name.toLowerCase()
      .trim().replace(/\s+/g, '_');
  }

  if (section.desc && Array.isArray(section.desc)) {
    section.desc.links = section.desc.links || [];
    section.desc = marked.parser(section.desc);
  }

  if (!section.list) section.list = [];
  processList(section);

  // classes sometimes have various 'ctor' children
  // which are actually just descriptions of a constructor
  // class signature.
  // Merge them into the parent.
  if (section.type === 'class' && section.ctors) {
    section.signatures = section.signatures || [];
    var sigs = section.signatures;
    section.ctors.forEach(function(ctor) {
      ctor.signatures = ctor.signatures || [{}];
      ctor.signatures.forEach(function(sig) {
        sig.desc = ctor.desc;
      });
      sigs.push.apply(sigs, ctor.signatures);
    });
    delete section.ctors;
  }

  // properties are a bit special.
  // their "type" is the type of object, not "property"
  if (section.properties) {
    section.properties.forEach(function (p) {
      if (p.typeof) p.type = p.typeof;
      else delete p.type;
      delete p.typeof;
    });
  }

  // handle clones
  if (section.clone) {
    var clone = section.clone;
    delete section.clone;
    delete clone.clone;
    deepCopy(section, clone);
    finishSection(clone, parent);
  }

  var plur;
  if (section.type.slice(-1) === 's') {
    plur = section.type + 'es';
  } else if (section.type.slice(-1) === 'y') {
    plur = section.type.replace(/y$/, 'ies');
  } else {
    plur = section.type + 's';
  }

  // if the parent's type is 'misc', then it's just a random
  // collection of stuff, like the "globals" section.
  // Make the children top-level items.
  if (section.type === 'misc') {
    Object.keys(section).forEach(function(k) {
      switch (k) {
        case 'textRaw':
        case 'name':
        case 'type':
        case 'desc':
        case 'miscs':
          return;
        default:
          if (parent.type === 'misc') {
            return;
          }
          if (Array.isArray(k) && parent[k]) {
            parent[k] = parent[k].concat(section[k]);
          } else if (!parent[k]) {
            parent[k] = section[k];
          } else {
            // parent already has, and it's not an array.
            return;
          }
      }
    });
  }

  parent[plur] = parent[plur] || [];
  parent[plur].push(section);
}

// Not a general purpose deep copy.
// But sufficient for these basic things.
function deepCopy(src, dest) {
  Object.keys(src).filter(function(k) {
    return !dest.hasOwnProperty(k);
  }).forEach(function(k) {
    dest[k] = deepCopy_(src[k]);
  });
}

function deepCopy_(src) {
  if (!src) return src;
  if (Array.isArray(src)) {
    var c = new Array(src.length);
    src.forEach(function(v, i) {
      c[i] = deepCopy_(v);
    });
    return c;
  }
  if (typeof src === 'object') {
    var c = {};
    Object.keys(src).forEach(function(k) {
      c[k] = deepCopy_(src[k]);
    });
    return c;
  }
  return src;
}

// these parse out the contents of an H# tag
var eventExpr = /^Event(?::|\s)+['"]?([^"']+).*$/i;
var classExpr = /^Class:\s*([^ ]+).*?$/i;
var propExpr = /^(?:property:?\s*)?[^\.]+\.([^ \.\(\)]+)\s*?$/i;
var braceExpr = /^(?:property:?\s*)?[^\.\[]+(\[[^\]]+\])\s*?$/i;
var classMethExpr =
  /^class\s*method\s*:?[^\.]+\.([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
var methExpr =
  /^(?:method:?\s*)?(?:[^\.]+\.)?([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
var newExpr = /^new ([A-Z][a-z]+)\([^\)]*\)\s*?$/;
var paramExpr = /\((.*)\);?$/;

function newSection(tok) {
  var section = {};
  // infer the type from the text.
  var text = section.textRaw = tok.text;
  if (text.match(eventExpr)) {
    section.type = 'event';
    section.name = text.replace(eventExpr, '$1');
  } else if (text.match(classExpr)) {
    section.type = 'class';
    section.name = text.replace(classExpr, '$1');
  } else if (text.match(braceExpr)) {
    section.type = 'property';
    section.name = text.replace(braceExpr, '$1');
  } else if (text.match(propExpr)) {
    section.type = 'property';
    section.name = text.replace(propExpr, '$1');
  } else if (text.match(classMethExpr)) {
    section.type = 'classMethod';
    section.name = text.replace(classMethExpr, '$1');
  } else if (text.match(methExpr)) {
    section.type = 'method';
    section.name = text.replace(methExpr, '$1');
  } else if (text.match(newExpr)) {
    section.type = 'ctor';
    section.name = text.replace(newExpr, '$1');
  } else {
    section.name = text;
  }
  return section;
}


text: install -m 644 files/blacklist-rpi3-wifi.conf ${ROOTFS_DIR}/etc/modprobe.d/blacklist-rpi3-wifi.conf

redpajama_set_name: RedPajamaGithub


text:
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
using OrchardCore.Tenants.Workflows.Activities;
using OrchardCore.Tenants.Workflows.Drivers;
using OrchardCore.Workflows.Helpers;

namespace OrchardCore.Tenants.Workflows
{
    [RequireFeatures("OrchardCore.Workflows")]
    public class Startup : StartupBase
    {
        public override void ConfigureServices(IServiceCollection services)
        {
            services.AddActivity<DisableTenantTask, DisableTenantTaskDisplay>();
            services.AddActivity<EnableTenantTask, EnableTenantTaskDisplay>();
            services.AddActivity<CreateTenantTask, CreateTenantTaskDisplay>();
            services.AddActivity<SetupTenantTask, SetupTenantTaskDisplay>();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.curso</groupId>
    <artifactId>ClasesSimples0001Java8</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>
    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showDeprecation>true</showDeprecation>
                    <compilerArgs>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.190</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbyclient</artifactId>
            <version>10.11.1.1</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.entitymanager.version}</version>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.6</version>
            <type>jar</type>
        </dependency>
    </dependencies>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>4.12</junit.version>
        <hibernate.entitymanager.version>4.3.9.Final</hibernate.entitymanager.version>
    </properties>
</project>


text:
typedef struct
{
	int over, down, once, uponce, doubleclick, orig, out_of_screen, too_small;
} ctrl_button_state_t;

typedef struct
{
	double vert_delta;
	int down, downonce, uponce, doubleclick, rightclick;
} ctrl_knob_state_t;

typedef struct
{
	xy_t pos, dim, offset, freedom, click_offset;
	int down, over, uponce;
} ctrl_drag_state_t;

typedef struct
{
	int open, next_open, sel_id, hover_id, count;
} ctrl_selectmenu_state_t;

typedef struct
{
	int type;	// 0 for obstructing rect, 1 for nearest-centre circle
	int id;		// identifies different controls with the same box
	rect_t box;	// rect coordinates that define the control
	xy_t pos;	// position of the type 1 circle
	double radius;	// radius of the type 1 circle
} ctrl_id_t;

typedef struct
{
	int init, dragged, prev_dragged;
	ctrl_drag_state_t drag[9];
} ctrl_resize_rect_t;


text:
#include "./instance_norm-inl.h"

namespace mxnet {
namespace op {
template <>
Operator* CreateOp<cpu>(InstanceNormParam param, int dtype) {
  return new InstanceNormOp<cpu>(param);
}

// DO_BIND_DISPATCH comes from operator_common.h
Operator* InstanceNormProp::CreateOperatorEx(Context ctx,
                                             std::vector<TShape>* in_shape,
                                             std::vector<int>* in_type) const {
  DO_BIND_DISPATCH(CreateOp, param_, (*in_type)[0]);
}

DMLC_REGISTER_PARAMETER(InstanceNormParam);

MXNET_REGISTER_OP_PROPERTY(InstanceNorm, InstanceNormProp)
.add_argument("data", "NDArray-or-Symbol",
              "An n-dimensional input array (n > 2) of the form [batch, "
              "channel, spatial_dim1, spatial_dim2, ...].")
.add_argument("gamma", "NDArray-or-Symbol",
              "A vector of length \'channel\', which multiplies the "
              "normalized input.")
.add_argument("beta", "NDArray-or-Symbol",
              "A vector of length \'channel\', which is added to the "
              "product of the normalized input and the weight.")
.add_arguments(InstanceNormParam::__FIELDS__())
.describe(R"code(Applies instance normalization to the n-dimensional input array.

This operator takes an n-dimensional input array where (n>2) and normalizes
the input using the following formula:

.. math::

  out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta

This layer is similar to batch normalization layer (`BatchNorm`)
with two differences: first, the normalization is
carried out per example (instance), not over a batch. Second, the
same normalization is applied both at test and train time. This
operation is also known as `contrast normalization`.

If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
`gamma` and `beta` parameters must be vectors of shape [channel].

This implementation is based on paper:

.. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
   D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).

Examples::

  // Input of shape (2,1,2)
  x = [[[ 1.1,  2.2]],
       [[ 3.3,  4.4]]]

  // gamma parameter of length 1
  gamma = [1.5]

  // beta parameter of length 1
  beta = [0.5]

  // Instance normalization is calculated with the above formula
  InstanceNorm(x,gamma,beta) = [[[-0.997527  ,  1.99752665]],
                                [[-0.99752653,  1.99752724]]]

)code" ADD_FILELINE);
}  // namespace op
}  // namespace mxnet


text:
'use strict';

let spreadMenuButtonBehaviors = Symbol('behaviors');

class SpreadMenuButton {
  get behaviors() {
    return this[spreadMenuButtonBehaviors] || (this[spreadMenuButtonBehaviors] = [
      Polymer.NeonAnimationRunnerBehavior
    ]);
  }

  set behaviors(value) {
    this[spreadMenuButtonBehaviors] = value;
  }

  get listeners() {
    return {
      'neon-animation-finish': '_onNeonAnimationFinish',
      'iron-select': '_onIronSelect'
    };
  }

  beforeRegister() {
    this.is = 'spread-menu-button';

    this.properties = {
      opened: {
        type: Boolean,
        notify: true,
        observer: '_openedChanged'
      },

      animationConfig: {
        value: function() {
          return {
            'entry': [
              {
                name: 'fade-in-animation',
                node: this
              }, {
                name: 'scale-up-animation',
                node: this,
                transformOrigin: '200% 200%',
                timing: {duration: 300, delay: 400, easing: app.ANIMATION_EASE_OUT_BACK}
              }
            ],

            'exit': [
              {
                name: 'fade-out-animation',
                node: this
              }, {
                name: 'scale-down-animation',
                node: this,
                transformOrigin: '200% 200%',
                timing: {duration: 200, easing: app.ANIMATION_EASE_IN_BACK}
              }
            ],

            'open': [
              {
                name: 'fade-in-animation',
                node: this.offElement
              }, {
                name: 'rotate-clockwise-animation',
                node: this.offElement
              }, {
                name: 'fade-out-animation',
                node: this.onElement
              }, {
                name: 'rotate-clockwise-animation',
                node: this.onElement
              }
            ],

            'close': [
              {
                name: 'fade-out-animation',
                node: this.offElement
              }, {
                name: 'rotate-anticlockwise-animation',
                node: this.offElement
              }, {
                name: 'fade-in-animation',
                node: this.onElement
              }, {
                name: 'rotate-anticlockwise-animation',
                node: this.onElement
              }
            ]
          };
        }
      },

      openAnimationConfig: {
        value: function() {
          return [
            {
              name: 'cascaded-animation',
              animation: 'fade-in-animation',
              nodes: this.itemsReversed,
              nodeDelay: 100,
              timing: {delay: 100, duration: 400}
            }, {
              name: 'cascaded-animation',
              animation: 'scale-up-animation',
              nodes: this.itemsReversed,
              nodeDelay: 100
            }
          ];
        }
      },

      closeAnimationConfig: {
        value: function() {
          return [
            {
              name: 'cascaded-animation',
              animation: 'fade-out-animation',
              nodes: this.items,
              nodeDelay: 100,
              timing: {duration: 300}
            }, {
              name: 'cascaded-animation',
              animation: 'scale-down-animation',
              nodes: this.items,
              nodeDelay: 100
            }
          ];
        }
      }
    };
  }

  get onElement() {
    return this.queryEffectiveChildren('.dropdown-trigger-on');
  }

  get offElement() {
    return this.queryEffectiveChildren('.dropdown-trigger-off');
  }

  get items() {
    let content = this.queryEffectiveChildren('.dropdown-content');
    // iron-selector
    let child = content.children[0];
    // fabs
    let children = child.children;

    return children;
  }

  get itemsReversed() {
    let items = [];
    let length = this.items.length;

    for (let i = 1; i <= length; i++) {
      items.push(this.items[length - i]);
    }

    return items;
  }

  _onNeonAnimationFinish(e, animation) {
    switch (animation) {
      case 'open':
        this.onElement.style.display = 'none';
        break;
      case 'close':
        this.offElement.style.display = 'none';
        break;
    }
  }

  _openedChanged(opened) {
    if (opened) {
      this.fire('paper-dropdown-open');

      this.cancelAnimation();
      this.offElement.style.display = '';
      this.playAnimation('open', 'open');
    } else {
      this.fire('paper-dropdown-close');

      this.cancelAnimation();
      this.onElement.style.display = '';
      this.playAnimation('close', 'close');
    }
  }

  open() {
    this.$.dropdown.open();
  }

  close() {
    this.$.dropdown.close();
  }

  _onTriggerOnTap() {
    this.open();
  }

  _onTriggerOffTap() {
    this.close();
  }

  _onIronSelect() {
    this.close();
  }
}

Polymer(SpreadMenuButton);


text:
<?php
/* ==================================================
 * Wrap interface to the excel spreasheet processing
 */
namespace Cerad\Bundle\ScheduleBundle\Format\PHPExcel;

class Excel
{
    public function __construct()
    {
        \PHPExcel_Cell::setValueBinder( new ExcelValueBinder() );
    }
    public function newSpreadSheet()
    {
        return new \PHPExcel();
    }
    public function newWriter($ss)
    {
        return \PHPExcel_IOFactory::createWriter($ss, 'Excel5');
    }
    public function loadx($file)
    {
        return \PHPExcel_IOFactory::load($file);
    }
    public function getCoordForColRow($pColumn = 0, $pRow = 1)
    {
        return \PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow;
    }
    public function setCellHorizontalAllignment($ws, $cell, $alignment = '(center|left|right)')
    {
        switch(strtolower($alignment)) {
            case "center":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
                break;
            case "left":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
                break;
            case "right":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
                break;
            default:
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
                break;
        }
        $ws->getStyle($cell)->getAlignment()->setHorizontal($align);
    }
    public function setColumnHorizontalAllignment($ws, $col, $rows, $alignment = '(center|left|right)')
    {
        switch(strtolower($alignment)) {
            case "center":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
                break;
            case "left":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
                break;
            case "right":
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
                break;
            default:
                $align = \PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
                break;
        }
        $top = $this->getCoordForColRow($col,1);
        $bot = $this->getCoordForColRow($col,$rows);
        $range = $top . ':' . $bot;
        $ws->getStyle($range)->getAlignment()->setHorizontal($align);
    }
    /* =====================================================================
     * 1. Check for Excel2003 file (aka Excel5
     * 2. If ZipArchive exists then check for Excel2007
     * 3. Then csv file
     *
     * Other formats are currently ignored
     * TODO: Add in XML support?  Maybe a generic reader of some sort
     */
    protected function createReaderForFile($fileName,$readDataOnly = true)
    {
        // Most common case
        $reader = new \PHPExcel_Reader_Excel5();

        $reader->setReadDataOnly($readDataOnly);

        if ($reader->canRead($fileName)) return $reader;

        // Make sure have zip archive
        if (class_exists('ZipArchive'))
        {
            $reader = new \PHPExcel_Reader_Excel2007();

            $reader->setReadDataOnly($readDataOnly);

            if ($reader->canRead($fileName)) return $reader;

        }

        // Note that csv does not actually check for a csv file
        $reader = new \PHPExcel_Reader_CSV();

        if ($reader->canRead($fileName)) return $reader;

        throw new Exception("No Reader found for $fileName");

    }
    public function load($fileName, $readDataOnly = true)
    {
        $reader = $this->createReaderForFile($fileName,$readDataOnly);

        return $reader->load($fileName);
    }
}

?>


text:
#if !defined(EF_GY_RENDER_XML_H)
#define EF_GY_RENDER_XML_H

#include <ef.gy/colour-space-hsl.h>
#include <ef.gy/continued-fractions.h>
#include <ef.gy/render.h>
#include <ef.gy/stream-xml.h>
#include <ef.gy/vector.h>

#include <sstream>

namespace efgy {
namespace render {
/**\brief Write HSL colour to XML stream
 *
 * Writes an XML serialisation of an HSL vector to a stream.
 *
 * \tparam C Character type for the basic_ostream reference.
 *
 * \param[out] stream The XML stream to write to.
 * \param[in]  pValue The HSL colour value to serialise.
 *
 * \returns A new copy of the input stream.
 */
template <typename C>
static inline xml::ostream<C> operator<<(
    xml::ostream<C> stream,
    const math::vector<math::fraction, 3, math::format::HSL> &pValue) {
  math::vector<math::fraction, 3, math::format::HSL> value = pValue;
  value.hue = math::numeric::round(value.hue, stream.precision);
  value.saturation = math::numeric::round(value.saturation, stream.precision);
  value.lightness = math::numeric::round(value.lightness, stream.precision);

  stream.stream << std::string(
                       "<colour xmlns='http://colouri.se/2012' space='hsl'")
                << " hue='" << value.hue.numerator << "'"
                << " saturation='" << value.saturation.numerator << "'"
                << " lightness='" << value.lightness.numerator << "'";

  if (value.hue.denominator != math::numeric::one()) {
    stream.stream << " hueDenominator='" << value.hue.denominator << "'";
  }
  if (value.saturation.denominator != math::numeric::one()) {
    stream.stream << " saturationDenominator='" << value.saturation.denominator
                  << "'";
  }
  if (value.lightness.denominator != math::numeric::one()) {
    stream.stream << " lightnessDenominator='" << value.lightness.denominator
                  << "'";
  }

  stream.stream << "/>";

  return stream;
}

/**\brief Write RGB colour to XML stream
 *
 * Writes an XML serialisation of an RGB vector to a stream.
 *
 * \tparam C Character type for the basic_ostream reference.
 *
 * \param[out] stream The XML stream to write to.
 * \param[in]  pValue The RGB colour value to serialise.
 *
 * \returns A new copy of the input stream.
 */
template <typename C>
static inline xml::ostream<C> operator<<(
    xml::ostream<C> stream,
    const math::vector<math::fraction, 3, math::format::RGB> &pValue) {
  math::vector<math::fraction, 3, math::format::RGB> value = pValue;
  value.red = math::numeric::round(value.red, stream.precision);
  value.green = math::numeric::round(value.green, stream.precision);
  value.blue = math::numeric::round(value.blue, stream.precision);

  stream.stream << std::string(
                       "<colour xmlns='http://colouri.se/2012' space='rgb'")
                << " red='" << value.red.numerator << "'"
                << " green='" << value.green.numerator << "'"
                << " blue='" << value.blue.numerator << "'";

  if (value.red.denominator != math::numeric::one()) {
    stream.stream << " redDenominator='" << value.red.denominator << "'";
  }
  if (value.green.denominator != math::numeric::one()) {
    stream.stream << " greenDenominator='" << value.green.denominator << "'";
  }
  if (value.blue.denominator != math::numeric::one()) {
    stream.stream << " blueDenominator='" << value.blue.denominator << "'";
  }

  stream.stream << "/>";

  return stream;
}

/**\brief Write colour picker to XML stream
 *
 * Writes an XML colour picker to a stream.
 *
 * \tparam C Character type for the basic_ostream reference.
 *
 * \param[out] stream The XML stream to write to.
 * \param[in]  value The reference colour value to at the centre.
 *
 * \returns A new copy of the input stream.
 */
template <typename C, class Q, typename format>
static inline xml::ostream<C> operator|=(
    xml::ostream<C> stream, const math::vector<Q, 3, format> &value) {
  stream.stream << "<picker xmlns='http://colouri.se/2012'>";
  math::vector<Q, 3, format> v = value;
  if (v[0].denominator == math::numeric::zero()) {
    v[0] = Q(0);
  }
  if (v[1].denominator == math::numeric::zero()) {
    v[1] = Q(0);
  }
  if (v[2].denominator == math::numeric::zero()) {
    v[2] = Q(0);
  }
  Q al = v[0] / Q(stream.resolution);
  Q ar = (Q(1) - v[0]) / Q(stream.resolution);
  Q bl = v[1] / Q(stream.resolution);
  Q br = (Q(1) - v[1]) / Q(stream.resolution);
  Q cl = v[2] / Q(stream.resolution);
  Q cr = (Q(1) - v[2]) / Q(stream.resolution);

  v[1] = Q(0);
  for (long y = -stream.resolution; y <= stream.resolution; y++) {
    stream.stream << "<set>";
    v[1] = (y < 0) ? (value[1] - bl * Q(-y)) : (value[1] + br * Q(y));
    for (long x = -stream.resolution; x <= stream.resolution; x++) {
      v[0] = (x < 0) ? (value[0] - al * Q(-x)) : (value[0] + ar * Q(x));
      stream << v;
    }
    stream.stream << "</set>";
  }

  stream.stream << "<set>";
  v[0] = value[0];
  v[1] = value[1];
  for (long z = -stream.resolution; z <= stream.resolution; z++) {
    v[2] = (z < 0) ? (value[2] - cl * Q(-z)) : (value[2] + cr * Q(z));
    stream << v;
  }
  stream.stream << "</set></picker>";

  return stream;
}
};  // namespace render
};  // namespace efgy

#endif


text:
*For Three.js r75, tested with Blender 2.75*

## Preliminaries: install the Three.js exporter add-on

* Get the Three.js exporter for blender, located in the repository at: utils/exporters/blender/addons/io_three
* Zip the whole directory: zip -r io_three.zip io_three
* Open Blender, go to File > User Preferences, click the Add-ons tab, then "install from file", browse and select the io_three.zip

## Blender part

* Create a basic mesh, select all faces
* Go to the texture panel (right panel), click the texture for material, choose the "image or movie" type, open your texture
* The model must have UV-mapping, if it doesn't, then:
	* Below, set the coordinates' type to UV, flat projection
	* In the top panel, choose the "UV editing" view
	* At the bottom of the left part, choose the appropriate texture image
	* All faces should be selected (Edit mode), move the cursor in the right part of the view and press the 'U' key to open the UV menu
	* Choose "Unwrap" in the menu
	* If you get the "Non-Uniform Scaling during UV unwrap" warning, you need to apply the scale:
		* Switch to Object mode
		* Press Ctrl-A to open the "apply" menu, and choose "scale"
		* Retry the "Unwrap" operation
	* Now the UV coordinates should be OK
	* Return back to the main "Default" view (top panel)
* If you have trouble with normals, i.e. smooth edge where sharp one are expected, that's because faces are sharing the same
  vertices normals, to fix it:
	* in the left panel open the "modifier" tab
	* click "add modifier" and choose "edge split"
	* adjust the angle
	* apply it: now your vertices normals should be OK
* Export the file: File > Export > Three.js (.json)

## Three.js part

Your materials and textures would be lost, but your texture UV-mapping is OK.

```
// Load the Geometry
var loader = new THREE.JSONLoader() ;
var parsed = loader.parse( require( 'path/to/blender/model.json' ) ) ;
var modelGeometry = parsed.geometry ;

// Manually load your texture
var modelTexture = new THREE.TextureLoader().load( 'path/to/my/texture.jpg' ) ;

// Really important: by default the texture is set to THREE.ClampToEdgeWrapping, which fucked up your UV-mapping
modelTexture.wrapS = THREE.RepeatWrapping ;
modelTexture.wrapT = THREE.RepeatWrapping ;

var modelMaterial = new THREE.MeshLambertMaterial( { map: modelTexture } ) ;

var model = new THREE.Mesh( modelGeometry , modelMaterial ) ;

scene.add( model ) ;
```

To debug normals:

```
var edges = new THREE.VertexNormalsHelper( model, 2, 0x00ff00, 1 ) ;
scene.add( edges ) ;
```

## Export material (without texture)

If you want to export more than just raw geometries, but raw material (without texture):

* In blender: export the file: File > Export > Three.js (.json), do not forget to check the option "face materials"
* The Three.js source code becomes:

```
var loader = new THREE.JSONLoader() ;
var parsed = loader.parse( require( 'path/to/blender/model.json' ) ) ;
var model = new THREE.Mesh( parsed.geometry , new THREE.MeshFaceMaterial( parsed.materials ) ) ;
scene.add( model ) ;
```

Notice the `new THREE.MeshFaceMaterial`.

## Export animation

* When exporting in Blender, check "bones", "skinning", "skeletal animation": "pose", "embed animation".

* Load the skinned mesh:

```
// Load the Geometry
var loader = new THREE.JSONLoader() ;
var parsed = loader.parse( require( 'path/to/blender/model.json' ) ) ;
var modelGeometry = parsed.geometry ;

// Enable skinning for each material, not sure why this does not work out of the box...
parsed.materials.forEach( mat => mat.skinning = true ) ;

// Use SkinnedMesh() instead of Mesh
var model = new THREE.SkinnedMesh( parsed.geometry , new THREE.MeshFaceMaterial( parsed.materials ) ) ;

// Create the animation mixer
var animationMixer = new THREE.AnimationMixer( model ) ;

// Get the first animation
var action = animationMixer.clipAction( parsed.geometry.animations[ 0 ] ) ;

action.setEffectiveWeight( 1 ) ;
action.play() ;

scene.add( model ) ;
```

* In your update function, do not forget to call `animationMixer.update()`:

```
function update()
{
	// ...

	var delta = clock.getDelta() ;
	if ( animationMixer ) { animationMixer.update( delta ); }

	// ...
}
```


text:
<?php
declare(strict_types = 1);

namespace Innmind\AMQP\Transport\Frame\Value;

use Innmind\AMQP\{
    Transport\Frame\Value,
    Exception\UnboundedTextCannotBeWrapped,
};
use Innmind\Math\Algebra\Integer;
use Innmind\Stream\Readable;
use Innmind\Immutable\{
    Str,
    Sequence as Seq,
    Map,
};
use function Innmind\Immutable\{
    assertMap,
    join,
};

/**
 * @implements Value<Map<string, Value>>
 */
final class Table implements Value
{
    /** @var Map<string, Value> */
    private Map $original;

    /**
     * @param Map<string, Value> $map
     */
    public function __construct(Map $map)
    {
        assertMap('string', Value::class, $map, 1);

        $texts = $map->filter(static function(string $key, Value $value): bool {
            return $value instanceof Text;
        });

        if (!$texts->empty()) {
            throw new UnboundedTextCannotBeWrapped;
        }

        $this->original = $map;
    }

    public static function unpack(Readable $stream): self
    {
        $length = UnsignedLongInteger::unpack($stream)->original();
        $position = $stream->position()->toInt();
        $boundary = $position + $length->value();

        /** @var Map<string, Value> */
        $map = Map::of('string', Value::class);

        while ($position < $boundary) {
            $key = ShortString::unpack($stream)->original();
            $class = Symbols::class($stream->read(1)->toString());
            /** @var Value */
            $value = [$class, 'unpack']($stream);

            $map = ($map)($key->toString(), $value);

            $position = $stream->position()->toInt();
        }

        return new self($map);
    }

    /**
     * @return Map<string, Value>
     */
    public function original(): Map
    {
        return $this->original;
    }

    public function pack(): string
    {
        /** @var Seq<string> */
        $data = $this->original->toSequenceOf(
            'string',
            static function(string $key, Value $value): \Generator {
                yield (new ShortString(Str::of($key)))->pack();
                yield Symbols::symbol(\get_class($value));
                yield $value->pack();
            },
        );
        $data = join('', $data)->toEncoding('ASCII');

        $value = UnsignedLongInteger::of(
            new Integer($data->length()),
        )->pack();

        return $value .= $data->toString();
    }
}


text:
.class final Lo/Cf$aux;
.super Lo/Cf$if;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lo/Cf;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x10
    name = "aux"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lo/Cf<TK;TV;>.if<TK;>;"
    }
.end annotation

# instance fields
.field final synthetic ˎ:Lo/Cf;

# direct methods
.method constructor <init>(Lo/Cf;Ljava/util/concurrent/ConcurrentMap;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(Ljava/util/concurrent/ConcurrentMap<**>;)V"
        }
    .end annotation

    .line 4462
    iput-object p1, p0, Lo/Cf$aux;->ˎ:Lo/Cf;

    .line 4463
    invoke-direct {p0, p1, p2}, Lo/Cf$if;-><init>(Lo/Cf;Ljava/util/concurrent/ConcurrentMap;)V

    .line 4464
    return-void
.end method

# virtual methods
.method public contains(Ljava/lang/Object;)Z
    .locals 1

    .line 4473
    iget-object v0, p0, Lo/Cf$aux;->ˊ:Ljava/util/concurrent/ConcurrentMap;

    invoke-interface {v0, p1}, Ljava/util/concurrent/ConcurrentMap;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public iterator()Ljava/util/Iterator;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()Ljava/util/Iterator<TK;>;"
        }
    .end annotation

    .line 4468
    new-instance v0, Lo/Cf$ˏ;

    iget-object v1, p0, Lo/Cf$aux;->ˎ:Lo/Cf;

    invoke-direct {v0, v1}, Lo/Cf$ˏ;-><init>(Lo/Cf;)V

    return-object v0
.end method

.method public remove(Ljava/lang/Object;)Z
    .locals 1

    .line 4478
    iget-object v0, p0, Lo/Cf$aux;->ˊ:Ljava/util/concurrent/ConcurrentMap;

    invoke-interface {v0, p1}, Ljava/util/concurrent/ConcurrentMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method


text:
package org.wfe.engine.task.impl;

import java.io.Serializable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.wfe.core.model.workflow.IWorkflowDefinition;
import org.wfe.engine.exception.TaskExecutionException;
import org.wfe.engine.model.IExecutionRequest;
import org.wfe.engine.task.IExecutableTask;

/**
 * A Fail Task For testing purposes. Provided in main/java.
 *
 */
public class FailExecutableTask implements IExecutableTask<Serializable> {

	/**
	 * Log.
	 */
	private final static Logger log = LoggerFactory
			.getLogger(FailExecutableTask.class);

	public void executeTask(IWorkflowDefinition wfdef,
			IExecutionRequest<Serializable> request)
			throws TaskExecutionException {

		log.error("FAIL transition executable task throwing an Exception.");
		throw new TaskExecutionException("Error FAIL transition task execution");

	}

	public String getDescription() {
		return this.getClass().toString();
	}

}


text:
using System;
using System.Collections.Generic;
using Entitas;
using Entitas.Unity;
using UnityEngine;

public class VisualDebuggingExampleController : MonoBehaviour {

    void Start() {
        var context = Contexts.sharedInstance.game;

        createTestGroups(context);

        createTestEntities(context);
        createTestEntityWithNullValues(context);

        createTestEntityError(context);
    }

    void createTestGroups(GameContext context) {
        context.GetGroup(GameMatcher.Vector3);
        context.GetGroup(GameMatcher.GameObject);
        context.GetGroup(Matcher<GameEntity>.AllOf(GameMatcher.GameObject, GameMatcher.Vector3));
        context.GetGroup(Matcher<GameEntity>.AllOf(GameMatcher.GameObject, GameMatcher.Vector3));
    }

    void createTestEntities(GameContext context) {
        for (int i = 0; i < 2; i++) {
            var e = context.CreateEntity();

            // Unity's builtIn
            e.AddBounds(new Bounds());
            e.AddColor(Color.red);
            e.AddAnimationCurve(AnimationCurve.EaseInOut(0f, 0f, 1f, 1f));
            e.AddMyEnum(MyEnumComponent.MyEnum.Item2);
            e.AddMyFlags(MyFlagsComponent.MyFlags.Item2);
            e.AddMyDouble(4.2f);
            e.AddMyFloat(4.2f);
            e.AddMyInt(42);
            e.AddMyHiddenInt(42);
            e.AddRect(new Rect(1f, 2f, 3f, 4f));
            e.AddMyString("Hello, world!");
            e.AddVector2(new Vector2(1f, 2f));
            e.AddVector3(new Vector3(1f, 2f, 3f));
            e.AddVector4(new Vector4(1f, 2f, 3f, 4f));
            e.AddMyBool(true);
            e.AddUnityObject(new UnityEngine.Object());
            var go = new GameObject("Player");
            go.Link(e);
            e.AddGameObject(go);
            e.AddTexture(new CustomRenderTexture(32, 32));
            e.AddTexture2D(new Texture2D(2, 2));

            // Custom
            e.isFlag = true;
            e.myCustomFlag = true;
            e.AddMonoBehaviourSubClass(new GameObject().AddComponent<MonoBehaviourSubClass>());
            e.AddCustomObject(new CustomObject("Custom Object"));
            e.AddSystemObject(new object());
            e.AddDateTime(DateTime.Now);
            e.AddAnArray(new [] { "Hello", ", ", "world", "!" });
            e.AddArray2D(new string[2, 3]);
            e.AddArray3D(new string[2, 3, 4]);
            string[][] jaggedArray = new string[2][];
            jaggedArray[0] = new [] { "Entity", "Component", "System" };
            jaggedArray[1] = new [] { "For", "C#" };
            e.AddJaggedArray(jaggedArray);
            var listArray = new List<string>[] {
                new List<string> { "1", "2", "3" },
                new List<string> { "One", "Two", "Three" }
            };
            e.AddListArray(listArray);
            e.AddList(new List<string>{ "Apple", "Banana", "Peach" });
            var dict = new Dictionary<string, string> {
                { "1", "One" },
                { "2", "Two" },
                { "3", "Three" },
                { "4", "One" },
                { "5", "Two" },
                { "6", "Three" },
                { "7", "One" },
                { "8", "Two" },
                { "9", "Three" }
            };
            e.AddDictionary(dict);
            var dict2 = new Dictionary<int, string[]> {
                { 1, new [] { "One", "Two", "Three" } },
                { 2, new [] { "Four", "Five", "Six" } },
                { 3, new [] { "One", "Two", "Three" } },
                { 4, new [] { "Four", "Five", "Six" } },
                { 5, new [] { "One", "Two", "Three" } },
                { 6, new [] { "Four", "Five", "Six" } },
                { 7, new [] { "One", "Two", "Three" } }
            };
            var dictArray = new Dictionary<int, string[]>[] {
                new Dictionary<int, string[]> {
                    { 1, new [] { "One", "Two", "Three" } },
                    { 2, new [] { "Four", "Five", "Six" } }
                }, new Dictionary<int, string[]> {
                    { 3, new [] { "One", "Two", "Three" } },
                    { 4, new [] { "Four", "Five", "Six" } }
                }
            };
            e.AddDictArray(dict2, dictArray);
            e.AddHashSet(new HashSet<string> { "One", "Two", "Three" });
            e.AddMyChar('c');
            e.AddUnsupportedObject(new UnsupportedObject("Unsupported Object"));
            e.AddSimpleObject(new SimpleObject());
            e.AddDontDrawSimpleObject(new SimpleObject());
            e.AddProperty("My Property");
            e.AddPerson("Max", "Male");
            e.AddManyMembers("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
        }
    }

    void createTestEntityWithNullValues(GameContext context) {
        var e = context.CreateEntity();

        // Unity's builtIn
        AnimationCurve animationCurve = null;
        e.AddAnimationCurve(animationCurve);
        string myString = null;
        e.AddMyString(myString);
        UnityEngine.Object unityObject = null;
        e.AddUnityObject(unityObject);
        GameObject go = null;
        e.AddGameObject(go);
        Texture texture = null;
        e.AddTexture(texture);
        Texture2D texture2D = null;
        e.AddTexture2D(texture2D);

        // Custom
        MonoBehaviourSubClass monoBehaviourSubClass = null;
        e.AddMonoBehaviourSubClass(monoBehaviourSubClass);
        CustomObject customObject = null;
        e.AddCustomObject(customObject);
        object systemObject = null;
        e.AddSystemObject(systemObject);
        string[] array = null;
        e.AddAnArray(array);
        string[,] array2d = null;
        e.AddArray2D(array2d);
        string[,,] array3d = null;
        e.AddArray3D(array3d);
        string[][] jaggedArray = null;
        e.AddJaggedArray(jaggedArray);
        List<string>[] listArray = null;
        e.AddListArray(listArray);
        List<string> list = null;
        e.AddList(list);
        Dictionary<string, string> dict = null;
        e.AddDictionary(dict);
        Dictionary<int, string[]> dict2 = null;
        Dictionary<int, string[]>[] dictArray = null;
        e.AddDictArray(dict2, dictArray);
        HashSet<string> hashset = null;
        e.AddHashSet(hashset);
        char c = default(char);
        e.AddMyChar(c);
        UnsupportedObject unsupportedObject = null;
        e.AddUnsupportedObject(unsupportedObject);
        SimpleObject simpleObject = null;
        e.AddSimpleObject(simpleObject);
        e.AddDontDrawSimpleObject(simpleObject);
        e.AddProperty(myString);
        string personName = null;
        string personGender = null;
        e.AddPerson(personName, personGender);
    }

    void createTestEntityError(GameContext context) {
        var entity = context.CreateEntity();
        entity.Retain(this);
        entity.Destroy();
    }
}


text:
package com.gizwits.framework.utils;

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

import android.app.Activity;

// TODO: Auto-generated Javadoc
/**
 * 历史程序栈.
 *
 * @author Lien Li
 * @version 1.00
 */
public class Historys
{

	/** The activity list. */
	private static List<Activity> activityList = null;

	/** The instance. */
	private static Historys instance = null;

	/**
	 *  返回该类的一个实例.
	 *
	 * @return single instance of Historys
	 */
	private static Historys getInstance()
	{
		if(instance == null)
		{
			synchronized ( Historys.class )
			{
				if(instance == null)
					instance = new Historys();
			}
		}
		return instance;
	}

	/**
	 * Instantiates a new historys.
	 */
	public Historys()
	{
		activityList = new ArrayList<Activity>();
	}

	/**
	 * 将一个程序Activity放入历史栈中.
	 *
	 * @param activity the activity
	 */
	public static void put(final Activity activity)
	{
		if(activityList == null)
			getInstance();
		SystemResource.getExecutorService().execute( new Runnable()
		{
			public void run()
			{
				activityList.add( activity );
				List<Activity> nos = new ArrayList<Activity>();
				int size = activityList.size();
				for(int i = 0; i < size; i++)
				{
					Activity act = activityList.get( i );
					if(act != null && act.isFinishing())
					{
						nos.add( act );
					}
				}

				activityList.removeAll( nos );
				nos = null;
			}
		});
	}

	/**
	 * 结束所有在历史栈中的程序,并清空历史栈.
	 */
	public static void exit()
	{
		if(activityList == null)
			return;
		int size = activityList.size();
		for(int i = 0; i < size; i++)
		{
			Activity act = activityList.get( i );
			finish( act );
			act = null;
		}
		activityList.clear();

		android.os.Process.killProcess(android.os.Process.myPid());
		System.exit(0);
	}

	/**
	 * Finish.
	 *
	 * @param activity the activity
	 */
	private static void finish(Activity activity)
	{
		if(activity == null)
			return ;
		try
		{
			activity.finish();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * 回收该类的数据资源.
	 */
	public static void recycle()
	{
		if(activityList != null)
		{
			activityList.clear();
			activityList = null;
		}
		instance = null;
	}
}


text:
<!DOCTYPE html>
<html>
	<head>
		<title>SSE example</title>
	</head>
	<body>
		<script>
		const evtSource = new EventSource("sse");

		evtSource.addEventListener("ping", (event) => {
  const newElement = document.createElement("li");
  const eventList = document.getElementById("list");
  const time = JSON.parse(event.data).time;
  const peer = JSON.parse(event.data).peer;
  newElement.textContent = `ping at ${time} from ${peer}`;
  eventList.appendChild(newElement);
});

		</script>
		<ul id="list">

		</ul>
	</body>
</html>


text:
/*
 */
#define _SUPPRESS_PLIB_WARNING 1
#include <p32xxxx.h>
#include <plib.h>
#include "HMain.h"
//config
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_2
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_1
#pragma config FWDTEN = OFF
#pragma config FSOSCEN = OFF
#pragma config WDTPS = PS4
#pragma config CP=OFF, BWP=OFF
#pragma config FCKSM = CSDCMD
#pragma config ICESEL   = ICS_PGx1      // ICE/ICD Comm Channel Select
#pragma config JTAGEN = OFF
//USB
#pragma config FUSBIDIO = OFF
#pragma config FVBUSONIO = OFF

unsigned char OS_Str_1[64];

//#=================================================================================================
//#=================================================================================================
void __ISR( _EXTERNAL_0_VECTOR, ipl2) INT0Interrupt( void)
{ // input capture interrupt service routine
   Delayms(10);
   SoftReset();
   mINT0ClearIntFlag();
}

//#=================================================================================================
//#=================================================================================================
int main( void ) {
    Tweeq_Init();

    COMM1_Tx_Str("EXAMPLE : INT0 external intrrupt \n");

    ConfigINT0(EXT_INT_PRI_2 | FALLING_EDGE_INT | EXT_INT_ENABLE);

    // enable multi-vector interrupts
    INTEnableSystemMultiVectoredInt();

    while(1)
    {
        LED_HIGH;
        Delayms(250);
        LED_LOW;
        Delayms(250);

        COMM1_Tx_Str("Endless \n");;
    }

    return (EXIT_SUCCESS);
}
//#=================================================================================================
//#=================================================================================================