text:
<法規>
<法規性質>命令</法規性質>
<英文法規名稱>Regulation on Permit and Management for Construction Industry to Employ Foreign</英文法規名稱>
<中文法規名稱>營造業聘僱外國技術人員許可及管理辦法</中文法規名稱>
<法規網址>https://law.moj.gov.tw/Eng/LawClass/LawAll.aspx?pcode=D0070136</法規網址>
<最新英文異動日期>20040421</最新英文異動日期>
<廢止註記>廢</廢止註記>
<附件 />
<沿革內容><![CDATA[1.Promulgated on August 16, 1993
2.Amended on May 16, 1996
3.Issued by Order Tai-Nei-Ying-Tzu No.8582288 of the Ministry of the Interior Order Tai (85)-Lao-Chih-Wai No.246316 of the Council of Labor Affairs, Executive Yuan on Jan.27, 1997
4.Amended by Order Tai-Nei-Ying-Tzu No.8873495 of the Ministry of the Interior Order Tai (88)-Lao-Chih-Wai No.0902718 of the Council of Labor Affairs, Executive Yuan on Aug.16, 1999
5.Deleted by Order Tai-Nei-Ying-Tzu No.0930082553 of the Ministry of the Interior Order Tai (93)-Lao-Chih-Wai No.0902718 of the Council of Labor Affairs, Executive Yuan on April.21, 2004                ]]></沿革內容>
<前言><![CDATA[]]></前言>
<法規內容>
  <條文>
    <條號>Article 1</條號>
    <條文內容><![CDATA[This regulation is enacted pursuant to Paragraph 2, Article 43 and Paragraph 2, Article 44 of the Employment Service Act (hereinafter referred to as "the Act").]]></條文內容>
  </條文>
  <條文>
    <條號>Article 2</條號>
    <條文內容><![CDATA[The "foreign technicians" mentioned in this Regulation refers to the foreigners employed by the construction industry according to Subparagraph 1, Paragraph 1, Article 43 of the Act to provide construction and civil engineering technologies.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 3</條號>
    <條文內容><![CDATA[The competent authority of this Regulation is the Ministry of the Interior.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 4</條號>
    <條文內容><![CDATA[The foreign technicians employed shall have any of the following qualifications:
1. Doctor graduated from related departments or institutes of universities.
2. Master graduated from related departments or institutes of colleges or higher schools, and having worked in similar technical position for over 1 year.
3. Graduated from related departments and subjects of colleges, and having worked in similar technical position for over 2 years.
4. Graduated from related specialities of senior vocational schools, and having worked in similar technical position for over 5 years.
5. Once having accepted professional training or having special skills and holding certificates, and having worked in similar positions for over 5 years.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 5</條號>
    <條文內容><![CDATA[To employ a foreign technician, the construction enterprise shall submit the following documents to the competent authority for application:
1. Letter of application.
2. Photostat copy of construction industry registration certificate.
3. Four copies of questionnaire for applying for employment of foreign technicians.
4. A copy of employment contract, including the following contents:
(1) Name and address of the construction enterprise.
(2) Name, birthday, nationality, passport number, and overseas dwelling address of the foreign technician employed.
(3) Work and position taken by the foreign technician employed.
(4) Monthly or daily salary income.
(5) Commencing and terminating dates of the employment term.
5. A photostat copy of education and experience certificates, and identity certificate or passport of the foreign technician employed.
6. Photostat copy of the engineering contract introducing foreign technician. Public works, except environmental protection works that do not use civil engineering as the major contracting works, must be directly contracted. For private construction works, construction license shall be enclosed.
Among the documents listed in the fifth subparagraph, domestic experiences shall be enclosed with photostat copy of the certificates about the work in R.O.C through years and payment of tax, while the overseas education or experiences in regions other than southeast Asia and other regions and countries designated by the competent authority do not need verification by the local embassy or consulate, representative office, agency, or organ authorized by the Ministry of Foreign Affairs.
After the employment application is approved, the competent authority shall immediately transfer the case to the Ministry of Foreign Affairs for granting visa, and inform the applicant construction enterprise, related departments and the foreigner employed.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 6</條號>
    <條文內容><![CDATA[The foreign technicians employed in the construction industry shall be physically and mentally healthy. During the employment term, the employer shall pay attention to the foreigners' health from time to time. Where a foreign technician gets phthisis, syphilis, hepatitis B, impaludism, amoebic dysentery, leprosy, serious mental disease, or positive status in HIV antibody, morphine or amphetamine test, or other disease likely to impact the domestic epidemic prevention, he or she shall be sent back to his/her country immediately. Upon finding the above-mentioned cases, the medical institutions shall immediately inform the local regulating department in charge of sanitary affairs, for the department to report to the Ministry of the Interior and the Council of Labor Affairs, Executive Yuan to cooperate with the local police for disposal.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 7</條號>
    <條文內容><![CDATA[(Deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 8</條號>
    <條文內容><![CDATA[(Deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 9</條號>
    <條文內容><![CDATA[(Deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 10</條號>
    <條文內容><![CDATA[After entering R.O.C with a residence visa, the foreign technician employed with permission shall apply for alien residence certificate at the police bureau at the location of residence within 15 days.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 11</條號>
    <條文內容><![CDATA[The term of work permit for foreign technicians employed by a construction enterprise is up to 3 years. Where it is necessary to continue employment, the construction enterprise shall submit the following documents within 30 days before expiration of the term to the competent authority to apply for extension of up to 1 year:
1. Letter of application.
2. Four copies of questionnaire for applying for employment of foreign technicians.
3. A copy of employment contract including the contents listed in Subparagraph 4, Paragraph 1, Article 5.
4. Original official document approving employment.
5. Certificates on tax payment during working in R.O.C.
6. Photostat copy of the engineering contract introducing foreign technician. Public works, except environmental protection works that do not use civil engineering as the major contracting works, must be directly contracted. For private construction works, construction license shall be enclosed.
After the extension of the term is approved, the foreign technician shall go to the police at the location of residence to finish the procedure for extended residence.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 12</條號>
    <條文內容><![CDATA[Where a foreign technician employed in the construction industry is refused to visa, prohibited from entrance or compelled to leave country by related departments, the competent authority shall cancel the employment permit.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 13</條號>
    <條文內容><![CDATA[Where a foreign technician employed in the construction industry needs to turn over to another employer during the effective term of the employment permit, the new employer shall submit the following documents to the competent authority, and cooperate with the original employer to submit application:
1. Letter of application.
2. Photostat copy of construction enterprise registration certificate.
3. A copy of employment contract including the contents listed in Subparagraph 4, Paragraph 1, Article 5.
4. Original official document approving employment.
5. Dimission certificate produced by the original employer.
6. Certificates on tax payment during working in R.O.C.
7. Photostat copy of the engineering contract introducing foreign technician. Public works, except environmental protection works that do not use civil engineering as the major contracting works, must be directly contracted. For private construction works, construction license shall be enclosed.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 14</條號>
    <條文內容><![CDATA[The notice given by a construction enterprise under Article 52 of the Act shall include the name, sex, age, nationality, date of entrance, working term, photo, and serial number of alien residence certificate of the foreign technician.
Upon receipt of the above-mentioned notice, the police departments shall immediately check whether the foreign technician has leaved the country. If not, the case shall be reported to the National Police Agency, Ministry of the Interior to strengthen reconnaissance.]]></條文內容>
  </條文>
  <條文>
    <條號>Article 15</條號>
    <條文內容><![CDATA[(Deleted)]]></條文內容>
  </條文>
  <條文>
    <條號>Article 16</條號>
    <條文內容><![CDATA[This Regulation will take effect since it is promulgated.]]></條文內容>
  </條文>
</法規內容>
</法規>


text:
cm.define('Com.Toolbar', {
    'modules' : [
        'Params',
        'Events',
        'Langs',
        'Structure',
        'DataConfig',
        'DataNodes',
        'Stack'
    ],
    'events' : [
        'onRenderStart',
        'onRender',
        'onProcessEnd'
    ],
    'params' : {
        'node' : cm.node('div'),
        'container' : null,
        'name' : '',
        'embedStructure' : 'append',
        'adaptive' : true,
        'className' : null
    }
},
function(params){
    var that = this;

    that.nodes = {};
    that.groups = {};
    that.items = [];
    that.isHidden = true;

    var init = function(){
        that.setParams(params);
        that.convertEvents(that.params['events']);
        that.getDataNodes(that.params['node']);
        that.getDataConfig(that.params['node']);
        that.addToStack(that.params['node']);
        that.triggerEvent('onRenderStart');
        render();
        that.addToStack(that.nodes['container']);
        that.triggerEvent('onRender');
    };

    var render = function(){
        // Structure
        that.nodes['container'] = cm.node('div', {'class' : 'com__toolbar is-hidden'},
            that.nodes['toolbar'] = cm.node('div', {'class' : 'pt__toolbar'},
                that.nodes['inner'] = cm.node('div', {'class' : 'inner'},
                    that.nodes['left'] = cm.node('div', {'class' : 'left'}),
                    that.nodes['right'] = cm.node('div', {'class' : 'right'})
                )
            )
        );
        if(that.params['adaptive']){
            cm.addClass(that.nodes['toolbar'], 'is-adaptive');
        }else{
            cm.addClass(that.nodes['toolbar'], 'is-not-adaptive');
        }
        that.params['className'] && cm.addClass(that.nodes['toolbar'], that.params['className']);
        // Append
        that.embedStructure(that.nodes['container']);
    };

    /* ******* PUBLIC ******* */

    that.clear = function(){
        cm.forEach(that.groups, function(group){
            that.removeGroup(group);
        });
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.addGroup = function(item){
        item = cm.merge({
            'name' : '',
            'position' : 'left',            // left | center | right | justify
            'hidden' : false,
            'container' : cm.node('ul', {'class' : 'group'}),
            'node' : null,
            'adaptive' : true,
            'flex' : false,
            'items' : {}
        }, item);
        if(!that.groups[item['name']]){
            if(!item['node']){
                item['node'] = item['container'];
            }
            item['adaptive'] && cm.addClass(item['container'], 'is-adaptive');
            item['flex'] && cm.addClass(item['container'], 'is-flex');
            item['hidden'] && cm.addClass(item['container'], 'is-hidden');
            // Position
            if(/left|right/.test(item['position'])){
                cm.appendChild(item['container'], that.nodes[item['position']]);
            }else if(item['position'] === 'justify'){
                cm.appendChild(item['container'], that.nodes['inner']);
            }
            that.groups[item['name']] = item;
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.removeGroup = function(name){
        var item;
        if(cm.isObject(arguments[0])){
            item = name;
        }else{
            item = that.getGroup(name);
        }
        if(item){
            cm.remove(item['container']);
            delete that.groups[item['name']];
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.getGroup = function(name){
        return that.groups[name];
    };

    that.showGroup = function(name){
        var item = that.getGroup(name);
        if(item){
            item['hidden'] = false;
            cm.removeClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.hideGroup = function(name){
        var item = that.getGroup(name);
        if(item){
            item['hidden'] = true;
            cm.addClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.isGroupEmpty = function(name){
        var item = that.getGroup(name);
        if(item){
            return cm.getLength(item.items) === 0;
        }
        return true;
    };

    that.toggleGroupVisibility = function(name){
        if(that.isGroupEmpty(name)){
            that.hideGroup(name);
        }else{
            that.showGroup(name);
        }
        return that;
    };

    that.addField = function(item){
        var group;
        item = cm.merge({
            'name' : '',
            'hidden' : false,
            'container' : cm.node('li'),
            'node' : null,
            'size' : null,
            'classes' : [],
            'group' : null,
            'constructor' : false,
            'constructorParams' : {}
        }, item);
        group = that.groups[item['group']];
        // Render
        if(group && !group.items[item['name']]){
            // Styles
            item['size'] && cm.addClass(item['container'], item['size']);
            item['classes'] && cm.addClass(item['container'], item['classes']);
            item['hidden'] && cm.addClass(item['container'], 'is-hidden')
            // Controller
            if(item['constructor']){
                cm.getConstructor(item['constructor'], function(classConstructor){
                    item['controller'] = new classConstructor(
                        cm.merge(item['constructorParams'], {
                            'container' : item['container']
                        })
                    );
                });
            }
            // Embed
            if(cm.isNode(item['node'])){
                cm.appendChild(item['node'], item['container']);
            }
            cm.appendChild(item['container'], group['node']);
            group.items[item['name']] = item;
            that.items = cm.arrayAdd(that.items, item);
            that.toggleVisibility();
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.showField = function(name, groupName){
        var item = that.getField(name, groupName);
        if(item){
            item['hidden'] = false;
            cm.removeClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.hideField = function(name, groupName){
        var item = that.getField(name, groupName);
        if(item){
            item['hidden'] = true;
            cm.addClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.addButton = function(item){
        var group;
        item = cm.merge({
            'container' : cm.node('li'),
            'node' : null,
            'type' : 'primary',             // primary, secondary, success, danger, warning
            'name' : '',
            'label' : '',
            'title' : '',
            'group' : '',
            'access' : true,
            'disabled' : false,
            'hidden' : false,
            'className' : '',
            'attr' : {},
            'preventDefault' : true,
            'constructor' : false,
            'constructorParams' : {},
            'callback' : function(){}
        }, item);
        group = that.groups[item['group']];
        // Validate
        if(cm.isEmpty(item['name'])){
            item['name'] = item['label'];
        }
        // Render
        if(item['access'] && group && !group.items[item['name']]){
            // Structure
            item['node'] = cm.node('a', item['attr']);
            // Styles
            cm.addClass(item['node'], 'button');
            cm.addClass(item['node'], ['button', item['type']].join('-'));
            cm.addClass(item['node'], item['className']);
            item['disabled'] && cm.addClass(item['node'], 'button-disabled');
            item['hidden'] && cm.addClass(item['container'], 'is-hidden');
            // Label and title
            item['node'].innerHTML = item['label'];
            item['node'].title = item['title'];
            // Callbacks
            if(item['constructor']){
                cm.getConstructor(item['constructor'], function(classConstructor){
                    item['controller'] = new classConstructor(
                        cm.merge(item['constructorParams'], {
                            'node' : item['node']
                        })
                    );
                });
            }else{
                cm.addEvent(item['node'], 'click', function(e){
                    item['preventDefault'] && cm.preventDefault(e);
                    !item['disabled'] && item['callback'](e, item);
                });
            }
            cm.appendChild(item['node'], item['container']);
            cm.appendChild(item['container'], group['node']);
            group.items[item['name']] = item;
            that.items = cm.arrayAdd(that.items, item);
            that.toggleVisibility();
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.enableButton = function(name, groupName){
        var item = that.getButton(name, groupName);
        if(item){
            item['disabled'] = false;
            cm.removeClass(item['node'], 'button-disabled');
        }
        return that;
    };

    that.disableButton = function(name, groupName){
        var item = that.getButton(name, groupName);
        if(item){
            item['disabled'] = true;
            cm.addClass(item['node'], 'button-disabled');
        }
        return that;
    };

    that.showButton = function(name, groupName){
        var item = that.getButton(name, groupName);
        if(item){
            item['hidden'] = false;
            cm.removeClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.hideButton = function(name, groupName){
        var item = that.getButton(name, groupName);
        if(item){
            item['hidden'] = true;
            cm.addClass(item['container'], 'is-hidden');
        }
        return that;
    };

    that.addLabel = function(item){
        var group;
        item = cm.merge({
            'container' : cm.node('li', {'class' : 'label'}),
            'node' : null,
            'name' : '',
            'label' : '',
            'size' : null,
            'hidden' : false,
            'group' : null
        }, item);
        group = that.groups[item['group']];
        // Render
        if(group && !group.items[item['name']]){
            // Structure
            item['node'] = cm.node('div', {'innerHTML' : item['label']});
            // Styles
            item['size'] && cm.addClass(item['container'], item['size']);
            item['hidden'] && cm.addClass(item['container'], 'is-hidden');
            // Embed
            if(cm.isNode(item['node'])){
                cm.appendChild(item['node'], item['container']);
            }
            cm.appendChild(item['container'], group['node']);
            group.items[item['name']] = item;
            that.items = cm.arrayAdd(that.items, item);
            that.toggleVisibility();
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.getField = that.getButton = that.getLabel = function(name, groupName){
        var group = that.groups[groupName],
            item;
        if(group){
            item = group.items[name];
        }
        return item;
    };

    that.removeField = that.removeButton = that.removeLabel = function(name, groupName){
        var item, group;
        if(cm.isObject(arguments[0])){
            item = arguments[0];
            group = that.groups[item['group']];
        }else{
            group = that.groups[groupName];
            if(group){
                item = group.items[name];
            }
        }
        if(item){
            cm.remove(item['container']);
            delete group.items[item['name']];
            that.items = cm.arrayRemove(that.items, item);
            that.toggleVisibility();
        }
        that.triggerEvent('onProcessEnd');
        return that;
    };

    that.isEmpty = function(){
        return that.items.length === 0;
    };

    that.hide = function(){
        if(!that.isHidden){
            that.isHidden = true;
            cm.addClass(that.nodes['container'], 'is-hidden');
        }
        return that;
    };

    that.show = function(){
        if(that.isHidden){
            that.isHidden = false;
            cm.removeClass(that.nodes['container'], 'is-hidden');
        }
        return that;
    };

    that.toggleVisibility = function(){
        if(that.isEmpty()){
            that.hide();
        }else{
            that.show();
        }
        return that;
    };

    that.getNodes = function(key){
        return that.nodes[key] || that.nodes;
    };

    init();
});

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../http/tests/resources/permissions-helper.js"></script>
</head>
<body>
<script>
description("Tests navigator.requestMIDIAccess.");

shouldBeDefined("PermissionsHelper.setPermission");

var access;
var input;
var output;

function checkInputMap(inputs) {
    window.inputs = inputs;
    debug("for (var input of inputs.values())");
    for (var input of inputs.values()) {
        window.input = input;
        shouldBeEqualToString("input.id", "MockInputID");
        shouldBeEqualToString("input.manufacturer", "MockInputManufacturer");
        shouldBeEqualToString("input.name", "MockInputName");
        shouldBeEqualToString("input.version", "MockInputVersion");
        shouldBeEqualToString("input.state", "connected");
        shouldBeEqualToString("input.type", "input");
    }
    debug("for (var input of inputs.keys())");
    for (var key of inputs.keys()) {
        window.inputKey = key;
        shouldBeEqualToString("inputKey", "MockInputID");
    }
    debug("for (var input of inputs.entries())");
    for (var entry of inputs.entries()) {
        window.entry = entry;
        shouldBe("entry[0]", "inputKey");
        shouldBe("entry[1]", "input");
    }
    debug("for (var input of inputs)");
    for (var entry of inputs) {
        window.entry = entry;
        shouldBe("entry[0]", "inputKey");
        shouldBe("entry[1]", "input");
    }
    shouldBeTrue("inputs.has('MockInputID')");
    shouldBeFalse("inputs.has('MockOutputID')");
    shouldBe("inputs.get('MockInputID')", "input");
    shouldBeUndefined("inputs.get('MockOutputID')");
    debug("inputs.forEach(...)");
    inputs.forEach(function (input, key, map) {
        window.forEachInput = input;
        shouldBe("forEachInput", "input");
        window.forEachInputKey = key;
        shouldBe("forEachInputKey", "inputKey");
        window.forEachMap = map;
        shouldBe("forEachMap", "inputs");
    });
}

function checkOutputMap(outputs) {
    window.outputs = outputs;
    debug("for (var output of outputs.values())");
    for (var output of outputs.values()) {
        window.output = output;
        shouldBeEqualToString("output.id", "MockOutputID");
        shouldBeEqualToString("output.manufacturer", "MockOutputManufacturer");
        shouldBeEqualToString("output.name", "MockOutputName");
        shouldBeEqualToString("output.version", "MockOutputVersion");
        shouldBeEqualToString("output.state", "connected");
        shouldBeEqualToString("output.type", "output");
    }
    debug("for (var output of outputs.keys())");
    for (var key of outputs.keys()) {
        window.outputKey = key;
        shouldBeEqualToString("outputKey", "MockOutputID");
    }
    debug("for (var output of outputs.entries())");
    for (var entry of outputs.entries()) {
        window.entry = entry;
        shouldBe("entry[0]", "outputKey");
        shouldBe("entry[1]", "output");
    }
    debug("for (var output of outputs)");
    for (var entry of outputs) {
        window.entry = entry;
        shouldBe("entry[0]", "outputKey");
        shouldBe("entry[1]", "output");
    }
    shouldBeTrue("outputs.has('MockOutputID')");
    shouldBeFalse("outputs.has('MockInputID')");
    shouldBe("outputs.get('MockOutputID')", "output");
    shouldBeUndefined("outputs.get('MockInputID')");
    debug("outputs.forEach(...)");
    outputs.forEach(function (output, key, map) {
        window.forEachOutput = output;
        shouldBe("forEachOutput", "output");
        window.forEachOutputKey = key;
        shouldBe("forEachOutputKey", "outputKey");
        window.forEachMap = map;
        shouldBe("forEachMap", "outputs");
    });
}

function successCallback1(a) {
    access = a;

    testPassed("requestMIDIAccess() succeeded with access " + access + ".");

    // Validate the values of the attributes on the access.
    shouldBeDefined("access.sysexEnabled");
    shouldBeFalse("access.sysexEnabled");
    shouldBe("access.inputs.size", "1");
    shouldBe("access.outputs.size", "1");
    checkInputMap(access.inputs);
    checkOutputMap(access.outputs);

    window.output = access.outputs.values().next().value;
    // Test sending of MIDI data with a Uint8Array.
    var typedArrayData = new Uint8Array([0x90, 0x45, 0x7f]);
    output.send(typedArrayData);

    // Test sending of MIDI data with a regular Array.
    output.send([0x90, 0x45, 0x7f]);
    testPassed("a note on message is sent without timestamp");

    // Test sending of MIDI data with a regular Array giving an explicit timestamp.
    output.send([0x90, 0x45, 0x7f], performance.now());
    testPassed("a note on message is sent with timestamp");

    // Test sending of invalid MIDI data.
    shouldThrow('output.send([0xfff, 0x45, 0x7f])');

    // Test sending system exclusive messages. These should throw, since we don't have sysex access.
    shouldThrow('output.send([0xf0, 0x45, 0xf7])');

    // Now test System Exclusive access - our test mock should not allow this type of access.
    navigator.requestMIDIAccess({sysex: true}).then(successCallback2, errorCallback2);
}

function errorCallback1(error) {
    testFailed("requestMIDIAccess() error callback should not be called when requesting basic access.");
    finishJSTest();
}

function successCallback2(access) {
    testFailed("requestMIDIAccess() was not correctly blocked for System Exclusive access.");
    finishJSTest();
}

function errorCallback2(error) {
    testPassed("requestMIDIAccess() was correctly blocked for System Exclusive access with error " + error + ".");
    finishJSTest();
}

window.jsTestIsAsync = true;

// Set default permission behavior that grants non-sysex requests.
PermissionsHelper.setPermission('midi', 'granted').then(function() {
    // Test basic access, with no System Exclusive.
    navigator.requestMIDIAccess().then(successCallback1, errorCallback1);
});

</script>
</body>
</html>


text:
cmake_minimum_required(VERSION 2.6)

set(recast_SRCS
	Source/Recast.cpp
	Source/RecastArea.cpp
	Source/RecastAlloc.cpp
	Source/RecastContour.cpp
	Source/RecastFilter.cpp
	Source/RecastLayers.cpp
	Source/RecastMesh.cpp
	Source/RecastMeshDetail.cpp
	Source/RecastRasterization.cpp
	Source/RecastRegion.cpp
)

set(recast_HDRS
	Include/Recast.h
	Include/RecastAlloc.h
	Include/RecastAssert.h
)

include_directories(Include)

add_library(Recast ${recast_SRCS} ${recast_HDRS})

install(TARGETS
    Recast #Recast_dynamic
    RUNTIME DESTINATION bin
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib)

install(FILES ${recast_HDRS} DESTINATION include/Recast)


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>ActiveModel::Name</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.2.1

            Class
            ActiveModel::Name

                <

                    Object

/Users/tony/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb

Methods

#

                !~,

                <=>,

                ==,

                ===,

                =~

E

                eql?

H

                human

N

                new

T

                to_s,

                to_str

Included Modules

            Comparable

Attributes

              [R]

            cache_key

              [R]

            collection

              [R]

            element

              [R]

            i18n_key

              [R]

            name

              [R]

            param_key

              [R]

            plural

              [R]

            route_key

              [R]

            singular

              [R]

            singular_route_key

Class Public methods

              new(klass, namespace = nil, name = nil)

            Link

Returns a new ActiveModel::Name instance. By
default, the namespace and name option will take
the namespace and name of the given class respectively.

module Foo
  class Bar
  end
end

ActiveModel::Name.new(Foo::Bar).to_s
# => "Foo::Bar"

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 146
def initialize(klass, namespace = nil, name = nil)
  @name = name || klass.name

  raise ArgumentError, "Class name cannot be blank. You need to supply a name argument when anonymous class given" if @name.blank?

  @unnamespaced = @name.sub(/^#{namespace.name}::/, '') if namespace
  @klass        = klass
  @singular     = _singularize(@name)
  @plural       = ActiveSupport::Inflector.pluralize(@singular)
  @element      = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(@name))
  @human        = ActiveSupport::Inflector.humanize(@element)
  @collection   = ActiveSupport::Inflector.tableize(@name)
  @param_key    = (namespace ? _singularize(@unnamespaced) : @singular)
  @i18n_key     = @name.underscore.to_sym

  @route_key          = (namespace ? ActiveSupport::Inflector.pluralize(@param_key) : @plural.dup)
  @singular_route_key = ActiveSupport::Inflector.singularize(@route_key)
  @route_key << "_index" if @plural == @singular
end

Instance Public methods

              !~(regexp)

            Link

Equivalent to String#!~. Match the class name against the
given regexp. Returns true if there is no match, otherwise
false.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name !~ /Post/ # => false
BlogPost.model_name !~ /\d/   # => true

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 95

              ==(other)

            Link

Equivalent to String#<=>.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name <=> 'BlogPost'  # => 0
BlogPost.model_name <=> 'Blog'      # => 1
BlogPost.model_name <=> 'BlogPosts' # => -1

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 62

              ==(other)

            Link

Equivalent to String#==. Returns true if the
class name and other are equal, otherwise false.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name == 'BlogPost'  # => true
BlogPost.model_name == 'Blog Post' # => false

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 31

              ===(other)

            Link

Equivalent to #==.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name === 'BlogPost'  # => true
BlogPost.model_name === 'Blog Post' # => false

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 46

              =~(regexp)

            Link

Equivalent to String#=~. Match the class name against the
given regexp. Returns the position where the match starts or
nil if there is no match.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name =~ /Post/ # => 4
BlogPost.model_name =~ /\d/   # => nil

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 79

              eql?(other)

            Link

Equivalent to String#eql?. Returns true if the
class name and other have the same length and content,
otherwise false.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name.eql?('BlogPost')  # => true
BlogPost.model_name.eql?('Blog Post') # => false

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 111

              human(options={})

            Link

Transform the model name into a more humane format, using I18n. By default, it will underscore then humanize
the class name.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name.human # => "Blog post"

Specify options with additional translating options.

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 176
def human(options={})
  return @human unless @klass.respond_to?(:lookup_ancestors) &&
                       @klass.respond_to?(:i18n_scope)

  defaults = @klass.lookup_ancestors.map do |klass|
    klass.model_name.i18n_key
  end

  defaults << options[:default] if options[:default]
  defaults << @human

  options = { scope: [@klass.i18n_scope, :models], count: 1, default: defaults }.merge!(options.except(:default))
  I18n.translate(defaults.shift, options)
end

              to_s()

            Link

Returns the class name.

class BlogPost
  extend ActiveModel::Naming
end

BlogPost.model_name.to_s # => "BlogPost"

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 125

              to_str()

            Link

Equivalent to to_s.

                Source:
                show

# File ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activemodel-4.2.1/lib/active_model/naming.rb, line 132
delegate :==, :===, :<=>, :=~, :"!~", :eql?, :to_s,
         :to_str, to: :name


text:
package org.apache.hadoop.hive.ql.udf;

import junit.framework.TestCase;

import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge;
import org.junit.Test;

public class TestUDFUUID extends TestCase {
  @Test
  public void testUUID() throws Exception {
    UDFUUID udf = new UDFUUID();

    String id1 = udf.evaluate().toString();
    String id2 = udf.evaluate().toString();

    assertFalse(id1.equals(id2));

    assertEquals(id1.length(), 36);
    assertEquals(id2.length(), 36);

    GenericUDFBridge bridge = new GenericUDFBridge("uuid", false, UDFUUID.class.getName());
    assertFalse(FunctionRegistry.isDeterministic(bridge));
  }
}


text:
package de.learnlib.alex.integrationtests.resources.api;

import de.learnlib.alex.modelchecking.entities.LtsFormulaSuite;
import java.util.List;
import java.util.stream.Collectors;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

public class LtsFormulaSuiteApi extends AbstractApi {

    public LtsFormulaSuiteApi(Client client, int port) {
        super(client, port);
    }

    public Response create(Long projectId, LtsFormulaSuite suite, String jwt) {
        return client.target(url(projectId)).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .post(Entity.json(suite));
    }

    public Response getAll(Long projectId, String jwt) {
        return client.target(url(projectId)).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .get();
    }

    public Response get(Long projectId, Long suiteId, String jwt) {
        return client.target(url(projectId, suiteId)).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .get();
    }

    public Response delete(Long projectId, Long suiteId, String jwt) {
        return client.target(url(projectId, suiteId)).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .delete();
    }

    public Response deleteAll(Long projectId, List<Long> suiteIds, String jwt) {
        final String ids = suiteIds.stream()
                .map(String::valueOf)
                .collect(Collectors.joining(","));

        return client.target(url(projectId) + "/batch/" + ids).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .delete();
    }

    public Response update(Long projectId, Long suiteId, LtsFormulaSuite suite, String jwt) {
        return client.target(url(projectId, suiteId)).request()
                .header(HttpHeaders.AUTHORIZATION, jwt)
                .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON)
                .put(Entity.json(suite));
    }

    private String url(Long projectId) {
        return baseUrl() + "/projects/" + projectId + "/ltsFormulaSuites";
    }

    private String url(Long projectId, Long suiteId) {
        return baseUrl() + "/projects/" + projectId + "/ltsFormulaSuites/" + suiteId;
    }
}


text:
namespace stNet.CurlSharp
{
    /// <summary>
    ///     Contains return codes for many of the functions in the
    ///     <see cref="CurlMulti" /> class.
    /// </summary>
    public enum CurlMultiCode
    {
        /// <summary>
        ///     You should call <see cref="CurlMulti.Perform" /> again before calling
        ///     <see cref="CurlMulti.Select" />.
        /// </summary>
        CallMultiPerform = -1,

        /// <summary>
        ///     The function succeded.
        /// </summary>
        Ok = 0,

        /// <summary>
        ///     The internal <see cref="CurlMulti" /> is bad.
        /// </summary>
        BadHandle = 1,

        /// <summary>
        ///     One of the <see cref="CurlEasy" /> handles associated with the
        ///     <see cref="CurlMulti" /> object is bad.
        /// </summary>
        BadEasyHandle = 2,

        /// <summary>
        ///     Out of memory. This is a severe problem.
        /// </summary>
        OutOfMemory = 3,

        /// <summary>
        ///     Internal error deep within the libcurl library.
        /// </summary>
        InternalError = 4,

        /// <summary>
        ///     End-of-enumeration marker, not used.
        /// </summary>
        Last = 5
    };
}


text: copyright &copy monjok travel 2014


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using System.Linq;

using MyTypes;
//TODO: this is now too specific to the player, make generic compo later
[AddComponentMenu("Custom Components/DeathComponent")]
[RequireComponent(typeof(Rigidbody))]
public class DeathComponent : Interactable {
    [Tooltip("Simply your health")]
    public int tempHitpoints = 100;
    [Tooltip("This is how fast you heal or die")]
    public float drainTimeStep = 0.1f;
    [Tooltip("This is how many points you lose in one hit")]
    private int drainagePoints = 1;
    private int origHitpoints;
    private bool beingHit = false;
    private bool quickDeath = false;
    private float nextFire = 0;
    private float depletionRation = 0;

    [SerializeField]
    private Image m_healthBar;
    [SerializeField]
    private Text m_deathMessage;
    [SerializeField]
    private string m_bulletTag = "Bullet";
    [SerializeField]
    private string m_deathTag = "DeathZone";
    [SerializeField]
    private string m_spawnPointTag = "SpawnPoint";

    private Transform m_lastSpawnPoint;
    StoreTransform saveTrans;
    private bool m_respawning = false;
    public bool isDead = false;

    //handle multiple hits
    ArrayList uniqueInvokers = new ArrayList();
    private bool isFirstHit = true;
    private static int concurrencyCount = 0;

    //quick shader effect only applicable to player
    //add animation curve later
    Vingette deathVig;

    protected override void Init() {
        AssignInteractionType(Interaction.DEATH);
        AssignStart(MyStart);
        AssignUpdate(MyUpdate);
    }

    private void MyStart() {
        deathVig = Camera.main.gameObject.GetComponent<Vingette>();
        saveTrans = this.gameObject.transform.Save().Position();
        m_lastSpawnPoint = null;
        print("last spawn point" + m_lastSpawnPoint);
        Debug.Log("DeathComponent: Starting...");
        origHitpoints = tempHitpoints;
    }

    private void MyUpdate(float deltaTime) {
        if (!isDead && !m_respawning) {
            if (beingHit) {
                StartDeath(true);
            } else if (quickDeath) {
                quickDeath = false;
                StartDeath(false);
            } else {
                Heal();
            }
        }
    }

    void StartDeath(bool normalDeath) {
        if (!normalDeath && !m_respawning) {
            m_healthBar.fillAmount = 0;
            m_deathMessage.text = "You Died!";
            isDead = true;

            StartCoroutine(Respawn());
        } else if (Time.time > nextFire && !m_respawning) {
            SwitchVignette(true);
            nextFire = Time.time + drainTimeStep;
            tempHitpoints -= drainagePoints;
            m_healthBar.fillAmount = (float)tempHitpoints / (float)origHitpoints;
            print("health: " + tempHitpoints);
            if (tempHitpoints <= 0) {
                m_healthBar.fillAmount = 0;
                m_deathMessage.text = "You Died!";
                isDead = true;
                StartCoroutine(Respawn());
            } else {
                m_deathMessage.text = "";
            }
        }
        uniqueInvokers.Clear();
        beingHit = false;
    }

    void Heal() {
        if (tempHitpoints <= origHitpoints - depletionRation) {
            //ala COD, same ratio as ROF
            if (Time.time > nextFire) {
                SwitchVignette(false);
                nextFire = Time.time + drainTimeStep;
                tempHitpoints++;
                depletionRation++;
                m_healthBar.fillAmount = (float)tempHitpoints / (float)origHitpoints;
                print("health: " + tempHitpoints);
            }
        }
    }

    void OnTriggerEnter(Collider other) {
        if (other.CompareTag(m_deathTag) && !m_respawning) {
            print(this + ": NEED A FLAG HERE TO PREVENT THESE FROM CALLING TWICE (OR MORE)");
            quickDeath = true;
        }

        if (other.CompareTag(m_spawnPointTag))
            m_lastSpawnPoint = other.gameObject.transform;
    }
    // place your custom logic here for interaction
    protected override void Commit(InteractMessage msg) {
        //object[] objects = new object[msg.msgData.Count];
        //poll unique invoker
        foreach (object[] id in msg.msgData) {
            int inID = (int)id[0];
            if (!uniqueInvokers.Contains(inID)) {
                uniqueInvokers.Add(inID);
            }
        }
        drainagePoints = uniqueInvokers.Count;
        print(drainagePoints);
        //int incomingmsgs = (int)((ArrayList)msg.msgData[0])[0]);
        //for (int i = 0; i < msg.msgData.Count; i++) {
        //    uniqueInvokers.Add msg.msgData[i];
        //}

        //int objectUID = (int)msg.msgData.FirstOrDefault<object>();
        //int objectsUID =
        //print(objectUID);

        //msg.msgData.CopyTo(objects, 0);
        //check if we have it
        //MULTIPLE; time step for the beam hp drainage

        //if (objects.Length > 0)
        //    print("invokers: ") + objects[isFirstHit];
        //    //if (objects[0].GetType() == typeof(float)) {
        //    //    drainTimeStep = (int)objects[0];
        //    //}
        Debug.Log(this + ": " + msg.msg);
        switch (msg.msg) {
            case "SENDHITS":
                beingHit = true;
                break;
            case "INSTAKILL":
                //short circuit death proc
                quickDeath = true;
                break;
        }
    }
    private IEnumerator Respawn() {
        print("RESPAWNING");
        m_respawning = true;
        yield return new WaitForSeconds(2);
        if (m_lastSpawnPoint != null) {
            transform.position = m_lastSpawnPoint.position;
        } else {
            this.transform.Load(saveTrans).Position();
            //transform.position;
        }
        //reset everything
        isDead = false;
        tempHitpoints = origHitpoints;
        m_deathMessage.text = "";
        depletionRation = 0;
        m_respawning = false;
        deathVig.ResetVignette();
    }

    void SwitchVignette(bool switcher) {
        if (tempHitpoints < origHitpoints / 2) {
            float normalVigDeplete = Remap(drainagePoints, 0, origHitpoints / 2, 0, 1);
            deathVig.ConvergeVignette(switcher, normalVigDeplete);
        }
    }

    // TODO add this to a universal extension method...
    float Remap(float value, float from1, float to1, float from2, float to2) {
        return (value - from1) / (to1 - from1) * (to2 - from2) + from2;
    }
}


text:
<?php

use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;

// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);

// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}

require __DIR__.'/../vendor/autoload.php';
Debug::enable();

$kernel = new AppKernel('dev', true);
if (PHP_VERSION_ID < 70000) {
    $kernel->loadClassCache();
}
$request = Request::createFromGlobals();
Request::setTrustedProxies(
// trust *all* requests
    array('127.0.0.1', $request->server->get('REMOTE_ADDR')),
    Request::HEADER_X_FORWARDED_ALL
);
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);


text:
Ext.define('acesure.config.view.system.SystemSafetyConfigWindow', {
	extend : 'Ext.window.Window',
	alias : 'widget.safetyConfigWin',
	id : 'safetyConfigWin',
	width:500,
	title:local.config.sysSafetyConfig,
	border:false,
	buttonAlign:"right",
	modal:true,

	initComponent : function(){
		var me = this;

		Ext.applyIf(me, {
			items : [{
				xtype:'tabpanel',
				margin:"10 0 0 0",
				cls:"tab_big",
				plain:true,
				activeTab:0,
				border:false,
				bodyBorder:false,
				items:[
					{
						title:local.config.loginAccess,
						border:false,
						style:"border-top:1px solid #ccc;",
						items:[{
								style:"margin-top:5px",
								border:false,
								bodyBorder:false,
								padding:10,
								items:[
									{
										xtype:'fieldset',
										checkboxToggle:true,
										title: local.config.errorLoginAccessLimit,
										id:'isStartLoginErrorLimit',
										collapsible: true,
										defaults:{
											width:440,
											labelAlign:"left",
											labelWidth:180
										},
										autoHeight:true,
										items:[
											{
												xtype:'numberfield',
												id:'loginErrorCount',
												fieldLabel:local.config.errorLoginAccessLimitTime,
												minValue: ERROR_LOGIN_MIN_COUNT,
												maxValue: ERROR_LOGIN_MAX_COUNT,
												minText: local.config.minText+ERROR_LOGIN_MIN_COUNT,
												maxText: local.config.maxText+ERROR_LOGIN_MAX_COUNT,
												msgTarget: 'under',
												allowBlank : false,
												blankText : local.config.loginErrorLimitTimeNoNull,
												listeners:{
													change: function(field, newValue, oldValue){
														setIntFieldExt(field, newValue, oldValue)
													}
												}
											},{
												xtype:'numberfield',
												id:'loginErrorMinute',
												fieldLabel:local.config.limitErrorLoginTime,
												//labelWidth:180,
												//width:300,
												minValue: LOCK_LOGIN_MIN_MINUTE,
												maxValue: LOCK_LOGIN_MAX_MINUTE,
												minText: local.config.minText+LOCK_LOGIN_MIN_MINUTE,
												maxText: local.config.maxText+LOCK_LOGIN_MAX_MINUTE,
												msgTarget: 'under',
												allowBlank : false,
												blankText : local.config.loginErrorLimitLockTimeNoNull,
												listeners:{
													change: function(field, newValue, oldValue){
														setIntFieldExt(field, newValue, oldValue);
													}
												}

											}
										]
									},{
										xtype:'fieldset',
										checkboxToggle:true,
										title: local.config.IPloginLimit,
										id:'isStartLimitIp',
										collapsible: true,
										autoHeight:true,
										defaults:{
											width:440,
											labelAlign:"left",
											labelWidth:180
										},
										items:[
											{
												xtype:'textareafield',
												id:'limitIp',
												fieldLabel:local.IP,
												msgTarget: 'under',
												emptyText:local.config.noLimit,
												allowBlank : false,
												blankText : local.config.IPNoNull
											}
										]
									},{
										xtype:'fieldset',
										title: local.explain,
										collapsible: false,
										padding:10,
										html:local.config.safetyConfigMsg
									}
								]}
					       	]},
					{
						title:local.config.sysSafetyConfig,
						border:false,
						style:"border-top:1px solid #ccc;",
						items:[{
							style:"margin-top:5px",
							border:false,
							margin:10,
							items:[
								{
									xtype:'fieldset',
									title: local.config.codeOutTip,
									checkboxToggle:true,
									id: 'pwdIsExpired',
									collapsible: true,
									autoHeight:true,
									labelWidth:120,
									defaults:{
										width:440,
										labelAlign:"left",
										labelWidth:180
									},
									items:[
										{
											xtype:'numberfield',
											id:'pwdExpiredDay',
											//labelWidth:180,
											fieldLabel:local.config.accountCodePastTime,
											minValue: PASSWORD_OUTDATE_MIN_DAY,
											maxValue: PASSWORD_OUTDATE_MAX_DAY,
											minText: local.config.minText+PASSWORD_OUTDATE_MIN_DAY,
											maxText: local.config.maxText+PASSWORD_OUTDATE_MAX_DAY,
											msgTarget: 'under',
											allowBlank : false,
											blankText : local.config.codePastTimeNoNull,
											listeners:{
												change: function(field, newValue, oldValue){
													setIntFieldExt(field, newValue, oldValue);
												}
											}
										}
									]
								},{
									xtype:'fieldset',
									title: local.config.codeCheck,
									checkboxToggle:true,
									id: 'isPwdCheck',
									collapsible: true,
									autoHeight:true,
									labelWidth:120,
									defaults:{
										width:440,
										labelAlign:"left",
										labelWidth:180
									},
									items:[
										{
											xtype:'combo',
											mode: 'local',
											fieldLabel:local.config.codeCheckType,
											//labelWidth:180,
											id:'pwdCheckType',
											name:'pwdCheckType',
											store:new Ext.data.SimpleStore({
												fields: ["value", "text"],
												data: [['0',local.config.checkNo],['1',local.config.letterNum]]
											}),
											valueField :"value",
											displayField: "text",
											value:'0',
											editable:false,
											triggerAction:"all"
										},
										{
											xtype:'numberfield',
											id:'pwdLength',
											//labelWidth:180,
											minValue:PASSWORD_MIN_LENGTH,
											maxValue:PASSWORD_MAX_LENGTH,
											fieldLabel:local.config.codeMinLength,
											minText: local.config.minText+PASSWORD_MIN_LENGTH,
											maxText: local.config.maxText+PASSWORD_MAX_LENGTH,
											msgTarget: 'under',
											allowBlank : false,
											blankText : local.config.codeLenghtNoNull,
											listeners:{
												change: function(field, newValue, oldValue){
													setIntFieldExt(field, newValue, oldValue);
												}
											}
										}
									]
								},{
									xtype:'fieldset',
									title: local.explain,
									collapsible: false,
									autoHeight:true,
									padding:10,
									html:local.config.safetyConfigAccountMsg
								}
							]
						}]}
				]
			}
		    ],
			buttons : [{
			            text:local.btn.save,
			            cls:"btn_focus",
			            id:'serverSafetyConfigSaveBtn'
	    			},{
						text : local.btn.cancle,
						handler : function() {
							this.up('window').close();
						}
	    			}]
		}
	)
		me.callParent(arguments);
	}
})


text:
namespace HanRuEdu.LDAL
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    [MetadataType(typeof(EDU_ZZFC_08_01_XSSS_metadata))]
    public partial class EDU_ZZFC_08_01_XSSS
    {
        public EDU_ZZFC_08_01_XSSS()
        {
            SSLBM = "";
            FJBM = "";
            RZXB = "";
            SFKY = "";
            SSM = "";
        }
        public class EDU_ZZFC_08_01_XSSS_metadata
        {
            [Required(ErrorMessage = "±ØÌî")]
            [Display(Name = "񅧏")]
            public Int32 ID { get; set; }

            [Required(ErrorMessage = "±ØÌî")]
            [Display(Name = "ѧУÃû")]
            public Int32 SCHOOLID { get; set; }

            [Required(ErrorMessage = "±ØÌî")]
            [Display(Name = "ËÞÉáÂ¥")]
            public Int32 SSLID { get; set; }

            [Required(ErrorMessage = "±ØÌî",AllowEmptyStrings = true)]
            [Display(Name = "ËÞÉáÂ¥±àºÅ")]
            [StringLength(6)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String SSLBM { get; set; }

            [Required(ErrorMessage = "±ØÌî",AllowEmptyStrings = true)]
            [Display(Name = "·¿¼ä±àºÅ")]
            [StringLength(10)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String FJBM { get; set; }

            [Required(ErrorMessage = "±ØÌî",AllowEmptyStrings = true)]
            [Display(Name = "ÈëסÐÔ±ð")]
            [StringLength(1)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String RZXB { get; set; }

            [Required(ErrorMessage = "±ØÌî",AllowEmptyStrings = true)]
            [Display(Name = "ÊÇ·ñ¿ÉÓÃ")]
            [StringLength(1)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String SFKY { get; set; }

            [Required(ErrorMessage = "±ØÌî")]
            [Display(Name = "¿ÉסÈËÊý")]
            [Range(typeof(decimal), "0", "99")]
            public decimal KZRS { get; set; }

            [Display(Name = "ÍøÂç¶Ë¿Ú")]
            [StringLength(20)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String WLDK { get; set; }

            [Display(Name = "°²×°µçÊÓ»ú")]
            [StringLength(1)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String AZDSJ { get; set; }

            [Display(Name = "µç»°¶Ë¿Ú")]
            [StringLength(20)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String DHDK { get; set; }

            [Display(Name = "µç»°ºÅÂë")]
            [StringLength(20)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String DHHM { get; set; }

            [Display(Name = "Ë®±íµ×Êý")]
            [Range(typeof(decimal), "0", "9999999999")]
            public decimal SBDS { get; set; }

            [Display(Name = "µç±íµ×Êý")]
            [Range(typeof(decimal), "0", "9999999999")]
            public decimal DBDS { get; set; }

            [Display(Name = "ËÞÉᱸע")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String SSBZ { get; set; }

            [Required(ErrorMessage = "±ØÌî")]
            [Display(Name = "ËùÔÚÂ¥²ã")]
            public Int32 SZLZ { get; set; }

            [Required(ErrorMessage = "±ØÌî",AllowEmptyStrings = true)]
            [Display(Name = "ËÞÉáÃû")]
            [StringLength(128)]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            public String SSM { get; set; }

        }
    }
}


text:
package com.gemstone.gemfire.management.internal.configuration;

import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import com.gemstone.gemfire.cache.Cache;
import com.gemstone.gemfire.cache.DiskStoreFactory;
import com.gemstone.gemfire.cache.RegionFactory;
import com.gemstone.gemfire.cache.RegionShortcut;
import com.gemstone.gemfire.cache30.CacheTestCase;
import com.gemstone.gemfire.distributed.Locator;
import com.gemstone.gemfire.distributed.internal.DM;
import com.gemstone.gemfire.distributed.internal.DistributionConfig;
import com.gemstone.gemfire.distributed.internal.InternalLocator;
import com.gemstone.gemfire.distributed.internal.SharedConfiguration;
import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
import com.gemstone.gemfire.distributed.internal.tcpserver.TcpClient;
import com.gemstone.gemfire.internal.AvailablePort;
import com.gemstone.gemfire.internal.AvailablePortHelper;
import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
import com.gemstone.gemfire.internal.cache.xmlcache.CacheXml;
import com.gemstone.gemfire.management.internal.configuration.domain.Configuration;
import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity;
import com.gemstone.gemfire.management.internal.configuration.domain.XmlEntity.XmlEntityBuilder;
import com.gemstone.gemfire.management.internal.configuration.handlers.ConfigurationRequestHandler;
import com.gemstone.gemfire.management.internal.configuration.messages.ConfigurationRequest;
import com.gemstone.gemfire.management.internal.configuration.messages.ConfigurationResponse;

import dunit.DistributedTestCase;
import dunit.Host;
import dunit.SerializableCallable;
import dunit.SerializableRunnable;
import dunit.VM;

/***
 * Tests the starting up of shared configuration, installation of {@link ConfigurationRequestHandler}
 * and {@link ConfigurationChangeHandler}
 * @author bansods
 *
 */
public class SharedConfigurationDUnitTest extends CacheTestCase {
  private static final long serialVersionUID = 1L;
  private static final String REGION1 = "region1";
  private static final int TIMEOUT = 10000;
  private static final int INTERVAL = 500;
  private static final String DISKSTORENAME = "diskStore1";

//  private static final VM locator1Vm = Host.getHost(0).getVM(1);
//  private static final VM locator2Vm = Host.getHost(0).getVM(2);
//  private static final VM dataMemberVm = Host.getHost(0).getVM(3);

  public static final SerializableRunnable locatorCleanup = new SerializableRunnable() {
    @Override
    public void run() {
      InternalLocator locator = InternalLocator.getLocator();
      if (locator != null) {
        SharedConfiguration sharedConfig = locator.getSharedConfiguration();
        if (sharedConfig != null) {
          sharedConfig.destroySharedConfiguration();
        }
        locator.stop();
      }
      disconnectAllFromDS();
    }
  };

  public SharedConfigurationDUnitTest(String name) {
    super(name);
  }

  public void testGetHostedLocatorsWithSharedConfiguration() {
    disconnectAllFromDS();
    final VM locator1Vm = Host.getHost(0).getVM(1);
    final VM locator2Vm = Host.getHost(0).getVM(2);

    final String testName = "testGetHostedLocatorsWithSharedConfiguration";
//    final VM locator3Vm = Host.getHost(0).getVM(3);

    final int []ports = AvailablePortHelper.getRandomAvailableTCPPorts(3);

    //final int locator1Port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
    final int locator1Port = ports[0];
    final String locator1Name = "locator1" + locator1Port;
    locator1Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() {
        final File locatorLogFile = new File(testName + "-locator-" + locator1Port + ".log");
        final Properties locatorProps = new Properties();
        locatorProps.setProperty(DistributionConfig.NAME_NAME, locator1Name);
        locatorProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
        locatorProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
        locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "true");
        try {
          final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator1Port, locatorLogFile, null,
              locatorProps);

          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
            @Override
            public boolean done() {
              return locator.isSharedConfigurationRunning();
            }

            @Override
            public String description() {
              return "Waiting for shared configuration to be started";
            }
          };
          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
        } catch (IOException ioex) {
          fail("Unable to create a locator with a shared configuration");
        }
        GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
        InternalDistributedMember me = cache.getMyId();
        DM dm = cache.getDistributionManager();
        Map<InternalDistributedMember, Collection<String>> hostedLocators = dm.getAllHostedLocators();
        assertFalse(hostedLocators.isEmpty());
        Map<InternalDistributedMember, Collection<String>> hostedLocatorsWithSharedConfiguration = dm.getAllHostedLocatorsWithSharedConfiguration();
        assertFalse(hostedLocatorsWithSharedConfiguration.isEmpty());

        assertNotNull(hostedLocators.get(me));
        assertNotNull(hostedLocatorsWithSharedConfiguration.get(me));
        return null;
      }
    });

    //final int locator2Port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
    final int locator2Port = ports[1];
    final String locator2Name = "locator2" + locator2Port;

    locator2Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() throws IOException {
        final File locatorLogFile = new File(testName + "-locator-" + locator2Port + ".log");
        final Properties locatorProps = new Properties();
        locatorProps.setProperty(DistributionConfig.NAME_NAME, locator2Name);
        locatorProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
        locatorProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, "fine");
        locatorProps.setProperty(DistributionConfig.LOCATORS_NAME, "localhost:" + locator1Port);
        locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "false");
        final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator2Port, locatorLogFile, null,
            locatorProps);

        GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
        InternalDistributedMember me = cache.getMyId();
        DM dm = cache.getDistributionManager();
        Map<InternalDistributedMember, Collection<String>> hostedLocators = dm.getAllHostedLocators();
        assertFalse(hostedLocators.isEmpty());
        Map<InternalDistributedMember, Collection<String>> hostedLocatorsWithSharedConfiguration = dm.getAllHostedLocatorsWithSharedConfiguration();
        assertFalse(hostedLocatorsWithSharedConfiguration.isEmpty());
        assertNotNull(hostedLocators.get(me));
        assertNull(hostedLocatorsWithSharedConfiguration.get(me));
        assertTrue(hostedLocators.size() == 2);
        assertTrue(hostedLocatorsWithSharedConfiguration.size() == 1);

        Set<InternalDistributedMember> locatorsWithSharedConfig = hostedLocatorsWithSharedConfiguration.keySet();
        Set<String> locatorsWithSharedConfigNames = new HashSet<String>();

        for (InternalDistributedMember locatorWithSharedConfig : locatorsWithSharedConfig) {
          locatorsWithSharedConfigNames.add(locatorWithSharedConfig.getName());
        }
        assertTrue(locatorsWithSharedConfigNames.contains(locator1Name));

        return null;
      }
    });

    locator1Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() {
        InternalLocator locator = (InternalLocator) Locator.getLocator();
        SharedConfiguration sharedConfig = locator.getSharedConfiguration();
        sharedConfig.destroySharedConfiguration();
        locator.stop();
        return null;
      }
    });

    locator2Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() {
        GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
        InternalDistributedMember me = cache.getMyId();
        DM dm = cache.getDistributionManager();
        Map<InternalDistributedMember, Collection<String>> hostedLocators = dm.getAllHostedLocators();
        assertFalse(hostedLocators.isEmpty());
        Map<InternalDistributedMember, Collection<String>> hostedLocatorsWithSharedConfiguration = dm.getAllHostedLocatorsWithSharedConfiguration();
        assertTrue(hostedLocatorsWithSharedConfiguration.isEmpty());
        assertNotNull(hostedLocators.get(me));
        assertNull(hostedLocatorsWithSharedConfiguration.get(me));
        assertTrue(hostedLocators.size() == 1);
        assertTrue(hostedLocatorsWithSharedConfiguration.size() == 0);
        return null;
      }
    });

//    locator2Vm.invoke(new SerializableCallable() {
//      public Object call() {
//        InternalLocator locator = (InternalLocator) Locator.getLocator();
//        SharedConfiguration sharedConfig = locator.getSharedConfiguration();
//        if (sharedConfig != null) {
//          sharedConfig.destroySharedConfiguration();
//        }
//        locator.stop();
//        return null;
//      }
//    });
  }

  public void testSharedConfigurationService() {
    disconnectAllFromDS();
    // Start the Locator and wait for shared configuration to be available
    final String testGroup = "G1";
    final String clusterLogLevel = "error";
    final String groupLogLevel = "fine";
    final String testName = "testSharedConfigurationService";

    final VM locator1Vm = Host.getHost(0).getVM(1);
    final VM locator2Vm = Host.getHost(0).getVM(3);
    final VM dataMemberVm = Host.getHost(0).getVM(2);
    final int [] ports = AvailablePortHelper.getRandomAvailableTCPPorts(3);
    final int locator1Port = ports[0];

    locator1Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() {
        final File locatorLogFile = new File(testName + "-locator-" + locator1Port + ".log");
        final Properties locatorProps = new Properties();
        locatorProps.setProperty(DistributionConfig.NAME_NAME, "Locator1");
        locatorProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
        locatorProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info");
        locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "true");
        try {
          final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator1Port, locatorLogFile, null,
              locatorProps);
          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
            @Override
            public boolean done() {
              return locator.isSharedConfigurationRunning();
            }

            @Override
            public String description() {
              return "Waiting for shared configuration to be started";
            }
          };
          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
        } catch (IOException ioex) {
          fail("Unable to create a locator with a shared configuration");
        }

        return null;
      }
    });

    dataMemberVm.invoke(new SerializableCallable() {
      @Override
      public Object call() {
        Properties localProps = new Properties();
        localProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
        localProps.setProperty(DistributionConfig.LOCATORS_NAME, "localhost:" + locator1Port);
        localProps.setProperty(DistributionConfig.GROUPS_NAME, testGroup);
        getSystem(localProps);
        Cache cache = getCache();
        assertNotNull(cache);
        DiskStoreFactory dsFactory = cache.createDiskStoreFactory();
        File dsDir = new File("dsDir");
        if (!dsDir.exists()) {
          dsDir.mkdir();
        }
        dsFactory.setDiskDirs(new File[] {dsDir});
        dsFactory.create(DISKSTORENAME);

        RegionFactory regionFactory = getCache().createRegionFactory(RegionShortcut.REPLICATE);
        regionFactory.create(REGION1);

        XmlEntity xmlEntity = new XmlEntity(CacheXml.REGION, "name", REGION1);
        final SharedConfigurationWriter scw = new SharedConfigurationWriter();
        assertTrue(scw.addXmlEntity(xmlEntity, new String[] {testGroup}));

        xmlEntity = new XmlEntity(CacheXml.DISK_STORE, "name", DISKSTORENAME);
        assertTrue(scw.addXmlEntity(xmlEntity, new String[] {testGroup}));
        //Modify property and cache attributes
        Properties clusterProperties = new Properties();
        clusterProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, clusterLogLevel);
        XmlEntity cacheEntity = XmlEntity.builder().withType(CacheXml.CACHE).build();
        Map<String, String> cacheAttributes = new HashMap<String, String>();
        cacheAttributes.put(CacheXml.COPY_ON_READ, "true");

        //assertTrue(scw.modifyProperties(clusterProperties, null));
        assertTrue(scw.modifyPropertiesAndCacheAttributes(clusterProperties, cacheEntity, null));

        clusterProperties.setProperty(DistributionConfig.LOG_LEVEL_NAME, groupLogLevel);
        assertTrue(scw.modifyPropertiesAndCacheAttributes(clusterProperties, cacheEntity, new String[]{testGroup}));

        //Add a jar
        byte[][] jarBytes = new byte[1][];
        jarBytes[0] = "Hello".getBytes();
        assertTrue(scw.addJars(new String[]{"foo.jar"}, jarBytes, null));

        //Add a jar for the group
        jarBytes = new byte[1][];
        jarBytes[0] = "Hello".getBytes();
        assertTrue(scw.addJars(new String[]{"bar.jar"}, jarBytes, new String[]{testGroup}));
        return null;
      }
    });

    final int locator2Port = ports[1];

    //Create another locator in VM2
    locator2Vm.invoke(new SerializableCallable() {
      @Override
      public Object call() throws Exception {

        final File locatorLogFile = new File(testName + "-locator-" + locator2Port + ".log");
        final Properties locatorProps = new Properties();
        locatorProps.setProperty(DistributionConfig.NAME_NAME, "Locator2");
        locatorProps.setProperty(DistributionConfig.MCAST_PORT_NAME, "0");
        locatorProps.setProperty(DistributionConfig.LOG_LEVEL_NAME, "info");
        locatorProps.setProperty(DistributionConfig.ENABLE_CLUSTER_CONFIGURATION_NAME, "true");
        locatorProps.setProperty(DistributionConfig.LOCATORS_NAME, "localhost:" + locator1Port);
        try {
          final InternalLocator locator = (InternalLocator) Locator.startLocatorAndDS(locator2Port, locatorLogFile, null,
              locatorProps);

          DistributedTestCase.WaitCriterion wc = new DistributedTestCase.WaitCriterion() {
            @Override
            public boolean done() {
              return locator.isSharedConfigurationRunning();
            }

            @Override
            public String description() {
              return "Waiting for shared configuration to be started";
            }
          };
          DistributedTestCase.waitForCriterion(wc, TIMEOUT, INTERVAL, true);
        } catch (IOException ioex) {
          fail("Unable to create a locator with a shared configuration");
        }

        InternalLocator locator = (InternalLocator) Locator.getLocator();
        SharedConfiguration sharedConfig = locator.getSharedConfiguration();
        Map<String, Configuration> entireConfiguration = sharedConfig.getEntireConfiguration();
        Configuration clusterConfig = entireConfiguration.get(SharedConfiguration.CLUSTER_CONFIG);
        assertNotNull(clusterConfig);
        assertNotNull(clusterConfig.getJarNames());
        assertTrue(clusterConfig.getJarNames().contains("foo.jar"));
        assertTrue(clusterConfig.getGemfireProperties().getProperty(DistributionConfig.LOG_LEVEL_NAME).equals(clusterLogLevel));
        assertNotNull(clusterConfig.getCacheXmlContent());

        Configuration testGroupConfiguration = entireConfiguration.get(testGroup);
        assertNotNull(testGroupConfiguration);
        assertNotNull(testGroupConfiguration.getJarNames());
        assertTrue(testGroupConfiguration.getJarNames().contains("bar.jar"));
        assertTrue(testGroupConfiguration.getGemfireProperties().getProperty(DistributionConfig.LOG_LEVEL_NAME).equals(groupLogLevel));
        assertNotNull(testGroupConfiguration.getCacheXmlContent());
        assertTrue(testGroupConfiguration.getCacheXmlContent().contains(REGION1));

        Object[] jarData = sharedConfig.getAllJars(entireConfiguration.keySet());
        String[] jarNames = (String[]) jarData[0];
        byte[][] jarBytes = (byte[][]) jarData[1];

        assertNotNull(jarNames);
        assertNotNull(jarBytes);

        return null;
      }
    });

    dataMemberVm.invoke(new SerializableCallable() {
      @Override
      public Object call() throws UnknownHostException, IOException, ClassNotFoundException {
        SharedConfigurationWriter scw = new SharedConfigurationWriter();
        scw.deleteXmlEntity(new XmlEntity(CacheXml.REGION, "name", REGION1), new String[]{testGroup});
        scw.deleteJars(new String []{"foo.jar"}, null);
        scw.deleteJars(null, null);

        Set<String> groups = new HashSet<String>();
        groups.add(testGroup);
        ConfigurationRequest configRequest = new ConfigurationRequest(groups);
        ConfigurationResponse configResponse = (ConfigurationResponse) TcpClient.requestToServer(InetAddress.getByName("localhost"), locator2Port, configRequest, 1000);
        assertNotNull(configResponse);

        Map<String, Configuration> requestedConfiguration = configResponse.getRequestedConfiguration();
        Configuration clusterConfiguration = requestedConfiguration.get(SharedConfiguration.CLUSTER_CONFIG);
        assertNotNull(clusterConfiguration);
        assertNull(configResponse.getJarNames());
        assertNull(configResponse.getJars());
        assertTrue(clusterConfiguration.getJarNames().isEmpty());
        assertTrue(clusterConfiguration.getGemfireProperties().getProperty(DistributionConfig.LOG_LEVEL_NAME).equals(clusterLogLevel));

        Configuration testGroupConfiguration = requestedConfiguration.get(testGroup);
        assertNotNull(testGroupConfiguration);
        assertFalse(testGroupConfiguration.getCacheXmlContent().contains(REGION1));
        assertTrue(testGroupConfiguration.getJarNames().isEmpty());
        assertTrue(testGroupConfiguration.getGemfireProperties().getProperty(DistributionConfig.LOG_LEVEL_NAME).equals(groupLogLevel));

        GemFireCacheImpl cache = (GemFireCacheImpl) getCache();
        Map<InternalDistributedMember, Collection<String>> locatorsWithSharedConfiguration = cache.getDistributionManager().getAllHostedLocatorsWithSharedConfiguration();
        assertFalse(locatorsWithSharedConfiguration.isEmpty());
        assertTrue(locatorsWithSharedConfiguration.size() == 2);
        Set<InternalDistributedMember> locatorMembers = locatorsWithSharedConfiguration.keySet();
        for (InternalDistributedMember locatorMember : locatorMembers) {
          System.out.println(locatorMember);
        }
        return null;
      }
    });
  }

  @Override
  public void tearDown2() throws Exception {
    super.tearDown2();
    for (int i=0; i<4; i++) {
      Host.getHost(0).getVM(i).invoke(SharedConfigurationDUnitTest.locatorCleanup);
    }
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class net.sf.jasperreports.compilers.JavaScriptCompiledData.ExpressionIndexes (JasperReports 5.6.0 API)</title>
<meta name="date" content="2014-05-27">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
net.sf.jasperreports.compilers.JavaScriptCompiledData.ExpressionIndexes

Packages that use JavaScriptCompiledData.ExpressionIndexes

Package
Description

net.sf.jasperreports.compilers

Contains classes for report compiling and expressions evaluating.

Uses of JavaScriptCompiledData.ExpressionIndexes in net.sf.jasperreports.compilers

Methods in net.sf.jasperreports.compilers that return JavaScriptCompiledData.ExpressionIndexes

Modifier and Type
Method and Description

JavaScriptCompiledData.ExpressionIndexes
JavaScriptCompiledData.getExpression(int id)

protected JavaScriptCompiledData.ExpressionIndexes
JavaScriptCompiledEvaluator.getExpression(int id)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Orchard.ContentManagement;
using Orchard.FileSystems.AppData;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Recipes.Models;

namespace Orchard.Recipes.Services {
    public class RecipeStepQueue : IRecipeStepQueue {
        private readonly IAppDataFolder _appDataFolder;
        private readonly string _recipeQueueFolder = "RecipeQueue" + Path.DirectorySeparatorChar;

        public RecipeStepQueue(IAppDataFolder appDataFolder) {
            _appDataFolder = appDataFolder;
            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }

        public Localizer T { get; set; }
        public ILogger Logger { get; set; }

        public void Enqueue(string executionId, RecipeStep step) {
            Logger.Information("Enqueuing recipe step '{0}'.", step.Name);
            var recipeStepElement = new XElement("RecipeStep");
            recipeStepElement.Attr("Id", step.Id);
            recipeStepElement.Attr("RecipeName", step.RecipeName);
            recipeStepElement.Add(new XElement("Name", step.Name));
            recipeStepElement.Add(step.Step);

            if (_appDataFolder.DirectoryExists(Path.Combine(_recipeQueueFolder, executionId))) {
                int stepIndex = GetLastStepIndex(executionId) + 1;
                _appDataFolder.CreateFile(Path.Combine(_recipeQueueFolder, executionId + Path.DirectorySeparatorChar + stepIndex),
                                          recipeStepElement.ToString());
            }
            else {
                _appDataFolder.CreateFile(
                    Path.Combine(_recipeQueueFolder, executionId + Path.DirectorySeparatorChar + "0"),
                    recipeStepElement.ToString());
            }
        }

        public RecipeStep Dequeue(string executionId) {
            Logger.Information("Dequeuing recipe steps.");
            if (!_appDataFolder.DirectoryExists(Path.Combine(_recipeQueueFolder, executionId))) {
                return null;
            }
            RecipeStep recipeStep = null;
            int stepIndex = GetFirstStepIndex(executionId);
            if (stepIndex >= 0) {
                var stepPath = Path.Combine(_recipeQueueFolder, executionId + Path.DirectorySeparatorChar + stepIndex);
                // string to xelement
                var stepElement = XElement.Parse(_appDataFolder.ReadFile(stepPath));
                var stepName = stepElement.Element("Name").Value;
                var stepId = stepElement.Attr("Id");
                var recipeName = stepElement.Attr("RecipeName");
                Logger.Information("Dequeuing recipe step '{0}'.", stepName);
                recipeStep = new RecipeStep(id: stepId, recipeName: recipeName, name: stepName, step: stepElement.Element(stepName));
                _appDataFolder.DeleteFile(stepPath);
            }

            if (stepIndex < 0) {
                _appDataFolder.DeleteFile(Path.Combine(_recipeQueueFolder, executionId));
            }

            return recipeStep;
        }

        private int GetFirstStepIndex(string executionId) {
            var stepFiles = new List<string>(_appDataFolder.ListFiles(Path.Combine(_recipeQueueFolder, executionId)));
            if (stepFiles.Count == 0)
                return -1;
            var currentSteps = stepFiles.Select(stepFile => Int32.Parse(stepFile.Substring(stepFile.LastIndexOf('/') + 1))).ToList();
            currentSteps.Sort();
            return currentSteps[0];
        }

        private int GetLastStepIndex(string executionId) {
            int lastIndex = -1;
            var stepFiles = _appDataFolder.ListFiles(Path.Combine(_recipeQueueFolder, executionId));
            // we always have only a handful of steps.
            foreach (var stepFile in stepFiles) {
                int stepOrder = Int32.Parse(stepFile.Substring(stepFile.LastIndexOf('/') + 1));
                if (stepOrder > lastIndex)
                    lastIndex = stepOrder;
            }

            return lastIndex;
        }
    }
}


text:
<?php

namespace lukisongroup\front\controllers;

use yii\web\Controller;

class DefaultController extends Controller
{
    public function actionIndex()
    {
		 if (\Yii::$app->user->isGuest) {
            return $this->render('../../../views/site/index_nologin'
            );
        }
        //return $this->render('index');
    }
}


text:
__author__ = 'rencui'
from sklearn import svm
from sklearn import cross_validation

dayMapper = {'Mon': 1, 'Tue': 2, 'Wed': 3, 'Thu': 4, 'Fri': 5, 'Sat': 6, 'Sun': 7}
posFile = open('adData\\analysis\\ranked\\1\\total.pos', 'r')
negFile = open('adData\\analysis\\ranked\\2\\total.neg', 'r')

meta = []
labels = []
for line in posFile:
    seg = line.strip().split(' : ')
    meta.append([dayMapper[seg[1]]])
    labels.append(1)
posSize = len(meta)

for line in negFile:
    seg = line.strip().split(' : ')
    meta.append([dayMapper[seg[1]]])
    labels.append(2)

posFile.close()
negFile.close()

precisionSum = 0.0
recallSum = 0.0
accuracySum = 0.0
for i in range(5):
    feature_train, feature_test, label_train, label_test = cross_validation.train_test_split(meta, labels, test_size=0.2, random_state=42)

    svmModel = svm.SVC().fit(feature_train, label_train)
    predictions = svmModel.predict(feature_test)
    print predictions
    print label_test
    precisionCount = 0.0
    totalCount = 0.0
    recallCount = 0.0
    if len(predictions) != len(label_test):
        print 'inference error!'
    for index, label in enumerate(predictions):
        if label == 1:
            if label_test[index] == 1:
                precisionCount += 1
            totalCount += 1
        if label_test[index] == 1 and label == 1:
            recallCount += 1
    if totalCount == 0:
        precision = 0
    else:
        precision = precisionCount / totalCount
    recall = recallCount / label_test.count(1)
    accuracy = svmModel.score(feature_test, label_test)

    precisionSum += precision
    recallSum += recall
    accuracySum += accuracy

print precisionSum/5
print recallSum/5
print accuracySum/5


text:
/* Reference https://nacl.cr.yp.to/ */
/* Reference https://tweetnacl.cr.yp.to/software.html */

#include <stdint.h>

#include <str.h>
#include <types.h>

#include <base64.h>
#include <crypto.h>
#include <die.h>
#include <memory.h>
#include <nacl.h>
#include <sha256.h>
#include <sha512.h>
#include <stdio.h> /* fopen */
#include <string.h> /* memcpy memset */

static FILE *fh_random;

void close_random(void)
	{
	if (fh_random)
		{
		fclose(fh_random);
		fh_random = 0;
		}
	}

static void read_random_bytes(u8 *result, unsigned long num_bytes)
	{
	if (!fh_random)
		{
		fh_random = fopen("/dev/urandom","r");
		if (!fh_random)
			die("could not open random byte source");
		}

	{
	size_t num_read = fread(result, 1, num_bytes, fh_random);
	if (num_read < num_bytes)
		die("out of random bytes");
	}
	}

/* Return a string of n random bytes. */
string str_random_bytes(unsigned long num_bytes)
	{
	string str = str_new(num_bytes);
	read_random_bytes((u8 *)str->data,num_bytes);
	return str;
	}

/* Return a string of 24 random bytes. */
string str_random_nonce(void)
	{
	return str_random_bytes(24);
	}

/* Return a string of 32 random bytes. */
string str_random_secret_key(void)
	{
	return str_random_bytes(32);
	}

static string op_public(void op(u8 *pk, const u8 *sk), string secret_key)
	{
	if (secret_key->len != 32) return 0;
	{
	string public_key = str_new(32);
	op(
		(u8 *)public_key->data,
		(const u8 *)secret_key->data
		);
	return public_key;
	}
	}

/* Map the 32-byte secret_key to the corresponding 32-byte public box key.  */
string str_nacl_box_public(string secret_key)
	{ return op_public(nacl_box_public,secret_key); }

/*
Combine the 32-byte public and secret key into a 32-byte composite key which is
used with str_nacl_box_seal and str_nacl_box_open.

When sending, use the recipient's public key and the sender's secret key.
When receiving, use the sender's public key and the recipient's secret key.
*/
string str_nacl_box_prepare(string public_key, string secret_key)
	{
	if (public_key->len != 32) return 0;
	if (secret_key->len != 32) return 0;
	{
	string result = str_new(32);
	nacl_box_prepare
		(
		(u8 *)result->data,
		(const u8 *)public_key->data,
		(const u8 *)secret_key->data
		);
	return result;
	}
	}

static string op_box_pad
	(
	int op(u8 *c, const u8 *m, u64 d, const u8 *n, const u8 *k),
	const int num_pad_text,
	const int num_pad_result,
	string text,
	string nonce,
	string key
	)
	{
	if (nonce->len != 24) return 0;
	if (key->len != 32) return 0;
	{
	unsigned long buf_len = text->len + num_pad_text;
	char *buf_text = new_memory(buf_len);
	char *buf_result = new_memory(buf_len);
	string result;
	int code;

	memset(buf_text,0,num_pad_text);
	memcpy(buf_text + num_pad_text, text->data, text->len);

	code = op(
		(u8 *)buf_result,
		(const u8 *)buf_text,
		buf_len,
		(const u8 *)nonce->data,
		(const u8 *)key->data
		);

	if (code == -1)
		result = 0;
	else
		result = str_new_data(
			buf_result + num_pad_result,
			buf_len - num_pad_result);

	free_memory(buf_text,buf_len);
	free_memory(buf_result,buf_len);
	return result;
	}
	}

/* Encrypt the plain text. */
string str_nacl_box_seal(string text, string nonce, string key)
	{ return op_box_pad(nacl_box_seal,32,16,text,nonce,key); }

/* Decrypt the crypt text. */
string str_nacl_box_open(string crypt_text, string nonce, string key)
	{ return op_box_pad(nacl_box_open,16,32,crypt_text,nonce,key); }

/* Map the 32-byte secret_key to the corresponding 32-byte public sign key. */
string str_nacl_sign_public(string secret_key)
	{ return op_public(nacl_sign_public,secret_key); }

/* Return the 64-byte signature of the text using the 32-byte public_key and
32-byte secret_key. */
string str_nacl_sign_seal(string text, string public_key, string secret_key)
	{
	string result;
	if (public_key->len == 32 && secret_key->len == 32)
		{
		unsigned long n = text->len + 64;
		char *sm = new_memory(n);
		nacl_sign_seal
			(
			(u8 *)sm,
			(const u8 *)text->data, text->len,
			(const u8 *)public_key->data,
			(const u8 *)secret_key->data
			);
		result = str_new_data(sm,64);
		free_memory(sm,n);
		}
	else
		result = 0;
	return result;
	}

/* Validate the signature on the text and return 1 if valid or 0 if invalid. */
int str_nacl_sign_open(string text, string public_key, string signature)
	{
	int ok;
	if (public_key->len == 32 && signature->len == 64)
		{
		unsigned long n = text->len + 64;
		u8 *sm = new_memory(n);
		u8 *m = new_memory(n);
		int code;

		memcpy(sm,signature->data,64);
		memcpy(sm+64,text->data,text->len);

		code = nacl_sign_open((u8 *)m, (const u8 *)sm, n,
			(const u8 *)public_key->data);
		free_memory(sm,n);
		free_memory(m,n);
		ok = (code == 0);
		}
	else
		ok = 0;
	return ok;
	}

/* Return the 32 byte SHA-256 hash of the text. */
string str_sha256(string text)
	{
	string hash = str_new(32);
	sha256((u8 *)hash->data, (const u8 *)text->data, text->len);
	return hash;
	}

/* Return the 64 byte SHA-512 hash of the text. */
string str_sha512(string text)
	{
	string hash = str_new(64);
	sha512((u8 *)hash->data, (const u8 *)text->data, text->len);
	return hash;
	}

/* Pack a base 64 format string into raw bytes. */
string str_pack64(string text)
	{
	u64 n = text->len;
	u64 n_out;
	string out;

	if (text->data[n-1] == '=') n--;
	if (text->data[n-1] == '=') n--;
	n_out = 3*(n/4) + (n%4 == 0 ? 0 : n%4-1);

	out = str_new(n_out);
	pack64((u8 *)out->data,(const u8 *)text->data,n);
	return out;
	}

/* Unpack raw bytes into a base 64 format string. */
string str_unpack64(string text)
	{
	u64 n = text->len;
	u64 n_out = 4*(n/3) + (n%3 == 0 ? 0 : 4);
	string out = str_new(n_out);
	unpack64((u8 *)out->data,(const u8 *)text->data,text->len);
	return out;
	}

/* Compute the HMAC value of the text using the key, using the given hash
function and blocksize.  If the key is longer than blocksize, only the first
blocksize bytes of the key are used.  If you want to use a key longer than
blocksize bytes, you should hash it first.
*/
static string str_hmac
	(
	void (*hash)(u8 digest[], const u8 *data, u64 n_data_byte),
	unsigned long blocksize,
	string text,
	string key
	)
	{
	unsigned long outsize = blocksize / 2;
	string mac = str_new(outsize);

	unsigned int len_ipad = blocksize + text->len;
	unsigned char *buf_ipad = new_memory(len_ipad);
	unsigned char buf_opad[blocksize+outsize];

	unsigned int key_len = key->len;

	unsigned int i;
	unsigned int fill;

	if (key_len > blocksize)
		key_len = blocksize;

	fill = blocksize - key_len;

	for (i = 0; i < key_len; i++)
		{
		buf_ipad[i] = key->data[i] ^ 0x36;
		buf_opad[i] = key->data[i] ^ 0x5c;
		}

	memset(buf_ipad + key_len, 0x36, fill);
	memset(buf_opad + key_len, 0x5c, fill);

	memcpy(buf_ipad+blocksize, text->data, text->len);
	hash(buf_opad+blocksize, buf_ipad, len_ipad);
	hash((u8 *)mac->data, buf_opad, blocksize+outsize);

	free_memory(buf_ipad,len_ipad);
	return mac;
	}

/* Compute the HMAC-SHA512 value of the text using the key. */
string str_hmac_sha512(string text, string key)
	{
	return str_hmac(sha512,128,text,key);
	}

/* Compute the HMAC-SHA256 value of the text using the key. */
string str_hmac_sha256(string text, string key)
	{
	return str_hmac(sha256,64,text,key);
	}


text:
using System;
using System.Collections.Generic;
using System.Text;

using Poderosa.View;
using Poderosa.Forms;
using Poderosa.Sessions;

namespace Poderosa.Commands {
    //ウィンドウメニューの下に来る、各ドキュメントをアクティベートするコマンド
    internal class DocActivationCommand : IPoderosaCommand {
        public CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args) {
            IPoderosaDocument doc = (IPoderosaDocument)args[0].GetAdapter(typeof(IPoderosaDocument));
            if (doc == null)
                return CommandResult.Failed;

            SessionManagerPlugin.Instance.ActivateDocument(doc, ActivateReason.InternalAction);
            return CommandResult.Succeeded;
        }

        public bool CanExecute(ICommandTarget target) {
            return true;
        }

        public IAdaptable GetAdapter(Type adapter) {
            return CommandManagerPlugin.Instance.PoderosaWorld.AdapterManager.GetAdapter(this, adapter);
        }
    }

    internal class DocActivationMenuGroup : IPoderosaMenuGroup, IPositionDesignation {
        #region IPoderosaMenuGroup
        public IPoderosaMenu[] ChildMenus {
            get {
                IPoderosaMainWindow w = WindowManagerPlugin.Instance.ActiveWindow; //TODO 本当はイマイチだが、ここに引数でCommandTargetを貰ってくるのもトロいしな
                if (w == null)
                    return new IPoderosaMenu[0];

                List<DocActivationMenuItem> result = new List<DocActivationMenuItem>();
                for (int i = 0; i < w.DocumentTabFeature.DocumentCount; i++)
                    result.Add(new DocActivationMenuItem(i, w, w.DocumentTabFeature.GetAtOrNull(i))); //foreach使えるようにすべきかな
                return result.ToArray();
            }
        }

        public bool IsVolatileContent {
            get {
                return true;
            }
        }

        public bool ShowSeparator {
            get {
                return true;
            }
        }

        public IAdaptable GetAdapter(Type adapter) {
            return CommandManagerPlugin.Instance.PoderosaWorld.AdapterManager.GetAdapter(this, adapter);
        }
        #endregion

        #region IPositionDesignation
        //分割メニューの次
        public IAdaptable DesignationTarget {
            get {
                return null;
            }
        }

        public PositionType DesignationPosition {
            get {
                return PositionType.Last;
            }
        }
        #endregion
    }

    internal class DocActivationMenuItem : IPoderosaMenuItemWithArgs {
        private IPoderosaMainWindow _mainWindow;
        private IPoderosaDocument _document;
        private int _index;

        public DocActivationMenuItem(int index, IPoderosaMainWindow window, IPoderosaDocument document) {
            _mainWindow = window;
            _index = index;
            _document = document;
        }

        public IAdaptable[] AdditionalArgs {
            get {
                return new IAdaptable[] { _document };
            }
        }

        public IPoderosaCommand AssociatedCommand {
            get {
                return BasicCommandImplementation.DocActivationCommand;
            }
        }

        public string Text {
            get {
                //9番目までには1...9のニーモニック
                return String.Format("{0}{1} {2}", _index < 9 ? "&" : "", _index + 1, _document.Caption);
            }
        }

        public bool IsEnabled(ICommandTarget target) {
            return true;
        }

        public bool IsChecked(ICommandTarget target) {
            return _mainWindow.DocumentTabFeature.ActiveDocument == _document;
        }

        public IAdaptable GetAdapter(Type adapter) {
            return CommandManagerPlugin.Instance.PoderosaWorld.AdapterManager.GetAdapter(this, adapter);
        }
    }
}


text:
<?php
	defined('C5_EXECUTE') or die(_("Access Denied."));
	//$textHelper = Loader::helper("text");
	// now that we're in the specialized content file for this block type,
	// we'll include this block type's class, and pass the block to it, and get
	// the content

	if (count($cArray) > 0) { ?>

   		<?php
   		for ($i = 0; $i < count($cArray); $i++ ) {
            $cobj = $cArray[$i];
            $title = $cobj->getCollectionName(); ?>

<a href="<?php echo $nh->getLinkToCollection($cobj)?>"><?php echo $title?>
<?php
		}  ?>

<?php
	}  ?>