text:
.clearfix {
  *zoom: 1;
}
.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
  line-height: 0;
}
.clearfix:after {
  clear: both;
}
.hide-text {
  font: 0/0 a;
  color: transparent;
  text-shadow: none;
  background-color: transparent;
  border: 0;
}
.input-block-level {
  display: block;
  width: 100%;
  min-height: 30px;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
  display: block;
}
audio,
canvas,
video {
  display: inline-block;
  *display: inline;
  *zoom: 1;
}
audio:not([controls]) {
  display: none;
}
html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
a:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
a:hover,
a:active {
  outline: 0;
}
sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}
sup {
  top: -0.5em;
}
sub {
  bottom: -0.25em;
}
img {
  /* Responsive images (ensure images don't scale beyond their parents) */

  max-width: 100%;
  /* Part 1: Set a maxium relative to the parent */

  width: auto\9;
  /* IE7-8 need help adjusting responsive images */

  height: auto;
  /* Part 2: Scale the height according to the width, otherwise you get stretching */

  vertical-align: middle;
  border: 0;
  -ms-interpolation-mode: bicubic;
}
#map_canvas img {
  max-width: none;
}
button,
input,
select,
textarea {
  margin: 0;
  font-size: 100%;
  vertical-align: middle;
}
button,
input {
  *overflow: visible;
  line-height: normal;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
  padding: 0;
  border: 0;
}
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
}
input[type="search"] {
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
  -webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
textarea {
  overflow: auto;
  vertical-align: top;
}
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  line-height: 18px;
  color: #333333;
  background-color: #ffffff;
}
a {
  color: #0088cc;
  text-decoration: none;
}
a:hover {
  color: #005580;
  text-decoration: underline;
}
.img-rounded {
  -webkit-border-radius: 6px;
  -moz-border-radius: 6px;
  border-radius: 6px;
}
.img-polaroid {
  padding: 4px;
  background-color: #fff;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.img-circle {
  -webkit-border-radius: 500px;
  -moz-border-radius: 500px;
  border-radius: 500px;
}
p {
  margin: 0 0 9px;
}
.lead {
  margin-bottom: 18px;
  font-size: 18px;
  font-weight: 200;
  line-height: 27px;
}
small {
  font-size: 85%;
}
strong {
  font-weight: bold;
}
em {
  font-style: italic;
}
cite {
  font-style: normal;
}
.muted {
  color: #999999;
}
.text-warning {
  color: #c09853;
}
.text-error {
  color: #b94a48;
}
.text-info {
  color: #3a87ad;
}
.text-success {
  color: #468847;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 9px 0;
  font-family: inherit;
  font-weight: bold;
  line-height: 1;
  color: inherit;
  text-rendering: optimizelegibility;
}
h1 small,
h2 small,
h3 small,
h4 small,
h5 small,
h6 small {
  font-weight: normal;
  line-height: 1;
  color: #999999;
}
h1 {
  font-size: 36px;
  line-height: 40px;
}
h2 {
  font-size: 30px;
  line-height: 40px;
}
h3 {
  font-size: 24px;
  line-height: 40px;
}
h4 {
  font-size: 18px;
  line-height: 20px;
}
h5 {
  font-size: 14px;
  line-height: 20px;
}
h6 {
  font-size: 12px;
  line-height: 20px;
}
h1 small {
  font-size: 24px;
}
h2 small {
  font-size: 18px;
}
h3 small {
  font-size: 14px;
}
h4 small {
  font-size: 14px;
}
.page-header {
  padding-bottom: 8px;
  margin: 18px 0 27px;
  border-bottom: 1px solid #eeeeee;
}
ul,
ol {
  padding: 0;
  margin: 0 0 9px 25px;
}
ul ul,
ul ol,
ol ol,
ol ul {
  margin-bottom: 0;
}
li {
  line-height: 18px;
}
ul.unstyled,
ol.unstyled {
  margin-left: 0;
  list-style: none;
}
dl {
  margin-bottom: 18px;
}
dt,
dd {
  line-height: 18px;
}
dt {
  font-weight: bold;
}
dd {
  margin-left: 9px;
}
.dl-horizontal {
  *zoom: 1;
}
.dl-horizontal:before,
.dl-horizontal:after {
  display: table;
  content: "";
  line-height: 0;
}
.dl-horizontal:after {
  clear: both;
}
.dl-horizontal dt {
  float: left;
  width: 160px;
  clear: left;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-horizontal dd {
  margin-left: 180px;
}
hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #ffffff;
}
abbr[title] {
  cursor: help;
  border-bottom: 1px dotted #999999;
}
abbr.initialism {
  font-size: 90%;
  text-transform: uppercase;
}
blockquote {
  padding: 0 0 0 15px;
  margin: 0 0 18px;
  border-left: 5px solid #eeeeee;
}
blockquote p {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 22.5px;
}
blockquote small {
  display: block;
  line-height: 18px;
  color: #999999;
}
blockquote small:before {
  content: '\2014 \00A0';
}
blockquote.pull-right {
  float: right;
  padding-right: 15px;
  padding-left: 0;
  border-right: 5px solid #eeeeee;
  border-left: 0;
}
blockquote.pull-right p,
blockquote.pull-right small {
  text-align: right;
}
blockquote.pull-right small:before {
  content: '';
}
blockquote.pull-right small:after {
  content: '\00A0 \2014';
}
q:before,
q:after,
blockquote:before,
blockquote:after {
  content: "";
}
address {
  display: block;
  margin-bottom: 18px;
  font-style: normal;
  line-height: 18px;
}
form {
  margin: 0 0 18px;
}
fieldset {
  padding: 0;
  margin: 0;
  border: 0;
}
legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 18px;
  font-size: 18px;
  line-height: 36px;
  color: #333333;
  border: 0;
  border-bottom: 1px solid #e5e5e5;
}
legend small {
  font-size: 13.5px;
  color: #999999;
}
label,
input,
button,
select,
textarea {
  font-size: 12px;
  font-weight: normal;
  line-height: 18px;
}
input,
button,
select,
textarea {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
label {
  display: block;
  margin-bottom: 5px;
}
select,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
  display: inline-block;
  height: 18px;
  padding: 4px 6px;
  margin-bottom: 9px;
  font-size: 12px;
  line-height: 18px;
  color: #555555;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
}
input,
textarea,
.uneditable-input {
  width: 206px;
}
textarea {
  height: auto;
}
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
.uneditable-input {
  background-color: #ffffff;
  border: 1px solid #cccccc;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -webkit-transition: border linear .2s, box-shadow linear .2s;
  -moz-transition: border linear .2s, box-shadow linear .2s;
  -o-transition: border linear .2s, box-shadow linear .2s;
  transition: border linear .2s, box-shadow linear .2s;
}
textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
.uneditable-input:focus {
  border-color: rgba(82, 168, 236, 0.8);
  outline: 0;
  outline: thin dotted \9;
  /* IE6-9 */

  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
}
input[type="radio"],
input[type="checkbox"] {
  margin: 4px 0 0;
  *margin-top: 0;
  /* IE7 */

  margin-top: 1px \9;
  /* IE8-9 */

  line-height: normal;
  cursor: pointer;
}
input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
  width: auto;
}
select,
input[type="file"] {
  height: 30px;
  /* In IE7, the height of the select element cannot be changed by height, only font-size */

  *margin-top: 4px;
  /* For IE7, add top margin to align select with labels */

  line-height: 30px;
}
select {
  width: 220px;
  border: 1px solid #cccccc;
  background-color: #ffffff;
}
select[multiple],
select[size] {
  height: auto;
}
select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.uneditable-input,
.uneditable-textarea {
  color: #999999;
  background-color: #fcfcfc;
  border-color: #cccccc;
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.025);
  cursor: not-allowed;
}
.uneditable-input {
  overflow: hidden;
  white-space: nowrap;
}
.uneditable-textarea {
  width: auto;
  height: auto;
}
input:-moz-placeholder,
textarea:-moz-placeholder {
  color: #999999;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #999999;
}
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #999999;
}
.radio,
.checkbox {
  min-height: 18px;
  padding-left: 18px;
}
.radio input[type="radio"],
.checkbox input[type="checkbox"] {
  float: left;
  margin-left: -18px;
}
.controls > .radio:first-child,
.controls > .checkbox:first-child {
  padding-top: 5px;
}
.radio.inline,
.checkbox.inline {
  display: inline-block;
  padding-top: 5px;
  margin-bottom: 0;
  vertical-align: middle;
}
.radio.inline + .radio.inline,
.checkbox.inline + .checkbox.inline {
  margin-left: 10px;
}
.input-mini {
  width: 60px;
}
.input-small {
  width: 90px;
}
.input-medium {
  width: 150px;
}
.input-large {
  width: 210px;
}
.input-xlarge {
  width: 270px;
}
.input-xxlarge {
  width: 530px;
}
input[class*="span"],
select[class*="span"],
textarea[class*="span"],
.uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"] {
  float: none;
  margin-left: 0;
}
.input-append input[class*="span"],
.input-append .uneditable-input[class*="span"],
.input-prepend input[class*="span"],
.input-prepend .uneditable-input[class*="span"],
.row-fluid input[class*="span"],
.row-fluid select[class*="span"],
.row-fluid textarea[class*="span"],
.row-fluid .uneditable-input[class*="span"],
.row-fluid .input-prepend [class*="span"],
.row-fluid .input-append [class*="span"] {
  display: inline-block;
}
input,
textarea,
.uneditable-input {
  margin-left: 0;
}
.controls-row [class*="span"] + [class*="span"] {
  margin-left: 20px;
}
input.span12, textarea.span12, .uneditable-input.span12 {
  width: 926px;
}
input.span11, textarea.span11, .uneditable-input.span11 {
  width: 846px;
}
input.span10, textarea.span10, .uneditable-input.span10 {
  width: 766px;
}
input.span9, textarea.span9, .uneditable-input.span9 {
  width: 686px;
}
input.span8, textarea.span8, .uneditable-input.span8 {
  width: 606px;
}
input.span7, textarea.span7, .uneditable-input.span7 {
  width: 526px;
}
input.span6, textarea.span6, .uneditable-input.span6 {
  width: 446px;
}
input.span5, textarea.span5, .uneditable-input.span5 {
  width: 366px;
}
input.span4, textarea.span4, .uneditable-input.span4 {
  width: 286px;
}
input.span3, textarea.span3, .uneditable-input.span3 {
  width: 206px;
}
input.span2, textarea.span2, .uneditable-input.span2 {
  width: 126px;
}
input.span1, textarea.span1, .uneditable-input.span1 {
  width: 46px;
}
.controls-row {
  *zoom: 1;
}
.controls-row:before,
.controls-row:after {
  display: table;
  content: "";
  line-height: 0;
}
.controls-row:after {
  clear: both;
}
.controls-row [class*="span"] {
  float: left;
}
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
  cursor: not-allowed;
  background-color: #eeeeee;
}
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
  background-color: transparent;
}
.control-group.warning > label,
.control-group.warning .help-block,
.control-group.warning .help-inline {
  color: #c09853;
}
.control-group.warning .checkbox,
.control-group.warning .radio,
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
  color: #c09853;
}
.control-group.warning input,
.control-group.warning select,
.control-group.warning textarea {
  border-color: #c09853;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.control-group.warning input:focus,
.control-group.warning select:focus,
.control-group.warning textarea:focus {
  border-color: #a47e3c;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.control-group.warning .input-prepend .add-on,
.control-group.warning .input-append .add-on {
  color: #c09853;
  background-color: #fcf8e3;
  border-color: #c09853;
}
.control-group.error > label,
.control-group.error .help-block,
.control-group.error .help-inline {
  color: #b94a48;
}
.control-group.error .checkbox,
.control-group.error .radio,
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
  color: #b94a48;
}
.control-group.error input,
.control-group.error select,
.control-group.error textarea {
  border-color: #b94a48;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.control-group.error input:focus,
.control-group.error select:focus,
.control-group.error textarea:focus {
  border-color: #953b39;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.control-group.error .input-prepend .add-on,
.control-group.error .input-append .add-on {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #b94a48;
}
.control-group.success > label,
.control-group.success .help-block,
.control-group.success .help-inline {
  color: #468847;
}
.control-group.success .checkbox,
.control-group.success .radio,
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
  color: #468847;
}
.control-group.success input,
.control-group.success select,
.control-group.success textarea {
  border-color: #468847;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.control-group.success input:focus,
.control-group.success select:focus,
.control-group.success textarea:focus {
  border-color: #356635;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.control-group.success .input-prepend .add-on,
.control-group.success .input-append .add-on {
  color: #468847;
  background-color: #dff0d8;
  border-color: #468847;
}
.control-group.info > label,
.control-group.info .help-block,
.control-group.info .help-inline {
  color: #3a87ad;
}
.control-group.info .checkbox,
.control-group.info .radio,
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  color: #3a87ad;
}
.control-group.info input,
.control-group.info select,
.control-group.info textarea {
  border-color: #3a87ad;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.control-group.info input:focus,
.control-group.info select:focus,
.control-group.info textarea:focus {
  border-color: #2d6987;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
}
.control-group.info .input-prepend .add-on,
.control-group.info .input-append .add-on {
  color: #3a87ad;
  background-color: #d9edf7;
  border-color: #3a87ad;
}
input:focus:required:invalid,
textarea:focus:required:invalid,
select:focus:required:invalid {
  color: #b94a48;
  border-color: #ee5f5b;
}
input:focus:required:invalid:focus,
textarea:focus:required:invalid:focus,
select:focus:required:invalid:focus {
  border-color: #e9322d;
  -webkit-box-shadow: 0 0 6px #f8b9b7;
  -moz-box-shadow: 0 0 6px #f8b9b7;
  box-shadow: 0 0 6px #f8b9b7;
}
.form-actions {
  padding: 17px 20px 18px;
  margin-top: 18px;
  margin-bottom: 18px;
  background-color: #f5f5f5;
  border-top: 1px solid #e5e5e5;
  *zoom: 1;
}
.form-actions:before,
.form-actions:after {
  display: table;
  content: "";
  line-height: 0;
}
.form-actions:after {
  clear: both;
}
.help-block,
.help-inline {
  color: #595959;
}
.help-block {
  display: block;
  margin-bottom: 9px;
}
.help-inline {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */

  *zoom: 1;
  vertical-align: middle;
  padding-left: 5px;
}
.input-append,
.input-prepend {
  margin-bottom: 5px;
  font-size: 0;
  white-space: nowrap;
}
.input-append input,
.input-prepend input,
.input-append select,
.input-prepend select,
.input-append .uneditable-input,
.input-prepend .uneditable-input {
  position: relative;
  margin-bottom: 0;
  *margin-left: 0;
  font-size: 12px;
  vertical-align: top;
  -webkit-border-radius: 0 3px 3px 0;
  -moz-border-radius: 0 3px 3px 0;
  border-radius: 0 3px 3px 0;
}
.input-append input:focus,
.input-prepend input:focus,
.input-append select:focus,
.input-prepend select:focus,
.input-append .uneditable-input:focus,
.input-prepend .uneditable-input:focus {
  z-index: 2;
}
.input-append .add-on,
.input-prepend .add-on {
  display: inline-block;
  width: auto;
  height: 18px;
  min-width: 16px;
  padding: 4px 5px;
  font-size: 12px;
  font-weight: normal;
  line-height: 18px;
  text-align: center;
  text-shadow: 0 1px 0 #ffffff;
  background-color: #eeeeee;
  border: 1px solid #ccc;
}
.input-append .add-on,
.input-prepend .add-on,
.input-append .btn,
.input-prepend .btn {
  vertical-align: top;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}
.input-append .active,
.input-prepend .active {
  background-color: #a9dba9;
  border-color: #46a546;
}
.input-prepend .add-on,
.input-prepend .btn {
  margin-right: -1px;
}
.input-prepend .add-on:first-child,
.input-prepend .btn:first-child {
  -webkit-border-radius: 3px 0 0 3px;
  -moz-border-radius: 3px 0 0 3px;
  border-radius: 3px 0 0 3px;
}
.input-append input,
.input-append select,
.input-append .uneditable-input {
  -webkit-border-radius: 3px 0 0 3px;
  -moz-border-radius: 3px 0 0 3px;
  border-radius: 3px 0 0 3px;
}
.input-append .add-on,
.input-append .btn {
  margin-left: -1px;
}
.input-append .add-on:last-child,
.input-append .btn:last-child {
  -webkit-border-radius: 0 3px 3px 0;
  -moz-border-radius: 0 3px 3px 0;
  border-radius: 0 3px 3px 0;
}
.input-prepend.input-append input,
.input-prepend.input-append select,
.input-prepend.input-append .uneditable-input {
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}
.input-prepend.input-append .add-on:first-child,
.input-prepend.input-append .btn:first-child {
  margin-right: -1px;
  -webkit-border-radius: 3px 0 0 3px;
  -moz-border-radius: 3px 0 0 3px;
  border-radius: 3px 0 0 3px;
}
.input-prepend.input-append .add-on:last-child,
.input-prepend.input-append .btn:last-child {
  margin-left: -1px;
  -webkit-border-radius: 0 3px 3px 0;
  -moz-border-radius: 0 3px 3px 0;
  border-radius: 0 3px 3px 0;
}
input.search-query {
  padding-right: 14px;
  padding-right: 4px \9;
  padding-left: 14px;
  padding-left: 4px \9;
  /* IE7-8 doesn't have border-radius, so don't indent the padding */

  margin-bottom: 0;
  -webkit-border-radius: 15px;
  -moz-border-radius: 15px;
  border-radius: 15px;
}
/* Allow for input prepend/append in search forms */
.form-search .input-append .search-query,
.form-search .input-prepend .search-query {
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}
.form-search .input-append .search-query {
  -webkit-border-radius: 14px 0 0 14px;
  -moz-border-radius: 14px 0 0 14px;
  border-radius: 14px 0 0 14px;
}
.form-search .input-append .btn {
  -webkit-border-radius: 0 14px 14px 0;
  -moz-border-radius: 0 14px 14px 0;
  border-radius: 0 14px 14px 0;
}
.form-search .input-prepend .search-query {
  -webkit-border-radius: 0 14px 14px 0;
  -moz-border-radius: 0 14px 14px 0;
  border-radius: 0 14px 14px 0;
}
.form-search .input-prepend .btn {
  -webkit-border-radius: 14px 0 0 14px;
  -moz-border-radius: 14px 0 0 14px;
  border-radius: 14px 0 0 14px;
}
.form-search input,
.form-inline input,
.form-horizontal input,
.form-search textarea,
.form-inline textarea,
.form-horizontal textarea,
.form-search select,
.form-inline select,
.form-horizontal select,
.form-search .help-inline,
.form-inline .help-inline,
.form-horizontal .help-inline,
.form-search .uneditable-input,
.form-inline .uneditable-input,
.form-horizontal .uneditable-input,
.form-search .input-prepend,
.form-inline .input-prepend,
.form-horizontal .input-prepend,
.form-search .input-append,
.form-inline .input-append,
.form-horizontal .input-append {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */

  *zoom: 1;
  margin-bottom: 0;
  vertical-align: middle;
}
.form-search .hide,
.form-inline .hide,
.form-horizontal .hide {
  display: none;
}
.form-search label,
.form-inline label,
.form-search .btn-group,
.form-inline .btn-group {
  display: inline-block;
}
.form-search .input-append,
.form-inline .input-append,
.form-search .input-prepend,
.form-inline .input-prepend {
  margin-bottom: 0;
}
.form-search .radio,
.form-search .checkbox,
.form-inline .radio,
.form-inline .checkbox {
  padding-left: 0;
  margin-bottom: 0;
  vertical-align: middle;
}
.form-search .radio input[type="radio"],
.form-search .checkbox input[type="checkbox"],
.form-inline .radio input[type="radio"],
.form-inline .checkbox input[type="checkbox"] {
  float: left;
  margin-right: 3px;
  margin-left: 0;
}
.control-group {
  margin-bottom: 9px;
}
legend + .control-group {
  margin-top: 18px;
  -webkit-margin-top-collapse: separate;
}
.form-horizontal .control-group {
  margin-bottom: 18px;
  *zoom: 1;
}
.form-horizontal .control-group:before,
.form-horizontal .control-group:after {
  display: table;
  content: "";
  line-height: 0;
}
.form-horizontal .control-group:after {
  clear: both;
}
.form-horizontal .control-label {
  float: left;
  width: 160px;
  padding-top: 5px;
  text-align: right;
}
.form-horizontal .controls {
  *display: inline-block;
  *padding-left: 20px;
  margin-left: 180px;
  *margin-left: 0;
}
.form-horizontal .controls:first-child {
  *padding-left: 180px;
}
.form-horizontal .help-block {
  margin-bottom: 0;
}
.form-horizontal input + .help-block,
.form-horizontal select + .help-block,
.form-horizontal textarea + .help-block {
  margin-top: 9px;
}
.form-horizontal .form-actions {
  padding-left: 180px;
}
.btn {
  display: inline-block;
  *display: inline;
  /* IE7 inline-block hack */

  *zoom: 1;
  padding: 4px 14px;
  margin-bottom: 0;
  font-size: 12px;
  line-height: 18px;
  *line-height: 18px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  color: #333333;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  background-color: #f5f5f5;
  background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
  background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
  background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #e6e6e6;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
  border: 1px solid #bbbbbb;
  *border: 0;
  border-bottom-color: #a2a2a2;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
  *margin-left: .3em;
  -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn:hover,
.btn:active,
.btn.active,
.btn.disabled,
.btn[disabled] {
  color: #333333;
  background-color: #e6e6e6;
  *background-color: #d9d9d9;
}
.btn:active,
.btn.active {
  background-color: #cccccc \9;
}
.btn:first-child {
  *margin-left: 0;
}
.btn:hover {
  color: #333333;
  text-decoration: none;
  background-color: #e6e6e6;
  *background-color: #d9d9d9;
  /* Buttons in IE7 don't get borders, so darken on hover */

  background-position: 0 -15px;
  -webkit-transition: background-position 0.1s linear;
  -moz-transition: background-position 0.1s linear;
  -o-transition: background-position 0.1s linear;
  transition: background-position 0.1s linear;
}
.btn:focus {
  outline: thin dotted #333;
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}
.btn.active,
.btn:active {
  background-color: #e6e6e6;
  background-color: #d9d9d9 \9;
  background-image: none;
  outline: 0;
  -webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  -moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn.disabled,
.btn[disabled] {
  cursor: default;
  background-color: #e6e6e6;
  background-image: none;
  opacity: 0.65;
  filter: alpha(opacity=65);
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
.btn-large {
  padding: 9px 14px;
  font-size: 14px;
  line-height: normal;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;
  border-radius: 5px;
}
.btn-large [class^="icon-"] {
  margin-top: 2px;
}
.btn-small {
  padding: 3px 9px;
  font-size: 10px;
  line-height: 16px;
}
.btn-small [class^="icon-"] {
  margin-top: 0;
}
.btn-mini {
  padding: 2px 6px;
  font-size: 9px;
  line-height: 15px;
}
.btn-block {
  display: block;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.btn-block + .btn-block {
  margin-top: 5px;
}
input[type="submit"].btn-block,
input[type="reset"].btn-block,
input[type="button"].btn-block {
  width: 100%;
}
.btn-primary.active,
.btn-warning.active,
.btn-danger.active,
.btn-success.active,
.btn-info.active,
.btn-inverse.active {
  color: rgba(255, 255, 255, 0.75);
}
.btn {
  border-color: #c5c5c5;
  border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
}
.btn-primary {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #006dcc;
  background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
  background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
  background-image: -o-linear-gradient(top, #0088cc, #0044cc);
  background-image: linear-gradient(to bottom, #0088cc, #0044cc);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
  border-color: #0044cc #0044cc #002a80;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #0044cc;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary.disabled,
.btn-primary[disabled] {
  color: #ffffff;
  background-color: #0044cc;
  *background-color: #003bb3;
}
.btn-primary:active,
.btn-primary.active {
  background-color: #003399 \9;
}
.btn-warning {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #faa732;
  background-image: -moz-linear-gradient(top, #fbb450, #f89406);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
  background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
  background-image: -o-linear-gradient(top, #fbb450, #f89406);
  background-image: linear-gradient(to bottom, #fbb450, #f89406);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
  border-color: #f89406 #f89406 #ad6704;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #f89406;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-warning:hover,
.btn-warning:active,
.btn-warning.active,
.btn-warning.disabled,
.btn-warning[disabled] {
  color: #ffffff;
  background-color: #f89406;
  *background-color: #df8505;
}
.btn-warning:active,
.btn-warning.active {
  background-color: #c67605 \9;
}
.btn-danger {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #da4f49;
  background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
  background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
  background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
  border-color: #bd362f #bd362f #802420;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #bd362f;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-danger:hover,
.btn-danger:active,
.btn-danger.active,
.btn-danger.disabled,
.btn-danger[disabled] {
  color: #ffffff;
  background-color: #bd362f;
  *background-color: #a9302a;
}
.btn-danger:active,
.btn-danger.active {
  background-color: #942a25 \9;
}
.btn-success {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #5bb75b;
  background-image: -moz-linear-gradient(top, #62c462, #51a351);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
  background-image: -webkit-linear-gradient(top, #62c462, #51a351);
  background-image: -o-linear-gradient(top, #62c462, #51a351);
  background-image: linear-gradient(to bottom, #62c462, #51a351);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
  border-color: #51a351 #51a351 #387038;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #51a351;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-success:hover,
.btn-success:active,
.btn-success.active,
.btn-success.disabled,
.btn-success[disabled] {
  color: #ffffff;
  background-color: #51a351;
  *background-color: #499249;
}
.btn-success:active,
.btn-success.active {
  background-color: #408140 \9;
}
.btn-info {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #49afcd;
  background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
  background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
  background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
  border-color: #2f96b4 #2f96b4 #1f6377;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #2f96b4;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-info:hover,
.btn-info:active,
.btn-info.active,
.btn-info.disabled,
.btn-info[disabled] {
  color: #ffffff;
  background-color: #2f96b4;
  *background-color: #2a85a0;
}
.btn-info:active,
.btn-info.active {
  background-color: #24748c \9;
}
.btn-inverse {
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  background-color: #363636;
  background-image: -moz-linear-gradient(top, #444444, #222222);
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
  background-image: -webkit-linear-gradient(top, #444444, #222222);
  background-image: -o-linear-gradient(top, #444444, #222222);
  background-image: linear-gradient(to bottom, #444444, #222222);
  background-repeat: repeat-x;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
  border-color: #222222 #222222 #000000;
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
  *background-color: #222222;
  /* Darken IE7 buttons by default so they stand out more given they won't have borders */

  filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.btn-inverse:hover,
.btn-inverse:active,
.btn-inverse.active,
.btn-inverse.disabled,
.btn-inverse[disabled] {
  color: #ffffff;
  background-color: #222222;
  *background-color: #151515;
}
.btn-inverse:active,
.btn-inverse.active {
  background-color: #080808 \9;
}
button.btn,
input[type="submit"].btn {
  *padding-top: 3px;
  *padding-bottom: 3px;
}
button.btn::-moz-focus-inner,
input[type="submit"].btn::-moz-focus-inner {
  padding: 0;
  border: 0;
}
button.btn.btn-large,
input[type="submit"].btn.btn-large {
  *padding-top: 7px;
  *padding-bottom: 7px;
}
button.btn.btn-small,
input[type="submit"].btn.btn-small {
  *padding-top: 3px;
  *padding-bottom: 3px;
}
button.btn.btn-mini,
input[type="submit"].btn.btn-mini {
  *padding-top: 1px;
  *padding-bottom: 1px;
}
.btn-link,
.btn-link:active,
.btn-link[disabled] {
  background-color: transparent;
  background-image: none;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
}
.btn-link {
  border-color: transparent;
  cursor: pointer;
  color: #0088cc;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}
.btn-link:hover {
  color: #005580;
  text-decoration: underline;
  background-color: transparent;
}
.btn-link[disabled]:hover {
  color: #333333;
  text-decoration: none;
}


text:
package Paws::RDS::DeleteDBClusterParameterGroup;
  use Moose;
  has DBClusterParameterGroupName => (is => 'ro', isa => 'Str', required => 1);

  use MooseX::ClassAttribute;

  class_has _api_call => (isa => 'Str', is => 'ro', default => 'DeleteDBClusterParameterGroup');
  class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::API::Response');
  class_has _result_key => (isa => 'Str', is => 'ro');
1;

### main pod documentation begin ###

=head1 NAME

Paws::RDS::DeleteDBClusterParameterGroup - Arguments for method DeleteDBClusterParameterGroup on Paws::RDS

=head1 DESCRIPTION

This class represents the parameters used for calling the method DeleteDBClusterParameterGroup on the
Amazon Relational Database Service service. Use the attributes of this class
as arguments to method DeleteDBClusterParameterGroup.

You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DeleteDBClusterParameterGroup.

As an example:

  $service_obj->DeleteDBClusterParameterGroup(Att1 => $value1, Att2 => $value2, ...);

Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.

=head1 ATTRIBUTES

=head2 B<REQUIRED> DBClusterParameterGroupName => Str

The name of the DB cluster parameter group.

Constraints:

=over

=item *

Must be the name of an existing DB cluster parameter group.

=item *

You cannot delete a default DB cluster parameter group.

=item *

Cannot be associated with any DB clusters.

=back

=head1 SEE ALSO

This class forms part of L<Paws>, documenting arguments for method DeleteDBClusterParameterGroup in L<Paws::RDS>

=head1 BUGS and CONTRIBUTIONS

The source code is located here: https://github.com/pplu/aws-sdk-perl

Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues

=cut

redpajama_set_name: RedPajamaGithub


text:
using AutoMapper;
using TimetableWebAPI.Domain.Entities;
using TimetableWebAPI.Domain.Responses;

namespace TimetableWebAPI.Mappings.Responses
{
    /// <summary>
    ///     Настройка маппинга DTO обьектов
    /// </summary>
    public class LessonResponseMapping : Profile
    {
        /// <summary>
        ///     Инцииализатор маппингов
        /// </summary>
        public LessonResponseMapping()
        {
            CreateMap<Lesson, LessonResponse>()
                .ForMember(lessonDTO => lessonDTO.ID, cfg => cfg.MapFrom(lesson => lesson.ID))
                .ForMember(lessonDTO => lessonDTO.Date, cfg => cfg.MapFrom(lesson => lesson.Date))
                .ForMember(lessonDTO => lessonDTO.Start, cfg => cfg.MapFrom(lesson => lesson.Start))
                .ForMember(lessonDTO => lessonDTO.End, cfg => cfg.MapFrom(lesson => lesson.End))

                //Вложенным обьектам запретим раскрываться до момента, пока сами этого не скажем
                .ForMember(lessonDTO => lessonDTO.Group, cfg =>
                {
                    cfg.MapFrom(lesson => lesson.Group);
                    cfg.ExplicitExpansion();
                })
                .ForMember(lessonDTO => lessonDTO.Location, cfg =>
                {
                    cfg.MapFrom(lesson => lesson.Location);
                    cfg.ExplicitExpansion();
                })
                .ForMember(lessonDTO => lessonDTO.Teacher, cfg =>
                {
                    cfg.MapFrom(lesson => lesson.Teacher);
                    cfg.ExplicitExpansion();
                })
                .ForMember(lessonDTO => lessonDTO.Subject, cfg =>
                {
                    cfg.MapFrom(lesson => lesson.Subject);
                    cfg.ExplicitExpansion();
                })
                .ForAllOtherMembers(cfg => cfg.Ignore());
        }
    }
}


text:
package org.springframework.social.popup.config;

import javax.inject.Inject;
import javax.sql.DataSource;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.core.env.Environment;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.encrypt.Encryptors;
import org.springframework.social.connect.Connection;
import org.springframework.social.connect.ConnectionFactoryLocator;
import org.springframework.social.connect.ConnectionRepository;
import org.springframework.social.connect.UsersConnectionRepository;
import org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository;
import org.springframework.social.connect.support.ConnectionFactoryRegistry;
import org.springframework.social.connect.web.ConnectController;
import org.springframework.social.facebook.api.Facebook;
import org.springframework.social.facebook.api.impl.FacebookTemplate;
import org.springframework.social.facebook.connect.FacebookConnectionFactory;
import org.springframework.social.popup.connect.SinglePageConnectController;
import org.springframework.social.popup.facebook.PopupDialogConnectInterceptor;
import org.springframework.social.popup.facebook.PostToWallAfterConnectInterceptor;
import org.springframework.social.popup.twitter.TweetAfterConnectInterceptor;
import org.springframework.social.twitter.api.Twitter;
import org.springframework.social.twitter.api.impl.TwitterTemplate;
import org.springframework.social.twitter.connect.TwitterConnectionFactory;

/**
 * Spring Social Configuration.
 * @author Craig Walls
 */
@Configuration
public class SocialConfig {

	@Inject
	private Environment environment;

	@Inject
	private DataSource dataSource;

	@Bean
	@Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES)
	public ConnectionFactoryLocator connectionFactoryLocator() {
		ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
		registry.addConnectionFactory(new TwitterConnectionFactory(environment.getProperty("twitter.consumerKey"),
				environment.getProperty("twitter.consumerSecret")));
		registry.addConnectionFactory(new FacebookConnectionFactory(environment.getProperty("facebook.clientId"),
				environment.getProperty("facebook.clientSecret")));
		return registry;
	}

	@Bean
	@Scope(value="singleton", proxyMode=ScopedProxyMode.INTERFACES)
	public UsersConnectionRepository usersConnectionRepository() {
		return new JdbcUsersConnectionRepository(dataSource, connectionFactoryLocator(), Encryptors.noOpText());
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public ConnectionRepository connectionRepository() {
		Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
		if (authentication == null) {
			throw new IllegalStateException("Unable to get a ConnectionRepository: no user signed in");
		}
		return usersConnectionRepository().createConnectionRepository(authentication.getName());
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public Facebook facebook() {
		Connection<Facebook> facebook = connectionRepository().findPrimaryConnection(Facebook.class);
		return facebook != null ? facebook.getApi() : new FacebookTemplate();
	}

	@Bean
	@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
	public Twitter twitter() {
		Connection<Twitter> twitter = connectionRepository().findPrimaryConnection(Twitter.class);
		return twitter != null ? twitter.getApi() : null;
	}

	@Bean
	public ConnectController connectController() {
		SinglePageConnectController connectController = new SinglePageConnectController(connectionFactoryLocator(), connectionRepository());
		connectController.addInterceptor(new PostToWallAfterConnectInterceptor());
		connectController.addInterceptor(new PopupDialogConnectInterceptor());
		connectController.addInterceptor(new TweetAfterConnectInterceptor());
		return connectController;
	}

}


text:
<?php

namespace spec\Konradha9\Tools;

use PhpSpec\ObjectBehavior;
use Prophecy\Argument;

class MnozenieSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Konradha9\Tools\Mnozenie');
    }
}


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Variant</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Variant: Variant

  Values:
  Short

Sometimes there are multiple word forms for the same lemma and set of features.
The Variant feature helps distinguish alternate forms.

In Old East Slavic there are two groups of words where double forms are regular and worth capturing:
short forms of adjectives (incl. adjectival pronouns and participles)
and short (clitic) forms of personal pronouns.
This feature only marks the short forms, hence there is only one value, Short.
For the long standard forms the Variant feature remains unspecified.

Short: short form of adjectives or personal pronouns

The short form is called nominal form of adjective (краткая форма прилагательного),
as opposed to the long form, which is pronominal because it originated as
a combination of a nominal form and a personal pronoun.
The short forms of personal pronouns are clitics. They are separate words (unlike in some other languages)
but in the clause they usually stick to the second position or some other syntactically determined positions.

Examples

чистъ "clear, clean", long equivalent: чистый

угодна "suitable", long equivalent: угодная

таковы "this", long equivalent: таковые

нареченъ "called", long equivalent: нареченный

ми "me", long equivalent: мнѣ</b>

Variant in other languages:

[be]

[cs]

[cu]

[de]

[koi]

[kpv]

[la]

[lt]

[mdf]

[myv]

[orv]

[pl]

[qpm]

[ro]

[ru]

[sl]

[uk]

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
<?php

namespace Troiswa\BackBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints as Assert;

class ContactType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
    $builder
        ->add("firstname","text",
            array('constraints'=>
                array(
                    new Assert\Length(
                        array(
                            'min'        => 2,
                            'max'        => 25,
                            'minMessage' => 'Votre prénom doit faire au moins {{ limit }} caractères',
                            'maxMessage' => 'Votre prénom ne peut pas être plus long que {{ limit }} caractères',
                        )
                    ),
                    new Assert\NotBlank()
                )
            )
        )
        ->add("lastname","text",
            array('constraints'=>
                array(
                    new Assert\Length(
                        array(
                            'min'        => 5,
                            'max'        => 50,
                            'minMessage' => 'Votre nom doit faire au moins {{ limit }} caractères',
                            'maxMessage' => 'Votre nom ne peut pas être plus long que {{ limit }} caractères',
                        )
                    ),
                    new Assert\NotBlank()
                )
            )
        )
        ->add('objet', 'choice',
            array(  'choices'  =>
                array(
                    1 => 'Informations',
                    2 => 'Contestation'
                ),
                'required' => true,
                'multiple' => false,
                'expanded' => true,
                'constraints'=>
                    array(
                        new Assert\NotBlank()
                    )
            )
        )
        ->add("email","text",
            array('constraints'=>
                array(
                    new Assert\NotBlank()
                )
            )
        )
        ->add("message","textarea",
            array('constraints'=>
                array(
                    new Assert\Length(
                        array(
                            'min'        => 10,
                            'max'        => 500,
                            'minMessage' => 'Votre message doit contenir au moins {{ limit }} caractères',
                            'maxMessage' => 'Votre message ne peut dépasser { limit }} caractères',
                        )
                    ),
                    new Assert\NotBlank()
                )
            )
        )
        ->add('submit', 'submit');

    }

    public function configureOptions(OptionsResolver $resolver)
    {
    $resolver->setDefaults([]);
    }

    public function getName()
    {
    return 'form_contact';
    }
}


text:
layout: post
title: django常用组件学习2——django-taggit
tags: ["django"]
---
  标签(tag)是比较新兴的一种信息管理方式,与经典的分类的区别在于:

+  同一篇文章标签(Tag)可以用多个,但通常只能属于一个分类;
+  标签(Tag)一般是在写作完成后,根据文章大意进行添加的;
+  标签(Tag)可以把文章中重点词语提炼出来,有关键词的意义,但是分类没有;
+  标签(Tag)通常反映了您的主要关注点,比如财经、互联网、体育等等;
+  标签(Tag)给了我们一条联系他人的纽带,通过标签(Tag)可以找到您的"同好"。

现在很多网站,论坛,博客和软件都是支持标签(TAG)的那么我们怎么用django实现标签(TAG)功能呢,今天我就来学习一下django-taggit组件。

组件的github主页为https://github.com/alex/django-taggit

## 基本使用方式:

我们按官方文档来练习.
安装
{% highlight html %}
$ pip install django-taggit
{% endhighlight %}
一般不会有什么问题。
第二步,在项目中使用,我想在前面我学习django-filter的项目里,按照文档"Add "taggit" to your project's INSTALLED_APPS setting."
结果项目启动时报错。
{% highlight powershell %}
taggit.taggeditem: 'content_type' has a relation with model <class 'django.contrib.contenttypes.models.ContentType'>, which has either not been installed or is abstract.
{% endhighlight %}
这里因为还需要把"django.contrib.contenttypes"加入到 "INSTALLED\_APPS" 中。
然后运行manage.py syncdb 会生成表【TAGGIT\_TAG】和【TAGGIT\_TAGGEDITEM】。我们可以查看一下这两个表的结构:
{% highlight powershell %}
PS .\manage.py dbshell
SQLite version 3.8.7.2 2014-11-18 20:57:56
Enter ".help" for usage hints.
sqlite> .schema taggit_tag
CREATE TABLE "taggit_tag" (
    "id" integer NOT NULL PRIMARY KEY,
    "name" varchar(100) NOT NULL UNIQUE,
    "slug" varchar(100) NOT NULL UNIQUE
);
sqlite> .schema taggit_taggeditem
CREATE TABLE "taggit_taggeditem" (
    "id" integer NOT NULL PRIMARY KEY,
    "tag_id" integer NOT NULL REFERENCES "taggit_tag" ("id"),
    "object_id" integer NOT NULL,
    "content_type_id" integer NOT NULL REFERENCES "django_content_type" ("id")
);
CREATE INDEX "taggit_taggeditem_5659cca2" ON "taggit_taggeditem" ("tag_id");
CREATE INDEX "taggit_taggeditem_846f0221" ON "taggit_taggeditem" ("object_id");
CREATE INDEX "taggit_taggeditem_37ef4eb4" ON "taggit_taggeditem" ("content_type_id");
{% endhighlight %}
下面我们来修改模型:
{% highlight python %}
from taggit.managers import TaggableManager
class Cars(models.Model):
    # ... 原有字段略
    tags = TaggableManager()
    class Meta:
        db_table = 'office_cars'
{% endhighlight %}
在命令行测试一下:
{% highlight python %}
.\manage.py shell
In [1]: from apps.office.cars.models import Cars
In [2]: car = Cars()
In [3]: car.car=u'测试车1'
In [4]: car.save()
In [5]: car.tags.add(u'宝马',u'跑车')
In [6]: car2 = Cars()
In [7]: car2.car=u'测试车2'
In [8]: car2.save()
In [9]: car2.tags.add(u'摩托','跑车')
In [10]: car2.tags.all()
Out[10]: [<Tag: 摩托>, <Tag: 跑车]
In [11]: Cars.objects.filter(tags__name__in=[u"跑车"])
Out[12]: [<Cars: 测试车1>,<Cars: 测试车2>]
{% endhighlight %}
## 结合ModelForm使用:
使用forms接回request参数时会把输入的标签参数进行智能的分隔处理,分隔规则如下表。

<colgroup>
<col width="21%">
<col width="32%">
<col width="47%">
</colgroup>

Tag input string
Resulting tags
Notes

apple ball cat
["apple", "ball", "cat"]
No commas, so space delimited

apple, ball cat
["apple", "ball cat"]
Comma present, so comma delimited

"apple, ball" cat dog
["apple, ball", "cat", "dog"]
All commas are quoted, so space delimited

"apple, ball", cat dog
["apple, ball", "cat dog"]
Contains an unquoted comma, so comma delimited

apple "ball cat" dog
["apple", "ball cat", "dog"]
No commas, so space delimited

"apple" "ball dog
["apple", "ball", "dog"]
Unclosed double quote is ignored

注意:当"commit=False"时,需要用"save_m2m()"方法保存多对多关系数据,如下:
{% highlight python %}
if request.method == "POST":
    form = MyFormClass(request.POST)
    if form.is_valid():
        obj = form.save(commit=False)
        obj.user = request.user
        obj.save()
        # Without this next line the tags won't be saved.
        form.save_m2m()
{% endhighlight %}
## 其他:
+  默认使用【TAGGIT\_TAG】和【TAGGIT\_TAGGEDITEM】表保存标签及与记录的关联关系数据,但是我们可以通过继承TaggedItemBase来自定义模型来保存相关数据。
   参考 custom_tagging
+  实际应用中我们需要在前端实时提示现有的标签及使用情况,可以参与项目django-taggit-suggest及项目django-taggit-templatetags以及文章Suggesting tags with django-taggit and jQuery UI


text:
package io.github.ianfairman.family.entity.jpa;

import io.github.ianfairman.family.entity.Family;
import io.github.ianfairman.family.entity.Individual;
import io.github.ianfairman.family.value.FirstName;
import io.github.ianfairman.family.value.IndividualId;
import static io.github.ianfairman.family.value.IndividualId.individualId;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "INDIVIDUAL")
@NamedQueries({
    @NamedQuery(name = "IndividualJpa.findAll", query = "SELECT i FROM IndividualJpa i")
    ,
    @NamedQuery(name = "IndividualJpa.findById", query = "SELECT i FROM IndividualJpa i WHERE i.id = :id")
    ,
    @NamedQuery(name = "IndividualJpa.findByFirstName", query = "SELECT i FROM IndividualJpa i WHERE i.firstName = :firstName")})
public class IndividualJpa implements Serializable, Individual {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "FIRST_NAME")
    private FirstName firstName;
    @JoinColumn(name = "FAMILY_ID", referencedColumnName = "ID")
    @ManyToOne(targetEntity = FamilyJpa.class)
    private Family family;

    public IndividualJpa() {
    }

    public IndividualJpa(Integer id) {
        this.id = id;
    }

    public IndividualJpa(IndividualId id) {
        this.id = id.getValue();
    }

    @Transient
    @Override
    public IndividualId getId() {
        return individualId(id);
    }

    @Transient
    @Override
    public void setId(IndividualId id) {
        this.id = id.getValue();
    }

    @Transient
    @Override
    public FirstName getFirstName() {
        return firstName;
    }

    @Transient
    @Override
    public void setFirstName(FirstName firstName) {
        this.firstName = firstName;
    }

    @Override
    public Family getFamily() {
        return family;
    }

    @Override
    public void setFamily(Family family) {
        this.family = family;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IndividualJpa)) {
            return false;
        }
        IndividualJpa other = (IndividualJpa) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "template.example.jpa.liquibase.entity.Individual[ id=" + id + " ]";
    }

}


text:
using System;
using Org.Apache.Etch.Bindings.Csharp.Msg;

namespace Org.Apache.Etch.Bindings.Csharp.Support
{
    /// <summary>
    /// Validator for Runtime Exceptions
    /// </summary>
    public class Validator_RuntimeException : Validator
    {
        /// <summary></summary>
        /// <returns>an instance of the validator</returns>
        public static Validator_RuntimeException Get()
        {
            if ( validator == null )
                validator = new Validator_RuntimeException();

            return validator;
        }

        private static Validator_RuntimeException validator;

        public Validator_RuntimeException()
        {
            // nothing to do
        }

        public override Validator ElementValidator()
        {
            throw new Exception( "not an array" );
        }

        public override bool Validate( object value )
        {
            return ( value is Exception );
        }

        public override object ValidateValue(object value)
        {
            if (Validate(value))
                return value;

            throw new Exception("value not appropriate for RuntimeException: " + value);
        }
    }
}


text:
from sqlalchemy import Column, Integer, String, Boolean, Text
from sqlalchemy.schema import UniqueConstraint

from .base import Base

class ImgurAlbum(Base):
	__tablename__ = 'imgur_album'

	id 			= Column(Integer, primary_key=True)
	album_id 		= Column(String(512))
	image_count 		= Column(Integer)
	user			= Column(String(512))
	enabled 		= Column(Boolean, default=True)
	used_image_count	= Column(Integer)
	title			= Column(String(1024))
	description		= Column(Text)
	wallpaper		= Column(Boolean, default=False)
	favorite		= Column(Boolean, default=False)

	__table_args__ = (UniqueConstraint('album_id'),)


text:
#pragma once

#include <stdlib.h>

void os_heap_init(void);


text:
import mock
import unittest

import a10_openstack_lib.resources.a10_certificate as a10_certificate
import a10_openstack_lib.resources.a10_device_instance as a10_device_instance
import a10_openstack_lib.resources.a10_scaling_group as a10_scaling_group
import a10_openstack_lib.resources.template as template

class TestResources(unittest.TestCase):

    def check_resource_attribute_map(self, resources):
        supported_attributes = [
            'convert_to_int',
            'convert_kvp_list_to_dict',
            'convert_to_list',
            'convert_kvp_to_list',
            'ATTR_NOT_SPECIFIED'
        ]
        mock_attributes = mock.Mock(spec=supported_attributes)

        # This shouldn't blow up:
        template.apply_template(resources, mock_attributes)

    def test_a10_certificate(self):
        self.check_resource_attribute_map(a10_certificate.RESOURCE_ATTRIBUTE_MAP)

    def test_a10_device_instance(self):
        self.check_resource_attribute_map(a10_device_instance.RESOURCE_ATTRIBUTE_MAP)

    def test_a10_scaling_group(self):
        self.check_resource_attribute_map(a10_scaling_group.RESOURCE_ATTRIBUTE_MAP)


text:
class ApplicationController < ActionController::Base
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_action :set_locale

  def set_locale
    I18n.locale = params[:locale] || I18n.default_locale
  end
end


text:
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/secure_channel/nearby_connector_impl.h"

#include <memory>
#include <vector>

#include "ash/services/nearby/public/cpp/fake_nearby_process_manager.h"
#include "ash/services/secure_channel/public/mojom/nearby_connector.mojom.h"
#include "base/containers/flat_map.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/task_environment.h"
#include "chrome/browser/ash/secure_channel/fake_nearby_connection_broker.h"
#include "chrome/browser/ash/secure_channel/fake_nearby_endpoint_finder.h"
#include "chrome/browser/ash/secure_channel/nearby_connection_broker_impl.h"
#include "chrome/browser/ash/secure_channel/nearby_endpoint_finder_impl.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace ash {
namespace secure_channel {
namespace {

int g_next_message_receiver_id = 0;

const std::vector<uint8_t> GetEid() {
  return std::vector<uint8_t>{0, 1};
}

std::vector<uint8_t> GetBluetoothAddress(uint8_t repeated_address_value) {
  return std::vector<uint8_t>(6u, repeated_address_value);
}

class FakeEndpointFinderFactory : public NearbyEndpointFinderImpl::Factory {
 public:
  FakeEndpointFinderFactory() = default;
  ~FakeEndpointFinderFactory() override = default;

 private:
  // NearbyEndpointFinderImpl::Factory:
  std::unique_ptr<NearbyEndpointFinder> CreateInstance(
      const mojo::SharedRemote<
          location::nearby::connections::mojom::NearbyConnections>&
          nearby_connections) override {
    return std::make_unique<FakeNearbyEndpointFinder>();
  }
};

class FakeConnectionBrokerFactory : public NearbyConnectionBrokerImpl::Factory {
 public:
  FakeConnectionBrokerFactory() = default;
  ~FakeConnectionBrokerFactory() override = default;

  FakeNearbyConnectionBroker* last_created() { return last_created_; }

 private:
  // NearbyConnectionBrokerImpl::Factory:
  std::unique_ptr<NearbyConnectionBroker> CreateInstance(
      const std::vector<uint8_t>& bluetooth_public_address,
      NearbyEndpointFinder* endpoint_finder,
      mojo::PendingReceiver<mojom::NearbyMessageSender> message_sender_receiver,
      mojo::PendingReceiver<mojom::NearbyFilePayloadHandler>
          file_payload_handler_receiver,
      mojo::PendingRemote<mojom::NearbyMessageReceiver> message_receiver_remote,
      const mojo::SharedRemote<
          location::nearby::connections::mojom::NearbyConnections>&
          nearby_connections,
      base::OnceClosure on_connected_callback,
      base::OnceClosure on_disconnected_callback,
      std::unique_ptr<base::OneShotTimer> timer) override {
    auto instance = std::make_unique<FakeNearbyConnectionBroker>(
        bluetooth_public_address, std::move(message_sender_receiver),
        std::move(file_payload_handler_receiver),
        std::move(message_receiver_remote), std::move(on_connected_callback),
        std::move(on_disconnected_callback));
    last_created_ = instance.get();
    return instance;
  }

  FakeNearbyConnectionBroker* last_created_ = nullptr;
};

class FakeMessageReceiver : public mojom::NearbyMessageReceiver {
 public:
  FakeMessageReceiver() = default;
  ~FakeMessageReceiver() override = default;

  int id() const { return id_; }
  const std::vector<std::string>& received_messages() const {
    return received_messages_;
  }

  mojo::PendingRemote<mojom::NearbyMessageReceiver> GeneratePendingRemote() {
    return receiver_.BindNewPipeAndPassRemote();
  }

  void set_on_message_received(base::OnceClosure on_message_received) {
    on_message_received_ = std::move(on_message_received);
  }

  void SetMojoDisconnectHandler(base::OnceClosure on_disconnected) {
    receiver_.set_disconnect_handler(std::move(on_disconnected));
  }

 private:
  // mojom::NearbyMessageReceiver:
  void OnMessageReceived(const std::string& message) override {
    received_messages_.push_back(message);
    std::move(on_message_received_).Run();
  }

  int id_ = g_next_message_receiver_id++;
  mojo::Receiver<mojom::NearbyMessageReceiver> receiver_{this};
  base::OnceClosure on_message_received_;
  std::vector<std::string> received_messages_;
};

}  // namespace

class NearbyConnectorImplTest : public testing::Test {
 protected:
  NearbyConnectorImplTest() = default;
  ~NearbyConnectorImplTest() override = default;

  // testing::Test:
  void SetUp() override {
    NearbyConnectionBrokerImpl::Factory::SetFactoryForTesting(
        &fake_connection_broker_factory_);
    NearbyEndpointFinderImpl::Factory::SetFactoryForTesting(
        &fake_endpoint_finder_factory_);

    connector_ =
        std::make_unique<NearbyConnectorImpl>(&fake_nearby_process_manager_);
  }

  void TearDown() override {
    NearbyConnectionBrokerImpl::Factory::SetFactoryForTesting(nullptr);
    NearbyEndpointFinderImpl::Factory::SetFactoryForTesting(nullptr);
  }

  void Connect(FakeMessageReceiver* fake_message_receiver,
               const std::vector<uint8_t>& address) {
    connector_->Connect(
        address, GetEid(), fake_message_receiver->GeneratePendingRemote(),
        base::BindOnce(&NearbyConnectorImplTest::OnConnectResult,
                       base::Unretained(this), fake_message_receiver->id()));
  }

  // Invoked when OnConnectResult() is called.
  base::OnceClosure on_connect_;

  // Keyed by FakeMessageReceiver::id().
  base::flat_map<int, mojo::Remote<mojom::NearbyMessageSender>>
      id_to_remote_map_;

  FakeConnectionBrokerFactory fake_connection_broker_factory_;
  nearby::FakeNearbyProcessManager fake_nearby_process_manager_;

 private:
  void OnConnectResult(int id,
                       mojo::PendingRemote<mojom::NearbyMessageSender>
                           message_sender_pending_remote,
                       mojo::PendingRemote<mojom::NearbyFilePayloadHandler>
                           file_payload_handler_remote) {
    if (!message_sender_pending_remote)
      id_to_remote_map_[id] = mojo::Remote<mojom::NearbyMessageSender>();
    else
      id_to_remote_map_[id].Bind(std::move(message_sender_pending_remote));

    std::move(on_connect_).Run();
  }

  base::test::TaskEnvironment task_environment_;

  FakeEndpointFinderFactory fake_endpoint_finder_factory_;

  std::unique_ptr<NearbyConnector> connector_;
};

TEST_F(NearbyConnectorImplTest, ConnectAndTransferMessages) {
  // Attempt connection.
  FakeMessageReceiver receiver;
  Connect(&receiver, GetBluetoothAddress(/*repeated_address_value=*/1u));
  FakeNearbyConnectionBroker* broker =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Complete connection.
  base::RunLoop connect_run_loop;
  on_connect_ = connect_run_loop.QuitClosure();
  broker->NotifyConnected();
  connect_run_loop.Run();

  // Send a message.
  base::RunLoop send_run_loop;
  id_to_remote_map_[receiver.id()]->SendMessage(
      "hi", base::BindLambdaForTesting([&](bool success) {
        EXPECT_TRUE(success);
        send_run_loop.Quit();
      }));
  send_run_loop.Run();
  EXPECT_EQ("hi", broker->sent_messages()[0]);

  // Receive a message.
  base::RunLoop receive_run_loop;
  receiver.set_on_message_received(receive_run_loop.QuitClosure());
  broker->NotifyMessageReceived("bye");
  receive_run_loop.Run();
  EXPECT_EQ("bye", receiver.received_messages()[0]);

  // Disconnect.
  base::RunLoop disconnect_run_loop;
  receiver.SetMojoDisconnectHandler(disconnect_run_loop.QuitClosure());
  broker->InvokeDisconnectedCallback();
  disconnect_run_loop.Run();
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
}

TEST_F(NearbyConnectorImplTest, TwoConnections) {
  // Attempt connection 1.
  FakeMessageReceiver receiver1;
  Connect(&receiver1, GetBluetoothAddress(/*repeated_address_value=*/1u));
  FakeNearbyConnectionBroker* broker1 =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Attempt connection 2 before connection 1 has completed. No new broker
  // should have been created since they are queued.
  FakeMessageReceiver receiver2;
  Connect(&receiver2, GetBluetoothAddress(/*repeated_address_value=*/2u));
  EXPECT_EQ(broker1, fake_connection_broker_factory_.last_created());
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Complete connection 1.
  base::RunLoop connect_run_loop1;
  on_connect_ = connect_run_loop1.QuitClosure();
  broker1->NotifyConnected();
  connect_run_loop1.Run();

  // A new broker should have been created for connection 2 since connection 1
  // has completed.
  FakeNearbyConnectionBroker* broker2 =
      fake_connection_broker_factory_.last_created();
  EXPECT_NE(broker1, broker2);

  // Complete connection 2.
  base::RunLoop connect_run_loop2;
  on_connect_ = connect_run_loop2.QuitClosure();
  broker2->NotifyConnected();
  connect_run_loop2.Run();

  // Disconnect connection 1. The process reference should still be active since
  // there is still an active connection.
  base::RunLoop disconnect_run_loop1;
  receiver1.SetMojoDisconnectHandler(disconnect_run_loop1.QuitClosure());
  broker1->InvokeDisconnectedCallback();
  disconnect_run_loop1.Run();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Disconnect connection 2. The process reference should have been released.
  base::RunLoop disconnect_run_loop2;
  receiver2.SetMojoDisconnectHandler(disconnect_run_loop2.QuitClosure());
  broker2->InvokeDisconnectedCallback();
  disconnect_run_loop2.Run();
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
}

// Regression test for https://crbug.com/1156162.
TEST_F(NearbyConnectorImplTest, TwoConnections_FirstFails) {
  // Attempt connection 1.
  FakeMessageReceiver receiver1;
  Connect(&receiver1, GetBluetoothAddress(/*repeated_address_value=*/1u));
  FakeNearbyConnectionBroker* broker1 =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Attempt connection 2 before connection 1 has completed. No new broker
  // should have been created since they are queued.
  FakeMessageReceiver receiver2;
  Connect(&receiver2, GetBluetoothAddress(/*repeated_address_value=*/2u));
  EXPECT_EQ(broker1, fake_connection_broker_factory_.last_created());
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Fail connection 1 by calling Disconnect() before completing the connection.
  base::RunLoop connect_run_loop;
  on_connect_ = connect_run_loop.QuitClosure();
  base::RunLoop disconnect_run_loop;
  receiver1.SetMojoDisconnectHandler(disconnect_run_loop.QuitClosure());
  broker1->InvokeDisconnectedCallback();
  connect_run_loop.Run();
  disconnect_run_loop.Run();

  // A new broker should have been created for connection 2 since connection 1
  // has completed.
  FakeNearbyConnectionBroker* broker2 =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Complete connection 2.
  base::RunLoop connect_run_loop2;
  on_connect_ = connect_run_loop2.QuitClosure();
  broker2->NotifyConnected();
  connect_run_loop2.Run();

  // Disconnect connection 2. The process reference should have been released.
  base::RunLoop disconnect_run_loop2;
  receiver2.SetMojoDisconnectHandler(disconnect_run_loop2.QuitClosure());
  broker2->InvokeDisconnectedCallback();
  disconnect_run_loop2.Run();
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
}

TEST_F(NearbyConnectorImplTest, FailToConnect) {
  // Attempt connection.
  FakeMessageReceiver receiver;
  Connect(&receiver, GetBluetoothAddress(/*repeated_address_value=*/1u));
  FakeNearbyConnectionBroker* broker =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Fail connection by calling Disconnect() before completing the connection.
  base::RunLoop connect_run_loop;
  on_connect_ = connect_run_loop.QuitClosure();
  base::RunLoop disconnect_run_loop;
  receiver.SetMojoDisconnectHandler(disconnect_run_loop.QuitClosure());
  broker->InvokeDisconnectedCallback();
  connect_run_loop.Run();
  disconnect_run_loop.Run();

  // The mojo::Remote<mojom::NearbyMessageSender> should be null.
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
  EXPECT_FALSE(id_to_remote_map_[receiver.id()]);
}

TEST_F(NearbyConnectorImplTest, NearbyProcessStops) {
  // Attempt connection.
  FakeMessageReceiver receiver;
  Connect(&receiver, GetBluetoothAddress(/*repeated_address_value=*/1u));
  FakeNearbyConnectionBroker* broker =
      fake_connection_broker_factory_.last_created();
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Complete connection.
  base::RunLoop connect_run_loop;
  on_connect_ = connect_run_loop.QuitClosure();
  broker->NotifyConnected();
  connect_run_loop.Run();

  // Stop the Nearby process; this should result in a disconnection.
  base::RunLoop disconnect_run_loop;
  receiver.SetMojoDisconnectHandler(disconnect_run_loop.QuitClosure());
  fake_nearby_process_manager_.SimulateProcessStopped(
      nearby::NearbyProcessManager::NearbyProcessShutdownReason::kNormal);
  disconnect_run_loop.Run();
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
}

TEST_F(NearbyConnectorImplTest, NearbyProcessStopsDuringConnectionAttempt) {
  // Attempt connection.
  FakeMessageReceiver receiver;
  Connect(&receiver, GetBluetoothAddress(/*repeated_address_value=*/1u));
  EXPECT_EQ(1u, fake_nearby_process_manager_.GetNumActiveReferences());

  // Stop the Nearby process; this should result in a disconnection.
  base::RunLoop connect_run_loop;
  on_connect_ = connect_run_loop.QuitClosure();
  base::RunLoop disconnect_run_loop;
  receiver.SetMojoDisconnectHandler(disconnect_run_loop.QuitClosure());
  fake_nearby_process_manager_.SimulateProcessStopped(
      nearby::NearbyProcessManager::NearbyProcessShutdownReason::kNormal);
  connect_run_loop.Run();
  disconnect_run_loop.Run();
  EXPECT_EQ(0u, fake_nearby_process_manager_.GetNumActiveReferences());
}

}  // namespace secure_channel
}  // namespace ash


text:
package mil.nga.geopackage.tiles.features;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.sql.SQLException;
import java.util.Date;

import mil.nga.geopackage.BoundingBox;
import mil.nga.geopackage.GeoPackage;
import mil.nga.geopackage.contents.Contents;
import mil.nga.geopackage.contents.ContentsDao;
import mil.nga.geopackage.db.TableColumnKey;
import mil.nga.geopackage.features.columns.GeometryColumns;
import mil.nga.geopackage.features.user.FeatureDao;
import mil.nga.geopackage.features.user.FeatureRow;
import mil.nga.geopackage.features.user.FeatureTableMetadata;
import mil.nga.geopackage.geom.GeoPackageGeometryData;
import mil.nga.proj.ProjectionConstants;
import mil.nga.sf.GeometryType;
import mil.nga.sf.LineString;
import mil.nga.sf.Point;
import mil.nga.sf.Polygon;

/**
 * Feature Tile Utils
 */
public class FeatureTileUtils {

	public static final String TABLE_NAME = "feature_tiles";

	/**
	 * Create feature dao
	 *
	 * @param geoPackage
	 *            GeoPackage
	 *
	 * @return feature dao
	 */
	public static FeatureDao createFeatureDao(GeoPackage geoPackage) {

		BoundingBox boundingBox = BoundingBox.worldWGS84();

		GeometryColumns geometryColumns = new GeometryColumns();
		geometryColumns.setId(new TableColumnKey(TABLE_NAME, "geom"));
		geometryColumns.setGeometryType(GeometryType.GEOMETRY);
		geometryColumns.setZ((byte) 0);
		geometryColumns.setM((byte) 0);
		geometryColumns
				.setSrsId(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM);

		geoPackage.createFeatureTable(
				FeatureTableMetadata.create(geometryColumns, boundingBox));

		FeatureDao featureDao = geoPackage.getFeatureDao(geometryColumns);

		return featureDao;
	}

	/**
	 * Insert features
	 *
	 * @param featureDao
	 * @return number of features
	 */
	public static int insertFeatures(GeoPackage geoPackage,
			FeatureDao featureDao) throws SQLException {

		int count = 0;

		count += 5;
		insertPoint(featureDao, 0, 0);
		insertPoint(featureDao, 0,
				ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE - 1);
		insertPoint(featureDao, 0,
				ProjectionConstants.WEB_MERCATOR_MIN_LAT_RANGE + 1);
		insertPoint(featureDao, -179, 0);
		insertPoint(featureDao, 179, 0);

		count += 4;
		insertFourPoints(featureDao, 179,
				ProjectionConstants.WEB_MERCATOR_MAX_LAT_RANGE - 1);
		count += 4;
		insertFourPoints(featureDao, 90, 45);

		count += 4;
		insertFourLines(featureDao, new double[][] { { 135.0, 67.5 },
				{ 90.0, 45.0 }, { 135.0, 45.0 } });

		count += 4;
		insertFourPolygons(featureDao,
				new double[][] { { 60.0, 35.0 }, { 65.0, 15.0 }, { 15.0, 20.0 },
						{ 20.0, 40.0 } },
				new double[][] { { 50.0, 30.0 }, { 48.0, 22.0 }, { 30.0, 23.0 },
						{ 25.0, 34.0 } });

		updateLastChange(geoPackage, featureDao);

		return count;
	}

	/**
	 * Create a new feature tiles
	 *
	 * @param geoPackage
	 * @param featureDao
	 * @param useIcon
	 *            true to use an icon instead of the default point
	 * @return feature tiles
	 */
	public static FeatureTiles createFeatureTiles(GeoPackage geoPackage,
			FeatureDao featureDao, boolean useIcon) {

		FeatureTiles featureTiles = new DefaultFeatureTiles(featureDao);

		if (useIcon) {
			BufferedImage icon = new BufferedImage(5, 5,
					BufferedImage.TYPE_INT_ARGB);
			Graphics2D graphics = icon.createGraphics();
			graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
					RenderingHints.VALUE_ANTIALIAS_ON);
			graphics.setColor(Color.MAGENTA);
			graphics.fillRect(0, 0, 5, 5);
			FeatureTilePointIcon pointIcon = new FeatureTilePointIcon(icon);
			pointIcon.centerIcon();
			featureTiles.setPointIcon(pointIcon);
		} else {
			featureTiles.setPointColor(Color.BLUE);
		}

		featureTiles.setLineColor(Color.GREEN);

		featureTiles.setPolygonColor(Color.RED);

		featureTiles.setFillPolygon(true);
		featureTiles.setPolygonFillColor(new Color(255, 0, 0, 50));

		featureTiles.calculateDrawOverlap();

		return featureTiles;
	}

	public static void insertFourPoints(FeatureDao featureDao, double x,
			double y) {
		insertPoint(featureDao, x, y);
		insertPoint(featureDao, x, -1 * y);
		insertPoint(featureDao, -1 * x, y);
		insertPoint(featureDao, -1 * x, -1 * y);
	}

	public static void insertFourLines(FeatureDao featureDao,
			double[][] points) {
		insertLine(featureDao, convertPoints(points, false, false));
		insertLine(featureDao, convertPoints(points, true, false));
		insertLine(featureDao, convertPoints(points, false, true));
		insertLine(featureDao, convertPoints(points, true, true));
	}

	public static void insertFourPolygons(FeatureDao featureDao,
			double[][]... points) {
		insertPolygon(featureDao, convertPoints(false, false, points));
		insertPolygon(featureDao, convertPoints(true, false, points));
		insertPolygon(featureDao, convertPoints(false, true, points));
		insertPolygon(featureDao, convertPoints(true, true, points));
	}

	private static double[][] convertPoints(double[][] points,
			boolean negativeX, boolean negativeY) {

		double[][] newPoints = new double[points.length][2];
		for (int i = 0; i < points.length; i++) {
			newPoints[i][0] = negativeX ? points[i][0] * -1 : points[i][0];
			newPoints[i][1] = negativeY ? points[i][1] * -1 : points[i][1];
		}

		return newPoints;
	}

	private static double[][][] convertPoints(boolean negativeX,
			boolean negativeY, double[][]... points) {

		double[][][] newPoints = new double[points.length][][];
		for (int i = 0; i < points.length; i++) {
			newPoints[i] = convertPoints(points[i], negativeX, negativeY);
		}

		return newPoints;
	}

	public static long insertPoint(FeatureDao featureDao, double x, double y) {
		FeatureRow featureRow = featureDao.newRow();
		setPoint(featureRow, x, y);
		return featureDao.insert(featureRow);
	}

	public static void setPoint(FeatureRow featureRow, double x, double y) {
		GeoPackageGeometryData geomData = GeoPackageGeometryData.create(
				ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM,
				new Point(x, y));
		featureRow.setGeometry(geomData);
	}

	public static long insertLine(FeatureDao featureDao, double[][] points) {
		FeatureRow featureRow = featureDao.newRow();
		GeoPackageGeometryData geomData = GeoPackageGeometryData.create(
				ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM,
				getLineString(points));
		featureRow.setGeometry(geomData);
		return featureDao.insert(featureRow);
	}

	private static LineString getLineString(double[][] points) {
		LineString lineString = new LineString(false, false);
		for (int i = 0; i < points.length; i++) {
			Point point = new Point(false, false, points[i][0], points[i][1]);
			lineString.addPoint(point);
		}
		return lineString;
	}

	public static long insertPolygon(FeatureDao featureDao,
			double[][]... points) {
		FeatureRow featureRow = featureDao.newRow();
		Polygon polygon = new Polygon();
		GeoPackageGeometryData geomData = GeoPackageGeometryData.create(
				ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM, polygon);
		for (double[][] ring : points) {
			LineString lineString = getLineString(ring);
			polygon.addRing(lineString);
		}
		featureRow.setGeometry(geomData);
		return featureDao.insert(featureRow);
	}

	public static void updateLastChange(GeoPackage geoPackage,
			FeatureDao featureDao) throws SQLException {
		Contents contents = featureDao.getContents();
		contents.setLastChange(new Date());
		ContentsDao contentsDao = geoPackage.getContentsDao();
		contentsDao.update(contents);
	}

}


text:
.class Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;
.super Ljava/lang/Object;
.source "HtcTabHost.java"

# interfaces
.implements Lcom/htc/fragment/widget/HtcTabHost$IndicatorStrategy;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/htc/fragment/widget/HtcTabHost;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "LabelAndIconIndicatorStrategy"
.end annotation

# instance fields
.field private final mIcon:Landroid/graphics/drawable/Drawable;

.field private final mLabel:Ljava/lang/CharSequence;

.field final synthetic this$0:Lcom/htc/fragment/widget/HtcTabHost;

# direct methods
.method private constructor <init>(Lcom/htc/fragment/widget/HtcTabHost;Ljava/lang/CharSequence;Landroid/graphics/drawable/Drawable;)V
    .locals 0
    .parameter
    .parameter "label"
    .parameter "icon"

    .prologue
    .line 802
    iput-object p1, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 803
    iput-object p2, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->mLabel:Ljava/lang/CharSequence;

    .line 804
    iput-object p3, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->mIcon:Landroid/graphics/drawable/Drawable;

    .line 805
    return-void
.end method

.method synthetic constructor <init>(Lcom/htc/fragment/widget/HtcTabHost;Ljava/lang/CharSequence;Landroid/graphics/drawable/Drawable;Lcom/htc/fragment/widget/HtcTabHost$1;)V
    .locals 0
    .parameter "x0"
    .parameter "x1"
    .parameter "x2"
    .parameter "x3"

    .prologue
    .line 797
    invoke-direct {p0, p1, p2, p3}, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;-><init>(Lcom/htc/fragment/widget/HtcTabHost;Ljava/lang/CharSequence;Landroid/graphics/drawable/Drawable;)V

    return-void
.end method

# virtual methods
.method public createIndicatorView()Landroid/view/View;
    .locals 8

    .prologue
    .line 812
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    invoke-virtual {v5}, Lcom/htc/fragment/widget/HtcTabHost;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 813
    .local v0, context:Landroid/content/Context;
    const-string v5, "layout_inflater"

    invoke-virtual {v0, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/LayoutInflater;

    .line 815
    .local v2, inflater:Landroid/view/LayoutInflater;
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    #getter for: Lcom/htc/fragment/widget/HtcTabHost;->mTabLayoutId:I
    invoke-static {v5}, Lcom/htc/fragment/widget/HtcTabHost;->access$900(Lcom/htc/fragment/widget/HtcTabHost;)I

    move-result v5

    iget-object v6, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    #getter for: Lcom/htc/fragment/widget/HtcTabHost;->mTabWidget:Lcom/htc/fragment/widget/HtcTabWidget;
    invoke-static {v6}, Lcom/htc/fragment/widget/HtcTabHost;->access$1000(Lcom/htc/fragment/widget/HtcTabHost;)Lcom/htc/fragment/widget/HtcTabWidget;

    move-result-object v6

    const/4 v7, 0x0

    invoke-virtual {v2, v5, v6, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v3

    .line 820
    .local v3, tabIndicator:Landroid/view/View;
    const v5, 0x1020016

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    .line 821
    .local v4, tv:Landroid/widget/TextView;
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->mLabel:Ljava/lang/CharSequence;

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 823
    const v5, 0x1020006

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    .line 824
    .local v1, iconView:Landroid/widget/ImageView;
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->mIcon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1, v5}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 826
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    #getter for: Lcom/htc/fragment/widget/HtcTabHost;->mTabLayoutId:I
    invoke-static {v5}, Lcom/htc/fragment/widget/HtcTabHost;->access$900(Lcom/htc/fragment/widget/HtcTabHost;)I

    move-result v5

    const v6, 0x109009e

    if-ne v5, v6, :cond_2

    .line 827
    const-string v5, "tab_indicator_holo"

    const v6, 0x108057c

    invoke-static {v0, v5, v6}, Lcom/htc/util/skin/HtcSkinUtil;->getDrawableResIdentifier(Landroid/content/Context;Ljava/lang/String;I)I

    move-result v5

    invoke-virtual {v3, v5}, Landroid/view/View;->setBackgroundResource(I)V

    .line 832
    :cond_0
    :goto_0
    invoke-virtual {v0}, Landroid/content/Context;->getApplicationInfo()Landroid/content/pm/ApplicationInfo;

    move-result-object v5

    iget v5, v5, Landroid/content/pm/ApplicationInfo;->targetSdkVersion:I

    const/4 v6, 0x4

    if-gt v5, v6, :cond_1

    .line 834
    const v5, 0x108057d

    invoke-virtual {v3, v5}, Landroid/view/View;->setBackgroundResource(I)V

    .line 835
    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    const v6, 0x106007d

    invoke-virtual {v5, v6}, Landroid/content/res/Resources;->getColorStateList(I)Landroid/content/res/ColorStateList;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setTextColor(Landroid/content/res/ColorStateList;)V

    .line 838
    :cond_1
    return-object v3

    .line 828
    :cond_2
    iget-object v5, p0, Lcom/htc/fragment/widget/HtcTabHost$LabelAndIconIndicatorStrategy;->this$0:Lcom/htc/fragment/widget/HtcTabHost;

    #getter for: Lcom/htc/fragment/widget/HtcTabHost;->mTabLayoutId:I
    invoke-static {v5}, Lcom/htc/fragment/widget/HtcTabHost;->access$900(Lcom/htc/fragment/widget/HtcTabHost;)I

    move-result v5

    const v6, 0x109009d

    if-ne v5, v6, :cond_0

    .line 829
    const-string v5, "tab_indicator"

    const v6, 0x108057a

    invoke-static {v0, v5, v6}, Lcom/htc/util/skin/HtcSkinUtil;->getDrawableResIdentifier(Landroid/content/Context;Ljava/lang/String;I)I

    move-result v5

    invoke-virtual {v3, v5}, Landroid/view/View;->setBackgroundResource(I)V

    goto :goto_0
.end method


text:
import logging

from django.utils.translation import ugettext_lazy as _

from horizon import tables

from openstack_dashboard import api

LOG = logging.getLogger(__name__)

class DeleteRacks(tables.DeleteAction):
    data_type_singular = _("Rack")
    data_type_plural = _("Racks")

    def delete(self, request, obj_id):
        api.tuskar.Rack.delete(request, obj_id)

class CreateRack(tables.LinkAction):
    name = "create"
    verbose_name = _("Create Rack")
    url = "horizon:infrastructure:resource_management:racks:create"
    classes = ("ajax-modal", "btn-create")

class UploadRack(tables.LinkAction):
    name = "upload"
    verbose_name = _("Upload Rack")
    url = "horizon:infrastructure:resource_management:racks:upload"
    classes = ("ajax-modal", "btn-upload")

class EditRack(tables.LinkAction):
    name = "edit"
    verbose_name = _("Edit Rack")
    url = "horizon:infrastructure:resource_management:racks:edit"
    classes = ("ajax-modal", "btn-edit")

class RacksFilterAction(tables.FilterAction):

    def filter(self, table, racks, filter_string):
        """ Naive case-insensitive search. """
        q = filter_string.lower()
        return [rack for rack in racks
                if q in rack.name.lower()]

class UpdateRow(tables.Row):
    ajax = True

    def get_data(self, request, rack_id):
        rack = api.tuskar.Rack.get(request, rack_id)
        return rack

class RacksTable(tables.DataTable):
    STATUS_CHOICES = (
        ("unprovisioned", False),
        ("provisioning", None),
        ("active", True),
        ("error", False),
    )
    name = tables.Column('name',
                         link=("horizon:infrastructure:resource_management"
                               ":racks:detail"),
                         verbose_name=_("Rack Name"))
    subnet = tables.Column('subnet', verbose_name=_("IP Subnet"))
    resource_class = tables.Column('get_resource_class',
                                    verbose_name=_("Class"),
                                    filters=(lambda resource_class:
                                                 (resource_class and
                                                  resource_class.name)
                                             or None,))
    node_count = tables.Column('nodes_count', verbose_name=_("Nodes"))
    state = tables.Column('state',
                          verbose_name=_("State"),
                          status=True,
                          status_choices=STATUS_CHOICES)
    usage = tables.Column(
              'vm_capacity',
              verbose_name=_("Usage"),
              filters=(lambda vm_capacity:
                (vm_capacity.value and
                    "%s %%" % int(round((100 / float(vm_capacity.value)) *
                                        vm_capacity.usage, 0))) or None,))

    class Meta:
        name = "racks"
        row_class = UpdateRow
        status_columns = ["state"]
        verbose_name = _("Racks")
        table_actions = (UploadRack, CreateRack, DeleteRacks,
                         RacksFilterAction)
        row_actions = (EditRack, DeleteRacks)

class UploadRacksTable(tables.DataTable):
    name = tables.Column("name")
    subnet = tables.Column("subnet")
    nodes_count = tables.Column("nodes_count")
    #region = tables.Column("region")

    class Meta:
        name = "uploaded_racks"
        verbose_name = " "


text:
/*
 * This file is subject to the terms of the GFX License. If a copy of
 * the license was not distributed with this file, you can obtain one at:
 *
 *              http://ugfx.org/license.html
 */

#ifndef _GINPUT_LLD_TOGGLE_CONFIG_H
#define _GINPUT_LLD_TOGGLE_CONFIG_H

#if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE

#define GINPUT_TOGGLE_POLL_PERIOD		TIME_INFINITE	// We are interrupt driven (or polled - either works here)

// This driver is unique in that it can support 8 buttons per window across multiple windows.
// GINPUT_TOGGLE_CONFIG_ENTRIES just must be less than the number of GDISP windows (GDISP_DRIVER_COUNT_WIN32).
// DEPRECATED: Currently only supports a single window with buttons until toggles use GDriver
#ifndef GINPUT_TOGGLE_CONFIG_ENTRIES
	#define GINPUT_TOGGLE_CONFIG_ENTRIES	1			// The total number of GToggleConfig entries
#endif

// The total number of toggle inputs
#define GINPUT_TOGGLE_NUM_PORTS		(8 * GINPUT_TOGGLE_CONFIG_ENTRIES)

#define GINPUT_TOGGLE_SW1			0				// Switch 1	- Toggle
#define GINPUT_TOGGLE_SW2			1				// Switch 2	- Toggle
#define GINPUT_TOGGLE_SW3			2				// Switch 3	- Toggle
#define GINPUT_TOGGLE_SW4			3				// Switch 4	- Toggle

#define GINPUT_TOGGLE_MOMENTARY1	4				// Switch 5	- Momentary
#define GINPUT_TOGGLE_MOMENTARY2	5				// Switch 6	- Momentary
#define GINPUT_TOGGLE_MOMENTARY3	6				// Switch 7	- Momentary
#define GINPUT_TOGGLE_MOMENTARY4	7				// Switch 8	- Momentary

// This pattern of switch and momentary action is repeated across all windows.

#endif	/* GFX_USE_GDISP && GINPUT_NEED_TOGGLE */

#endif	/* _GINPUT_LLD_TOGGLE_CONFIG_H */