__resources__["/mainPanelView.js"] = {
  meta: {
    mimetype: "application/javascript"
  },

  data: function(exports, require, module, __filename, __dirname) {
    var playerPanel = require('playerPanelView');
    var bagPanel = require('bagPanelView');
    var equipmentsPanel = require('equipmentsPanelView');
    var taskPanel = require('taskPanelView');
    var teamPanel = require('teamPanelView');
    var kickOutPanel = require('kickOutPanelView');
    var dialogPanel = require('dialogPanelView');
    var playerDialogPanel = require('playerDialogPanelView');
    var applyJoinTeamPanel = require('applyJoinTeamPanelView');
    var inviteJoinTeamPanel = require('inviteJoinTeamPanelView');
    var config = require('config');
    var app = require('app');
    var dataApi = require('dataApi');
    var pomelo = window.pomelo;
    // bottom nav li
    var $li;
    // hp bar
    var $hpBar;
    // mp bar
    var $mpBar;
    // level
    var $level;
    // experience value
    var $exp, $expBar;
    var $avatarImg;
    // team menu
    var $teamMenu, $createTeam, $leaveTeam, $disbandTeam;
    var $teamMenu4TM1, $kickOut4TM1, $teamMenu4TM2, $kickOut4TM2;

    // TeamMate-1 ~ Begin
    var $teamMate1;
    var $name4TM1;
    var $hpBar4TM1;
    var $mpBar4TM1;
    var $level4TM1;
    var $playerId4TM1;
    var $avatarImg4TM1;
    // TeamMate-1 ~ End

    // TeamMate-2 ~ Begin
    var $teamMate2;
    var $name4TM2;
    var $hpBar4TM2;
    var $mpBar4TM2;
    var $level4TM2;
    var $playerId4TM2;
    var $avatarImg4TM2;
    // TeamMate-2 ~ End

    var inited = false;

    var init = function() {
      if (inited) {
        return;
      }
      inited = true;

      $hpBar = $('#mainPanel .m-player .u-levbar span.outer');
      $mpBar = $('#mainPanel .m-player .u-levbar-1 span.outer');
      $level = $('#mainPanel .m-player .name span').eq(1);
      $exp = $('#mainPanel .m-asset .pos6 span');
      $expBar = $('#mainPanel .m-asset .icon-ll');
      $avatarImg = $('#mainPanel .m-player .avatar img');
      $teamMenu = $('#mainPanel .m-player .teamMenu');
      $createTeam = $('#mainPanel .m-player .teamMenu .menuItem #createTeam');
      $disbandTeam = $('#mainPanel .m-player .teamMenu .menuItem #disbandTeam');
      $leaveTeam = $('#mainPanel .m-player .teamMenu .menuItem #leaveTeam');

      // TeamMate-1 ~ Begin
      $teamMate1 = $('#mainPanel .m-team-mate-1');
      $name4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(0);
      $level4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(1);
      $playerId4TM1 = $('#mainPanel .m-team-mate-1 .name span').eq(2);
      $hpBar4TM1 = $('#mainPanel .m-team-mate-1 .u-levbar span.outer');
      $mpBar4TM1 = $('#mainPanel .m-team-mate-1 .u-levbar-1 span.outer');
      $avatarImg4TM1 = $('#mainPanel .m-team-mate-1 .avatar img');
      $playerId4TM1.hide();
      $teamMate1.hide();
      $teamMenu4TM1 = $('#mainPanel .m-team-mate-1 .teamMenu');
      $kickOut4TM1 = $('#mainPanel .m-team-mate-1 .teamMenu .menuItem #kickOut');
      // TeamMate-1 ~ End

      // TeamMate-2 ~ Begin
      $teamMate2 = $('#mainPanel .m-team-mate-2');
      $name4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(0);
      $level4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(1);
      $playerId4TM2 = $('#mainPanel .m-team-mate-2 .name span').eq(2);
      $hpBar4TM2 = $('#mainPanel .m-team-mate-2 .u-levbar span.outer');
      $mpBar4TM2 = $('#mainPanel .m-team-mate-2 .u-levbar-1 span.outer');
      $avatarImg4TM2 = $('#mainPanel .m-team-mate-2 .avatar img');
      $playerId4TM2.hide();
      $teamMate2.hide();
      $teamMenu4TM2 = $('#mainPanel .m-team-mate-2 .teamMenu');
      $kickOut4TM2 = $('#mainPanel .m-team-mate-2 .teamMenu .menuItem #kickOut');
      // TeamMate-2 ~ End

      $li = $('.m-nav li');

      initNav();

      var player = app.getCurPlayer();
      console.log('player.characterData.id = ', player.characterData.id);
      $('#mainPanel .avatar img').attr('src', config.IMAGE_URL + 'character/' + player.characterData.id + '.png');
      $('#mainPanel .m-player .name span').eq(0).text(player.name);
      setLevel(player.level);
      setHpBar(player.hp, player.maxHp);
      setMpBar(player.mp, player.maxMp);
      setExp(player.experience, player.nextLevelExp);
      initTeamMenu();

      initSkillPanel();
      bindHotkeys();
      playerPanel.init();
      equipmentsPanel.init();
      bagPanel.init();
      taskPanel.init();
      teamPanel.init();
      kickOutPanel.init();
      dialogPanel.init();
      playerDialogPanel.init();
      applyJoinTeamPanel.init();
      inviteJoinTeamPanel.init();

    };

    //init bottom nav events bind
    var initNav = function() {
      $li.on('click', function() {
        var $this = $(this);
        if ($this.hasClass('selected')) {
          return;
        }

        $li.filter('.selected').trigger('selected', false);

        $this.trigger('selected', true);
      });

      $li.on('selected', function(e, selected) {
        var $this = $(this);
        var panel;
        $this.toggleClass('selected', selected);

        if ($this.hasClass('itm01')) {
          panel = playerPanel;
        } else if ($this.hasClass('itm02')) {
          panel = bagPanel;
        } else if ($this.hasClass('itm03')) {
          panel = taskPanel;
        } else if ($this.hasClass('itm04')) {
          panel = teamPanel;
        }

        if (panel) {
          // !!selected ? panel.show() : panel.hide();
          panel[ !! selected ? 'show' : 'hide'].call(panel);
        }
      });
    };

    var closeAllPanel = function() {
      playerPanel.hide();
      bagPanel.hide();
      taskPanel.hide();
      teamPanel.hide();
      removeNavSelect();
    };

    //remove bottom nav selected class
    var removeNavSelect = function() {
      $li.filter('.selected').removeClass('selected');
    };

    // set hp
    var setHpBar = function(hp, maxHp) {
      $hpBar.css('width', (hp * 100 / maxHp) + '%');
    };

    // set mp
    var setMpBar = function(mp, maxMp) {
      $mpBar.css('width', (mp * 100 / maxMp) + '%');
    };

    // set level
    var setLevel = function(level) {
      $level.html(level);
    };

    // set Experience
    var setExp = function(val, val2) {
      $exp.html(val + "/" + val2);

      if (val >= val2) {
        $expBar.css('width', '100%');
      } else {
        if (val === 0) {
          $expBar.hide().css('width', '1%');
        } else {
          $expBar.show().css('width', (val * 100 / val2) + '%');
        }
      }
    };

    // TeamMate-1 ~ Begin
    var showTeamMate1 = function() {
      if (!$teamMate1.is(':visible')) {
        console.log('1 ~ ShowTeamMate1 is running ...');
        $teamMate1.show();
      }
    };

    var hideTeamMate1 = function() {
      if ($teamMate1.is(':visible')) {
        console.log('1 ~ HideTeamMate1 is running ...');
        $teamMate1.hide();
      }
    };

    var setName4TM1 = function(name) {
      $name4TM1.text(name);
    };

    var setLevel4TM1 = function(level) {
      $level4TM1.html(level);
    };

    var setPlayerId4TM1 = function(playerId) {
      $playerId4TM1.html(playerId);
    };

    var setHpBar4TM1 = function(hp, maxHp) {
      hp = Math.max(hp, 0);
      $hpBar4TM1.css('width', (hp * 100 / maxHp) + '%');
    };

    var setMpBar4TM1 = function(mp, maxMp) {
      mp = Math.max(mp, 0);
      $mpBar4TM1.css('width', (mp * 100 / maxMp) + '%');
    };

    var setAvatar4TM1 = function(kindId) {
      $avatarImg4TM1.attr('src', config.IMAGE_URL + 'character/' + kindId + '.png');
    };
    // TeamMate-1 ~ End

    // TeamMate-2 ~ Begin
    var showTeamMate2 = function() {
      if (!$teamMate2.is(':visible')) {
        console.log('2 ~ ShowTeamMate1 is running ...');
        $teamMate2.show();
      }
    };

    var hideTeamMate2 = function() {
      if ($teamMate2.is(':visible')) {
        console.log('2 ~ HideTeamMate1 is running ...');
        $teamMate2.hide();
      }
    };

    var setName4TM2 = function(name) {
      $name4TM2.text(name);
    };

    var setLevel4TM2 = function(level) {
      $level4TM2.html(level);
    };

    var setPlayerId4TM2 = function(playerId) {
      $playerId4TM2.html(playerId);
    };

    var setHpBar4TM2 = function(hp, maxHp) {
      hp = Math.max(hp, 0);
      $hpBar4TM2.css('width', (hp * 100 / maxHp) + '%');
    };

    var setMpBar4TM2 = function(mp, maxMp) {
      mp = Math.max(mp, 0);
      $mpBar4TM2.css('width', (mp * 100 / maxMp) + '%');
    };

    var setAvatar4TM2 = function(kindId) {
      $avatarImg4TM2.attr('src', config.IMAGE_URL + 'character/' + kindId + '.png');
    };
    // TeamMate-2 ~ End

    // init team menu
    var initTeamMenu = function() {
      $teamMenu.hide();
      $teamMenu4TM1.hide();
      $teamMenu4TM2.hide();

      $avatarImg.on('click', function() {
        // $teamMenu.toggle();
      });

      $avatarImg4TM1.on('click', function() {
        // $teamMenu4TM1.toggle();
        var kickedPlayerId = parseInt($playerId4TM1.text(), null);
        kickOutPanel.open(kickedPlayerId);
      });

      $avatarImg4TM2.on('click', function() {
        // $teamMenu4TM2.toggle();
        var kickedPlayerId = parseInt($playerId4TM2.text(), null);
        kickOutPanel.open(kickedPlayerId);
      });

      $createTeam.on('click', function() {
        console.log('click createTeam ...');
        pomelo.notify("area.teamHandler.createTeam");
        $teamMenu.hide();
      });

      $disbandTeam.on('click', function() {
        console.log('click disbandTeam ...');
        pomelo.notify("area.teamHandler.disbandTeam", {
          playerId: pomelo.playerId,
          teamId: pomelo.teamId
        });
        console.log('disbandTeam ~ pomelo.teamId = ', pomelo.teamId);
        $teamMenu.hide();
      });

      $leaveTeam.on('click', function() {
        console.log('click leaveTeam ...');
        pomelo.notify("area.teamHandler.leaveTeam", {
          playerId: pomelo.playerId,
          teamId: pomelo.teamId
        });
        console.log('leaveTeam ~ pomelo.teamId = ', pomelo.teamId);
        $teamMenu.hide();
      });

      $kickOut4TM1.on('click', function() {
        console.log('1 ~ click kickOut ...');
        pomelo.notify("area.teamHandler.kickOut", {
          teamId: pomelo.teamId,
          kickedPlayerId: parseInt($playerId4TM1.text(), null)
        });
        console.log('1 ~ kickOut ~ pomelo.teamId = ', pomelo.teamId);
        $teamMenu4TM1.hide();
      });

      $kickOut4TM2.on('click', function() {
        console.log('2 ~ click kickOut ...');
        pomelo.notify("area.teamHandler.kickOut", {
          teamId: pomelo.teamId,
          kickedPlayerId: parseInt($playerId4TM2.text(), null)
        });
        console.log('2 ~ kickOut ~ pomelo.teamId = ', pomelo.teamId);
        $teamMenu4TM1.hide();
      });

    };

    var bindHotkeys = function() {
      //var code = {"0": 48, "1": 49, "2": 50, "3": 51, "4": 52, "5": 53, "6": 54, "7": 55, "8": 56, "9": 57};
      var $li = $('#mainPanel .m-skill li');
      $('body').on('keypress', function(e) {
        if (e.target.tagName === 'INPUT') {
          return;
        }

        var key = e.keyCode;
        if (key > 48 && key <= 57) {
          $li.eq(key - 49).trigger('click');
        } else if (key === 48) {
          $li.eq(9).trigger('click');
        }
      });
    };

    // init skill panel
    var skillBox = {};
    var initSkillPanel = function() {
      var skills = app.getCurPlayer().fightSkills;
      var $li = $('#mainPanel .m-skill li');
      var i, sk, $cli;
      for (i in skills) {
        if (i > 1) {
          sk = dataApi.fightskill.findById(skills[i].id);
          $cli = $li.eq(i - 2).data('skillId', sk.id).html('' + skills[i].level + '');
          skillBox[sk.id] = new SkillCD(sk.id, $cli, sk.cooltime * 1000, function(skillId) {
            pomelo.notify("area.fightHandler.useSkill", {
              skillId: skillId,
              playerId: pomelo.playerId
            });
          });
        }
      }
    };

    var SkillCD = function(id, $box, time, action) {
      this.id = id;
      this.$box = $box;
      this.$box.addClass('skill-box');
      //var $img
      $box.children('img');
      //var r = 20.8;
      this.inCD = false;
      for (var i = 0; i < 4; i++) {
        this.$box.append('

');
      }
      this.$cover = this.$box.children('.cover').css({
        '-webkit-transition': 'All ' + (time / 8) + 'ms linear'
      });
      this.l0 = this.$cover.eq(0);
      this.l1 = this.$cover.eq(1);
      this.l2 = this.$cover.eq(2);
      this.l3 = this.$cover.eq(3);

      var self = this;
      this.$box.on('click', function() {
        if (action) {
          action(self.id);
        }
      });
    };

    SkillCD.prototype.start = function() {
      if (this.inCD) {
        return;
      }

      this.inCD = true;
      this.resetCover();
      var self = this;
      setTimeout(function() {
        self.draw();
      }, 0);
    };

    SkillCD.prototype.resetCover = function() {
      this.l0.css({
        height: '0',
        width: '0',
        'border-left-width': '0',
        'border-bottom-width': '20px'
      });
      this.l1.css({
        height: '0',
        width: '0',
        'border-top-width': '0',
        'border-left-width': '20px'
      });
      this.l2.css({
        height: '0',
        width: '20px',
        'border-right-width': '0',
        'border-top-width': '20px'
      });
      this.l3.css({
        height: '20px',
        width: '0',
        'border-bottom-width': '0',
        'border-right-width': '20px'
      });
      this.$cover.show();
    };

    SkillCD.prototype.draw = function() {
      var setTransition = function($dom, css, count, callback) {
        $dom.on('webkitTransitionEnd', function(e) {
          count--;
          if (count === 0) {
            $dom.off('webkitTransitionEnd');
            callback.call(this);
          }
        }).css(css);
      };

      var l0 = this.l0;
      var l1 = this.l1;
      var l2 = this.l2;
      var l3 = this.l3;
      var self = this;

      setTransition(l0, {
        'border-left-width': "20px"
      }, 1, function() {
        setTransition(l0, {
          height: '20px',
          'border-bottom-width': "0px"
        }, 2, function() {
          setTransition(l1, {
            'border-top-width': "20px"
          }, 1, function() {
            setTransition(l1, {
              width: '20px',
              'border-left-width': "0px"
            }, 2, function() {
              setTransition(l2, {
                width: '0px',
                'border-right-width': "20px"
              }, 2, function() {
                setTransition(l2, {
                  height: '20px',
                  'border-top-width': "0px"
                }, 2, function() {
                  setTransition(l3, {
                    height: '0px',
                    'border-bottom-width': "20px"
                  }, 2, function() {
                    setTransition(l3, {
                      width: '20px',
                      'border-right-width': "0px"
                    }, 2, function() {
                      self.inCD = false;
                      self.$cover.hide();
                    });
                  });
                });
              });
            });
          });
        });
      });
    };

    exports.reviveMaskShow = function(time) {
      $('#game-mask').show();
    };

    exports.reviveMaskHide = function(time) {
      $('#game-mask').hide();
    };

    exports.notify = function(msg) {
      var $notice = $('#notice');
      $notice.children('p').html(msg);
      $notice.animate({
        top: '28px'
      }, 700, function() {
        setTimeout(function() {
          $notice.animate({
            opacity: '0'
          }, 800, function() {
            $notice.css({
              top: '-52px'
            }).css({
                'opacity': '0.75'
              });
          });
        }, 3000);
      });
    };

    exports.init = init;
    exports.removeNavSelect = removeNavSelect;
    exports.closeAllPanel = closeAllPanel;
    exports.setHpBar = setHpBar;
    exports.setMpBar = setMpBar;
    exports.setLevel = setLevel;
    exports.setExp = setExp;
    exports.initSkillPanel = initSkillPanel;
    exports.skillBox = skillBox;

    // TeamMate-1 ~ Begin
    exports.showTeamMate1 = showTeamMate1;
    exports.hideTeamMate1 = hideTeamMate1;
    exports.setName4TM1 = setName4TM1;
    exports.setLevel4TM1 = setLevel4TM1;
    exports.setPlayerId4TM1 = setPlayerId4TM1;
    exports.setHpBar4TM1 = setHpBar4TM1;
    exports.setMpBar4TM1 = setMpBar4TM1;
    exports.setAvatar4TM1 = setAvatar4TM1;
    // TeamMate-1 ~ End

    // TeamMate-2 ~ Begin
    exports.showTeamMate2 = showTeamMate2;
    exports.hideTeamMate2 = hideTeamMate2;
    exports.setName4TM2 = setName4TM2;
    exports.setLevel4TM2 = setLevel4TM2;
    exports.setPlayerId4TM2 = setPlayerId4TM2;
    exports.setHpBar4TM2 = setHpBar4TM2;
    exports.setMpBar4TM2 = setMpBar4TM2;
    exports.setAvatar4TM2 = setAvatar4TM2;
    // TeamMate-2 ~ End
  }
};

{'repo_name': 'NetEase/lordofpomelo', 'stars': '757', 'repo_language': 'JavaScript', 'file_name': 'session.json', 'mime_type': 'text/plain', 'hash': -5073622335592631605, 'source_dataset': 'data'}


safe-buffer

Safer Node.js Buffer API

buffer
buffer allocate
node security
safe
safe-buffer
security
uninitialized

{'repo_name': 'SunGodAppollo/node.js', 'stars': '112', 'repo_language': 'JavaScript', 'file_name': 'relativize.js', 'mime_type': 'text/plain', 'hash': 5433602709827017240, 'source_dataset': 'data'}


<!DOCTYPE html>

<title>Image gallery with interact.js inertia and snapping</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

{'repo_name': 'taye/interact.js', 'stars': '9517', 'repo_language': 'TypeScript', 'file_name': 'deploy.sh', 'mime_type': 'text/x-shellscript', 'hash': 3200486594026454279, 'source_dataset': 'data'}


package ca.uhn.fhir.rest.server.method;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.api.RequestTypeEnum;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.hl7.fhir.instance.model.api.IBaseMetaType;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import java.lang.reflect.Method;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;

@SuppressWarnings(value = "unchecked")
@ExtendWith(MockitoExtension.class)
public class ReadMethodBindingTest {

	@Mock
	private FhirContext myCtx;

	@Mock
	private RequestDetails myRequestDetails;

	@Mock
	private RuntimeResourceDefinition definition;

	@Test
	public void testIncomingServerRequestMatchesMethod_Read() throws NoSuchMethodException {

		class MyProvider {
			@Read(version = false)
			public IBaseResource read(@IdParam IIdType theIdType) {
				return null;
			}
		}

		when(myCtx.getResourceDefinition(any(Class.class))).thenReturn(definition);
		when(definition.getName()).thenReturn("Patient");
		when(myRequestDetails.getResourceName()).thenReturn("Patient");
		when(myRequestDetails.getRequestType()).thenReturn(RequestTypeEnum.GET);

		// Read
		ReadMethodBinding binding = createBinding(new MyProvider());
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123"));
		assertEquals(MethodMatchEnum.EXACT, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// VRead
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123/_history/123"));
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// Type history
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123"));
		when(myRequestDetails.getResourceName()).thenReturn("Patient");
		when(myRequestDetails.getOperation()).thenReturn("_history");
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));

	}

	@Test
	public void testIncomingServerRequestMatchesMethod_VRead() throws NoSuchMethodException {

		class MyProvider {
			@Read(version = true)
			public IBaseResource read(@IdParam IIdType theIdType) {
				return null;
			}
		}

		when(myCtx.getResourceDefinition(any(Class.class))).thenReturn(definition);
		when(definition.getName()).thenReturn("Patient");
		when(myRequestDetails.getResourceName()).thenReturn("Patient");
		when(myRequestDetails.getRequestType()).thenReturn(RequestTypeEnum.GET);

		// Read - wrong resource type
		ReadMethodBinding binding = createBinding(new MyProvider());
		when(myRequestDetails.getResourceName()).thenReturn("Observation");
		when(myRequestDetails.getId()).thenReturn(new IdDt("Observation/123"));
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// Read
		when(myRequestDetails.getResourceName()).thenReturn("Patient");
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123"));
		assertEquals(MethodMatchEnum.EXACT, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// VRead
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123/_history/123"));
		when(myRequestDetails.getOperation()).thenReturn("_history");
		assertEquals(MethodMatchEnum.EXACT, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// Some other operation
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123/_history/123"));
		when(myRequestDetails.getOperation()).thenReturn("$foo");
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));

		// History operation
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123"));
		when(myRequestDetails.getOperation()).thenReturn("_history");
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));

	}

	@Test
	public void testIncomingServerRequestNoMatch_HasCompartment() throws NoSuchMethodException {

		class MyProvider {
			@Read(version = false)
			public IBaseResource read(@IdParam IIdType theIdType) {
				return null;
			}
		}

		when(myCtx.getResourceDefinition(any(Class.class))).thenReturn(definition);
		when(definition.getName()).thenReturn("Patient");
		when(myRequestDetails.getResourceName()).thenReturn("Patient");
		when(myRequestDetails.getCompartmentName()).thenReturn("Patient");
		when(myRequestDetails.getId()).thenReturn(new IdDt("Patient/123"));

		ReadMethodBinding binding = createBinding(new MyProvider());
		assertEquals(MethodMatchEnum.NONE, binding.incomingServerRequestMatchesMethod(myRequestDetails));
	}

	public ReadMethodBinding createBinding(Object theProvider) throws NoSuchMethodException {
		Method method = theProvider.getClass().getMethod("read", IIdType.class);
		return new ReadMethodBinding(MyPatient.class, method, myCtx, theProvider);
	}

	@ResourceDef(name = "Patient")
	private static class MyPatient implements IBaseResource {

		@Override
		public IBaseMetaType getMeta() {
			return null;
		}

		@Override
		public IIdType getIdElement() {
			return null;
		}

		@Override
		public IBaseResource setId(String theId) {
			return null;
		}

		@Override
		public IBaseResource setId(IIdType theId) {
			return null;
		}

		@Override
		public FhirVersionEnum getStructureFhirVersionEnum() {
			return null;
		}

		@Override
		public boolean isEmpty() {
			return false;
		}

		@Override
		public boolean hasFormatComment() {
			return false;
		}

		@Override
		public List<String> getFormatCommentsPre() {
			return null;
		}

		@Override
		public List<String> getFormatCommentsPost() {
			return null;
		}

		@Override
		public Object getUserData(String theName) {
			return null;
		}

		@Override
		public void setUserData(String theName, Object theValue) {

		}
	}

}

{'repo_name': 'jamesagnew/hapi-fhir', 'stars': '1022', 'repo_language': 'Java', 'file_name': 'GenericClientDstu3IT.java', 'mime_type': 'text/x-java', 'hash': -4159433972801630137, 'source_dataset': 'data'}


---Module: Sim
-- @module Sim

--- Restrict the army from building the unit category.
-- The categories can be combined using + - * (), example: (categories.TECH3 * categories:NAVAL) + categories.urb0202.
-- @param army Army's index.
-- @param category Unit category.
function AddBuildRestriction(army, category)
end

--- TODO.
-- @param army Army's index.
function ArmyGetHandicap(army)
end

--- TODO.
-- @param army Army's index.
function ArmyInitializePrebuiltUnits(army)
end

--- Return true if the indicated army is civilian.
-- @param army Army's index.
function ArmyIsCivilian(army)
end

--- Return true if the indicated army has been defeated.
-- @param army Army's index.
function ArmyIsOutOfGame(army)
end

--- TODO.
function AttachBeamEntityToEntity(self, bone, other, bone, army, blueprint)
end

--- TODO.
-- @param army Army's index.
function AttachBeamToEntity(emitter, entity, tobone, army)
end

--- Sets language for playing voices.
-- Available languages are in '/gamedata/loc'.
-- Game currently defaults on 'us' language if the localized voices don't exists.
-- @param language String of the language shortcut, example: 'us'.
function AudioSetLanguage(language)
end

--- Change a unit's army, return the new unit.
-- @param unit Unit to be given.
-- @param army Army's index to recieve the unit.
function ChangeUnitArmy(unit, army)
end

--- Return true if cheats are enabled.
-- Logs the cheat attempt no matter what.
function CheatsEnabled()
end

--- TODO.
function CoordinateAttacks()
end

--- TODO.
function CreateAimController(weapon, label, turretBone, [barrelBone], [muzzleBone])
end

--- Create a manipulator for playing animations.
function CreateAnimator(unit)
end

--- TODO.
function CreateAttachedBeam(entity, bone, army, length, thickness, texture_filename)
end

--- TODO.
function CreateAttachedEmitter(entity, bone, army, emitter_blueprint)
end

--- TODO.
function CreateBeamEmitter(blueprint, army)
end

--- TODO.
function CreateBeamEmitterOnEntity(entity, tobone, army, blueprint)
end

--- TODO.
function CreateBeamEntityToEntity(entity, bone, other, bone, army, blueprint)
end

--- TODO.
function CreateBeamToEntityBone(entity, bone, other, bone, army, thickness, texture_filename)
end

--- TODO.
function CreateBuilderArmController(unit,turretBone, [barrelBone], [aimBone])
end

--- Create a collision detection manipulator
-- TODO.
function CreateCollisionDetector(unit)
end

--- Creates a decal with supplied parametrs.
-- This decal is visible to all armies.
-- @param position Table with position {x, y, z}.
-- @param heading Table with orientation {x, y, z}.
-- @param textureName1 TODO.
-- @param textureName2 TODO.
-- @param type TODO.
-- @param sizeX Size on x axis in game units.
-- @param sizeZ Size on y axisin game units.
-- @param lodParam Distance in game units before the decals disappear.
-- @param duration Life time of the decal in seconds, 0 for infinite.
-- @param army Owner's army's index.
-- @param fidelity TODO.
-- @return The created decal.
function CreateDecal(position, heading, textureName1, textureName2, type, sizeX, sizeZ, lodParam, duration, army, fidelity)
end

--- Creates an economy event for the unit that consumes resources over given time.
-- The unit shows the orange build bar for this event.
-- @param unit Target unit.
-- @param energy Amount of total energy the event will consume.
-- @param mass Amount of total energy the event will consume.
-- @param timeInSeconds How many seconds will the event last.
-- return event Created economy event.
function CreateEconomyEvent(unit, energy, mass, timeInSeconds)
end

--- TODO.
function CreateEmitterAtBone(entity, bone, army, emitter_blueprint)
end

--- TODO.
function CreateEmitterAtEntity(entity, army, emitter_bp_name)
end

--- TODO.
function CreateEmitterOnEntity(entity, army, emitter_bp_name)
end

--- TODO.
function CreateFootPlantController(unit, footBone, kneeBone, hipBone, [straightLegs], [maxFootFall])
end

--- Spawns initial unit for the given army.
-- @param armyName String, army's name.
-- @param initialUnitName String, unit blueprint name, example: 'uel0001'.
-- @return The created unit.
function CreateInitialArmyUnit(armyName, initialUnitName)
end

--- TODO.
function CreateLightParticle(entity, bone, army, size, lifetime, textureName, rampName)
end

--- TODO.
function CreateLightParticleIntel(entity, bone, army, size, lifetime, textureName, rampName)
end

--- Spawns a prop.
-- Orientation is set by the prop's model.
-- For more control over the orientation use CreatePropHPR.
-- @param location Table with position {x, y, z}.
-- @param prop_blueprint_id Blueprint ID of the prop to spawn, example: 'CrysCrystal01_prop'.
-- @return The spawned prop.
function CreateProp(location, prop_blueprint_id)
end

--- Spawns a prop.
-- Additional control to set orientation of the prop.
-- @param blueprint Full path to the prop's blueprint.
-- @param x Position on x axis.
-- @param y Position on y axis.
-- @param z Position on z axis.
-- @param heading TODO.
-- @param pitch TODO.
-- @param roll TODO.
-- @return The spawned prop.
function CreatePropHPR(blueprint, x, y, z, heading, pitch, roll)
end

--- Spawn Mass and Hydro points on the map.
-- @param type Type of the resource to create, either 'Mass' or 'Hydrocarbon'.
-- @param x Position on x axis.
-- @param y Position on y axis.
-- @param z Position on z axis.
-- @param size Size in game units, 1 for Mass, 3 for Hydro.
function CreateResourceDeposit(type, x, y, z, size)
end

--- Create a manipulator which rotates unit's bone.
-- @param unit Unit to create the manipulator for.
-- @param bone String, name of the bone to rotate.
-- @param axis String, 'x', 'Y' or 'z', axis to rotate around.
-- @param [goal] TODO.
-- @param [speed] TODO.
-- @param [accel] TODO.
-- @param [goalspeed] TODO.
-- @return manipulator
function CreateRotator(unit, bone, axis, [goal], [speed], [accel], [goalspeed])
end

--- Create a manipulator which copies the motion of src_bone onto dst_bone.
-- Priority matters! Only manipulators which come before the slave manipulator will be copied.
-- @param unit Unit to create the manipulator for.
-- @param dest_bone String, name of the bone to paste the motion to.
-- @param src_bone String, name of the bone to copy the motion from.
-- @return manipulator
function CreateSlaver(unit, dest_bone, src_bone)
end

--- TODO.
-- CreateSlider(unit, bone, [goal_x, goal_y, goal_z, [speed, [world_space]]]).
function CreateSlider()
end

--- TODO.
function CreateSplat(position, heading, textureName, sizeX, sizeZ, lodParam, duration, army, fidelity)
end

--- Add a splat to the game at an entity bone position and heading.
-- TODO.
function CreateSplatOnBone(boneName, offset, textureName, sizeX, sizeZ, lodParam, duration, army)
end

--- TODO.
function CreateStorageManip(unit, bone, resouceName, minX, minY, minZ, maxX, maxY, maxZ)
end

--- TODO.
function CreateThrustController(unit, label, thrustBone)
end

--- TODO.
function CreateTrail(entity, bone, army, trail_blueprint)
end

--- TODO.
function CreateUnit(blueprint, army, tx, ty, tz, qx, qy, qz, qw, [layer])
end

--- TODO.
function CreateUnit2(blueprint, army, layer, x, z, heading)
end

--- TODO.
function CreateUnitHPR(blueprint, army, x, y, z, pitch, yaw, roll)
end

--- Deals damage to the target unit.
-- @param instigator Source of the damage (unit) or nil.
-- @param target Unit taking the damage
-- @param amount Number, amount of damage.
-- @param damageType Example: 'Force', 'Normal', 'Nuke', 'Fire', TODO.
function Damage(instigator, target, amount, damageType)
end

--- Deals damage to the target unit.
-- @param instigator Source of the damage (unit) or nil.
-- @param location Table with position {x, y, z}.
-- @param radius Number, distance from the location to deal the damage.
-- @param amount Number, amount of damage.
-- @param damageType Example: 'Force', 'Normal', 'Nuke', 'Fire', TODO.
-- @param damageFriendly true/false if it should damage allied units.
-- @param [damageSelf] true/false if the unit dealing the damage should take it as well.
function DamageArea(instigator, location, radius, amount, damageType, damageFriendly, [damageSelf])
end

--- Deals damage to the target unit.
-- @param instigator Source of the damage (unit) or nil.
-- @param location Table with position {x, y, z}.
-- @param minRadius Number, distance from the location to start dealing damage.
-- @param maxRadius Number, distance from the location to stop dealing damage.
-- @param amount Number, amount of damage.
-- @param damageType Example: 'Force', 'Normal', 'Nuke', 'Fire', TODO.
-- @param damageFriendly true/false if it should damage allied units.
-- @param [damageSelf] true/false if the unit dealing the damage should take it as well.
function DamageRing(instigator, location, minRadius, maxRadius, amount, damageType, damageFriendly, [damageSelf])
end

--- Get DEBUG info for UI selection.
-- TODO.
function DebugGetSelection()
end

--- Draw a 3d circle at a with size s and color c.
-- TODO.
function DrawCircle()
end

--- Draw a 3d line from a to b with color c.
-- TODO.
function DrawLine()
end

--- Draw a 3d line from a to b with color c with a circle at the endof the target line.
-- TODO.
function DrawLinePop()
end

--- Check if the economy event is finished.
-- @param event Economy event created by CreateEconomyEvent function.
-- @return true/false.
function EconomyEventIsDone(event)
end

--- Signal the end of the game.
-- Acts like a permanent pause.
function EndGame()
end

--- Returns true if a unit category contains this unit.
-- @param category Unit category.
-- @unit Unit fo check for category.
function EntityCategoryContains(category, unit)
end

--- Count how many units fit the specified category.
-- @param category Unit category.
-- @tblUnits Table containing units, same as group of units.
-- @return Number.
function EntityCategoryCount(category, tblUnits)
end

--- Count how many units fit the specified category around a position.
-- TODO Ideas: (cytegory, position).
-- @return Number.
function EntityCategoryCountAroundPosition()
end

--- Filter a list of units to only those found in the category.
-- @param category Unit category.
-- @tblUnits Table containing units, same as group of units.
-- @return Filtered list of units.
function EntityCategoryFilterDown(category, tblUnits)
end

--- Changes elevation of the map in the desired area.
-- Used mainly for spawning buildings, so they don't float in air.
-- @param x Starting point on x axis in game units.
-- @param z Starting point on z axis in game units.
-- @param sizex Size on x axis in game units.
-- @param sizez Size on z axis in game units.
-- @param elevation Target elevation in game units.
function FlattenMapRect(x, z, sizex, sizez, elevation)
end

--- Deletes sscouted icons from the target area.
-- If the area is in a radar range, it will switch back to default unscouted icons.
function FlushIntelInRect(minX, minZ, maxX, maxZ)
end

--- TODO.
function GenerateArmyStart(strArmy)
end

--- TODO.
-- INFO: rotation = GenerateRandomOrientation()
function GenerateRandomOrientation()
end

--- Returns an army brain given the brain's name.
function GetArmyBrain(strArmy)
end

--- Returns current army's unit capacity.
function GetArmyUnitCap(strArmy)
end

--- TODO.
function GetArmyUnitCostTotal(strArmy)
end

--- Returns entity's blueprint.
-- Can be used as local bp = entity:GetBlueprint().
function GetBlueprint(entity)
end

--- Return the (1 based) index of the current command source.
-- TODO.
function GetCurrentCommandSource()
end

--- Return the enitities inside the given rectangle.
-- @param rectangle Map area created by function Rect(x0, z0, x1, z1).
function GetEntitiesInRect(rectangle)
end

--- Get entity by entity id.
-- This ID is unique for each entity.
function GetEntityById(id)
end

--- Returns the index of local army.
function GetFocusArmy()
end

--- Get the current game time in ticks.
-- The game time is the simulation time, that stops when the game is paused.
function GetGameTick()
end

--- Get the current game time in seconds.
-- The game time is the simulation time, that stops when the game is paused.
function GetGameTimeSeconds()
end

--- Returns map size.
-- @return sizeX, sizeZ.
function GetMapSize()
end

--- Return the reclamable things inside the given rectangle.
-- That includes props, units, wreckages.
-- @param rectangle Map area created by function Rect(x0, z0, x1, z1).
function GetReclaimablesInRect(rectangle)
end

--- Returns surface elevation at given position.
-- Takes water into count.
-- @param x Position on x axis.
-- @param z Position on x axis.
function GetSurfaceHeight(x z)
end

--- Returns System time in seconds.
-- INFO: float GetSystemTimeSecondsOnlyForProfileUse().
-- TODO.
function GetSystemTimeSecondsOnlyForProfileUse()
end

--- Returns elevation at given position.
-- Ignores water surface.
-- @param x Position on x axis.
-- @param z Position on x axis.
function GetTerrainHeight(x z)
end

--- Returns terrain type at given position.
-- INFO: type = GetTerrainType(x,z).
-- @param x Position on x axis.
-- @param z Position on z axis.
function GetTerrainType(x z)
end

--- TODO.
-- INFO: type = GetTerrainTypeOffset(x,z).
function GetTerrainTypeOffset(x z)
end

--- Returns unit's blueprint given the blueprint's name.
-- Example: 'ueb0101'.
-- @param bpName Unit's blueprint name.
function GetUnitBlueprintByName(bpName)
end

--- Returns unit by unique entity id.
-- This ID is unique for each entity.
function GetUnitById(id)
end

--- Return a table with units inside the given rectangle.
-- @param rectangle Map area created by function Rect(x0, z0, x1, z1).
function GetUnitsInRect(rectangle)
end

--- Returns true if the language for playing voices exists.
-- Available languages are in '/gamedata/loc'.
-- Game currently defaults on 'us' language if the localized voices don't exists.
-- @param language String of the language shortcut, example: 'us'.
function HasLocalizedVO(language)
end

--- Starts the AI on given army.
function InitializeArmyAI(strArmy)
end

--- Returns true if army2 is allied with army1.
-- @param army1 Army's index.
-- @param army2 Army's index.
function IsAlly(army1, army2)
end

--- TODO.
-- INFO: Blip = IsBlip(entity).
function IsBlip(entity)
end

--- TODO.
-- INFO: CollisionBeam = IsCollisionBeam(entity).
function IsCollisionBeam(entity)
end

--- Returns true if given command is finished.
-- @param cmd Unit's command crated for example by IssueMove().
function IsCommandDone(cmd)
end

--- Returns true if army2 is enemy to army1.
-- @param army1 Army's index.
-- @param army2 Army's index.
function IsEnemy(army1, army2)
end

--- Returns true if the given object is a Entity.
function IsEntity(object)
end

--- Return true if the game is over.
-- i.e. EndGame() has been called.
function IsGameOver()
end

--- Returns true if army2 is neutral to army1.
-- @param army1 Army's index.
-- @param army2 Army's index.
function IsNeutral(army1, army2)
end

--- Returns true if the target entity is a projectile.
function IsProjectile(entity)
end

--- Returns true if the target entity is a prop.
function IsProp(entity)
end

--- Returns true if the target entity is a unit.
function IsUnit(entity)
end

--- Orders group of units to attack move to target position.
-- @param tblUnits Table containing units, same as group of units.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueAggressiveMove(tblUnits, position)
end

--- Orders group of units to attack the target unit.
-- @param tblUnits Table containing units, same as group of units.
-- @param target Unit to attack.
-- @return Returns the issued command.
function IssueAttack(tblUnits, target)
end

--- Orders a group of factories to build units.
-- Works on mobile factories like Fatboy as well.
-- @param tblUnits Table containing factories.
-- @param blueprintID ID of the unit to build, example: 'uel0103'.
-- @param count How many units to build.
-- @return Returns the issued command.
function IssueBuildFactory(tblUnits, blueprintID, count)
end

--- Orders a group of engineers to build a unit at target position.
-- Example: IssueBuildMobile({builder}, Vector(pos.x, pos.y, pos.z-2), msid, {}).
-- @param tblUnits Table containing engineers.
-- @param position Table with position {x, y, z}.
-- @param blueprintID ID of the unit to build, example: 'ueb0103'.
-- @param table (Two element table - TODO: find out what it is) or empty table.
-- @return Returns the issued command.
function IssueBuildMobile(tblUnits, position, blueprintID, table)
end

--- Orders a group of engineers to capture the target unit.
-- @param tblUnits Table containing engineers.
-- @param target Unit to capture.
-- @return Returns the issued command.
function IssueCapture(tblUnits, target)
end

--- Clears all commands of given units.
-- That includes build queue as well.
-- @param tblUnits Table containing units.
function IssueClearCommands(tblUnits)
end

--- Clears factory command without affecting current build queue.
-- Used to change rally point while the factories are building units.
-- @param tblUnits Table containing factories.
function IssueClearFactoryCommands(tblUnits)
end

--- Orders unit to destroy itself.
-- This doesn't leave wreckage.
-- @param tblUnits Table containing units.
function IssueDestroySelf(tblUnits)
end

--- Orders a group of unit to dive.
-- Surfaces the unit if they are already under water.
-- @param tblUnits Table containing units.
function IssueDive(tblUnits)
end

--- Orders a group of factories to assisnt a target factory.
-- @param tblUnits Table containing factories.
-- @param target Factory to assist.
-- @return Returns the issued command.
function IssueFactoryAssist(tblUnits, target)
end

--- Sets a factory rally point.
-- Doesn't remove the current one, use IssueClearCommands for that.
-- @param position Table with position {x, y, z}.
function IssueFactoryRallyPoint(tblUnits, position)
end

--- TODO.
function IssueFerry(tblUnits, position)
end

--- Orders group of units to attack move in formation to target position.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @param formation Formation to use, 'AttackFormation', 'GrowthFormation'.
-- @param degrees The orientation the platoon should take when it reaches the position. South is 0 degrees, east is 90 degrees, etc.
-- @return Returns the issued command.
function IssueFormAggressiveMove(tblUnits, position, formation, degrees)
end

--- Orders group of units to attack the target unit.
-- Moves to the unit in a formation.
-- @param tblUnits Table containing units.
-- @param target Unit to attack.
-- @param formation Formation to use, 'AttackFormation', 'GrowthFormation'.
-- @param degrees The orientation the platoon should take when it reaches the position. South is 0 degrees, east is 90 degrees, etc.
-- @return Returns the issued command.
function IssueFormAttack(tblUnits, target, formation, degrees)
end

--- Oders group of units to move in formation to target position.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @param formation Formation to use, 'AttackFormation', 'GrowthFormation'.
-- @param degrees The orientation the platoon should take when it reaches the position. South is 0 degrees, east is 90 degrees, etc.
-- @return Returns the issued command.
function IssueFormMove(tblUnits, position, formation, degrees)
end

--- Oders group of units to patrol in formation on target position.
-- Call this at least twice for two different positions to have any meaning.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @param formation Formation to use, 'AttackFormation', 'GrowthFormation'.
-- @param degrees The orientation the platoon should take when it reaches the position. South is 0 degrees, east is 90 degrees, etc.
-- @return Returns the issued command.
function IssueFormPatrol(tblUnits, position, formation, degrees)
end

--- Orders group of unit to assist the target unit.
-- @param tblUnits Table containing units.
-- @param target Unit to assist.
-- @return Returns the issued command.
function IssueGuard(tblUnits, target)
end

--- Orders group of units to self-destruct.
-- Thisl leaves wreckages.
-- @param tblUnits Table containing units.
function IssueKillSelf(tblUnits)
end

--- Oders group of units to move to target position.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueMove(tblUnits, position)
end

--- Orders group of units to move off factory.
-- This is used to move units out of factories when they are finished.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueMoveOffFactory(tblUnits, position)
end

--- Launches a nuke at target position.
-- @param tblUnits Table containing Nuke Launchers.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueNuke(tblUnits, position)
end

--- Orders unit to fire OverCharge weapon at the target.
-- @param tblUnits Table containing units.
-- @param target Unit to OC.
function IssueOverCharge(tblUnits, target)
end

--- Oders group of units to patrol on target position.
-- Call this at least twice for two different positions to have any meaning.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssuePatrol(tblUnits, position)
end

--- Pauses the unit.
-- @param unit Unit to pause.
function IssuePause(unit)
end

--- Orders group of units to reclaim the target entity.
-- @param tblUnits Table containing units.
-- @param target Unit or prop to reclaim.
-- @return Returns the issued command.
function IssueReclaim(tblUnits, target)
end

--- Orders group of units to repair the target unit.
-- @param tblUnits Table containing units.
-- @param target Unit to repair.
-- @return Returns the issued command.
function IssueRepair(tblUnits, target)
end

--- Orders group of unit to use Sacrifice on target unit.
-- @param tblUnits Table containing units that can use sacrifice.
-- @param target Unit to to sacrifice into.
-- TODO This is untested.
-- @return Returns the issued command.
function IssueSacrifice(tblUnits, target)
end

--- Orders group of unit to do scripted task.
-- Currently used for ACU/sACU upgrading. Valid enhancement names are in the unut's blueprint or here http://wiki.faforever.com/index.php?title=Mission_Scripting#Enhancements .
-- @param tblUnits Table containing units.
-- @param oder Working format example: {TaskName = "EnhanceTask", Enhancement = "AdvancedEngineering"}.
-- @return Returns the issued command.
function IssueScript(tblUnits, order)
end

--- TODO.
function IssueSiloBuildNuke()
end

--- TODO.
function IssueSiloBuildTactical()
end

--- Order group of units to stop.
-- @param tblUnits Table containing units.
function IssueStop(tblUnits)
end

--- Orders group of units to fire a tactical missile at target or location.
-- @param tblUnits Table containing missle launchers.
-- @param target Unit to fire at or table with position {x, y, z}.
-- @return Returns the issued command.
function IssueTactical(tblUnits, target)
end

--- Orders group of units to teleport to target position.
-- @param tblUnits Table containing units.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueTeleport(tblUnits, position)
end

--- TODO.
function IssueTeleportToBeacon()
end

--- Orders group of units to load into the transport.
-- @param tblUnits Table containing units.
-- @param transport Transport unit to load into.
-- @return Returns the issued command.
function IssueTransportLoad(tblUnits, transport)
end

--- Orders group of transports to drop units at target position.
-- @param tblUnits Table containing transports.
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueTransportUnload(tblUnits, position)
end

--- Orders group of transports (carriers) to drop specific units at target position.
-- This seems to work only with carriers and not with air transports.
-- @param tblUnits Table containing transports (carriers).
-- @param category Unit category (categories.BOMBER).
-- @param position Table with position {x, y, z}.
-- @return Returns the issued command.
function IssueTransportUnloadSpecific(tblUnits, category, position)
end

--- Orders group of units to upgrade.
-- Used for factories, radars, etc.
-- @param tblUnits Table containing units.
-- @param blueprintID ID of the blueprint to upgrade to.
-- @return Returns the issued command.
function IssueUpgrade(tblUnits, blueprintID)
end

--- TODO.
-- INFO: ScriptTask.LUnitMove(self, target)
function LUnitMove(self, target)
end

--- TODO.
-- INFO: ScriptTask.LUnitMoveNear(self,target,range)
function LUnitMoveNear(self, target, range)
end

--- List all armies in the game.
-- @return Table containing strings of army names.
function ListArmies()
end

--- TODO.
function MetaImpact(instigator, location, fMaxRadius, iAmount, affectsCategory, [damageFriendly])
end

--- TODO.
function NotifyUpgrade(from, to)
end

--- Return true if the current command source is authorized to mess with the given army.
-- Or if cheats are enabled.
-- TODO.
function OkayToMessWithArmy()
end

--- Parse a string to generate a new entity category.
-- @param strCategory Example: 'ual0101'.
-- @return Returns generated category, example: categories.ual0101 .
function ParseEntityCategory(strCategory)
end

--- TODO.
-- INFO: handle = PlayLoop(self,sndParams)
function PlayLoop(self, sndParams)
end

--- TODO.
-- INFO: Random([[min,] max])
function Random()
end

--- Unrestrict the army from building the unit category.
-- The categories can be combined using + - * (), example: (categories.TECH3 * categories:NAVAL) + categories.urb0202.
-- @param army Army's index.
-- @param category Unit category.
function RemoveBuildRestriction(army, category)
end

--- Removes economy event created by CreateEconomyEvent function from the unit.
-- @param unit Unit to remove the event from.
-- @param event Event to remove.
function RemoveEconomyEvent(unit, event)
end

--- Returns the currently selected unit. For use at the lua console, so you can call Lua methods on a unit.
-- Example: unit = SelectedUnit().
function SelectedUnit()
end

--- Set alliances between 2 armies.
-- @param army1 Army's index.
-- @param army2 Army's index.
-- @param alliance Can be 'Neutral', 'Enemy', 'Ally'.
function SetAlliance(army1, army2, alliance)
end

--- Set alliances from army1 to army2.
-- @param army1 Army's index.
-- @param army2 Army's index.
-- @param alliance Can be 'Neutral', 'Enemy', 'Ally'.
function SetAllianceOneWay(army1, army2, alliance)
end

--- TODO.
function SetAlliedVictory()
end

--- TODO.
-- @param army Army's index.
-- @param personality TODO.
function SetArmyAIPersonality(army, personality)
end

--- Set army's color using RGB values.
-- @param army Army's index.
-- @param r Number 0-255.
-- @param g Number 0-255.
-- @param b Number 0-255.
function SetArmyColor(army, r, g, b)
end

--- TODO.
-- @param army Army's index.
function SetArmyColorIndex(army, index)
end

--- Gives mass and energy to the army.
-- TODO: Find out if this is in any way special than brain:GiveResource().
-- @param army Army's index.
-- @param mass Amount of mass to give.
-- @param energy Amount of energy to give.
function SetArmyEconomy(army, mass, energy)
end

--- Sets faction for the given army.
-- 0 - UEF, 1 - Aeon, 2 - Cybran, 3 - Seraphim.
-- @param army Army's index.
-- @param index Faction index.
function SetArmyFactionIndex(army, index)
end

--- Indicate that the supplied army has been defeated.
-- @param army Army's index.
function SetArmyOutOfGame(army)
end

--- TODO.
function SetArmyPlans(army, plans)
end

--- Determines if the user should be able to see the army score.
-- @param army Army's index.
-- @param bool true/false.
function SetArmyShowScore(army, bool)
end

--- Set the arty starting position.
-- Position where the initial unit will be spawned.
-- @param army Army's index.
-- @param x Position on the map on X axis.
-- @param x Position on the map on Z axis.
function SetArmyStart(army, x, z)
end

--- Set the army index for which to sync army stats (-1 for none) .
-- TODO
function SetArmyStatsSyncArmy()
end

--- Sets maximum number of units army can build.
-- @param army Army's index.
-- @param unitCap Number, the new unit cap.
function SetArmyUnitCap(army, unitCap)
end

--- Sets army to ignore max unit capacity.
-- @param army Army's index.
-- @param flag true/false.
function SetIgnoreArmyUnitCap(army, flag)
end

--- Sets army to ignore playable reclangle.
-- Units can move outside of restricted area.
-- Used in campaign for offmap attacks.
-- @param army Army's index.
-- @param flag true/false
function SetIgnorePlayableRect(army, flag)
end

--- Set playable rectangle.
function SetPlayableRect(minX, minZ, maxX, maxZ)
end

--- Changes terrain type at given position.
-- @param x Position on x axis.
-- @param z Position on z axis.
-- @param type Terrain type to change to.
function SetTerrainType(x, z, type)
end

--- Changes terrain type in given rectangle.
-- @paran rect Map area created by function Rect(x0, z0, x1, z1).
-- @param type Terrain type to change to.
function SetTerrainTypeRect(rect, type)
end

--- TODO.
function ShouldCreateInitialArmyUnits()
end

--- Perform a console command.
-- SimConExecute('command string').
function SimConExecute(commandString)
end

--- Split a prop into multiple child props, one per bone.
-- Used for breaking up tree groups at colision.
-- @param original Prop to split
-- @param blueprint_name BP name of the new props to spawn at each bone of the original prop.
-- @return Returns all the created props.
function SplitProp(original, blueprint_name)
end

--- TODO.
function StopLoop(self, handle)
end

--- Request that we submit xml army stats to gpg.net.
-- TODO.
function SubmitXMLArmyStats()
end

--- Attempt to copy animation pose from the unit to the prop.
-- Only works if the mesh and skeletons are the same, but will not produce an error if not.
-- @param unitFrom Unit to copy pose from.
-- @param entityTo Entity (prop) to copy pose on.
-- @param bCopyWorldTransform true/false.
function TryCopyPose(unitFrom, entityTo, bCopyWorldTransform)
end

--- Instanly moves entity to target location.
-- @param entity Entity to teleport.
-- @param location Table with position {x, y, z}.
-- @param orientation Target orientation, optimal parameter.
function Warp(entity, location, orientation)
end

--- TODO.
function _c_CreateEntity(spec)
end

--- TODO.
function _c_CreateShield(spec)
end

--- Print a log message
-- TODO
function print()
end

---
--  derived from Entity
function base()
end

---
--
function moho.CollisionBeamEntity()
end

--- Sinks the entity into the ground.
-- Used for dead trees for example.
-- @param vy Velocity at Y axis.
function SinkAway(vy)
end

---
--
function moho.entity_methods()
end

------
-- New functions from engine patch:
------

-- Returns list of deposits
-- Type: 0 - All, 1 - Mass, 2 - Energy
-- Result: {{X1,X2,Z1,Z2,Type,Dist},...}
function GetDepositsAroundPoint(X, Z, Radius, Type)
end

-- Returns true if the active session is a replay
-- Same as user SessionIsReplay.
function SessionIsReplay()
end

-- Allows set the rights to the army
-- targetArmyIndex, sourceHumanIndex is 0 based index
-- 'Set or Unset' is boolean
-- Nothing returns
function SetCommandSource(targetArmyIndex, sourceHumanIndex, Set or Unset)
end

-- Sets the focus without checking rights
-- armyIndex is 0 based index
-- Nothing returns
function SetFocusArmy(armyIndex or -1)
end

{'repo_name': 'FAForever/fa', 'stars': '101', 'repo_language': 'Lua', 'file_name': 'ping_nuke_marker.bp', 'mime_type': 'text/plain', 'hash': 4724117627341279912, 'source_dataset': 'data'}


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 22-dic-2009 14.20.04 by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
    <class name="it.eng.spagobi.profiling.bean.SbiUserAttributes" table="SBI_USER_ATTRIBUTES">
        <composite-id name="id" class="it.eng.spagobi.profiling.bean.SbiUserAttributesId">
            <key-property name="id" type="int">
                <column name="ID" />
            </key-property>
            <key-property name="attributeId" type="int">
                <column name="ATTRIBUTE_ID" />
            </key-property>
        </composite-id>

        <many-to-one name="sbiUser" class="it.eng.spagobi.profiling.bean.SbiUser" update="false" insert="false" fetch="select">
            <column name="ID" not-null="true" />
        </many-to-one>
        <many-to-one name="sbiAttribute" class="it.eng.spagobi.profiling.bean.SbiAttribute" update="false" insert="false" fetch="select">
            <column name="ATTRIBUTE_ID" not-null="true" />
        </many-to-one>
        <property name="attributeValue" type="string">
            <column name="ATTRIBUTE_VALUE" length="500" />
        </property>
    </class>
</hibernate-mapping>

{'repo_name': 'KnowageLabs/Knowage-Server', 'stars': '244', 'repo_language': 'Java', 'file_name': 'AbstractModelEditingTest.java', 'mime_type': 'text/x-java', 'hash': -819316487080745175, 'source_dataset': 'data'}


---
title: QueryClose constants
keywords: vblr6.chm1106127
f1_keywords:
- vblr6.chm1106127
ms.prod: office
ms.assetid: 0e7ca25d-316c-53bb-4213-1b0c8d529de4
ms.date: 12/11/2018
localization_priority: Normal
---

# QueryClose constants

The following [constants](../../Glossary/vbe-glossary.md#constant) can be used anywhere in your code in place of the actual values.

<br/>

|Constant|Value|Description|
|:-----|:-----|:-----|
|**vbFormControlMenu**|0|The user chose the **Close** command from the **Control** menu on the form.|
|**vbFormCode**|1|The **Unload** statement is invoked from code.|
|**vbAppWindows**|2|The current Microsoft Windows operating environment session is ending.|
|**vbAppTaskManager**|3|The Windows **Task Manager** is closing the application.|

## See also

- [Constants (Visual Basic for Applications)](../constants-visual-basic-for-applications.md)

[!include[Support and feedback](~/includes/feedback-boilerplate.md)]

{'repo_name': 'MicrosoftDocs/VBA-Docs', 'stars': '154', 'repo_language': 'PowerShell', 'file_name': 'create-or-replace-a-worksheet.md', 'mime_type': 'text/plain', 'hash': -2215009161770177436, 'source_dataset': 'data'}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Y!LDA: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>

Main Page

Related Pages

Namespaces

Classes

Files

File List

File Members

All

Functions

Variables

Typedefs

Defines

$

_

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

p

q

r

s

t

u

v

w

y

z

- a -

aacute
: UserManual.h

accept
: UserManual.h

accessories
: UserManual.h

accommodations
: UserManual.h

activities
: UserManual.h

activity
: UserManual.h

address
: UserManual.h

advanced
: UserManual.h

amp
: UserManual.h

apple
: UserManual.h

aqua
: UserManual.h

aquajoggeraj
: UserManual.h

aquatic
: UserManual.h

aqui
: UserManual.h

artists
: UserManual.h

<address style="text-align: right;">Generated on Sun Apr 24 01:38:36 2011 for Y!LDA by

 1.6.3 </address>

{'repo_name': 'sudar/Yahoo_LDA', 'stars': '341', 'repo_language': 'C++', 'file_name': 'license.txt', 'mime_type': 'text/plain', 'hash': 8310505387415642147, 'source_dataset': 'data'}


/** @file
  Virtio Network Device specific type and macro definitions corresponding to
  the virtio-0.9.5 specification.

  Copyright (C) 2013-2016, Red Hat, Inc.

  SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#ifndef _VIRTIO_0_9_5_NET_H_
#define _VIRTIO_0_9_5_NET_H_

#include <IndustryStandard/Virtio095.h>

//
// virtio-0.9.5, Appendix C: Network Device
//
#pragma pack(1)
typedef struct {
  UINT8      Mac[6];
  UINT16     LinkStatus;
} VIRTIO_NET_CONFIG;
#pragma pack()

#define OFFSET_OF_VNET(Field) OFFSET_OF (VIRTIO_NET_CONFIG, Field)
#define SIZE_OF_VNET(Field)   (sizeof ((VIRTIO_NET_CONFIG *) 0)->Field)

//
// Queue Identifiers
//
#define VIRTIO_NET_Q_RX 0
#define VIRTIO_NET_Q_TX 1

//
// Feature Bits
//
#define VIRTIO_NET_F_CSUM           BIT0  // host to checksum outgoing packets
#define VIRTIO_NET_F_GUEST_CSUM     BIT1  // guest to checksum incoming packets
#define VIRTIO_NET_F_MAC            BIT5  // MAC available to guest
#define VIRTIO_NET_F_GSO            BIT6  // deprecated
#define VIRTIO_NET_F_GUEST_TSO4     BIT7  // guest can receive TSOv4
#define VIRTIO_NET_F_GUEST_TSO6     BIT8  // guest can receive TSOv6
#define VIRTIO_NET_F_GUEST_ECN      BIT9  // guest can receive TSO with ECN
#define VIRTIO_NET_F_GUEST_UFO      BIT10 // guest can receive UFO
#define VIRTIO_NET_F_HOST_TSO4      BIT11 // host can receive TSOv4
#define VIRTIO_NET_F_HOST_TSO6      BIT12 // host can receive TSOv6
#define VIRTIO_NET_F_HOST_ECN       BIT13 // host can receive TSO with ECN
#define VIRTIO_NET_F_HOST_UFO       BIT14 // host can receive UFO
#define VIRTIO_NET_F_MRG_RXBUF      BIT15 // guest can merge receive buffers
#define VIRTIO_NET_F_STATUS         BIT16 // link status available to guest
#define VIRTIO_NET_F_CTRL_VQ        BIT17 // control channel available
#define VIRTIO_NET_F_CTRL_RX        BIT18 // control channel RX mode support
#define VIRTIO_NET_F_CTRL_VLAN      BIT19 // control channel VLAN filtering
#define VIRTIO_NET_F_GUEST_ANNOUNCE BIT21 // guest can send gratuitous pkts

//
// Packet Header
//
#pragma pack(1)
typedef struct {
  UINT8  Flags;
  UINT8  GsoType;
  UINT16 HdrLen;
  UINT16 GsoSize;
  UINT16 CsumStart;
  UINT16 CsumOffset;
} VIRTIO_NET_REQ;
#pragma pack()

//
// Bits in VIRTIO_NET_REQ.Flags
//
#define VIRTIO_NET_HDR_F_NEEDS_CSUM BIT0

//
// Types/Bits for VIRTIO_NET_REQ.GsoType
//
#define VIRTIO_NET_HDR_GSO_NONE  0x00
#define VIRTIO_NET_HDR_GSO_TCPV4 0x01
#define VIRTIO_NET_HDR_GSO_UDP   0x03
#define VIRTIO_NET_HDR_GSO_TCPV6 0x04
#define VIRTIO_NET_HDR_GSO_ECN   BIT7

//
// Link Status Bits in VIRTIO_NET_CONFIG.LinkStatus
//
#define VIRTIO_NET_S_LINK_UP  BIT0
#define VIRTIO_NET_S_ANNOUNCE BIT1

#endif // _VIRTIO_0_9_5_NET_H_

{'repo_name': 'tianocore/edk2', 'stars': '1775', 'repo_language': 'C', 'file_name': 'SerialPortInfoGuid.h', 'mime_type': 'text/x-c', 'hash': 281515752404060927, 'source_dataset': 'data'}


function frg_prob = TransformSegToProb(orig_bbox_size, erod_bbox_size, soft_erosion)
% transform the ground truth annotations to prob, used for analysis
% experiments
% soft_erosion: interpolate the values between
%

zero_prob       = 1e-12;
%one_prob        = 1 - zero_prob;
one_prob        = 0.75 - zero_prob;    % weak one probability
uniform_prob = 1 / 2;

orig_bbox_num_row = orig_bbox_size(2) - orig_bbox_size(1) + 1;
orig_bbox_num_col  = orig_bbox_size(4) - orig_bbox_size(3) + 1;

erod_bbox_min_row = erod_bbox_size(1) - orig_bbox_size(1) + 1;
erod_bbox_max_row = erod_bbox_size(2) - orig_bbox_size(1) + 1;
erod_bbox_min_col = erod_bbox_size(3) - orig_bbox_size(3) + 1;
erod_bbox_max_col = erod_bbox_size(4) - orig_bbox_size(3) + 1;

frg_prob = zero_prob * ones(orig_bbox_num_row, orig_bbox_num_col);
if soft_erosion
    mask = zeros(erod_bbox_max_row-erod_bbox_min_row+3, erod_bbox_max_col-erod_bbox_min_col+3);
    mask(2:end-1, 2:end-1) = 1;

    [x y] = meshgrid(1:size(mask,2), 1:size(mask,1));
    x_grid = unique([linspace(1,2, erod_bbox_size(3) - orig_bbox_size(3)+2), 1:size(mask,2), ...
        linspace(size(mask,2)-1,size(mask,2), orig_bbox_size(4) - erod_bbox_size(4) +2)]);
    y_grid = unique([linspace(1,2, erod_bbox_size(1) - orig_bbox_size(1)+2), 1:size(mask,1), ...
        linspace(size(mask,1)-1,size(mask,1), orig_bbox_size(2) - erod_bbox_size(2)+2)]);
    [xi yi] = meshgrid(x_grid, y_grid);

    tmp = interp2(x, y, mask, xi, yi);
    frg_prob = tmp(2:end-1, 2:end-1);
else
    mask = false(size(frg_prob));
    mask(erod_bbox_min_row:erod_bbox_max_row, erod_bbox_min_col:erod_bbox_max_col) = 1;

    frg_prob(mask) = one_prob;
    frg_prob(~mask) = uniform_prob;
end

{'repo_name': 'meng-tang/rloss', 'stars': '129', 'repo_language': 'Jupyter Notebook', 'file_name': 'fetchPascalScribble.sh', 'mime_type': 'text/x-shellscript', 'hash': -4187036062525079436, 'source_dataset': 'data'}


fileFormatVersion: 2
guid: cfac61b5ac93c4101b40011e6cd637b3
folderAsset: yes
DefaultImporter:
  externalObjects: {}
  userData:
  assetBundleName:
  assetBundleVariant:

{'repo_name': 'Verasl/BoatAttack', 'stars': '1199', 'repo_language': 'C#', 'file_name': 'AudioManager.asset', 'mime_type': 'text/plain', 'hash': -379694910580759624, 'source_dataset': 'data'}


Contributors
============

.. include:: ../CONTRIBUTORS.txt

.. raw:: html

Credits

.. include:: ../CREDITS.txt

{'repo_name': 'alberanid/imdbpy', 'stars': '679', 'repo_language': 'Python', 'file_name': 'test_http_search_movie_keyword.py', 'mime_type': 'text/x-python', 'hash': -8902972515484696181, 'source_dataset': 'data'}


// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2006-2010 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_MATHFUNCTIONS_H
#define EIGEN_MATHFUNCTIONS_H

namespace Eigen {

namespace internal {

/** \internal \struct global_math_functions_filtering_base
  *
  * What it does:
  * Defines a typedef 'type' as follows:
  * - if type T has a member typedef Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl, then
  *   global_math_functions_filtering_base<T>::type is a typedef for it.
  * - otherwise, global_math_functions_filtering_base<T>::type is a typedef for T.
  *
  * How it's used:
  * To allow to defined the global math functions (like sin...) in certain cases, like the Array expressions.
  * When you do sin(array1+array2), the object array1+array2 has a complicated expression type, all what you want to know
  * is that it inherits ArrayBase. So we implement a partial specialization of sin_impl for ArrayBase<Derived>.
  * So we must make sure to use sin_impl<ArrayBase<Derived> > and not sin_impl<Derived>, otherwise our partial specialization
  * won't be used. How does sin know that? That's exactly what global_math_functions_filtering_base tells it.
  *
  * How it's implemented:
  * SFINAE in the style of enable_if. Highly susceptible of breaking compilers. With GCC, it sure does work, but if you replace
  * the typename dummy by an integer template parameter, it doesn't work anymore!
  */

template<typename T, typename dummy = void>
struct global_math_functions_filtering_base
{
  typedef T type;
};

template<typename T> struct always_void { typedef void type; };

template<typename T>
struct global_math_functions_filtering_base
  <T,
   typename always_void<typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl>::type
  >
{
  typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type;
};

#define EIGEN_MATHFUNC_IMPL(func, scalar) func##_impl<typename global_math_functions_filtering_base<scalar>::type>
#define EIGEN_MATHFUNC_RETVAL(func, scalar) typename func##_retval<typename global_math_functions_filtering_base<scalar>::type>::type

/****************************************************************************
* Implementation of real                                                 *
****************************************************************************/

template<typename Scalar>
struct real_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar run(const Scalar& x)
  {
    return x;
  }
};

template<typename RealScalar>
struct real_impl<std::complex<RealScalar> >
{
  static inline RealScalar run(const std::complex<RealScalar>& x)
  {
    using std::real;
    return real(x);
  }
};

template<typename Scalar>
struct real_retval
{
  typedef typename NumTraits<Scalar>::Real type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x);
}

/****************************************************************************
* Implementation of imag                                                 *
****************************************************************************/

template<typename Scalar>
struct imag_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar run(const Scalar&)
  {
    return RealScalar(0);
  }
};

template<typename RealScalar>
struct imag_impl<std::complex<RealScalar> >
{
  static inline RealScalar run(const std::complex<RealScalar>& x)
  {
    using std::imag;
    return imag(x);
  }
};

template<typename Scalar>
struct imag_retval
{
  typedef typename NumTraits<Scalar>::Real type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x);
}

/****************************************************************************
* Implementation of real_ref                                             *
****************************************************************************/

template<typename Scalar>
struct real_ref_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar& run(Scalar& x)
  {
    return reinterpret_cast<RealScalar*>(&x)[0];
  }
  static inline const RealScalar& run(const Scalar& x)
  {
    return reinterpret_cast<const RealScalar*>(&x)[0];
  }
};

template<typename Scalar>
struct real_ref_retval
{
  typedef typename NumTraits<Scalar>::Real & type;
};

template<typename Scalar>
inline typename add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x)
{
  return real_ref_impl<Scalar>::run(x);
}

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) real_ref(Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x);
}

/****************************************************************************
* Implementation of imag_ref                                             *
****************************************************************************/

template<typename Scalar, bool IsComplex>
struct imag_ref_default_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar& run(Scalar& x)
  {
    return reinterpret_cast<RealScalar*>(&x)[1];
  }
  static inline const RealScalar& run(const Scalar& x)
  {
    return reinterpret_cast<RealScalar*>(&x)[1];
  }
};

template<typename Scalar>
struct imag_ref_default_impl<Scalar, false>
{
  static inline Scalar run(Scalar&)
  {
    return Scalar(0);
  }
  static inline const Scalar run(const Scalar&)
  {
    return Scalar(0);
  }
};

template<typename Scalar>
struct imag_ref_impl : imag_ref_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};

template<typename Scalar>
struct imag_ref_retval
{
  typedef typename NumTraits<Scalar>::Real & type;
};

template<typename Scalar>
inline typename add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x)
{
  return imag_ref_impl<Scalar>::run(x);
}

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) imag_ref(Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x);
}

/****************************************************************************
* Implementation of conj                                                 *
****************************************************************************/

template<typename Scalar>
struct conj_impl
{
  static inline Scalar run(const Scalar& x)
  {
    return x;
  }
};

template<typename RealScalar>
struct conj_impl<std::complex<RealScalar> >
{
  static inline std::complex<RealScalar> run(const std::complex<RealScalar>& x)
  {
    using std::conj;
    return conj(x);
  }
};

template<typename Scalar>
struct conj_retval
{
  typedef Scalar type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x);
}

/****************************************************************************
* Implementation of abs2                                                 *
****************************************************************************/

template<typename Scalar>
struct abs2_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar run(const Scalar& x)
  {
    return x*x;
  }
};

template<typename RealScalar>
struct abs2_impl<std::complex<RealScalar> >
{
  static inline RealScalar run(const std::complex<RealScalar>& x)
  {
    return real(x)*real(x) + imag(x)*imag(x);
  }
};

template<typename Scalar>
struct abs2_retval
{
  typedef typename NumTraits<Scalar>::Real type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x);
}

/****************************************************************************
* Implementation of norm1                                                *
****************************************************************************/

template<typename Scalar, bool IsComplex>
struct norm1_default_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar run(const Scalar& x)
  {
    using std::abs;
    return abs(real(x)) + abs(imag(x));
  }
};

template<typename Scalar>
struct norm1_default_impl<Scalar, false>
{
  static inline Scalar run(const Scalar& x)
  {
    using std::abs;
    return abs(x);
  }
};

template<typename Scalar>
struct norm1_impl : norm1_default_impl<Scalar, NumTraits<Scalar>::IsComplex> {};

template<typename Scalar>
struct norm1_retval
{
  typedef typename NumTraits<Scalar>::Real type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x)
{
  return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x);
}

/****************************************************************************
* Implementation of hypot                                                *
****************************************************************************/

template<typename Scalar>
struct hypot_impl
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline RealScalar run(const Scalar& x, const Scalar& y)
  {
    using std::max;
    using std::min;
    using std::abs;
    using std::sqrt;
    RealScalar _x = abs(x);
    RealScalar _y = abs(y);
    RealScalar p = (max)(_x, _y);
    RealScalar q = (min)(_x, _y);
    RealScalar qp = q/p;
    return p * sqrt(RealScalar(1) + qp*qp);
  }
};

template<typename Scalar>
struct hypot_retval
{
  typedef typename NumTraits<Scalar>::Real type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y)
{
  return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y);
}

/****************************************************************************
* Implementation of cast                                                 *
****************************************************************************/

template<typename OldType, typename NewType>
struct cast_impl
{
  static inline NewType run(const OldType& x)
  {
    return static_cast<NewType>(x);
  }
};

// here, for once, we're plainly returning NewType: we don't want cast to do weird things.

template<typename OldType, typename NewType>
inline NewType cast(const OldType& x)
{
  return cast_impl<OldType, NewType>::run(x);
}

/****************************************************************************
* Implementation of atanh2                                                *
****************************************************************************/

template<typename Scalar, bool IsInteger>
struct atanh2_default_impl
{
  typedef Scalar retval;
  typedef typename NumTraits<Scalar>::Real RealScalar;
  static inline Scalar run(const Scalar& x, const Scalar& y)
  {
    using std::abs;
    using std::log;
    using std::sqrt;
    Scalar z = x / y;
    if (abs(z) > sqrt(NumTraits<RealScalar>::epsilon()))
      return RealScalar(0.5) * log((y + x) / (y - x));
    else
      return z + z*z*z / RealScalar(3);
  }
};

template<typename Scalar>
struct atanh2_default_impl<Scalar, true>
{
  static inline Scalar run(const Scalar&, const Scalar&)
  {
    EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar)
    return Scalar(0);
  }
};

template<typename Scalar>
struct atanh2_impl : atanh2_default_impl<Scalar, NumTraits<Scalar>::IsInteger> {};

template<typename Scalar>
struct atanh2_retval
{
  typedef Scalar type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(atanh2, Scalar) atanh2(const Scalar& x, const Scalar& y)
{
  return EIGEN_MATHFUNC_IMPL(atanh2, Scalar)::run(x, y);
}

/****************************************************************************
* Implementation of pow                                                  *
****************************************************************************/

template<typename Scalar, bool IsInteger>
struct pow_default_impl
{
  typedef Scalar retval;
  static inline Scalar run(const Scalar& x, const Scalar& y)
  {
    using std::pow;
    return pow(x, y);
  }
};

template<typename Scalar>
struct pow_default_impl<Scalar, true>
{
  static inline Scalar run(Scalar x, Scalar y)
  {
    Scalar res(1);
    eigen_assert(!NumTraits<Scalar>::IsSigned || y >= 0);
    if(y & 1) res *= x;
    y >>= 1;
    while(y)
    {
      x *= x;
      if(y&1) res *= x;
      y >>= 1;
    }
    return res;
  }
};

template<typename Scalar>
struct pow_impl : pow_default_impl<Scalar, NumTraits<Scalar>::IsInteger> {};

template<typename Scalar>
struct pow_retval
{
  typedef Scalar type;
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(pow, Scalar) pow(const Scalar& x, const Scalar& y)
{
  return EIGEN_MATHFUNC_IMPL(pow, Scalar)::run(x, y);
}

/****************************************************************************
* Implementation of random                                               *
****************************************************************************/

template<typename Scalar,
         bool IsComplex,
         bool IsInteger>
struct random_default_impl {};

template<typename Scalar>
struct random_impl : random_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};

template<typename Scalar>
struct random_retval
{
  typedef Scalar type;
};

template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y);
template<typename Scalar> inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random();

template<typename Scalar>
struct random_default_impl<Scalar, false, false>
{
  static inline Scalar run(const Scalar& x, const Scalar& y)
  {
    return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX);
  }
  static inline Scalar run()
  {
    return run(Scalar(NumTraits<Scalar>::IsSigned ? -1 : 0), Scalar(1));
  }
};

enum {
  floor_log2_terminate,
  floor_log2_move_up,
  floor_log2_move_down,
  floor_log2_bogus
};

template<unsigned int n, int lower, int upper> struct floor_log2_selector
{
  enum { middle = (lower + upper) / 2,
         value = (upper <= lower + 1) ? int(floor_log2_terminate)
               : (n < (1 << middle)) ? int(floor_log2_move_down)
               : (n==0) ? int(floor_log2_bogus)
               : int(floor_log2_move_up)
  };
};

template<unsigned int n,
         int lower = 0,
         int upper = sizeof(unsigned int) * CHAR_BIT - 1,
         int selector = floor_log2_selector<n, lower, upper>::value>
struct floor_log2 {};

template<unsigned int n, int lower, int upper>
struct floor_log2<n, lower, upper, floor_log2_move_down>
{
  enum { value = floor_log2<n, lower, floor_log2_selector<n, lower, upper>::middle>::value };
};

template<unsigned int n, int lower, int upper>
struct floor_log2<n, lower, upper, floor_log2_move_up>
{
  enum { value = floor_log2<n, floor_log2_selector<n, lower, upper>::middle, upper>::value };
};

template<unsigned int n, int lower, int upper>
struct floor_log2<n, lower, upper, floor_log2_terminate>
{
  enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower };
};

template<unsigned int n, int lower, int upper>
struct floor_log2<n, lower, upper, floor_log2_bogus>
{
  // no value, error at compile time
};

template<typename Scalar>
struct random_default_impl<Scalar, false, true>
{
  typedef typename NumTraits<Scalar>::NonInteger NonInteger;

  static inline Scalar run(const Scalar& x, const Scalar& y)
  {
    return x + Scalar((NonInteger(y)-x+1) * std::rand() / (RAND_MAX + NonInteger(1)));
  }

  static inline Scalar run()
  {
#ifdef EIGEN_MAKING_DOCS
    return run(Scalar(NumTraits<Scalar>::IsSigned ? -10 : 0), Scalar(10));
#else
    enum { rand_bits = floor_log2<(unsigned int)(RAND_MAX)+1>::value,
           scalar_bits = sizeof(Scalar) * CHAR_BIT,
           shift = EIGEN_PLAIN_ENUM_MAX(0, int(rand_bits) - int(scalar_bits))
    };
    Scalar x = Scalar(std::rand() >> shift);
    Scalar offset = NumTraits<Scalar>::IsSigned ? Scalar(1 << (rand_bits-1)) : Scalar(0);
    return x - offset;
#endif
  }
};

template<typename Scalar>
struct random_default_impl<Scalar, true, false>
{
  static inline Scalar run(const Scalar& x, const Scalar& y)
  {
    return Scalar(random(real(x), real(y)),
                  random(imag(x), imag(y)));
  }
  static inline Scalar run()
  {
    typedef typename NumTraits<Scalar>::Real RealScalar;
    return Scalar(random<RealScalar>(), random<RealScalar>());
  }
};

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y)
{
  return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y);
}

template<typename Scalar>
inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random()
{
  return EIGEN_MATHFUNC_IMPL(random, Scalar)::run();
}

/****************************************************************************
* Implementation of fuzzy comparisons                                       *
****************************************************************************/

template<typename Scalar,
         bool IsComplex,
         bool IsInteger>
struct scalar_fuzzy_default_impl {};

template<typename Scalar>
struct scalar_fuzzy_default_impl<Scalar, false, false>
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  template<typename OtherScalar>
  static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
  {
    using std::abs;
    return abs(x) <= abs(y) * prec;
  }
  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
  {
    using std::min;
    using std::abs;
    return abs(x - y) <= (min)(abs(x), abs(y)) * prec;
  }
  static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec)
  {
    return x <= y || isApprox(x, y, prec);
  }
};

template<typename Scalar>
struct scalar_fuzzy_default_impl<Scalar, false, true>
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  template<typename OtherScalar>
  static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&)
  {
    return x == Scalar(0);
  }
  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&)
  {
    return x == y;
  }
  static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&)
  {
    return x <= y;
  }
};

template<typename Scalar>
struct scalar_fuzzy_default_impl<Scalar, true, false>
{
  typedef typename NumTraits<Scalar>::Real RealScalar;
  template<typename OtherScalar>
  static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
  {
    return abs2(x) <= abs2(y) * prec * prec;
  }
  static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
  {
    using std::min;
    return abs2(x - y) <= (min)(abs2(x), abs2(y)) * prec * prec;
  }
};

template<typename Scalar>
struct scalar_fuzzy_impl : scalar_fuzzy_default_impl<Scalar, NumTraits<Scalar>::IsComplex, NumTraits<Scalar>::IsInteger> {};

template<typename Scalar, typename OtherScalar>
inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y,
                                   typename NumTraits<Scalar>::Real precision = NumTraits<Scalar>::dummy_precision())
{
  return scalar_fuzzy_impl<Scalar>::template isMuchSmallerThan<OtherScalar>(x, y, precision);
}

template<typename Scalar>
inline bool isApprox(const Scalar& x, const Scalar& y,
                          typename NumTraits<Scalar>::Real precision = NumTraits<Scalar>::dummy_precision())
{
  return scalar_fuzzy_impl<Scalar>::isApprox(x, y, precision);
}

template<typename Scalar>
inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y,
                                    typename NumTraits<Scalar>::Real precision = NumTraits<Scalar>::dummy_precision())
{
  return scalar_fuzzy_impl<Scalar>::isApproxOrLessThan(x, y, precision);
}

/******************************************
***  The special case of the  bool type ***
******************************************/

template<> struct random_impl<bool>
{
  static inline bool run()
  {
    return random<int>(0,1)==0 ? false : true;
  }
};

template<> struct scalar_fuzzy_impl<bool>
{
  typedef bool RealScalar;

  template<typename OtherScalar>
  static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&)
  {
    return !x;
  }

  static inline bool isApprox(bool x, bool y, bool)
  {
    return x == y;
  }

  static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&)
  {
    return (!x) || y;
  }

};

/****************************************************************************
* Special functions                                                          *
****************************************************************************/

// std::isfinite is non standard, so let's define our own version,
// even though it is not very efficient.
template<typename T> bool (isfinite)(const T& x)
{
  return x<NumTraits<T>::highest() && x>NumTraits<T>::lowest();
}

} // end namespace internal

} // end namespace Eigen

#endif // EIGEN_MATHFUNCTIONS_H

{'repo_name': 'prclibo/relative-pose-estimation', 'stars': '136', 'repo_language': 'C++', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': -6168149651664912374, 'source_dataset': 'data'}


package org.orcid.core.email.trickle.producer;

import org.springframework.jms.core.JmsTemplate;

public class EmailQueueProducer {

    private JmsTemplate jmsTemplate;

    private static final String EMAIL_QUEUE = "email.queue";

    public void queueEmail(EmailTrickleItem item) {
        jmsTemplate.convertAndSend(EMAIL_QUEUE, item);
    }

    public void setJmsTemplate(JmsTemplate jmsTemplate) {
        this.jmsTemplate = jmsTemplate;
    }

}

{'repo_name': 'ORCID/ORCID-Source', 'stars': '210', 'repo_language': 'Java', 'file_name': 'S3ManagerTest.java', 'mime_type': 'text/x-java', 'hash': -302679014827414429, 'source_dataset': 'data'}


pim_enrich:
  #Attribute
  attribute:
    tab:
      parameter.title: Parameter
      value.title: Werte
      history.title: Historie
  #Family
  family:
    info:
      cant_remove_attribute_used_as_axis: Sie können dieses Attribut nicht entfernen, da es als Achse in der Variante der Produktfamilie verwendet wird
  #Group type
  group_type:
    tab:
      property.title: Eigenschaften
  #Mass edit operations
  mass_edit_action:
    family:
      page_title: Produktfamilien
      page_subtitle: Massenbearbeitung (1 Produktfamilie)|Massenbearbeitung (%count% Produktfamilien)
      title: Aktion auswählen
      subtitle: Wählen Sie die Aktion aus, die Sie auf die ausgewählte Produktfamilie anwenden wollen|Wählen Sie die Aktion aus, die Sie auf die ausgewählten %count% Produktfamilien anwenden wollen
      confirm: Sie sind dabei eine Produktfamilie mit den folgenden Informationen zu aktualisieren - bitte bestätigten Sie den Vorgang.|Sie sind dabei %count% Produktfamilien mit den folgenden Informationen zu aktualisieren - bitte bestätigten Sie den Vorgang.
      steps:
        first: Produktfamilien auswählen
        second: Aktion auswählen
        third: Konfigurieren
        fourth: Bestätigen
  entity:
    association_type:
      property:
        is_two_way: 2-Wege-Verbindung
        is_quantified: Verbindung mit Menge
pim_enrich_attribute_form:
  code: Code
  type: Attributtyp
  reference_data_name: Referenzdaten Name
  scopable: Wert je Ausgabekanal
  localizable: Wert je Gebietsschema
  unique: Eindeutiger Wert
  availableLocales: Verfügbare Gebietsschemata
  locale_specific: Gebietsschemaspezifisch
  group: Attributgruppe
  useableAsGridFilter: Anwendbar in der Listenansicht

{'repo_name': 'akeneo/pim-community-dev', 'stars': '719', 'repo_language': 'PHP', 'file_name': 'cell-formatter.js', 'mime_type': 'text/plain', 'hash': -374641379637765340, 'source_dataset': 'data'}


// Code generated by msgraph.go/gen DO NOT EDIT.

package msgraph

// DelegatedPermissionClassification undocumented
type DelegatedPermissionClassification struct {
	// Entity is the base model of DelegatedPermissionClassification
	Entity
	// PermissionID undocumented
	PermissionID *string `json:"permissionId,omitempty"`
	// PermissionName undocumented
	PermissionName *string `json:"permissionName,omitempty"`
	// Classification undocumented
	Classification *PermissionClassificationType `json:"classification,omitempty"`
}

{'repo_name': '42wim/matterbridge', 'stars': '2758', 'repo_language': 'Go', 'file_name': 'matterhook.go', 'mime_type': 'text/plain', 'hash': 476636320671188916, 'source_dataset': 'data'}


import {Component} from '@angular/core';

/**
 * @title Tooltip that can be manually shown/hidden.
 */
@Component({
  selector: 'tooltip-manual-example',
  templateUrl: 'tooltip-manual-example.html',
  styleUrls: ['tooltip-manual-example.css'],
})
export class TooltipManualExample {}

{'repo_name': 'angular/components', 'stars': '20069', 'repo_language': 'TypeScript', 'file_name': 'config.yml', 'mime_type': 'text/plain', 'hash': -8124081233986071350, 'source_dataset': 'data'}


---
layout: post
title: Accessibility auditing with react-axe and eslint-plugin-jsx-a11y
hero: hero-accessibility-auditing-react.jpg
subhead: |
  Your React site is not progressive if it's not accessible. Auditing during development can help you spot any issues.
date: 2019-04-29
updated: 2020-07-16
description: |
  react-axe is a library that audits a React application and logs any
  accessibility issues to the Chrome DevTools console. eslint-plugin-jsx-a11y
  is an ESLint plugin that identifies and enforces a number of accessibility
  rules directly in your JSX. Using them in combination can provide a
  comprehensive auditing approach to find and fix any accessibility concerns in
  your application.
authors:
  - houssein
---

{% Aside %}
  If you would like to learn about the basic concepts behind accessibility in
  web pages, refer to the [What is accessibility](/what-is-accessibility) guide
  first.
{% endAside %}

[`react-axe`](https://github.com/dequelabs/react-axe) is a library that audits a
React application and logs any accessibility issues to the Chrome DevTools
console. It uses the open-source [axe](https://github.com/dequelabs/axe-core)
testing library to flag any issues and their severity.

[`eslint-plugin-jsx-a11y`](https://github.com/evcohen/eslint-plugin-jsx-a11y) is
an ESLint plugin that identifies and enforces a number of accessibility rules
directly in your JSX. Using this in combination with a tool that tests the final
rendered DOM, such as `react-axe`, can help you find and fix any accessibility
concerns on your site.

## Why is this useful?

It is crucial to build web sites that provide every user, regardless of their
impairment or restriction, the capability to access its content. Using auditing
libraries such as `react-axe` and `eslint-plugin-jsx-a11y` during the
development of your React application will automatically surface any
accessibility issues as they pop up.

## Use eslint-plugin-jsx-a11y

React already supports writing accessible HTML elements within JSX syntax. For
example, you only need to use the `htmlFor` attribute instead of `for` to link a
label to a specific form element within a React component.

```html
<input id="promo" type="checkbox">
<label htmlFor="promo">Receive promotional offers?</label>
```

The
[React accessibility documentation](https://reactjs.org/docs/accessibility.html)
covers all the nuances of handling accessibility concerns within a React
component. To make it easier to spot these issues during development, Create
React App (CRA) includes the **`eslint-plugin-jsx-a11y`** plugin for ESLint by
default.

To enable pre-configured linting provided by CRA:

1. Install the appropriate [ESLint plugin](https://eslint.org/docs/user-guide/integrations#editors) for your code editor
2. Add a `.eslintrc.json` file to your project

```json
{
  "extends": "react-app"
}
```

{% Aside %}
  You can find more details about configuring your editor to support out-of-box
  linting in the
  [CRA documentation](https://facebook.github.io/create-react-app/docs/setting-up-your-editor).
{% endAside %}

Some common accessibility issues will now show up.

![Image accessibility warning in linter](./img-a11y-lint.png)

To check for even more accessibility rules, modify the file to automatically
include all the recommended rules by the plugin:

```json
{
  "extends": ["react-app", "plugin:jsx-a11y/recommended"]
}
```

If you would like an even stricter subset of rules, switch to strict mode:

```json
{
  "extends": ["react-app", "plugin:jsx-a11y/strict"]
}
```

![Label accessibility error in linter](./label-a11y-lint.png)

The project
[documentation](https://github.com/evcohen/eslint-plugin-jsx-a11y#difference-between-recommended-and-strict-mode)
provides information on the differences between recommended and strict mode.

## Use react-axe

`eslint-plugin-jsx-a11y` can help you easily pinpoint any accessibility issues
in your JSX, but it does not test any of the final HTML output. **`react-axe`**
is a library that does exactly this by providing a React wrapper around the
[`axe-core`](https://github.com/dequelabs/axe-core) testing tool by Deque Labs.

Install the library as a development dependency to begin:

```bash
npm install --save-dev react-axe
```

You now only need to initialize the module in `index.js`:

```js
if (process.env.NODE_ENV !== 'production') {
  import('react-axe').then(axe => {
    axe.default(React, ReactDOM, 1000);
    ReactDOM.render(<App />, document.getElementById('root'));
  });
} else {
  ReactDOM.render(<App />, document.getElementById('root'));
}
```

A
[dynamic import](https://developers.google.com/web/updates/2017/11/dynamic-import)
is used here to only load the library when it is not in production mode before
rendering and booting up the root `App` component. This ensures that it is not
unecessarily included in the final production bundle.

Now when you run the application during development, issues are surfaced
directly to the Chrome DevTools console.

<img class="w-screenshot w-screenshot--filled" src="./react-axe-devtools.png" alt="React Axe in Chrome DevTools">

A severity level is also assigned for each violation. These levels are:

* Minor
* Moderate
* Serious
* Critical

{% Aside %}
  If you would like to include accessibility testing in your unit testing
  workflow, take a look at the
  [Jest and axe integration example](https://github.com/dequelabs/axe-core/tree/develop/doc/examples/jest_react)
  to understand how.
{% endAside %}

## Conclusion

1. If you are building a site with React, include accessibility auditing into
   your workflow early to catch problems as you build your components.
2. Use `eslint-plugin-jsx-a11y` to add accessibility checks into your linting
   workflow. CRA already comes with it included, but switch to either the
   recommended or strict mode.
3. In addition to local development testing, include `react-axe` into your
   application to catch any issues on the final rendered DOM. Do not include it
   into your production bundle.

{'repo_name': 'GoogleChrome/web.dev', 'stars': '1306', 'repo_language': 'JavaScript', 'file_name': 'locale.js', 'mime_type': 'text/plain', 'hash': 7731655254490068383, 'source_dataset': 'data'}


<!--
  Copyright 2016 Goldman Sachs.
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->

<Mithra>
    <MithraObjectResource name="DatedReadOnlyOrder"/>
    <MithraObjectResource name="DatedTransactionalOrder"/>
    <MithraObjectResource name="ReadOnlyOrder"/>
    <MithraObjectResource name="TransactionalOrder"/>
    <MithraObjectResource name="DatedTransactionalWithSuperOrder"/>
    <MithraObjectResource name="TransactionalWithSuperOrder"/>
    <MithraObjectResource name="RelatedOrder"/>

    <MithraObjectResource name="SuperOrder"/>
</Mithra>

{'repo_name': 'goldmansachs/reladomo', 'stars': '312', 'repo_language': 'Java', 'file_name': 'TestGsIntegratorTransport.java', 'mime_type': 'text/plain', 'hash': 2960713578465217601, 'source_dataset': 'data'}