text:
/*@import url(http://weloveiconfonts.com/api/?family=entypo);*/
@import url(https://fonts.googleapis.com/css?family=Bad+Script);
@import url(https://fonts.googleapis.com/css?family=Nova+Mono);

[class*="entypo-"]:before {
  font-family: 'entypo', sans-serif;
}

* {
  box-sizing:border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  border: 0;
  background: url(../img/symphony.png)
}
body {
    padding-top: 50px;
    }
@media screen and (max-width: 768px) {
    body { padding-top: 20px; }
}
@media (min-width: 992px) {
.container {
  width: 100%;
  }
}

h1 {
 color:#7f8c8d;
  font-family: 'Bad Script', cursive;
  margin-bottom:0px;

}
li {
  list-style: none;
}
.container {
  margin: 0 auto;
}
.row {
  margin: 0;
}
.add {
    font-family: 'Bad Script', helvetica;
    font-size: 18px;
    color: #95a5a6;
}
.load-more, body {
  font-family: 'Bad Script', cursive;
}
.todoItem {
  font-family: helvetica;
}
.create-todo {
  /*font-family: '"Helvetica Neue",Helvetica,Arial,sans-serif'*/
  width: 100%;
  height: 100%;
  left: -4px;
}
.input-group-addon, span.pull-left, .selectpicker {
  color:  #95a5a6;
  background: none;
  border:none;
}

.content {
  margin: 0 auto;
  background: #ecf0f1;
  border-top:5px solid #7f8c8d;
  box-shadow: 0px 0px 10px -2px rgba(0, 0, 0, .5);
  font-size: 18px;
 }

.header {
  padding:20px;
  background: #ececec;
  }

.todoItem {
  padding: 20px;
  border-top:2px solid rgb(200,200,200);
  border-top-style:dashed;
  color:#7f8c8d;
  transition:all 1s;
}
.todo {
  word-wrap: break-word;
  width: 100%;
  max-width: 100%;
}
.done {
  text-decoration:line-through;
}
.check-todo span:after {
  content: '☐' ;
}
.done .check-todo span:after {
 content: '☑ '; !important
}
.deadline-error {
  display: none;
}

input, textarea {
  padding-left: 35px;
  background: transparent;
  border:none;
  font-size:20px;
  color:#95a5a6;
  width: 100%;
}

input:focus, textarea:focus {
  	outline-color: transparent;
}

span:focus {
  	outline-color: transparent;
}

button {
   background: transparent;
   border:none;
  color:#7f8c8d;
  cursor: pointer;
}

.todoItem button {
  position: relative;
  background: rgba(0,0,0,0);
  border: 0;
  float: right;
  display:inline-block;
  color:transparent;
  transition:all .5s;
}

.todoItem:hover button {
  color:#7f8c8d;
}
.selectpicker.btn-default {
  box-shadow: none;
  border: none;
  background: #ececec;
  border-radius: 0;
}
.bootstrap-select.priority {
  width: 50px !important;
}
.label-default.priority.priority-1 {
  background-color: #fceabb;
}
.label-default.priority.priority-2 {
  background-color: #D3ED8C
}
.label-default.priority.priority-3 {
  background-color: #abf05d;
}
.label-default.priority.priority-4 {
  background-color: #5EF298;
}
.label-default.priority.priority-5 {
  background-color: #0cf5d6;
}
.label-default.priority.priority-6 {
  background-color: #12A4E3;
}
.label-default.priority.priority-7 {
  background-color: #184ef0;
}
.label-default.priority.priority-8 {
  background-color: #7F3A8B;
}
.label-default.priority.priority-9 {
  background-color: #e62727;
}

#login .container {
  margin:0;
  padding: 1px 0;
  height: 100%;
  width: 100%;
  background-size: cover;
  color: #fff;
  font-family: "Comfortaa", "Helvetica", sans-serif
}

#login .login {
  max-width: 280px;
  margin: 30px auto;
  background-color: rgba(10,10,10,.68);
}

#login .login-icon-field {
  height: 250px;
  width: 100%;
  /*background-color: red;*/
}

#login .login-icon {
  margin: 50px 65px;
}
#login ul {
  padding: 0;
}
#login .login-form {
  padding: 8px 20px 20px;

  width: 100%;
  /*background-color: green;*/
}

#login .username-row {
  position: relative;
  /*background-color: pink;*/
  border-bottom: 1px solid;
  margin-bottom: 10px;
  margin: 10px;
}

#login .password-row {
  margin: 10px;
  position: relative;
  height: 55px;
 /* background-color: grey;*/
  border-bottom: 1px solid;
}

#login .password-icon,
#login .user-icon {
  margin: 5px;
}

#login .password-icon .key-path,
#login .user-icon .user-path{
  fill: rgba(10,10,10,0);
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  -webkit-animation: dash 3s .3s linear forwards;
  animation: dash 3s .3s linear forwards;
}

#login  .user-icon .user-path {
  -webkit-animation: dash 3s .8s linear forwards;
  animation: dash 3s .8s linear forwards;
}

#login input {
  padding-left: 0;
  width: 220px;
  height: 28px;
  margin: 0px 0;
  background: transparent;
  border: none;
}

#login input:focus,
#login button:focus {
  outline: none;
}

#login input::-webkit-input-placeholder {
  color: rgba(255,255,255,.4);
}

#login input::-moz-placeholder {
  color: rgba(255,255,255,.4);
}

#login .call-to-action {
  margin: 22px 0;
  height: 130px;
  width: 100%;
  /*background-color: blue;*/
}
#login h1 {
    left: 77px;
  color: #7f8c8d;
  font-family: 'Bad Script', cursive;
  margin-bottom: 0px;
  position: relative;
  top: 10px;
}
#login button {
  color: #fff;
  display: block;
  width: 240px;
  height: 40px;
  padding: 0;
  margin: 10px 20px 10px;
  font-weight: 700;
  background-color: #22c08a;
  border: none;
  border-radius: 20px;
  transition: background-color .10s ease-in-out;
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}

#login button:hover {
  background-color: #26d69a;
}

#login button:active {
  background-color: #1eaa7a;
}

#login p {
  display: inline-block;
  width: 200px;
  margin: 0 40px;
  font-size: 1rem;
  color: rgba(255,255,255,.4);
  /*background-color: yellow;*/
}

#login p a {
  color: #fff;
}

#login label,
#login p a:hover {
  -webkit-cursor: pointer;
  cursor: pointer;
}
.navbar-inverse {
    background: rgba(0,0,0,0.5);
}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:hover, .navbar-inverse .navbar-nav>.active>a:focus{
  background: rgba(0,0,0,0.5);
}
@-webkit-keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}

/*!
 * Datepicker for Bootstrap
 *
 * Copyright 2012 Stefan Petre
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *

 /*!
 * Datetimepicker for Bootstrap 3
 * ! version : 4.7.14
 * https://github.com/Eonasdan/bootstrap-datetimepicker/
 */
.
.bootstrap-datetimepicker-widget .dropdown-menu {
  background: #ecf0f1 !important;
  list-style: none;
}
.bootstrap-datetimepicker-widget.dropdown-menu {
  margin: 2px 0;
  padding: 4px;
  width: 19em;
}
@media (min-width: 768px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}
@media (min-width: 992px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}
@media (min-width: 1200px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}
.bootstrap-datetimepicker-widget.dropdown-menu:before,
.bootstrap-datetimepicker-widget.dropdown-menu:after {
  content: '';
  display: inline-block;
  position: absolute;
}
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #cccccc;
  border-bottom-color: rgba(0, 0, 0, 0.2);
  top: -7px;
  left: 7px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid white;
  top: -6px;
  left: 8px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid #cccccc;
  border-top-color: rgba(0, 0, 0, 0.2);
  bottom: -7px;
  left: 6px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
  bottom: -6px;
  left: 7px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
  left: auto;
  right: 6px;
}
.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
  left: auto;
  right: 7px;
}
.bootstrap-datetimepicker-widget .list-unstyled {
  margin: 0;
}
.bootstrap-datetimepicker-widget a[data-action] {
  padding: 6px 0;
}
.bootstrap-datetimepicker-widget a[data-action]:active {
  box-shadow: none;
}
.bootstrap-datetimepicker-widget .timepicker-hour,
.bootstrap-datetimepicker-widget .timepicker-minute,
.bootstrap-datetimepicker-widget .timepicker-second {
  width: 54px;
  font-weight: bold;
  font-size: 1.2em;
  margin: 0;
}
.bootstrap-datetimepicker-widget button[data-action] {
  padding: 6px;
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Increment Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Increment Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Decrement Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Decrement Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Show Hours";
}
.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Show Minutes";
}
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Toggle AM/PM";
}
.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Clear the picker";
}
.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Set the date to today";
}
.bootstrap-datetimepicker-widget .picker-switch {
  text-align: center;
}
.bootstrap-datetimepicker-widget .picker-switch::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Toggle Date and Time Screens";
}
.bootstrap-datetimepicker-widget .picker-switch td {
  padding: 0;
  margin: 0;
  height: auto;
  width: auto;
  line-height: inherit;
}
.bootstrap-datetimepicker-widget .picker-switch td span {
  line-height: 2.5;
  height: 2.5em;
  width: 100%;
}
.bootstrap-datetimepicker-widget table {
  width: 100%;
  margin: 0;
}
.bootstrap-datetimepicker-widget table td,
.bootstrap-datetimepicker-widget table th {
  text-align: center;
  border-radius: 4px;
}
.bootstrap-datetimepicker-widget table th {
  height: 20px;
  line-height: 20px;
  width: 20px;
}
.bootstrap-datetimepicker-widget table th.picker-switch {
  width: 145px;
}
.bootstrap-datetimepicker-widget table th.disabled,
.bootstrap-datetimepicker-widget table th.disabled:hover {
  background: none;
  color: #777777;
  cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table th.prev::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Previous Month";
}
.bootstrap-datetimepicker-widget table th.next::after {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  content: "Next Month";
}
.bootstrap-datetimepicker-widget table thead tr:first-child th {
  cursor: pointer;
}
.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
  background: #eeeeee;
}
.bootstrap-datetimepicker-widget table td {
  height: 54px;
  line-height: 54px;
  width: 54px;
}
.bootstrap-datetimepicker-widget table td.cw {
  font-size: .8em;
  height: 20px;
  line-height: 20px;
  color: #777777;
}
.bootstrap-datetimepicker-widget table td.day {
  height: 20px;
  line-height: 20px;
  width: 20px;
}
.bootstrap-datetimepicker-widget table td.day:hover,
.bootstrap-datetimepicker-widget table td.hour:hover,
.bootstrap-datetimepicker-widget table td.minute:hover,
.bootstrap-datetimepicker-widget table td.second:hover {
  background: #eeeeee;
  cursor: pointer;
}
.bootstrap-datetimepicker-widget table td.old,
.bootstrap-datetimepicker-widget table td.new {
  color: #777777;
}
.bootstrap-datetimepicker-widget table td.today {
  position: relative;
}
.bootstrap-datetimepicker-widget table td.today:before {
  content: '';
  display: inline-block;
  border: 0 0 7px 7px solid transparent;
  border-bottom-color: #337ab7;
  border-top-color: rgba(0, 0, 0, 0.2);
  position: absolute;
  bottom: 4px;
  right: 4px;
}
.bootstrap-datetimepicker-widget table td.active,
.bootstrap-datetimepicker-widget table td.active:hover {
  background-color: #337ab7;
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget table td.active.today:before {
  border-bottom-color: #fff;
}
.bootstrap-datetimepicker-widget table td.disabled,
.bootstrap-datetimepicker-widget table td.disabled:hover {
  background: none;
  color: #777777;
  cursor: not-allowed;
}
.bootstrap-datetimepicker-widget table td span {
  display: inline-block;
  width: 54px;
  height: 54px;
  line-height: 54px;
  margin: 2px 1.5px;
  cursor: pointer;
  border-radius: 4px;
}
.bootstrap-datetimepicker-widget table td span:hover {
  background: #eeeeee;
}
.bootstrap-datetimepicker-widget table td span.active {
  background-color: #337ab7;
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.bootstrap-datetimepicker-widget table td span.old {
  color: #777777;
}
.bootstrap-datetimepicker-widget table td span.disabled,
.bootstrap-datetimepicker-widget table td span.disabled:hover {
  background: none;
  color: #777777;
  cursor: not-allowed;
}
.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
  height: 27px;
  line-height: 27px;
}
.input-group.date .input-group-addon {
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.glyphicon:empty{
  width: 1.4em;
}
/*!
 * Bootstrap-select v1.6.3 (http://silviomoreto.github.io/bootstrap-select/)
 *
 * Copyright 2013-2014 bootstrap-select
 * Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
 */

.bootstrap-select {
  /*width: 220px\9; IE8 and below*/
  width: 220px \0;
  /*IE9 and below*/
}
.bootstrap-select > .btn {
  width: 100%;
  padding-right: 25px;
}
.error .bootstrap-select .btn {
  border: 1px solid #b94a48;
}
.control-group.error .bootstrap-select .dropdown-toggle {
  border-color: #b94a48;
}
.bootstrap-select.fit-width {
  width: auto !important;
}
.bootstrap-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) {
  width: 220px;
}
.bootstrap-select .btn:focus {
  outline: thin dotted #333333 !important;
  outline: 5px auto -webkit-focus-ring-color !important;
  outline-offset: -2px;
}
.bootstrap-select.form-control {
  margin-bottom: 0;
  padding: 0;
  border: none;
}
.bootstrap-select.form-control:not([class*="col-"]) {
  width: 100%;
}
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="col-"] {
  float: none;
  display: inline-block;
  margin-left: 0;
}
.bootstrap-select.btn-group.dropdown-menu-right,
.bootstrap-select.btn-group[class*="col-"].dropdown-menu-right,
.row-fluid .bootstrap-select.btn-group[class*="col-"].dropdown-menu-right {
  float: right;
}
.form-search .bootstrap-select.btn-group,
.form-inline .bootstrap-select.btn-group,
.form-horizontal .bootstrap-select.btn-group,
.form-group .bootstrap-select.btn-group {
  margin-bottom: 0;
}
.form-group-lg .bootstrap-select.btn-group.form-control,
.form-group-sm .bootstrap-select.btn-group.form-control {
  padding: 0;
}
.form-inline .bootstrap-select.btn-group .form-control {
  width: 100%;
}
.input-append .bootstrap-select.btn-group {
  margin-left: -1px;
}
.input-prepend .bootstrap-select.btn-group {
  margin-right: -1px;
}
.bootstrap-select.btn-group > .disabled {
  cursor: not-allowed;
}
.bootstrap-select.btn-group > .disabled:focus {
  outline: none !important;
}
.bootstrap-select.btn-group .btn .filter-option {
  color: black;
  font-size: 25px;
  padding-right: 14px;
  margin-left: -10px;
  margin-top: -10px;
  display: inline-block;
  overflow: hidden;
  width: 100%;
  text-align: left;
}
.bootstrap-select.btn-group .btn .caret {
  position: absolute;
  top: 50%;
  right: 12px;
  margin-top: -2px;
  vertical-align: middle;
}
.bootstrap-select.btn-group[class*="col-"] .btn {
  width: 100%;
}
.bootstrap-select.btn-group .dropdown-menu {
  min-width: 100%;
  z-index: 1035;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
.bootstrap-select.btn-group .dropdown-menu.inner {
  position: static;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 0;
  -webkit-box-shadow: none;
          box-shadow: none;
}
.bootstrap-select.btn-group .dropdown-menu li {
  position: relative;
}
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) a:hover small,
.bootstrap-select.btn-group .dropdown-menu li:not(.disabled) a:focus small,
.bootstrap-select.btn-group .dropdown-menu li.active:not(.disabled) a small {
  color: #64b1d8;
  color: rgba(100, 177, 216, 0.4);
}
.bootstrap-select.btn-group .dropdown-menu li.disabled a {
  cursor: not-allowed;
}
.bootstrap-select.btn-group .dropdown-menu li a {
  cursor: pointer;
}
.bootstrap-select.btn-group .dropdown-menu li a.opt {
  position: relative;
  padding-left: 2.25em;
}
.bootstrap-select.btn-group .dropdown-menu li a span.check-mark {
  display: none;
}
.bootstrap-select.btn-group .dropdown-menu li a span.text {
  display: inline-block;
}
.bootstrap-select.btn-group .dropdown-menu li small {
  padding-left: 0.5em;
}
.bootstrap-select.btn-group .dropdown-menu .notify {
  position: absolute;
  bottom: 5px;
  width: 96%;
  margin: 0 2%;
  min-height: 26px;
  padding: 3px 5px;
  background: #f5f5f5;
  border: 1px solid #e3e3e3;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
  pointer-events: none;
  opacity: 0.9;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
.bootstrap-select.btn-group .no-results {
  padding: 3px;
  background: #f5f5f5;
  margin: 0 5px;
}
.bootstrap-select.btn-group.fit-width .btn .filter-option {
  position: static;
}
.bootstrap-select.btn-group.fit-width .btn .caret {
  position: static;
  top: auto;
  margin-top: -1px;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark {
  position: absolute;
  display: inline-block;
  right: 15px;
  margin-top: 5px;
}
.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text {
  margin-right: 34px;
}
.bootstrap-select.show-menu-arrow.open > .btn {
  z-index: 1035 + 1;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:before {
  content: '';
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom-width: 7px;
  border-bottom-style: solid;
  border-bottom-color: #cccccc;
  border-bottom-color: rgba(204, 204, 204, 0.2);
  position: absolute;
  bottom: -4px;
  left: 9px;
  display: none;
}
.bootstrap-select.show-menu-arrow .dropdown-toggle:after {
  content: '';
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid white;
  position: absolute;
  bottom: -4px;
  left: 10px;
  display: none;
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before {
  bottom: auto;
  top: -3px;
  border-bottom: 0;
  border-top-width: 7px;
  border-top-style: solid;
  border-top-color: #cccccc;
  border-top-color: rgba(204, 204, 204, 0.2);
}
.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after {
  bottom: auto;
  top: -3px;
  border-top: 6px solid white;
  border-bottom: 0;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before {
  right: 12px;
  left: auto;
}
.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after {
  right: 13px;
  left: auto;
}
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:before,
.bootstrap-select.show-menu-arrow.open > .dropdown-toggle:after {
  display: block;
}
.bs-searchbox,
.bs-actionsbox {
  padding: 4px 8px;
}
.bs-actionsbox {
  float: left;
  width: 100%;
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}
.bs-actionsbox .btn-group button {
  width: 50%;
}
.bs-searchbox + .bs-actionsbox {
  padding: 0 8px 4px;
}
.bs-searchbox input.form-control {
  margin-bottom: 0;
  width: 100%;
}
.mobile-device {
  position: absolute;
  top: 0;
  left: 0;
  display: block !important;
  width: 100%;
  height: 100% !important;
  opacity: 0;
}


text:
<?xml version='1.0' encoding='utf-8'?>
<Configuration>
   <Property name='application.root'>D:\ZW-Mobile-P1301-Resource</Property>
   <Property name='resource.root'>D:\ZW-Mobile-P1301-Resource\Webroot</Property>
   <Property name='resource2d.root'>D:\ZW-Mobile-P1301-Resource\Resource2d</Property>
   <Property name='resource3d.root'>D:\ZW-Mobile-P1301-Resource\Resource3d</Property>
   <Property name='export.root'>D:\ZW-Mobile-P1301-Resource\Webroot</Property>
</Configuration>

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Nectandra dioica Mez

### Remarks
null


text:
class EnableSslVerificationForWebHooks < ActiveRecord::Migration[4.2]
  def up
    execute("UPDATE web_hooks SET enable_ssl_verification = true")
  end

  def down
  end
end


text:
require 'webmock/rspec'
require 'avro_turf/confluent_schema_registry'
require 'avro_turf/test/fake_confluent_schema_registry_server'

describe AvroTurf::ConfluentSchemaRegistry do
  let(:user) { "abc" }
  let(:password) { "xxyyzz" }
  let(:client_cert) { "test client cert" }
  let(:client_key) { "test client key" }
  let(:client_key_pass) { "test client key password" }

  it_behaves_like "a confluent schema registry client" do
    let(:registry) {
      described_class.new(
        registry_url,
        logger: logger,
        client_cert: client_cert,
        client_key: client_key,
        client_key_pass: client_key_pass
      )
    }
  end

  it_behaves_like "a confluent schema registry client" do
    let(:registry) {
      described_class.new(
        registry_url,
        user: user,
        password: password,
      )
    }
  end
end


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

<title>Uses of Class org.drip.function.definition.UnitVector</title>
<meta name="date" content="2017-01-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.drip.function.definition.UnitVector

Packages that use UnitVector

Package
Description

org.drip.function.definition

org.drip.function.rdtor1descent

Uses of UnitVector in org.drip.function.definition

Methods in org.drip.function.definition that return UnitVector

Modifier and Type
Method and Description

UnitVector
SizedVector.direction()

Retrieve the Unit Direction Vector

UnitVector
RdToR1.gradient(double[] adblVariate)

Construct an Instance of the Unit Gradient Vector at the given Input Variates

static UnitVector
UnitVector.Standard(double[] adbl)

Construct an Instance of the Unit Vector from the Input Vector

Constructors in org.drip.function.definition with parameters of type UnitVector

Constructor and Description

SizedVector(UnitVector uv,
           double dblMagnitude)

SizedVector Constructor

Uses of UnitVector in org.drip.function.rdtor1descent

Methods in org.drip.function.rdtor1descent that return UnitVector

Modifier and Type
Method and Description

UnitVector
LineEvolutionVerifierMetrics.targetDirection()

Retrieve the Target Direction Unit Vector

Methods in org.drip.function.rdtor1descent with parameters of type UnitVector

Modifier and Type
Method and Description

LineEvolutionVerifierMetrics
WolfeEvolutionVerifier.metrics(UnitVector uvTargetDirection,
       double[] adblCurrentVariate,
       RdToR1 funcRdToR1,
       double dblStepLength)

abstract LineEvolutionVerifierMetrics
LineEvolutionVerifier.metrics(UnitVector uvTargetDirection,
       double[] adblCurrentVariate,
       RdToR1 funcRdToR1,
       double dblStepLength)

Generate the Verifier Metrics for the Specified Inputs

LineEvolutionVerifierMetrics
CurvatureEvolutionVerifier.metrics(UnitVector uvTargetDirection,
       double[] adblCurrentVariate,
       RdToR1 funcRdToR1,
       double dblStepLength)

LineEvolutionVerifierMetrics
ArmijoEvolutionVerifier.metrics(UnitVector uvTargetDirection,
       double[] adblCurrentVariate,
       RdToR1 funcRdToR1,
       double dblStepLength)

boolean
LineEvolutionVerifier.verify(UnitVector uvTargetDirection,
      double[] adblCurrentVariate,
      RdToR1 funcRdToR1,
      double dblStepLength)

Verify if the specified Inputs satisfy the Criterion

Constructors in org.drip.function.rdtor1descent with parameters of type UnitVector

Constructor and Description

ArmijoEvolutionVerifierMetrics(double dblArmijoParameter,
                              boolean bMaximizerCheck,
                              UnitVector uvTargetDirection,
                              double[] adblCurrentVariate,
                              double dblStepLength,
                              double dblCurrentVariateFunctionValue,
                              double dblNextVariateFunctionValue,
                              double[] adblCurrentVariateFunctionJacobian)

ArmijoEvolutionVerifierMetrics Constructor

CurvatureEvolutionVerifierMetrics(double dblCurvatureParameter,
                                 boolean bStrongCurvatureCriterion,
                                 UnitVector uvTargetDirection,
                                 double[] adblCurrentVariate,
                                 double dblStepLength,
                                 double[] adblCurrentVariateFunctionJacobian,
                                 double[] adblNextVariateFunctionJacobian)

CurvatureEvolutionVerifierMetrics Constructor

WolfeEvolutionVerifierMetrics(double dblArmijoParameter,
                             boolean bMaximizerCheck,
                             double dblCurvatureParameter,
                             boolean bStrongCurvatureCriterion,
                             UnitVector uvTargetDirection,
                             double[] adblCurrentVariate,
                             double dblStepLength,
                             double dblCurrentVariateFunctionValue,
                             double dblNextVariateFunctionValue,
                             double[] adblCurrentVariateFunctionJacobian,
                             double[] adblNextVariateFunctionJacobian)

WolfeEvolutionVerifierMetrics Constructor

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
require File.expand_path('../square.rb', __FILE__)
require File.expand_path('../move.rb', __FILE__)
require File.expand_path('../exceptions.rb', __FILE__)

class State

  attr_accessor :board, :moveCounter

  MAXTURNS = 80
  $mzero = 'UNSET'

  def initialize
    @board = []
    @moveCounter = 1
    @sideOnMove = 'W'
    @nodes = 0
  end

  def printBoard
    puts "#{@moveCounter} #{@sideOnMove}"
    @board.each do |x|
      puts x.join("")
    end
    puts "\n"
  end

  def initBoard
    @board = [
      ['k','q','b','n','r'],
      ['p','p','p','p','p'],
      ['.','.','.','.','.'],
      ['.','.','.','.','.'],
      ['P','P','P','P','P'],
      ['R','N','B','Q','K'],
    ]
  end

  def gameOver?(board=@board, moveCounter=@moveCounter)
    if not board.flatten.include?('k')
      #puts "white wins"
      return true
    elsif not board.flatten.include?('K')
      #puts "black wins"
      return true
    elsif moveCounter > MAXTURNS
      puts "draw"
      return true
    else
      return false
    end
  end

  def timeRemains?
    if Time.now - @turnTimer > 3
      return false
    else
      return true
    end
  end

  def captureKing?(move, board, sideOnMove)
    piece = board[move.toSquare.y][move.toSquare.x]
    if piece == 'k' and sideOnMove == 'W'
      return true
    elsif piece == 'K' and sideOnMove == 'B'
      return true
    else
      return false
    end
  end

  def bestMove(board=@board, sideOnMove=@sideOnMove)
    @turnTimer = Time.now
    @nodes = 0
    d0 = 1
    m0 = 'UNSET'
    negaScore = 0
    values = {}

    getLegalMoves(board, sideOnMove).each do |move|
      copyOfBoard = Marshal.load( Marshal.dump(board) )
      if captureKing?(move, copyOfBoard, sideOnMove)
        return move
      end
      move(move, copyOfBoard, sideOnMove)
      values[move] = scoreGen(copyOfBoard, sideOnMove)
    end

    while timeRemains?
      v = -10000000
      a0 = -1.0

      # shuffle values
      sortedValues = values.to_a
      sortedValues.shuffle!
      # sort from greatest to least
      sortedValues = sortedValues.sort_by { | m, v | v }.reverse
      # run negamax from greatest to least
      sortedValues.each { |tuple|
        copyOfBoard = Marshal.load( Marshal.dump(board) )
        move(tuple.first, copyOfBoard, sideOnMove)
        v0 = [v, -negamax(copyOfBoard, d0, sideOnMove, -1.0, -a0)].max
        a0 = [a0, v0].max
        if v0 > v
         m0 = tuple.first
         negaScore = v0
        end

        v = [v, v0].max
      }

      d0 = d0 + 1
      puts "depth is #{d0}"
    end

    puts "Negamax at (#{@nodes}), move is #{m0}, score is #{negaScore}, time is #{Time.now - @turnTimer}"
    turnMove(m0)
    return m0
  end

  def negamax(board, depth, sideOnMove, alpha, beta)
      if gameOver?(board) or depth == 0
        return scoreGen(board, sideOnMove)
      end

      @nodes += 1
      # gather all the moves
      values = {}

      getLegalMoves(board, sideOnMove).each do |move|
        copyOfBoard = Marshal.load( Marshal.dump(board) )
        move(move, copyOfBoard, sideOnMove)
        values[move] = scoreGen(copyOfBoard, sideOnMove)
      end

      v = -1.0
      alpha0 = alpha

      # switch sides
      sideOnMove == 'W' ? sideOnMove = 'B' : sideOnMove = 'W'
      # sort from greatest to least
      sortedValues = values.sort_by { |move, value| value}.reverse
      # run negamax from greatest to least
      sortedValues.each { |tuple|
        copyOfBoard = Marshal.load( Marshal.dump(board) )
        move(tuple.first, copyOfBoard, @sideOnMove)
        v = [v, -negamax(copyOfBoard, depth - 1, sideOnMove, -beta, -alpha0)].max
        alpha0 = [alpha0, v].max
        if v >= beta
          return v
        end
      }
    return v
  end

  def scoreGen(board, sideOnMove)
    whiteScore = 0
    blackScore = 0
    for y in 0..5 do
      for x in 0..4 do
        piece = Square.new(x,y)
        if isPiece?(board, piece)
          pieceColor = getColor(board, x, y)
          if pieceColor == 'W'
            piece = board[piece.y][piece.x]
            if piece == 'P'
              whiteScore += checkPawns(board, sideOnMove, x, y)
            end
            whiteScore += getPieceValue(piece)
          else
            piece = board[piece.y][piece.x]
            if piece == 'p'
              blackScore += checkPawns(board, sideOnMove, x, y)
            end
            blackScore += getPieceValue(piece)
          end
        end
      end
    end
    score = whiteScore + blackScore
    return sideOnMove == 'W' ?  score : -score
  end

  def checkPawns(board, sideOnMove, x, y)
    score = 0
    sideOnMove == 'W' ? pos = [ 5, 4, 3, 2 ] : pos = [ 3, 2, 1, 0 ]

    # additional points for moving pawns forward
    if pos.include?(y)
      score += 5
    end

    # check pawn diags
    score += checkPawnDiags(board, sideOnMove, x, y)

    return score
  end

  def checkPawnDiags(board, sideOnMove, x, y)
    score = 0
    sideOnMove == 'W' ? direction = 1 : direction = -1
    sideOnMove == 'W' ? color = 'W' : color = 'B'

    west = board[y+direction][x+1]
    east = board[y+direction][x-1]

    if not west.nil? and color == getColor(board, x, y) and  isOccupied?(west)
      score += 6
    end
    if not east.nil? and color == getColor(board, x, y) and isOccupied?(east)
      score += 6
    end

    return score
  end

  def getPieceValue(p)
    case p.upcase
      when 'P'
        score = 100
      when 'B', 'N'
        score = 300
      when 'R'
        score = 500
      when 'Q'
        score = 900
      when 'K'
        score = 10000
      when  '.'
        score = 0
    end

    return p.upcase == p ? score : - score
  end

  def getPiecesForSide(board, color)
    pieces = []
    for y in 0..5 do
      for x in 0..4 do
        piece = Square.new(x,y)
        if isPiece?(board, piece) and color == getColor(board, x, y)
           pieces << piece
        end
      end
    end
    return pieces
  end

  def humanTurn
    puts "Enter Move:"
    input = gets.strip
    begin
      humanMove(input)
    rescue InvalidHumanMove
      puts "Invalid move #{input}, Please try again"
      humanTurn
    end
  end

  def humanMove(hmove)
    begin
      m = hmove.split("-")
      fs = getChessSquare(m.first)
      ts = getChessSquare(m.last)
      hmove = Move.new(fs, ts)
      turnMove(hmove)
    rescue InvalidMove
      raise InvalidHumanMove, hmove.to_s
    rescue InvalidSquare
      raise InvalidHumanMove, hmove.to_s
    end
  end

  def turnMove(move)
      move(move, @board, @sideOnMove)
      @moveCounter += 1
      @sideOnMove == 'W' ? @sideOnMove = 'B' : @sideOnMove = 'W'
  end

  def move(m, board, sideOnMove)
    begin
      if isPiece?(board, m.fromSquare) and (getColor(board, m.fromSquare.x, m.fromSquare.y) == sideOnMove)

        moves = []
        moveList(m.fromSquare.x, m.fromSquare.y, board).flatten.each do |m|
          moves << m.to_s
        end

        if not moves.include?(m.to_s)
          raise InvalidMove, "Error: Not a valid move x, y is fromSquare: #{m.fromSquare.x} #{m.fromSquare.y}, toSquare is #{m.toSquare.x} #{m.toSquare.y}"
        else
          updateBoard(m, board)
        end
      end
    rescue InvalidPiece => e
        raise InvalidMove, e.message
    end
  end

  def updateBoard(m, board)
    # move piece to toSquare
    board[m.toSquare.y][m.toSquare.x] = board[m.fromSquare.y][m.fromSquare.x]
    # set from square to empty
    board[m.fromSquare.y][m.fromSquare.x] = '.'

    # if piece is pawn and reaches the end of the board, then its becomes a queen
    if board[m.toSquare.y][m.toSquare.x].upcase == 'P'
      if m.toSquare.y == 5 and getColor(board, m.toSquare.x, m.toSquare.y) == 'B'
        board[m.toSquare.y][m.toSquare.x] = 'q'
      end
      if m.toSquare.y == 0 and getColor(board, m.toSquare.x, m.toSquare.y) == 'W'
        board[m.toSquare.y][m.toSquare.x] = 'Q'
      end
    end

  end

  def moveScan(x0, y0, dx, dy, capture, stop_short, board)
    x = x0
    y = y0
    c = getColor(board, x0,y0)
    moves = []

    loop do
      x += dx
      y += dy
      break if not inBounds?(x,y)

      if isOccupied?(board[y][x])
        break if getColor(board, x,y) == c
        break if not capture
        stop_short = true
      end

      validMove = Move.new(Square.new(x0,y0), Square.new(x,y))
      moves << validMove
      break if stop_short == true
    end

    return moves
  end

  def getLegalMoves(board, color)
    moves = []
    getPiecesForSide(board, color).each do |piece|
      moves << moveList(piece.x, piece.y, board).flatten
    end
    return moves.flatten
  end

  def getColor(board, x, y)
    if board[y][x].to_s.upcase == board[y][x]
      return "W"
    else
      return "B"
    end
  end

  def isPiece?(board, square)
    return ['Q','K','R','N','B','P'].include?(board[square.y][square.x].upcase)
  end

  def isCapture?(move, board)
    if board[move.toSquare.y][move.toSquare.x] == '.'
      return false
    else
      return board[move.fromSquare.y][move.fromSquare.x].to_s != board[move.toSquare.y][move.toSquare.x].to_s
    end
  end

  def isOccupied?(value)
    return value != '.'
  end

  def inBounds?(x,y)
    return (x < 5 and x > -1 and y < 6 and y > -1)
  end

  def moveList(x,y, board)

    # To list the moves of a piece at x, y:
    p = board[y][x]
    moves = []

    case p
      when 'Q', 'K', 'q', 'k'
        (-1..1).each do |dx|
          (-1..1).each do |dy|
            if dx == 0 and dy == 0
                next
            end
            stop_short = (p == 'K' or p == 'k')
            moves << moveScan(x, y, dx, dy, capture=true, stop_short, board)
          end
        end
        return moves
      when 'R', 'r'
        dx = 1
        dy = 0
        stop_short = false
        capture = true
        for i in 1..4
          moves << moveScan(x, y, dx, dy, capture, stop_short, board)
          dx,dy = -dy,dx
        end
        return moves
      when 'B', 'b'
        dx = 1
        dy = 0
        stop_short = true
        capture = false
        for i in 1..4
          moves << moveScan(x, y, dx, dy, capture, stop_short, board)
          dx,dy = -dy,dx
        end
        dx = 1
        dy = 1
        stop_short = false
        capture = true
        for i in 1..4
            moves << moveScan(x, y, dx, dy, capture, stop_short, board)
            dx,dy = -dy,dx
        end
        return moves
      when 'N', 'n'
        dx = 1
        dy = 2
        stop_short = true
        capture = true
        for i in 1..4
            moves << moveScan(x, y, dx, dy, capture, stop_short, board)
            dx,dy = -dy,dx
        end
        dx = -1
        dy = 2
        for i in 1..4
            moves << moveScan(x, y, dx, dy, capture, stop_short, board)
            dx,dy = -dy,dx
        end
        return moves
      when 'P', 'p'

        # inverse the direction of black pawns
        dir = (getColor(board, x,y) == 'B') ? 1 : -1

        stop_short = true

        # West
        m = moveScan(x, y, -1, dir, true, stop_short, board)
        # check if I can capture diag (NW or SW)
        if m.size == 1 and isCapture?(m[0], board)
            moves << m
        end
        # East
        m = moveScan(x, y, 1, dir, true, stop_short, board)
        # check if I can capture diag ( NE or SE)
        if m.size == 1 and isCapture?(m[0], board)
            moves << m
        end
        moves << moveScan(x, y, 0, dir, false, stop_short, board)
        return moves

      else
        raise InvalidPiece, "Error: moveList called on invalid piece '#{p}' with coordinates x: #{x} y: #{y}"
      end
    end

  def getChessSquare(square)
    row = ['a','b','c','d','e']
    x = row.index(square[0].chr)
    y = [6, 5, 4, 3, 2, 1, 0][square[1].chr.to_i]
    return Square.new(x,y)
  end
end


text:
package com.evolveum.midpoint.schema;

import static com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext;
import static org.testng.AssertJUnit.assertNull;
import static org.testng.AssertJUnit.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;
import static com.evolveum.midpoint.schema.TestConstants.*;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.prism.*;

import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.xnode.*;
import com.evolveum.prism.xml.ns._public.types_3.ItemPathType;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;

import com.evolveum.midpoint.prism.polystring.PolyString;
import com.evolveum.midpoint.prism.util.PrismAsserts;
import com.evolveum.midpoint.prism.util.PrismTestUtil;
import com.evolveum.midpoint.schema.constants.MidPointConstants;
import com.evolveum.midpoint.schema.util.SchemaTestConstants;
import com.evolveum.midpoint.schema.util.SchemaTestUtil;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.PrettyPrinter;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CachingMetadataType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ExtensionType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.GenericObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.XmlSchemaType;
import com.evolveum.prism.xml.ns._public.query_3.SearchFilterType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
import com.evolveum.prism.xml.ns._public.types_3.SchemaDefinitionType;

/**
 * @author semancik
 *
 */
public class TestJaxbConstruction {

    private static final String FAUX_RESOURCE_OID = "fuuuuuuuuuuu";
    private static final String ACCOUNT_NAME = "jack";

    @BeforeSuite
    public void setup() throws SchemaException, SAXException, IOException {
        PrettyPrinter.setDefaultNamespacePrefix(MidPointConstants.NS_MIDPOINT_PUBLIC_PREFIX);
        PrismTestUtil.resetPrismContext(MidPointPrismContextFactory.FACTORY);
    }

    @Test
    public void testUserConstruction() throws JAXBException, SchemaException {
        System.out.println("\n\n ===[ testUserConstruction ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        UserType userType = new UserType();
        prismContext.adopt(userType);

        PrismObject<UserType> user = userType.asPrismObject();
        assertNotNull("No object definition after adopt", user.getDefinition());
        SchemaTestUtil.assertUserDefinition(user.getDefinition());

        // fullName: PolyString
        userType.setFullName(new PolyStringType("Čučoriedka"));
        PrismProperty<PolyString> fullNameProperty = user.findProperty(UserType.F_FULL_NAME);
        PolyString fullName = fullNameProperty.getRealValue();
        assertEquals("Wrong fullName orig", "Čučoriedka", fullName.getOrig());
        assertEquals("Wrong fullName norm", "cucoriedka", fullName.getNorm());

        // description: setting null value
        userType.setDescription(null);
        PrismProperty<String> descriptionProperty = user.findProperty(UserType.F_DESCRIPTION);
        assertNull("Unexpected description property "+descriptionProperty, descriptionProperty);

        // description: setting null value
        userType.setDescription("blah blah");
        descriptionProperty = user.findProperty(UserType.F_DESCRIPTION);
        assertEquals("Wrong description value", "blah blah", descriptionProperty.getRealValue());

        // description: resetting null value
        userType.setDescription(null);
        descriptionProperty = user.findProperty(UserType.F_DESCRIPTION);
        assertNull("Unexpected description property (after reset) "+descriptionProperty, descriptionProperty);

        // Extension
        ExtensionType extension = new ExtensionType();
        userType.setExtension(extension);

        user.checkConsistence();

        PrismContainer<Containerable> extensionContainer = user.findContainer(GenericObjectType.F_EXTENSION);
        checkExtension(extensionContainer,"user extension after setExtension");
        checkExtension(extension,"user extension after setExtension");

        AssignmentType assignmentType = new AssignmentType();
        userType.getAssignment().add(assignmentType);

        user.checkConsistence();
        user.assertDefinitions();

        // Assignment
        ExtensionType assignmentExtension = new ExtensionType();
        assignmentType.setExtension(assignmentExtension);

        user.assertDefinitions();
        user.checkConsistence();
        checkExtension(assignmentExtension,"assignment extension after setExtension");
        user.checkConsistence();
        user.assertDefinitions();

        // accountRef/account
        ObjectReferenceType accountRefType = new ObjectReferenceType();
        accountRefType.setOid(USER_ACCOUNT_REF_1_OID);
        MapXNode filterElement = createFilter();
        SearchFilterType filter = new SearchFilterType();
        filter.setFilterClauseXNode(filterElement);
        accountRefType.setFilter(filter);
        userType.getLinkRef().add(accountRefType);

        assertAccountRefs(userType, USER_ACCOUNT_REF_1_OID);
        user.checkConsistence();
        user.assertDefinitions();

        PrismReference accountRef = user.findReference(UserType.F_LINK_REF);
        assertEquals("1/ Wrong accountRef values", 1, accountRef.getValues().size());
        PrismReferenceValue accountRefVal0 = accountRef.getAnyValue();
        SearchFilterType prismFilter = accountRefVal0.getFilter();
        assertNotNull("Filter have not passed", prismFilter);
        //assertTrue("Bad filter in reference", prismFilter instanceof EqualsFilter);
//        assertEquals("Difference filter", filterElement, prismFilter);

        ShadowType accountShadowType = new ShadowType();
        prismContext.adopt(accountShadowType);
        accountShadowType.setOid(USER_ACCOUNT_REF_1_OID);
        ObjectReferenceType accountRef1 = new ObjectReferenceType();
        accountRef1.asReferenceValue().setObject(accountShadowType.asPrismObject());
        userType.getLinkRef().add(accountRef1);
        //value still should be only one... (reference was only resolved)
        assertEquals("2/ Wrong accountRef values", 1, user.findReference(UserType.F_LINK_REF).getValues().size());

        ObjectReferenceType accountRef2 = new ObjectReferenceType();
        accountRef2.setOid(USER_ACCOUNT_REF_2_OID);
        userType.getLinkRef().add(accountRef2);

        assertEquals("3/ Wrong accountRef values", 2, user.findReference(UserType.F_LINK_REF).getValues().size());

        assertAccountRefs(userType, USER_ACCOUNT_REF_1_OID, USER_ACCOUNT_REF_2_OID);
        user.checkConsistence();
        user.assertDefinitions();

        assertEquals("4/ Wrong accountRef values", 2, accountRef.getValues().size());
        PrismAsserts.assertReferenceValues(accountRef, USER_ACCOUNT_REF_1_OID, USER_ACCOUNT_REF_2_OID);

    }

    @Test
    public void testUserConstructionBeforeAdopt() throws Exception {
        System.out.println("\n\n ===[ testUserConstructionBeforeAdopt ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        UserType userType = new UserType();

        userType.setFullName(new PolyStringType("Čučoriedka"));
        userType.setDescription("blah blah");
        ExtensionType extension = new ExtensionType();
        userType.setExtension(extension);

        AssignmentType assignmentType = new AssignmentType();
        userType.getAssignment().add(assignmentType);

        // Assignment
        ExtensionType assignmentExtension = new ExtensionType();
        assignmentType.setExtension(assignmentExtension);

        // accountRef/account
        ObjectReferenceType accountRefType = new ObjectReferenceType();
        accountRefType.setOid(USER_ACCOUNT_REF_1_OID);

        MapXNode filterElement = createFilter();
        SearchFilterType filter = new SearchFilterType();
        filter.setFilterClauseXNode(filterElement);
        accountRefType.setFilter(filter);
        userType.getLinkRef().add(accountRefType);

        ShadowType accountShadowType = new ShadowType();
        prismContext.adopt(accountShadowType);
        accountShadowType.setOid(USER_ACCOUNT_REF_1_OID);
        ObjectReferenceType accountRef1 = new ObjectReferenceType();
        accountRef1.asReferenceValue().setObject(accountShadowType.asPrismObject());
        userType.getLinkRef().add(accountRef1);

        ObjectReferenceType accountRef2 = new ObjectReferenceType();
        accountRef2.setOid(USER_ACCOUNT_REF_2_OID);
        userType.getLinkRef().add(accountRef2);

        // WHEN
        prismContext.adopt(userType);

        // THEN
        PrismObject<UserType> user = userType.asPrismObject();
        assertNotNull("No object definition after adopt", user.getDefinition());
        SchemaTestUtil.assertUserDefinition(user.getDefinition());

        // fullName: PolyString
        PrismProperty<PolyString> fullNameProperty = user.findProperty(UserType.F_FULL_NAME);
        user.checkConsistence();
        user.assertDefinitions();

        PolyString fullName = fullNameProperty.getRealValue();
        assertEquals("Wrong fullName orig", "Čučoriedka", fullName.getOrig());
        assertEquals("Wrong fullName norm", "cucoriedka", fullName.getNorm());

        PrismProperty<String> descriptionProperty = user.findProperty(UserType.F_DESCRIPTION);
        assertEquals("Wrong description value", "blah blah", descriptionProperty.getRealValue());

        PrismContainer<Containerable> extensionContainer = user.findContainer(GenericObjectType.F_EXTENSION);
        checkExtension(extensionContainer,"user extension");
        checkExtension(extension,"user extension");

        PrismReference accountRef = user.findReference(UserType.F_LINK_REF);
        assertEquals("Wrong accountRef values", 2, accountRef.getValues().size());
        PrismAsserts.assertReferenceValues(accountRef, USER_ACCOUNT_REF_1_OID, USER_ACCOUNT_REF_2_OID);

        PrismReferenceValue accountRefVal0 = accountRef.getAnyValue();
        SearchFilterType prismFilter = accountRefVal0.getFilter();
        assertNotNull("Filter have not passed", prismFilter);
        // assertTrue("Wrong filter in reference " , prismFilter instanceof EqualsFilter);
//        assertEquals("Difference filter", filterElement, prismFilter);

        assertAccountRefs(userType, USER_ACCOUNT_REF_1_OID, USER_ACCOUNT_REF_2_OID);

        user.assertDefinitions();
        user.checkConsistence();

    }

    private void assertAccountRefs(UserType userType, String... accountOids) {
        List<ObjectReferenceType> accountRefs = userType.getLinkRef();
        assertEquals("Wrong number of accountRefs", accountOids.length, accountRefs.size());
        for (String expectedAccountOid: accountOids) {
            assertAccountRef(accountRefs, expectedAccountOid);
        }
    }

    private void assertAccountRef(List<ObjectReferenceType> accountRefs, String expectedAccountOid) {
        for (ObjectReferenceType accountRef: accountRefs) {
            if (accountRef.getOid().equals(expectedAccountOid)) {
                return;
            }
        }
        AssertJUnit.fail("acountRef for oid "+expectedAccountOid+" was not found");
    }

    /**
     * Similar to testUserConstruction, but some operations are done in a different order
     * e.g. assignment is filled in first then set to the user.
     */
    @Test
    public void testUserConstructionReverse() throws JAXBException, SchemaException {
        System.out.println("\n\n ===[ testUserConstructionReverse ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        UserType userType = new UserType(prismContext);

        PrismObject<UserType> user = userType.asPrismObject();
        assertNotNull("No object definition after adopt", user.getDefinition());

        // Extension
        ExtensionType extension = new ExtensionType();
        userType.setExtension(extension);

        user.checkConsistence();

        PrismContainer<Containerable> extensionContainer = user.findContainer(GenericObjectType.F_EXTENSION);
        checkExtension(extensionContainer,"user extension after setExtension");
        checkExtension(extension,"user extension after setExtension");

        AssignmentType assignmentType = new AssignmentType(prismContext);

        ExtensionType assignmentExtension = new ExtensionType();
        assignmentType.setExtension(assignmentExtension);

        PrismContainerValue<ExtensionType> assignmentExtensionValueFromJaxb = assignmentExtension.asPrismContainerValue();
        PrismProperty<Integer> intProperty = assignmentExtensionValueFromJaxb.findOrCreateProperty(EXTENSION_INT_TYPE_ELEMENT);
        intProperty.setRealValue(15);

        PrismProperty<String> stringProperty = assignmentExtensionValueFromJaxb.findOrCreateItem(EXTENSION_STRING_TYPE_ELEMENT, PrismProperty.class);
        stringProperty.setRealValue("fifteen men on a dead man chest");

        // Adding assignemnt to the user should cause application of definitions
        userType.getAssignment().add(assignmentType);

        PrismAsserts.assertDefinition(assignmentType.asPrismContainerValue().getParent().getDefinition(),
                UserType.F_ASSIGNMENT, AssignmentType.COMPLEX_TYPE, 0, -1);
        PrismAsserts.assertDefinition(assignmentExtensionValueFromJaxb.getParent().getDefinition(),
                AssignmentType.F_EXTENSION, ExtensionType.COMPLEX_TYPE, 0, 1);
        assertTrue("assignment extension definition is not runtime", assignmentExtensionValueFromJaxb.getParent().getDefinition().isRuntimeSchema());
        assertTrue("assignment extension definition is not dynamic", assignmentExtensionValueFromJaxb.getParent().getDefinition().isDynamic());
        PrismAsserts.assertDefinition(intProperty.getDefinition(), EXTENSION_INT_TYPE_ELEMENT, DOMUtil.XSD_INT, 0, -1);
        PrismAsserts.assertDefinition(stringProperty.getDefinition(), EXTENSION_STRING_TYPE_ELEMENT, DOMUtil.XSD_STRING, 0, -1);

        user.assertDefinitions();
        user.checkConsistence();
    }

    @Test
    public void testGenericConstruction() throws JAXBException, SchemaException {
        System.out.println("\n\n ===[ testGenericConstruction ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        GenericObjectType genericType = new GenericObjectType();
        prismContext.adopt(genericType);

        PrismObject<GenericObjectType> generic = genericType.asPrismObject();
        assertNotNull("No object definition after adopt", generic.getDefinition());

        // WHEN
        ExtensionType extension = new ExtensionType();
        genericType.setExtension(extension);

        // THEN
        generic.checkConsistence();

        PrismContainer<Containerable> extensionContainer = generic.findContainer(GenericObjectType.F_EXTENSION);
        checkExtension(extensionContainer,"user extension after setExtension");
        checkExtension(extension,"user extension after setExtension");

        generic.checkConsistence();
    }

    @Test
    public void testAccountConstruction() throws JAXBException, SchemaException {
        System.out.println("\n\n ===[ testAccountConstruction ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        ShadowType accountType = new ShadowType();
        prismContext.adopt(accountType);

        PrismObject<ShadowType> account = accountType.asPrismObject();
        assertNotNull("No object definition after adopt", account.getDefinition());

        // WHEN
        accountType.setName(PrismTestUtil.createPolyStringType(ACCOUNT_NAME));
        ObjectReferenceType resourceRefType = new ObjectReferenceType();
        resourceRefType.setOid(FAUX_RESOURCE_OID);
        resourceRefType.setType(ResourceType.COMPLEX_TYPE);
        accountType.setResourceRef(resourceRefType);

        // THEN (prism)
        account.checkConsistence();
        PrismAsserts.assertPropertyValue(account, ShadowType.F_NAME, PrismTestUtil.createPolyString(ACCOUNT_NAME));
        PrismReference resourceRef = account.findReference(ShadowType.F_RESOURCE_REF);
        assertNotNull("No resourceRef", resourceRef);
        PrismReferenceValue resourceRefVal = resourceRef.getValue();
        assertNotNull("No resourceRef value", resourceRefVal);
        assertEquals("Wrong OID in resourceRef value", FAUX_RESOURCE_OID, resourceRefVal.getOid());
        assertEquals("Wrong type in resourceRef value", ResourceType.COMPLEX_TYPE, resourceRefVal.getTargetType());
//        Element filter = resourceRefVal.getFilter();
//        assertNotNull("No filter in resourceRef value", filter);

        // THEN (JAXB)
        assertEquals("Wrong name (JAXB)", PrismTestUtil.createPolyStringType(ACCOUNT_NAME), accountType.getName());
        resourceRefType = accountType.getResourceRef();
        assertNotNull("No resourceRef (JAXB)", resourceRefType);
        assertEquals("Wrong OID in resourceRef (JAXB)", FAUX_RESOURCE_OID, resourceRefType.getOid());
        assertEquals("Wrong type in resourceRef (JAXB)", ResourceType.COMPLEX_TYPE, resourceRefType.getType());
//        Filter filter = connectorRef.getFilter();
//        assertNotNull("No filter in connectorRef value (JAXB)", filter);
//        Element filterElement = filter.getFilter();
//        assertNotNull("No filter element in connectorRef value (JAXB)", filterElement);

    }

    @Test
    public void testExtensionTypeConstruction() throws Exception {
        System.out.println("\n\n ===[ testExtensionTypeConstruction ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        GenericObjectType object = new GenericObjectType();
        prismContext.adopt(object.asPrismObject(), GenericObjectType.class);

        ExtensionType extension = new ExtensionType();
        object.setExtension(extension);

        PrismContainerValue extValue = extension.asPrismContainerValue();
        assertNotNull("No extension definition", extValue.getParent().getDefinition());

        // WHEN
        Item item = extValue.findOrCreateItem(SchemaTestConstants.EXTENSION_STRING_TYPE_ELEMENT);

        // THEN
        assertNotNull(item);
        object.asPrismObject().checkConsistence();
    }

    @Test
    public void testResourceConstruction() throws Exception {
        System.out.println("\n\n ===[ testResourceConstruction ]===\n");

        // GIVEN
        PrismContext prismContext = PrismTestUtil.getPrismContext();

        ResourceType resourceType = new ResourceType();
        prismContext.adopt(resourceType);

        PrismObject<ResourceType> resource = resourceType.asPrismObject();
        assertNotNull("No object definition after adopt", resource.getDefinition());

        // name: PolyString
        resourceType.setName(new PolyStringType("Môj risórs"));
        PrismProperty<PolyString> fullNameProperty = resource.findProperty(ResourceType.F_NAME);
        PolyString fullName = fullNameProperty.getRealValue();
        assertEquals("Wrong name orig", "Môj risórs", fullName.getOrig());
        assertEquals("Wrong name norm", "moj risors", fullName.getNorm());

        // description: setting null value
        resourceType.setDescription(null);
        PrismProperty<String> descriptionProperty = resource.findProperty(UserType.F_DESCRIPTION);
        assertNull("Unexpected description property "+descriptionProperty, descriptionProperty);

        // description: setting null value
        resourceType.setDescription("blah blah");
        descriptionProperty = resource.findProperty(UserType.F_DESCRIPTION);
        assertEquals("Wrong description value", "blah blah", descriptionProperty.getRealValue());

        // description: resetting null value
        resourceType.setDescription(null);
        descriptionProperty = resource.findProperty(UserType.F_DESCRIPTION);
        assertNull("Unexpected description property (after reset) "+descriptionProperty, descriptionProperty);

        // Extension
        ExtensionType extension = new ExtensionType();
        resourceType.setExtension(extension);

        resource.checkConsistence();

        PrismContainer<Containerable> extensionContainer = resource.findContainer(GenericObjectType.F_EXTENSION);
        checkExtension(extensionContainer,"resource extension after setExtension");
        checkExtension(extension,"resource extension after setExtension");

        // Schema
        XmlSchemaType xmlSchemaType = new XmlSchemaType();
        CachingMetadataType cachingMetadata = new CachingMetadataType();
        cachingMetadata.setSerialNumber("serial123");
        xmlSchemaType.setCachingMetadata(cachingMetadata);

        resourceType.setSchema(xmlSchemaType);

        SchemaDefinitionType schemaDefinition = new SchemaDefinitionType();
        Element xsdSchemaElement = DOMUtil.createElement(DOMUtil.XSD_SCHEMA_ELEMENT);
        schemaDefinition.getAny().add(xsdSchemaElement);
        xmlSchemaType.setDefinition(schemaDefinition);

        PrismContainer<Containerable> schemaContainer = resource.findContainer(ResourceType.F_SCHEMA);
        assertNotNull("No schema container", schemaContainer);

        // TODO

        // Schema: null
        resourceType.setSchema(null);
        schemaContainer = resource.findContainer(ResourceType.F_SCHEMA);
        assertNull("Unexpected schema container", schemaContainer);

    }

    private void checkExtension(PrismContainer<Containerable> extensionContainer, String sourceDescription) {
        assertNotNull("No extension container in "+sourceDescription+" (prism)", extensionContainer);
        assertNotNull("No extension definition in "+sourceDescription+" (prism)", extensionContainer.getDefinition());
        assertTrue("Not runtime in definition in "+sourceDescription+" (prism)", extensionContainer.getDefinition().isRuntimeSchema());
    }

    private void checkExtension(ExtensionType extension, String sourceDescription) throws SchemaException {
        PrismContainerValue<ExtensionType> extensionValueFromJaxb = extension.asPrismContainerValue();
        assertNotNull("No extension container in "+sourceDescription+" (jaxb)", extensionValueFromJaxb);
        assertNotNull("No extension definition in "+sourceDescription+" (jaxb)", extensionValueFromJaxb.getParent().getDefinition());
        assertTrue("Not runtime in definition in "+sourceDescription+" (jaxb)", extensionValueFromJaxb.getParent().getDefinition().isRuntimeSchema());

        PrismProperty<Integer> intProperty = extensionValueFromJaxb.findOrCreateProperty(EXTENSION_INT_TYPE_ELEMENT);
        PrismAsserts.assertDefinition(intProperty.getDefinition(), EXTENSION_INT_TYPE_ELEMENT, DOMUtil.XSD_INT, 0, -1);
        intProperty.setRealValue(15);

        PrismProperty<String> stringProperty = extensionValueFromJaxb.findOrCreateItem(EXTENSION_STRING_TYPE_ELEMENT, PrismProperty.class);
        PrismAsserts.assertDefinition(stringProperty.getDefinition(), EXTENSION_STRING_TYPE_ELEMENT, DOMUtil.XSD_STRING, 0, -1);
        stringProperty.setRealValue("fifteen men on a dead man chest");
    }

    private MapXNode createFilter() {
        XNodeFactory factory = getPrismContext().xnodeFactory();

        Map<QName, XNode> equalsElementSource = new HashMap<>();
        PrimitiveXNode<ItemPathType> pathElement = factory.primitive(new ItemPathType(new ItemName("name")));
        equalsElementSource.put(new QName(SchemaConstantsGenerated.NS_QUERY, "path"), pathElement);
        PrimitiveXNode<String> valueElement = factory.primitive("čučoriedka");
        equalsElementSource.put(new QName(SchemaConstantsGenerated.NS_QUERY, "value"), valueElement);
        MapXNode equalsElement = factory.map(equalsElementSource);

        return factory.map(new QName(SchemaConstantsGenerated.NS_QUERY, "equal"), equalsElement);
    }

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <base href="/">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Oppia : A tool for creating interactive tutors">

    <link rel="stylesheet" type="text/css" media="screen" href="static/css/stylesheet.css">

    <title ng-bind="$root.title"></title>

          View on GitHub

          Oppia

          Published with GitHub Pages


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout ="vertical" ="fill_parent" ="fill_parent"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <com.quizup.lib.widgets.buttons.MessageItemButton ="@id/message_item" ="fill_parent" ="wrap_content" />
    <ImageView ="@id/message_shadow" ="@drawable/bottom_shadow" ="fill_parent" ="@dimen/card_bottom_shadow_height" ="@string/shadow_desc" />
</LinearLayout>


text:
logi_fluentd
============

A [logi](https://github.com/sile) implementation library for [fluentd](http://www.fluentd.org/)

Build
-----

The build tool is [rebar3](https://github.com/erlang/rebar3).

Add following code to your `rebar.config` and `.app.src` file:
```erlang
%% In rebar.config
{deps,
 [
   {logi_fluentd, {git, "https://github.com/sile/logi_fluentd.git", {tag, "0.1.0"}}}
 ]}.

%% In src/${YOUR_APP}.app.src
{application, ${YOUR_APP},
  [
    {applications,
      [
        %% other dependencies
        logi_fluentd
      ]}
  ]}.
```

API
---

See [EDoc Documents](doc/README.md)

Example
-------

Add following lines to your td-agent.conf and start td-agent (fluentd):

```
<source>
  tag default
  type tcp
  format json
  port 9880
  time_key timestamp
</source>
```

```erlang
$ rebar3 shell
> Sink = logi_fluentd_sink_tcp:new(sample_sink, "localhost", [{port, 9880}]).
> {ok, _} = logi_channel:install_sink(Sink, info).
> logi:info("Hello World!").
```

License
-------

This library is released under the MIT License.

See the [LICENSE](LICENSE) file for full license information.


text:
namespace etexpacker
{

MeshToolbarPage::MeshToolbarPage(wxWindow* parent, StagePanel* stage)
	: wxPanel(parent)
	, m_stage(stage)
{
	InitLayout();
}

void MeshToolbarPage::InitLayout()
{
	wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	// dir
	{
		wxStaticBox* bounding = new wxStaticBox(this, wxID_ANY, wxT("src dir"));
		wxSizer* sz = new wxStaticBoxSizer(bounding, wxHORIZONTAL);

		m_src_dir = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), wxTE_READONLY);
		sz->Add(m_src_dir);

		sz->AddSpacer(5);

		wxButton* btn = new wxButton(this, wxID_ANY, wxT("..."), wxDefaultPosition, wxSize(25, 25));
		Connect(btn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MeshToolbarPage::OnSetSrcDir));
		sz->Add(btn);

		sizer->Add(sz);
	}
	sizer->AddSpacer(10);
	// save
	{
		wxButton* btn = new wxButton(this, wxID_ANY, wxT("save physics"));
		Connect(btn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MeshToolbarPage::OnSaveToFile));
		sizer->Add(btn);
	}
	sizer->AddSpacer(10);
	// output image
	{
		wxButton* btn = new wxButton(this, wxID_ANY, wxT("save image ..."));
		Connect(btn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MeshToolbarPage::OnSaveImage));
		sizer->Add(btn);
	}
	SetSizer(sizer);
}

void MeshToolbarPage::OnSetSrcDir(wxCommandEvent& event)
{
 	auto op = std::dynamic_pointer_cast<ee::ZoomViewOP>(m_stage->GetEditOP());
 	op->SetMouseMoveFocus(false);

	wxDirDialog dlg(NULL, "Src Dir", wxEmptyString, wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST);
	if (dlg.ShowModal() == wxID_OK) {
		std::string dir = dlg.GetPath();
		LoadBodies(dir);
		m_src_dir->SetValue(dir);
	}

	op->SetMouseMoveFocus(true);
}

void MeshToolbarPage::OnSaveToFile(wxCommandEvent& event)
{
	Json::Value value;

	b2Body* b = m_stage->getWorld()->GetBodyList();
	int idx = 0;
	while (b != NULL) {
		char* filepath = static_cast<char*>(b->GetUserData());
		if (filepath) {
			Json::Value item_val;
			item_val["filepath"] = filepath;
			item_val["pos"]["x"] = (b->GetPosition().x + HALF_WIDTH) * ee::BOX2D_SCALE_FACTOR;
			item_val["pos"]["y"] = (b->GetPosition().y + HALF_H_EIGHT) * ee::BOX2D_SCALE_FACTOR;
			item_val["angle"] = b->GetAngle();
			value[idx++] = item_val;
		}
		b = b->GetNext();
	}

	std::string filepath = m_src_dir->GetValue() + "//position.json";
	Json::StyledStreamWriter writer;
	std::locale::global(std::locale(""));
	std::ofstream fout(filepath.c_str());
	std::locale::global(std::locale("C"));
	writer.write(fout, value);
	fout.close();
}

void MeshToolbarPage::OnSaveImage(wxCommandEvent& event)
{
	wxFileDialog dlg(this, wxT("Open Physics Result"), wxEmptyString, wxEmptyString, "*.json", wxFD_OPEN);
	if (dlg.ShowModal() == wxID_OK) {
		std::string physics_filepath = dlg.GetPath();

		Json::Value value;
		Json::Reader reader;
		std::locale::global(std::locale(""));
		std::ifstream fin(physics_filepath.c_str());
		std::locale::global(std::locale("C"));
		reader.parse(fin, value);
		fin.close();

		const int width = 1024,
			      height = 2048;
		s2::DrawRT rt(width, height);
		int i = 0;
		Json::Value item_val = value[i++];

		while (!item_val.isNull()) {
			std::string filepath = item_val["filepath"].asString();
			auto sym = ee::SymbolMgr::Instance()->FetchSymbol(filepath);
			auto spr = ee::SpriteFactory::Instance()->Create(sym);

			sm::vec2 pos;
			pos.x = item_val["pos"]["x"].asDouble() - width * 0.5f;
			pos.y = item_val["pos"]["y"].asDouble() - height * 0.5f;
			spr->SetPosition(pos);
			float angle = item_val["angle"].asDouble();
			spr->SetAngle(angle);
			rt.Draw(*spr);

			item_val = value[i++];
		}

		std::string outpath = ee::FileHelper::GetFileDir(physics_filepath) + "\\image.png";
		rt.StoreToFile(outpath, width, height);
	}
}

void MeshToolbarPage::LoadBodies(const std::string& dir)
{
	b2BodyDef bd;
	bd.type = b2_dynamicBody;
 	bd.linearDamping = 0;
 	bd.angularDamping = 0;
	bd.allowSleep = true;
	bd.bullet = false;
	bd.active = true;
	bd.gravityScale = 1;

	b2FixtureDef fd;
 	fd.density = 1;
 	fd.friction = 0.2f;
 	fd.restitution = 0;
 	fd.isSensor = false;
 	fd.filter.categoryBits = 1;
 	fd.filter.maskBits = 0xffff;
 	fd.filter.groupIndex = 0;

	wxArrayString files;
	ee::FileHelper::FetchAllFiles(dir, files);
	for (int i = 0, n = files.size(); i < n; ++i)
	{
		std::string filepath = ee::FileHelper::GetAbsolutePath(files[i].ToStdString());
		if (ee::SymbolFile::Instance()->Type(filepath) != s2::SYM_SHAPE) {
			continue;
		}

		std::vector<ee::Shape*> shapes;
		std::string bg_filepath;
		eshape::FileIO::LoadFromFile(filepath.c_str(), shapes, bg_filepath);
		for (int i = 0, n = shapes.size(); i < n; ++i)
		{
			eshape::PolygonShape* polygon = dynamic_cast<eshape::PolygonShape*>(shapes[i]);
			if (!polygon) {
				continue;
			}

			b2Body* body = m_stage->getWorld()->CreateBody(&bd);

			b2Vec2 pos(ee::Random::GetNum(-HALF_WIDTH*4, HALF_WIDTH*4), ee::Random::GetNum(HALF_WIDTH*5, HALF_WIDTH*100));
			body->SetTransform(pos, 0);

			const std::vector<sm::vec2>& src = polygon->GetVertices();
			for (int i = 0, n = src.size(); i < n; i += 3) {
				b2Vec2 dst[3];
				for (int j = 0; j < 3; ++j) {
					dst[j].x = src[i+j].x / ee::BOX2D_SCALE_FACTOR;
					dst[j].y = src[i+j].y / ee::BOX2D_SCALE_FACTOR;
				}

				b2PolygonShape shape;
				shape.Set(&dst[0], 3);
				fd.shape = &shape;

				body->CreateFixture(&fd);
			}

			char* buf = new char[bg_filepath.size() + 1];
			int len = bg_filepath.copy(buf, bg_filepath.size(), 0);
			buf[len] = '\0';
			body->SetUserData(buf);
		}
	}
}

}


text:
var TreeFace = function(objectId, className){
	this.objectId = objectId;
	this.className = className;
	this.objectDivId = mw3._getObjectDivId(this.objectId);
	this.objectDiv = $('#' + this.objectDivId);

	this.object = mw3.objects[this.objectId];

	if(this.object == null)
		return true;

	if('java.util.List' != this.objectDiv.parent().attr('classname'))
		this.objectDiv.addClass('filemgr-tree').addClass('filemgr-treeFocus')
}


text:
package org.apache.cordova.test;

public class HtmlNotFoundTest extends BaseCordovaIntegrationTest {
  private static final String START_URL = "file:///android_asset/www/htmlnotfound/index.html";

  protected void setUp() throws Exception {
    super.setUp();
    setUpWithStartUrl(START_URL);
  }
  public void testUrl() throws Throwable
  {
      assertEquals(START_URL, testActivity.onPageFinishedUrl.take());
      runTestOnUiThread(new Runnable() {
          public void run() {
              assertFalse(START_URL.equals(testActivity.getCordovaWebView().getUrl()));
          }
      });
  }
}


text:
// -----------------------------------------------------------------------
// <copyright file="SpellList.cs" company="Pathfinder-fr">
// Copyright (c) Pathfinder-fr. Tous droits reserves.
// </copyright>
// -----------------------------------------------------------------------

namespace PathfinderDb.Schema
{
    using System.Xml.Serialization;

    [XmlType("spellList")]
    public class SpellList
    {
        public string Id { get; set; }

        public class Ids
        {
            public const string AntiPaladin = "antipaladin";

            public const string Bard = "bard";

            public const string SorcererWizard = "sorcerer-wizard";

            public const string Ranger = "ranger";

            public const string Paladin = "paladin";

            public const string Druid = "druid";

            public const string Cleric = "cleric";

            public const string Inquisitor = "inquisitor";

            public const string Summoner = "summoner";

            public const string Oracle = "oracle";

            public const string Witch = "witch";

            public const string Alchemist = "alchemist";

            public const string Magus = "magus";

            public const string ElementalistWizard = "elementalistWizard";
        }
    }
}


text:
require 'spec_helper'

require 'rubocop'
require 'rubocop/rspec/support'

require_relative '../../../rubocop/cop/redirect_with_status'

describe RuboCop::Cop::RedirectWithStatus do
  include CopHelper

  subject(:cop) { described_class.new }
  let(:controller_fixture_without_status) do
    %q(
      class UserController < ApplicationController
        def show
          user = User.find(params[:id])
          redirect_to user_path if user.name == 'John Wick'
        end

        def destroy
          user = User.find(params[:id])

          if user.destroy
            redirect_to root_path
          else
            render :show
          end
        end
      end
    )
  end

  let(:controller_fixture_with_status) do
    %q(
      class UserController < ApplicationController
        def show
          user = User.find(params[:id])
          redirect_to user_path if user.name == 'John Wick'
        end

        def destroy
          user = User.find(params[:id])

          if user.destroy
            redirect_to root_path, status: 302
          else
            render :show
          end
        end
      end
    )
  end

  context 'in controller' do
    before do
      allow(cop).to receive(:in_controller?).and_return(true)
    end

    it 'registers an offense when a "destroy" action uses "redirect_to" without "status"' do
      inspect_source(cop, controller_fixture_without_status)

      aggregate_failures do
        expect(cop.offenses.size).to eq(1)
        expect(cop.offenses.map(&:line)).to eq([12]) # 'redirect_to' is located on 12th line in controller_fixture.
        expect(cop.highlights).to eq(['redirect_to'])
      end
    end

    it 'does not register an offense when a "destroy" action uses "redirect_to" with "status"' do
      inspect_source(cop, controller_fixture_with_status)

      aggregate_failures do
        expect(cop.offenses.size).to eq(0)
      end
    end
  end

  context 'outside of controller' do
    it 'registers no offense' do
      inspect_source(cop, controller_fixture_without_status)
      inspect_source(cop, controller_fixture_with_status)

      expect(cop.offenses.size).to eq(0)
    end
  end
end


text:
Miscellaneous raster-grid functions
-----------------------------------

  .. automodule:: landlab.grid.raster_funcs
    :members:
    :undoc-members:
    :show-inheritance:


text:
import Staircase from "../../lib/staircase.js";
import StepGroupSetter from "../../lib/stepGroupSetter.js";

describe("staircase.series(...steps)", () => {
	let staircase,
			parameters,
			steps;

	beforeEach(() => {
		parameters = [1, 2, 3];

		staircase = new Staircase(...parameters);

		steps = [
			(one, two, three, done) => done(),
			(one, two, three, done) => done(),
			(one, two, three, done) => done()
		];
	});

	it("should return a StepGroupSetter instance", () => {
		staircase
			.series(...steps)
				.should.be.instanceOf(StepGroupSetter);
	});

	it("should add the step functions to steps as a series", () => {
		staircase
			.series(...steps)
			.stepGroups()
				.should.eql([
					{ type: "series", steps: steps }
				]);
	});
});


text:
<?php

namespace CampaignChain\Channel\CitrixBundle\Controller;

use CampaignChain\CoreBundle\Entity\Location;
use CampaignChain\Location\CitrixBundle\Entity\CitrixUser;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Request;

class CitrixController extends Controller
{
    const RESOURCE_OWNER = 'Citrix';
    const LOCATION_BUNDLE = 'campaignchain/location-citrix';
    const LOCATION_MODULE = 'campaignchain-citrix-user';

    private $applicationInfo = array(
        'key_labels' => array('id', 'Consumer Key'),
        'secret_labels' => array('secret', 'Consumer Secret'),
        'config_url' => 'https://developer.citrixonline.com/user/me/apps',
        'parameters' => array(),
        'wrapper' => array(
            'class'=>'Hybrid_Providers_Citrix',
            'path' => 'vendor/campaignchain/channel-citrix/REST/CitrixOAuth.php'
        ),
    );

    public function createAction()
    {
        $oauthApp = $this->get('campaignchain.security.authentication.client.oauth.application');
        $application = $oauthApp->getApplication(self::RESOURCE_OWNER);

        if(!$application){
            return $oauthApp->newApplicationTpl(self::RESOURCE_OWNER, $this->applicationInfo);
        }
        else {
            return $this->render(
                'CampaignChainChannelCitrixBundle:Create:index.html.twig',
                array(
                    'page_title' => 'Connect with GoToWebinar',
                    'app_id' => $application->getKey(),
                )
            );
        }
    }

    public function loginAction(Request $request){
            $oauth = $this->get('campaignchain.security.authentication.client.oauth.authentication');
            $status = $oauth->authenticate(self::RESOURCE_OWNER, $this->applicationInfo);
            $profile = $oauth->getProfile();

            if($status){
                try {
                    $em = $this->getDoctrine()->getManager();
                    $em->getConnection()->beginTransaction();

                    $wizard = $this->get('campaignchain.core.channel.wizard');
                    $wizard->setName($profile->displayName);

                    // Get the location module.
                    $locationService = $this->get('campaignchain.core.location');
                    $locationModule = $locationService->getLocationModule(self::LOCATION_BUNDLE, self::LOCATION_MODULE);

                    $location = new Location();
                    $location->setIdentifier($profile->identifier);
                    $location->setName($profile->displayName);
                    $location->setLocationModule($locationModule);
                    $wizard->addLocation($location->getIdentifier(), $location);

                    $channel = $wizard->persist();
                    $wizard->end();

                    $oauth->setLocation($channel->getLocations()[0]);

                    $user = new CitrixUser();
                    $user->setLocation($channel->getLocations()[0]);
                    $user->setIdentifier($profile->identifier);
                    $user->setDisplayName($profile->displayName);
                    $user->setFirstName($profile->firstName);
                    $user->setLastName($profile->lastName);
                    $user->setEmail($profile->email);

                    $em->persist($user);
                    $em->flush();

                    $em->getConnection()->commit();

                    $this->get('session')->getFlashBag()->add(
                        'success',
                        'The Citrix location '.$profile->displayName.' was connected successfully.'
                    );
                } catch (\Exception $e) {
                    $em->getConnection()->rollback();
                    throw $e;
                }
            } else {
                $this->get('session')->getFlashBag()->add(
                    'warning',
                    'A location has already been connected for this Citrix account.'
                );
            }

        return $this->render(
            'CampaignChainChannelCitrixBundle:Create:login.html.twig',
            array(
                'redirect' => $this->generateUrl('campaignchain_core_location')
            )
        );
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Server.MessageClasses
{
    public class MsgUpload
    {

        public string type { get; set; }
        public string userName { get; set; }
        public string password { get; set; }
        public string nodeInfo { get; set; }
        public string filePathInSynFolder { get; set; }
        public DateTime fileTimeStamps { get; set; }
        public string fileHashValue { get; set; }
        public string fileName { get; set; }

        // for upload, deletion, or renaming
        public string addInfo { get; set; }

    }
}


text:
const chai = require('chai');
const assert = chai.assert;

var arrayContainsObject = require('../app/lib/collision/array-contains-object');

describe('ArrayContainsObject', function() {
  it('should return true if object is in array', function() {
    let obj1 = { test: 'test' };
    let array = [];
    array.push(obj1);

    assert.strictEqual(arrayContainsObject(obj1, array), true);
  });

  it('should return false if object is not in array', function() {
    let obj1 = { test: 'test' };
    let obj2 = { pizza: 'sausage' };
    let array = [];
    array.push(obj1);

    assert.strictEqual(arrayContainsObject(obj2, array), false);
  });
});


text:
<!DOCTYPE html>

    <title>Discursiva</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
    <link href="data/styles.css" type="text/css" rel="stylesheet"/>
    <link href="files/discursiva/styles.css" type="text/css" rel="stylesheet"/>

        <textarea id="u6_input"></textarea>

Adicionar uma questão Discursiva

        <input id="u9_input" type="text" value=""/>

Titulo da Questão

        <textarea id="u12_input"></textarea>

Resposta:


text:
import os
from flask import Flask, request, redirect, url_for
from werkzeug import secure_filename

UPLOAD_FOLDER = '/tmp/file'
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'}
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

#@app.route('/')
#def hello_world():
#    return 'Hello world'

def allowed_file(filename):
    return '.' in filename and \
            filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS

@app.route('/', methods=['GET', 'POST'])
def upload_file():
    if request.method == 'POST':
        file = request.files['file']
        if file and allowed_file(file.filename):
            filename = secure_filename(file.filename)
            file.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))
            return redirect(url_for('upload_file', filename=filename))
    return '''
    <!doctype html>
    <title>Upload new File</title>

Upload new File

    <form action="" method=post enctype=multipart/form-data>

<input type=file name=file>
        <input type=submit value=Upload>
    </form>
    '''

if __name__ == "__main__":
    app.run('0.0.0.0')


text:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="at.modalog.cordova.plugin.html2pdf"
    version="2.0.0">

    <name>Html2pdf</name>
    <repo>https://github.com/moderna/cordova-plugin-html2pdf.git</repo>
    <keywords>html,pdf,android,ios</keywords>
    <license>MIT</license>
    <author>Modern Alchemists OG</author>
    <description>

Cordova 6.1.1+ plugin for android and ios which converts the given html to a pdf document and stores it on the device.

	  This Plugin requires iText.jar to be added to your project. Here is the last open source version (4.2.0) of it:

		GitHub: https://github.com/ymasory/iText-4.2.0
		Download .jar:: https://github.com/ymasory/iText-4.2.0/downloads
    </description>

    <js-module src="www/Html2pdf.js" name="Html2pdf">
        <clobbers target="html2pdf" />
    </js-module>

    <platform name="android">
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="Html2pdf" >
                <param name="android-package" value="at.modalog.cordova.plugin.html2pdf.Html2pdf"/>
            </feature>
        </config-file>

        <source-file src="src/android/libs/iText-4.2.0-com.itextpdf.jar" target-dir="libs" />
        <source-file src="src/android/Html2pdf.java" target-dir="src/at/modalog/cordova/plugin/html2pdf" />
    </platform>

    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="Html2pdf">
                <param name="ios-package" value="Html2pdf" />
            </feature>
        </config-file>

        <source-file src="src/ios/Html2pdf.m" />
    </platform>
</plugin>


text:
<?php

require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Class.php';
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Printer.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

/**
 * A TestListener that generates an XML-based logfile
 * of the test execution.
 *
 * @category   Testing
 * @package    PHPUnit
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2008 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: 3.2.9
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 2.1.0
 */
class PHPUnit_Util_Log_XML extends PHPUnit_Util_Printer implements PHPUnit_Framework_TestListener
{
    /**
     * @var    DOMDocument
     * @access protected
     */
    protected $document;

    /**
     * @var    DOMElement
     * @access protected
     */
    protected $root;

    /**
     * @var    boolean
     * @access protected
     */
    protected $logIncompleteSkipeed = FALSE;

    /**
     * @var    boolean
     * @access protected
     */
    protected $writeDocument = TRUE;

    /**
     * @var    DOMElement[]
     * @access protected
     */
    protected $testSuites = array();

    /**
     * @var    integer[]
     * @access protected
     */
    protected $testSuiteTests = array(0);

    /**
     * @var    integer[]
     * @access protected
     */
    protected $testSuiteErrors = array(0);

    /**
     * @var    integer[]
     * @access protected
     */
    protected $testSuiteFailures = array(0);

    /**
     * @var    integer[]
     * @access protected
     */
    protected $testSuiteTimes = array(0);

    /**
     * @var    integer
     * @access protected
     */
    protected $testSuiteLevel = 0;

    /**
     * @var    DOMElement
     * @access protected
     */
    protected $currentTestCase = NULL;

    /**
     * @var    boolean
     * @access protected
     */
    protected $attachCurrentTestCase = TRUE;

    /**
     * Constructor.
     *
     * @param  mixed   $out
     * @param  boolean $logIncompleteSkipped
     * @access public
     */
    public function __construct($out = NULL, $logIncompleteSkipped = FALSE)
    {
        $this->document = new DOMDocument('1.0', 'UTF-8');
        $this->document->formatOutput = TRUE;

        $this->root = $this->document->createElement('testsuites');
        $this->document->appendChild($this->root);

        parent::__construct($out);

        $this->logIncompleteSkipped = $logIncompleteSkipped;
    }

    /**
     * Flush buffer and close output.
     *
     * @access public
     */
    public function flush()
    {
        if ($this->writeDocument === TRUE) {
            $this->write($this->getXML());
        }

        parent::flush();
    }

    /**
     * An error occurred.
     *
     * @param  PHPUnit_Framework_Test $test
     * @param  Exception              $e
     * @param  float                  $time
     * @access public
     */
    public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
    {
        $error = $this->document->createElement('error');
        $error->setAttribute('type', get_class($e));

        if ($test instanceof PHPUnit_Framework_SelfDescribing) {
            $buffer = $test->toString() . "\n";
        } else {
            $buffer = '';
        }

        $buffer .= PHPUnit_Framework_TestFailure::exceptionToString($e) . "\n" .
                   PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE);

        $error->appendChild(
          $this->document->createCDATASection(
            utf8_encode($buffer)
          )
        );

        $this->currentTestCase->appendChild($error);

        $this->testSuiteErrors[$this->testSuiteLevel]++;
    }

    /**
     * A failure occurred.
     *
     * @param  PHPUnit_Framework_Test                 $test
     * @param  PHPUnit_Framework_AssertionFailedError $e
     * @param  float                                  $time
     * @access public
     */
    public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time)
    {
        $failure = $this->document->createElement('failure');
        $failure->setAttribute('type', get_class($e));

        if ($test instanceof PHPUnit_Framework_SelfDescribing) {
            $buffer = $test->toString() . "\n";
        } else {
            $buffer = '';
        }

        $buffer .= PHPUnit_Framework_TestFailure::exceptionToString($e) . "\n" .
                   PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE);

        $failure->appendChild(
          $this->document->createCDATASection(
            utf8_encode($buffer)
          )
        );

        $this->currentTestCase->appendChild($failure);

        $this->testSuiteFailures[$this->testSuiteLevel]++;
    }

    /**
     * Incomplete test.
     *
     * @param  PHPUnit_Framework_Test $test
     * @param  Exception              $e
     * @param  float                  $time
     * @access public
     */
    public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time)
    {
        if ($this->logIncompleteSkipped) {
            $error = $this->document->createElement('error');
            $error->setAttribute('type', get_class($e));

            $error->appendChild(
              $this->document->createCDATASection(
                utf8_encode(
                  "Incomplete Test\n" .
                  PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE)
                )
              )
            );

            $this->currentTestCase->appendChild($error);

            $this->testSuiteErrors[$this->testSuiteLevel]++;
        } else {
            $this->attachCurrentTestCase = FALSE;
        }
    }

    /**
     * Skipped test.
     *
     * @param  PHPUnit_Framework_Test $test
     * @param  Exception              $e
     * @param  float                  $time
     * @access public
     * @since  Method available since Release 3.0.0
     */
    public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
    {
        if ($this->logIncompleteSkipped) {
            $error = $this->document->createElement('error');
            $error->setAttribute('type', get_class($e));

            $error->appendChild(
              $this->document->createCDATASection(
                utf8_encode(
                  "Skipped Test\n" .
                  PHPUnit_Util_Filter::getFilteredStacktrace($e, FALSE)
                )
              )
            );

            $this->currentTestCase->appendChild($error);

            $this->testSuiteErrors[$this->testSuiteLevel]++;
        } else {
            $this->attachCurrentTestCase = FALSE;
        }
    }

    /**
     * A testsuite started.
     *
     * @param  PHPUnit_Framework_TestSuite $suite
     * @access public
     * @since  Method available since Release 2.2.0
     */
    public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
    {
        $testSuite = $this->document->createElement('testsuite');
        $testSuite->setAttribute('name', $suite->getName());

        if (class_exists($suite->getName(), FALSE)) {
            try {
                $class = new ReflectionClass($suite->getName());

                $testSuite->setAttribute('file', $class->getFileName());

                $packageInformation = PHPUnit_Util_Class::getPackageInformation(
                  $suite->getName()
                );

                if (!empty($packageInformation['category'])) {
                    $testSuite->setAttribute('category', $packageInformation['category']);
                }

                if (!empty($packageInformation['package'])) {
                    $testSuite->setAttribute('package', $packageInformation['package']);
                }

                if (!empty($packageInformation['subpackage'])) {
                    $testSuite->setAttribute('subpackage', $packageInformation['subpackage']);
                }
            }

            catch (ReflectionException $e) {
            }
        }

        if ($this->testSuiteLevel > 0) {
            $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite);
        } else {
            $this->root->appendChild($testSuite);
        }

        $this->testSuiteLevel++;
        $this->testSuites[$this->testSuiteLevel]        = $testSuite;
        $this->testSuiteTests[$this->testSuiteLevel]    = 0;
        $this->testSuiteErrors[$this->testSuiteLevel]   = 0;
        $this->testSuiteFailures[$this->testSuiteLevel] = 0;
        $this->testSuiteTimes[$this->testSuiteLevel]    = 0;
    }

    /**
     * A testsuite ended.
     *
     * @param  PHPUnit_Framework_TestSuite $suite
     * @access public
     * @since  Method available since Release 2.2.0
     */
    public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
    {
        $this->testSuites[$this->testSuiteLevel]->setAttribute('tests', $this->testSuiteTests[$this->testSuiteLevel]);
        $this->testSuites[$this->testSuiteLevel]->setAttribute('failures', $this->testSuiteFailures[$this->testSuiteLevel]);
        $this->testSuites[$this->testSuiteLevel]->setAttribute('errors', $this->testSuiteErrors[$this->testSuiteLevel]);
        $this->testSuites[$this->testSuiteLevel]->setAttribute('time', sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]));

        if ($this->testSuiteLevel > 1) {
            $this->testSuiteTests[$this->testSuiteLevel - 1]    += $this->testSuiteTests[$this->testSuiteLevel];
            $this->testSuiteErrors[$this->testSuiteLevel - 1]   += $this->testSuiteErrors[$this->testSuiteLevel];
            $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel];
            $this->testSuiteTimes[$this->testSuiteLevel - 1]    += $this->testSuiteTimes[$this->testSuiteLevel];
        }

        $this->testSuiteLevel--;
    }

    /**
     * A test started.
     *
     * @param  PHPUnit_Framework_Test $test
     * @access public
     */
    public function startTest(PHPUnit_Framework_Test $test)
    {
        $testCase = $this->document->createElement('testcase');
        $testCase->setAttribute('name', $test->getName());

        if ($test instanceof PHPUnit_Framework_TestCase) {
            $class  = new ReflectionClass($test);
            $method = $class->getMethod($test->getName());

            $testCase->setAttribute('class', $class->getName());
            $testCase->setAttribute('file', $class->getFileName());
            $testCase->setAttribute('line', $method->getStartLine());
        }

        $this->currentTestCase = $testCase;
    }

    /**
     * A test ended.
     *
     * @param  PHPUnit_Framework_Test $test
     * @param  float                  $time
     * @access public
     */
    public function endTest(PHPUnit_Framework_Test $test, $time)
    {
        if ($this->attachCurrentTestCase) {
            $this->currentTestCase->setAttribute('time', sprintf('%F', $time));

            $this->testSuites[$this->testSuiteLevel]->appendChild(
              $this->currentTestCase
            );

            $this->testSuiteTests[$this->testSuiteLevel]++;
            $this->testSuiteTimes[$this->testSuiteLevel] += $time;
        }

        $this->currentTestCase       = NULL;
        $this->attachCurrentTestCase = TRUE;
    }

    /**
     * Returns the XML as a string.
     *
     * @return string
     * @access public
     * @since  Method available since Release 2.2.0
     */
    public function getXML()
    {
        return $this->document->saveXML();
    }

    /**
     * Enables or disables the writing of the document
     * in flush().
     *
     * This is a "hack" needed for the integration of
     * PHPUnit with Phing.
     *
     * @return string
     * @access public
     * @since  Method available since Release 2.2.0
     */
    public function setWriteDocument($flag)
    {
        if (is_bool($flag)) {
            $this->writeDocument = $flag;
        }
    }
}
?>