text:
(function(){

	// To learn how to write Jasmine tests, please read Jasmine documentation:
	// https://github.com/pivotal/jasmine/wiki

	// ok
	//^\s*ok\(\s*([^,]+),\s*["]([^"]+)["]\s*\);
	//it("\2", function(){ expect(\1).toBeDefined(); });

	// equals
	//^\s*equals\(\s*([^,]+),\s*([^,]+),\s*["]([^"]+)["]\s*\);
	//it("\3", function(){ expect(\1).toEqual(\2); });

	// same
	//^\s*same\(\s*([^,]+),\s*([^,]+),\s*["]([^"]+)["]\s*\);
	//it("\3", function(){ expect(\1).toBeSameTiElementsAs(\2); });

	beforeEach(function(){
		//Ti.API.log('winchildren', win.children);

		this.addMatchers({
			toBeSameTiElementsAs: function(els) {

				function getUUID(el){
					return el._uuid;
				}

				var thisStr = (Array.isArray(this.actual) ? this.actual : [this.actual]).map(getUUID).join(', '),
					compStr = (Array.isArray(els) ? els : [els]).map(getUUID).join(', ');

				return thisStr === compStr;
			}
		});

		var els = [];
		Object.keys(K.elsByName).forEach(function(key){
			els.concat(K.elsByName[key]||[]);
		});
		els.forEach(function(el){
			el.getParent().remove(el);
		});

		/*(win.children||[]).forEach(function(child){
			win.remove(child);
		});*/

		K.reset();
	});

	describe('jQuery-Core', function() {

		describe('Basic requirements', function(){
			it('Array.push()', function(){ expect(Array.prototype.push).toBeDefined(); });
			it('Function.apply()', function(){ expect(Function.prototype.apply).toBeDefined(); });
			it('getElementById', function(){ expect(getElementById).toBeDefined(); });
			it('getElementsByTagName', function(){ expect(getElementsByTagName).toBeDefined(); });
			it('RegExp', function(){ expect(RegExp).toBeDefined(); });
			it('K', function(){ expect(K).toBeDefined(); });
		});

		describe('K()', function(){
			it("K() === K([])", function(){ expect(K().length).toEqual(0); });
			it("K(undefined) === K([])", function(){ expect(K(undefined).length).toEqual(0); });
			it("K(null) === K([])", function(){ expect(K(null).length).toEqual(0); });
			it("K('') === K([])", function(){ expect(K("").length).toEqual(0); });
			it("K('#') === K([])", function(){ expect(K("#").length).toEqual(0); });
		});

		describe('element connectors', function(){
			it("Free KElement hasn't parentNode", function(){ expect(K({ type: 'label' }).get(0).getParent()).toBeNull(); });
			it("Added KElement has parentNode", function(){ expect(K({ type: 'label' }).appendTo(win).get(0).getParent()._uuid).not.toBeUndefined(); });
			it("Added KElement has correct parentNode", function(){ expect(K({ type: 'label' }).appendTo(win).get(0).getParent()._uuid).toEqual(win._uuid); });

		});

		var labelBlueprints = [];
		for(var i = 0; i < 6; i++){ labelBlueprints.push({ width: 50, height: 50, top: i*10, left: 10*i, opacity: 0.3, backgroundColor: '#f00', type: 'label', text: i, className: 'lengthTest', id: 'label' + i }); }

		describe("length", function () {
		    it("Get Number of Elements Found", function () {
				K(labelBlueprints).appendTo(win);
		        expect(K(".lengthTest", win).length).toEqual(6);
		    });
		});

		describe("size()", function () {
		    it("Get Number of Elements Found", function () {
				K(labelBlueprints).appendTo(win);
		        expect(K(".lengthTest", win).size()).toEqual(6);
		    });
		});

		var getElBlueprints = [
			{ type: 'view', id: 'getView', className: 'getEl', backgroundColor: '#0f0' },
			{ type: 'label', id: 'getLabel', text: 'get()', className: 'getEl' },
			{ type: 'imageview', id: 'getImageView', className: 'getEl', image: 'http://krawaller.se/logo_mini.png' }
		];

		describe("get()", function () {
			it("Get All Elements", function(){
				var els = K(getElBlueprints).appendTo(win);
				expect(els.get()).toBeSameTiElementsAs(K.elsByClassName.getEl);
			});
		});

		describe("toArray()", function () {
			it("Convert K object to an Array", function(){
				var els = K(getElBlueprints).appendTo(win);
				expect(els.toArray()).toBeSameTiElementsAs(K.elsByClassName.getEl);
			});
		});

		describe("get(Number)", function () {
		    it("Get A Single Element", function () {
				K(labelBlueprints).appendTo(win);
		        expect(K("label").get(0)).toBeSameTiElementsAs(getElementById("label0"));
		    });

			it("Try get with index larger elements count", function(){
				expect(K('#label0').get(1)).toBeUndefined();
			});
		});

		describe("get(-Number)", function () {
		    it("Get a single element with negative index", function () {
				K(labelBlueprints).appendTo(win);
				var id = labelBlueprints[labelBlueprints.length - 1].id,
					el = getElementById(id);

		        expect(K("label").get(-1)).toBeSameTiElementsAs(el);
		    });

			it("Try get with index negative index larger then elements count", function(){
				expect(K('#label0').get(-2)).toBeUndefined();
			});
		});

		describe("each(Function)", function () {
		    it('Execute a function, Relative', function () {
				K(labelBlueprints).appendTo(win);

			    var div = K("label");
			    div.each(function () {
			        this.foo = 'zoo';
			    });
			    var pass = true;
			    for (var i = 0; i < div.size(); i++) {
			        if (div.get(i).foo != "zoo") pass = false;
			    }
		        expect(pass).toBeTruthy();
		    });
		});

		describe("slice()", function () {
			var $labels;
			beforeEach(function(){
				$labels = K(labelBlueprints).appendTo(win);
			});

			it("slice(1,2)", function(){
				expect($labels.slice(1,2).get()).toBeSameTiElementsAs(q('label1'));
			});
			it("slice(1)", function(){
				expect($labels.slice(1).get()).toBeSameTiElementsAs(q('label1, label2, label3, label4, label5'));
			});
			it("slice(0,3)", function(){
				expect($labels.slice(0,3).get()).toBeSameTiElementsAs(q('label0, label1, label2'));
			});

		    it("slice(-1)", function () {
				var id = labelBlueprints[labelBlueprints.length - 1].id,
					el = q(id);

				expect($labels.slice(-1).get()).toBeSameTiElementsAs(el);
		    });
		    it("eq(1)", function () {
		        expect($labels.eq(1).get()).toBeSameTiElementsAs(q(labelBlueprints[1].id));
		    });
		    it("eq('2')", function () {
		        expect($labels.eq('2').get()).toBeSameTiElementsAs(q(labelBlueprints[2].id));
		    });
		    it("eq(-1)", function () {
		        expect($labels.eq(-1).get()).toBeSameTiElementsAs(q(labelBlueprints[labelBlueprints.length - 1].id));
		    });
		});

		describe("first()/last()", function () {
			var $labels,
				$none;
			beforeEach(function(){
				$labels = K(labelBlueprints).appendTo(win);
				$none = K('none');
			});

		    it("first()", function () {
		        expect($labels.first().get()).toBeSameTiElementsAs(q("label0"));
		    });
		    it("last()", function () {
		        expect($labels.last().get()).toBeSameTiElementsAs(q("label5"));
		    });
		    it("first() none", function () {
		        expect($none.first().get()).toBeSameTiElementsAs([]);
		    });
		    it("last() none", function () {
		        expect($none.last().get()).toBeSameTiElementsAs([]);
		    });
		});

		/*describe("map()", function () {

		    same(
		    K("#ap").map(function () {
		        return K(this).find("a").get();
		    }).get(), q("google", "groups", "anchor1", "mark"), "Array Map");

		    same(
		    K("#ap > a").map(function () {
		        return this.parentNode;
		    }).get(), q("ap", "ap", "ap"), "Single Map");

		    //for #2616
		    var keys = K.map({
		        a: 1,
		        b: 2
		    }, function (v, k) {
		        return k;
		    });
		    it("Map the keys from a hash to an array", function () {
		        expect(keys.join("")).toEqual("ab");
		    });

		    var values = K.map({
		        a: 1,
		        b: 2
		    }, function (v, k) {
		        return v;
		    });
		    it("Map the values from a hash to an array", function () {
		        expect(values.join("")).toEqual("12");
		    });

		    // object with length prop
		    var values = K.map({
		        a: 1,
		        b: 2,
		        length: 3
		    }, function (v, k) {
		        return v;
		    });
		    it("Map the values from a hash with a length property to an array", function () {
		        expect(values.join("")).toEqual("123");
		    });

		    var scripts = document.getElementsByTagName("script");
		    var mapped = K.map(scripts, function (v, k) {
		        return v;
		    });
		    it("Map an array(-like) to a hash", function () {
		        expect(mapped.length).toEqual(scripts.length);
		    });

		    var flat = K.map(Array(4), function (v, k) {
		        return k % 2 ? k : [k, k, k]; //try mixing array and regular returns
		    });
		    it("try the new flatten technique(#2616)", function () {
		        expect(flat.join("")).toEqual("00012223");
		    });
		});*/

		/*describe("K.merge()", function () {

		    var parse = K.merge;

		    same(parse([], []), [], "Empty arrays");

		    same(parse([1], [2]), [1, 2], "Basic");
		    same(parse([1, 2], [3, 4]), [1, 2, 3, 4], "Basic");

		    same(parse([1, 2], []), [1, 2], "Second empty");
		    same(parse([], [1, 2]), [1, 2], "First empty");

		    // Fixed at [5998], #3641
		    same(parse([-2, -1], [0, 1, 2]), [-2, -1, 0, 1, 2], "Second array including a zero (falsy)");

		    // After fixing #5527
		    same(parse([], [null, undefined]), [null, undefined], "Second array including null and undefined values");
		    same(parse({
		        length: 0
		    }, [1, 2]), {
		        length: 2,
		        0: 1,
		        1: 2
		    }, "First array like");
		});

		describe("K.extend(Object, Object)", function () {

		    var settings = {
		        xnumber1: 5,
		        xnumber2: 7,
		        xstring1: "peter",
		        xstring2: "pan"
		    },
		        options = {
		            xnumber2: 1,
		            xstring2: "x",
		            xxx: "newstring"
		        },
		        optionsCopy = {
		            xnumber2: 1,
		            xstring2: "x",
		            xxx: "newstring"
		        },
		        merged = {
		            xnumber1: 5,
		            xnumber2: 1,
		            xstring1: "peter",
		            xstring2: "x",
		            xxx: "newstring"
		        },
		        deep1 = {
		            foo: {
		                bar: true
		            }
		        },
		        deep1copy = {
		            foo: {
		                bar: true
		            }
		        },
		        deep2 = {
		            foo: {
		                baz: true
		            },
		            foo2: document
		        },
		        deep2copy = {
		            foo: {
		                baz: true
		            },
		            foo2: document
		        },
		        deepmerged = {
		            foo: {
		                bar: true,
		                baz: true
		            },
		            foo2: document
		        },
		        arr = [1, 2, 3],
		        nestedarray = {
		            arr: arr
		        };

		    K.extend(settings, options);
		    it("Check if extended: settings must be extended", function () {
		        expect(settings).toBe(merged);
		    });
		    it("Check if not modified: options must not be modified", function () {
		        expect(options).toBe(optionsCopy);
		    });

		    K.extend(settings, null, options);
		    it("Check if extended: settings must be extended", function () {
		        expect(settings).toBe(merged);
		    });
		    it("Check if not modified: options must not be modified", function () {
		        expect(options).toBe(optionsCopy);
		    });

		    K.extend(true, deep1, deep2);
		    it("Check if foo: settings must be extended", function () {
		        expect(deep1.foo).toBe(deepmerged.foo);
		    });
		    it("Check if not deep2: options must not be modified", function () {
		        expect(deep2.foo).toBe(deep2copy.foo);
		    });
		    it("Make sure that a deep clone was not attempted on the document", function () {
		        expect(deep1.foo2).toEqual(document);
		    });

		    ok(K.extend(true, {}, nestedarray).arr !== arr, "Deep extend of object must clone child array");

		    // #5991
		    ok(K.isArray(K.extend(true, {
		        arr: {}
		    }, nestedarray).arr), "Cloned array heve to be an Array");
		    ok(K.isPlainObject(K.extend(true, {
		        arr: arr
		    }, {
		        arr: {}
		    }).arr), "Cloned object heve to be an plain object");

		    var empty = {};
		    var optionsWithLength = {
		        foo: {
		            length: -1
		        }
		    };
		    K.extend(true, empty, optionsWithLength);
		    it("The length property must copy correctly", function () {
		        expect(empty.foo).toBe(optionsWithLength.foo);
		    });

		    empty = {};
		    var optionsWithDate = {
		        foo: {
		            date: new Date
		        }
		    };
		    K.extend(true, empty, optionsWithDate);
		    it("Dates copy correctly", function () {
		        expect(empty.foo).toBe(optionsWithDate.foo);
		    });

		    var myKlass = function () {};
		    var customObject = new myKlass();
		    var optionsWithCustomObject = {
		        foo: {
		            date: customObject
		        }
		    };
		    empty = {};
		    K.extend(true, empty, optionsWithCustomObject);
		    it("Custom objects copy correctly (no methods)", function () {
		        expect(empty.foo && empty.foo.date === customObject).toBeDefined();
		    });

		    // Makes the class a little more realistic
		    myKlass.prototype = {
		        someMethod: function () {}
		    };
		    empty = {};
		    K.extend(true, empty, optionsWithCustomObject);
		    it("Custom objects copy correctly", function () {
		        expect(empty.foo && empty.foo.date === customObject).toBeDefined();
		    });

		    var ret = K.extend(true, {
		        foo: 4
		    }, {
		        foo: new Number(5)
		    });
		    it("Wrapped numbers copy correctly", function () {
		        expect(ret.foo == 5).toBeDefined();
		    });

		    var nullUndef;
		    nullUndef = K.extend({}, options, {
		        xnumber2: null
		    });
		    it("Check to make sure null values are copied", function () {
		        expect(nullUndef.xnumber2 === null).toBeDefined();
		    });

		    nullUndef = K.extend({}, options, {
		        xnumber2: undefined
		    });
		    it("Check to make sure undefined values are not copied", function () {
		        expect(nullUndef.xnumber2 === options.xnumber2).toBeDefined();
		    });

		    nullUndef = K.extend({}, options, {
		        xnumber0: null
		    });
		    it("Check to make sure null values are inserted", function () {
		        expect(nullUndef.xnumber0 === null).toBeDefined();
		    });

		    var target = {};
		    var recursive = {
		        foo: target,
		        bar: 5
		    };
		    K.extend(true, target, recursive);
		    it("Check to make sure a recursive obj doesn't go never-ending loop by not copying it over", function () {
		        expect(target).toBe({
		            bar: 5
		        });
		    });

		    var ret = K.extend(true, {
		        foo: []
		    }, {
		        foo: [0]
		    }); // 1907
		    it("Check to make sure a value with coersion 'false' copies over when necessary to fix #1907", function () {
		        expect(ret.foo.length).toEqual(1);
		    });

		    var ret = K.extend(true, {
		        foo: "1,2,3"
		    }, {
		        foo: [1, 2, 3]
		    });
		    it("Check to make sure values equal with coersion (but not actually equal) overwrite correctly", function () {
		        expect(typeof ret.foo != "string").toBeDefined();
		    });

		    var ret = K.extend(true, {
		        foo: "bar"
		    }, {
		        foo: null
		    });
		    it("Make sure a null value doesn't crash with deep extend, for #1908", function () {
		        expect(typeof ret.foo !== 'undefined').toBeDefined();
		    });

		    var obj = {
		        foo: null
		    };
		    K.extend(true, obj, {
		        foo: "notnull"
		    });
		    it("Make sure a null value can be overwritten", function () {
		        expect(obj.foo).toEqual("notnull");
		    });

		    function func() {}
		    K.extend(func, {
		        key: "value"
		    });
		    it("Verify a function can be extended", function () {
		        expect(func.key).toEqual("value");
		    });

		    var defaults = {
		        xnumber1: 5,
		        xnumber2: 7,
		        xstring1: "peter",
		        xstring2: "pan"
		    },
		        defaultsCopy = {
		            xnumber1: 5,
		            xnumber2: 7,
		            xstring1: "peter",
		            xstring2: "pan"
		        },
		        options1 = {
		            xnumber2: 1,
		            xstring2: "x"
		        },
		        options1Copy = {
		            xnumber2: 1,
		            xstring2: "x"
		        },
		        options2 = {
		            xstring2: "xx",
		            xxx: "newstringx"
		        },
		        options2Copy = {
		            xstring2: "xx",
		            xxx: "newstringx"
		        },
		        merged2 = {
		            xnumber1: 5,
		            xnumber2: 1,
		            xstring1: "peter",
		            xstring2: "xx",
		            xxx: "newstringx"
		        };

		    var settings = K.extend({}, defaults, options1, options2);
		    it("Check if extended: settings must be extended", function () {
		        expect(settings).toBe(merged2);
		    });
		    it("Check if not modified: options1 must not be modified", function () {
		        expect(defaults).toBe(defaultsCopy);
		    });
		    it("Check if not modified: options1 must not be modified", function () {
		        expect(options1).toBe(options1Copy);
		    });
		    it("Check if not modified: options2 must not be modified", function () {
		        expect(options2).toBe(options2Copy);
		    });
		});

		describe("K.proxy", function () {

		    var test = function () {
		        equals(this, thisObject, "Make sure that scope is set properly.");
		    };
		    var thisObject = {
		        foo: "bar",
		        method: test
		    };

		    // Make sure normal works
		    test.call(thisObject);

		    // Basic scoping
		    K.proxy(test, thisObject)();

		    // Make sure it doesn't freak out
		    equals(K.proxy(null, thisObject), undefined, "Make sure no function was returned.");

		    // Partial application
		    var test2 = function (a) {
		        equals(a, "pre-applied", "Ensure arguments can be pre-applied.");
		    };
		    K.proxy(test2, null, "pre-applied")();

		    // Partial application w/ normal arguments
		    var test3 = function (a, b) {
		        equals(b, "normal", "Ensure arguments can be pre-applied and passed as usual.");
		    };
		    K.proxy(test3, null, "pre-applied")("normal");

		    // Test old syntax
		    var test4 = {
		        meth: function (a) {
		            equals(a, "boom", "Ensure old syntax works.");
		        }
		    };
		    K.proxy(test4, "meth")("boom");
		});

		it('get predefined label text', function() {
			expect(K({ type: 'label', text: 'labelText' }).text()).toBe('labelText');
		});

		it('set label text', function() {
			expect(K({ type: 'label' }).text('setLabelText').text()).toBe('setLabelText');
		});*/

	});

})();


text:
layout: post
title:  "2001, James and Zhang, A Way to Search for Multiferroic Materials with "Unlikely" Combinations of Physical Properties"
date:   2017-04-17
author: "Joephy"
header-img: "img/post-bg-os-metro.jpg"
catalog: true
tag:
- Martensite Phase Transformation/马氏体相变
comments: true
---
Martensite phase transition
-----------

1. Good fitting of phases will decrease the strain energy and interface energy;
2. First-order phase transformation will generate a change of lattice parameters;
3. If the phase transformation is highly reversible, it is a diffusionless phase transition;
4. Property of material is sensitivity to changes of lattice parameters;
5. det(U) = 1 means no volume change. $\lambda_2 = 1$ will avoid the interfacial energy;
6. According to 3 conditions, we can find material more easily;
7. If satisfy cofactor condition, fraction can change freely and still compatible.

Reference:

[Planes, Antoni, and Lluís Mañosa. Magnetism and structure in functional materials. Ed. Avadh Saxena. Vol. 1. New York: Springer, 2005.](http://download.springer.com/static/pdf/780/bok%253A978-3-540-31631-2.pdf?originUrl=http%3A%2F%2Flink.springer.com%2Fbook%2F10.1007%2F3-540-31631-0&token2=exp=1494052019~acl=%2Fstatic%2Fpdf%2F780%2Fbok%25253A978-3-540-31631-2.pdf%3ForiginUrl%3Dhttp%253A%252F%252Flink.springer.com%252Fbook%252F10.1007%252F3-540-31631-0*~hmac=7e3786cd764230be9c89792b927cf454bfe3181c12a4ffc213f54661ffe65526)

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace BindableApplicationBar.TestApp.ViewModels
{
    public class PropertyBindingTestViewModel : ViewModel
    {
        private const int XamlDefinedButtonsCount = 2;
        private const int XamlDefinedMenuItemsCount = 2;
        private readonly List<ApplicationBarIconButton> nonBindableButtons = new List<ApplicationBarIconButton>();
        private readonly List<ApplicationBarMenuItem> nonBindableMenuItems = new List<ApplicationBarMenuItem>();

        #region IconUri
        private Uri iconUri = new Uri("/Icons/Dark/appbar.add.rest.png", UriKind.RelativeOrAbsolute);

        public Uri IconUri
        {
            get
            {
                if(FirstIconChoice)
                {
                    this.iconUri = new Uri("/Icons/Dark/appbar.add.rest.png", UriKind.RelativeOrAbsolute);
                }

                if(SecondIconChoice)
                {
                    this.iconUri = new Uri("/Icons/Dark/appbar.minus.rest.png", UriKind.RelativeOrAbsolute);
                }

                return this.iconUri;
            }
        }
        #endregion

        #region FirstIconChoice
        private bool firstIconChoice = true;

        public bool FirstIconChoice
        {
            get { return this.firstIconChoice; }
            set
            {
                if(this.firstIconChoice != value)
                {
                    this.firstIconChoice = value;
                    RaisePropertyChanged("FirstIconChoice");
                    RaisePropertyChanged("IconUri");
                }
            }
        }
        #endregion

        #region SecondIconChoice
        private bool secondIconChoice;

        public bool SecondIconChoice
        {
            get { return this.secondIconChoice; }
            set
            {
                if(this.secondIconChoice != value)
                {
                    this.secondIconChoice = value;
                    RaisePropertyChanged("SecondIconChoice");
                    RaisePropertyChanged("IconUri");
                }
            }
        }
        #endregion

        #region IconButtonText
        private string iconButtonText = "XAML Btn 1";

        public string IconButtonText
        {
            get { return this.iconButtonText; }
            set
            {
                if(this.iconButtonText != value)
                {
                    this.iconButtonText = value;
                    RaisePropertyChanged("IconButtonText");
                }
            }
        }
        #endregion

        #region MenuItemText
        private string menuItemText = "XAML MnuIt 1";

        public string MenuItemText
        {
            get { return this.menuItemText; }
            set
            {
                if(this.menuItemText != value)
                {
                    this.menuItemText = value;
                    RaisePropertyChanged("MenuItemText");
                }
            }
        }
        #endregion

        #region BarIsVisible
        private bool barIsVisible = true;

        public bool BarIsVisible
        {
            get { return this.barIsVisible; }
            set
            {
                if(this.barIsVisible != value)
                {
                    this.barIsVisible = value;
                    RaisePropertyChanged("BarIsVisible");
                }
            }
        }
        #endregion

        #region Opacity
        private double opacity = 0.75;

        public double Opacity
        {
            get { return this.opacity; }
            set
            {
                if(this.opacity != value)
                {
                    this.opacity = value;
                    RaisePropertyChanged("Opacity");
                }
            }
        }
        #endregion

        #region ForegroundColor
        private double foregroundColor = 0.90;

        public double ForegroundColor
        {
            get { return this.foregroundColor; }
            set
            {
                if(this.foregroundColor != value)
                {
                    this.foregroundColor = value;
                    RaisePropertyChanged("ForegroundColor");
                }
            }
        }
        #endregion

        #region BackgroundColor
        private double backgroundColor = 0.001;

        public double BackgroundColor
        {
            get { return this.backgroundColor; }
            set
            {
                if(this.backgroundColor != value)
                {
                    this.backgroundColor = value;
                    RaisePropertyChanged("BackgroundColor");
                }
            }
        }
        #endregion

        #region IsMenuVisible
        private bool isMenuVisible;

        public bool IsMenuVisible
        {
            get { return this.isMenuVisible; }
            set
            {
                if(this.isMenuVisible != value)
                {
                    this.isMenuVisible = value;
                    RaisePropertyChanged("IsMenuVisible");
                }
            }
        }
        #endregion

        #region IsMenuEnabled
        private bool isMenuEnabled = true;

        public bool IsMenuEnabled
        {
            get { return this.isMenuEnabled; }
            set
            {
                if(this.isMenuEnabled != value)
                {
                    this.isMenuEnabled = value;
                    RaisePropertyChanged("IsMenuEnabled");
                }
            }
        }
        #endregion

        #region ModeBool
        private bool modeBool = true;

        public bool ModeBool
        {
            get { return this.modeBool; }
            set
            {
                if(this.modeBool != value)
                {
                    this.modeBool = value;
                    RaisePropertyChanged("ModeBool");
                    RaisePropertyChanged("Mode");
                    RaisePropertyChanged("ModeString");
                }
            }
        }
        #endregion

        #region Mode
        public ApplicationBarMode Mode
        {
            get { return ModeBool ? ApplicationBarMode.Default : ApplicationBarMode.Minimized; }
        }
        #endregion

        #region ModeString
        public string ModeString
        {
            get { return Mode.ToString(); }
        }
        #endregion

        #region ButtonIsEnabled
        private bool buttonIsEnabled;

        public bool ButtonIsEnabled
        {
            get { return this.buttonIsEnabled; }
            set
            {
                if(this.buttonIsEnabled != value)
                {
                    this.buttonIsEnabled = value;
                    RaisePropertyChanged("ButtonIsEnabled");
                }
            }
        }
        #endregion

        #region MenuItemIsEnabled
        private bool menuItemIsEnabled;

        public bool MenuItemIsEnabled
        {
            get { return this.menuItemIsEnabled; }
            set
            {
                if(this.menuItemIsEnabled != value)
                {
                    this.menuItemIsEnabled = value;
                    RaisePropertyChanged("MenuItemIsEnabled");
                }
            }
        }
        #endregion

        public ICommand TestCommand { get; private set; }

        #region TestCommandParameter
        private bool testCommandParameter;

        public bool TestCommandParameter
        {
            get { return this.testCommandParameter; }
            set
            {
                if(this.testCommandParameter != value)
                {
                    this.testCommandParameter = value;
                    RaisePropertyChanged("TestCommandParameter");
                }
            }
        }
        #endregion

        public ICommand TestCommand2 { get; private set; }

        #region TestCommand2Parameter
        private bool testCommand2Parameter;

        public bool TestCommand2Parameter
        {
            get { return this.testCommand2Parameter; }
            set
            {
                if(this.testCommand2Parameter != value)
                {
                    this.testCommand2Parameter = value;
                    RaisePropertyChanged("TestCommand2Parameter");
                }
            }
        }
        #endregion

        public ObservableCollection<MenuItemViewModel> MenuItems { get; private set; }
        public ObservableCollection<ButtonViewModel> Buttons { get; private set; }

        public PropertyBindingTestViewModel()
        {
            TestCommand = new DelegateCommand(
                p => MessageBox.Show("Tapped button when parameter checkbox was checked"),
                p => p is bool && (bool)p);
            TestCommand2 = new DelegateCommand(
                p => MessageBox.Show("Tapped menu item when parameter checkbox was checked"),
                p => p is bool && (bool)p);

            MenuItems = new ObservableCollection<MenuItemViewModel>();

            for (int i = 0; i < 45; i++)
            {
                AddMenuItemViewModel();
            }

            Buttons = new ObservableCollection<ButtonViewModel>();

            for (int i = 0; i < 2; i++)
            {
                AddButtonViewModel();
            }
        }

        private void AddMenuItemViewModel()
        {
            int j = MenuItems.Count;

            MenuItems.Add(
                new MenuItemViewModel
                {
                    Command = new DelegateCommand(
                        p =>
                        {
                            MessageBox.Show("MenuItem " + j);

                            for (int k = 0; k < MenuItems.Count; k++)
                            {
                                MenuItems[k].CommandParameter =
                                    (int)MenuItems[k].CommandParameter + 1;
                            }
                        },
                        p => (int)(p ?? 0) % 2 == 0),
                    CommandParameter = j,
                    Text = "MenuItem " + j
                });
            AddMenuItemCommand.RaiseCanExecuteChanged();
            AddNonBindableMenuItemCommand.RaiseCanExecuteChanged();
            RemoveMenuItemCommand.RaiseCanExecuteChanged();
            RemoveNonBindableMenuItemCommand.RaiseCanExecuteChanged();
        }

        private void AddButtonViewModel()
        {
            int j = Buttons.Count;

            Buttons.Add(
                new ButtonViewModel
                {
                    Command = new DelegateCommand(
                        p =>
                        {
                            MessageBox.Show("Button " + j);

                            for (int k = 0; k < Buttons.Count; k++)
                            {
                                Buttons[k].CommandParameter =
                                    (int)Buttons[k].CommandParameter + 1;
                            }
                        },
                        p => (int)(p ?? 0) % 2 == 0),
                    CommandParameter = j,
                    IconUri =
                        j % 2 == 0
                            ? new Uri("/Icons/Dark/appbar.back.rest.png", UriKind.Relative)
                            : new Uri("/Icons/Dark/appbar.next.rest.png", UriKind.Relative),
                    Text = "Button " + j
                });
            AddButtonCommand.RaiseCanExecuteChanged();
            AddNonBindableButtonCommand.RaiseCanExecuteChanged();
            RemoveButtonCommand.RaiseCanExecuteChanged();
            RemoveNonBindableButtonCommand.RaiseCanExecuteChanged();
        }

        #region AddButtonCommand
        private DelegateCommand addButtonCommand;
        public DelegateCommand AddButtonCommand
        {
            get
            {
                return addButtonCommand ?? (addButtonCommand = new DelegateCommand(AddButton, CanAddButton));
            }
        }

        private void AddButton(object parameter)
        {
            AddButtonViewModel();
        }

        private bool CanAddButton(object parameter)
        {
            return XamlDefinedButtonsCount + Buttons.Count + nonBindableButtons.Count < 4;
        }
        #endregion

        #region RemoveButtonCommand
        private DelegateCommand removeButtonCommand;
        public DelegateCommand RemoveButtonCommand
        {
            get
            {
                return removeButtonCommand ?? (removeButtonCommand = new DelegateCommand(RemoveButton, CanRemoveButton));
            }
        }

        private void RemoveButton(object parameter)
        {
            Buttons.RemoveAt(Buttons.Count - 1);
            AddButtonCommand.RaiseCanExecuteChanged();
            AddNonBindableButtonCommand.RaiseCanExecuteChanged();
            RemoveButtonCommand.RaiseCanExecuteChanged();
            RemoveNonBindableButtonCommand.RaiseCanExecuteChanged();
        }

        private bool CanRemoveButton(object parameter)
        {
            return Buttons.Count > 0;
        }
        #endregion

        #region AddNonBindableButtonCommand
        private DelegateCommand addNonBundableButtonCommand;
        public DelegateCommand AddNonBindableButtonCommand
        {
            get
            {
                return addNonBundableButtonCommand ?? (addNonBundableButtonCommand = new DelegateCommand(AddNonBindableButton, CanAddNonBindableButton));
            }
        }

        private bool CanAddNonBindableButton(object parameter)
        {
            return XamlDefinedButtonsCount + Buttons.Count + nonBindableButtons.Count < 4;
        }

        private void AddNonBindableButton(object parameter)
        {
            var page = (PhoneApplicationPage)parameter;
            var bar = page.ApplicationBar;
            var button = new ApplicationBarIconButton(
                new Uri("/Icons/Dark/appbar.add.rest.png", UriKind.RelativeOrAbsolute));
            button.Text = "NonBound " + nonBindableButtons.Count;
            nonBindableButtons.Add(button);
            bar.Buttons.Add(button);

            AddButtonCommand.RaiseCanExecuteChanged();
            AddNonBindableButtonCommand.RaiseCanExecuteChanged();
            RemoveButtonCommand.RaiseCanExecuteChanged();
            RemoveNonBindableButtonCommand.RaiseCanExecuteChanged();
        }
        #endregion

        #region RemoveNonBindableButtonCommand
        private DelegateCommand removeNonBindableButtonCommand;
        public DelegateCommand RemoveNonBindableButtonCommand
        {
            get
            {
                return removeNonBindableButtonCommand ?? (removeNonBindableButtonCommand =
                    new DelegateCommand(RemoveNonBindableButton, CanRemoveNonBindableButton));
            }
        }

        private bool CanRemoveNonBindableButton(object parameter)
        {
            return nonBindableButtons.Count > 0;
        }

        private void RemoveNonBindableButton(object parameter)
        {
            var button = nonBindableButtons[nonBindableButtons.Count - 1];
            nonBindableButtons.Remove(button);
            var page = (PhoneApplicationPage)parameter;
            var bar = page.ApplicationBar;
            bar.Buttons.Remove(button);

            AddButtonCommand.RaiseCanExecuteChanged();
            AddNonBindableButtonCommand.RaiseCanExecuteChanged();
            RemoveButtonCommand.RaiseCanExecuteChanged();
            RemoveNonBindableButtonCommand.RaiseCanExecuteChanged();
        }
        #endregion

        #region AddMenuItemCommand
        private DelegateCommand addMenuItemCommand;
        public DelegateCommand AddMenuItemCommand
        {
            get
            {
                return addMenuItemCommand ?? (addMenuItemCommand = new DelegateCommand(AddMenuItem, CanAddMenuItem));
            }
        }

        private void AddMenuItem(object parameter)
        {
            AddMenuItemViewModel();
        }

        private bool CanAddMenuItem(object parameter)
        {
            return XamlDefinedMenuItemsCount + MenuItems.Count + nonBindableMenuItems.Count < 50;
        }
        #endregion

        #region RemoveMenuItemCommand
        private DelegateCommand removeMenuItemCommand;
        public DelegateCommand RemoveMenuItemCommand
        {
            get
            {
                return removeMenuItemCommand ?? (removeMenuItemCommand = new DelegateCommand(RemoveMenuItem, CanRemoveMenuItem));
            }
        }

        private void RemoveMenuItem(object parameter)
        {
            MenuItems.RemoveAt(MenuItems.Count - 1);
            AddMenuItemCommand.RaiseCanExecuteChanged();
            AddNonBindableMenuItemCommand.RaiseCanExecuteChanged();
            RemoveMenuItemCommand.RaiseCanExecuteChanged();
            RemoveNonBindableMenuItemCommand.RaiseCanExecuteChanged();
        }

        private bool CanRemoveMenuItem(object parameter)
        {
            return MenuItems.Count > 0;
        }
        #endregion

        #region AddNonBindableMenuItemCommand
        private DelegateCommand addNonBundableMenuItemCommand;
        public DelegateCommand AddNonBindableMenuItemCommand
        {
            get
            {
                return addNonBundableMenuItemCommand ?? (addNonBundableMenuItemCommand = new DelegateCommand(AddNonBindableMenuItem, CanAddNonBindableMenuItem));
            }
        }

        private bool CanAddNonBindableMenuItem(object parameter)
        {
            return XamlDefinedMenuItemsCount + MenuItems.Count + nonBindableMenuItems.Count < 50;
        }

        private void AddNonBindableMenuItem(object parameter)
        {
            var page = (PhoneApplicationPage)parameter;
            var bar = page.ApplicationBar;
            var menuItem = new ApplicationBarMenuItem { Text = "NonBound " + nonBindableMenuItems.Count };
            nonBindableMenuItems.Add(menuItem);
            bar.MenuItems.Add(menuItem);

            AddMenuItemCommand.RaiseCanExecuteChanged();
            AddNonBindableMenuItemCommand.RaiseCanExecuteChanged();
            RemoveMenuItemCommand.RaiseCanExecuteChanged();
            RemoveNonBindableMenuItemCommand.RaiseCanExecuteChanged();
        }
        #endregion

        #region RemoveNonBindableMenuItemCommand
        private DelegateCommand removeNonBindableMenuItemCommand;
        public DelegateCommand RemoveNonBindableMenuItemCommand
        {
            get
            {
                return removeNonBindableMenuItemCommand ?? (removeNonBindableMenuItemCommand =
                    new DelegateCommand(RemoveNonBindableMenuItem, CanRemoveNonBindableMenuItem));
            }
        }

        private bool CanRemoveNonBindableMenuItem(object parameter)
        {
            return nonBindableMenuItems.Count > 0;
        }

        private void RemoveNonBindableMenuItem(object parameter)
        {
            var menuItem = nonBindableMenuItems[nonBindableMenuItems.Count - 1];
            nonBindableMenuItems.Remove(menuItem);
            var page = (PhoneApplicationPage)parameter;
            var bar = page.ApplicationBar;
            bar.MenuItems.Remove(menuItem);

            AddMenuItemCommand.RaiseCanExecuteChanged();
            AddNonBindableMenuItemCommand.RaiseCanExecuteChanged();
            RemoveMenuItemCommand.RaiseCanExecuteChanged();
            RemoveNonBindableMenuItemCommand.RaiseCanExecuteChanged();
        }
        #endregion
    }
}


text:
var spawn = require("child_process").spawn
var execFile = require("child_process").execFile

var child = spawn("ls", ["-lF", "/rooot"])

child.stdout.on("data", function (data) {
  console.log("spawnSTDOUT:", JSON.stringify(data))
})

child.stderr.on("data", function (data) {
  console.log("spawnSTDERR:", JSON.stringify(data))
})

child.on("exit", function (code) {
  console.log("spawnEXIT:", code)
})

//child.kill("SIGKILL")

execFile("ls", ["-lF", "/usr"], null, function (err, stdout, stderr) {
  console.log("execFileSTDOUT:", JSON.stringify(stdout))
  console.log("execFileSTDERR:", JSON.stringify(stderr))
})

setTimeout(function () {
  phantom.exit(0)
}, 2000)


text:
Imports System.Data.OleDb

Public Class newTeam
    Public editor As Boolean = False
    Dim panelColor As Color = Color.CadetBlue
    Dim listAthletes As New List(Of athlete) 'Master list
    Dim listSorted As New List(Of athlete) 'Actual list displayed
    Dim listSearched As New List(Of athlete)
    Dim listSelected As New List(Of athlete) 'People selected

    Private Sub newTeam_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        listAthletes = populate(listAthletes) 'Populate with athletes
        If editor = True Then
            loadMembers()
            txtTeamName.Text = manageTeams.target.Name
            cmbAgeGroup.SelectedItem = manageTeams.target.Tag
        End If
        listSorted = listAthletes.FindAll(Function(x) x.ageGroup = cmbAgeGroup.SelectedItem)
        listSearched.AddRange(listSorted)
        fillPanels(flpSelected, "sel", listSelected)
        fillPanels(flpAthletes, "", listSorted)
    End Sub

    Private Sub loadMembers()
        Dim temp As String = ""
        Using conn As New OleDbConnection(dataPath + "\Athlete.accdb")
            conn.Open()
            Using cmd As New OleDbCommand("SELECT Members FROM teamDb WHERE Team = '" + manageTeams.target.Name + "'", conn)
                Using dr = cmd.ExecuteReader()
                    If dr.HasRows Then
                        Do While dr.Read()
                            For i = 1 To dr("Members").Length - 1
                                If dr("Members")(i) = ";" And temp.Length > 1 Then 'Check for the leading separator
                                    Using cmd2 As New OleDbCommand("SELECT RollClass, FirstName, LastName, AgeGroup FROM athleteDb WHERE ID = " + temp, conn) 'Load athlete details
                                        Using dr2 = cmd2.ExecuteReader()
                                            If dr2.HasRows Then
                                                Do While dr2.Read()
                                                    Dim ath As New athlete
                                                    ath.ID = temp
                                                    ath.fName = dr2("FirstName")
                                                    ath.lName = dr2("LastName")
                                                    ath.roll = dr2("RollClass")
                                                    ath.ageGroup = dr2("AgeGroup")
                                                    listSelected.Add(ath)
                                                    Dim athRem As athlete = listAthletes.Find(Function(x) x.ID = temp)
                                                    listAthletes.Remove(athRem)
                                                Loop
                                            End If
                                        End Using
                                    End Using
                                    temp = ""
                                Else
                                    temp += dr("Members")(i)
                                End If
                            Next
                        Loop
                    End If
                End Using
            End Using
        End Using
    End Sub

    Private Sub cmbAgeGroup_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbAgeGroup.SelectedIndexChanged
        If cmbAgeGroup.SelectedItem = "All" Then
            listSorted = listAthletes
        Else
            listSorted = listAthletes.FindAll(Function(x) x.ageGroup = cmbAgeGroup.SelectedItem) 'Filter by age group
        End If
        listSorted = sort(cmbSort, listSorted)
        listSearched = updateSearched(listSearched, listSorted)
        fillPanels(flpAthletes, "", listSearched)
    End Sub

    Private Sub cmbSort_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbSort.SelectedIndexChanged
        listSorted = sort(cmbSort, listSorted)
        listSearched = updateSearched(listSearched, listSorted)
        fillPanels(flpAthletes, "", listSearched)
    End Sub

    Private Sub fillPanels(flp As FlowLayoutPanel, tag As String, list As List(Of athlete))
        flp.Controls.Clear() 'Filling panels
        For Each ath As athlete In list
            Dim newpanel As New Panel With
                {
                .Margin = New Padding(3, 3, 3, 3),
                .Height = 55,
                .Width = 140,
                .BackColor = panelColor,
                .Name = ath.ID,
                .Tag = tag
                }

            Dim ID As New Label With
                {
                .Text = ath.ID,
                .Font = New Font("Segoe UI", 9, FontStyle.Bold),
                .Height = 15,
                .Location = New Point(0, 0),
                .Name = ath.ID + ".ID"
                }

            Dim roll As New Label With
                {
                .Text = ath.roll,
                .Font = New Font("Segoe UI", 8),
                .Height = 13,
                .Location = New Point(0, 15),
                .Name = ath.ID.ToString + ".roll"
                }

            Dim lName As New Label With
                {
                .Text = ath.lName.ToUpper,
                .Font = New Font("Segoe UI", 8),
                .Height = 13,
                .Location = New Point(0, 28),
                .Name = ath.ID.ToString + ".lName"
                }

            Dim fName As New Label With
                {
                .Text = ath.fName,
                .Font = New Font("Segoe UI", 8),
                .Height = 13,
                .Location = New Point(0, 41),
                .Name = ath.ID.ToString + ".fName"
                }

            newpanel.Controls.Add(ID)
            newpanel.Controls.Add(roll)
            newpanel.Controls.Add(fName)
            newpanel.Controls.Add(lName)

            flp.Controls.Add(newpanel)
            AddHandler newpanel.MouseClick, AddressOf panelClicked
            AddHandler ID.MouseClick, AddressOf labelClicked
            AddHandler roll.MouseClick, AddressOf labelClicked
            AddHandler fName.MouseClick, AddressOf labelClicked
            AddHandler lName.MouseClick, AddressOf labelClicked
        Next
    End Sub

    Private Sub panelClicked(sender As Object, e As EventArgs)
        Dim clicked As Panel = sender
        If clicked.Tag = "sel" Then
            Dim ath As athlete = listSelected.Find(Function(x) x.ID = clicked.Name)
            listAthletes.Add(ath)
            listSorted.Add(ath)
            listSelected.Remove(ath)
        Else
            Dim ath As athlete = listAthletes.Find(Function(x) x.ID = clicked.Name)
            listSelected.Add(ath)
            listSorted.Remove(ath)
            listAthletes.Remove(ath)
        End If
        fillPanels(flpAthletes, "", listSorted)
        fillPanels(flpSelected, "sel", listSelected)
    End Sub

    Private Sub labelClicked(sender As Object, e As EventArgs)
        panelClicked(sender.Parent, e)
    End Sub

    Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
        If txtTeamName.Text <> "" Or cmbAgeGroup.SelectedItem <> Nothing Or listSelected.Count <> 0 Then
            If MsgBox("You have unsaved changes. Continue?", MsgBoxStyle.YesNo, "Save Changes?") = MsgBoxResult.Yes Then
                Me.Close()
            End If
        Else
            Me.Close()
        End If
    End Sub

    Private Sub txtSearch_TextChanged(sender As Object, e As EventArgs) Handles txtSearch.TextChanged
        If txtSearch.Text = "" Then
            listSearched = updateSearched(listSearched, listSorted)
        Else
            listSearched = searchFilter(txtSearch, listSearched, listSorted)
        End If
        fillPanels(flpAthletes, "", listSearched)
    End Sub

    Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
        If txtTeamName.Text = "" Then 'Field checking (Absolutely disgusting field checking)
            MsgBox("Please enter a team name.", MsgBoxStyle.OkOnly, "Error")
        ElseIf cmbAgeGroup.SelectedItem = Nothing Then
            MsgBox("Please select an age group.", MsgBoxStyle.OkOnly, "Error")
        ElseIf listSelected.Count = 0 Then
            MsgBox("Please select members to add.", MsgBoxStyle.OkOnly, "Error")
        Else
            If MsgBox("You are creating a " + cmbAgeGroup.SelectedItem.ToString + " team with " + listSelected.Count.ToString + " members named " + txtTeamName.Text + ". Is this okay?", MsgBoxStyle.YesNo, "Confirm Team Creation") = MsgBoxResult.Yes Then
                Using conn As New OleDbConnection(dataPath + "\Athlete.accdb") 'Commits the team
                    conn.Open()
                    If editor = True Then
                        Using cmd As New OleDbCommand("DELETE FROM teamDb WHERE Team = '" + txtTeamName.Text + "'", conn)
                            cmd.ExecuteNonQuery()
                        End Using
                    End If
                    Using cmd As New OleDbCommand("INSERT INTO teamDb (Team, AgeGroup, Members) VALUES (@team, @AgeGroup, @Members)", conn) 'Appends the database with a new team
                        'Spool members list
                        Dim Members As String = ";" 'Leading separator character
                        For Each ath As athlete In listSelected
                            Members += (ath.ID + ";")
                        Next
                        cmd.Parameters.AddWithValue("@Team", txtTeamName.Text)
                        cmd.Parameters.AddWithValue("@AgeGroup", cmbAgeGroup.SelectedItem.ToString)
                        cmd.Parameters.AddWithValue("@Members", Members)
                        cmd.ExecuteNonQuery()
                    End Using
                End Using
                Me.Close()
            End If
            manageTeams.refreshPanels()
        End If
    End Sub

    Private Sub btnHelp_Click(sender As Object, e As EventArgs) Handles btnHelp.Click
        MsgBox("To begin, enter a team name and select an age group. Members can be added on the left and removed on the right. They can also be searched, sorted and filtered.", MsgBoxStyle.OkOnly, "Help")
    End Sub
End Class


text:
package net.bytebuddy.matcher;

import net.bytebuddy.description.method.MethodDescription;
import net.bytebuddy.description.method.MethodList;
import net.bytebuddy.description.type.generic.GenericTypeDescription;

/**
 * An element matcher that checks if a type description declares methods of a given property.
 *
 * @param <T> The exact type of the annotated element that is matched.
 */
public class DeclaringMethodMatcher<T extends GenericTypeDescription> extends ElementMatcher.Junction.AbstractBase<T> {

    /**
     * The field matcher to apply to the declared fields of the matched type description.
     */
    private final ElementMatcher<? super MethodList<?>> methodMatcher;

    /**
     * Creates a new matcher for a type's declared methods.
     *
     * @param methodMatcher The method matcher to apply to the declared methods of the matched type description.
     */
    public DeclaringMethodMatcher(ElementMatcher<? super MethodList<? extends MethodDescription>> methodMatcher) {
        this.methodMatcher = methodMatcher;
    }

    @Override
    public boolean matches(T target) {
        return methodMatcher.matches(target.getDeclaredMethods());
    }

    @Override
    public boolean equals(Object other) {
        return this == other || !(other == null || getClass() != other.getClass())
                && methodMatcher.equals(((DeclaringMethodMatcher<?>) other).methodMatcher);
    }

    @Override
    public int hashCode() {
        return methodMatcher.hashCode();
    }

    @Override
    public String toString() {
        return "declaresMethods(" + methodMatcher + ")";
    }
}


text:
#ifndef IDBTransaction_h
#define IDBTransaction_h

#if ENABLE(INDEXED_DATABASE)

#include "ActiveDOMObject.h"
#include "DOMError.h"
#include "DOMStringList.h"
#include "Event.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
#include "IDBMetadata.h"
#include "IDBTransactionBackendInterface.h"
#include "IDBTransactionCallbacks.h"
#include <wtf/HashSet.h>
#include <wtf/RefCounted.h>

namespace WebCore {

class IDBCursor;
class IDBDatabase;
class IDBObjectStore;
class IDBOpenDBRequest;

class IDBTransaction : public IDBTransactionCallbacks, public EventTarget, public ActiveDOMObject {
public:
    enum Mode {
        READ_ONLY = 0,
        READ_WRITE = 1,
        VERSION_CHANGE = 2
    };

    static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*);
    static PassRefPtr<IDBTransaction> create(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*, IDBOpenDBRequest*);
    virtual ~IDBTransaction();

    static const AtomicString& modeReadOnly();
    static const AtomicString& modeReadWrite();
    static const AtomicString& modeVersionChange();
    static const AtomicString& modeReadOnlyLegacy();
    static const AtomicString& modeReadWriteLegacy();

    static Mode stringToMode(const String&, ScriptExecutionContext*, ExceptionCode&);
    static const AtomicString& modeToString(Mode, ExceptionCode&);

    IDBTransactionBackendInterface* backend() const;
    bool isActive() const { return m_active; }
    bool isFinished() const { return m_state == Finished; }
    bool isReadOnly() const { return m_mode == READ_ONLY; }
    bool isVersionChange() const { return m_mode == VERSION_CHANGE; }

    // Implement the IDBTransaction IDL
    const String& mode() const;
    IDBDatabase* db() const { return m_database.get(); }
    PassRefPtr<DOMError> error() const { return m_error; }
    PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&);
    void abort(ExceptionCode&);

    class OpenCursorNotifier {
    public:
        OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*);
        ~OpenCursorNotifier();
        void cursorFinished();
    private:
        RefPtr<IDBTransaction> m_transaction;
        IDBCursor* m_cursor;
    };

    void registerRequest(IDBRequest*);
    void unregisterRequest(IDBRequest*);
    void objectStoreCreated(const String&, PassRefPtr<IDBObjectStore>);
    void objectStoreDeleted(const String&);
    void setActive(bool);
    void setError(PassRefPtr<DOMError>);

    DEFINE_ATTRIBUTE_EVENT_LISTENER(abort);
    DEFINE_ATTRIBUTE_EVENT_LISTENER(complete);
    DEFINE_ATTRIBUTE_EVENT_LISTENER(error);

    // IDBTransactionCallbacks
    virtual void onAbort(PassRefPtr<IDBDatabaseError>);
    virtual void onComplete();

    // EventTarget
    virtual const AtomicString& interfaceName() const;
    virtual ScriptExecutionContext* scriptExecutionContext() const;
    virtual bool dispatchEvent(PassRefPtr<Event>);
    bool dispatchEvent(PassRefPtr<Event> event, ExceptionCode& ec) { return EventTarget::dispatchEvent(event, ec); }

    // ActiveDOMObject
    virtual bool hasPendingActivity() const OVERRIDE;
    virtual bool canSuspend() const OVERRIDE;
    virtual void stop() OVERRIDE;

    using RefCounted<IDBTransactionCallbacks>::ref;
    using RefCounted<IDBTransactionCallbacks>::deref;

private:
    IDBTransaction(ScriptExecutionContext*, PassRefPtr<IDBTransactionBackendInterface>, Mode, IDBDatabase*, IDBOpenDBRequest*);

    void enqueueEvent(PassRefPtr<Event>);
    void closeOpenCursors();

    void registerOpenCursor(IDBCursor*);
    void unregisterOpenCursor(IDBCursor*);

    // EventTarget
    virtual void refEventTarget() { ref(); }
    virtual void derefEventTarget() { deref(); }
    virtual EventTargetData* eventTargetData();
    virtual EventTargetData* ensureEventTargetData();

    enum State {
        Unused, // No requests have been made.
        Used, // At least one request has been made.
        Finishing, // In the process of aborting or completing.
        Finished, // No more events will fire and no new requests may be filed.
    };

    RefPtr<IDBTransactionBackendInterface> m_backend;
    RefPtr<IDBDatabase> m_database;
    IDBOpenDBRequest* m_openDBRequest;
    const Mode m_mode;
    bool m_active;
    State m_state;
    bool m_hasPendingActivity;
    bool m_contextStopped;
    RefPtr<DOMError> m_error;

    ListHashSet<IDBRequest*> m_requestList;

    typedef HashMap<String, RefPtr<IDBObjectStore> > IDBObjectStoreMap;
    IDBObjectStoreMap m_objectStoreMap;

    typedef HashSet<RefPtr<IDBObjectStore> > IDBObjectStoreSet;
    IDBObjectStoreSet m_deletedObjectStores;

    typedef HashMap<RefPtr<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjectStoreMetadataMap;
    IDBObjectStoreMetadataMap m_objectStoreCleanupMap;

    HashSet<IDBCursor*> m_openCursors;

    EventTargetData m_eventTargetData;
};

} // namespace WebCore

#endif // ENABLE(INDEXED_DATABASE)

#endif // IDBTransaction_h


text:
from unittest import TestCase

from scrapy.spiders import Spider
from scrapy.http import Request, Response, HtmlResponse
from scrapy.utils.test import get_crawler
from scrapy.settings import Settings

from scrapy_rotate.middleware import RotateFakeUserAgentMiddleware
import os

class RotateTestCaseMixin(object):

    def _setup_crawler(self, req_kwargs={}):
        self.crawler = get_crawler(Spider, req_kwargs)
        self.spider = self.crawler._create_spider('foo')
        self.mw = RotateFakeUserAgentMiddleware.from_crawler(self.crawler)
        self.mw.spider_opened(self.spider)

    def _req_resp(self, url, req_kwargs=None, resp_kwargs=None):
        req = Request(url, **(req_kwargs or {}))
        resp = HtmlResponse(url, request=req, **(resp_kwargs or {}))
        return req, resp

    def _process_request_response(self, req, resp):
        req2 = self.mw.process_request(req, self.spider)
        resp2 = self.mw.process_response(req, resp, self.spider)
        return req2, resp2

class RotateFakeUserAgentMiddlewareTestCase(RotateTestCaseMixin, TestCase):

    def test_fake_useragent(self):
        '''
            Check that the useragent string matches
            the one in the request headers.
        '''
        self._setup_crawler({})
        req, resp = self._req_resp('http://example.com/', {'method': 'GET'})
        req2, resp2 = self._process_request_response(req, resp)
        headers_useragent = req.headers['User-Agent'].decode('utf8')
        self.assertEqual(self.mw.useragent, headers_useragent)

    def test_fake_useragent_choices(self):
        '''
            Check that the useragent string belongs
            to the right browser, given provided choices
        '''
        self._setup_crawler({'ROTATE_BROWSER_CHOICES': ['opera']})
        req, resp = self._req_resp('http://example.com/', {'method': 'GET'})
        req2, resp2 = self._process_request_response(req, resp)
        headers_useragent = req.headers['User-Agent'].decode('utf8')
        self.assertEqual('Opera' in self.mw.useragent, True)

        self._setup_crawler({'ROTATE_BROWSER_CHOICES': ['msie']})
        req, resp = self._req_resp('http://example.com/', {'method': 'GET'})
        req2, resp2 = self._process_request_response(req, resp)
        headers_useragent = req.headers['User-Agent'].decode('utf8')
        self.assertEqual('Windows NT' in self.mw.useragent, True)


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link type="text/css" rel="stylesheet" href="./styles/graphdoc.css" />
    <title>deprecated</title>
    <link href="https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700" rel="stylesheet"><link type="text/css" rel="stylesheet" href="./assets/code.css" /><link type="text/css" rel="stylesheet" href="./assets/require-by.css" />

            <button class="slds-button slds-button--icon slds-float--right js-toggle-navigation less-than-medium">
                close
            </button>

GraphQL Schema

                <input id="type-search" type="text" placeholder="Search a type" autofocus="" class="slds-input" />

Schema

                rootQuery

                rootMutation

Scalars

                Boolean

                Float

                Int

                String

Enums

                EEEE

                __DirectiveLocation

                __TypeKind

Objects

                AType

                AType_EmbeddedB

                AType_EmbeddedBArray

                AType_tree

                AType_tree_tree

                AType_tree_tree_titleObject

                BType

                __Directive

                __EnumValue

                __Field

                __InputValue

                __Schema

                __Type

Input Objects

                InputTypeA

                InputTypeA_EmbeddedB

                InputTypeA_EmbeddedBArray

                InputTypeA_tree

                InputTypeA_tree_tree

                InputTypeA_tree_tree_titleObject

Directives

                deprecated

                include

                skip

        <button class="slds-button js-toggle-navigation less-than-medium">
            menu
            Types
        </button>

deprecated

Marks an element of a GraphQL schema as no longer supported.

                link

            GraphQL Schema definition

directive @deprecated(reason: String) on FIELD_DEFINITION | ENUM_VALUE

                link

            Require by

This element is not required by anyone

        Generated with graphdoc 2.3.0


text:
module Fog
  module Compute
    class Cloudstack
      class Real

        # Creates a domain.
        #
        # {CloudStack API Reference}[http://download.cloud.com/releases/2.2.0/api_2.2.4/global_admin/queryAsyncJobResult.html]
        def query_async_job_result(options={})
          options.merge!(
            'command' => 'queryAsyncJobResult'
          )

          request(options)
        end

      end
    end
  end
end


text:
require_dependency "engine_test/application_controller"

module EngineTest
  class FoosController < ApplicationController
    before_action :set_foo, only: [:show, :edit, :update, :destroy]

    # GET /foos
    def index
      @foos = Foo.all
    end

    # GET /foos/1
    def show
    end

    # GET /foos/new
    def new
      @foo = Foo.new
    end

    # GET /foos/1/edit
    def edit
    end

    # POST /foos
    def create
      @foo = Foo.new(foo_params)

      if @foo.save
        redirect_to @foo, notice: 'Foo was successfully created.'
      else
        render action: 'new'
      end
    end

    # PATCH/PUT /foos/1
    def update
      if @foo.update(foo_params)
        redirect_to @foo, notice: 'Foo was successfully updated.'
      else
        render action: 'edit'
      end
    end

    # DELETE /foos/1
    def destroy
      @foo.destroy
      redirect_to foos_url, notice: 'Foo was successfully destroyed.'
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_foo
        @foo = Foo.find(params[:id])
      end

      # Only allow a trusted parameter "white list" through.
      def foo_params
        params.require(:foo).permit(:name)
      end
  end
end


text: Voice Wit Control - Server


text:
package org.apache.carbondata.core.scan.filter.resolver.resolverinfo;

import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier;
import org.apache.carbondata.core.scan.expression.Expression;
import org.apache.carbondata.core.scan.filter.intf.FilterExecuterType;
import org.apache.carbondata.core.scan.filter.resolver.ConditionalFilterResolverImpl;

/* The expression with If FALSE will be resolved setting empty bitset. */
public class FalseConditionalResolverImpl extends ConditionalFilterResolverImpl {

  private static final long serialVersionUID = 4599541011924324041L;

  public FalseConditionalResolverImpl(Expression exp, boolean isExpressionResolve,
      boolean isIncludeFilter) {
    super(exp, isExpressionResolve, isIncludeFilter, false);
  }

  @Override public void resolve(AbsoluteTableIdentifier absoluteTableIdentifier) {
  }

  /**
   * This method will provide the executer type to the callee inorder to identify
   * the executer type for the filter resolution, False Expresssion willl not execute anything.
   * it will return empty bitset
   */
  @Override public FilterExecuterType getFilterExecuterType() {
    return FilterExecuterType.FALSE;
  }

  /**
   * Method will the read filter expression corresponding to the resolver.
   * This method is required in row level executer inorder to evaluate the filter
   * expression against spark, as mentioned above row level is a special type
   * filter resolver.
   *
   * @return Expression
   */
  public Expression getFilterExpresion() {
    return exp;
  }

}


text:
module CzPayrollee5
  class PendingAggregator
    # collect all related pendings articles into collection
    # Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Attributes
    #
    # * +pending_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Returns
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    def self.collect_related_collection(pending_map)
      initial_map = {}

      related_map = pending_map.inject(initial_map) do |agr, concept_pair|
        collect_related_for_concept(agr, concept_pair, pending_map)
      end
    end

    # collect all related pendings articles for one concept
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +concept_pair+ - Array[concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +pending_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Returns
    #
    # * +related_ret+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    def self.collect_related_for_concept(related_map, concept_pair, pending_map)
      code = concept_pair.first
      pend = concept_pair.last

      related_arry = self.collect_all_related_articles(related_map, code, pend, pending_map)

      related_ret = merge_into_aggregates(related_map, code, related_arry)
    end

    # merge a new related pendings articles into Hash
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +concept_code+ - uint
    #
    # * +concept_related+ - Array:PayrollArticle
    #
    # ==== Returns
    #
    # * +related_ret+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    def self.merge_into_aggregates(related_map, concept_code, concept_related)
      merge_collection = Hash[concept_code, concept_related.uniq]

      related_ret = related_map.merge(merge_collection) { |key, _, new_val| new_val }
    end

    # collect all related pendings articles for one concept
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +concept_code+ - uint
    #
    # * +concept_pend+ - Array:PayrollArticle
    #
    # ==== Returns
    #
    # * +concept_related+ - Array:PayrollArticle
    #
    def self.collect_all_related_articles(related_map, concept_code, concept_pend, pending_map)
      concept_related = concept_pend.inject([]) do |agr, article|
        agr.concat(self.collect_deep_related_articles(related_map, article, pending_map))
      end
    end

    # collect all related pendings articles for one article from pending array
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +article+ - PayrollArticle
    #
    # * +pending_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Returns
    #
    # * +article_related+ - Array:PayrollArticle
    #
    def self.collect_deep_related_articles(related_map, article, pending_map)
      article_related = self.collect_from_related(related_map, article, pending_map)

      from_related = !article_related.nil?

      return article_related if from_related

      article_related = self.collect_from_pending(related_map, article, pending_map)
      return article_related
    end

    # collect related pendings articles for concept from related_map
    # if there is key in related_map, otherwise returns nil
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +article+ - PayrollArticle
    #
    # * +pending_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Returns
    #
    # * +article_related+ - Array:PayrollArticle
    #
    def self.collect_from_related(related_map, article, pending_map)
      not_from_related = !related_map.has_key?(article.concept_code)
      return nil if not_from_related

      article_related = self.find_related_for_article(related_map, article)

      article_to_arry = Array(article)
      return article_to_arry.concat(article_related)
    end

    # collect all related pendings articles for concept pending array
    # if there is not key in related_map, otherwise returns nil
    #
    # ==== Attributes
    #
    # * +related_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # * +article+ - PayrollArticle
    #
    # * +pending_map+ - Hash [concept_code:uint, pendings:Array:PayrollArticle]
    #
    # ==== Returns
    #
    # * +article_related+ - Array:PayrollArticle
    #
    def self.collect_from_pending(related_map, article, pending_map)
      not_from_pending = related_map.has_key?(article.concept_code)
      return nil if not_from_pending

      article_pending = self.find_pending_for_article(pending_map, article)

      article_related = article_pending.inject([article]) do |agr, article_source|
        agr.concat(self.collect_deep_related_articles(related_map, article_source, pending_map))
      end
    end

    def self.find_related_for_article(related_map, article)
      article_related = Array(related_map[article.concept_code])
    end

    def self.find_pending_for_article(pending_map, article)
      article_pending = Array(pending_map[article.concept_code])
    end

  end
end


text:
package Paws::ELBv2::SetRulePrioritiesOutput;
  use Moose;
  has Rules => (is => 'ro', isa => 'ArrayRef[Paws::ELBv2::Rule]');

  has _request_id => (is => 'ro', isa => 'Str');
1;

### main pod documentation begin ###

=head1 NAME

Paws::ELBv2::SetRulePrioritiesOutput

=head1 ATTRIBUTES

=head2 Rules => ArrayRef[L<Paws::ELBv2::Rule>]

Information about the rules.

=head2 _request_id => Str

=cut


text:
define(function (require, exports, module) {
    "use strict";

    var ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
        EditorManager  = brackets.getModule("editor/EditorManager"),
        AppInit        = brackets.getModule("utils/AppInit");

    var linterManager = require("linterManager");

    ExtensionUtils.loadStyleSheet(module, "style.less");

    function setDocument (event, currentEditor, previousEditor) {
        linterManager.init(currentEditor, previousEditor);
    }

    AppInit.appReady(function () {
        EditorManager.on("activeEditorChange.inlineLinter", setDocument);
    });
});


text:
require 'minitest_helper'

# Test for Rubeus::Extensions::Javax::Swing
class TestJPanel < MiniTest::Test
  include Rubeus::Swing

  # setup method
  def setup
  end

  # normal pattern
  def test_normal
    assert_nothing_raised do
      JFrame.new do |f|
        JPanel.new do |p|
          JButton.new("Push!")
        end
      end
    end
  end
end


text:
namespace CGAL {

template < class C,
           class Ref = typename C::reference,
           class Ptr = typename C::pointer>
class Circulator_identity {
protected:
  C        nt;    // The internal circulator.
public:
  typedef C  Circulator;
  typedef Circulator_identity<C,Ref,Ptr> Self;

  typedef typename  C::iterator_category   iterator_category;
  typedef typename  C::value_type          value_type;
  typedef typename  C::difference_type     difference_type;
  typedef typename  C::size_type           size_type;
  typedef typename  C::reference           reference;
  typedef typename  C::pointer             pointer;

  // CREATION
  // --------

  Circulator_identity() {}
  Circulator_identity( Circulator j) : nt(j) {}

  // OPERATIONS Forward Category
  // ---------------------------

  Circulator  current_circulator() const { return nt;}

  bool operator==( Nullptr_t p) const {
    CGAL_assertion( p == 0);
    CGAL_USE(p);
    return ( nt == 0);                                    //###//
  }
  bool operator!=( Nullptr_t p) const {
    return !(*this == p);
  }
  bool operator==( const Self& i) const {
    return ( nt == i.nt);                                    //###//
  }
  bool operator!=( const Self& i) const {
    return !(*this == i);
  }
  Ref  operator*() const {
    return *nt;                                              //###//
  }
  Ptr  operator->() const {
    return nt.operator->();                                  //###//
  }
  Self& operator++() {
    ++nt;                                                    //###//
    return *this;
  }
  Self  operator++(int) {
    Self tmp = *this;
    ++*this;
    return tmp;
  }

  // OPERATIONS Bidirectional Category
  // ---------------------------------

  Self& operator--() {
    --nt;                                                    //###//
    return *this;
  }
  Self  operator--(int) {
    Self tmp = *this;
    --*this;
    return tmp;
  }

  // OPERATIONS Random Access Category
  // ---------------------------------

  Self  min_circulator() const {
    return Self( nt.min_circulator());                       //###//
  }
  Self& operator+=( difference_type n) {
    nt += n;                                                 //###//
    return *this;
  }
  Self  operator+( difference_type n) const {
    Self tmp = *this;
    return tmp += n;
  }
  Self& operator-=( difference_type n) {
    return operator+=( -n);
  }
  Self  operator-( difference_type n) const {
    Self tmp = *this;
    return tmp += -n;
  }
  difference_type  operator-( const Self& i) const {
    return nt - i.nt;                                        //###//
  }
  Ref  operator[]( difference_type n) const {
    Self tmp = *this;
    tmp += n;
    return tmp.operator*();
  }
};

template < class Dist, class C, class Ref, class Ptr>
inline
Circulator_identity<C,Ref,Ptr>
operator+( Dist n, Circulator_identity<C,Ref,Ptr> i) {
  return i += n;
}

} //namespace CGAL
#endif // CGAL_CIRCULATOR_IDENTITY_H //
// EOF //


text:
package com.hazelcast.config;

import com.hazelcast.test.HazelcastSerialClassRunner;
import com.hazelcast.test.annotation.QuickTest;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;

@RunWith(HazelcastSerialClassRunner.class)
@Category(QuickTest.class)
public class EvictionConfigReadOnlyTest {

    private EvictionConfig getReadOnlyConfig() {
        return new EvictionConfig().getAsReadOnly();
    }

    @Test(expected = UnsupportedOperationException.class)
    public void setSizeOnReadOnlyEvictionConfigShouldFail() {
        getReadOnlyConfig().setSize(100);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void setMaxSizePolicyOnReadOnlyEvictionConfigShouldFail() {
        getReadOnlyConfig().setMaximumSizePolicy(null);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void setEvictionPolicyOnReadOnlyEvictionConfigShouldFail() {
        getReadOnlyConfig().setEvictionPolicy(null);
    }

    @Test(expected = UnsupportedOperationException.class)
    public void setComparatorClassNameOnReadOnlyEvictionConfigShouldFail() {
        getReadOnlyConfig().setComparatorClassName("myComparatorClassName");
    }

    @Test(expected = UnsupportedOperationException.class)
    public void setComparatorOnReadOnlyEvictionConfigShouldFail() {
        getReadOnlyConfig().setComparator(null);
    }
}


text:
using namespace sensactcore;
namespace sensactapps {

class cROTAR: public cApplication {
private:
	const uint16_t inputRotary;
	uint16_t const inputPush;
	const eEventType *const localEvents;
	const uint8_t localEventsLength;
	const eEventType *const busEvents;
	const uint8_t busEventsLength;
	const Command *const pressedCommands;
	const uint8_t pressedCommandsLength;
	const Command *const releasedShortCommands;
	const uint8_t releasedShortCommandsLength;
	const Command *const releasedLongCommands;
	const uint8_t releasedLongCommandsLength;
	const Command *const turnedCommands;
	const uint8_t turnedCommandsLength;
	Time_t lastChange;
	Time_t lastPressOrRelease;
	uint16_t rotaryState;
	ePushState pushState;
	void OnPressed(SensactContext *ctx);
	void OnReleasedShort(SensactContext *ctx);
	void OnReleasedLong(SensactContext *ctx);
	void OnTurned(SensactContext *ctx, int16_t);

public:
	eAppCallResult Setup(SensactContext *ctx) override;
	eAppType GetAppType() override;
	eAppCallResult DoEachCycle(SensactContext *ctx, uint8_t *statusBuffer, size_t *statusBufferLength) override;

	cROTAR(
			const eApplicationID id,
			const uint16_t inputRotary,
			uint16_t const inputPush,
			const eEventType *const localEvents,
			const uint8_t localEventsLength,
			const eEventType *const busEvents,
			const uint8_t busEventsLength,
			const Command *const pressedCommands,
			const uint8_t pressedCommandsLength,
			const Command *const releasedShortCommands,
			const uint8_t releasedShortCommandsLength,
			const Command *const releasedLongCommands,
			const uint8_t releasedLongCommandsLength,
			const Command *const turnedCommands,
			const uint8_t turnedCommandsLength
			);
};
}


text:
/*
 * arch/sh/boards/landisk/gio.c - driver for landisk
 *
 * This driver will also support the I-O DATA Device, Inc. LANDISK Board.
 * LANDISK and USL-5P Button, LED and GIO driver drive function.
 *
 *   Copylight (C) 2006 kogiidena
 *   Copylight (C) 2002 Atom Create Engineering Co., Ltd. *
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 *
 */
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kdev_t.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/landisk/gio.h>
#include <asm/landisk/iodata_landisk.h>

#define DEVCOUNT                4
#define GIO_MINOR	        2	/* GIO minor no. */

static dev_t dev;
static struct cdev *cdev_p;
static int openCnt;

static int gio_open(struct inode *inode, struct file *filp)
{
	int minor;

	minor = MINOR(inode->i_rdev);
	if (minor < DEVCOUNT) {
		if (openCnt > 0) {
			return -EALREADY;
		} else {
			openCnt++;
			return 0;
		}
	}
	return -ENOENT;
}

static int gio_close(struct inode *inode, struct file *filp)
{
	int minor;

	minor = MINOR(inode->i_rdev);
	if (minor < DEVCOUNT) {
		openCnt--;
	}
	return 0;
}

static int gio_ioctl(struct inode *inode, struct file *filp,
			     unsigned int cmd, unsigned long arg)
{
	unsigned int data;
	static unsigned int addr = 0;

	if (cmd & 0x01) {	/* write */
		if (copy_from_user(&data, (int *)arg, sizeof(int))) {
			return -EFAULT;
		}
	}

	switch (cmd) {
	case GIODRV_IOCSGIOSETADDR:	/* address set */
		addr = data;
		break;

	case GIODRV_IOCSGIODATA1:	/* write byte */
		ctrl_outb((unsigned char)(0x0ff & data), addr);
		break;

	case GIODRV_IOCSGIODATA2:	/* write word */
		if (addr & 0x01) {
			return -EFAULT;
		}
		ctrl_outw((unsigned short int)(0x0ffff & data), addr);
		break;

	case GIODRV_IOCSGIODATA4:	/* write long */
		if (addr & 0x03) {
			return -EFAULT;
		}
		ctrl_outl(data, addr);
		break;

	case GIODRV_IOCGGIODATA1:	/* read byte */
		data = ctrl_inb(addr);
		break;

	case GIODRV_IOCGGIODATA2:	/* read word */
		if (addr & 0x01) {
			return -EFAULT;
		}
		data = ctrl_inw(addr);
		break;

	case GIODRV_IOCGGIODATA4:	/* read long */
		if (addr & 0x03) {
			return -EFAULT;
		}
		data = ctrl_inl(addr);
		break;
	default:
		return -EFAULT;
		break;
	}

	if ((cmd & 0x01) == 0) {	/* read */
		if (copy_to_user((int *)arg, &data, sizeof(int))) {
			return -EFAULT;
		}
	}
	return 0;
}

static struct file_operations gio_fops = {
	.owner = THIS_MODULE,
	.open = gio_open,	/* open */
	.release = gio_close,	/* release */
	.ioctl = gio_ioctl,	/* ioctl */
};

static int __init gio_init(void)
{
	int error;

	printk(KERN_INFO "gio: driver initialized\n");

	openCnt = 0;

	if ((error = alloc_chrdev_region(&dev, 0, DEVCOUNT, "gio")) < 0) {
		printk(KERN_ERR
		       "gio: Couldn't alloc_chrdev_region, error=%d\n",
		       error);
		return 1;
	}

	cdev_p = cdev_alloc();
	cdev_p->ops = &gio_fops;
	error = cdev_add(cdev_p, dev, DEVCOUNT);
	if (error) {
		printk(KERN_ERR
		       "gio: Couldn't cdev_add, error=%d\n", error);
		return 1;
	}

	return 0;
}

static void __exit gio_exit(void)
{
	cdev_del(cdev_p);
	unregister_chrdev_region(dev, DEVCOUNT);
}

module_init(gio_init);
module_exit(gio_exit);

MODULE_LICENSE("GPL");


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fleet.entidades;

/**
 *
 * @author Alvaro Lopez
 */
public class Usuario {

    public Usuario(String id_usuario, String pass, String nombre, String rol) {
        this.id_usuario = id_usuario;
        this.pass = pass;
        this.nombre = nombre;
        this.rol = rol;
    }

    public Usuario(String id_usuario, String nombre, String rol) {
        this.id_usuario = id_usuario;
        this.nombre = nombre;
        this.rol = rol;
    }

    public Usuario(String id_usuario,String pass){
        this.id_usuario = id_usuario;
        this.pass = pass;
    }

    public String getId_usuario() {
        return id_usuario;
    }

    public void setId_usuario(String id_usuario) {
        this.id_usuario = id_usuario;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getRol() {
        return rol;
    }

    public void setRol(String rol) {
        this.rol = rol;
    }

    public String createDBUser(){
        return id_usuario.split("@")[0];
    }

    String id_usuario;
    String pass;
    String nombre;
    String rol;

}


text:
module.exports = function (text_msg, interval) {
  const https = require('https');
  let options = {
    host: "api.telegram.org",
    path: `/bot${process.env.TELEGRAM_TOKEN}/sendMessage`,
    method: "POST",
    headers: {
      'Content-Type': "application/json"
    }
  };

  let msg_db = require('./telegram_db');
  msg_db(function (rows) {
    for (let i = 0; i <= rows.length; i += 1) {
      if (i === rows.length) {
        clearInterval(interval);
        return;
      }

      let post_data = {
        "chat_id": rows[i].telegram_id,
        "text": text_msg
      };

      let post_req = https.request(options, function (res) {
        res.setEncoding('utf8');
        res.on('data', function (chunk) {
          console.log('[TELEGRAM SEND] Res: ' + chunk);
        });
      });

      // post the data
      post_req.write(JSON.stringify(post_data));
      post_req.end();
    }
  });
};


text:
.lt-ie9 .row .row{margin:0;}
.lt-ie9 .row .column:first-child,.lt-ie9 .row .columns:first-child{margin-left:0!important;}
.lt-ie9 .row .column:last-child,.lt-ie9 .row .columns:last-child{margin-right:0!important;}
.lt-ie9 .column,.lt-ie9 .columns{position:relative;padding-left:0;padding-right:0;float:left;margin-left:.9375%;margin-right:.9375%;min-height:1px;}
.lt-ie9 .small-1{width:6.45833%;}
.lt-ie9 .small-2{width:14.79167%;}
.lt-ie9 .small-3{width:23.125%;}
.lt-ie9 .small-4{width:31.45833%;}
.lt-ie9 .small-5{width:39.79167%;}
.lt-ie9 .small-6{width:48.125%;}
.lt-ie9 .small-7{width:56.45833%;}
.lt-ie9 .small-8{width:64.79167%;}
.lt-ie9 .small-9{width:73.125%;}
.lt-ie9 .small-10{width:81.4583%;}
.lt-ie9 .small-11{width:89.79167%;}
.lt-ie9 .small-12{width:100%;}
.lt-ie9 .small-offset-0,.lt-ie9 .large-offset-0{width:100%;}
.lt-ie9 .small-offset-1,.lt-ie9 .large-offset-1{margin-left:8.33333%;}
.lt-ie9 .small-offset-2,.lt-ie9 .large-offset-2{margin-left:16.66667%;}
.lt-ie9 .small-offset-3,.lt-ie9 .large-offset-3{margin-left:25%;}
.lt-ie9 .small-offset-4,.lt-ie9 .large-offset-4{margin-left:33.33333%;}
.lt-ie9 .small-offset-5,.lt-ie9 .large-offset-5{margin-left:41.66667%;}
.lt-ie9 .small-offset-6,.lt-ie9 .large-offset-6{margin-left:50%;}
.lt-ie9 .small-offset-7,.lt-ie9 .large-offset-7{margin-left:58.33333%;}
.lt-ie9 .small-offset-8,.lt-ie9 .large-offset-8{margin-left:66.66667%;}
.lt-ie9 .small-offset-9,.lt-ie9 .large-offset-9{margin-left:75%;}
.lt-ie9 .small-offset-10,.lt-ie9 .large-offset-10{margin-left:83.3333%;}
.lt-ie9 .large-offset-11{margin-left:91.66667%;}
.lt-ie9 [class*=column] + [class*=column]:last-child{float:right;}
.lt-ie9 [class*=column] + [class*=column].end{float:left;}
.lt-ie9 .column.small-centered,.lt-ie9 .columns.small-centered{position:relative;margin-left:auto;margin-right:auto;float:none!important;}
.lt-ie9 .row .column.small-centered:first-child,.lt-ie9 .row .columns.small-centered:first-child{margin-left:auto !important;}

.lt-ie9 .large-1{width:6.45833%;}
.lt-ie9 .large-2{width:14.79167%;}
.lt-ie9 .large-3{width:23.125%;}
.lt-ie9 .large-4{width:31.45833%;}
.lt-ie9 .large-5{width:39.79167%;}
.lt-ie9 .large-6{width:48.125%;}
.lt-ie9 .large-7{width:56.45833%;}
.lt-ie9 .large-8{width:64.79167%;}
.lt-ie9 .large-9{width:73.125%;}
.lt-ie9 .large-10{width:81.4583%;}
.lt-ie9 .large-11{width:89.79167%;}
.lt-ie9 .large-12{width:100%;}
.lt-ie9 .push-1{position:relative;left:8.33333%;right:auto;}
.lt-ie9 .pull-1{position:relative;right:8.33333%;left:auto;}
.lt-ie9 .push-2{position:relative;left:16.66667%;right:auto;}
.lt-ie9 .pull-2{position:relative;right:16.66667%;left:auto;}
.lt-ie9 .push-3{position:relative;left:25%;right:auto;}
.lt-ie9 .pull-3{position:relative;right:25%;left:auto;}
.lt-ie9 .push-4{position:relative;left:33.33333%;right:auto;}
.lt-ie9 .pull-4{position:relative;right:33.33333%;left:auto;}
.lt-ie9 .push-5{position:relative;left:41.66667%;right:auto;}
.lt-ie9 .pull-5{position:relative;right:41.66667%;left:auto;}
.lt-ie9 .push-6{position:relative;left:50%;right:auto;}
.lt-ie9 .pull-6{position:relative;right:50%;left:auto;}
.lt-ie9 .push-7{position:relative;left:58.33333%;right:auto;}
.lt-ie9 .pull-7{position:relative;right:58.33333%;left:auto;}
.lt-ie9 .push-8{position:relative;left:66.66667%;right:auto;}
.lt-ie9 .pull-8{position:relative;right:66.66667%;left:auto;}
.lt-ie9 .push-9{position:relative;left:75%;right:auto;}
.lt-ie9 .pull-9{position:relative;right:75%;left:auto;}
.lt-ie9 .push-10{position:relative;left:83.33333%;right:auto;}
.lt-ie9 .pull-10{position:relative;right:83.33333%;left:auto;}
.lt-ie9 .push-11{position:relative;left:91.66667%;right:auto;}
.lt-ie9 .pull-11{position:relative;right:91.66667%;left:auto;}
.lt-ie9 .column.large-centered,.lt-ie9 .columns.large-centered{position:relative;margin-left:auto ;margin-right:auto;float:none !important;}
.lt-ie9 .column.large-uncentered,.lt-ie9 .columns.large-uncentered{margin-left:0;margin-right:0;float:left!important;}
.lt-ie9 .column.large-uncentered.opposite,.lt-ie9 .columns.large-uncentered.opposite{float:right!important;}
.lt-ie9 .row .column.large-centered:first-child,.lt-ie9 .row .columns.large-centered:first-child{margin-left:auto !important;}

/* Nicolas Gallagher's micro clearfix */
.lt-ie9 .row { *zoom: 1; }
.lt-ie9 .row:before, .row:after { content: " "; display: table; }
.lt-ie9 .row:after { clear: both; }

/* For top Horizantal menu */
.lt-ie9 .top-bar{background:#111111;zoom:1;overflow:visible;}
.lt-ie9 .top-bar:before,.top-bar:after{content:" ";display:table;}
.lt-ie9 .top-bar:after{clear:both;}
.lt-ie9 .top-bar .toggle-topbar{display:none;}
.lt-ie9 .top-bar .title-area{float:left;}
.lt-ie9 .top-bar .name h1 a{width:auto;}
.lt-ie9 .top-bar input,.lt-ie9 .top-bar .button{line-height:2em;font-size:.875em;height:2em;padding:0 10px;position:relative;top:8px;}
.lt-ie9 .top-bar.expanded{background:#111111;}
.lt-ie9 .contain-to-grid .top-bar{max-width:70em;margin:0 auto;}
.lt-ie9 .top-bar-section{-webkit-transition:none 0 0;-moz-transition:none 0 0;transition:none 0 0;left:0!important;}
.lt-ie9 .top-bar-section ul{width:auto;height:auto!important;display:inline;}
.lt-ie9 .top-bar-section ul li{float:left;}
.lt-ie9 .top-bar-section ul li .js-generated{display:none;}
.lt-ie9 .top-bar-section li a:not(.button){padding:0 15px;line-height:45px;background:#111111;}
.lt-ie9 .top-bar-section li a:not(.button).hover{background:black;}
.lt-ie9 .top-bar-section .has-dropdown > a{padding-right:35px!important;}
.lt-ie9 .top-bar-section .has-dropdown > a:after{content:"";display:block;width:0;height:0;border:inset 5px;border-color:rgba(255,255,255,0.5) transparent transparent;border-top-style:solid;margin-top:-2.5px;top:22.5px;}
.lt-ie9 .top-bar-section .has-dropdown.moved{position:relative;}
.lt-ie9 .top-bar-section .has-dropdown.moved > .dropdown{visibility:hidden;}
.lt-ie9 .top-bar-section .has-dropdown.hover > .dropdown{visibility:visible;}
.lt-ie9 .top-bar-section .has-dropdown .dropdown li.has-dropdown > a:after{border:none;content:"\00bb";margin-top:-16px;right:5px;}
.lt-ie9 .top-bar-section .dropdown{left:0;top:auto;background:transparent;min-width:100%;}
.lt-ie9 .top-bar-section .dropdown li a{color:white;line-height:1;white-space:nowrap;padding:7px 15px;background:#1e1e1e;}
.lt-ie9 .top-bar-section .dropdown li label{white-space:nowrap;background:#1e1e1e;}
.lt-ie9 .top-bar-section .dropdown li .dropdown{left:100%;top:0;}
.lt-ie9 .top-bar-section > ul > .divider,.top-bar-section > ul > [role=separator]{border-bottom:none;border-top:none;border-right:solid 1px #2b2b2b;border-left:solid 1px black;clear:none;height:45px;width:0;}
.lt-ie9 .top-bar-section .has-form{background:#111111;padding:0 15px;height:45px;}
.lt-ie9 .top-bar-section ul.right li .dropdown{left:auto;right:0;}
.lt-ie9 .top-bar-section ul.right li .dropdown li .dropdown{right:100%;}
.lt-ie9 .no-js .top-bar-section ul li:hover > a{background:#090909;color:white;}
.lt-ie9 .no-js .top-bar-section ul li:active > a{background:#090909;color:white;}
.lt-ie9 .no-js .top-bar-section .has-dropdown:hover > .dropdown{visibility:visible;}


text:
import babel from 'rollup-plugin-babel';

export default {
  entry: 'src/roun.js',
  dest: 'roun.js',
  plugins: [
    babel({exclude: 'node_modules/**'}),
  ],
  format: 'umd',
  moduleName: 'roun',
};


text:
var isCloud = false;
var jwtToken = null;
var PROP_AUTHTOKEN = 'authToken';
var serverId = null;
var user = null;
var systemInfo = null;
var sen = null;
var yasoonServerUrl = null;

$(document).ready(function () {
    jwtToken = getUrlParameterByName('jwt');
    if (jwtToken)
        isCloud = true;

    if (isCloud) {
        //AP.sizeToParent();
        AP.resize('100%', (window.screen.availHeight - 250) + 'px');
        $('.tab-container').css('max-height', (window.screen.availHeight - 330) + 'px')
    }

    loadSystemInfo()
        .then(function () {
            return getStoreUrl();
        })
        .then(function (url) {
            yasoonServerUrl = url;

            $('#pageLoading').addClass('hidden');
            var htmlPath = '';
            if (isCloud) {
                htmlPath = 'user.html';
            } else {
                htmlPath = pathHtml;
            }

            $('#pageContent').removeClass('hidden').load(htmlPath, function () {
                $('#homepage').css('height', (window.innerHeight - $('#content').offset().top) + 'px');
                getInstanceProperty(PROP_AUTHTOKEN)
                    .then(function (authToken) {
                        return $.ajax({
                            url: yasoonServerUrl + '/api/company/build',
                            type: 'GET',
                            headers: { userAuthToken: authToken }
                        });
                    })
                    .then(function (infos) {
                        var url = btoa(infos.downloadUrl);
                        $('#homepage').attr('src', "https://yasoon.com/jira-for-outlook-in-product/?url=" + url);
                    });
            });
        });
});


text:
id: componentWillReceiveProps-not-triggered-after-mounting
title: componentWillReceiveProps Not Triggered After Mounting
layout: tips
permalink: componentWillReceiveProps-not-triggered-after-mounting.html
prev: controlled-input-null-value.html
next: props-in-getInitialState-as-anti-pattern.html
---

`componentWillReceiveProps` isn't triggered after the node is put on scene. This is by design. Check out [other lifecycle methods](/react/docs/component-specs.html) for the one that suits your needs.

The reason for that is because `componentWillReceiveProps` often handles the logic of comparing with the old props and acting upon changes; not triggering it at mounting (where there are no old props) helps in defining what the method does.


text:
import sys
import os
import time

import angr
from angr import options as so

test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')

def perf_unicorn_0():
    p = angr.Project(os.path.join(test_location, 'binaries', 'tests', 'x86_64', 'perf_unicorn_0'))

    s_unicorn = p.factory.entry_state(add_options=so.unicorn | {so.STRICT_PAGE_ACCESS}, remove_options={so.LAZY_SOLVES}) # unicorn

    sm_unicorn = p.factory.simulation_manager(s_unicorn)

    start = time.time()
    sm_unicorn.run()
    elapsed = time.time() - start

    print("Elapsed %f sec" % elapsed)
    print(sm_unicorn.one_deadended)

def perf_unicorn_1():
    p = angr.Project(os.path.join(test_location, 'binaries', 'tests', 'x86_64', 'perf_unicorn_1'))

    s_unicorn = p.factory.entry_state(add_options=so.unicorn | {so.STRICT_PAGE_ACCESS}, remove_options={so.LAZY_SOLVES}) # unicorn

    sm_unicorn = p.factory.simulation_manager(s_unicorn)

    start = time.time()
    sm_unicorn.run()
    elapsed = time.time() - start

    print("Elapsed %f sec" % elapsed)
    print(sm_unicorn.one_deadended)

if __name__ == "__main__":
    if len(sys.argv) > 1:
        for arg in sys.argv[1:]:
            print('perf_' + arg)
            globals()['perf_' + arg]()

    else:
        for fk, fv in globals().items():
            if fk.startswith('perf_') and callable(fv):
                print(fk)
                res = fv()


text:
import { expect } from 'chai'
import { it, describe } from 'mocha'
import { setupTest } from 'ember-mocha'

describe('Unit | Service | ajax', function(hooks) {
  setupTest(hooks)

  // Replace this with your real tests.
  it('exists', function() {
    let service = this.owner.lookup('service:ajax')
    expect(service).to.be.ok
  })
})


text:
package org.zstack.network.service.virtualrouter;

import org.zstack.header.configuration.APICreateInstanceOfferingMsg;
import org.zstack.header.configuration.ConfigurationConstant;
import org.zstack.header.identity.Action;
import org.zstack.header.image.ImageVO;
import org.zstack.header.message.APIParam;
import org.zstack.header.network.l3.L3NetworkVO;
import org.zstack.header.tag.TagConstant;
import org.zstack.header.zone.ZoneVO;

@Action(category = VirtualRouterConstant.ACTION_CATEGORY)
public class APICreateVirtualRouterOfferingMsg extends APICreateInstanceOfferingMsg {
	@APIParam(resourceType = ZoneVO.class)
	private String zoneUuid;
	@APIParam(resourceType = L3NetworkVO.class, checkAccount = true)
	private String managementNetworkUuid;
	@APIParam(resourceType = ImageVO.class, checkAccount = true)
	private String imageUuid;
    @APIParam(required = false, resourceType = L3NetworkVO.class, checkAccount = true)
	private String publicNetworkUuid;
	private boolean isDefault;

    public String getType() {
        return VirtualRouterConstant.VIRTUAL_ROUTER_OFFERING_TYPE;
    }

	public String getZoneUuid() {
		return zoneUuid;
	}
	public void setZoneUuid(String zoneUuid) {
		this.zoneUuid = zoneUuid;
	}
	public String getManagementNetworkUuid() {
		return managementNetworkUuid;
	}
	public void setManagementNetworkUuid(String managementNetworkUuid) {
		this.managementNetworkUuid = managementNetworkUuid;
	}
	public String getPublicNetworkUuid() {
		return publicNetworkUuid;
	}
	public void setPublicNetworkUuid(String publicNetworkUuid) {
		this.publicNetworkUuid = publicNetworkUuid;
	}
	public boolean isDefault() {
		return isDefault;
	}
	public void setDefault(boolean isDefault) {
		this.isDefault = isDefault;
	}
	public String getImageUuid() {
		return imageUuid;
	}
	public void setImageUuid(String imageUuid) {
		this.imageUuid = imageUuid;
	}
}


text:
package com.asakusafw.lang.compiler.tester.executor.util;

import com.asakusafw.vocabulary.batch.Batch;
import com.asakusafw.vocabulary.batch.BatchDescription;

/**
 * A dummy batch class.
 */
@Batch(name = DummyBatchClass.ID)
public class DummyBatchClass extends BatchDescription {

    /**
     * The batch ID for this class.
     */
    public static final String ID = "dummy"; //$NON-NLS-1$

    @Override
    protected void describe() {
        throw new UnsupportedOperationException();
    }
}