text:
package java.lang

import scala.scalajs.js

/* This is a hijacked class. Its instances are primitive numbers.
 * Constructors are not emitted.
 */
final class Integer private () extends Number with Comparable[Integer] {

  def this(value: scala.Int) = this()
  def this(s: String) = this()

  @inline def intValue(): scala.Int =
    this.asInstanceOf[scala.Int]

  @inline override def byteValue(): scala.Byte = intValue.toByte
  @inline override def shortValue(): scala.Short = intValue.toShort
  @inline def longValue(): scala.Long = intValue.toLong
  @inline def floatValue(): scala.Float = intValue.toFloat
  @inline def doubleValue(): scala.Double = intValue.toDouble

  @inline override def equals(that: Any): scala.Boolean =
    this eq that.asInstanceOf[AnyRef]

  @inline override def hashCode(): Int =
    intValue

  @inline override def compareTo(that: Integer): Int =
    Integer.compare(intValue, that.intValue)

  @inline override def toString(): String =
    Integer.toString(intValue)

  /* Methods of java.lang.Byte and java.lang.Short.
   * When calling a method of j.l.Byte or j.l.Short on a primitive value,
   * it appears to be called directly on the primitive value, which has type
   * IntType. Call resolution, by the analyzer and the optimizer, will then
   * look for the method in the class j.l.Integer instead of j.l.Byte or
   * j.l.Short. This is why we add here the methods of these two classes that
   * are not already in j.l.Integer.
   */

  @inline def compareTo(that: Byte): Int =
    Integer.compare(intValue, that.intValue)

  @inline def compareTo(that: Short): Int =
    Integer.compare(intValue, that.intValue)

}

object Integer {
  final val TYPE = classOf[scala.Int]
  final val MIN_VALUE = -2147483648
  final val MAX_VALUE = 2147483647
  final val SIZE = 32
  final val BYTES = 4

  @inline def valueOf(intValue: scala.Int): Integer = new Integer(intValue)
  @inline def valueOf(s: String): Integer = valueOf(parseInt(s))

  @inline def valueOf(s: String, radix: Int): Integer =
    valueOf(parseInt(s, radix))

  @inline def parseInt(s: String): scala.Int = parseInt(s, 10)

  @noinline def parseInt(s: String, radix: scala.Int): scala.Int =
    parseIntImpl(s, radix, signed = true)

  @inline def parseUnsignedInt(s: String): scala.Int = parseUnsignedInt(s, 10)

  @noinline def parseUnsignedInt(s: String, radix: scala.Int): scala.Int =
    parseIntImpl(s, radix, signed = false)

  @inline
  private def parseIntImpl(s: String, radix: scala.Int,
      signed: scala.Boolean): scala.Int = {
    def fail = throw new NumberFormatException(s"""For input string: "$s"""")

    if (s == null || s.size == 0 ||
        radix < Character.MIN_RADIX ||
        radix > Character.MAX_RADIX)
      fail
    else {
      var i = if ((signed && s(0) == '-') || s(0) == '+') 1 else 0
      // JavaDoc says: We need at least one digit
      if (s.size <= i) fail
      else {
        // Check each character for validity
        while (i < s.size) {
          if (Character.digit(s(i), radix) < 0) fail
          i += 1
        }
        val res = js.Dynamic.global.parseInt(s, radix).asInstanceOf[scala.Double]

        @inline def isOutOfBounds: scala.Boolean = {
          if (signed) res > MAX_VALUE || res < MIN_VALUE
          else res > 0xFFFFFFFFL || res < 0
        }

        if (res.isNaN || isOutOfBounds) {
          fail
        } else if (signed) {
          res.toInt
        } else {
          asInt(res)
        }
      }
    }
  }

  @inline def toString(i: scala.Int): String = "" + i

  @inline def toUnsignedString(i: Int, radix: Int): String =
    toStringBase(i, radix)

  @inline def compare(x: scala.Int, y: scala.Int): scala.Int =
    if (x == y) 0 else if (x < y) -1 else 1

  @inline def compareUnsigned(x: scala.Int, y: scala.Int): scala.Int = {
    import js.JSNumberOps._
    if (x == y) 0
    else if (x.toUint > y.toUint) 1
    else -1
  }

  @inline def toUnsignedLong(x: Int): scala.Long =
    x.toLong & 0xffffffffL

  def bitCount(i: scala.Int): scala.Int = {
    /* See http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
     *
     * The original algorithm uses *logical* shift rights. Here we use
     * *arithmetic* shift rights instead. >> is shorter than >>>, especially
     * since the latter needs (a >>> b) | 0 in JS. It might also be the case
     * that >>> is a bit slower for that reason on some VMs.
     *
     * Using >> is valid because:
     * * For the 2 first >>, the possible sign bit extension is &'ed away
     * * For (t2 >> 4), t2 cannot be negative because it is at most the result
     *   of 2 * 0x33333333, which does not overflow and is positive.
     * * For the last >> 24, the left operand cannot be negative either.
     *   Assume it was, that means the result of a >>> would be >= 128, but
     *   the correct result must be <= 32. So by contradiction, it is positive.
     */
    val t1 = i - ((i >> 1) & 0x55555555)
    val t2 = (t1 & 0x33333333) + ((t1 >> 2) & 0x33333333)
    (((t2 + (t2 >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24
  }

  @inline def divideUnsigned(dividend: Int, divisor: Int): Int = {
    import js.JSNumberOps._
    asInt(dividend.toUint / divisor.toUint)
  }

  @inline def remainderUnsigned(dividend: Int, divisor: Int): Int = {
    import js.JSNumberOps._
    asInt(dividend.toUint % divisor.toUint)
  }

  @inline def highestOneBit(i: Int): Int =
    if (i == 0) 0
    else (1 << 31) >>> numberOfLeadingZeros(i)

  @inline def lowestOneBit(i: Int): Int =
    i & -i

  def reverseBytes(i: scala.Int): scala.Int = {
    val byte3 = i >>> 24
    val byte2 = (i >>> 8) & 0xFF00
    val byte1 = (i << 8) & 0xFF0000
    val byte0 = i << 24
    byte0 | byte1 | byte2 | byte3
  }

  @inline def rotateLeft(i: scala.Int, distance: scala.Int): scala.Int =
    (i << distance) | (i >>> -distance)

  @inline def rotateRight(i: scala.Int, distance: scala.Int): scala.Int =
    (i >>> distance) | (i << -distance)

  @inline def signum(i: scala.Int): scala.Int =
    if (i == 0) 0 else if (i < 0) -1 else 1

  // Intrinsic
  def numberOfLeadingZeros(i: scala.Int): scala.Int = {
    // See Hacker's Delight, Section 5-3
    var x = i
    if (x == 0) {
      32
    } else {
      var r = 1
      if ((x & 0xffff0000) == 0) { x <<= 16; r += 16 }
      if ((x & 0xff000000) == 0) { x <<= 8; r += 8 }
      if ((x & 0xf0000000) == 0) { x <<= 4; r += 4 }
      if ((x & 0xc0000000) == 0) { x <<= 2; r += 2 }
      r + (x >> 31)
    }
  }

  @inline def numberOfTrailingZeros(i: scala.Int): scala.Int =
    if (i == 0) 32
    else 31 - numberOfLeadingZeros(i & -i)

  def toBinaryString(i: scala.Int): String = toStringBase(i, 2)
  def toHexString(i: scala.Int): String = toStringBase(i, 16)
  def toOctalString(i: scala.Int): String = toStringBase(i, 8)

  @inline // because radix is almost certainly constant at call site
  def toString(i: Int, radix: Int): String = {
    if (radix == 10 || radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
      Integer.toString(i)
    } else {
      import js.JSNumberOps.enableJSNumberOps
      i.toString(radix)
    }
  }

  @inline def toUnsignedString(i: scala.Int): String = toUnsignedString(i, 10)

  @inline def hashCode(value: Int): Int = value.hashCode

  @inline def sum(a: Int, b: Int): Int = a + b
  @inline def max(a: Int, b: Int): Int = Math.max(a, b)
  @inline def min(a: Int, b: Int): Int = Math.min(a, b)

  @inline private[this] def toStringBase(i: scala.Int, base: scala.Int): String = {
    import js.JSNumberOps._
    i.toUint.toString(base)
  }

  @inline private def asInt(n: scala.Double): scala.Int =
    (n.asInstanceOf[js.Dynamic] | 0.asInstanceOf[js.Dynamic]).asInstanceOf[Int]
}


text:
@interface BTSerialDemo : NSObject<BTSerialConnectionDelegate>
{
    BTSerialConnection *serial;
}

- (void)startDemo;
- (void)stopDemo;

@end

redpajama_set_name: RedPajamaGithub


text:
[MOVED]

This example app has been moved to a separate repository [grommet-todo](https://github.com/grommet/grommet-todo)


text:
package com.alibaba.rocketmq.common;

import com.alibaba.rocketmq.remoting.common.RemotingUtil;
import org.junit.Test;

public class RemotingUtilTest {
    @Test
    public void test() throws Exception {
        String a = RemotingUtil.getLocalAddress();
        System.out.println(a);
    }
}


text:
pol_ids = %w[

]

calc = Premiums::PolicyCalculator.new

pols = Policy.where({ "id" => {"$in" => pol_ids} })

pols.each do |pol|
  if pol.canceled?
    puts "#{pol.id} - canceled"
  elsif pol.terminated?
    puts "#{pol.id} - terminated"
  else
    prev = pol.employer_contribution
    calc.apply_calculations(pol)
    puts "#{pol.id} - recalced #{prev}:#{pol.employer_contribution}"
    out_f = File.open(File.join("recalc", "#{pol._id}_recalced.xml"), 'w')
    ser = CanonicalVocabulary::MaintenanceSerializer.new(
      pol,
      "change",
      "benefit_selection",
      pol.enrollees.map(&:m_id),
      pol.enrollees.map(&:m_id),
    )
    out_f.write(ser.serialize)
    out_f.close
  end
end


text:
Mazy Tic-Tac-Toe
================

Mazy Tic-Tac-Toe is spin off of the Ultimate Tic-Tac-Toe
(http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe) with the only
difference in the winning condition (or losing).

About Game
----------

Mazy Tic-Tac-Toe is a 2-player computer game played on a game board comprising
nine tic-tac-toe games consisting of nine cells within a 3x3 big square. Thus,
there are 81 cells, arranged in nine 3x3 big square within the board.

Objective
---------

The objective of this game is to be the first to win tic-tac-toe game within any
big square.

Rules of Play
-------------

1.  The first player may place an "X" in any cell within any big square of the
    board.

2.  The selected cell position within this big square corresponds to the big
    square where the second player must then place an "O".

3.  Thereafter, the two players take turns placing their mark in any unfilled
    cell within the big square dictated by the cell position marked by the
    previous player.

NOTE: If a player is sent to a big square in which all the cells are already
filled, then the player may next place his mark in any unfilled cell in any
other big squares.

Browser support
---------------

Mazy Tic-Tac-Toe works good on all versions of Google Chrome, Safari v4.0+,
Firefox v3.5+, IE 10.0+, Opera 10.6+.


text:
dojo.provide("widgets.widgets");
dojo.registerModulePath("AppCloudNavigation", "../../widgets/AppCloudNavigation");
dojo.provide("AppCloudNavigation.AppCloudNavigation");
dojo.require("dojo.io.script");

mendix.widget.declare('AppCloudNavigation.AppCloudNavigation', {
	inputargs: {
		mendixserver : ''
	},

	_hasStarted : false,

	startup : function() {
		if (!this._hasStarted) {
			this._hasStarted = true;

			mxui.dom.addClass(this.domNode, "mx-mendixtoolbar");

			if (!window.mxToolbarSettings || window.mxToolbarSettings.started !== true) {

				var url = this.mendixserver + (this.mendixserver.match(/\/$/) != null ? "" : "/");
				window.mxToolbarSettings = {
					toolbarBaseUrl: url
				};

				dojo.io.script.get({
					url: url + 'mendixtoolbar/js/appcloudservice.js?PP_5.27',
					error : dojo.hitch(this, function (e) {
						console && console.log('Mendix AppCloud Navigation could not load external script: ', e);
					})
				});
			}
		}
		this.actLoaded();
	},

	uninitialize : function() {

	}

});;
dojo.registerModulePath("GreenSock", "../../widgets/GreenSock");
/*jslint white:true, nomen: true, plusplus: true */
/*global mx, define, require, browser, devel, console, window */
/*mendix */
/*
    GreenSock
    ========================

    @file      : GreenSock.js
    @version   : 1.0
    @author    : Gerhard Richard Edens
    @date      : Fri, 27 Feb 2015 08:08:07 GMT
    @copyright : Mendix B.V.
    @license   : Apache 2

    Documentation
    ========================
    Describe your widget here.
*/

// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
require([
    'dojo/_base/declare', 'mxui/widget/_WidgetBase', 'dijit/_TemplatedMixin',

    'mxui/dom', 'dojo/dom', 'dojo/query', 'dojo/dom-prop', 'dojo/dom-geometry', 'dojo/dom-class', 'dojo/dom-style', 'dojo/dom-construct', 'dojo/_base/array', 'dojo/_base/lang', 'dojo/text',

    'GreenSock/lib/jquery-1.11.2.min',

    'dojo/text!GreenSock/widget/template/GreenSock.html', 'GreenSock/lib/TweenMax.min'
], function (declare, _WidgetBase, _TemplatedMixin, dom, dojoDom, domQuery, domProp, domGeom, domClass, domStyle, domConstruct, dojoArray, lang, text, _jQuery, widgetTemplate) {
    'use strict';

    var TweenMax = window.TweenMax;

    // Declare widget's prototype.
    return declare('GreenSock.widget.GreenSock', [ _WidgetBase, _TemplatedMixin ], {
        // _TemplatedMixin will create our dom node using this HTML template.
        templateString: widgetTemplate,

        // Parameters configured in the Modeler.
        mfToExecute: "",
        messageString: "",
        backgroundColor: "",

        // Internal variables. Non-primitives created in the prototype are shared between all widget instances.
        _handle: null,
        _contextObj: null,
        _objProperty: null,

        // dojo.declare.constructor is called to construct the widget instance. Implement to initialize non-primitive properties.
        constructor: function () {
            this._objProperty = {};
        },

        // dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
        postCreate: function () {
            console.log(this.id + '.postCreate');
        },

        // mxui.widget._WidgetBase.update is called when context is changed or initialized. Implement to re-render and / or fetch data.
        update: function (obj, callback) {
            console.log(this.id + '.update');

            this._contextObj = obj;
            this._resetSubscriptions();
            this._updateRendering();

            callback();
        },

        // mxui.widget._WidgetBase.enable is called when the widget should enable editing. Implement to enable editing if widget is input widget.
        enable: function () {

        },

        // mxui.widget._WidgetBase.enable is called when the widget should disable editing. Implement to disable editing if widget is input widget.
        disable: function () {

        },

        // mxui.widget._WidgetBase.resize is called when the page's layout is recalculated. Implement to do sizing calculations. Prefer using CSS instead.
        resize: function (box) {

        },

        // mxui.widget._WidgetBase.uninitialize is called when the widget is destroyed. Implement to do special tear-down work.
        uninitialize: function () {
            // Clean up listeners, helper objects, etc. There is no need to remove listeners added with this.connect / this.subscribe / this.own.
        },

        _updateRendering: function () {
            // TODO
        },

        _resetSubscriptions: function () {
            // Release handle on previous object, if any.
            if (this._handle) {
                this.unsubscribe(this._handle);
                this._handle = null;
            }

            if (this._contextObj) {
                this._handle = this.subscribe({
                    guid: this._contextObj.getGuid(),
                    callback: this._updateRendering
                });
            }
        }
    });
});
;
dojo.registerModulePath("MobileSliderBackground", "../../widgets/MobileSliderBackground");
/*jslint white:true, nomen: true, plusplus: true */
/*global mx, define, require, browser, devel, console, location, dojo, MobileSliderBackground, $, document, window, device, setTimeout */
/*mendix */
/*
    MobileSliderBackground
    ========================

    @file      : MobileSliderBackground.js
    @version   : 1.0
    @author    : Gerhard Richard Edens
    @date      : Wed, 25 Mar 2015 10:48:53 GMT
    @copyright : Mendix b.v.
    @license   : Apache 2

    Documentation
    ========================
    Describe your widget here.
*/

// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
require([
    'dojo/_base/declare', 'mxui/widget/_WidgetBase', 'dijit/_TemplatedMixin',
    'mxui/dom', 'dojo/dom', 'dojo/query', 'dojo/dom-prop', 'dojo/dom-geometry', 'dojo/dom-class', 'dojo/dom-style', 'dojo/dom-construct', 'dojo/_base/array', 'dojo/_base/lang', 'dojo/text',
    'MobileSliderBackground/lib/jquery-1.11.2.min', 'dojo/text!MobileSliderBackground/widget/template/MobileSliderBackground.html'
], function (declare, _WidgetBase, _TemplatedMixin, dom, dojoDom, domQuery, domProp, domGeom, domClass, domStyle, domConstruct, dojoArray, lang, text, _jQuery, widgetTemplate) {
    'use strict';

    // Declare widget's prototype.
    return declare('MobileSliderBackground.widget.MobileSliderBackground', [_WidgetBase, _TemplatedMixin], {  //'MobileSliderBackground.widget.MobileSliderBackground',
        // _TemplatedMixin will create our dom node using this HTML template.
        templateString: widgetTemplate,

        // Parameters configured in the Modeler.
        mfToExecute: "",
        messageString: "",
        backgroundColor: "",

        // Internal variables. Non-primitives created in the prototype are shared between all widget instances.
        _handle: null,
        _contextObj: null,
        _objProperty: null,

        // dojo.declare.constructor is called to construct the widget instance. Implement to initialize non-primitive properties.
        constructor: function () {
            this._objProperty = {};
        },

        // dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
        postCreate: function () {
            console.log(this.id + '.postCreate');

            if ($('#mx-slider-background').length === 0) {
                var backgroundImage = $('

'),
                    backgroundImageLayer = $('

');
                backgroundImage.attr('id', 'mx-slider-background');
                backgroundImageLayer.attr('id', 'mx-slider-background-layer');
                backgroundImage.append(backgroundImageLayer);
                $('#content').prepend(backgroundImage.wrapAll('
').parent().html());
            }

            this._setupEvents();
        },

        // mxui.widget._WidgetBase.update is called when context is changed or initialized. Implement to re-render and / or fetch data.
        update: function (obj, callback) {
            console.log(this.id + '.update');

            this._contextObj = obj;
            this._resetSubscriptions();
            this._updateRendering();

            callback();
        },

        // mxui.widget._WidgetBase.enable is called when the widget should enable editing. Implement to enable editing if widget is input widget.
        enable: function () {

        },

        // mxui.widget._WidgetBase.enable is called when the widget should disable editing. Implement to disable editing if widget is input widget.
        disable: function () {

        },

        // mxui.widget._WidgetBase.resize is called when the page's layout is recalculated. Implement to do sizing calculations. Prefer using CSS instead.
        resize: function (box) {

        },

        // mxui.widget._WidgetBase.uninitialize is called when the widget is destroyed. Implement to do special tear-down work.
        uninitialize: function () {
            // Clean up listeners, helper objects, etc. There is no need to remove listeners added with this.connect / this.subscribe / this.own.
        },

        _setupEvents: function () {
            $('#mx-slider-background-layer').on('mx.slide.set.background', lang.hitch(this, function(event, data) {
                $('#mx-slider-background-layer').css('background-image', 'url(\'' + mx.appUrl + data.background + '\')');
                $('#mx-slider-background-layer').css('background-size', '100% auto');
                $('#mx-slider-background-layer').css('width', data.width + 'px');
                $('#mx-slider-background-layer').css('height', data.height + 'px');
            }));
            // iOS
            window.addEventListener('resize', lang.hitch(this, this._orientationChanged));
        },

        _orientationChanged: function(){
            $('#mx-slider-background').css('width', window.innerWidth + 'px');
            $('#mx-slider-background').css('height', window.innerHeight + 'px');
            $('#mx-slider-background-layer').css('height', window.innerHeight + 'px');
            $('#mx-slider-background-layer').css('background-size', '100% auto');
        },

        _updateRendering: function () {
        },

        _resetSubscriptions: function () {
            // Release handle on previous object, if any.
            if (this._handle) {
                this.unsubscribe(this._handle);
                this._handle = null;
            }

            if (this._contextObj) {
                this._handle = this.subscribe({
                    guid: this._contextObj.getGuid(),
                    callback: this._updateRendering
                });
            }
        }
    });
});
;
dojo.registerModulePath("SprintrFeedbackWidget", "../../widgets/SprintrFeedbackWidget");
dojo.provide("SprintrFeedbackWidget.SprintrFeedback");
dojo.require("dojo.io.script");

mendix.widget.declare('SprintrFeedbackWidget.SprintrFeedback', {
    inputargs: {

		sprintrapp : '',
		entity : '',
		usernameattr : '',
		emailattr : '',
		allowFile : true,
		allowSshot : false,
		sprintrserver : ''

    },

	postCreate : function(){
		if (!window.sprintrFeedback) {
			var url = this.sprintrserver + (this.sprintrserver.match(/\/$/) != null ? "" : "/");
			dojo.io.script.attach("sprintrfeedbackWrapper", url + "feedback/sprintrfeedback.js");

			this.checkScript(function () { return typeof window.sprintrFeedback != "undefined";}, dojo.hitch(this, function() {
				mx.addOnLoad(dojo.hitch(this, this.loadData));
			}), 0);
		} else {
			mx.addOnLoad(dojo.hitch(this, this.loadData));
		}
		this.actRendered();
	},
	loadData : function () {
		if (this.entity !== '' && !!mx.session.getUserId()) {
			mx.processor.get({
				guid : mx.session.getUserId(),
				callback : dojo.hitch(this, this.startFeedback),
				error: function(e) {
					alert("Error while loading feedback form: " +e);
				}
			});
		} else {
			this.startFeedback(null);
		}
	},
	startFeedback : function (userobj) {
		var data = {
			'sprintrid' : this.sprintrapp,
			'allowFile' : this.allowFile,
			'allowSshot' : this.allowSshot
		};
		var username = '';
		if (userobj != null && this.usernameattr != '' && userobj.hasAttribute(this.usernameattr))
			username = userobj.getAttribute(this.usernameattr)
		else if (mx.session.getUserId() > 0 && mx.session.isGuest && !mx.session.isGuest())
			username = mx.session.getUserName();

		var emailaddr =
			(userobj != null && this.emailattr != '' && userobj.hasAttribute(this.emailattr))
			? userobj.getAttribute(this.emailattr)
			: (username.match(/.+@.+\..+/) ? username : ''); //if it looks like an email address, it is one.

		var roles = mx.session.getUserRoles();
		var rolenames = [];
		for(var i = 0; i < roles.length; i++)
			rolenames.push(roles[i].getAttribute("Name"));

		data.userdata = {
			'username' : username,
			'emailaddress' : emailaddr,
			'userroles' : rolenames.join(" ") + " (account: " + username + ")"
		};
		window.sprintrFeedback.create(data);
	},
	checkScript : function (elem, cb, counter) {
        if (elem()) {
            cb();
        } else {
            if (counter < 30) {
                setTimeout(dojo.hitch(this, function () {
                    this.checkScript(elem, cb, counter+1);
                }), 50);
            }
        }
    },
	uninitialize : function(){
	}
});;
dojo.registerModulePath("MobileSlider", "../../widgets/MobileSlider");
/*jslint white:true, nomen: true, plusplus: true */
/*global mx, define, require, browser, devel, console, Draggable, document, TweenMax, Elastic, $, window, navigator, setTimeout */
/*mendix */
/*
    MobileSlider
    ========================

    @file      : MobileSlider.js
    @version   : 1.0
    @author    : Gerhard Richard Edens
    @date      : Tue, 24 Mar 2015 08:15:20 GMT
    @copyright : Mendix b.v.
    @license   : Apache 2

    Documentation
    ========================
    Describe your widget here.
*/

// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
require([

    // Mixins
    'dojo/_base/declare', 'mxui/widget/_WidgetBase', 'dijit/_TemplatedMixin',

    // Dojo
    'mxui/dom', 'dojo/dom', 'dojo/query', 'dojo/dom-prop', 'dojo/dom-geometry', 'dojo/dom-class', 'dojo/dom-style', 'dojo/dom-construct', 'dojo/_base/array', 'dojo/_base/lang', 'dojo/text',

    // jQuery
    'MobileSlider/lib/jquery-1.11.2.min',

    // Templates
    'dojo/text!MobileSlider/widget/template/MobileSlider.html'

], function (declare, _WidgetBase, _TemplatedMixin, dom, dojoDom, domQuery, domProp, domGeom, domClass, domStyle, domConstruct, dojoArray, lang, text, _jQuery, widgetTemplate) {
    'use strict';

    // Declare widget's prototype.
    return declare('MobileSlider.widget.MobileSlider', [ _WidgetBase, _TemplatedMixin ], {
        // _TemplatedMixin will create our dom node using this HTML template.
        templateString: widgetTemplate,

        // Parameters configured in the Modeler.
        mfToExecute: "",
        messageString: "",
        backgroundColor: "",

        // Internal variables. Non-primitives created in the prototype are shared between all widget instances.
        _handle: null,
        _contextObj: null,
        _objProperty: null,

        // Snap points
        _snapPoints: null,
        _snapCount: null,
        _snapping: null,
        _originalOffset: null,
        _limit: null,

        // Added style for mx-slide.
        _addedStyle: null,

        // dojo.declare.constructor is called to construct the widget instance. Implement to initialize non-primitive properties.
        constructor: function () {
            var slideWidthStyle = $('');

            // Properties
            this._snapCount = 0;
            this._snapPoints = [];
            this._objProperty = {};

            // Slide width style set!
            if (this._addedStyle === null) {
                this._addedStyle = true;
                $('head').append('');
            }
        },

        // dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
        postCreate: function () {
            var slide = null,
                properties = null,

                documentWidth = null,
                documentHeight = null,

                i = null,
                containerDraggable = null,
                slideClass = 'mx-slide';

            console.log(this.id + '.postCreate');

            // Go through slides
            for(slide in this.slides){
                if (this.slides.hasOwnProperty(slide)){
                    properties = this.slides[slide];
                    this._slides.appendChild(dom.create('div', {
                        'class': (this.useFixedViewportWidth) ? 'mx-slide-view' : 'mx-slide',
                        'id': this.id + '_mx_slide_' + properties.number,
                        'data-number': properties.number
                    }, ''));
                }
            }

            // Width
            documentWidth = window.innerWidth;
            documentHeight = window.innerHeight;

            // Set viewport and actual widget width!
            this._createSnapPointsAndSizes();

            // Draggable.
            containerDraggable = Draggable.create($('#' + this.id + ' .mx-slides-viewport'), {
                type: 'left',
                maxDuration: 1.25,
                minDuration: 0.75,
                edgeResistance: 0.8,
                onDragStart:lang.hitch(this, function()
                                       {
                    this._originalOffset = $('#' + this.id + ' .mx-slides-viewport').offset().left;
                }),
                onDragEnd: lang.hitch(this, function() {
                    this._slideToNextBestSnapPoint();
                })//function end
            });//draggable end

            //{ type:"x", edgeResistance:0.65, bounds: '#' + this.id, lockAxis: true, throwProps: true });

            this._setupEvents();
        },

        // mxui.widget._WidgetBase.update is called when context is changed or initialized. Implement to re-render and / or fetch data.
        update: function (obj, callback) {
            console.log(this.id + '.update');

            this._contextObj = obj;
            this._resetSubscriptions();
            this._updateRendering();

            callback();
        },

        // mxui.widget._WidgetBase.enable is called when the widget should enable editing. Implement to enable editing if widget is input widget.
        enable: function () {

        },

        // mxui.widget._WidgetBase.enable is called when the widget should disable editing. Implement to disable editing if widget is input widget.
        disable: function () {

        },

        // mxui.widget._WidgetBase.resize is called when the page's layout is recalculated. Implement to do sizing calculations. Prefer using CSS instead.
        resize: function (box) {

        },

        // mxui.widget._WidgetBase.uninitialize is called when the widget is destroyed. Implement to do special tear-down work.
        uninitialize: function () {
            // Clean up listeners, helper objects, etc. There is no need to remove listeners added with this.connect / this.subscribe / this.own.
        },

        _formCallback : function(form) {
            console.log(form.id);
        },

        _setupEvents: function () {
            // iOS
            window.addEventListener('resize', lang.hitch(this, this._orientationChanged));
        },

        _orientationChanged: function(){
            if ($('#mx-slides-style').length === 1) {
                $('#mx-slides-style').html('.mx-slide { width: ' + window.innerWidth + 'px; }');
                this._createSnapPointsAndSizes();
                this._slideToNextBestSnapPoint();
            }
        },

        _createSnapPointsAndSizes: function(){
            var documentWidth = window.innerWidth,
                documentHeight = window.innerHeight,
                i = null;

            this._snapPoints = [];

            if (this.useFixedViewportWidth) {

                // Setting the background!
                $('#mx-slider-background-layer').trigger('mx.slide.set.background', [{
                    background: this.slides[0].backgroundImage,
                    width: (this.fixedViewportWidth * documentWidth),
                    height: documentHeight
                }]);

                // Slides
                this._limit = this.fixedViewportWidth - 1;

                $(this._slideDots).html('');

                // Snap points.
                for(i = 0; i < this.fixedViewportWidth; i++)
                {
                    this._snapPoints.push((i === 0) ? 0 : -documentWidth * i);
                    $(this._slideDots).append('');
                }
                $('#mx-slide-image-' + this.id + '-0').attr('class', 'mx-slide-dot active');

                $('#' + this.id).css('width', documentWidth);
                $('#' + this.id + ' .mx-slides-viewport').css('width', documentWidth * this.fixedViewportWidth);

            } else {

                // Setting the background!
                $('#mx-slider-background-layer').trigger('mx.slide.set.background', [{
                    background: this.slides[0].backgroundImage,
                    width: (this.slides.length * documentWidth),
                    height: documentHeight
                }]);

                // Slides
                this._limit = this.slides.length - 1;

                $(this._slideDots).html('');

                // Snap points.
                for(i = 0; i < this.slides.length; i++)
                {
                    this._snapPoints.push((i === 0) ? 0 : -documentWidth * i);
                    $(this._slideDots).append('');
                }
                $('#mx-slide-image-' + this.id + '-0').attr('class', 'mx-slide-dot active');

                $('#' + this.id).css('width', documentWidth);
                $('#' + this.id + ' .mx-slides-viewport').css('width', documentWidth * this.slides.length);

            }
        },

        _slideToNextBestSnapPoint: function() {
            var documentWidth = (window.innerWidth / 2),
                endValue = $('#' + this.id + ' .mx-slides-viewport').position().left,
                originalOffset = this._originalOffset,
                count = null,
                i = null;

            //the las value to be used as a snap point
            this._lastEndValue = this._snapPoints[this._snapCount];

            //going forward
            if(endValue < this._lastEndValue + documentWidth && this._snapCount < this._limit)
            {
                this._snapCount++;
            }

            if(endValue > this._lastEndValue - documentWidth && this._snapCount > 0)
            {
                this._snapCount--;
            }

            // Snap points.
            count = (this.useFixedViewportWidth) ? this.fixedViewportWidth : this.slides.length;
            for(i = 0; i < count; i++)
            {
                $('#mx-slide-image-' + this.id + '-' + i).attr('class', 'mx-slide-dot');
            }
            $('#mx-slide-image-' + this.id + '-' + this._snapCount).attr('class', 'mx-slide-dot active');

            // TweenLite.
            TweenMax.to($('#mx-slider-background-layer')[0], 3,{
                left: (this._snapPoints[this._snapCount] / 2)
            });
            TweenMax.to($('#' + this.id + ' .mx-slides-viewport')[0], 0.1,{
                left: this._snapPoints[this._snapCount]
            });
        },

        _updateRendering: function () {
            var slide = null,
                properties = null;

            for(slide in this.slides){
                if (this.slides.hasOwnProperty(slide)){
                    properties = this.slides[slide];
                    // Add to dojo attach point
                    mx.ui.openForm(properties.slide, {
                        location: "content",
                        domNode: dojoDom.byId(this.id + '_mx_slide_' + properties.number)
                    });
                }
            }
        },

        _resetSubscriptions: function () {
            // Release handle on previous object, if any.
            if (this._handle) {
                this.unsubscribe(this._handle);
                this._handle = null;
            }

            if (this._contextObj) {
                this._handle = this.subscribe({
                    guid: this._contextObj.getGuid(),
                    callback: this._updateRendering
                });
            }
        }
    });
});
;


text:
<?php
use backend\assets\AdminlteAsset;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;

/* @var $this \yii\web\View */
/* @var $content string */

AdminlteAsset::register($this);

$baseUrl = Yii::$app->request->baseUrl;
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">

    <meta charset="<?= Yii::$app->charset ?>">
    <title><?= Html::encode($this->title) ?></title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <?= Html::csrfMetaTags() ?>
    <?php $this->head() ?>

    <?php $this->beginBody() ?>

        <a href="<?php echo \Yii::$app->getUrlManager()->createUrl(['/site/index']); ?>" class="logo">Trang Quản Trị

            Toggle navigation

                  <img src="<?php echo $baseUrl; ?>/adminlte/dist/img/user.png" class="user-image" alt="User Image"/>
                  <?php echo Yii::$app->user->identity->fullname; ?>

                    <img src="<?php echo $baseUrl; ?>/adminlte/dist/img/user.png" class="img-circle" alt="User Image" />

                      <?php echo Yii::$app->user->identity->fullname; ?>
                      <?php echo Yii::t('app', 'Member'); ?>

                      <a href="<?php echo \Yii::$app->getUrlManager()->createUrl(['/user/default/change-password']); ?>" class="btn btn-default btn-flat">Đổi mật khẩu

                      <a href="<?php echo \Yii::$app->getUrlManager()->createUrl(['/user/default/logout']); ?>" class="btn btn-default btn-flat">Thoát

      <?php echo yii\base\View::render('//partials/slideMenu',array()); ?>

        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>

        <?= $content ?>

          <?= Yii::powered() ?>. Version 1.0.

        Copyright © <?php echo date('Y'); ?> I-Designer. All rights reserved.

    <?php $this->endBody() ?>

<?php $this->endPage() ?>


text:
package com.salesmanager.shop.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Properties;

@Component
public class AppConfiguration {

	private static final Logger LOGGER = LoggerFactory.getLogger(AppConfiguration.class);
	public Properties properties;

	public Properties getProperties() {
		return properties;
	}

	public void setProperties(Properties properties) {
		this.properties = properties;
	}

	public AppConfiguration() {}

	public String getProperty(String propertyKey) {

		if(properties!=null) {
			return properties.getProperty(propertyKey);
		} else {
			LOGGER.warn("Application properties are not loaded");
			return null;
		}

	}

}


text: Demo repo for the article [Making a Simple Site Work Offline with ServiceWorker](https://css-tricks.com/serviceworker-for-offline).


text:
package com.facebook.buck.jvm.groovy;

import com.facebook.buck.core.config.BuckConfig;
import com.facebook.buck.core.description.Description;
import com.facebook.buck.core.description.DescriptionCreationContext;
import com.facebook.buck.core.model.targetgraph.DescriptionProvider;
import com.facebook.buck.core.toolchain.ToolchainProvider;
import com.facebook.buck.jvm.java.JavaBuckConfig;
import java.util.Arrays;
import java.util.Collection;
import org.pf4j.Extension;

@Extension
public class GroovyDescriptionsProvider implements DescriptionProvider {

  @Override
  public Collection<Description<?>> getDescriptions(DescriptionCreationContext context) {
    ToolchainProvider toolchainProvider = context.getToolchainProvider();
    BuckConfig config = context.getBuckConfig();
    GroovyBuckConfig groovyBuckConfig = new GroovyBuckConfig(config);
    JavaBuckConfig javaConfig = config.getView(JavaBuckConfig.class);

    return Arrays.asList(
        new GroovyLibraryDescription(toolchainProvider, groovyBuckConfig, javaConfig),
        new GroovyTestDescription(toolchainProvider, groovyBuckConfig, javaConfig));
  }
}


text:
category: links
draft: false

title: Benjamin Button Reviews The New MacBook Pro
link: https://blog.pinboard.in/2016/10/benjamin_button_reviews_the_new_macbook_pro/
date: 2021-01-02 17:30:58
tags:
    - apple
    - design
    - asshole design
    - technology

---

> Gone is the gimmicky TouchBar, gone are the four USB-C ports that forced power users to carry a suitcase full of dongles. In their place we get a cornucopia of developer-friendly ports: two USB 3.0 and Thunderbolt 2 ports, a redesigned power connector, and a long-awaited HDMI port.
>
> Photographers will rejoice at the surprising and welcome addition of an SDXC card reader, a sign that Apple might be thinking seriously about photography.
>
> The new MagSafe connector is a bit of Apple design genius. The charging cord stays seated securely, but pops right off if you yank on it. No more worries about destroying your $2k laptop just by accidentally kicking a cord.

😭


text:
"""Tests for HomematicIP Cloud button."""

from unittest.mock import patch

from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN
from homeassistant.components.button.const import SERVICE_PRESS
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNKNOWN
from homeassistant.util import dt as dt_util

from .helper import get_and_check_entity_basics

async def test_hmip_garage_door_controller_button(hass, default_mock_hap_factory):
    """Test HomematicipGarageDoorControllerButton."""
    entity_id = "button.garagentor"
    entity_name = "Garagentor"
    device_model = "HmIP-WGC"
    mock_hap = await default_mock_hap_factory.async_get_mock_hap(
        test_devices=[entity_name]
    )

    get_and_check_entity_basics(hass, mock_hap, entity_id, entity_name, device_model)

    state = hass.states.get(entity_id)
    assert state
    assert state.state == STATE_UNKNOWN

    now = dt_util.parse_datetime("2021-01-09 12:00:00+00:00")
    with patch("homeassistant.util.dt.utcnow", return_value=now):
        await hass.services.async_call(
            BUTTON_DOMAIN,
            SERVICE_PRESS,
            {ATTR_ENTITY_ID: entity_id},
            blocking=True,
        )

    state = hass.states.get(entity_id)
    assert state
    assert state.state == now.isoformat()


text:
<head th:fragment="head" xmlns:th="http://www.springframework.org/schema/data/jaxb">
    <title th:if="${pageTitle}" th:text="${pageTitle}"></title>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/custom.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{https://fonts.googleapis.com/css?family=News+Cycle}" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Press+Start+2P"></link>
    <link th:href="@{/img/sec.png}" rel="icon" type="image/png"/>
</head>


text:
using System;
using System.Xml.Serialization;

namespace Hanoi.Serialization.Extensions.MultiUserChat {
    /// <summary>
    ///   XEP-0045: Multi-User Chat
    /// </summary>
    [Serializable]
    [XmlType(Namespace = "http://jabber.org/protocol/muc#user")]
    public enum MucUserItemAffiliation {
        /// <remarks />
        [XmlEnumAttribute("admin")] Admin,

        /// <remarks />
        [XmlEnumAttribute("member")] Member,

        /// <remarks />
        [XmlEnumAttribute("none")] None,

        /// <remarks />
        [XmlEnumAttribute("outcast")] Outcast,

        /// <remarks />
        [XmlEnumAttribute("owner")] Owner,
    }
}


text:
Framing was designed to simplify the creation of applications in Node.js by declaratively facilitating dependency injection. Further, Framing encourages best practices by promoting separation of concerns within the application by dividing the application logic into components.

```
require('framing')
  .setBaseDir(__dirname)
  .run();
```

## Table of Contents
- [Installation](#installation)
- [Why Framing](#why-framing)
- [Components](#components)
- [Application Startup](#application-startup)
- [Command Line Arguments](#command-line-arguments)
- [Examples](#examples)
- [Example Projects](examples/examples.md)
- [FAQ](FAQ.md)

## Installation
```
$ npm install framing
```

## Why Framing
Framing makes it easy to divide an application into components. A component is essentially a node module which allows developers to continue to leverage npm for building, deploying, and sharing of components.

Framing diverges from classical dependency injection in a few ways:
1. All components are singletons.
2. The application logic does not request components from a container or factory.
3. All components in the dependency graph are instantiated during startup.
4. Component instantiation is safely asynchronous, so any external dependencies can safely block the instantiation of dependents.

Framing does not simply manage the construction and reference to objects, but it also handles the application scaffolding. The application does not request components but rather declares the required components. From the declarations, Framing will build and execute the dependency tree.

Because the execution of the dependency tree for all the components occurs only once. Framing will not have an impact on application performance beyond slightly increasing the startup time.

## Components
A component in Framing is simply a node module with extra metadata within the **package.json** and an `initialize` function in the `main` code file. Components are by definition singletons within Framing, i.e., each instance of a component interface is shared across all dependents.

### Locations
By default, components may be installed as node modules with `npm install` or by default be put into the **/components** folder. Framing will first search in the **/components** folder and then in the **node_modules** folder.

### Initialize Method
When the `initialize` method for the component executes, the component constructs the object interface for the component and returns the interface to Framing.

The initialize method can take two forms taking either a callback or returning a promise. For either, the first parameter, `imports` will be the dictionary of all dependencies keyed by their respective names for the component as they have been designated within the imports array of the framing metadata in the package.json.

If an exception is thrown directly within the initialize function's stack, Framing will catch and write the error to the standard out. However, if within an asynchronous function stack, the error will need to be passed through the callback or through the rejection of the promise. Otherwise, Framing will block waiting for the component to finish initializing. Once a component has errored, no additional components will initialize. Framing will wait for current components to finish with either resolved or rejected states and then return the error(s).

**Note:** Framing has no timeout; the application will wait until the components have all finished initializing or have thrown errors.

#### With Callback
The initialize method takes two arguments:
- `imports` - **dictionary** The components that the current component depends on.
- `callback` - **function** Called when the component is ready, taking two arguments:
  - `error` - **object** If an error has occurred.
  - `componentInterface` - **object** The interface to the object.

```
module.exports.initialize = (imports, callback) => {
  let logger = imports.logger;
  let someService = imports['some-service'];

  callback({
    doSomething: callback => someService.getData(callback)
  });
};
```

#### Returning Promise
The initialize method takes one argument:
- `imports` - **dictionary** The components that the current component depends on.

`return value` - **Promise** Resolve with the component interface or reject with an error.

```
module.exports.initialize = (imports) => {
  let logger = imports.logger;
  let someService = imports['some-service'];

  return Promise.resolve({
    doSomething: () => someService.getData()
  });
};
```

### Framing Metadata
The framing metadata is defined in the **package.json**. The metadata expresses the name of the component and what components are to be imported.

#### Component Name
A component has two mechanisms for identifying itself:
- `name` - **string** *required* This is the package name for the node module. Consider this property as the implementation name for the component.
- `framing.name` - **string** *optional* The Framing name should be considered as something akin to an interface name but without the interface contract.

```
{
  "name": "my-service",
  "framing": {
    "name": "service"
  }
}
```

#### Importing Components
Importing components within Framing only requires specifying the names of the dependency components. The dependencies will be exposed as a dictionary by import name.

- `framing.imports` - **array of strings** *optional*

```
{
  "framing": {
    "imports": [ "service", "logger" ]
  }
}
```

When a dependent imports the component, it may use either the package name or the framing name. Then the component passed into the imports dictionary will be keyed by the name given in the imports array.

## Application Startup
When the application is run and after Framing has completed the generation of the dependency graphs, the application can select a component or several components that identify the entry point(s) of the application. The initialization path will be constructed and then executed by iterating over the path's nodes. The execution will attempt to process through the path by initializing, in parallel, all subsequent node components that have had all of their dependencies satisfied.

### Setting Up Framing

```
require('framing')
  .setBaseDir(__dirname)
  .run();
```

## Command Line Arguments

- `--debug` - Enables debug mode for Framing. This just causes Framing to output data like what components it has found.

## Framing Object
### `setBaseDir()`
Sets the directory to begin the search for components.
#### Syntax
```
  framing.setBaseDir(path)
```
#### Parameters
- `path` - **string** The path (relative or absolute) from which to search for components.

### `run()`
Prompts Framing to build the dependency tree and execute the initialize method of all components within the tree.

Framing will automatically start all root level components in the dependency tree, but optionally the components that will be initialized may be set.
#### Syntax
```
  framing.run([entryPoint]);
```
#### Parameters
- `entryPoint` - **array of strings** Root component names to initialize.

## Examples

### Simple Component
#### package.json
```
{
  "name": "my-simple-component",
  "main": "index.js",
  "framing": {
    "name": "simple-component",
    "imports": []
  }
}
```
#### index.js
```
module.exports.initialize = (imports) => {
  return Promise.resolve({
    say: () => console.log('Hello, world!')
  });
};
```

### Simple Asynchronous Component
```
module.exports.initialize = (imports) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve({
        say: () => console.log('Hello, world!')
      });
    }, 250);
  });
};
```

### Throwing an Error
#### Synchronously
If the currently executing stack is not asynchronous, then it is okay to throw an error.
```
module.exports.initialize = (imports) => {
  throw new Error('fail');

  // ...
};
```

#### Asynchronously
However, if the currently executing stack is asynchronous, then the error must be passed back either by callback or promise.

**Note:** Be careful to not call the callback before the component is actually ready.
```
module.exports.initialize = (imports, callback) => {
  setTimeout(() => {
    callback(new Error('fail'));
  }, 250);
};
```

```
module.exports.initialize = (imports) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      reject(new Error('fail'));
    }, 250);
  });
};
```

## License
MIT

**©2016. Accusoft Corporation. All Rights Reserved.**


text:
#include "multiBlock/multiDataProcessorWrapper3D.h"
#include "multiBlock/multiBlockLattice3D.h"
#include "multiBlock/multiDataField3D.h"
#include "multiBlock/multiBlockOperations3D.h"
#include "atomicBlock/dataProcessor3D.h"
#include "core/plbDebug.h"

namespace plb {

/* *************** BoxProcessing3D, general case *************************** */

void applyProcessingFunctional(BoxProcessingFunctional3D* functional,
                               Box3D domain, std::vector<MultiBlock3D*> multiBlocks)
{
    executeDataProcessor( BoxProcessorGenerator3D(functional, domain),
                          multiBlocks );
}

void integrateProcessingFunctional(BoxProcessingFunctional3D* functional,
                                   Box3D domain,
                                   std::vector<MultiBlock3D*> multiBlocks,
                                   plint level)
{
    addInternalProcessor( BoxProcessorGenerator3D(functional, domain),
                          multiBlocks, level );
}

void integrateProcessingFunctional(BoxProcessingFunctional3D* functional, Box3D domain,
                                   MultiBlock3D& actor, std::vector<MultiBlock3D*> multiBlockArgs,
                                   plint level)
{
    addInternalProcessor( BoxProcessorGenerator3D(functional, domain),
                          actor, multiBlockArgs, level );
}

/* *************** DotProcessing, general case ***************************** */

void applyProcessingFunctional(DotProcessingFunctional3D* functional,
                               DotList3D const& dotList,
                               std::vector<MultiBlock3D*> multiBlocks)
{
    executeDataProcessor( DotProcessorGenerator3D(functional, dotList),
                          multiBlocks );
}

void integrateProcessingFunctional(DotProcessingFunctional3D* functional,
                                   DotList3D const& dotList,
                                   std::vector<MultiBlock3D*> multiBlocks,
                                   plint level)
{
    addInternalProcessor( DotProcessorGenerator3D(functional, dotList),
                          multiBlocks, level );
}

/* *************** BoundedBoxProcessing3D, general case *************************** */

void applyProcessingFunctional(BoundedBoxProcessingFunctional3D* functional,
                               Box3D domain, std::vector<MultiBlock3D*> multiBlocks,
                               plint boundaryWidth )
{
    std::vector<BoxProcessorGenerator3D*> generators;
    functional -> getGenerators(domain, boundaryWidth, generators);
    delete functional;
    for (pluint iGen=0; iGen<generators.size(); ++iGen) {
        executeDataProcessor( *generators[iGen], multiBlocks );
        delete generators[iGen];
    }
}

void integrateProcessingFunctional(BoundedBoxProcessingFunctional3D* functional,
                                   Box3D domain, std::vector<MultiBlock3D*> multiBlocks,
                                   plint boundaryWidth, plint level)
{
    std::vector<BoxProcessorGenerator3D*> generators;
    functional -> getGenerators(domain, boundaryWidth, generators);
    delete functional;
    for (pluint iGen=0; iGen<generators.size(); ++iGen) {
        addInternalProcessor( *generators[iGen], multiBlocks, level );
        delete generators[iGen];
    }
}

}  // namespace plb


text:
"""
This example shows the usage of superpixel segmentation. It shows
how each segmented superpixel individually. And also shows the usage
of colorWithClusterMeans() functions which draws superpixel in its
mean color
"""
print __doc__

from SimpleCV import Image
import time

img = Image("lenna")
sp = img.segmentSuperpixels(300, 30)
for superpixel in sp:
    superpixel.image.show()
    time.sleep(0.1)

sp.show()
time.sleep(3)
sp.colorWithClusterMeans().show()
time.sleep(3)


text:
package com.ebay.jetstream.event;

import java.util.Collection;

public interface BatchEventSink extends EventSink {
  void sendEvents(Collection<JetstreamEvent> events, EventMetaInfo meta) throws EventException;
}


text:
package org.moeaframework.analysis.sensitivity;

import java.util.Properties;

import org.moeaframework.core.NondominatedPopulation;
import org.moeaframework.util.TypedProperties;

/**
 * An entry in a result file.
 *
 * @see ResultFileWriter
 * @see ResultFileReader
 */
public class ResultEntry {

	/**
	 * The non-dominated population stored in this entry.
	 */
	private final NondominatedPopulation population;

	/**
	 * The auxiliary properties stored in this entry.
	 */
	private final Properties properties;

	/**
	 * Constructs a result file entry with the specified non-dominated
	 * population.
	 *
	 * @param population the non-dominated population stored in this entry
	 */
	public ResultEntry(NondominatedPopulation population) {
		this(population, new Properties());
	}

	/**
	 * Constructs a result file entry with the specified non-dominated
	 * population and auxiliary properties.
	 *
	 * @param population the non-dominated population stored in this entry
	 * @param properties the auxiliary properties stored in this entry
	 */
	public ResultEntry(NondominatedPopulation population,
			Properties properties) {
		super();
		this.population = population;
		this.properties = properties;
	}

	/**
	 * Constructs a result file entry with the specified non-dominated
	 * population and auxiliary properties.
	 *
	 * @param population the non-dominated population stored in this entry
	 * @param properties the auxiliary properties stored in this entry
	 */
	public ResultEntry(NondominatedPopulation population,
			TypedProperties properties) {
		this(population, properties == null ? null :
				properties.getProperties());
	}

	/**
	 * Returns the non-dominated population stored in this entry.
	 *
	 * @return the non-dominated population stored in this entry
	 */
	public NondominatedPopulation getPopulation() {
		return population;
	}

	/**
	 * Returns the auxiliary properties stored in this entry.
	 *
	 * @return the auxiliary properties stored in this entry
	 */
	public Properties getProperties() {
		return properties;
	}

}