text:
@charset "UTF-8";
/* @section: base */
/* @section: grid */
/* @section: blocks */
/* @section: blocks */
/* @section: buttons */
/* @section: labels and badges */
.left {
  float: left !important; }

.right {
  float: right !important; }

.clearfix:before, .clearfix:after {
  content: " ";
  display: table; }

.clearfix:after {
  clear: both; }

.nowrap,
.nowrap td {
  white-space: nowrap; }

.text-left {
  text-align: left; }

.text-right {
  text-align: right; }

.text-center {
  text-align: center; }

.text-justify {
  text-align: justify; }

.full-width {
  width: 100%; }

.full-height {
  height: 100%; }

.block {
  display: block; }

.inline-block {
  display: inline-block; }

.hidden {
  display: none; }

.end {
  margin-bottom: 0 !important; }

/* Responsive Helper */
.video-wrapper {
  height: 0;
  padding-bottom: 56.25%;
  position: relative; }
  .video-wrapper iframe, .video-wrapper object, .video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; }

@media only screen and (max-width: 767px) {
  .left,
  .right {
    float: none; }

  .hide-on-mobile {
    display: none; } }
/* Buttons */
/* @section: btn-base */
.btn.btn-red,
input.btn.btn-red {
  color: #fff;
  background-color: #da4453;
  border: 1px solid #da4453; }
  .btn.btn-red:hover, .btn.btn-red.active,
  input.btn.btn-red:hover,
  input.btn.btn-red.active {
    background-color: #c42737;
    border-color: #c42737; }
  .btn.btn-red.disable,
  input.btn.btn-red.disable {
    background-color: #af2331;
    border-color: #af2331;
    color: #ebebeb; }
.btn.btn-orange,
input.btn.btn-orange {
  color: #fff;
  background-color: #e9573f;
  border: 1px solid #e9573f; }
  .btn.btn-orange:hover, .btn.btn-orange.active,
  input.btn.btn-orange:hover,
  input.btn.btn-orange.active {
    background-color: #dc3519;
    border-color: #dc3519; }
  .btn.btn-orange.disable,
  input.btn.btn-orange.disable {
    background-color: #c52f17;
    border-color: #c52f17;
    color: #ebebeb; }
.btn.btn-yellow,
input.btn.btn-yellow {
  color: #fff;
  background-color: #f6bb42;
  border: 1px solid #f6bb42; }
  .btn.btn-yellow:hover, .btn.btn-yellow.active,
  input.btn.btn-yellow:hover,
  input.btn.btn-yellow.active {
    background-color: #f4a911;
    border-color: #f4a911; }
  .btn.btn-yellow.disable,
  input.btn.btn-yellow.disable {
    background-color: #e19b0b;
    border-color: #e19b0b;
    color: #ebebeb; }
.btn.btn-green,
input.btn.btn-green {
  color: #fff;
  background-color: #8cc152;
  border: 1px solid #8cc152; }
  .btn.btn-green:hover, .btn.btn-green.active,
  input.btn.btn-green:hover,
  input.btn.btn-green.active {
    background-color: #72a53b;
    border-color: #72a53b; }
  .btn.btn-green.disable,
  input.btn.btn-green.disable {
    background-color: #659234;
    border-color: #659234;
    color: #ebebeb; }
.btn.btn-blue,
input.btn.btn-blue {
  color: #fff;
  background-color: #3bafda;
  border: 1px solid #3bafda; }
  .btn.btn-blue:hover, .btn.btn-blue.active,
  input.btn.btn-blue:hover,
  input.btn.btn-blue.active {
    background-color: #2494be;
    border-color: #2494be; }
  .btn.btn-blue.disable,
  input.btn.btn-blue.disable {
    background-color: #2084a9;
    border-color: #2084a9;
    color: #ebebeb; }
.btn.btn-white,
input.btn.btn-white {
  color: #000;
  background-color: #fff;
  border: 1px solid #fff; }
  .btn.btn-white:hover, .btn.btn-white.active,
  input.btn.btn-white:hover,
  input.btn.btn-white.active {
    background-color: #e6e6e6;
    border-color: #e6e6e6; }
  .btn.btn-white.disable,
  input.btn.btn-white.disable {
    background-color: #d9d9d9;
    border-color: #d9d9d9;
    color: black; }
.btn.btn-outline-red,
input.btn.btn-outline-red {
  color: #da4453;
  background-color: transparent;
  border: 1px solid #da4453; }
  .btn.btn-outline-red:hover, .btn.btn-outline-red.active,
  input.btn.btn-outline-red:hover,
  input.btn.btn-outline-red.active {
    color: #fff;
    background-color: #da4453; }
  .btn.btn-outline-red.disable,
  input.btn.btn-outline-red.disable {
    background-color: #efaeb5;
    color: #cd2939; }
.btn.btn-outline-orange,
input.btn.btn-outline-orange {
  color: #e9573f;
  background-color: transparent;
  border: 1px solid #e9573f; }
  .btn.btn-outline-orange:hover, .btn.btn-outline-orange.active,
  input.btn.btn-outline-orange:hover,
  input.btn.btn-outline-orange.active {
    color: #fff;
    background-color: #e9573f; }
  .btn.btn-outline-orange.disable,
  input.btn.btn-outline-orange.disable {
    background-color: #f6bbb1;
    color: #e5371a; }
.btn.btn-outline-yellow,
input.btn.btn-outline-yellow {
  color: #f6bb42;
  background-color: transparent;
  border: 1px solid #f6bb42; }
  .btn.btn-outline-yellow:hover, .btn.btn-outline-yellow.active,
  input.btn.btn-outline-yellow:hover,
  input.btn.btn-outline-yellow.active {
    color: #fff;
    background-color: #f6bb42; }
  .btn.btn-outline-yellow.disable,
  input.btn.btn-outline-yellow.disable {
    background-color: #fce7bc;
    color: #f4ad1b; }
.btn.btn-outline-green,
input.btn.btn-outline-green {
  color: #8cc152;
  background-color: transparent;
  border: 1px solid #8cc152; }
  .btn.btn-outline-green:hover, .btn.btn-outline-green.active,
  input.btn.btn-outline-green:hover,
  input.btn.btn-outline-green.active {
    color: #fff;
    background-color: #8cc152; }
  .btn.btn-outline-green.disable,
  input.btn.btn-outline-green.disable {
    background-color: #cae3b0;
    color: #78ac3e; }
.btn.btn-outline-blue,
input.btn.btn-outline-blue {
  color: #3bafda;
  background-color: transparent;
  border: 1px solid #3bafda; }
  .btn.btn-outline-blue:hover, .btn.btn-outline-blue.active,
  input.btn.btn-outline-blue:hover,
  input.btn.btn-outline-blue.active {
    color: #fff;
    background-color: #3bafda; }
  .btn.btn-outline-blue.disable,
  input.btn.btn-outline-blue.disable {
    background-color: #a6dbee;
    color: #269bc7; }
.btn.btn-outline-white,
input.btn.btn-outline-white {
  color: white;
  background-color: transparent;
  border: 1px solid #fff; }
  .btn.btn-outline-white:hover, .btn.btn-outline-white.active,
  input.btn.btn-outline-white:hover,
  input.btn.btn-outline-white.active {
    color: #fff;
    background-color: #fff; }
  .btn.btn-outline-white.disable,
  input.btn.btn-outline-white.disable {
    background-color: white;
    color: #ebebeb; }
  .btn.btn-outline-white:hover, .btn.btn-outline-white.active,
  input.btn.btn-outline-white:hover,
  input.btn.btn-outline-white.active {
    color: #000; }
  .btn.btn-outline-white.disable,
  input.btn.btn-outline-white.disable {
    background-color: #d9d9d9;
    border-color: #d9d9d9;
    color: black; }

/* Forms */
/* @section: forms-base */
.form-ctrl input.form-input,
.form-ctrl textarea.form-textarea,
.form-ctrl select.form-select,
.form-ctrl select.form-select option,
.form-ctrl select.form-select-group {
  color: #373737;
  text-align: left;
  padding: 0.3em 0.8em;
  border: 3px solid #EDEDED;
  background-color: #fff;
  -webkit-transition: 0.2s;
  -moz-transition: 0.2s;
  transition: 0.2s; }
  .form-ctrl input.form-input.blue,
  .form-ctrl textarea.form-textarea.blue,
  .form-ctrl select.form-select.blue,
  .form-ctrl select.form-select option.blue,
  .form-ctrl select.form-select-group.blue {
    border-color: #9fc1ed; }
    .form-ctrl input.form-input.blue:focus,
    .form-ctrl textarea.form-textarea.blue:focus,
    .form-ctrl select.form-select.blue:focus,
    .form-ctrl select.form-select option.blue:focus,
    .form-ctrl select.form-select-group.blue:focus {
      border-color: #4a89dc; }
      .form-ctrl input.form-input.blue:focus + i,
      .form-ctrl textarea.form-textarea.blue:focus + i,
      .form-ctrl select.form-select.blue:focus + i,
      .form-ctrl select.form-select option.blue:focus + i,
      .form-ctrl select.form-select-group.blue:focus + i {
        color: #4a89dc; }
    .form-ctrl input.form-input.blue + i,
    .form-ctrl textarea.form-textarea.blue + i,
    .form-ctrl select.form-select.blue + i,
    .form-ctrl select.form-select option.blue + i,
    .form-ctrl select.form-select-group.blue + i {
      color: #9fc1ed; }
  .form-ctrl input.form-input.yellow,
  .form-ctrl textarea.form-textarea.yellow,
  .form-ctrl select.form-select.yellow,
  .form-ctrl select.form-select option.yellow,
  .form-ctrl select.form-select-group.yellow {
    border-color: #fbdea3; }
    .form-ctrl input.form-input.yellow:focus,
    .form-ctrl textarea.form-textarea.yellow:focus,
    .form-ctrl select.form-select.yellow:focus,
    .form-ctrl select.form-select option.yellow:focus,
    .form-ctrl select.form-select-group.yellow:focus {
      border-color: #f6bb42; }
      .form-ctrl input.form-input.yellow:focus + i,
      .form-ctrl textarea.form-textarea.yellow:focus + i,
      .form-ctrl select.form-select.yellow:focus + i,
      .form-ctrl select.form-select option.yellow:focus + i,
      .form-ctrl select.form-select-group.yellow:focus + i {
        color: #f6bb42; }
    .form-ctrl input.form-input.yellow + i,
    .form-ctrl textarea.form-textarea.yellow + i,
    .form-ctrl select.form-select.yellow + i,
    .form-ctrl select.form-select option.yellow + i,
    .form-ctrl select.form-select-group.yellow + i {
      color: #fbdea3; }
  .form-ctrl input.form-input.red,
  .form-ctrl textarea.form-textarea.red,
  .form-ctrl select.form-select.red,
  .form-ctrl select.form-select option.red,
  .form-ctrl select.form-select-group.red {
    border-color: #eb99a1; }
    .form-ctrl input.form-input.red:focus,
    .form-ctrl textarea.form-textarea.red:focus,
    .form-ctrl select.form-select.red:focus,
    .form-ctrl select.form-select option.red:focus,
    .form-ctrl select.form-select-group.red:focus {
      border-color: #da4453; }
      .form-ctrl input.form-input.red:focus + i,
      .form-ctrl textarea.form-textarea.red:focus + i,
      .form-ctrl select.form-select.red:focus + i,
      .form-ctrl select.form-select option.red:focus + i,
      .form-ctrl select.form-select-group.red:focus + i {
        color: #da4453; }
    .form-ctrl input.form-input.red + i,
    .form-ctrl textarea.form-textarea.red + i,
    .form-ctrl select.form-select.red + i,
    .form-ctrl select.form-select option.red + i,
    .form-ctrl select.form-select-group.red + i {
      color: #eb99a1; }
  .form-ctrl input.form-input.green,
  .form-ctrl textarea.form-textarea.green,
  .form-ctrl select.form-select.green,
  .form-ctrl select.form-select option.green,
  .form-ctrl select.form-select-group.green {
    border-color: #bedc9d; }
    .form-ctrl input.form-input.green:focus,
    .form-ctrl textarea.form-textarea.green:focus,
    .form-ctrl select.form-select.green:focus,
    .form-ctrl select.form-select option.green:focus,
    .form-ctrl select.form-select-group.green:focus {
      border-color: #8cc152; }
      .form-ctrl input.form-input.green:focus + i,
      .form-ctrl textarea.form-textarea.green:focus + i,
      .form-ctrl select.form-select.green:focus + i,
      .form-ctrl select.form-select option.green:focus + i,
      .form-ctrl select.form-select-group.green:focus + i {
        color: #8cc152; }
    .form-ctrl input.form-input.green + i,
    .form-ctrl textarea.form-textarea.green + i,
    .form-ctrl select.form-select.green + i,
    .form-ctrl select.form-select option.green + i,
    .form-ctrl select.form-select-group.green + i {
      color: #bedc9d; }
  .form-ctrl input.form-input.orange,
  .form-ctrl textarea.form-textarea.orange,
  .form-ctrl select.form-select.orange,
  .form-ctrl select.form-select option.orange,
  .form-ctrl select.form-select-group.orange {
    border-color: #f3a79b; }
    .form-ctrl input.form-input.orange:focus,
    .form-ctrl textarea.form-textarea.orange:focus,
    .form-ctrl select.form-select.orange:focus,
    .form-ctrl select.form-select option.orange:focus,
    .form-ctrl select.form-select-group.orange:focus {
      border-color: #e9573f; }
      .form-ctrl input.form-input.orange:focus + i,
      .form-ctrl textarea.form-textarea.orange:focus + i,
      .form-ctrl select.form-select.orange:focus + i,
      .form-ctrl select.form-select option.orange:focus + i,
      .form-ctrl select.form-select-group.orange:focus + i {
        color: #e9573f; }
    .form-ctrl input.form-input.orange + i,
    .form-ctrl textarea.form-textarea.orange + i,
    .form-ctrl select.form-select.orange + i,
    .form-ctrl select.form-select option.orange + i,
    .form-ctrl select.form-select-group.orange + i {
      color: #f3a79b; }
  .form-ctrl input.form-input.focus-blue:focus,
  .form-ctrl textarea.form-textarea.focus-blue:focus,
  .form-ctrl select.form-select.focus-blue:focus,
  .form-ctrl select.form-select option.focus-blue:focus,
  .form-ctrl select.form-select-group.focus-blue:focus {
    border-color: #4a89dc; }
  .form-ctrl input.form-input.focus-yellow:focus,
  .form-ctrl textarea.form-textarea.focus-yellow:focus,
  .form-ctrl select.form-select.focus-yellow:focus,
  .form-ctrl select.form-select option.focus-yellow:focus,
  .form-ctrl select.form-select-group.focus-yellow:focus {
    border-color: #f6bb42; }
  .form-ctrl input.form-input.focus-red:focus,
  .form-ctrl textarea.form-textarea.focus-red:focus,
  .form-ctrl select.form-select.focus-red:focus,
  .form-ctrl select.form-select option.focus-red:focus,
  .form-ctrl select.form-select-group.focus-red:focus {
    border-color: #da4453; }
  .form-ctrl input.form-input.focus-green:focus,
  .form-ctrl textarea.form-textarea.focus-green:focus,
  .form-ctrl select.form-select.focus-green:focus,
  .form-ctrl select.form-select option.focus-green:focus,
  .form-ctrl select.form-select-group.focus-green:focus {
    border-color: #8cc152; }
  .form-ctrl input.form-input.focus-orange:focus,
  .form-ctrl textarea.form-textarea.focus-orange:focus,
  .form-ctrl select.form-select.focus-orange:focus,
  .form-ctrl select.form-select option.focus-orange:focus,
  .form-ctrl select.form-select-group.focus-orange:focus {
    border-color: #e9573f; }
.form-ctrl .form-input-group.icon i {
  -webkit-transition: 0.2s;
  -moz-transition: 0.2s;
  transition: 0.2s; }

/* @section: forms-input-placeholder */
::-webkit-input-placeholder {
  color: #bababa; }

:-moz-placeholder {
  /* Firefox 18- */
  color: #bababa; }

::-moz-placeholder {
  /* Firefox 19+ */
  color: #bababa; }

:-ms-input-placeholder {
  color: #bababa; }

/* @section: forms-controls */
.form-ctrl.form-checkbox input[type=checkbox], .form-ctrl.form-radio input[type=checkbox] {
  visibility: hidden; }
.form-ctrl.form-checkbox .chkbox-input, .form-ctrl.form-radio .chkbox-input {
  position: relative;
  display: inline-block; }
  .form-ctrl.form-checkbox .chkbox-input label, .form-ctrl.form-radio .chkbox-input label {
    cursor: pointer;
    position: absolute;
    width: 15px;
    height: 15px;
    top: 25%;
    left: 0;
    background: #eee;
    border: 1px solid #ddd; }
    .form-ctrl.form-checkbox .chkbox-input label:after, .form-ctrl.form-radio .chkbox-input label:after {
      opacity: 0.2;
      content: '';
      position: absolute;
      width: 9px;
      height: 5px;
      background: transparent;
      top: 4px;
      left: 2px;
      border: 3px solid #333;
      border-top: none;
      border-right: none;
      -webkit-transform: rotate(-45deg);
      -moz-transform: rotate(-45deg);
      -o-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg); }
    .form-ctrl.form-checkbox .chkbox-input label:hover::after, .form-ctrl.form-radio .chkbox-input label:hover::after {
      opacity: 0.5; }
  .form-ctrl.form-checkbox .chkbox-input input[type=checkbox]:checked + label:after, .form-ctrl.form-radio .chkbox-input input[type=checkbox]:checked + label:after {
    opacity: 1; }
  .form-ctrl.form-checkbox .chkbox-input.chk-blue label, .form-ctrl.form-radio .chkbox-input.chk-blue label {
    background-color: #bce4f2;
    border-color: #3bafda; }
    .form-ctrl.form-checkbox .chkbox-input.chk-blue label:after, .form-ctrl.form-radio .chkbox-input.chk-blue label:after {
      border-color: #3bafda; }
  .form-ctrl.form-checkbox .chkbox-input.chk-red label, .form-ctrl.form-radio .chkbox-input.chk-red label {
    background-color: #f3c4c8;
    border-color: #da4453; }
    .form-ctrl.form-checkbox .chkbox-input.chk-red label:after, .form-ctrl.form-radio .chkbox-input.chk-red label:after {
      border-color: #da4453; }
  .form-ctrl.form-checkbox .chkbox-input.chk-yellow label, .form-ctrl.form-radio .chkbox-input.chk-yellow label {
    background-color: #fdf0d4;
    border-color: #f6bb42; }
    .form-ctrl.form-checkbox .chkbox-input.chk-yellow label:after, .form-ctrl.form-radio .chkbox-input.chk-yellow label:after {
      border-color: #f6bb42; }
  .form-ctrl.form-checkbox .chkbox-input.chk-orange label, .form-ctrl.form-radio .chkbox-input.chk-orange label {
    background-color: #f9cfc8;
    border-color: #e9573f; }
    .form-ctrl.form-checkbox .chkbox-input.chk-orange label:after, .form-ctrl.form-radio .chkbox-input.chk-orange label:after {
      border-color: #e9573f; }
  .form-ctrl.form-checkbox .chkbox-input.chk-green label, .form-ctrl.form-radio .chkbox-input.chk-green label {
    background-color: #d7e9c3;
    border-color: #8cc152; }
    .form-ctrl.form-checkbox .chkbox-input.chk-green label:after, .form-ctrl.form-radio .chkbox-input.chk-green label:after {
      border-color: #8cc152; }
.form-ctrl.form-checkbox input[type=radio], .form-ctrl.form-radio input[type=radio] {
  visibility: hidden; }
.form-ctrl.form-checkbox .rdo-input, .form-ctrl.form-radio .rdo-input {
  position: relative;
  display: inline-block; }
  .form-ctrl.form-checkbox .rdo-input label, .form-ctrl.form-radio .rdo-input label {
    cursor: pointer;
    position: absolute;
    width: 15px;
    height: 15px;
    top: 25%;
    left: 0;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 50%; }
    .form-ctrl.form-checkbox .rdo-input label:after, .form-ctrl.form-radio .rdo-input label:after {
      opacity: 0.2;
      content: '';
      position: absolute;
      width: 7px;
      height: 7px;
      background: #333;
      top: 3px;
      left: 3px;
      border: 3px solid #333;
      border-radius: 50%; }
    .form-ctrl.form-checkbox .rdo-input label:hover::after, .form-ctrl.form-radio .rdo-input label:hover::after {
      opacity: 0.5; }
  .form-ctrl.form-checkbox .rdo-input input[type=radio]:checked + label:after, .form-ctrl.form-radio .rdo-input input[type=radio]:checked + label:after {
    opacity: 1; }
  .form-ctrl.form-checkbox .rdo-input.rdo-blue label, .form-ctrl.form-radio .rdo-input.rdo-blue label {
    background-color: #bce4f2;
    border-color: #3bafda; }
    .form-ctrl.form-checkbox .rdo-input.rdo-blue label:after, .form-ctrl.form-radio .rdo-input.rdo-blue label:after {
      background-color: #3bafda;
      border-color: #3bafda; }
  .form-ctrl.form-checkbox .rdo-input.rdo-red label, .form-ctrl.form-radio .rdo-input.rdo-red label {
    background-color: #f3c4c8;
    border-color: #da4453; }
    .form-ctrl.form-checkbox .rdo-input.rdo-red label:after, .form-ctrl.form-radio .rdo-input.rdo-red label:after {
      background-color: #da4453;
      border-color: #da4453; }
  .form-ctrl.form-checkbox .rdo-input.rdo-yellow label, .form-ctrl.form-radio .rdo-input.rdo-yellow label {
    background-color: #fdf0d4;
    border-color: #f6bb42; }
    .form-ctrl.form-checkbox .rdo-input.rdo-yellow label:after, .form-ctrl.form-radio .rdo-input.rdo-yellow label:after {
      background-color: #f6bb42;
      border-color: #f6bb42; }
  .form-ctrl.form-checkbox .rdo-input.rdo-orange label, .form-ctrl.form-radio .rdo-input.rdo-orange label {
    background-color: #f9cfc8;
    border-color: #e9573f; }
    .form-ctrl.form-checkbox .rdo-input.rdo-orange label:after, .form-ctrl.form-radio .rdo-input.rdo-orange label:after {
      background-color: #e9573f;
      border-color: #e9573f; }
  .form-ctrl.form-checkbox .rdo-input.rdo-green label, .form-ctrl.form-radio .rdo-input.rdo-green label {
    background-color: #d7e9c3;
    border-color: #8cc152; }
    .form-ctrl.form-checkbox .rdo-input.rdo-green label:after, .form-ctrl.form-radio .rdo-input.rdo-green label:after {
      background-color: #8cc152;
      border-color: #8cc152; }
.form-ctrl input.form-input.sucess,
.form-ctrl textarea.form-textarea.sucess,
.form-ctrl select.form-select.sucess,
.form-ctrl select.form-select option.sucess,
.form-ctrl select.form-select-group.sucess {
  border-color: #8cc152; }
.form-ctrl input.form-input.warning,
.form-ctrl textarea.form-textarea.warning,
.form-ctrl select.form-select.warning,
.form-ctrl select.form-select option.warning,
.form-ctrl select.form-select-group.warning {
  border-color: #f6bb42; }
.form-ctrl input.form-input.error,
.form-ctrl textarea.form-textarea.error,
.form-ctrl select.form-select.error,
.form-ctrl select.form-select option.error,
.form-ctrl select.form-select-group.error {
  border-color: #da4453; }

/* Forms */
/* @section: form-base */
.label.lbl-blue,
.badge.lbl-blue {
  color: #fff;
  background-color: #3bafda;
  border: 1px solid #3bafda; }
.label.lbl-red,
.badge.lbl-red {
  color: #fff;
  background-color: #da4453;
  border: 1px solid #da4453; }
.label.lbl-yellow,
.badge.lbl-yellow {
  color: #fff;
  background-color: #f6bb42;
  border: 1px solid #f6bb42; }
.label.lbl-green,
.badge.lbl-green {
  color: #fff;
  background-color: #8cc152;
  border: 1px solid #8cc152; }
.label.lbl-orange,
.badge.lbl-orange {
  color: #fff;
  background-color: #e9573f;
  border: 1px solid #e9573f; }
.label.lbl-white,
.badge.lbl-white {
  color: #000;
  background-color: #fff;
  border: 1px solid #fff; }
.label.lbl-outline-blue,
.badge.lbl-outline-blue {
  color: #3bafda;
  background-color: transparent;
  border: 1px solid #3bafda; }
.label.lbl-outline-red,
.badge.lbl-outline-red {
  color: #da4453;
  background-color: transparent;
  border: 1px solid #da4453; }
.label.lbl-outline-yellow,
.badge.lbl-outline-yellow {
  color: #f6bb42;
  background-color: transparent;
  border: 1px solid #f6bb42; }
.label.lbl-outline-green,
.badge.lbl-outline-green {
  color: #8cc152;
  background-color: transparent;
  border: 1px solid #8cc152; }
.label.lbl-outline-orange,
.badge.lbl-outline-orange {
  color: #e9573f;
  background-color: transparent;
  border: 1px solid #e9573f; }
.label.lbl-outline-white,
.badge.lbl-outline-white {
  color: #fff;
  background-color: transparent;
  border: 1px solid #fff; }
.label.icon-prepend i,
.badge.icon-prepend i {
  padding-right: 5px; }
.label.icon-append i,
.badge.icon-append i {
  padding-left: 5px; }

.badge {
  border-radius: 15px; }

.bgc.white {
  background-color: #fff; }
.bgc.black {
  background-color: #000; }
.bgc.black-light {
  background-color: #373737; }
.bgc.gray {
  background-color: #CBCBCB; }
.bgc.gray-light {
  background-color: #EDEDED; }
.bgc.red-light {
  background-color: #ed5565; }
.bgc.red-dark {
  background-color: #da4453; }
.bgc.orange-light {
  background-color: #fc6e51; }
.bgc.orange-dark {
  background-color: #e9573f; }
.bgc.yellow-light {
  background-color: #ffce54; }
.bgc.yellow-dark {
  background-color: #f6bb42; }
.bgc.green-light {
  background-color: #a0d468; }
.bgc.green-dark {
  background-color: #8cc152; }
.bgc.greensea-light {
  background-color: #48cfad; }
.bgc.greensea-dark {
  background-color: #37bc9b; }
.bgc.blue-light {
  background-color: #4fc1e9; }
.bgc.blue-dark {
  background-color: #3bafda; }
.bgc.sky-light {
  background-color: #5d9cec; }
.bgc.sky-dark {
  background-color: #4a89dc; }

.color.white {
  color: #fff; }
.color.black {
  color: #000; }
.color.black-light {
  color: #373737; }
.color.gray {
  color: #CBCBCB; }
.color.gray-light {
  color: #EDEDED; }
.color.red-light {
  color: #ed5565; }
.color.red-dark {
  color: #da4453; }
.color.orange-light {
  color: #fc6e51; }
.color.orange-dark {
  color: #e9573f; }
.color.yellow-light {
  color: #ffce54; }
.color.yellow-dark {
  color: #f6bb42; }
.color.green-light {
  color: #a0d468; }
.color.green-dark {
  color: #8cc152; }
.color.greensea-light {
  color: #48cfad; }
.color.greensea-dark {
  color: #37bc9b; }
.color.blue-light {
  color: #4fc1e9; }
.color.blue-dark {
  color: #3bafda; }
.color.sky-light {
  color: #5d9cec; }
.color.sky-dark {
  color: #4a89dc; }

.brdc.white {
  border-color: #fff; }
.brdc.black {
  border-color: #000; }
.brdc.black-light {
  border-color: #373737; }
.brdc.gray {
  border-color: #CBCBCB; }
.brdc.gray-light {
  border-color: #EDEDED; }
.brdc.red-light {
  border-color: #ed5565; }
.brdc.red-dark {
  border-color: #da4453; }
.brdc.orange-light {
  border-color: #fc6e51; }
.brdc.orange-dark {
  border-color: #e9573f; }
.brdc.yellow-light {
  border-color: #ffce54; }
.brdc.yellow-dark {
  border-color: #f6bb42; }
.brdc.green-light {
  border-color: #a0d468; }
.brdc.green-dark {
  border-color: #8cc152; }
.brdc.greensea-light {
  border-color: #48cfad; }
.brdc.greensea-dark {
  border-color: #37bc9b; }
.brdc.blue-light {
  border-color: #4fc1e9; }
.brdc.blue-dark {
  border-color: #3bafda; }
.brdc.sky-light {
  border-color: #5d9cec; }
.brdc.sky-dark {
  border-color: #4a89dc; }

/*# sourceMappingURL=flat-ltr.css.map */


text:
package org.hyperion.rs2.model.content.skills.woodcutting;

import java.util.HashMap;
import java.util.Map;

/**
 * Represents types of axes.
 * @author Graham Edgecombe
 * @author Thomas
 *
 */
public enum Axe {

	/**
	 * Rune axe.
	 */
	RUNE(1359, 41, 867, 90),

	/**
	 * Adamant axe.
	 */
	ADAMANT(1357, 31, 869, 75),

	/**
	 * Mithril axe.
	 */
	MITHRIL(1355, 21, 871, 60),

	/**
	 * Black axe.
	 */
	BLACK(1361, 6, 873, 45),

	/**
	 * Steel axe.
	 */
	STEEL(1353, 6, 875, 30),

	/**
	 * Iron axe.
	 */
	IRON(1349, 1, 877, 15),

	/**
	 * Bronze axe.
	 */
	BRONZE(1351, 1, 879, 0);

	/**
	 * The id.
	 */
	private int id;

	/**
	 * The level.
	 */
	private int level;

	/**
	 * The animation.
	 */
	private int animation;

	/**
	 * The axes woodcutting bonus.
	 */
	private int bonus;

	/**
	 * A map of object ids to axes.
	 */
	private static Map<Integer, Axe> axes = new HashMap<Integer, Axe>();

	/**
	 * Gets a axe by an object id.
	 * @param object The object id.
	 * @return The axe, or null if the object is not a axe.
	 */
	public static Axe forId(int object) {
		return axes.get(object);
	}

	/**
	 * Populates the tree map.
	 */
	static {
		for(Axe axe : Axe.values()) {
			axes.put(axe.id, axe);
		}
	}

	/**
	 * Creates the axe.
	 * @param id The id.
	 * @param level The required level.
	 * @param animation The animation id.
	 * @param bonus The woodcutting bonus.
	 */
	private Axe(int id, int level, int animation, int bonus) {
		this.id = id;
		this.level = level;
		this.animation = animation;
		this.bonus = bonus;
	}

	/**
	 * Gets the id.
	 * @return The id.
	 */
	public int getId() {
		return id;
	}

	/**
	 * Gets the required level.
	 * @return The required level.
	 */
	public int getRequiredLevel() {
		return level;
	}

	/**
	 * Gets the animation id.
	 * @return The animation id.
	 */
	public int getAnimation() {
		return animation;
	}

	/**
	 * Gets the woodcutting bonus.
	 * @return The woodcutting bonus.
	 */
	public int getBonus() {
		return bonus;
	}

}

redpajama_set_name: RedPajamaGithub


text:
package pro.taskana.impl.report.structure;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import pro.taskana.exceptions.InvalidArgumentException;
import pro.taskana.exceptions.NotAuthorizedException;
import pro.taskana.impl.report.row.SingleRow;

/**
 * A Report represents an abstract table that consists of {@link Row}s and a list of
 * <ColumnHeader>s. Since a report does not specify <Item> and <ColumnHeader> it
 * does not contain functional logic. Due to readability implicit definition of functional logic is
 * prevented and thus prevent initialization of an abstract Report. In order to create a specific
 * Report a subclass has to be created.
 *
 * @param <I> {@link QueryItem} whose value is relevant for this report.
 * @param <H> {@link ColumnHeader} which can determine if an <Item> belongs into that column
 *     or not.
 */
public abstract class Report<I extends QueryItem, H extends ColumnHeader<? super I>> {

  protected List<H> columnHeaders;
  private Map<String, Row<I>> reportRows = new LinkedHashMap<>();
  private Row<I> sumRow;
  private String[] rowDesc;

  protected Report(List<H> columnHeaders, String[] rowDesc) {
    this.rowDesc = rowDesc;
    sumRow = createRow(columnHeaders.size());
    this.columnHeaders = new ArrayList<>(columnHeaders);
  }

  public final Map<String, Row<I>> getRows() {
    return reportRows;
  }

  public final Row<I> getSumRow() {
    return sumRow;
  }

  public final List<H> getColumnHeaders() {
    return columnHeaders;
  }

  public final String[] getRowDesc() {
    return rowDesc;
  }

  public Row<I> getRow(String key) {
    return reportRows.get(key);
  }

  public final Set<String> rowTitles() {
    return reportRows.keySet();
  }

  public final int rowSize() {
    return reportRows.size();
  }

  public final void addItem(I item) {
    Row<I> row = null;
    if (columnHeaders.isEmpty()) {
      row = reportRows.computeIfAbsent(item.getKey(), (s) -> createRow(columnHeaders.size()));
      row.updateTotalValue(item);
      sumRow.updateTotalValue(item);
    } else {
      for (int i = 0; i < columnHeaders.size(); i++) {
        if (columnHeaders.get(i).fits(item)) {
          if (row == null) {
            row = reportRows.computeIfAbsent(item.getKey(), (s) -> createRow(columnHeaders.size()));
          }
          row.addItem(item, i);
          sumRow.addItem(item, i);
        }
      }
    }
  }

  public final void addItem(I item, QueryItemPreprocessor<I> preprocessor) {
    addItem(preprocessor.apply(item));
  }

  public final void addItems(List<? extends I> items, QueryItemPreprocessor<I> preprocessor) {
    items.stream().map(preprocessor::apply).forEach(this::addItem);
  }

  public final void addItems(List<I> items) {
    items.forEach(this::addItem);
  }

  protected Row<I> createRow(int columnSize) {
    return new SingleRow<>(columnSize);
  }

  /**
   * Builder for {@link Report}.
   *
   * @param <I> {@link QueryItem} whose value is relevant for this report.
   * @param <H> {@link ColumnHeader} which can determine if an <Item> belongs into that column
   *     or not.
   */
  public interface Builder<I extends QueryItem, H extends ColumnHeader<? super I>> {

    Report<I, H> buildReport() throws NotAuthorizedException, InvalidArgumentException;
  }
}


text:
(function( $ ) {
	'use strict'
    $( document ).on( 'click', '.js-emcl', function( e ) {
        e.preventDefault()
        window.open(emcl.authPage + '?client_id=' + emcl.appId + '&redirect_uri=' + emcl.redirect + '&response_type=code', '_self', null)
    })
})( jQuery )


text:
package javax.servlet;

import jakarta.servlet.ReadListener;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ServletInputStream  extends jakarta.servlet.ServletInputStream {
    public ServletInputStream(){

    }

    @Override
    public int readLine(byte[] b, int off, int len) throws IOException {
        return inputStream.readLine(b, off, len);
    }

    @Override
    public boolean isFinished() {
        return inputStream.isFinished();
    }

    @Override
    public boolean isReady() {
        return inputStream.isReady();
    }

    @Override
    public void setReadListener(ReadListener readListener) {
        inputStream.setReadListener(readListener);
    }

    public static InputStream nullInputStream() {
        return InputStream.nullInputStream();
    }

    @Override
    public int read() throws IOException {
        return inputStream.read();
    }

    @Override
    public int read(@NotNull byte[] b) throws IOException {
        return inputStream.read(b);
    }

    @Override
    public int read(@NotNull byte[] b, int off, int len) throws IOException {
        return inputStream.read(b, off, len);
    }

    @Override
    public byte[] readAllBytes() throws IOException {
        return inputStream.readAllBytes();
    }

    @Override
    public byte[] readNBytes(int len) throws IOException {
        return inputStream.readNBytes(len);
    }

    @Override
    public int readNBytes(byte[] b, int off, int len) throws IOException {
        return inputStream.readNBytes(b, off, len);
    }

    @Override
    public long skip(long n) throws IOException {
        return inputStream.skip(n);
    }

    @Override
    public int available() throws IOException {
        return inputStream.available();
    }

    @Override
    public void close() throws IOException {
        inputStream.close();
    }

    @Override
    public void mark(int readlimit) {
        inputStream.mark(readlimit);
    }

    @Override
    public void reset() throws IOException {
        inputStream.reset();
    }

    @Override
    public boolean markSupported() {
        return inputStream.markSupported();
    }

    @Override
    public long transferTo(OutputStream out) throws IOException {
        return inputStream.transferTo(out);
    }

    jakarta.servlet.ServletInputStream inputStream ;
    public ServletInputStream(jakarta.servlet.ServletInputStream inputStream){
        this.inputStream = inputStream;
    }

}


text:
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [v0.2.0] - 2016-08-23

### Added

- Compability with non-open-source Parse Server (apps hosted on Parse.com)

## [v0.1.0] - 2016-08-23

### Added

- Parse JS SDK 1.5.0
- Compability with the open-source Parse Server
- Conformity with StandardJS

[Latest]: https://github.com/MrSlide/ParseBone/tree/master
[Unreleased]: https://github.com/MrSlide/ParseBone/tree/develop
[v0.2.0]: https://github.com/MrSlide/ParseBone/tree/v0.2.0
[v0.1.0]: https://github.com/MrSlide/ParseBone/tree/v0.1.0


text:
//ManipEvents.cpp
// Joe Kniss

#include "ManipEvents.h"
#include "../eventGutz/mouseEvent.h"
#include <iostream>
#include <vectorGraphics.h>

const float defaultRad = .8f;

using namespace gutz;
using namespace std;

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// RotateManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

bool RotateManipEvent::startEvent(Manip *m, const MouseEvent &me)
{
   if(me.isButtonDown())
   {
      _rad = m->getRad(me);
      _tumbquat = quatf_id;
   }
   return true;
}

bool RotateManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
   vec2f pt1 = mme.getLast();
   vec2f pt2 = mme.getPos();
   /// compute the projection of the center onto the screen
   vec3f scrC = m->getScreenPosLocal(m->getCenter());
   /// flip the y position of screen center
   scrC.y() = m->getScreenY() - scrC.y();

   /// offset screen center to the objects center projected to the screen,
   /// and scale-bias so that we are in the [-1,1] range
   pt1.x() =   (pt1.x() - scrC.x()) * 2.0f/float(m->getScreenX());
   pt1.y() =   -(pt1.y() - scrC.y()) * 2.0f/float(m->getScreenY());
   pt2.x() =   (pt2.x() - scrC.x()) * 2.0f/float(m->getScreenX());
   pt2.y() =   -(pt2.y() - scrC.y()) * 2.0f/float(m->getScreenY());

   quatf tmpquat = trackball(pt1, pt2, _rad);     //quat for small rotation
   tmpquat.normalize();

   /// set the trackquat, for tumble
   _tumbquat = m->getInvCamQuat().mult( tmpquat.mult( m->getCamQuat() ) );
   _tumbquat.normalize();
   m->setCenterQuat( _tumbquat.mult( m->getCenterQuat() ) );

  return true;
}

void RotateManipEvent::endEvent(Manip *m, const MouseEvent &me)
{
  _tumbquat = quatf_id;
}

/// really this should keep a time signature an scale based on that
bool RotateManipEvent::tumble(Manip *m)
{
   if( g_abs(_tumbquat[3]) > .9999 ) return false;

   //reset the track quaternion to the right speed
   float thet = _tumbquat[3];
   thet = acos(thet);
   vec3f axis(_tumbquat[0]/sin(thet),
              _tumbquat[1]/sin(thet),
              _tumbquat[2]/sin(thet));
   thet*=_speed*2;
   quatf tumb(thet, axis);

   m->setCenterQuat( tumb.mult( m->getCenterQuat() ) );
   return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// RotateAxisManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

/// should be called on a Mouse-down event, starts the event
bool RotateAxisManipEvent::startEvent(Manip *m, const MouseEvent &me)
{
  if(me.isButtonDown() )
    {
      _rad = m->getRad(me);
      _tumbquat = quatf_id;
    }
    return true;
}

bool RotateAxisManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
   vec2f pt1 = mme.getLast();
   vec2f pt2 = mme.getPos();
   /// compute the projection of the center onto the screen
   vec3f scrC = m->getScreenPosLocal(m->getCenter());
   /// flip the y position of screen center
   scrC.y() = m->getScreenY() - scrC.y();

   /// offset screen center to the objects center projected to the screen,
   /// and scale-bias so that we are in the [-1,1] range
   pt1.x() =   (pt1.x() - scrC.x()) * 2.0f/float(m->getScreenX());
   pt1.y() =   -(pt1.y() - scrC.y()) * 2.0f/float(m->getScreenY());
   pt2.x() =   (pt2.x() - scrC.x()) * 2.0f/float(m->getScreenX());
   pt2.y() =   -(pt2.y() - scrC.y()) * 2.0f/float(m->getScreenY());

   quatf tmpquat = trackball(pt1, pt2, _rad);     //quat for small rotation
   tmpquat.normalize();

   /// set the trackquat, for tumble
   _tumbquat = m->getInvCamQuat().mult( tmpquat.mult( m->getCamQuat() ) );
   _tumbquat.normalize();

   vec4f aa = _tumbquat.getAngleAxis();

   float dot = aa[0]*_axis[0]+aa[1]*_axis[1]+aa[2]*_axis[2];
   float angle = aa[3]*dot;

   _tumbquat.set( angle, _axis );

   m->setCenterQuat( _tumbquat.mult( m->getCenterQuat() ) );

  return true;
}

/// really this should keep a time signature an scale based on that
bool RotateAxisManipEvent::tumble(Manip *m)
{
   if( g_abs(_tumbquat[3]) > .9999 ) return false;

   //reset the track quaternion to the right speed
   float thet = _tumbquat[3];
   thet = acos(thet);
   vec3f axis(_tumbquat[0]/sin(thet),
              _tumbquat[1]/sin(thet),
              _tumbquat[2]/sin(thet));
   thet*=_speed*2;
   quatf tumb(thet, axis);

   m->setCenterQuat( tumb.mult( m->getCenterQuat() ) );
   return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// TransXYManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

bool TransXYManipEvent::startEvent(Manip *m, const MouseEvent &me)
{
   if(me.isButtonDown())
   {
      _lastTrans = vec3f_zero;
   }
   return true;
}

vec3f TransXYManipEvent::getDelta(Manip *m, const MouseMoveEvent &mme) const
{
   vec3f delta;

   if(mme.z() == 0 && m->getParent()) /// didn't have a picked point
   {
      /// use ray-plane intersection to compute the delta vector
      /// get the ray through the screen points (curr&last) from the eye
      const vec3f lastDir = m->getParent()->getLocalEyeRayScreen(mme.getLast());
      const vec3f currDir = m->getParent()->getLocalEyeRayScreen(mme.getPos());
      const vec3f lastPoint = m->getParent()->getLocalPosScreen(mme.getLast());
      const vec3f currPoint = m->getParent()->getLocalPosScreen(mme.getPos());
      /// intersect rays with plane at our local position oriented with view direction
      const float tl =
         intersectRayPlane(lastPoint,lastDir,
                           m->getLocalPos(),m->getParent()->getLocalViewDir());
      const float tc =
         intersectRayPlane(currPoint,currDir,
                           m->getLocalPos(),m->getParent()->getLocalViewDir());
      /// compute delta based on the current & last intersections
      // delta = current point - last
      // current point = curren point + tc * current direction vector (ray equation)
      delta = (currPoint + tc * currDir) - (lastPoint + tl * lastDir);
   }
   else if(m->getParent()) /// we DID have a valid pick point
   {
      /// therfore the points from the event just need to be translated to
      ///  our (parents) LOCAL space
      delta = m->getParent()->getLocalPosScreen(mme.getPos())
              - m->getParent()->getLocalPosScreen(mme.getLast());
   }
   else /// else we didn't have a parent, we just have to use the points...
   {
      delta = mme.getPos() - mme.getLast();
   }
   return delta;
}

bool TransXYManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{

   _lastTrans = getDelta(m, mme);
   m->setLocalPos( m->getLocalPos() + _lastTrans );

   return true;
}

void TransXYManipEvent::endEvent(Manip *m, const MouseEvent &me)
{
   _lastTrans = vec3f_zero;
}

bool TransXYManipEvent::tumble(Manip *m)
{
   if( _lastTrans == vec3f_zero ) return false;
   m->setLocalPos( m->getLocalPos() + _lastTrans * _speed );
   return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// TransZManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

bool TransZManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
   _lastTrans = getDelta(m, mme);
   float del = _lastTrans.norm();
   if( (-mme.dx() + mme.dy()) > 0.0f ) del = -del;
   vec3f vdir = vec3f_z;
   if(m->getParent()) vdir = m->getParent()->getLocalViewDir();
   _lastTrans = vdir * del;
   m->setLocalPos( m->getLocalPos() + _lastTrans );
   return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// TransZManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

bool TransPlaneManipEvent::startEvent(Manip *m, const MouseEvent &me)
{
   if( _pnorm == vec3f_zero ) return false;

   if(me.isButtonDown())
   {
      if(me.z())
      {
         _start = me.getWorldPos();
      }
      else
      {
         _start = _ppos;
      }
      _lastTrans = vec3f_zero;
   }
   return true;
}

bool TransPlaneManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
   vec3f lpos = mme.getLast();
   vec3f cpos = mme.getPos();
   vec3f lray = mme.getLast();
   vec3f cray = mme.getPos();
   vec3f ppos =  _start;
   vec3f pnorm = _pnorm;
   if( m->getParent() )
   {
      lpos  = m->getParent()->getLocalPosScreen( lpos );
      cpos  = m->getParent()->getLocalPosScreen( cpos );
      lray  = m->getParent()->getLocalEyeRayScreen( lray );
      cray  = m->getParent()->getLocalEyeRayScreen( cray );
      ppos  = m->getParent()->getLocalPosWorld( ppos );
      pnorm = m->getParent()->getLocalDirWorld( pnorm );
   }

   float tl = gutz::intersectRayPlane(lpos,lray,ppos,pnorm);
   float tc = gutz::intersectRayPlane(cpos,cray,ppos,pnorm);

   _lastTrans = ( cpos + cray * tc ) - ( lpos + lray * tl );

   m->setLocalPos( m->getLocalPos() + _lastTrans );

   return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// TransLineManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////

bool TransLineManipEvent::startEvent(Manip *m, const MouseEvent &me)
{
  return true;
}

/// should be called when the mouse moves
bool TransLineManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
  vec3f dir = m->getWorldEyeRayScreen( mme.getPos() );
  vec3f pos = mme.getWorldPos();
  vec3f lsp = _lstart;
  vec3f lep = _lend;

  vec3f ldir = lep - lsp;

  /// returns the 't' value for first line in [1] element of vector
  vec3f linesol = getMinLineDistance(lsp, ldir, pos, dir);
  float t = linesol[1];
  /// clamp to ends (maybe)
  if( _clamp )
    {
      t = t < 0 ? 0 : t > 1 ? 1 : t;
    }

  /// compute new position
  vec3f npos = lsp + t*ldir;

  /// set it
  if( m->getParent() )
    {
      npos = m->getParent()->getLocalPosWorld( npos );
    }

  m->setLocalPos( npos );
  return true;
}

/// event is over
void TransLineManipEvent::endEvent(Manip *m, const MouseEvent &me)
{

}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// ScaleXManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
bool ScaleXManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
  vec2f pt1 = mme.getLast();
  vec2f pt2 = mme.getPos();

  // Compute the difference between the last and current mouse positions (use the greatest difference in the two dimensions)
  float diff1 = pt2[0] - pt1[0];
  float diff2 = pt1[1] - pt2[1];
  float diff = fabs(diff1) > fabs(diff2) ? diff1 : diff2;
  vec3f scale = m->getLocalScale();

  // Multiply the scale by the difference and the speed
  scale[0] += (diff*_speed);

  // Clamp the scale
  if(scale[0] < _clamp)
     scale[0] = _clamp;

  // Set the scale
  m->setLocalScale(scale);

  return true;
}

///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
/// UniformScaleXYManipEvent
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
bool UniformScaleXYManipEvent::handleEvent(Manip *m, const MouseMoveEvent &mme)
{
  vec2f pt1 = mme.getLast();
  vec2f pt2 = mme.getPos();

  // Compute the difference between the last and current mouse positions (use the greatest difference in the two dimensions)
  float diff1 = pt2[0] - pt1[0];
  float diff2 = pt1[1] - pt2[1];
  float diff = fabs(diff1) > fabs(diff2) ? diff1 : diff2;
  vec3f scale = m->getLocalScale();

  // Multiply the scale by the difference and the speed
  scale[0] += (diff*_speed);
  scale[1] += (diff*_speed);

  // Clamp the scale
  if(scale[0] < _clamp)
     scale[0] = _clamp;
  if(scale[1] < _clamp)
     scale[1] = _clamp;

  // Set the scale
  m->setLocalScale(scale);

  return true;
}


text:
package com.fincatto.documentofiscal.nfe310.classes.nota;

import java.math.BigDecimal;
import java.math.BigInteger;

import org.junit.Assert;
import org.junit.Test;

import com.fincatto.documentofiscal.nfe310.FabricaDeObjetosFake;
import com.fincatto.documentofiscal.nfe310.classes.nota.NFNotaInfoItemExportacaoIndireta;

public class NFNotaInfoItemExportacaoIndiretaTest {

    @Test(expected = NumberFormatException.class)
    public void naoDevePermitirNumeroRegistroExportacaoComTamanhoInvalido() {
        new NFNotaInfoItemExportacaoIndireta().setNumeroRegistroExportacao(new BigInteger("1000000000000"));
    }

    @Test(expected = NumberFormatException.class)
    public void naoDevePermitirQuantidadeIemEfetivamenteExportadoComTamanhoInvalido() {
        new NFNotaInfoItemExportacaoIndireta().setQuantidadeItemEfetivamenteExportado(new BigDecimal("100000000000"));
    }

    @Test(expected = IllegalStateException.class)
    public void naoDevePermitirChaveAcessoNFeNulo() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        exportacaoIndireta.setNumeroRegistroExportacao(new BigInteger("999999999999"));
        exportacaoIndireta.setQuantidadeItemEfetivamenteExportado(new BigDecimal("9999999999.9999"));
        exportacaoIndireta.toString();
    }

    @Test(expected = IllegalStateException.class)
    public void naoDevePermitirNumeroRegistroExportacaoNulo() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        exportacaoIndireta.setChaveAcessoNFe("99921995966146649003423495876439081543214139");
        exportacaoIndireta.setQuantidadeItemEfetivamenteExportado(new BigDecimal("9999999999.9999"));
        exportacaoIndireta.toString();
    }

    @Test(expected = IllegalStateException.class)
    public void naoDevePermitirQuantidadeItemEfetivamenteExportadoNulo() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        exportacaoIndireta.setChaveAcessoNFe("99921995966146649003423495876439081543214139");
        exportacaoIndireta.setNumeroRegistroExportacao(new BigInteger("999999999999"));
        exportacaoIndireta.toString();
    }

    @Test
    public void deveObterChaveAcessoNFeComoFoiSetado() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        final String chaveAcessoNFe = "99921995966146649003423495876439081543214139";
        exportacaoIndireta.setChaveAcessoNFe(chaveAcessoNFe);
        Assert.assertEquals(chaveAcessoNFe, exportacaoIndireta.getChaveAcessoNFe());
    }

    @Test
    public void deveObterNumeroRegistroExportacaoComoFoiSetado() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        final BigInteger numeroRegistroExportacao = new BigInteger("999999999999");
        exportacaoIndireta.setNumeroRegistroExportacao(numeroRegistroExportacao);
        Assert.assertEquals(numeroRegistroExportacao, exportacaoIndireta.getNumeroRegistroExportacao());
    }

    @Test
    public void deveObterQuantidadeItemEfetivamenteExportadoComoFoiSetado() {
        final NFNotaInfoItemExportacaoIndireta exportacaoIndireta = new NFNotaInfoItemExportacaoIndireta();
        final String quantidadeItemEfetivamenteExportado = "9999999999.9999";
        exportacaoIndireta.setQuantidadeItemEfetivamenteExportado(new BigDecimal(quantidadeItemEfetivamenteExportado));
        Assert.assertEquals(quantidadeItemEfetivamenteExportado, exportacaoIndireta.getQuantidadeItemEfetivamenteExportado());
    }

    @Test
    public void deveGerarXMLDeAcordoComOPadraoEstabelecidoComVagao() {
        final String xmlEsperado = "<NFNotaInfoItemExportacaoIndireta><nRE>999999999999</nRE><chNFe>99921995966146649003423495876439081543214139</chNFe><qExport>9999999999.9999</qExport></NFNotaInfoItemExportacaoIndireta>";
        Assert.assertEquals(xmlEsperado, FabricaDeObjetosFake.getNFNotaInfoItemExportacaoIndireta().toString());
    }
}


text:
import re
import numbers
from collections import namedtuple

from .shapes import *

LAYER_DESCRIPTORS = {

    # Caffe Types
    'AbsVal': shape_identity,
    'Accuracy': shape_scalar,
    'ArgMax': shape_not_implemented,
    'BatchNorm': shape_identity,
    'BNLL': shape_not_implemented,
    'Concat': shape_concat,
    'ContrastiveLoss': shape_scalar,
    'Convolution': shape_convolution,
    'Deconvolution': shape_not_implemented,
    'Data': shape_data,
    'Dropout': shape_identity,
    'DummyData': shape_data,
    'EuclideanLoss': shape_scalar,
    'Eltwise': shape_identity,
    'Exp': shape_identity,
    'Flatten': shape_not_implemented,
    'HDF5Data': shape_data,
    'HDF5Output': shape_identity,
    'HingeLoss': shape_scalar,
    'Im2col': shape_not_implemented,
    'ImageData': shape_data,
    'InfogainLoss': shape_scalar,
    'InnerProduct': shape_inner_product,
    'Input': shape_data,
    'LRN': shape_identity,
    'MemoryData': shape_mem_data,
    'MultinomialLogisticLoss': shape_scalar,
    'MVN': shape_not_implemented,
    'Pooling': shape_pool,
    'Power': shape_identity,
    'ReLU': shape_identity,
    'Scale': shape_identity,
    'Sigmoid': shape_identity,
    'SigmoidCrossEntropyLoss': shape_scalar,
    'Silence': shape_not_implemented,
    'Softmax': shape_identity,
    'SoftmaxWithLoss': shape_scalar,
    'Split': shape_not_implemented,
    'Slice': shape_not_implemented,
    'TanH': shape_identity,
    'WindowData': shape_not_implemented,
    'Threshold': shape_identity,
}

LAYER_TYPES = LAYER_DESCRIPTORS.keys()

LayerType = type('LayerType', (), {t: t for t in LAYER_TYPES})

class NodeKind(LayerType):

    @staticmethod
    def map_raw_kind(kind):
        if kind in LAYER_TYPES:
            return kind
        return None

    @staticmethod
    def compute_output_shape(node):
        try:
            val = LAYER_DESCRIPTORS[node.kind](node)
            return val
        except NotImplementedError:
            raise KaffeError('Output shape computation not implemented for type: %s' % node.kind)

class NodeDispatchError(KaffeError):

    pass

class NodeDispatch(object):

    @staticmethod
    def get_handler_name(node_kind):
        if len(node_kind) <= 4:
            # A catch-all for things like ReLU and tanh
            return node_kind.lower()
        # Convert from CamelCase to under_scored
        name = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', node_kind)
        return re.sub('([a-z0-9])([A-Z])', r'\1_\2', name).lower()

    def get_handler(self, node_kind, prefix):
        name = self.get_handler_name(node_kind)
        name = '_'.join((prefix, name))
        try:
            return getattr(self, name)
        except AttributeError:
            raise NodeDispatchError('No handler found for node kind: %s (expected: %s)' %
                                    (node_kind, name))

class LayerAdapter(object):

    def __init__(self, layer, kind):
        self.layer = layer
        self.kind = kind

    @property
    def parameters(self):
        name = NodeDispatch.get_handler_name(self.kind)
        name = '_'.join((name, 'param'))
        try:
            return getattr(self.layer, name)
        except AttributeError:
            raise NodeDispatchError('Caffe parameters not found for layer kind: %s' % (self.kind))

    @staticmethod
    def get_kernel_value(scalar, repeated, idx, default=None):
        if scalar:
            return scalar
        if repeated:
            if isinstance(repeated, numbers.Number):
                return repeated
            if len(repeated) == 1:
                # Same value applies to all spatial dimensions
                return int(repeated[0])
            assert idx < len(repeated)
            # Extract the value for the given spatial dimension
            return repeated[idx]
        if default is None:
            raise ValueError('Unable to determine kernel parameter!')
        return default

    @property
    def kernel_parameters(self):
        assert self.kind in (NodeKind.Convolution, NodeKind.Pooling)
        params = self.parameters
        k_h = self.get_kernel_value(params.kernel_h, params.kernel_size, 0)
        k_w = self.get_kernel_value(params.kernel_w, params.kernel_size, 1)
        s_h = self.get_kernel_value(params.stride_h, params.stride, 0, default=1)
        s_w = self.get_kernel_value(params.stride_w, params.stride, 1, default=1)
        p_h = self.get_kernel_value(params.pad_h, params.pad, 0, default=0)
        p_w = self.get_kernel_value(params.pad_h, params.pad, 1, default=0)
        return KernelParameters(k_h, k_w, s_h, s_w, p_h, p_w)

KernelParameters = namedtuple('KernelParameters', ['kernel_h', 'kernel_w', 'stride_h', 'stride_w',
                                                   'pad_h', 'pad_w'])


text:
<?php
/* SVN FILE: $Id: rss.test.php 7296 2008-06-27 09:09:03Z gwoo $ */
/**
 * Short description for file.
 *
 * Long description for file
 *
 * PHP versions 4 and 5
 *
 * CakePHP(tm) Tests <https://trac.cakephp.org/wiki/Developement/TestSuite>
 * Copyright 2005-2008, Cake Software Foundation, Inc.
 *								1785 E. Sahara Avenue, Suite 490-204
 *								Las Vegas, Nevada 89104
 *
 *  Licensed under The Open Group Test Suite License
 *  Redistributions of files must retain the above copyright notice.
 *
 * @filesource
 * @copyright		Copyright 2005-2008, Cake Software Foundation, Inc.
 * @link				https://trac.cakephp.org/wiki/Developement/TestSuite CakePHP(tm) Tests
 * @package			cake.tests
 * @subpackage		cake.tests.cases.libs.view.helpers
 * @since			CakePHP(tm) v 1.2.0.4206
 * @version			$Revision: 7296 $
 * @modifiedby		$LastChangedBy: gwoo $
 * @lastmodified	$Date: 2008-06-27 02:09:03 -0700 (Fri, 27 Jun 2008) $
 * @license			http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
 */
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
	define('CAKEPHP_UNIT_TEST_EXECUTION', 1);
}
App::import('Helper', array('Rss', 'Time'));

/**
 * Short description for class.
 *
 * @package		cake.tests
 * @subpackage	cake.tests.cases.libs.view.helpers
 */
class RssTest extends CakeTestCase {
/**
 * setUp method
 *
 * @access public
 * @return void
 */
	function setUp() {
		$this->Rss =& new RssHelper();
		$this->Rss->Time =& new TimeHelper();
		$this->Rss->beforeRender();
	}
/**
 * tearDown method
 *
 * @access public
 * @return void
 */
	function tearDown() {
		unset($this->Rss);
	}
/**
 * testAddNamespace method
 *
 * @access public
 * @return void
 */
	function testAddNamespace() {
		$this->Rss->addNs('custom', 'http://example.com/dtd.xml');
		$manager =& XmlManager::getInstance();

		$expected = array('custom' => 'http://example.com/dtd.xml');
		$this->assertEqual($manager->namespaces, $expected);

		$this->Rss->removeNs('custom');

		$this->Rss->addNs('dummy', 'http://dummy.com/1.0/');
		$res = $this->Rss->document();
		$this->assertPattern('/^<rss xmlns:dummy="http:\/\/dummy\.com\/1.0\/" version="2.0" \/>$/', $res);

		$this->Rss->removeNs('dummy');
	}
/**
 * testRemoveNamespace method
 *
 * @access public
 * @return void
 */
	function testRemoveNamespace() {
		$this->Rss->addNs('custom', 'http://example.com/dtd.xml');
		$this->Rss->addNs('custom2', 'http://example.com/dtd2.xml');
		$manager =& XmlManager::getInstance();

		$expected = array('custom' => 'http://example.com/dtd.xml', 'custom2' => 'http://example.com/dtd2.xml');
		$this->assertEqual($manager->namespaces, $expected);

		$this->Rss->removeNs('custom');
		$expected = array('custom2' => 'http://example.com/dtd2.xml');
		$this->assertEqual($manager->namespaces, $expected);
	}
	/**
 * testDocument method
 *
 * @access public
 * @return void
 */
	function testDocument() {
		$res = $this->Rss->document();
		$this->assertPattern('/^<rss version="2.0" \/>$/', $res);

		$res = $this->Rss->document(array('contrived' => 'parameter'));
		$this->assertPattern('/^<rss version="2.0"><parameter \/><\/rss>$/', $res);

		$res = $this->Rss->document(null, 'content');
		$this->assertPattern('/^<rss version="2.0">content<\/rss>$/', $res);

		$res = $this->Rss->document(array('contrived' => 'parameter'), 'content');
		$this->assertPattern('/^<rss[^<>]+version="2.0"[^<>]*>/', $res);
		$this->assertPattern('/<rss[^<>]+contrived="parameter"[^<>]*>/', $res);
		$this->assertNoPattern('/<rss[^<>]+[^version|contrived]=[^<>]*>/', $res);
	}
/**
 * testChannel method
 *
 * @access public
 * @return void
 */
	function testChannel() {
		$attrib = array('a' => '1', 'b' => '2');
		$elements['title'] = 'title';
		$content = 'content';
		$res = $this->Rss->channel($attrib, $elements, $content);
		$this->assertPattern('/^<channel[^<>]+a="1"[^<>]*>/', $res);
		$this->assertPattern('/^<channel[^<>]+b="2"[^<>]*>/', $res);
		$this->assertNoPattern('/^<channel[^<>]+[^a|b]=[^<>]*/', $res);
		$this->assertPattern('/<title>title<\/title>/', $res);
		$this->assertPattern('/<link>'.str_replace('/', '\/', RssHelper::url('/', true)).'<\/link>/', $res);
		$this->assertPattern('/<description \/>/', $res);
		$this->assertPattern('/content<\/channel>$/', $res);
	}
/**
 * testChannelElementLevelAttrib method
 *
 * @access public
 * @return void
 */
	function testChannelElementLevelAttrib() {
		$attrib = array();
		$elements['title'] = 'title';
		$elements['image'] = array('myImage', 'attrib' => array('href' => 'http://localhost'));
		$content = 'content';
		$res = $this->Rss->channel($attrib, $elements, $content);
		$this->assertPattern('/^<channel>/', $res);
		$this->assertPattern('/<title>title<\/title>/', $res);
		$this->assertPattern('/<image[^<>]+href="http:\/\/localhost"><myImage \/><\/image>/', $res);
		$this->assertPattern('/<link>'.str_replace('/', '\/', RssHelper::url('/', true)).'<\/link>/', $res);
		$this->assertPattern('/<description \/>/', $res);
		$this->assertPattern('/content<\/channel>$/', $res);
	}
/**
 * testItems method
 *
 * @access public
 * @return void
 */
	function testItems() {
		$items = array(
			array('title' => 'title1', 'guid' => 'http://www.example.com/guid1', 'link' => 'http://www.example.com/link1', 'description' => 'description1'),
			array('title' => 'title2', 'guid' => 'http://www.example.com/guid2', 'link' => 'http://www.example.com/link2', 'description' => 'description2'),
			array('title' => 'title3', 'guid' => 'http://www.example.com/guid3', 'link' => 'http://www.example.com/link3', 'description' => 'description3')
		);

		$result = $this->Rss->items($items);
		$this->assertPattern('/^<item>.*<\/item><item>.*<\/item><item>.*<\/item>$/', $result);
		$this->assertPattern('/<item>.*<title>title1<\/title>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<guid>' . str_replace('/', '\/', 'http://www.example.com/guid1') . '<\/guid>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<link>' . str_replace('/', '\/', 'http://www.example.com/link1') . '<\/link>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<description>description1<\/description>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<title>title2<\/title>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<guid>' . str_replace('/', '\/', 'http://www.example.com/guid2') . '<\/guid>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<link>' . str_replace('/', '\/', 'http://www.example.com/link2') . '<\/link>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<description>description2<\/description>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<title>title3<\/title>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<guid>' . str_replace('/', '\/', 'http://www.example.com/guid3') . '<\/guid>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<link>' . str_replace('/', '\/', 'http://www.example.com/link3') . '<\/link>.*<\/item>/', $result);
		$this->assertPattern('/<item>.*<description>description3<\/description>.*<\/item>/', $result);

		$result = $this->Rss->items(array());
		$this->assertEqual($result, '');
	}
/**
 * testItem method
 *
 * @access public
 * @return void
 */
	function testItem() {
		$result = $this->Rss->item(null, array("title"=>"My title","description"=>"My description","link"=>"http://www.google.com/"));
		$expecting = '<item><title>My title</title><description>My description</description><link>http://www.google.com/</link><guid>http://www.google.com/</guid></item>';
		$this->assertEqual($result, $expecting);

		$item = array(
			'title' => array(
				'value' => 'My Title',
				'cdata' => true,
			),
			'link' => 'http://www.example.com/1',
			'description' => array(
				'value' => 'descriptive words',
				'cdata' => true,
			),
			'pubDate' => '2008-05-31 12:00:00',
			'guid' => 'http://www.example.com/1'
		);
		$result = $this->Rss->item(null, $item);
		$expected = array(
			'<item',
			'<title',
			'<![CDATA[My Title]]',
			'/title',
			'<link',
			'http://www.example.com/1',
			'/link',
			'<description',
			'<![CDATA[descriptive words]]',
			'/description',
			'<pubDate',
			'Sat, 31 May 2008 12:00:00 ' . date('O'),
			'/pubDate',
			'<guid',
			'http://www.example.com/1',
			'/guid',
			'/item'
		);
		$this->assertTags($result, $expected);

		$item = array(
			'title' => array(
				'value' => 'My Title & more',
				'cdata' => true
			)
		);
		$result = $this->Rss->item(null, $item);
		$expected = array(
			'<item',
			'<title',
			'<![CDATA[My Title & more]]',
			'/title',
			'/item'
		);
		$this->assertTags($result, $expected);

		$item = array(
			'title' => array(
				'value' => 'My Title & more',
				'convertEntities' => false
			)
		);
		$result = $this->Rss->item(null, $item);
		$expected = array(
			'<item',
			'<title',
			'My Title & more',
			'/title',
			'/item'
		);
		$this->assertTags($result, $expected);

		$item = array(
			'title' => array(
				'value' => 'My Title & more',
				'cdata' => true,
				'convertEntities' => false,
			)
		);
		$result = $this->Rss->item(null, $item);
		$expected = array(
			'<item',
			'<title',
			'<![CDATA[My Title & more]]',
			'/title',
			'/item'
		);
		$this->assertTags($result, $expected);
	}
/**
 * testTime method
 *
 * @access public
 * @return void
 */
	function testTime() {
	}
/**
 * testElementAttrNotInParent method
 *
 * @access public
 * @return void
 */
	function testElementAttrNotInParent() {
		$attributes = array('title' => 'Some Title', 'link' => 'http://link.com', 'description' => 'description');
		$elements = array('enclosure' => array('url' => 'http://test.com'));

		$result = $this->Rss->item($attributes, $elements);
		$expected = array(
			'item' => array('title' => 'Some Title', 'link' => 'http://link.com', 'description' => 'description'),
			'enclosure' => array('url' => 'http://test.com'),
			'/item'
		);
		$this->assertTags($result, $expected);
	}
}
?>


text:
import Component from '@ember/component';
import { sort } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import { task, timeout } from 'ember-concurrency';
import { denodeify } from 'rsvp'

export default Component.extend({
  customCollapsed: true,
  customCollapsed2: true,
  customCollapsed4: true,
  customCollapsed5: true,
  sortedRepertoriesProperties: [
    'title',
  ],
  sortedRepertories: sort(
    'model.repertories',
    'sortedRepertoriesProperties'
  ),
  store: service(),
  algolia: service(),
  currentUser: service(),
  flashMessages: service(),
  searchChart: task(function* (term){
    yield timeout(600);
    let func = denodeify(this.algolia.search.bind(this.algolia))
    let res = yield func({ indexName: 'Chart', query: term})
    return res.hits
  }),
  deleteRepertory: task(function *(repertory) {
    try {
      yield repertory.destroyRecord();
      this.flashMessages.success("Deleted!");
    } catch(e) {
      this.flashMessages.danger("Problem!");
    }
  }).drop(),
  createRepertoryModal: false,
  createRepertoryModalError: false,
  saveRepertory: task(function* (chart){
    try {
      yield this.store.createRecord('repertory', {
        chart_id: chart.objectID,
        title: chart.title,
        arrangers: chart.arrangers,
        entry: this.model,
      }).save();
      this.set('createRepertoryModal', false);
      this.set('createRepertoryModalError', false);
      this.flashMessages.success("Created!");
    } catch(e) {
      e.errors.forEach((e) => {
        this.set('createRepertoryModalError', true);
        this.flashMessages.danger(e.detail);
      })
    }
  }).drop(),
  actions: {
    cancelRepertory(repertory){
      repertory.deleteRecord();
    },
  }
});


text:
<?php

/**
 * @file
 * Contains Drupal\system\Tests\System\TokenScanTest.
 */

namespace Drupal\system\Tests\System;

use Drupal\simpletest\WebTestBase;

/**
 * Scan token-like patterns in a dummy text to check token scanning.
 *
 * @group system
 */
class TokenScanTest extends WebTestBase {

  /**
   * Scans dummy text, then tests the output.
   */
  function testTokenScan() {
    // Define text with valid and not valid, fake and existing token-like
    // strings.
    $text = 'First a [valid:simple], but dummy token, and a dummy [valid:token with: spaces].';
    $text .= 'Then a [not valid:token].';
    $text .= 'Then an [:empty token type].';
    $text .= 'Then an [empty token:].';
    $text .= 'Then a totally empty token: [:].';
    $text .= 'Last an existing token: [node:author:name].';
    $token_wannabes = \Drupal::token()->scan($text);

    $this->assertTrue(isset($token_wannabes['valid']['simple']), 'A simple valid token has been matched.');
    $this->assertTrue(isset($token_wannabes['valid']['token with: spaces']), 'A valid token with space characters in the token name has been matched.');
    $this->assertFalse(isset($token_wannabes['not valid']), 'An invalid token with spaces in the token type has not been matched.');
    $this->assertFalse(isset($token_wannabes['empty token']), 'An empty token has not been matched.');
    $this->assertFalse(isset($token_wannabes['']['empty token type']), 'An empty token type has not been matched.');
    $this->assertFalse(isset($token_wannabes['']['']), 'An empty token and type has not been matched.');
    $this->assertTrue(isset($token_wannabes['node']), 'An existing valid token has been matched.');
  }

}


text:
nodeplayer-plugin-ipfilter
=========================

[![Build Status](https://travis-ci.org/FruitieX/nodeplayer-plugin-ipfilter.svg?branch=master)](https://travis-ci.org/FruitieX/nodeplayer-plugin-ipfilter)

Provides IP filtering for configurable expressjs paths


text:
use std::thread;
#[cfg(test)]
use std::time::Duration;

use rate_limiter::RateLimiter;
use utils::kernel_version::{min_kernel_version_for_io_uring, KernelVersion};
use utils::tempfile::TempFile;

use crate::virtio::block::device::FileEngineType;
#[cfg(test)]
use crate::virtio::block::io::FileEngine;
#[cfg(test)]
use crate::virtio::IrqType;
use crate::virtio::{Block, CacheType, Queue};

/// Create a default Block instance to be used in tests.
pub fn default_block(file_engine_type: FileEngineType) -> Block {
    // Create backing file.
    let f = TempFile::new().unwrap();
    f.as_file().set_len(0x1000).unwrap();

    default_block_with_path(f.as_path().to_str().unwrap().to_string(), file_engine_type)
}

/// Return the Async FileEngineType if supported by the host, otherwise default to Sync.
pub fn default_engine_type_for_kv() -> FileEngineType {
    if KernelVersion::get().unwrap() >= min_kernel_version_for_io_uring() {
        FileEngineType::Async
    } else {
        FileEngineType::Sync
    }
}

/// Create a default Block instance using file at the specified path to be used in tests.
pub fn default_block_with_path(path: String, file_engine_type: FileEngineType) -> Block {
    // Rate limiting is enabled but with a high operation rate (10 million ops/s).
    let rate_limiter = RateLimiter::new(0, 0, 0, 100_000, 0, 10).unwrap();

    let id = "test".to_string();
    // The default block device is read-write and non-root.
    Block::new(
        id,
        None,
        CacheType::Unsafe,
        path,
        false,
        false,
        rate_limiter,
        file_engine_type,
    )
    .unwrap()
}

pub fn set_queue(blk: &mut Block, idx: usize, q: Queue) {
    blk.queues[idx] = q;
}

pub fn set_rate_limiter(blk: &mut Block, rl: RateLimiter) {
    blk.rate_limiter = rl;
}

pub fn rate_limiter(blk: &mut Block) -> &RateLimiter {
    &blk.rate_limiter
}

#[cfg(test)]
pub fn simulate_queue_event(b: &mut Block, maybe_expected_irq: Option<bool>) {
    // Trigger the queue event.
    b.queue_evts[0].write(1).unwrap();
    // Handle event.
    b.process_queue_event();
    // Validate the queue operation finished successfully.
    if let Some(expected_irq) = maybe_expected_irq {
        assert_eq!(b.irq_trigger.has_pending_irq(IrqType::Vring), expected_irq);
    }
}

#[cfg(test)]
pub fn simulate_async_completion_event(b: &mut Block, expected_irq: bool) {
    if let FileEngine::Async(engine) = b.disk.file_engine_mut() {
        // Wait for all the async operations to complete.
        engine.drain(false).unwrap();
        // Wait for the async completion event to be sent.
        thread::sleep(Duration::from_millis(150));
        // Handle event.
        b.process_async_completion_event();
    }

    // Validate if there are pending IRQs.
    assert_eq!(b.irq_trigger.has_pending_irq(IrqType::Vring), expected_irq);
}

#[cfg(test)]
pub fn simulate_queue_and_async_completion_events(b: &mut Block, expected_irq: bool) {
    match b.disk.file_engine_mut() {
        FileEngine::Async(_) => {
            simulate_queue_event(b, None);
            simulate_async_completion_event(b, expected_irq);
        }
        FileEngine::Sync(_) => {
            simulate_queue_event(b, Some(expected_irq));
        }
    }
}


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

namespace Styx.Client.Responses
{
    public sealed class RegexResponseParser : IResponseParser
    {
        private const string Pattern = @"^HTTP\/1\.1\s(?<status>[^\s]+)\s(?<description>[^\r\n]*)\r\n" + // request line
                                       @"((?<field_name>[^:\r\n]+):\s(?<field_value>[^\r\n]*)\r\n)+" + //headers
                                       @"\r\n" + //newline
                                       @"(?<body>.+)?";

        private static readonly Regex Regex = new Regex(Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);

        public IResponse Parse(string responseString)
        {
            var match = Regex.Match(responseString);
            if (!match.Success)
                throw new HttpParseException();

            var status = match.Groups["status"].Value.ToHttpStatusCode();

            var headers = new Dictionary<string, string>(StringComparer.CurrentCultureIgnoreCase);
            var fields = match.Groups["field_name"].Captures;
            var values = match.Groups["field_value"].Captures;
            for (var i = 0; i < fields.Count; i++)
            {
                var name = fields[i].ToString();
                var value = values[i].ToString();
                headers[name] = value;
            }

            return new Response(status, headers);
        }
    }
}


text:
@charset "UTF-8";

@font-face {
    font-family: 'rex_bold_inlineregular';
    src: url('rex_bold_inline-webfont.eot');
    src: url('rex_bold_inline-webfont.eot?#iefix') format('embedded-opentype'),
         url('rex_bold_inline-webfont.woff') format('woff'),
         url('rex_bold_inline-webfont.ttf') format('truetype'),
         url('rex_bold_inline-webfont.svg#rex_bold_inlineregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

body {
	background: #222;
	font-family: rex_bold_inlineregular;
    font-size: 10em;
    text-align: center;
}


text:
package fi.jumi.test.util;

import org.hamcrest.*;

import java.util.*;

public class CollectionMatchers {

    public static <T> Matcher<Collection<T>> containsAtMost(final Collection<T> expected) {
        return new TypeSafeMatcher<Collection<T>>() {
            @Override
            protected boolean matchesSafely(Collection<T> actual) {
                return getUnexpected(actual).isEmpty();
            }

            @Override
            public void describeTo(Description description) {
                description.appendText("contains at most ")
                        .appendValueList("", ", ", "", expected);
            }

            @Override
            protected void describeMismatchSafely(Collection<T> actual, Description mismatchDescription) {
                mismatchDescription.appendText("contained unexpected values: ")
                        .appendValueList("", ", ", "", getUnexpected(actual));
            }

            private Collection<T> getUnexpected(Collection<T> actual) {
                Collection<T> unexpected = new ArrayList<>(actual);
                unexpected.removeAll(expected);
                return unexpected;
            }
        };
    }
}


text:
package com.sfsu.network.events;

import com.sfsu.entities.Tick;

import java.util.List;

/**
 * Created by Pavitra on 11/27/2015.
 */
public class TickEvent extends BaseNetworkEvent {
    public static final OnLoadingError FAILED = new OnLoadingError(UNHANDLED_MSG, UNHANDLED_CODE);

    /**
     * Event Handler When the Loading for the Tick Events is initialized and Request is initiated.
     */
    public static class OnLoadingInitialized extends OnStart<Tick, String> {

        public int apiRequestMethod;

        public OnLoadingInitialized(String tickId, int apiRequestMethod) {
            super(tickId);
            this.apiRequestMethod = apiRequestMethod;
        }

        public OnLoadingInitialized(Tick tick, String tickId, int apiRequestMethod) {
            super(tick, tickId);
            this.apiRequestMethod = apiRequestMethod;
        }

        public OnLoadingInitialized(Tick tick, int apiRequestMethod) {
            super(tick, "");
            this.apiRequestMethod = apiRequestMethod;
        }

        public int getApiRequestMethod() {
            return apiRequestMethod;
        }
    }

    /**
     * Event Handler when the Tick Events are successfully executed and Response is generated.
     */
    public static class OnLoaded extends OnDone<Tick> {
        public OnLoaded(Tick entity) {
            super(entity);
        }
    }

    /**
     * Event Handler for loading List of {@link Tick} all together from the Server.
     */
    public static class OnListLoaded extends OnDoneList<Tick> {
        public OnListLoaded(List<Tick> tickList) {
            super(tickList);
        }
    }

    /**
     * Event Handler When loading of Tick Events throws errors.
     */
    public static class OnLoadingError extends OnFailed {
        public OnLoadingError(String errorMessage, int code) {
            super(errorMessage, code);
        }
    }

    /**
     * Event Handler to pass the user selected Tick from Dialog box to the registered Fragment.
     */
    public static class OnTickSelected extends OnDone<Tick> {

        public OnTickSelected(Tick selectedTick) {
            super(selectedTick);
        }
    }
}


text:
<?php
use com\blackmoonit\Strings;

//additional options we wish to parse besides the default -u -p and --host
//nothing additional to do

//standard means of setting up the environment to access the website via CLI
//  the processed CLI options returned by the process_cli_options() are returned as well.
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'cli_bootstrap.php');

print(Strings::createUUID());

//end output with an EOL so CLI prompt will alway appear correctly on a fresh line
print(PHP_EOL);


text:
package eventoscientificos.view;

import eventoscientificos.controllers.RegistarUtilizadorController;
import eventoscientificos.model.Empresa;
import java.awt.Frame;
import javax.swing.JOptionPane;

/**
 * @author G01
 */
public class RegistarUtilizadorUI extends javax.swing.JDialog {

    private Frame framePai;
    private RegistarUtilizadorController controller;

    /**
     * Creates new form RegistarUtilizadorUI
     * @param parent parent
     * @param modal modal
     * @param empresa empresa
     */
    public RegistarUtilizadorUI(java.awt.Frame parent, boolean modal, Empresa empresa) {
        super(parent, "Registar utilizador", modal);
        this.controller = new RegistarUtilizadorController(empresa);
        this.framePai = parent;
        setResizable(false);
        initComponents();
        setLocationRelativeTo(null);
        getRootPane().setDefaultButton(this.btn_registar);
        setVisible(true);
        pack();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lbl_username = new javax.swing.JLabel();
        lbl_password = new javax.swing.JLabel();
        lbl_nome = new javax.swing.JLabel();
        lbl_email = new javax.swing.JLabel();
        txt_username = new javax.swing.JTextField();
        txt_nome = new javax.swing.JTextField();
        txt_email = new javax.swing.JTextField();
        btn_cancelar = new javax.swing.JButton();
        btn_registar = new javax.swing.JButton();
        txt_password = new javax.swing.JPasswordField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        lbl_username.setText("Username:");

        lbl_password.setText("Password:");

        lbl_nome.setText("Nome:");

        lbl_email.setText("Email:");

        btn_cancelar.setText("Cancelar");
        btn_cancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_cancelarActionPerformed(evt);
            }
        });

        btn_registar.setText("Registar");
        btn_registar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_registarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(lbl_username)
                            .addComponent(lbl_password)
                            .addComponent(lbl_nome)
                            .addComponent(lbl_email))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txt_username)
                            .addComponent(txt_nome)
                            .addComponent(txt_email)
                            .addComponent(txt_password)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 96, Short.MAX_VALUE)
                        .addComponent(btn_registar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btn_cancelar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_username)
                    .addComponent(txt_username, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lbl_password)
                    .addComponent(txt_password, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_nome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbl_nome))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txt_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lbl_email))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_cancelar)
                    .addComponent(btn_registar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_registarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_registarActionPerformed
        try {
            controller.novoUtilizador(
                txt_nome.getText(), txt_email.getText(), txt_username.getText(),
                new String(txt_password.getPassword()));

            String opcoes[] = {"Sim", "Não"};
            int resposta = JOptionPane.showOptionDialog(
                    null, "Confirma os dados?", "Registar Utilizador", 0,
                    JOptionPane.QUESTION_MESSAGE, null, opcoes, opcoes[0]);
            if (resposta == 0) {
                controller.adicionarUtilizador();
                dispose();
            } else {
                dispose();
            }
        } catch(IllegalArgumentException ex) {
            JOptionPane.showMessageDialog(
                    framePai,
                    ex.getMessage(),
                    "Registar Utilizador",
                    JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_btn_registarActionPerformed

    private void btn_cancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_cancelarActionPerformed
        dispose();
    }//GEN-LAST:event_btn_cancelarActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_cancelar;
    private javax.swing.JButton btn_registar;
    private javax.swing.JLabel lbl_email;
    private javax.swing.JLabel lbl_nome;
    private javax.swing.JLabel lbl_password;
    private javax.swing.JLabel lbl_username;
    private javax.swing.JTextField txt_email;
    private javax.swing.JTextField txt_nome;
    private javax.swing.JPasswordField txt_password;
    private javax.swing.JTextField txt_username;
    // End of variables declaration//GEN-END:variables
}


text:
#ifndef WEBRTC_AUDIO_SEND_STREAM_H_
#define WEBRTC_AUDIO_SEND_STREAM_H_

#include <string>
#include <vector>

#include "webrtc/base/scoped_ptr.h"
#include "webrtc/config.h"
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
#include "webrtc/stream.h"
#include "webrtc/typedefs.h"

namespace webrtc {

class AudioSendStream : public SendStream {
 public:
  struct Stats {};

  struct Config {
    std::string ToString() const;

    // Receive-stream specific RTP settings.
    struct Rtp {
      std::string ToString() const;

      // Sender SSRC.
      uint32_t ssrc = 0;

      // RTP header extensions used for the received stream.
      std::vector<RtpExtension> extensions;
    } rtp;

    rtc::scoped_ptr<AudioEncoder> encoder;
    int cng_payload_type = -1;  // pt, or -1 to disable Comfort Noise Generator.
    int red_payload_type = -1;  // pt, or -1 to disable REDundant coding.
  };

  virtual Stats GetStats() const = 0;
};
}  // namespace webrtc

#endif  // WEBRTC_AUDIO_SEND_STREAM_H_


text:
class CarsController < ApplicationController
  before_action :set_car, only: [:show, :update, :destroy]

  def index
    respond_to do |format|
      format.json { render json: Car.all }
    end
  end

  def show
    respond_to do |format|
      format.json { render json: @car }
    end
  end

  def update
    respond_to do |format|
      if @car.update(car_params)
        format.json { render json: @car, status: :ok }
      else
        format.json { render json: @car.errors, status: :unprocessable_entity }
      end
    end
  end

  def create
    @car = Car.new(car_params)
    respond_to do |format|
      if @car.save
        format.json { render json: @car, status: :created }
      else
        format.json { render json: @car.errors, status: :unprocessable_entity }
      end
    end
  end

  def destroy
    respond_to do |format|
      if @car.destroy
        format.json { render json: Car.all, status: :ok }
      else
        format.json { render json: @car.errors, status: :unprocessable_entity }
      end
    end
  end

  private
    def set_car
      @car = Car.find(params[:id])
    end

    def car_params
      params.require(:car).permit(:id, :make, :model, :color, :condition)
    end
end


text:
package dk.aau.cs.qweb.qboairbase.provenance;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import dk.aau.cs.qweb.qboairbase.types.Quad;
import dk.aau.cs.qweb.qboairbase.types.Tuple;

public class Provenance {

	private static Provenance instance = null;
	private Map<ProvenanceSignature,String> provenanceMap = new HashMap<ProvenanceSignature, String>();
	private Map<String,ProvenanceGraph> provenanceGraphMap = new HashMap<String, ProvenanceGraph>();
	private Set<String> subjects = new LinkedHashSet<>();

	private Provenance() { }

	public static Provenance getInstance() {
		if(instance == null) {
			instance = new Provenance();
		}
		return instance;
	}

	public String getProvenanceIdentifier(Quad quad, String level, List<String> files, Tuple tuple) {
		ProvenanceSignature signature = new ProvenanceSignature(quad, level, LocalDate.now(), files, tuple);
		if (provenanceMap.containsKey(signature)) {
			return provenanceMap.get(signature);
		} else {
			String provenanceIdentifier = createProvenanceGraph(signature);
			provenanceMap.put(signature, provenanceIdentifier);
			return provenanceIdentifier;
		}
	}

	private String createProvenanceGraph(ProvenanceSignature signature) {
		ProvenanceGraph provenanceGraph = new ProvenanceGraph(signature);
		provenanceGraphMap.put(provenanceGraph.getProvenanceIdentifier(), provenanceGraph);
		return provenanceGraph.getProvenanceIdentifier();
	}

	public Set<Quad> getProvenanceQuads() {
		Set<Quad> provenanceQuads = new HashSet<Quad>();
		for (ProvenanceGraph provenanceGraph : provenanceGraphMap.values()) {
			if (!subjects.contains(provenanceGraph.getProvenanceIdentifier())) {
				Set<Quad> qds = provenanceGraph.getQuads();
				provenanceQuads.addAll(qds);
				subjects.add(provenanceGraph.getProvenanceIdentifier());
			}

		}
		return provenanceQuads;
	}

	public Set<Quad> getProvenanceGraph(String provenanceIdentifier) {
		Set<Quad> provenanceQuads = new HashSet<Quad>();
		provenanceQuads.addAll(provenanceGraphMap.get(provenanceIdentifier).getQuads());
		return provenanceQuads;
	}

	public boolean subjectExists(String subject) {
		return subjects.contains(subject);
	}

	public void registerSubject(String subject) {
		subjects.add(subject);
	}

	public void clearProvenance() {
		provenanceGraphMap.clear();
		provenanceMap.clear();
	}

}


text:
@class NSView;

namespace ui {

struct ViewTreeProblemDetails {
  enum ProblemType {
    // |view_a| (the child view) is not entirely contained within the bounds of
    // |view_b| (the parent view).
    VIEW_OUTSIDE_PARENT,

    // |view_a| and |view_b|, neither of which is an ancestor of the other,
    // overlap each other, and at least one of |view_a| or |view_b| has
    // localizable text (is an NSControl or NSText).
    VIEWS_OVERLAP,
  };

  ProblemType type;
  NSView* view_a;
  NSView* view_b;

  std::string ToString();
};

// Validates the view tree rooted at |root|. If at least one problem is found,
// returns a |ViewTreeProblemDetails| as described above; if not, returns an
// empty option.
absl::optional<ViewTreeProblemDetails> ValidateViewTree(NSView* root);

}  // namespace ui

#endif  // UI_BASE_TEST_VIEW_TREE_VALIDATOR_H_


text:
    <input type="text" class="form-control" placeholder="Placeholder value...">

      <input type="checkbox"> Label

  <input type="submit" class="btn btn-primary">


text:
module RDataTables
  module Helpers
    def symbolize_keys(hash)
      hash.map { |option, value| [option.to_sym, value] }.to_h
    end

    def clone_object(object)
      Marshal.load(Marshal.dump(object))
    end

    extend self
  end
end


text:
package com.hp.ov.sdk.util;

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

import com.hp.ov.sdk.dto.samples.NetworkForServerProfile;
import com.hp.ov.sdk.dto.samples.SanStorageForServerProfile.StorageVolume;
import com.hp.ov.sdk.dto.samples.ServerProfileValue;
import com.hp.ov.sdk.dto.servers.SanStorage;
import com.hp.ov.sdk.dto.servers.VolumeAttachment;
import com.hp.ov.sdk.dto.servers.serverprofile.ProfileConnection;
import com.hp.ov.sdk.dto.servers.serverprofile.ServerProfile;
import com.hp.ov.sdk.rest.http.core.client.ApiVersion;

public class ResourceDtoUtilsWrapper {

    private final ResourceDtoUtils resourceDtoUtils;

    public ResourceDtoUtilsWrapper(ResourceDtoUtils resourceDtoUtils) {
        this.resourceDtoUtils = resourceDtoUtils;
    }

    public ServerProfile buildServerProfile(ApiVersion apiVersion, final ServerProfileValue serverProfileValue) {
        Integer j = 1;
        final HashMap<String, Integer> fcId = new HashMap<String, Integer>();
        List<ProfileConnection> connections = new ArrayList<ProfileConnection>();
        SanStorage sanStorage;

        if (serverProfileValue.getNetworkForServerProfile().size() > 0) {
            for (final NetworkForServerProfile networkForServerProfile : serverProfileValue.getNetworkForServerProfile()) {
                connections.add(resourceDtoUtils.buildProfileConnection(j, networkForServerProfile.getNetworkName(),
                        networkForServerProfile.getRequestedMbps(), networkForServerProfile.getAllocatedMbps(),
                        networkForServerProfile.getMaximumMbps(), networkForServerProfile.getNetworkType(),
                        networkForServerProfile.getBoot(), networkForServerProfile.getConnectionName()));
                if ((networkForServerProfile.getNetworkType().toString()).equalsIgnoreCase("FibreChannel")) {
                    fcId.put(networkForServerProfile.getNetworkName(), j);
                }
                j++;
            }
        } else {
            connections = null;
        }
        if (serverProfileValue.getStorageVolumeForServerProfile().getStorageVolume().size() > 0) {
            final List<VolumeAttachment> volumeAttachments = new ArrayList<VolumeAttachment>();
            for (final StorageVolume storageVolume : serverProfileValue.getStorageVolumeForServerProfile().getStorageVolume()) {
                volumeAttachments.add(resourceDtoUtils.buildVolumeAttachment(storageVolume.getVolumeName(),
                        serverProfileValue.getUseBayNameForServerHardwareUri(), j, storageVolume.getIsEnabled(),
                        storageVolume.getStorageTargets(), storageVolume.getStorageTargetType(), storageVolume.getLunType(), fcId));
                j++;
            }
            sanStorage = resourceDtoUtils.buildSanStorage(serverProfileValue.getStorageVolumeForServerProfile()
                    .getHostOSType(), volumeAttachments);
        } else {
            sanStorage = null;
        }

        return resourceDtoUtils.buildServerProfile(apiVersion, serverProfileValue.getTemplateName(), serverProfileValue.getBayName(),
                serverProfileValue.getUseBayNameForServerHardwareUri(), serverProfileValue.getEnclosureGroupName(),
                serverProfileValue.getAffinity(), serverProfileValue.getWwnType(), serverProfileValue.getMacType(),
                serverProfileValue.getSerialNumberType(), sanStorage, connections, serverProfileValue.getLocalStorage(),
                serverProfileValue.getBoot(), serverProfileValue.getBios(), serverProfileValue.getFirmware(),
                serverProfileValue.getOsDeploymentSettings());
    }
}