text:
* {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.btn,
.badge,
.modal,
.modal-dialog,
.modal-content,
input,
select {
  -ms-border-radius: 0 !important;
  border-radius: 0 !important;
}
input,
select {
  padding: 4px !important;
  display: inline-block !important;
}
.navbar * {
  background-image: none !important;
  -webkit-text-shadow: none !important;
  -ms-text-shadow: none !important;
  text-shadow: none !important;
}
form * {
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}
input,
textarea {
  background-image: none !important;
  border: 1px solid #cccccc !important;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}
select {
  font-size: 13px !important;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}
input[type="radio"],
input[type="checkbox"] {
  margin: 0 0 0 !important;
  margin-right: 5px !important;
  line-height: 23px !important;
  border: 0 !important;
}
.btn {
  background-image: none !important;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px !important;
}
.btn.btn-mini {
  font-size: 11px !important;
}
body {
  font-size: 13px;
  line-height: 23px;
  color: #666666;
  background: #111111;
  padding-top: 45px;
  -webkit-font-smoothing: antialiased;
}
body .container {
  width: 97%;
  padding-left: 1.5%;
  padding-right: 1.5%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  padding: 2px 0;
  margin: 2px 0;
  color: #777777;
  font-weight: 400;
}
h2 {
  font-size: 30px;
  line-height: 40px;
}
h3 {
  font-size: 23px;
  line-height: 33px;
}
h4 {
  font-size: 20px;
  line-height: 30px;
}
h5 {
  font-size: 18px;
  line-height: 28px;
}
h6 {
  font-size: 15px;
  line-height: 25px;
}
p {
  padding: 1px 0 !important;
  margin: 1px 0 !important;
}
a {
  color: #333333;
  text-decoration: none !important;
}
a:hover {
  color: #888888;
  text-decoration: none;
}
a:hover,
a:focus,
a:active {
  outline: 0;
}
.bold {
  font-weight: 600;
}
hr {
  margin: 8px 0 8px 0 !important;
  padding: 0 !important;
  border-top: 0;
  border-bottom: 1px solid #eeeeee !important;
  height: 0;
}
:focus {
  outline: none;
}
::-moz-focus-inner {
  border: 0;
}
.well {
  padding: 10px 15px;
}
a.btn {
  font-size: 13px !important;
}
.label {
  font-weight: 400;
  padding: 3px 6px !important;
  font-size: 13px;
}
.control-label {
  font-weight: 400 !important;
  font-size: 14px;
}
.badge {
  font-weight: 400;
  padding: 3px 8px;
  font-size: 13px;
}
.progress {
  height: 17px;
  line-height: 17px;
  margin: 5px 0 !important;
  border: 0;
}
.progress .bar {
  font-size: 12px;
}
.btn.btn-primary {
  background: #1171a3 !important;
}
.btn.btn-primary:hover {
  background: #0c5175 !important;
}
.btn.btn-info {
  background: #52b9e9 !important;
}
.btn.btn-info:hover {
  background: #25a7e3 !important;
}
.btn.btn-success {
  background: #43c83c !important;
}
.btn.btn-success:hover {
  background: #34a32e !important;
}
.btn.btn-warning {
  background: #f88529 !important;
}
.btn.btn-warning:hover {
  background: #e66b08 !important;
}
.btn.btn-danger {
  background: #fa3031 !important;
}
.btn.btn-danger:hover {
  background: #f10607 !important;
}
.label.label-success,
.badge.badge-success {
  background: #43c83c !important;
}
.label.label-warning,
.badge.badge-warning {
  background: #f88529 !important;
}
.label.label-important,
.badge.badge-important {
  background: #fa3031 !important;
}
.label.label-info,
.badge.badge-info {
  background: #52b9e9 !important;
}
.blightblue {
  background: #52b9e9 !important;
  color: #ffffff !important;
  border: 0 !important;
}
.bblue {
  background: #1171a3 !important;
  color: #ffffff !important;
  border: 0 !important;
}
.bgreen {
  background: #43c83c !important;
  color: #ffffff !important;
  border: 0 !important;
}
.borange {
  background: #f88529 !important;
  color: #ffffff !important;
  border: 0 !important;
}
.bred {
  background: #fa3031 !important;
  color: #ffffff !important;
  border: 0 !important;
}
.bviolet {
  background: #932ab6 !important;
  color: #ffffff !important;
  border: 0 !important;
}
.blightblue h2,
.blightblue h3,
.blightblue h3,
.blightblue h4,
.blightblue h5,
.blightblue h6,
.bblue h2,
.bblue h3,
.bblue h3,
.bblue h4,
.bblue h5,
.bblue h6,
.bgreen h2,
.bgreen h3,
.bgreen h3,
.bgreen h4,
.bgreen h5,
.bgreen h6,
.bred h2,
.bred h3,
.bred h3,
.bred h4,
.bred h5,
.bred h6,
.bviolet h2,
.bviolet h3,
.bviolet h3,
.bviolet h4,
.bviolet h5,
.bviolet h6,
.borange h2,
.borange h3,
.borange h3,
.borange h4,
.borange h5,
.borange h6 {
  color: #ffffff !important;
}
.blightblue a,
.bblue a,
.bgreen a,
.bred a,
.borange a,
.bviolet a {
  color: #eeeeee !important;
}
.blightblue a:hover,
.bblue a:hover,
.bgreen a:hover,
.bred a:hover,
.borange a:hover,
.bviolet a:hover {
  color: #eeeeee !important;
}
.lightblue {
  color: #52b9e9 !important;
}
.blue {
  color: #1171a3 !important;
}
.green {
  color: #43c83c !important;
}
.orange {
  color: #f88529 !important;
}
.red {
  color: #fa3031 !important;
}
.violet {
  color: #932ab6 !important;
}
.modal-header {
  padding-top: 7px;
  padding-bottom: 7px;
}
form {
  margin: 10px;
}
form input,
form button,
form textarea,
form select {
  font-size: 13px !important;
}
form label {
  font-size: 13px;
  line-height: 13px;
}
.form-inline button {
  margin-left: 15px;
}
.form-horizontal .control-label {
  width: 90px;
}
.form-horizontal .controls {
  margin-left: 110px;
}
.form-horizontal .controls:first-child {
  *padding-left: 100px;
}
.form-horizontal .form-actions {
  padding-left: 110px;
}
.form-actions {
  padding: 5px 20px 5px;
  background: transparent;
  border-top: 0;
}
.totop {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 104400;
  background: #fa3031;
  display: none;
}
.totop a,
.totop a:visited {
  display: block;
  width: 30px;
  height: 30px;
  color: #ffffff;
  text-align: center;
  line-height: 30px;
}
.totop a:hover {
  color: #eeeeee;
  text-decoration: none;
}
.col-left {
  width: 48%;
  float: left;
}
.col-right {
  width: 48%;
  float: right;
}
.dropdown-big .dropdown-menu {
  min-width: 250px;
  padding: 8px 10px;
  background: #ffffff;
}
.dropdown-big .dropdown-menu p {
  margin: 1px 0;
  padding: 1px 0;
  font-size: 12px;
  line-height: 18px;
}
.dropdown-big .dropdown-menu a {
  font-size: 13px;
  line-height: 23px;
  background: transparent;
  padding: 0;
  color: #333333 !important;
  display: inline;
}
.dropdown-big .dropdown-menu a:hover {
  color: #777777 !important;
  background: transparent !important;
}
.dropdown-big .dropdown-menu .drop-foot {
  text-align: center;
}
.dropdown-big .dropdown-menu .drop-foot a {
  font-size: 12px !important;
}
.dropdown-big .dropdown-menu hr {
  padding: 0;
  margin: 8px 0;
  border-top: 0 solid #aaaaaa;
  border-bottom: 1px solid #eeeeee;
}
.dropdown-big .dropdown-menu h5 {
  color: #666666 !important;
  line-height: 18px;
  font-weight: bold;
  font-size: 13px;
}
.dropdown-menu {
  background: #ffffff;
  border-radius: 0;
  border: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}
.dropdown-menu li {
  color: #777777;
  font-size: 13px;
  line-height: 18px;
}
.dropdown-menu li > a {
  color: #666666;
  line-height: 23px !important;
}
.dropdown-menu li > a:hover {
  background: #f5f5f5 !important;
  filter: none;
  color: #888888;
}
.dropdown-menu a:hover,
.dropdown-menu a:focus {
  filter: none !important;
  background: #ffffff !important;
}
.dropdown-menu::after,
.dropdown-menu::before {
  border: none !important;
}
.navbar {
  background: #000000;
}
.navbar .container {
  width: 97% !important;
}
.navbar .nav > li > a {
  font-size: 13px !important;
  color: #ffffff !important;
}
.navbar i {
  margin-right: 3px;
}
.navbar .caret {
  border-top-color: #ffffff !important;
  border-bottom-color: #ffffff !important;
}
.navbar .nav-user-pic {
  width: 20px;
  margin-right: 10px;
}
.navbar .badge {
  margin-left: 5px;
}
.sidebar {
  width: 230px;
  float: left;
  display: block;
  background: #111111;
  color: #eeeeee;
  position: relative;
}
.sidebar hr {
  border-bottom: 1px solid #333333 !important;
}
.sidebar ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}
.sidebar ul li {
  list-style-type: none;
}
.sidebar .sidebar-inner {
  display: block;
  width: 100%;
  margin: 0 auto;
  position: absolute;
  z-index: 60;
  background: #111111;
}
.sidebar .navi li i {
  margin-right: 5px;
}
.sidebar .navi li span i {
  margin: 0;
}
.sidebar .navi > li > a {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  line-height: 25px;
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px solid #222222;
  background-color: #111111;
}
.sidebar .navi > li > a:hover,
.sidebar .navi > li.open > a {
  border-bottom: 1px solid #222222;
  background-color: #222222;
  color: #ffffff;
}
.sidebar .navi li ul {
  display: none;
  background: #111111;
}
.sidebar .navi li.open ul {
  display: block;
}
.sidebar .navi li ul li a {
  display: block;
  background: none;
  padding: 10px 0;
  padding-left: 30px;
  text-decoration: none;
  color: #888888;
  border-bottom: 1px solid #222222;
}
.sidebar .navi li ul li a:hover {
  background: #111111;
  border-bottom: 1px solid #222222;
}
.sidebar .navi li ul li.active a {
  background: #111111;
  border-bottom: 1px solid #222222;
}
.sidebar .navi > li.nlightblue > a:hover,
.sidebar .navi > li.open.nlightblue > a,
.sidebar .navi > li.current.nlightblue > a {
  background: #52b9e9 !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .navi > li.nblue > a:hover,
.sidebar .navi > li.open.nblue > a,
.sidebar .navi > li.current.nblue > a {
  background: #1171a3 !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .navi > li.ngreen > a:hover,
.sidebar .navi > li.open.ngreen > a,
.sidebar .navi > li.current.ngreen > a {
  background: #43c83c !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .navi > li.norange > a:hover,
.sidebar .navi > li.open.norange > a,
.sidebar .navi > li.current.norange > a {
  background: #f88529 !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .navi > li.nred > a:hover,
.sidebar .navi > li.open.nred > a,
.sidebar .navi > li.current.nred > a {
  background: #fa3031 !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .navi > li.nviolet > a:hover,
.sidebar .navi > li.open.nviolet > a,
.sidebar .navi > li.current.nviolet > a {
  background: #932ab6 !important;
  -webkit-transition: background 0.5s ease;
  -moz-transition: background 0.5s ease;
  -o-transition: background 0.5s ease;
  transition: background 0.5s ease;
}
.sidebar .sidebar-dropdown {
  display: none;
}
.sidebar .sidebar-dropdown * {
  text-decoration: none;
}
.sidebar .sidebar-dropdown a {
  color: #eeeeee;
  background-color: #333333;
  padding: 6px;
  text-transform: uppercase;
  text-align: center;
  font-size: 13px;
  display: block;
  border-top: 1px solid #666666;
  border-bottom: 1px solid #333333;
}
.sidebar .sidebar-dropdown a:hover {
  text-decoration: none;
}
.sidebar .sidebar-widget {
  padding: 10px 5px;
}
.sidebar .ui-datepicker {
  width: 95%;
  margin: 0 auto;
  background: #111111;
  color: #888888;
  border: 0;
  padding: 0;
}
.sidebar .ui-datepicker-header {
  background: #222222;
  border: 1px solid #222222;
}
.sidebar .ui-datepicker-prev:hover {
  background: transparent;
  border: 0;
  top: 2px !important;
  left: 2px !important;
}
.sidebar .ui-datepicker-next:hover {
  background: transparent;
  border: 0;
  top: 2px !important;
  right: 2px !important;
}
.sidebar .ui-state-default {
  background: #222222;
  border: 0;
  text-align: center;
  color: #cccccc;
}
.sidebar .ui-state-default:hover {
  background: #222222;
  color: #888888;
}
.sidebar .ui-state-hightlight,
.sidebar .ui-state-active {
  background: #333333;
}
.mainbar {
  position: relative;
  margin-left: 230px;
  margin-right: 0;
  width: auto;
  background: #ffffff;
}
.mainbar .container {
  width: 100%;
  padding: 0 !important;
}
.mainbar .page-head {
  padding: 15px 20px;
  border-bottom: 1px solid #ffffff;
}
.mainbar .page-meta {
  font-size: 13px;
  line-height: 15px;
  margin-left: 2px;
  display: block;
}
.mainbar .matter {
  border-top: 0 solid #eeeeee;
  margin: 2em;
}
.pagination {
  margin: 10px 0 5px 0;
}
.pagination ul > li > a,
.pagination ul > li > span {
  border: 1px solid #cccccc;
  margin-right: 3px;
  padding: 3px 8px;
  background-color: #ffffff;
  color: #666666;
}
.pagination ul > li > a:hover {
  color: #333333;
  background: #f5f5f5;
}
.widget {
  margin-top: 10px;
  margin-bottom: 20px;
  background: #ffffff;
}
.widget hr {
  margin: 4px 0;
  padding: 4px 0;
  border-top: 0;
  border-bottom: 1px solid #eeeeee;
}
.widget .table {
  margin: 0;
  width: 100%;
}
.widget .table-bordered {
  border: 0;
}
.widget .table-bordered th {
  border-bottom: 1px solid #cccccc !important;
}
.widget .table-bordered td {
  border-top: 0 !important;
  border-bottom: 1px solid #cccccc !important;
}
.widget .table-bordered td:first-child,
.widget .table-bordered th:first-child {
  border-left: 0;
}
.widget .padd {
  padding: 15px;
}
.widget .widget-head {
  background-color: #f5f5f5;
  border: 1px solid #eeeeee;
  color: #777777;
  font-size: 18px;
  padding: 12px 15px;
}
.widget .widget-head .widget-icons i {
  font-size: 14px;
  margin: 0 4px;
}
.widget .widget-head .widget-icons a {
  color: #aaaaaa;
}
.widget .widget-head .widget-icons a:hover {
  color: #888888;
}
.widget .widget-content {
  border-left: 1px solid #eeeeee;
  border-right: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
}
.widget .widget-foot {
  background-color: #f5f5f5;
  border: 1px solid #eeeeee;
  border-top: 0;
  padding: 8px 15px;
  font-size: 13px;
  color: #666666;
}
.widget.wred .widget-head {
  background-color: #fa3031;
  border: 1px solid #fa3031;
  color: #ffffff;
}
.widget.wlightblue .widget-head {
  background-color: #52b9e9;
  border: 1px solid #52b9e9;
  color: #ffffff;
}
.widget.wblue .widget-head {
  background-color: #1171a3;
  border: 1px solid #1171a3;
  color: #ffffff;
}
.widget.wgreen .widget-head {
  background-color: #43c83c;
  border: 1px solid #43c83c;
  color: #ffffff;
}
.widget.worange .widget-head {
  background-color: #f88529;
  border: 1px solid #f88529;
  color: #ffffff;
}
.widget.wviolet .widget-head {
  background-color: #932ab6;
  border: 1px solid #932ab6;
  color: #ffffff;
}
.widget.wred .widget-head .widget-icons a,
.widget.wblue .widget-head .widget-icons a,
.widget.wlightblue .widget-head .widget-icons a,
.widget.worange .widget-head .widget-icons a,
.widget.wgreen .widget-head .widget-icons a,
.widget.wviolet .widget-head .widget-icons a {
  color: #ffffff;
}
.widget.wred .widget-head .widget-icons a:hover,
.widget.wblue .widget-head .widget-icons a:hover,
.widget.wlightblue .widget-head .widget-icons a:hover,
.widget.worange .widget-head .widget-icons a:hover,
.widget.wgreen .widget-head .widget-icons a:hover,
.widget.wviolet .widget-head .widget-icons a:hover {
  color: #eeeeee;
}
.widget .nav-tabs {
  margin-bottom: 5px;
}
.widget .nav-tabs > li a {
  padding: 5px 10px;
}
.widget .tab-content {
  margin-bottom: 10px;
}
.today-datas {
  list-style-type: none;
  padding: 0;
  margin: 10px 0;
}
.today-datas li {
  display: inline-block;
  margin-bottom: 5px;
  margin-right: 10px;
  padding: 1.5em 1em;
  background-color: #f5f5f5;
  background: #f5f5f5;
  border: 1px solid #cccccc;
  max-width: 100%;
  text-align: center;
}
.today-datas li .spark {
  margin-right: 10px;
}
.today-datas li .datas-text {
  font-size: 13px;
  padding: 7px 0 0 0;
  font-weight: normal;
}
.today-datas li .datas-text span {
  display: block;
  font-size: 24px;
  margin-bottom: 5px;
}
.today-datas li i {
  font-size: 50px;
  margin-right: 10px;
}
.today-datas li .dial {
  margin-right: 10px !important;
}
.toggle-button span {
  font-size: 13px !important;
}
.gallery img {
  max-width: 170px;
  margin: 5px;
}
@media (max-width: 480px) {
  .mainbar .page-head h2 {
    float: none;
  }
  .mainbar .bread-crumb {
    float: none;
    margin-top: 10px;
  }
  .col-left {
    width: 100%;
    float: none;
    margin-right: 0;
  }
  .col-right {
    width: 100%;
    float: none;
  }
}
@media (max-width: 767px) {
  body {
    margin: 0 auto;
  }
  body .container {
    width: 95%;
    padding-left: 2.5%;
    padding-right: 2.5%;
  }
  .mainbar .matter {
    padding-left: 20px;
    padding-right: 20px;
  }
  .form-inline button {
    margin-left: 0;
  }
  .navbar {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu {
    color: #bbbbbb !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu a {
    color: #cccccc !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu a:hover {
    color: #aaaaaa !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu h5 {
    color: #eeeeee !important;
  }
  .nav-collapse .dropdown-menu {
    padding: 10px 10px !important;
  }
  .nav-collapse .dropdown-menu a {
    color: #ffffff !important;
  }
  .nav-collapse .dropdown-menu a:hover {
    background: transparent !important;
  }
  .nav-collapse .dropdown-menu hr {
    border-top: 0 solid #eeeeee;
    border-bottom: 1px solid #333333;
  }
  .sidebar {
    float: none;
    width: 100%;
  }
  .sidebar .navi li {
    margin-left: 1em;
  }
  .sidebar .sidebar-dropdown {
    display: block;
  }
  .sidebar .sidebar-inner {
    display: none;
  }
  .sidebar .sidebar-widget {
    text-align: center;
  }
  .mainbar {
    margin: 0;
    float: none;
  }
  .today-datas {
    text-align: center;
  }
}
@media (min-width: 768px) and (max-width: 979px) {
  .form {
    margin: 0 !important;
  }
  form .control-group {
    margin: 0 !important;
  }
  form .control-label {
    float: none !important;
    width: auto !important;
    text-align: left !important;
  }
  form .controls {
    float: none !important;
    margin-left: 0 !important;
  }
  form .form-actions {
    padding-left: 0 !important;
  }
  .navbar {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu {
    color: #bbbbbb !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu a {
    color: #cccccc !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu a:hover {
    color: #aaaaaa !important;
  }
  .nav-collapse .dropdown-big .dropdown-menu h5 {
    color: #eeeeee !important;
  }
  .nav-collapse .dropdown-menu {
    padding: 10px 10px !important;
  }
  .nav-collapse .dropdown-menu a {
    color: #ffffff !important;
  }
  .nav-collapse .dropdown-menu a:hover {
    background: transparent !important;
  }
  .nav-collapse .dropdown-menu hr {
    border-top: 0 solid #eeeeee;
    border-bottom: 1px solid #333333;
  }
  .sidebar {
    width: 200px;
  }
  .mainbar {
    margin-left: 200px;
  }
}
/*#region Widgets */
.map iframe {
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}
.user {
  font-size: 12px !important;
  line-height: 20px !important;
}
.user h6 {
  line-height: 17px !important;
}
.user img {
  max-width: 70px;
  margin-top: 10px;
}
.user .user-pic {
  float: left;
  width: 80px;
}
.user .user-details {
  margin-left: 85px;
}
.user .btn {
  font-size: 11px !important;
}
/*#endregion */
/*# sourceMappingURL=customtheme.css.map */


text:
/**
 * @param {string} name Attribute name with dashes
 * @return {string} Dashes removed and character after to upper case.
 * visibleForTesting
 */
export function dashToCamelCase(name) {
  return name.replace(/-([a-z])/g, function(all, character) {
    return character.toUpperCase();
  });
}

/**
 * Expands placeholders in a given template string with values.
 *
 * Placeholders use ${key-name} syntax and are replaced with the value
 * returned from the given getter function.
 *
 * @param {string} template The template string to expand.
 * @param {!function(string):*} getter Function used to retrieve a value for a
 *   placeholder. Returns values will be coerced into strings.
 * @param {number=1} optMaxIterations Number of times to expand the template.
 *   Defaults to 1, but should be set to a larger value your placeholder tokens
 *   can be expanded to other placeholder tokens. Take caution with large values
 *   as recursively expanding a string can be exponentially expensive.
 */
export function expandTemplate(template, getter, opt_maxIterations) {
  const maxIterations = opt_maxIterations || 1;
  for (let i = 0; i < maxIterations; i++) {
    let matches = 0;
    template = template.replace(/\${([^}]*)}/g, (a, b) => {
      matches++;
      return getter(b);
    });
    if (!matches) {
      break;
    }
  }
  return template;
}

redpajama_set_name: RedPajamaGithub


text:
TabRendererData::TabRendererData()
    : network_state(NETWORK_STATE_NONE),
      loading(false),
      crashed_status(base::TERMINATION_STATUS_STILL_RUNNING),
      incognito(false),
      show_icon(true),
      pinned(false),
      blocked(false),
      app(false),
      alert_state(TabAlertState::NONE) {}

TabRendererData::TabRendererData(const TabRendererData& other) = default;

TabRendererData::~TabRendererData() {}

bool TabRendererData::IsCrashed() const {
  return (crashed_status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED ||
#if defined(OS_CHROMEOS)
          crashed_status ==
              base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM ||
#endif
          crashed_status == base::TERMINATION_STATUS_PROCESS_CRASHED ||
          crashed_status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION ||
          crashed_status == base::TERMINATION_STATUS_LAUNCH_FAILED);
}

bool TabRendererData::Equals(const TabRendererData& data) {
  return
      favicon.BackedBySameObjectAs(data.favicon) &&
      network_state == data.network_state &&
      title == data.title &&
      url == data.url &&
      loading == data.loading &&
      crashed_status == data.crashed_status &&
      incognito == data.incognito &&
      show_icon == data.show_icon &&
      pinned == data.pinned &&
      blocked == data.blocked &&
      app == data.app &&
      alert_state == data.alert_state;
}


text:
package hms.tap.idea.plugin.ui;
import javax.swing.*;
import javax.swing.JPanel;
import java.net.URL;

public class NcsUiFactory  {

        SpringLayout bgLayout;
        JTextArea displayTextArea;
        JPanel toolWindowContent;
        JPanel elementContainer;
        JLabel phoneImage;

        protected URL getImage(String imageName){
                return getClass().getResource("/resources/tap-simulator/images/"+imageName);
        }

        public  NcsUiFactory(JPanel toolWindowContent) {
                this.toolWindowContent = toolWindowContent;
                this.bgLayout = new SpringLayout();
                this.elementContainer = new JPanel(bgLayout);
                this.phoneImage = new JLabel(new ImageIcon(getImage("phone.png")));
        }

        public void setToolWindowContent(JPanel toolWindowContent) {
                this.toolWindowContent = toolWindowContent;
        }

}


text:
<?php

namespace common\models\search;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\TipoHasSubtipo;

/**
 * TipoHasSubtipoSearch represents the model behind the search form about `common\models\TipoHasSubtipo`.
 */
class TipoHasSubtipoSearch extends TipoHasSubtipo
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['Tipo_id', 'SubTipo_id'], 'each', 'rule'=>['integer']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = TipoHasSubtipo::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'Tipo_id' => $this->Tipo_id,
            'SubTipo_id' => $this->SubTipo_id,
        ]);

        return $dataProvider;
    }
}


text:
import { Span } from "opentracing";
import { IProgram } from "../../commands/types";
import { Runner } from "../../bootstrap/create-graphql-runner";
import { GraphQLRunner } from "../../query/graphql-runner";
import { Store, AnyAction } from "redux";
import { IGatsbyState } from "../../redux/types";
import { IGroupedQueryIds } from "../data-layer/types";
import { WebsocketManager } from "../../utils/websocket-manager";
export interface IQueryRunningContext {
    firstRun?: boolean;
    program?: IProgram;
    store?: Store<IGatsbyState, AnyAction>;
    parentSpan?: Span;
    gatsbyNodeGraphQLFunction?: Runner;
    graphqlRunner?: GraphQLRunner;
    pagesToBuild?: Array<string>;
    pagesToDelete?: Array<string>;
    queryIds?: IGroupedQueryIds;
    websocketManager?: WebsocketManager;
    filesDirty?: boolean;
    pendingQueryRuns?: Set<string>;
    currentlyHandledPendingQueryRuns?: Set<string>;
}


text:
package org.appbricks.commons.sharedlock.exception;

/**
 * Exception thrown when waiting for a sharedlock times out.
 */
public class LockTimedoutException
    extends LockException {

    public LockTimedoutException(String format, Object... args) {
        super(String.format(format, args));
    }
}


text:
four51.app.controller('CartViewCtrl', function ($scope, $location, $451, Order, OrderConfig, User) {
    $scope.continueShopping = function() {
	    if (!$scope.cart.$invalid) {
	        if (confirm('Do you want to save changes to your order before continuing?') == true)
		        $scope.saveChanges(function() { $location.path('catalog') });
        }
	    else
		    $location.path('catalog');
    };

	$scope.cancelOrder = function() {
		if (confirm('Are you sure you wish to cancel your order?') == true) {
			$scope.displayLoadingIndicator = true;
			$scope.actionMessage = null;
			Order.delete($scope.currentOrder,
				function(){
					$scope.currentOrder = null;
					$scope.user.CurrentOrderID = null;
					User.save($scope.user, function(){
						$location.path('catalog');
					});
					$scope.displayLoadingIndicator = false;
					$scope.actionMessage = 'Your Changes Have Been Saved!';
				},
				function(ex) {
					$scope.actionMessage = 'An error occurred: ' + ex.Message;
					$scope.displayLoadingIndicator = false;
				}
			);
		}
	};

	$scope.saveChanges = function(callback) {
		$scope.actionMessage = null;
		$scope.errorMessage = null;
		if($scope.currentOrder.LineItems.length == $451.filter($scope.currentOrder.LineItems, {Property:'Selected', Value: true}).length) {
			$scope.cancelOrder();
		}
		else {
			$scope.displayLoadingIndicator = true;
			Order.save($scope.currentOrder,
				function(data) {
					$scope.currentOrder = data;
					OrderConfig.costcenter(data, $scope.user).address(data, $scope.user);
					$scope.displayLoadingIndicator = false;
					if (callback) callback();
	                $scope.actionMessage = 'Your Changes Have Been Saved!';
				},
				function(ex) {
					$scope.errorMessage = ex.Message;
					$scope.displayLoadingIndicator = false;
				}
			);
		}
	};

	$scope.removeItem = function(item) {
		if ($scope.currentOrder.LineItems.length > 1) {
			if (confirm('Are you sure you wish to remove this item from your cart?') == true) {
				item.Selected = true;
				$scope.saveChanges();
			}
		}
		else {
			item.Selected = true;
			$scope.saveChanges();
		}
	}

    $scope.checkOut = function() {
	    $scope.displayLoadingIndicator = true;
        Order.save($scope.currentOrder, function(data) {
            $scope.currentOrder = data;
            $location.path('checkout');
            $scope.displayLoadingIndicator = false;
        });
    };

	$scope.$watch('currentOrder.LineItems', function(newval) {
		var newTotal = 0;
        if (!$scope.currentOrder) return newTotal;
		angular.forEach($scope.currentOrder.LineItems, function(item){
			newTotal += item.LineTotal;
		});
		$scope.currentOrder.Subtotal = newTotal;
	}, true);

    $scope.copyAddressToAll = function() {
        angular.forEach($scope.currentOrder.LineItems, function(n) {
            n.DateNeeded = $scope.currentOrder.LineItems[0].DateNeeded;
        });
    };

	$scope.copyCostCenterToAll = function() {
		angular.forEach($scope.currentOrder.LineItems, function(n) {
			n.CostCenter = $scope.currentOrder.LineItems[0].CostCenter;
		});
	};

    $scope.onPrint = function()  {
	    window.print();
    };
});


text:
package io.burt.kafka.clients;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.consumer.OffsetAndMetadata;
import org.apache.kafka.clients.consumer.OffsetCommitCallback;
import org.apache.kafka.common.KafkaException;
import org.apache.kafka.common.PartitionInfo;
import org.apache.kafka.common.TopicPartition;

import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyClass;
import org.jruby.RubyHash;
import org.jruby.RubyInteger;
import org.jruby.RubyModule;
import org.jruby.RubyObject;
import org.jruby.RubyProc;
import org.jruby.RubyString;
import org.jruby.anno.JRubyClass;
import org.jruby.anno.JRubyMethod;
import org.jruby.runtime.Block;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;

@SuppressWarnings("serial")
@JRubyClass(name = "Kafka::Clients::Consumer")
public class ConsumerWrapper extends RubyObject {
  private Consumer<IRubyObject, IRubyObject> kafkaConsumer;

  public ConsumerWrapper(Ruby runtime, RubyClass metaClass) {
    this(runtime, metaClass, null);
  }

  public ConsumerWrapper(Ruby runtime, RubyClass metaClass, Consumer<IRubyObject, IRubyObject> consumer) {
    super(runtime, metaClass);
    this.kafkaConsumer = consumer;
  }

  private static class ConsumerAllocator implements ObjectAllocator {
    public IRubyObject allocate(Ruby runtime, RubyClass metaClass) {
      return new ConsumerWrapper(runtime, metaClass);
    }
  }

  static RubyClass install(Ruby runtime, RubyModule parentModule) {
    RubyClass cls = parentModule.defineClassUnder("Consumer", runtime.getObject(), new ConsumerAllocator());
    cls.defineAnnotatedMethods(ConsumerWrapper.class);
    return cls;
  }

  static ConsumerWrapper create(Ruby runtime, Consumer<IRubyObject, IRubyObject> consumer) {
    JRubyClass annotation = ConsumerWrapper.class.getAnnotation(JRubyClass.class);
    RubyClass metaClass = (RubyClass) runtime.getClassFromPath(annotation.name()[0]);
    return new ConsumerWrapper(runtime, metaClass, consumer);
  }

  @JRubyMethod(optional = 1)
  public IRubyObject initialize(ThreadContext ctx, IRubyObject[] args) {
    if (kafkaConsumer == null) {
      if (args.length > 0) {
        try {
          Map<String, Object> config = KafkaClientsLibrary.toKafkaConfiguration(args[0].convertToHash());
          kafkaConsumer = new KafkaConsumer<>(config);
        } catch (KafkaException ke) {
          throw KafkaClientsLibrary.newRaiseException(ctx.runtime, ke);
        }
      } else {
        throw ctx.runtime.newArgumentError(0, 1);
      }
    }
    return this;
  }

  @JRubyMethod
  public IRubyObject close(ThreadContext ctx) {
    kafkaConsumer.close();
    return ctx.runtime.getNil();
  }

  @JRubyMethod(name = "partitions_for")
  public IRubyObject partitionsFor(ThreadContext ctx, IRubyObject topic) {
    List<PartitionInfo> partitionInfos = kafkaConsumer.partitionsFor(topic.asJavaString());
    RubyArray partitions = ctx.runtime.newArray();
    if (partitionInfos != null) {
      for (PartitionInfo partition : partitionInfos) {
        partitions.add(PartitionInfoWrapper.create(ctx.runtime, partition));
      }
    }
    return partitions;
  }

  private ConsumerRebalanceListener createListener(final ThreadContext ctx, final IRubyObject listener) {
    return new ConsumerRebalanceListener() {
      @Override
      public void onPartitionsRevoked(Collection<TopicPartition> partitions) {
        if (listener != null && listener.respondsTo("on_partitions_revoked")) {
          RubyArray topicPartitions = ctx.runtime.newArray(partitions.size());
          for (TopicPartition tp : partitions) {
            topicPartitions.append(TopicPartitionWrapper.create(ctx.runtime, tp));
          }
          listener.callMethod(ctx, "on_partitions_revoked", topicPartitions);
        }
      }

      @Override
      public void onPartitionsAssigned(Collection<TopicPartition> partitions) {
        if (listener != null && listener.respondsTo("on_partitions_assigned")) {
          RubyArray topicPartitions = ctx.runtime.newArray(partitions.size());
          for (TopicPartition tp : partitions) {
            topicPartitions.append(TopicPartitionWrapper.create(ctx.runtime, tp));
          }
          listener.callMethod(ctx, "on_partitions_assigned", topicPartitions);
        }
      }
    };
  }

  @SuppressWarnings("unchecked")
  @JRubyMethod(required = 1, optional = 1)
  public IRubyObject subscribe(final ThreadContext ctx, IRubyObject[] args) {
    final IRubyObject topicNames = args[0];
    final IRubyObject listener = args.length > 1 ? args[1] : null;
    ConsumerRebalanceListener rebalanceListener = createListener(ctx, listener);
    if (topicNames instanceof RubyString) { // TODO can this be done by not checking the Java class?
      try {
        Pattern topicPattern = Pattern.compile(topicNames.asJavaString());
        kafkaConsumer.subscribe(topicPattern, rebalanceListener);
      } catch (PatternSyntaxException pse) {
        throw ctx.runtime.newArgumentError(String.format("Invalid topic pattern: %s", pse.getMessage()));
      }
    } else if (topicNames.respondsTo("to_a")) {
      RubyArray topicNamesArray = topicNames.callMethod(ctx, "to_a").convertToArray();
      Set<String> topics = new HashSet<>();
      for (IRubyObject topic : (List<IRubyObject>) topicNamesArray.getList()) {
        topics.add(topic.asString().asJavaString());
      }
      kafkaConsumer.subscribe(topics, rebalanceListener);
    } else {
      throw ctx.runtime.newTypeError(topicNames, "Enumerable of topics or topic pattern");
    }
    return ctx.runtime.getNil();
  }

  @JRubyMethod
  public IRubyObject subscription(ThreadContext ctx) {
    Set<String> topicNames = kafkaConsumer.subscription();
    RubyArray topics = ctx.runtime.newArray(topicNames.size());
    for (String topicName : topicNames) {
      topics.append(ctx.runtime.newString(topicName));
    }
    return topics;
  }

  @JRubyMethod
  public IRubyObject unsubscribe(ThreadContext ctx) {
    kafkaConsumer.unsubscribe();
    return ctx.runtime.getNil();
  }

  @JRubyMethod
  public IRubyObject poll(ThreadContext ctx, IRubyObject timeout) {
    try {
      long timeoutMs = (long) timeout.convertToFloat().getDoubleValue() * 1000;
      ConsumerRecords<IRubyObject, IRubyObject> records = kafkaConsumer.poll(timeoutMs);
      return ConsumerRecordsWrapper.create(ctx.runtime, records);
    } catch (KafkaException ke) {
      throw KafkaClientsLibrary.newRaiseException(ctx.runtime, ke);
    }
  }

  @SuppressWarnings("unchecked")
  private Map<TopicPartition, OffsetAndMetadata> toOffsets(ThreadContext ctx, IRubyObject arg) {
    Map<TopicPartition, OffsetAndMetadata> syncOffsets = new HashMap<>();
    RubyHash offsets = arg.convertToHash();
    for (IRubyObject key : (List<IRubyObject>) offsets.keys().getList()) {
      IRubyObject value = offsets.fastARef(key);
      if (key instanceof TopicPartitionWrapper) {
        if (value instanceof OffsetAndMetadataWrapper) {
          TopicPartition tp = ((TopicPartitionWrapper) key).topicPartition();
          OffsetAndMetadata om = ((OffsetAndMetadataWrapper) value).offsetAndMetadata();
          syncOffsets.put(tp, om);
        } else if (value instanceof RubyInteger) {
          TopicPartition tp = ((TopicPartitionWrapper) key).topicPartition();
          OffsetAndMetadata om = new OffsetAndMetadata(((RubyInteger) value).getLongValue());
          syncOffsets.put(tp, om);
        } else {
          throw ctx.runtime.newTypeError(value, ctx.runtime.getClassFromPath("Kafka::Clients::OffsetAndMetadata"));
        }
      } else {
        throw ctx.runtime.newTypeError(key, ctx.runtime.getClassFromPath("Kafka::Clients::TopicPartition"));
      }
    }
    return syncOffsets;
  }

  private RubyHash fromOffsets(ThreadContext ctx, Map<TopicPartition, OffsetAndMetadata> syncOffsets) {
    RubyHash offsets = RubyHash.newHash(ctx.runtime);
    for (TopicPartition tp : syncOffsets.keySet()) {
      OffsetAndMetadata om = syncOffsets.get(tp);
      offsets.fastASet(TopicPartitionWrapper.create(ctx.runtime, tp), OffsetAndMetadataWrapper.create(ctx.runtime, om));
    }
    return offsets;
  }

  @JRubyMethod(name = "commit_sync", optional = 1)
  public IRubyObject commitSync(ThreadContext ctx, IRubyObject[] args) {
    try {
      if (args.length == 0) {
        kafkaConsumer.commitSync();
      } else {
        kafkaConsumer.commitSync(toOffsets(ctx, args[0]));
      }
    } catch (KafkaException ke) {
      throw KafkaClientsLibrary.newRaiseException(ctx.runtime, ke);
    }
    return ctx.runtime.getNil();
  }

  @JRubyMethod(name = "commit_async", optional = 1)
  public IRubyObject commitAsync(ThreadContext ctx, IRubyObject[] args, final Block block) {
    final RubyProc callback = block.isGiven() ? ctx.runtime.newProc(Block.Type.PROC, block) : null;
    final Ruby runtime = ctx.runtime;
    OffsetCommitCallback commitCallback = new OffsetCommitCallback() {
      @Override
      public void onComplete(Map<TopicPartition, OffsetAndMetadata> syncOffsets, Exception exception) {
        if (callback != null) {
          IRubyObject error = runtime.getNil();
          if (exception != null) {
            RubyClass errorClass = KafkaClientsLibrary.mapErrorClass(runtime, exception);
            error = errorClass.newInstance(runtime.getCurrentContext(), runtime.newString(exception.getMessage()), Block.NULL_BLOCK);
          }
          callback.call(runtime.getCurrentContext(), new IRubyObject[] {fromOffsets(runtime.getCurrentContext(), syncOffsets), error});
        }
      }
    };
    if (args.length == 0) {
      kafkaConsumer.commitAsync(commitCallback);
    } else {
      kafkaConsumer.commitAsync(toOffsets(ctx, args[0]), commitCallback);
    }
    return ctx.runtime.getNil();
  }

  @JRubyMethod(required = 1, optional = 1)
  public IRubyObject committed(ThreadContext ctx, IRubyObject[] args) {
    TopicPartition tp = TopicPartitionWrapper.toTopicPartition(ctx, args);
    try {
      OffsetAndMetadata committedOffset = kafkaConsumer.committed(tp);
      if (committedOffset != null) {
        return OffsetAndMetadataWrapper.create(ctx.runtime, committedOffset);
      } else {
        return ctx.runtime.getNil();
      }
    } catch (IllegalArgumentException iae) {
      throw ctx.runtime.newArgumentError(iae.getMessage());
    }
  }

  @JRubyMethod(required = 1, optional = 1)
  public IRubyObject position(ThreadContext ctx, IRubyObject[] args) {
    TopicPartition tp = TopicPartitionWrapper.toTopicPartition(ctx, args);
    try {
      long offset = kafkaConsumer.position(tp);
      return ctx.runtime.newFixnum(offset);
    } catch (IllegalArgumentException iae) {
      throw ctx.runtime.newArgumentError(iae.getMessage());
    }
  }

  @SuppressWarnings("unchecked")
  private List<TopicPartition> toTopicPartitionList(ThreadContext ctx, IRubyObject partitions) {
    RubyArray tpa = partitions.convertToArray();
    List<TopicPartition> tpl = new ArrayList<>(tpa.size());
    for (IRubyObject tp : (List<IRubyObject>) tpa.getList()) {
      tpl.add(TopicPartitionWrapper.toTopicPartition(ctx, tp));
    }
    return tpl;
  }

  @JRubyMethod(name = "seek_to_beginning", optional = 1)
  public IRubyObject seekToBeginning(ThreadContext ctx, IRubyObject[] args) {
    try {
      Collection<TopicPartition> partitions;
      if (args.length == 0) {
        partitions = Collections.<TopicPartition>emptySet();
      } else {
        partitions = toTopicPartitionList(ctx, args[0]);
      }
      kafkaConsumer.seekToBeginning(partitions);
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod(name = "seek_to_end", optional = 1)
  public IRubyObject seekToEnd(ThreadContext ctx, IRubyObject[] args) {
    try {
      Collection<TopicPartition> partitions;
      if (args.length == 0) {
        partitions = Collections.<TopicPartition>emptySet();
      } else {
        partitions = toTopicPartitionList(ctx, args[0]);
      }
      kafkaConsumer.seekToEnd(partitions);
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod(required = 2, optional = 1)
  public IRubyObject seek(ThreadContext ctx, IRubyObject[] args) {
    try {
      TopicPartition tp;
      if (args.length == 3) {
        tp = TopicPartitionWrapper.toTopicPartition(ctx, args);
      } else if (args[0] instanceof TopicPartitionWrapper) {
        tp = ((TopicPartitionWrapper) args[0]).topicPartition();
      } else {
        throw ctx.runtime.newTypeError(args[0], ctx.runtime.getClassFromPath("Kafka::Clients::TopicPartition"));
      }
      kafkaConsumer.seek(tp, args[args.length - 1].convertToInteger().getLongValue());
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod
  public IRubyObject assignment(ThreadContext ctx) {
    Set<TopicPartition> topicPartitions = kafkaConsumer.assignment();
    RubyArray array = ctx.runtime.newArray(topicPartitions.size());
    for (TopicPartition topicPartition : topicPartitions) {
      array.append(TopicPartitionWrapper.create(ctx.runtime, topicPartition));
    }
    return array;
  }

  @JRubyMethod(required = 1)
  public IRubyObject assign(ThreadContext ctx, IRubyObject partitions) {
    try {
      kafkaConsumer.assign(toTopicPartitionList(ctx, partitions));
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod(name = "list_topics")
  public IRubyObject listTopics(ThreadContext ctx) {
    Map<String, List<PartitionInfo>> topicsAndPartitions = kafkaConsumer.listTopics();
    RubyHash topics = RubyHash.newHash(ctx.runtime);
    for (String t : topicsAndPartitions.keySet()) {
      List<PartitionInfo> pis = topicsAndPartitions.get(t);
      RubyArray partitionInfos = ctx.runtime.newArray(pis.size());
      for (PartitionInfo pi : pis) {
        partitionInfos.append(PartitionInfoWrapper.create(ctx.runtime, pi));
      }
      topics.fastASet(ctx.runtime.newString(t), partitionInfos);
    }
    return topics;
  }

  @JRubyMethod
  public IRubyObject paused(ThreadContext ctx) {
    Collection<TopicPartition> pausedPartitions = kafkaConsumer.paused();
    RubyArray paused = ctx.runtime.newArray(pausedPartitions.size());
    for (TopicPartition tp : pausedPartitions) {
      paused.append(TopicPartitionWrapper.create(ctx.runtime, tp));
    }
    return paused;
  }

  @SuppressWarnings("unchecked")
  private Set<TopicPartition> toTopicPartitions(ThreadContext ctx, IRubyObject arg) {
    Set<TopicPartition> topicPartitions = new HashSet<>();
    RubyArray partitions= arg.convertToArray();
    for (IRubyObject tp : (List<IRubyObject>) partitions.getList()) {
      if (tp instanceof TopicPartitionWrapper) {
        topicPartitions.add(((TopicPartitionWrapper) tp).topicPartition());
      } else {
        throw ctx.runtime.newTypeError(tp, "Kafka::Clients::TopicPartition");
      }
    }
    return topicPartitions;
  }

  @JRubyMethod
  public IRubyObject pause(ThreadContext ctx, IRubyObject partitions) {
    try {
      kafkaConsumer.pause(toTopicPartitions(ctx, partitions));
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod
  public IRubyObject resume(ThreadContext ctx, IRubyObject partitions) {
    try {
      kafkaConsumer.resume(toTopicPartitions(ctx, partitions));
      return ctx.runtime.getNil();
    } catch (IllegalStateException ise) {
      throw ctx.runtime.newArgumentError(ise.getMessage());
    }
  }

  @JRubyMethod
  public IRubyObject wakeup(ThreadContext ctx) {
    kafkaConsumer.wakeup();
    return ctx.runtime.getNil();
  }
}


text:
/*************************************************************************/
/*  ss_effects.h                                                         */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef SS_EFFECTS_RD_H
#define SS_EFFECTS_RD_H

#include "servers/rendering/renderer_rd/pipeline_cache_rd.h"
#include "servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_filter.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_scale.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssao.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssao_blur.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssao_importance_map.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssao_interleave.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssil.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssil_blur.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssil_importance_map.glsl.gen.h"
#include "servers/rendering/renderer_rd/shaders/effects/ssil_interleave.glsl.gen.h"
#include "servers/rendering/renderer_scene_render.h"
#include "servers/rendering_server.h"

namespace RendererRD {

class SSEffects {
private:
	static SSEffects *singleton;

public:
	static SSEffects *get_singleton() { return singleton; }

	SSEffects();
	~SSEffects();

	/* SS Downsampler */

	void downsample_depth(RID p_depth_buffer, const Vector<RID> &p_depth_mipmaps, RS::EnvironmentSSAOQuality p_ssao_quality, RS::EnvironmentSSILQuality p_ssil_quality, bool p_invalidate_uniform_set, bool p_ssao_half_size, bool p_ssil_half_size, Size2i p_full_screen_size, const Projection &p_projection);

	/* SSIL */

	struct SSILRenderBuffers {
		bool half_size = false;
		int buffer_width;
		int buffer_height;
		int half_buffer_width;
		int half_buffer_height;

		RID ssil_final;
		RID deinterleaved;
		Vector<RID> deinterleaved_slices;
		RID pong;
		Vector<RID> pong_slices;
		RID edges;
		Vector<RID> edges_slices;
		RID importance_map[2];
		RID depth_texture_view;

		RID last_frame;
		Vector<RID> last_frame_slices;

		RID gather_uniform_set;
		RID importance_map_uniform_set;
		RID projection_uniform_set;
	};

	struct SSILSettings {
		float radius = 1.0;
		float intensity = 2.0;
		float sharpness = 0.98;
		float normal_rejection = 1.0;

		RS::EnvironmentSSILQuality quality = RS::ENV_SSIL_QUALITY_MEDIUM;
		bool half_size = true;
		float adaptive_target = 0.5;
		int blur_passes = 4;
		float fadeout_from = 50.0;
		float fadeout_to = 300.0;

		Size2i full_screen_size = Size2i();
	};

	void ssil_allocate_buffers(SSILRenderBuffers &p_ssil_buffers, const SSILSettings &p_settings, RID p_linear_depth);
	void screen_space_indirect_lighting(SSILRenderBuffers &p_ssil_buffers, RID p_normal_buffer, const Projection &p_projection, const Projection &p_last_projection, const SSILSettings &p_settings);
	void ssil_free(SSILRenderBuffers &p_ssil_buffers);

	/* SSAO */

	struct SSAORenderBuffers {
		bool half_size = false;
		int buffer_width;
		int buffer_height;
		int half_buffer_width;
		int half_buffer_height;

		RID ao_deinterleaved;
		Vector<RID> ao_deinterleaved_slices;
		RID ao_pong;
		Vector<RID> ao_pong_slices;
		RID ao_final;
		RID importance_map[2];
		RID depth_texture_view;

		RID gather_uniform_set;
		RID importance_map_uniform_set;
	};

	struct SSAOSettings {
		float radius = 1.0;
		float intensity = 2.0;
		float power = 1.5;
		float detail = 0.5;
		float horizon = 0.06;
		float sharpness = 0.98;

		RS::EnvironmentSSAOQuality quality = RS::ENV_SSAO_QUALITY_MEDIUM;
		bool half_size = false;
		float adaptive_target = 0.5;
		int blur_passes = 2;
		float fadeout_from = 50.0;
		float fadeout_to = 300.0;

		Size2i full_screen_size = Size2i();
	};

	void ssao_allocate_buffers(SSAORenderBuffers &p_ssao_buffers, const SSAOSettings &p_settings, RID p_linear_depth);
	void generate_ssao(SSAORenderBuffers &p_ssao_buffers, RID p_normal_buffer, const Projection &p_projection, const SSAOSettings &p_settings);
	void ssao_free(SSAORenderBuffers &p_ssao_buffers);

	/* Screen Space Reflection */

	struct SSRRenderBuffers {
		RID normal_scaled;
		RID depth_scaled;
		RID blur_radius[2];
		RID intermediate;
		RID output;
		RID output_slices[RendererSceneRender::MAX_RENDER_VIEWS];
	};

	void ssr_allocate_buffers(SSRRenderBuffers &p_ssr_buffers, const RenderingDevice::DataFormat p_color_format, RenderingServer::EnvironmentSSRRoughnessQuality p_roughness_quality, const Size2i &p_screen_size, const uint32_t p_view_count);
	void screen_space_reflection(SSRRenderBuffers &p_ssr_buffers, const RID *p_diffuse_slices, const RID *p_normal_roughness_slices, RS::EnvironmentSSRRoughnessQuality p_roughness_quality, const RID *p_metallic_slices, const Color &p_metallic_mask, const RID *p_depth_slices, const Size2i &p_screen_size, int p_max_steps, float p_fade_in, float p_fade_out, float p_tolerance, const uint32_t p_view_count, const Projection *p_projections, const Vector3 *p_eye_offsets);
	void ssr_free(SSRRenderBuffers &p_ssr_buffers);

private:
	/* SS Downsampler */

	struct SSEffectsDownsamplePushConstant {
		float pixel_size[2];
		float z_far;
		float z_near;
		uint32_t orthogonal;
		float radius_sq;
		uint32_t pad[2];
	};

	enum SSEffectsMode {
		SS_EFFECTS_DOWNSAMPLE,
		SS_EFFECTS_DOWNSAMPLE_HALF_RES,
		SS_EFFECTS_DOWNSAMPLE_MIPMAP,
		SS_EFFECTS_DOWNSAMPLE_MIPMAP_HALF_RES,
		SS_EFFECTS_DOWNSAMPLE_HALF,
		SS_EFFECTS_DOWNSAMPLE_HALF_RES_HALF,
		SS_EFFECTS_DOWNSAMPLE_FULL_MIPS,
		SS_EFFECTS_MAX
	};

	struct SSEffectsGatherConstants {
		float rotation_matrices[80]; //5 vec4s * 4
	};

	struct SSEffectsShader {
		SSEffectsDownsamplePushConstant downsample_push_constant;
		SsEffectsDownsampleShaderRD downsample_shader;
		RID downsample_shader_version;
		RID downsample_uniform_set;
		bool used_half_size_last_frame = false;
		bool used_mips_last_frame = false;
		bool used_full_mips_last_frame = false;

		RID gather_constants_buffer;

		RID mirror_sampler;

		RID pipelines[SS_EFFECTS_MAX];
	} ss_effects;

	/* SSIL */

	enum SSILMode {
		SSIL_GATHER,
		SSIL_GATHER_BASE,
		SSIL_GATHER_ADAPTIVE,
		SSIL_GENERATE_IMPORTANCE_MAP,
		SSIL_PROCESS_IMPORTANCE_MAPA,
		SSIL_PROCESS_IMPORTANCE_MAPB,
		SSIL_BLUR_PASS,
		SSIL_BLUR_PASS_SMART,
		SSIL_BLUR_PASS_WIDE,
		SSIL_INTERLEAVE,
		SSIL_INTERLEAVE_SMART,
		SSIL_INTERLEAVE_HALF,
		SSIL_MAX
	};

	struct SSILGatherPushConstant {
		int32_t screen_size[2];
		int pass;
		int quality;

		float half_screen_pixel_size[2];
		float half_screen_pixel_size_x025[2];

		float NDC_to_view_mul[2];
		float NDC_to_view_add[2];

		float pad2[2];
		float z_near;
		float z_far;

		float radius;
		float intensity;
		int size_multiplier;
		int pad;

		float fade_out_mul;
		float fade_out_add;
		float normal_rejection_amount;
		float inv_radius_near_limit;

		uint32_t is_orthogonal;
		float neg_inv_radius;
		float load_counter_avg_div;
		float adaptive_sample_limit;

		int32_t pass_coord_offset[2];
		float pass_uv_offset[2];
	};

	struct SSILImportanceMapPushConstant {
		float half_screen_pixel_size[2];
		float intensity;
		float pad;
	};

	struct SSILBlurPushConstant {
		float edge_sharpness;
		float pad;
		float half_screen_pixel_size[2];
	};

	struct SSILInterleavePushConstant {
		float inv_sharpness;
		uint32_t size_modifier;
		float pixel_size[2];
	};

	struct SSILProjectionUniforms {
		float inv_last_frame_projection_matrix[16];
	};

	struct SSIL {
		SSILGatherPushConstant gather_push_constant;
		SsilShaderRD gather_shader;
		RID gather_shader_version;
		RID projection_uniform_buffer;

		SSILImportanceMapPushConstant importance_map_push_constant;
		SsilImportanceMapShaderRD importance_map_shader;
		RID importance_map_shader_version;
		RID importance_map_load_counter;
		RID counter_uniform_set;

		SSILBlurPushConstant blur_push_constant;
		SsilBlurShaderRD blur_shader;
		RID blur_shader_version;

		SSILInterleavePushConstant interleave_push_constant;
		SsilInterleaveShaderRD interleave_shader;
		RID interleave_shader_version;

		RID pipelines[SSIL_MAX];
	} ssil;

	void gather_ssil(RD::ComputeListID p_compute_list, const Vector<RID> p_ssil_slices, const Vector<RID> p_edges_slices, const SSILSettings &p_settings, bool p_adaptive_base_pass, RID p_gather_uniform_set, RID p_importance_map_uniform_set, RID p_projection_uniform_set);

	/* SSAO */

	enum SSAOMode {
		SSAO_GATHER,
		SSAO_GATHER_BASE,
		SSAO_GATHER_ADAPTIVE,
		SSAO_GENERATE_IMPORTANCE_MAP,
		SSAO_PROCESS_IMPORTANCE_MAPA,
		SSAO_PROCESS_IMPORTANCE_MAPB,
		SSAO_BLUR_PASS,
		SSAO_BLUR_PASS_SMART,
		SSAO_BLUR_PASS_WIDE,
		SSAO_INTERLEAVE,
		SSAO_INTERLEAVE_SMART,
		SSAO_INTERLEAVE_HALF,
		SSAO_MAX
	};

	struct SSAOGatherPushConstant {
		int32_t screen_size[2];
		int pass;
		int quality;

		float half_screen_pixel_size[2];
		int size_multiplier;
		float detail_intensity;

		float NDC_to_view_mul[2];
		float NDC_to_view_add[2];

		float pad[2];
		float half_screen_pixel_size_x025[2];

		float radius;
		float intensity;
		float shadow_power;
		float shadow_clamp;

		float fade_out_mul;
		float fade_out_add;
		float horizon_angle_threshold;
		float inv_radius_near_limit;

		uint32_t is_orthogonal;
		float neg_inv_radius;
		float load_counter_avg_div;
		float adaptive_sample_limit;

		int32_t pass_coord_offset[2];
		float pass_uv_offset[2];
	};

	struct SSAOImportanceMapPushConstant {
		float half_screen_pixel_size[2];
		float intensity;
		float power;
	};

	struct SSAOBlurPushConstant {
		float edge_sharpness;
		float pad;
		float half_screen_pixel_size[2];
	};

	struct SSAOInterleavePushConstant {
		float inv_sharpness;
		uint32_t size_modifier;
		float pixel_size[2];
	};

	struct SSAO {
		SSAOGatherPushConstant gather_push_constant;
		SsaoShaderRD gather_shader;
		RID gather_shader_version;

		SSAOImportanceMapPushConstant importance_map_push_constant;
		SsaoImportanceMapShaderRD importance_map_shader;
		RID importance_map_shader_version;
		RID importance_map_load_counter;
		RID counter_uniform_set;

		SSAOBlurPushConstant blur_push_constant;
		SsaoBlurShaderRD blur_shader;
		RID blur_shader_version;

		SSAOInterleavePushConstant interleave_push_constant;
		SsaoInterleaveShaderRD interleave_shader;
		RID interleave_shader_version;

		RID pipelines[SSAO_MAX];
	} ssao;

	void gather_ssao(RD::ComputeListID p_compute_list, const Vector<RID> p_ao_slices, const SSAOSettings &p_settings, bool p_adaptive_base_pass, RID p_gather_uniform_set, RID p_importance_map_uniform_set);

	/* Screen Space Reflection */

	enum SSRShaderSpecializations {
		SSR_MULTIVIEW = 1 << 0,
		SSR_VARIATIONS = 2,
	};

	struct ScreenSpaceReflectionSceneData {
		float projection[2][16];
		float inv_projection[2][16];
		float eye_offset[2][4];
	};

	// SSR Scale

	struct ScreenSpaceReflectionScalePushConstant {
		int32_t screen_size[2];
		float camera_z_near;
		float camera_z_far;

		uint32_t orthogonal;
		uint32_t filter;
		uint32_t view_index;
		uint32_t pad1;
	};

	struct ScreenSpaceReflectionScale {
		ScreenSpaceReflectionScaleShaderRD shader;
		RID shader_version;
		RID pipelines[SSR_VARIATIONS];
	} ssr_scale;

	// SSR main

	enum ScreenSpaceReflectionMode {
		SCREEN_SPACE_REFLECTION_NORMAL,
		SCREEN_SPACE_REFLECTION_ROUGH,
		SCREEN_SPACE_REFLECTION_MAX,
	};

	struct ScreenSpaceReflectionPushConstant {
		float proj_info[4]; // 16 - 16

		int32_t screen_size[2]; //  8 - 24
		float camera_z_near; //  4 - 28
		float camera_z_far; //  4 - 32

		int32_t num_steps; //  4 - 36
		float depth_tolerance; //  4 - 40
		float distance_fade; //  4 - 44
		float curve_fade_in; //  4 - 48

		uint32_t orthogonal; //  4 - 52
		float filter_mipmap_levels; //  4 - 56
		uint32_t use_half_res; //  4 - 60
		uint8_t metallic_mask[4]; //  4 - 64

		uint32_t view_index; //  4 - 68
		uint32_t pad[3]; // 12 - 80

		// float projection[16];			// this is in our ScreenSpaceReflectionSceneData now
	};

	struct ScreenSpaceReflection {
		ScreenSpaceReflectionShaderRD shader;
		RID shader_version;
		RID pipelines[SSR_VARIATIONS][SCREEN_SPACE_REFLECTION_MAX];

		RID ubo;
	} ssr;

	// SSR Filter

	struct ScreenSpaceReflectionFilterPushConstant {
		float proj_info[4]; // 16 - 16

		uint32_t orthogonal; //  4 - 20
		float edge_tolerance; //  4 - 24
		int32_t increment; //  4 - 28
		uint32_t view_index; //  4 - 32

		int32_t screen_size[2]; //  8 - 40
		uint32_t vertical; //  4 - 44
		uint32_t steps; //  4 - 48
	};

	enum SSRReflectionMode {
		SCREEN_SPACE_REFLECTION_FILTER_HORIZONTAL,
		SCREEN_SPACE_REFLECTION_FILTER_VERTICAL,
		SCREEN_SPACE_REFLECTION_FILTER_MAX,
	};

	struct ScreenSpaceReflectionFilter {
		ScreenSpaceReflectionFilterShaderRD shader;
		RID shader_version;
		RID pipelines[SSR_VARIATIONS][SCREEN_SPACE_REFLECTION_FILTER_MAX];
	} ssr_filter;
};

} // namespace RendererRD

#endif // SS_EFFECTS_RD_H


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Plan extends CI_Controller {

    public function index()
    {
        checkSessionStart(); //check if user session has started, and if not start the session
        if(isset($_SESSION['id'])) {
            $user_data = $_SESSION['user_data']; //get user data
            $user_type = strtoupper(get_class($user_data));
            $id = $user_data->getId();
            $this->load->view('navbar', getUserSessionDataArray());
            $this->load->view('plan',$user_data->getPlansInformation($user_type));
            $this->load->view('footer');
        }
        else
        {
            $this->load->view("header_login");
            $this->load->view('errors_notification', notification('You must be logged in to access this page','info','Login Needed: ',1000));
            $this->load->view("welcome");
            $this->load->view("footer");
        }
    }

    public function addExercise()
    {
        getUserSessionDataArray();
        if(!empty($_SESSION['user_data']) &&  !empty($_POST['repetitions'])&&  !empty($_POST['duration'])&& !empty($_POST['days'])&& !empty($_POST['planID'])) //check if the data isset and proceeds to saving data
        {
            $days_string="0-0-0-0-0-0-0"; // days that the exercise must be done
            for($i=0;$i<count($_POST['days']);$i++)
            {
                switch($_POST['days'][$i])
                {
                    case 'sunday':
                    {
                        $days_string[0]=1;
                    }break;
                    case 'monday':
                    {
                        $days_string[2]=1;
                    }break;
                    case 'tuesday':
                    {
                        $days_string[4]=1;
                    }break;
                    case 'wednesday':
                    {
                        $days_string[6]=1;
                    }break;
                    case 'thursday':
                    {
                        $days_string[8]=1;
                    }break;
                    case 'friday':
                    {
                        $days_string[10]=1;
                    }break;
                    case 'saturday':
                    {
                        $days_string[12]=1;
                    }break;
                }
            }

            if($_POST['choose-exercise']=="insert-exercise")
            {
               $exercise_id = $this->DB_Helper->insertArray('exercise',array('exercise_description'=>$_POST['exercise-description'],'name'=>$_POST['exercise-name']));
                $this->DB_Helper->insertArray('exerciseinstance',array('days'=>$days_string,'plan_id'=>$_POST['planID'],'duration'=>$_POST['duration'],'repetitions'=>$_POST['repetitions'],'exercise_id'=>$exercise_id));
            }
            else if ($_POST['choose-exercise']=="select-exercise")
            {
                for($i=0;$i<count($_POST['chosenExercise']);$i++)
                {
                    $this->DB_Helper->insertArray('exerciseinstance',array('days'=>$days_string,'plan_id'=>$_POST['planID'],'duration'=>$_POST['duration'],'repetitions'=>$_POST['repetitions'],'exercise_id'=>$_POST['chosenExercise'][$i]));
                }
            }
            else
            {
                $this->load->view("navbar",getUserSessionDataArray());
                $this->load->view('errors_notification', notification('Error inserting try again!','danger','Insert: ',2000));
                $this->load->view("plan");
                $this->load->view("footer");
                header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects
                return;
            }
            $this->load->view("navbar",getUserSessionDataArray());
            $this->load->view('errors_notification', notification('New exercise inserted correctly!','success','Insert: ',2000));
            $this->load->view("plan");
            $this->load->view("footer");
            header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects
        }
        else
        {
            $this->load->view("navbar",getUserSessionDataArray());
            $this->load->view('errors_notification', notification('Missing some fields!','danger','Insert: ',2000));
            $this->load->view("plan");
            $this->load->view("footer");
            header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects
            return;
        }
    }

    public function insert()
    {
        getUserSessionDataArray();
        $doctor_id = $_SESSION['id'];
        if(!empty($_SESSION['user_data']) &&  !empty($_POST['start-date'])&&  !empty($_POST['patient'])&& !empty($_POST['end-date'])&&!empty($_POST['description'])) //check if the data isset and proceeds to saving data
        {
            //verification
            $end_date = DateTime::createFromFormat('Y-m-d',$_POST['end-date'] );
            $start_date = DateTime::createFromFormat('Y-m-d',$_POST['start-date'] );
            $description= preg_match('/[a-zAZ ]*$/',$_POST['description']);
            if($end_date&&$start_date&&$description)
            {
                $this->DB_Helper->insertArray('plan',array('start_date'=>$_POST['start-date'],'end_date'=>$_POST['end-date'],'description'=>$_POST['description'],'user_id'=>$_POST['patient'],'doctor_id'=>$doctor_id));

                $this->load->view("navbar",getUserSessionDataArray());
                $this->load->view('errors_notification', notification('Plan inserted correctly','success','Insert: ',3000));
                $this->load->view("plan");
                $this->load->view("footer");
                header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects to other page
            }
            else
            {
                $this->load->view("navbar",getUserSessionDataArray());
                $this->load->view('errors_notification', notification('Error inserting plan! Please try again','danger','Insert: ',3000));
                $this->load->view("plan");
                $this->load->view("footer");
                header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects to other page
            }

        }
        else
        {
            header("Refresh: 2; url=".base_url()."plan"); // wait 2 seconds and redirects to other page
            $this->load->view("navbar",getUserSessionDataArray());
            $this->load->view('errors_notification', notification('Error inserting plan! Please try again','danger','Insert: ',3000));
            $this->load->view("plan");
            $this->load->view("footer");

        }
    }
}


text:
If you want a windowed desktop on C.H.I.P., you can install X-Windows.

### Requirements
  * CHIP [connected to WiFi](#connecting-c-h-i-p-to-wi-fi-with-nmcli)
  * Monitor attached to CHIP
  * Keyboard or [Serial or SSH Connection](#headless-chip) to CHIP

### Installation (xfce4)
CHIP is a lightweight computer, so we'll install the lightweight xfce4:

```shell
  sudo apt-get install xfce4
```

It might take some time to download and install all the packages, since there are a lot of dependencies and libraries involved. Once installed, start the windowing system with the command

```shell
  startx&
```

(the `&` runs Xwindows in the background, so you can still use your terminal). After a minute or so, you'll get an image on the monitor:

![Xwindows up and running on CHIP](images/xwindows_first.jpg)

Now you can use a mouse and keyboard to explore CHIP and launch programs.

### Troubleshooting

If you get errors from apt that report "unmet dependencies," you can run the command

```shell
sudo apt-get install -f
```

which will force installation of any alternate or missing dependencies of any installed packages.


text:
package splitter

import (
	"testing"

	"github.com/pingcap/tidb-tools/pkg/dbutil"
	"github.com/pingcap/tidb/parser"
	"github.com/stretchr/testify/require"
)

func TestIndexFieldsSimple(t *testing.T) {
	t.Parallel()

	createTableSQL1 := "CREATE TABLE `sbtest1` " +
		"(`id` int(11) NOT NULL AUTO_INCREMENT, " +
		" `k` int(11) NOT NULL DEFAULT '0', " +
		"`c` char(120) NOT NULL DEFAULT '', " +
		"PRIMARY KEY (`id`), KEY `k_1` (`k`))"

	tableInfo, err := dbutil.GetTableInfoBySQL(createTableSQL1, parser.New())
	require.NoError(t, err)

	fields, err := indexFieldsFromConfigString("k", tableInfo)
	require.NoError(t, err)
	require.False(t, fields.IsEmpty())
	require.Len(t, fields.Cols(), 1)

	for _, index := range tableInfo.Indices {
		switch index.Name.String() {
		case "PRIMARY":
			require.False(t, fields.MatchesIndex(index))
		case "k_1":
			require.True(t, fields.MatchesIndex(index))
		default:
			require.FailNow(t, "unreachable")
		}
	}
}

func TestIndexFieldsComposite(t *testing.T) {
	t.Parallel()

	createTableSQL1 := "CREATE TABLE `sbtest1` " +
		"(`id` int(11) NOT NULL AUTO_INCREMENT, " +
		" `k` int(11) NOT NULL DEFAULT '0', " +
		"`c` char(120) NOT NULL DEFAULT '', " +
		"PRIMARY KEY (`id`, `k`)," +
		"KEY `k_1` (`k`)," +
		"UNIQUE INDEX `c_1` (`c`))"

	tableInfo, err := dbutil.GetTableInfoBySQL(createTableSQL1, parser.New())
	require.NoError(t, err)

	fields, err := indexFieldsFromConfigString("id, k", tableInfo)
	require.NoError(t, err)
	require.False(t, fields.IsEmpty())
	require.Len(t, fields.Cols(), 2)

	for _, index := range tableInfo.Indices {
		switch index.Name.String() {
		case "PRIMARY":
			require.True(t, fields.MatchesIndex(index))
		case "k_1":
			require.False(t, fields.MatchesIndex(index))
		case "c_1":
			require.False(t, fields.MatchesIndex(index))
		default:
			require.FailNow(t, "unreachable")
		}
	}
}

func TestIndexFieldsEmpty(t *testing.T) {
	t.Parallel()

	createTableSQL1 := "CREATE TABLE `sbtest1` " +
		"(`id` int(11) NOT NULL AUTO_INCREMENT, " +
		" `k` int(11) NOT NULL DEFAULT '0', " +
		"`c` char(120) NOT NULL DEFAULT '', " +
		"PRIMARY KEY (`id`), KEY `k_1` (`k`))"

	tableInfo, err := dbutil.GetTableInfoBySQL(createTableSQL1, parser.New())
	require.NoError(t, err)

	fields, err := indexFieldsFromConfigString("", tableInfo)
	require.NoError(t, err)
	require.True(t, fields.IsEmpty())

	for _, index := range tableInfo.Indices {
		// Expected to match all.
		require.True(t, fields.MatchesIndex(index))
	}
}


text:
(function() {
    'use strict';

    var s = new ShardingTest({shards: 2, mongos: 2});
    var specialDB = "[a-z]+";
    var specialNS = specialDB + ".special";

    assert.commandWorked(s.s0.adminCommand({enablesharding: "test"}));
    s.ensurePrimaryShard('test', 'shard0001');
    assert.commandWorked(s.s0.adminCommand({shardcollection: "test.data", key: {num: 1}}));

    // Test that the database will not complain "cannot have 2 database names that differs on case"
    assert.commandWorked(s.s0.adminCommand({enablesharding: specialDB}));
    s.ensurePrimaryShard(specialDB, 'shard0000');
    assert.commandWorked(s.s0.adminCommand({shardcollection: specialNS, key: {num: 1}}));

    var exists = s.getDB("config").collections.find({_id: specialNS}).itcount();
    assert.eq(exists, 1);

    // Test that drop database properly cleans up config
    s.getDB(specialDB).dropDatabase();

    var cursor = s.getDB("config").collections.find({_id: specialNS});
    assert(cursor.next()["dropped"]);
    assert(!cursor.hasNext());

    s.stop();
})();


text:
<!DOCTYPE html>

    <title>Angular Tutorial</title>

        {{ x.name}}
        {{ x.username }}
        {{ x.password }}


text:
from django.db import models

# Create your models here.

class Country(models.Model):
    name = models.CharField(verbose_name='Наименование', max_length=255)
    full_name = models.CharField(verbose_name='Полное наименование', max_length=255)
    is_main = models.BooleanField(verbose_name='Основная страна', default=False)
    code = models.CharField(verbose_name='Код', max_length=3)
    code_a2 = models.CharField(verbose_name='Код альфа-2', max_length=2)
    code_a3 = models.CharField(verbose_name='Код альфа-3', max_length=3)

    def __str__(self):
        return self.name.title()

    @staticmethod
    def default_country():
        try:
            return Country.objects.get(is_main=True)
        except Country.DoesNotExist:
            return None

    @staticmethod
    def default_country_id():
        try:
            return Country.objects.get(is_main=True).id
        except Country.DoesNotExist:
            return None

    class Meta:
        ordering = ['name']


text:
Logging and error-handling are built in and ready when you are.

## Logging

Edmunds comes with logging built in. You can activate it in your settings:
```python
from edmunds.log.drivers.file import File
from edmunds.log.drivers.stream import Stream
from edmunds.log.drivers.syslog import SysLog
from edmunds.log.drivers.timedfile import TimedFile
from edmunds.log.drivers.googleappengine import GoogleAppEngine
from logging.handlers import SysLogHandler, SYSLOG_UDP_PORT
from logging import WARNING
from socket import SOCK_DGRAM
import sys

APP = {
    'logging':
    {
        'enabled': True,
        'instances':
        [
            {
                'name': 'file',
                'driver': File,
                # 'directory': 'logs', 		# Optional, default: 'logs'
                # 'prefix': 'Myapp.', 		# Optional, default: ''
                # 'max_bytes': 0, 			# Optional, default: 0
                # 'backup_count': 0, 		# Optional, default: 0
                # 'level': WARNING, 		# Optional, default: WARNING
                # 'format': '%(message)s', 	# Optional, default: '[%(asctime)s] %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
            },
            {
                'name': 'timedfile',
                'driver': TimedFile,
                # 'directory': 'logs', 					# Optional, default: 'logs'
                # 'prefix': 'Myapp.', 					# Optional, default: ''
                # 'when': 'H', 							# Optional, default: 'D'
                # 'interval': 12, 						# Optional, default: 1
                # 'backup_count': 0, 					# Optional, default: 0
                # 'level': WARNING, 					# Optional, default: WARNING
                # 'format': '%(message)s', 				# Optional, default: '[%(asctime)s] %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
            },
            {
                'name': 'syslog',
                'driver': SysLog,
                # 'address': '/dev/log', 				# Optional, default: ('localhost', SYSLOG_UDP_PORT)
                # 'facility': SysLogHandler.LOG_USER, 	# Optional, default: SysLogHandler.LOG_USER
                # 'socktype': SOCK_DGRAM, 				# Optional, default: SOCK_DGRAM
                # 'level': WARNING, 					# Optional, default: WARNING
                # 'format': '%(message)s', 				# Optional, default: '[%(asctime)s] %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
            },
            {
                'name': 'stream',
                'driver': Stream,
                # 'stream': sys.stderr, 				# Optional, default: sys.stderr
                # 'level': WARNING, 					# Optional, default: WARNING
                # 'format': '%(message)s', 				# Optional, default: '[%(asctime)s] %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]'
            },
            {
                'name': 'googleappengine',
                'driver': GoogleAppEngine,
                # 'level': WARNING, 					# Optional, default: WARNING
            },
        ],
    },
}
```
The instances will all be used for logging, so you can have multiple at once.

The available drivers are:

- **File**: Print logs to file which can be separated by size.
- **TimedFile**: Print logs to file which can be separated by time-interval.
- **SysLog**: Print logs to syslog.
- **Stream**: Pring logs to given stream.
- **GoogleAppEngine**: Pring logs to the Google App Engine stream when running in Google App Engine runtime.

## Errors

Even the best programming logic and tests can't always foresee every
possible scenario where errors can occure. You can report and render
these exceptions by registering your own exception-handler.

If logging is enabled, errors that pass through the handler will
automatically be logged to your provider logging-services.

### Define

Define your Handler like so:
```python
from edmunds.exceptions.handler import Handler as EdmundsHandler

class Handler(EdmundsHandler):
    """
    Exception handler
    """

    def report(self, exception):
        """
        Report the exception
        :param exception:   The exception
        :type  exception:   Exception
        """
        if super(Handler, self).report(exception):
            # Additional reporting
            pass

    def render(self, exception):
        """
        Render the exception
        :param exception:   The exception
        :type  exception:   Exception
        :return:            The response
        """
        return super(Handler, self).render(exception)
```

**Important!**: The `report`-function of the edmunds-super-class will log
the error to `self.app.logger`. You defined loggers will by default pick up
caught exceptions as described above.

### Register

Register the Handler for usage in `config/app.py`:
```python
from app.exceptions.handler import Handler

APP = {
    'exceptions':
    {
        'handler': Handler,
    },
}
```
This way the application knows to use your handler in case of an exception.


text:
using System.Diagnostics;

namespace LDAPLibrary.Logger
{
    internal class EventViewerLogger : ALogger
    {
        private const string EventLogSource = "LDAPLibrary";

        public override void Write(string message)
        {
            using (var e = new EventLog { Source = EventLogSource })
            {
                e.WriteEntry(message);
            }
        }
    }
}


text:
require 'aruba/cucumber'
require 'stack_master'
require 'stack_master/testing'
require 'aruba/processes/in_process'
require 'pry'
require 'cucumber/rspec/doubles'
require 'timecop'

Aruba.configure do |config|
  config.command_launcher = :in_process
  config.main_class = StackMaster::CLI
end

Before do
  StackMaster.cloud_formation_driver.reset
  StackMaster.s3_driver.reset
  StackMaster.reset_flags
  Timecop.travel(Time.local(2020, 10, 19))
end

After do
  Timecop.return
end

lib = File.join(File.dirname(__FILE__), "../../spec/fixtures/sparkle_pack_integration/my_sparkle_pack/lib")
$LOAD_PATH << lib


text:
<?php

namespace Slacker\Payload;

class Payload implements \JsonSerializable
{
    public $username;
    public $channel;
    public $text;

    /** @var Attachment[] */
    public $attachments = [];

    public function addAttachment(Attachment $attachment)
    {
        $this->attachments[] = $attachment;
    }

    public function jsonSerialize()
    {
        $data = [
            'username' => $this->username,
            'channel' => $this->channel,
            'text' => $this->text,
            'attachments' => [],
        ];

        foreach ($this->attachments as $attachment) {
            $data['attachments'][] = $attachment->jsonSerialize();
        }

        return $data;
    }
}


text:
import { createClient, FacetOptions } from 'solr-client';

const client = createClient();
const query = client.query();

query; // $ExpectType Query
client; // $ExpectType Client

query.q({ id: '1' }); // $ExpectType Query

client.search(query); // $ExpectType ClientRequest

() => {
    client.search(query, (err, data) => {
        if (err) {
            console.log(err);
        } else {
            console.log(data);
        }
    });
};

const facetOptions1: FacetOptions = {
    on: true,
};

const facetOptions2: FacetOptions = {
    on: true,
    query: 'test',
    field: 'test',
    prefix: 'test',
    sort: 'test',
    limit: 1,
    offset: 1,
    mincout: 1,
    missing: false,
    method: 'test',
    pivot: 'test',
};

const facetOptions3: FacetOptions = {
    on: true,
    query: 'test',
    field: ['test', 'foo'],
    prefix: 'test',
    sort: 'test',
    limit: 1,
    offset: 1,
    mincout: 1,
    missing: false,
    method: 'test',
    pivot: ['test', 'foo'],
};

facetOptions1; // $ExpectType FacetOptions
facetOptions2; // $ExpectType FacetOptions
facetOptions3; // $ExpectType FacetOptions


text:
XpenseJS
=========

ExpenseJS is a mobile app to manage your manage expenses.

Online version - http://ansal.github.io/xpensejs/

Download APK for Android here - https://raw.githubusercontent.com/ansal/xpensejs/master/apk/XpenseJS-debug.apk

![Screenshot1](https://raw.githubusercontent.com/ansal/xpensejs/master/img/1.png "Screenshot1")
![Screenshot2](https://raw.githubusercontent.com/ansal/xpensejs/master/img/2.png "Screenshot2")
![Screenshot3](https://raw.githubusercontent.com/ansal/xpensejs/master/img/3.png "Screenshot3")
![Screenshot4](https://raw.githubusercontent.com/ansal/xpensejs/master/img/4.png "Screenshot4")

I did this project for learning to make an Android app with HTML5 & CSS. I used Apache Cordova for generating the APK. Read more at http://learnjsbydoingprojects.tumblr.com/post/94689425260/xpensejs


text:
package com.xfragwork.xfragwork.base.activity;

import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.View;

import com.readystatesoftware.systembartint.SystemBarTintManager;
import com.xfragwork.xfragwork.base.presenter.BasePresenter;
import com.xfragwork.xfragwork.base.view.IBaseDelegate;
import com.xfragwork.xfragwork.base.view.IBaseView;

public abstract class BaseMVPActivity<V extends IBaseView, P extends BasePresenter<V>> extends BaseActivity implements IBaseDelegate<V, P> {
    public Context mContext;
    protected P mPresenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = createPresenter();
        mContext = this;
        setContentView(getLayoutId());
        setStatusBar();
        initView();
        initData();
        regCommonBtn();
        initListener();
    }
    public void setStatusBar() {
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            int option = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
            decorView.setSystemUiVisibility(option);
            getWindow().setNavigationBarColor(Color.TRANSPARENT);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
    }

    @Override
    public P getPresenter() {
        return mPresenter;
    }

    @Override
    protected void onDestroy() {
        mPresenter.detachView();
        super.onDestroy();
    }
}


text:
"""The tests for the LG webOS media player platform."""
import json
import os
from unittest.mock import patch

import pytest
from sqlitedict import SqliteDict

from homeassistant.components import media_player
from homeassistant.components.media_player.const import (
    ATTR_INPUT_SOURCE,
    ATTR_MEDIA_VOLUME_MUTED,
    SERVICE_SELECT_SOURCE,
)
from homeassistant.components.webostv.const import (
    ATTR_BUTTON,
    ATTR_PAYLOAD,
    DOMAIN,
    SERVICE_BUTTON,
    SERVICE_COMMAND,
    WEBOSTV_CONFIG_FILE,
)
from homeassistant.const import (
    ATTR_COMMAND,
    ATTR_ENTITY_ID,
    CONF_HOST,
    CONF_NAME,
    SERVICE_VOLUME_MUTE,
)
from homeassistant.setup import async_setup_component

NAME = "fake"
ENTITY_ID = f"{media_player.DOMAIN}.{NAME}"

@pytest.fixture(name="client")
def client_fixture():
    """Patch of client library for tests."""
    with patch(
        "homeassistant.components.webostv.WebOsClient", autospec=True
    ) as mock_client_class:
        mock_client_class.create.return_value = mock_client_class.return_value
        client = mock_client_class.return_value
        client.software_info = {"device_id": "a1:b1:c1:d1:e1:f1"}
        client.client_key = "0123456789"
        yield client

async def setup_webostv(hass):
    """Initialize webostv and media_player for tests."""
    assert await async_setup_component(
        hass,
        DOMAIN,
        {DOMAIN: {CONF_HOST: "fake", CONF_NAME: NAME}},
    )
    await hass.async_block_till_done()

@pytest.fixture
def cleanup_config(hass):
    """Test cleanup, remove the config file."""
    yield
    os.remove(hass.config.path(WEBOSTV_CONFIG_FILE))

async def test_mute(hass, client):
    """Test simple service call."""

    await setup_webostv(hass)

    data = {
        ATTR_ENTITY_ID: ENTITY_ID,
        ATTR_MEDIA_VOLUME_MUTED: True,
    }
    await hass.services.async_call(media_player.DOMAIN, SERVICE_VOLUME_MUTE, data)
    await hass.async_block_till_done()

    client.set_mute.assert_called_once()

async def test_select_source_with_empty_source_list(hass, client):
    """Ensure we don't call client methods when we don't have sources."""

    await setup_webostv(hass)

    data = {
        ATTR_ENTITY_ID: ENTITY_ID,
        ATTR_INPUT_SOURCE: "nonexistent",
    }
    await hass.services.async_call(media_player.DOMAIN, SERVICE_SELECT_SOURCE, data)
    await hass.async_block_till_done()

    client.launch_app.assert_not_called()
    client.set_input.assert_not_called()

async def test_button(hass, client):
    """Test generic button functionality."""

    await setup_webostv(hass)

    data = {
        ATTR_ENTITY_ID: ENTITY_ID,
        ATTR_BUTTON: "test",
    }
    await hass.services.async_call(DOMAIN, SERVICE_BUTTON, data)
    await hass.async_block_till_done()

    client.button.assert_called_once()
    client.button.assert_called_with("test")

async def test_command(hass, client):
    """Test generic command functionality."""
    await setup_webostv(hass)

    data = {
        ATTR_ENTITY_ID: ENTITY_ID,
        ATTR_COMMAND: "test",
    }
    await hass.services.async_call(DOMAIN, SERVICE_COMMAND, data)
    await hass.async_block_till_done()

    client.request.assert_called_with("test", payload=None)

async def test_command_with_optional_arg(hass, client):
    """Test generic command functionality."""
    await setup_webostv(hass)

    data = {
        ATTR_ENTITY_ID: ENTITY_ID,
        ATTR_COMMAND: "test",
        ATTR_PAYLOAD: {"target": "https://www.google.com"},
    }
    await hass.services.async_call(DOMAIN, SERVICE_COMMAND, data)
    await hass.async_block_till_done()

    client.request.assert_called_with(
        "test", payload={"target": "https://www.google.com"}
    )

async def test_migrate_keyfile_to_sqlite(hass, client, cleanup_config):
    """Test migration from JSON key-file to Sqlite based one."""
    key = "3d5b1aeeb98e"
    # Create config file with JSON content
    config_file = hass.config.path(WEBOSTV_CONFIG_FILE)
    with open(config_file, "w+") as file:
        json.dump({"host": key}, file)

    # Run the component setup
    await setup_webostv(hass)

    # Assert that the config file is a Sqlite database which contains the key
    with SqliteDict(config_file) as conf:
        assert conf.get("host") == key

async def test_dont_migrate_sqlite_keyfile(hass, client, cleanup_config):
    """Test that migration is not performed and setup still succeeds when config file is already an Sqlite DB."""
    key = "3d5b1aeeb98e"

    # Create config file with Sqlite DB
    config_file = hass.config.path(WEBOSTV_CONFIG_FILE)
    with SqliteDict(config_file) as conf:
        conf["host"] = key
        conf.commit()

    # Run the component setup
    await setup_webostv(hass)

    # Assert that the config file is still an Sqlite database and setup didn't fail
    with SqliteDict(config_file) as conf:
        assert conf.get("host") == key


text:
$(() => {
  /**
   * Create a constructor for sparklines that takes some sensible defaults and merges in the individual
   * chart options. This function is also available from the jQuery plugin as $(element).highcharts('SparkLine').
   */
  Highcharts.SparkLine = function (a, b, c) {
    var hasRenderToArg = typeof a === 'string' || a.nodeName,
        options = arguments[hasRenderToArg ? 1 : 0],
        defaultOptions = {
            chart: {
                renderTo: (options.chart && options.chart.renderTo) || this,
                backgroundColor: null,
                borderWidth: 0,
                type: 'area',
                margin: [2, 0, 2, 0],
                width: 120,
                height: 20,
                style: {
                    overflow: 'visible'
                },

                // small optimalization, saves 1-2 ms each sparkline
                skipClone: true
            },
            title: {
                text: ''
            },
            credits: {
                enabled: false
            },
            xAxis: {
                labels: {
                    enabled: false
                },
                title: {
                    text: null
                },
                startOnTick: false,
                endOnTick: false,
                tickPositions: []
            },
            yAxis: {
                endOnTick: false,
                startOnTick: false,
                labels: {
                    enabled: false
                },
                title: {
                    text: null
                },
                tickPositions: [0]
            },
            legend: {
                enabled: false
            },
            tooltip: {
                hideDelay: 0,
                outside: true,
                shared: true
            },
            plotOptions: {
                series: {
                    animation: false,
                    lineWidth: 1,
                    shadow: false,
                    states: {
                        hover: {
                            lineWidth: 1
                        }
                    },
                    marker: {
                        radius: 1,
                        states: {
                            hover: {
                                radius: 2
                            }
                        }
                    },
                    fillOpacity: 0.25
                },
                column: {
                    negativeColor: '#910000',
                    borderColor: 'silver'
                }
            }
        };

    options = Highcharts.merge(defaultOptions, options);

    return hasRenderToArg ?
        new Highcharts.Chart(a, options, c) :
        new Highcharts.Chart(options, b);
  };

  var start = +new Date(),
    $divs = $('div[data-sparkline]'),
    fullLen = $divs.length,
    n = 0;

  // Creating sparkline charts is quite fast in modern browsers, but IE8 and mobile
  // can take some seconds, so we split the input into chunks and apply them in timeouts
  // in order avoid locking up the browser process and allow interaction.
  function doChunk() {
    var time = +new Date(),
        i,
        len = $divs.length,
        $div,
        data,
        chart;

    for (i = 0; i < len; i += 1) {
        $div = $($divs[i]);
        data = $div.data('sparkline').map((datum) => [Date.parse(datum.date), +datum.value]);

        chart = {
          width: $div.data('width'),
          height: $div.data('height'),
        };

        $div.highcharts('SparkLine', {
            series: [{
                data: data,
            }],
            tooltip: {
                headerFormat: 'Value: {point.y}' + $div.data('value-type') + '
',
                pointFormat: '{point.x:%Y-%m-%d}'
            },
            chart: chart,
            yAxis: {
              plotLines: [{
                value: $div.data('critical-value'),
                color: 'black',
                dashStyle: 'shortdash',
                width: 2,
              }],
            }
        });

        n += 1;

        // If the process takes too much time, run a timeout to allow interaction with the browser
        if (new Date() - time > 500) {
            $divs.splice(0, i + 1);
            setTimeout(doChunk, 0);
            break;
        }

        // Print a feedback on the performance
        if (n === fullLen) {
            $('#result').html('Generated ' + fullLen + ' sparklines in ' + (new Date() - start) + ' ms');
        }
    }
  }
  doChunk();
})


text:
@interface LineLabel : UILabel
@property (nonatomic, strong) UIView *lineView;
- (void)initstance:(NSString *)string height:(CGFloat)height font:(UIFont *)font color:(UIColor *)color width:(CGFloat )width;
@end


text:
sudo -u postgres psql -c 'drop database if exists vocab' || exit
sudo -u postgres psql -c 'drop user if exists contr_vocab_db' || exit
sudo -u postgres psql -c 'create user contr_vocab_db with password $$contr_vocab_db$$ createdb' || exit
echo '127.0.0.1:5432:*:contr_vocab_db:contr_vocab_db' > ~/.pgpass

# create db
psql -h 127.0.0.1 -U contr_vocab_db -d postgres -c 'create database vocab' || exit

# import into public schema
psql -h 127.0.0.1 -U contr_vocab_db -d vocab -f misc/admin93.sql

echo done