text:
/*FONTS*/
@font-face {
  font-family: 'brandon_grotesqueblack';
  src: url("../fonts/brandon/brandon_blk-webfont.eot");
  src: url("../fonts/brandon/brandon_blk-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/brandon/brandon_blk-webfont.woff2") format("woff2"), url("../fonts/brandon/brandon_blk-webfont.woff") format("woff"), url("../fonts/brandon/brandon_blk-webfont.ttf") format("truetype"), url("../fonts/brandon/brandon_blk-webfont.svg#brandon_grotesqueblack") format("svg");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'brandon_grotesquemedium';
  src: url("../fonts/brandon/brandon_med-webfont.eot");
  src: url("../fonts/brandon/brandon_med-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/brandon/brandon_med-webfont.woff2") format("woff2"), url("../fonts/brandon/brandon_med-webfont.woff") format("woff"), url("../fonts/brandon/brandon_med-webfont.ttf") format("truetype"), url("../fonts/brandon/brandon_med-webfont.svg#brandon_grotesquemedium") format("svg");
  font-weight: normal;
  font-style: normal;
}

/* COLOR */
/*--------------------
---------------------*/
* {
  font-family: "Work Sans";
  font-weight: 400;
}

body {
  background: #29292e;
  margin: 0 auto;
  width: 1170px;
  position: relative;
  /*background-image: url(../images/graph.png);*/
  background-color: #29292e;
  z-index: -999;
}

.container {
  width: 910px;
  margin: 0 auto;
  margin-right: 0px;
}

.btn_modification {
  background-color: #1072EA;
  border-radius: 100px;
  border: 2px solid transparent;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 18px;
  height: 50px;
  line-height: 50px;
  margin-top: 25px;
  padding: 0 20px;
  text-align: center;
  text-decoration: none;
  transition: ease-in-out 0.3s;
}

.btn_modification:hover {
  background-color: transparent;
  border: 2px solid #1072EA;
}

.btn__edit {
  background-color: #45FF73;
  border-radius: 100px;
  border: 1px solid transparent;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 14px;
  height: 50px;
  padding: 0 20px;
  line-height: 50px;
  text-decoration: none;
  transition: ease-in-out 0.3s;
}

.btn__edit:hover {
  background-color: transparent;
  border: 1px solid #45FF73;
}

.btn__supp {
  background-color: #f39468;
  border-radius: 100px;
  border: 1px solid transparent;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 14px;
  height: 50px;
  padding: 0 20px;
  line-height: 50px;
  text-decoration: none;
  text-align: center;
  transition: ease-in-out 0.3s;
  width: 150px;
}

.btn__supp:hover {
  background-color: transparent;
  border: 1px solid #f39468;
}

.flash-success {
  color: #45FF73;
  position: relative;
  left: 300px;
  top: 120px;
}

/*----------------
    PAGE INDEX
-----------------*/
.index {
  z-index: 999;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  height: 500px;
  margin-top: 150px;
}

.index .description {
  /*background-image: url(../images/background_description.png);
    background-repeat: no-repeat;
    background-position: center;*/
  float: left;
  line-height: 500px;
  text-align: center;
  width: 50%;
}

.index .description .title {
  color: white;
  font-size: 45px;
  font-family: "brandon_grotesqueblack";
  letter-spacing: 10px;
  margin: 0;
  text-transform: uppercase;
}

.index .description .title .logo {
  vertical-align: -10px;
  margin-right: 15px;
}

.index .connection {
  float: left;
  width: 50%;
  text-align: center;
}

.index .connection .btn_connect {
  background-color: #1072EA;
  border-radius: 100px;
  border: 2px solid transparent;
  color: white;
  display: block;
  font-size: 16px;
  height: 50px;
  line-height: 50px;
  letter-spacing: 5px;
  margin: 190px auto 0 auto;
  text-decoration: none;
  text-transform: uppercase;
  width: 80%;
}

.index .connection .btn_connect:hover {
  border: 2px solid #1072EA;
  background-color: transparent;
  transition: ease-in-out 0.3s;
}

.index .connection .btn_disconnect {
  background-color: #1072EA;
  border-radius: 100px;
  border: 2px solid transparent;
  color: white;
  display: block;
  font-size: 16px;
  height: 50px;
  line-height: 50px;
  letter-spacing: 5px;
  margin: 20px auto 0 auto;
  text-decoration: none;
  text-transform: uppercase;
  width: 80%;
}

.index .connection .btn_disconnect:hover {
  border: 2px solid #1072EA;
  background-color: transparent;
  transition: ease-in-out 0.3s;
}

.index .article_register {
  float: left;
  text-align: center;
  width: 50%;
}

.index .article_register .title {
  color: white;
  font-size: 45px;
  font-family: "brandon_grotesqueblack";
  letter-spacing: 10px;
  margin: 0;
  margin-top: 180px;
  text-transform: uppercase;
}

.index .article_register .title .logo {
  vertical-align: -10px;
  margin-right: 15px;
}

.index .article_register .text_register {
  color: white;
  font-size: 18px;
}

.index .article_register .register {
  background-color: #1072EA;
  border: 2px solid transparent;
  border-radius: 100px;
  color: white;
  display: block;
  height: 30px;
  line-height: 30px;
  margin: 0 auto;
  text-transform: uppercase;
  text-decoration: none;
  width: 200px;
}

.index .article_register .register:hover {
  background-color: transparent;
  border: 2px solid #1072EA;
  transition: ease-in-out 0.3s;
}

.index .form {
  float: left;
  text-align: center;
  width: 50%;
}

.index .form .champ_form {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  padding-left: 15px;
  text-transform: uppercase;
  width: 250px;
}

.index .form #username {
  margin-top: 170px;
  margin-bottom: 20px;
}

.index .form #password {
  margin-bottom: 20px;
}

.index .form .form_champ div {
  position: relative;
}

.index .form .form_champ input[type=email] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-top: 60px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.index .form .form_champ input[type=text] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-top: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.index .form .form_champ input[type=password] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-top: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.index .form .form_champ input[type=file] {
  background: transparent;
  border: 1px solid #1072EA;
  color: white;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-top: 35px;
  outline: none;
  padding-left: 15px;
  padding-top: 10px;
  width: 90%;
}

.index .form .form_champ label {
  color: white;
  position: absolute;
  left: 30px;
  bottom: 50px;
}

.index .form .btn_connection {
  background-color: #1072EA;
  border-radius: 100px;
  border: 2px solid transparent;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 16px;
  height: 50px;
  line-height: 50px;
  letter-spacing: 5px;
  margin: 0 auto;
  margin-top: 30px;
  text-decoration: none;
  text-transform: uppercase;
  width: 80%;
}

.index .form .btn_connection:hover {
  border: 2px solid #1072EA;
  background-color: transparent;
  transition: ease-in-out 0.3s;
}

.index .form .remember {
  color: white;
}

.index .error {
  color: #f39468;
  text-transform: uppercase;
  margin-left: 40px;
  padding-top: 25px;
}

.index .error .material-icons {
  vertical-align: -7px;
  margin-right: 10px;
}

/*--------------
    BACK
---------------*/
.aside-left {
  background-color: rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow: hidden;
  overflow: auto;
  position: fixed;
  top: 0;
  width: 260px;
  z-index: 11;
}

.aside-left .title {
  font-size: 16px;
  letter-spacing: 5px;
  margin: 0;
  margin-top: 25px;
  text-align: center;
  text-transform: uppercase;
}

.aside-left .title .logo {
  vertical-align: -25px;
  margin-right: 15px;
}

.aside-left .title a {
  color: white;
  font-family: "brandon_grotesqueblack";
  text-decoration: none;
}

.aside-left .sidebar {
  padding-right: 20px;
  margin-top: 20px;
}

.aside-left .sidebar .menu_aside ul {
  margin: 0;
  padding-left: 0px;
  list-style: none;
}

.aside-left .sidebar .menu_aside ul li {
  display: block;
}

.aside-left .sidebar .menu_aside ul li a {
  padding: 15px 20px;
  display: block;
  text-decoration: none;
  color: white;
  font-size: 16px;
  border-left: 5px solid transparent;
}

.aside-left .sidebar .menu_aside ul li a:hover {
  border-left: 5px solid #1072EA;
}

.aside-left .sidebar .menu_aside ul li a .material-icons {
  vertical-align: -4px;
  margin-right: 10px;
  font-size: 20px;
}

.aside-left .sidebar .menu_aside ul li .active {
  border-left: 5px solid #1072EA;
}

.header {
  background-color: rgba(0, 0, 0, 0.1);
  height: 80px;
}

.header .header--user .img--user {
  border-radius: 100px;
  float: right;
  margin-top: 10px;
  margin-right: 20px;
  object-fit: cover;
  height: 50px;
  width: 50px;
}

.header .header--user .img--user img {
  border-radius: 100px;
  height: 100%;
  width: 100%;
}

.header .header--user .text--user {
  color: white;
  line-height: 80px;
  float: right;
  font-family: "brandon_grotesquemedium";
  margin: 0;
  margin-right: 5px;
  text-transform: uppercase;
}

.header .header--user .disconect--user {
  color: white;
  float: right;
  margin-top: 25px;
  margin-right: 30px;
  margin-left: 80px;
}

.header:after {
  clear: both;
  content: '';
  display: table;
}

.contenue--profile {
  margin-left: 2%;
}

.contenue--profile .show--profile {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 50px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--profile .show--profile .title--profile {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--profile .show--profile .content__text .text--profile {
  color: white;
  float: left;
  margin-right: 20px;
}

.contenue--profile .show--profile .content__text .text--profile span {
  color: #f39468;
  font-family: "brandon_grotesquemedium";
  text-transform: uppercase;
  letter-spacing: 3px;
}

.contenue--profile .show--profile .content__text:after {
  clear: both;
  content: '';
  display: table;
}

.contenue--profile .show--profile .content__btn .btn_modification {
  float: left;
  margin-right: 20px;
  padding: 0 20px;
}

.contenue--profile .show--profile .content__btn:after {
  clear: both;
  content: '';
  display: table;
}

.contenue--profile .show--profile .form .champ {
  position: relative;
  float: left;
  width: 50%;
  margin-top: 20px;
}

.contenue--profile .show--profile .form .champ label {
  color: white;
  padding-left: 25px;
}

.contenue--profile .show--profile .form .picture {
  background-color: transparent;
  border: 2px solid #1072EA;
  height: 60px;
  margin-bottom: 30px;
  margin-left: 25px;
  position: relative;
  width: 95%;
}

.contenue--profile .show--profile .form .picture span {
  color: white;
  line-height: 60px;
  padding-left: 30px;
}

.contenue--profile .show--profile .form .btn_submit {
  float: left;
  margin-top: 0px;
  margin-left: 100px;
}

.contenue--profile .show--profile .form input[type=email] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--profile .show--profile .form input[type=text] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--profile .show--profile .form input[type=number] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--profile .show--profile .form input[type=password] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--profile .show--profile .form input[type=file] {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
}

.contenue--profile .show--profile:after {
  clear: both;
  display: table;
  content: '';
}

.contenue--profile .show--picture {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
  margin-right: 50px;
  margin-bottom: 20px;
  padding: 20px 0 20px 20px;
  width: 50%;
}

.contenue--profile .show--picture .title--profile {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--profile .show--picture .images {
  margin: 0 auto;
  height: 300px;
  object-fit: cover;
  width: 300px;
}

.contenue--profile .show--picture .images img {
  background-color: white;
  border-radius: 100%;
  height: 100%;
  width: 100%;
}

.contenue--profile .show--project {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 30px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--profile .show--project .title--project {
  color: #f39468;
  letter-spacing: 5px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--profile .show--project .text--project {
  color: white;
}

.contenue--client {
  margin-left: 2%;
}

.contenue--client .show--client {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 50px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--client .show--client .title--client {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--client .show--client .title--client .material-icons {
  font-size: 45px;
  vertical-align: -7px;
}

.contenue--client .show--client .text--client {
  color: white;
  font-size: 14px;
  padding: 0 20px 0 0;
}

.contenue--client .show--client .text--client .material-icons {
  font-size: 25px;
  margin-right: 10px;
  vertical-align: -4px;
}

.contenue--client .show--client ul {
  padding: 0;
}

.contenue--client .show--client ul li {
  list-style: none;
  display: inline-block;
}

.contenue--client .show--client .form--client .champ--client {
  position: relative;
  float: left;
  width: 100%;
  margin-top: 20px;
}

.contenue--client .show--client .form--client .champ--client label {
  color: white;
  padding-left: 5px;
  position: absolute;
  top: -20px;
}

.contenue--client .show--client .form--client .champ--client div {
  float: left;
  position: relative;
}

.contenue--client .show--client .form--client .champ--client input[type=text] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--client .show--client .form--client .champ--client input[type=number] {
  background: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  display: block;
  font-size: 16px;
  height: 50px;
  margin: 0 auto;
  margin-bottom: 35px;
  outline: none;
  padding-left: 15px;
  width: 90%;
}

.contenue--client .show--client .form--client .champ--client select {
  background-color: transparent;
  border: 1px solid #1072EA;
  color: #1072EA;
  height: 54px;
  padding: 0 20px;
  width: 150px;
  margin-left: 5px;
}

.contenue--client .show--client .form--client:after {
  clear: both;
  display: table;
  content: '';
}

.contenue--client .show--projet {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  position: relative;
  width: 98%;
}

.contenue--client .show--projet .title--project {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--client .show--projet .title--show--projet {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 18px;
  font-family: "brandon_grotesqueblack";
  margin: 0px 0 0px 0;
}

.contenue--client .show--projet .title--show--projet .material-icons {
  font-size: 35px;
  vertical-align: -10px;
  margin-right: 10px;
}

.contenue--client .show--projet .title--projet {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 18px;
  font-family: "brandon_grotesqueblack";
  margin: 0px 0 0px 0;
}

.contenue--client .show--projet .title--projet .material-icons {
  font-size: 35px;
  vertical-align: -10px;
  margin-right: 10px;
}

.contenue--client .show--projet .text--projet {
  color: white;
  font-size: 14px;
}

.contenue--client .show--projet .text--projet .material-icons {
  vertical-align: -5px;
}

.contenue--client .show--projet .text--projet span {
  color: #1072EA;
  font-size: 16px;
}

.contenue--client .show--projet .text--title {
  color: white;
  font-family: "brandon_grotesqueblack";
  font-size: 16px;
  text-transform: uppercase;
}

.contenue--client .show--projet tr td {
  padding-right: 200px;
  padding-bottom: 50px;
}

.contenue--client .show--projet .table_show_projet td {
  padding-right: 50px;
}

.contenue--client .show--projet ul {
  padding: 0px;
}

.contenue--client .show--projet ul li .btn__update {
  background-color: #1072EA;
  border-radius: 100px;
  border: 2px solid transparent;
  color: white;
  cursor: pointer;
  display: block;
  font-size: 18px;
  height: 50px;
  line-height: 50px;
  margin-top: 25px;
  padding: 0 20px;
  text-align: center;
  text-decoration: none;
  transition: ease-in-out 0.3s;
  width: 250px;
}

.contenue--client .show--projet ul li .btn__update:hover {
  background-color: transparent;
  border: 2px solid #1072EA;
}

.contenue--dashboard {
  margin-left: 2%;
}

.contenue--dashboard .show--desc {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 50px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--dashboard .show--desc .main-text-dashboard {
  color: white;
  font-size: 24px;
}

.contenue--dashboard .show--desc .main-text-dashboard span {
  color: #1072EA;
}

.contenue--dashboard .show--desc .text--dashboard {
  color: white;
}

.contenue--dashboard .show--desc .text--dashboard .material-icons {
  vertical-align: -5px;
}

.contenue--dashboard .show--dashboard {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--dashboard .show--dashboard .text--dashboard {
  color: white;
  padding: 0 20px 40px 0;
}

.contenue--dashboard .show--dashboard .text--dashboard .material-icons {
  vertical-align: -5px;
}

.contenue--dashboard .show--dashboard ul {
  padding: 0 0 40px 0;
  margin: 0px;
}

.contenue--dashboard .show--dashboard ul li {
  list-style: none;
  display: inline-block;
}

.contenue--dashboard .show--dashboard .title--dashboard {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 18px;
  font-family: "brandon_grotesqueblack";
  margin: 0px 0 50px 0;
}

.contenue--graphic {
  margin-left: 2%;
}

.contenue--graphic .show--graphic {
  background-color: rgba(0, 0, 0, 0.3);
  box-shadow: 8px 3px 15px 0px rgba(0, 0, 0, 0.3);
  margin-top: 50px;
  margin-right: 50px;
  padding: 20px 0 20px 20px;
  width: 98%;
}

.contenue--graphic .show--graphic .title--graphic {
  color: #f39468;
  letter-spacing: 10px;
  text-transform: uppercase;
  font-size: 24px;
  font-family: "brandon_grotesqueblack";
}

.contenue--graphic .show--graphic .title--graphic .material-icons {
  font-size: 45px;
  vertical-align: -7px;
}


text:
using System;

using static System.FormattableString;

namespace AirBreather.Random
{
    public struct RngState128 : IEquatable<RngState128>, IRandomGeneratorState
    {
        public ulong S0; public ulong S1;

        public RngState128(ulong s0, ulong s1)
        {
            if (0 == (s0 | s1))
            {
                ThrowHelpers.ThrowArgumentExceptionForAllZeroes();
            }

            this.S0 = s0; this.S1 = s1;
        }

        public RngState128(RngState128 copyFrom)
            : this(copyFrom.S0, copyFrom.S1)
        {
        }

        public bool IsValid => 0 != (this.S0 | this.S1);

        public static bool operator ==(RngState128 first, RngState128 second) => first.Equals(second);
        public static bool operator !=(RngState128 first, RngState128 second) => !first.Equals(second);

        public override bool Equals(object obj) => obj is RngState128 other && Equals(this, other);
        public bool Equals(RngState128 other) => 0 == (this.S0 ^ other.S0 | (this.S1 ^ other.S1));
        public override int GetHashCode() => (this.S0 ^ this.S1).GetHashCode();
        public override string ToString() => Invariant($"{nameof(RngState128)}[S0 = {this.S0}, S1 = {this.S1}]");
    }
}

redpajama_set_name: RedPajamaGithub


text:
class ColumnComparisonStrategy
  def compute_difference(image, leftColumn, rightColumn)
  end

  def diff_pixels(x1, y1, x2, y2)
    first = @image.get_pixel_value(x1, y1)
    second = @image.get_pixel_value(x2, y2)
    diff = 0
    (0...first.length).each do |index|
      diff += (first[index] - second[index]).abs
    end
    return diff
  end
end


text:
id: 587d7789367417b2b2512aa4
title: Mejorar la accesibilidad del contenido de audio con el elemento de audio
challengeType: 0
videoUrl: 'https://scrimba.com/c/cVJVkcZ'
forumTopicId: 301014
dashedName: improve-accessibility-of-audio-content-with-the-audio-element
---

# --description--

El elemento `audio` de HTLM le da un significado semántico cuando contiene sonido o contenido de flujo de audio en el código. El contenido del audio también necesita un texto alternativo para que las personas sordas o con dificultad para escuchar puedan acceder al mismo. Para esto debe tener un texto cercano en la página o un enlace a una transcripción.

La etiqueta de `audio` suporta los atributos `controls`. Esto muestra los controles por defecto de reproducir, pausar, entre otros controles, y soporta la funcionalidad del teclado. Este es un atributo booleano por lo que no necesita un valor, su presencia en la etiqueta activa la configuración.

Acá tenemos un ejemplo:

```html
<audio id="meowClip" controls>
  <source src="audio/meow.mp3" type="audio/mpeg">
  <source src="audio/meow.ogg" type="audio/ogg">
</audio>
```

**Note:** El contenido multimedia generalmente tiene componentes visuales y de audio. Se necesita sincronizar los subtítulos y una transcripción para que los usuarios con dificultades de vista o con problemas para escuchar puedan tener acceso a las mismas. Por lo general, un desarrollador de web no se responsabiliza de la creación de subtítulos o transcripciones pero necesita saber para incluirlos.

# --instructions--

Es hora de salir del Camper Cat y conocer a nuestro compañero Zersiax (@zersiax), un campeón en accesibilidad y un usuario de lector de pantalla. Para escuchar un clip de su lector de pantalla en acción, añade un elemento `audio` después de `p`. Incluye el atributo `controls`. A continuación, coloca una etiqueta `source` dentro de las etiquetas `audio` con el atributo `src` establecido en `https://s3.amazonaws.com/freecodecamp/screen-reader.mp3` y el atributo `type` establecido en `"audio/mpeg"`.

**Note:** El clip del audio puede sonar rápido y quizás sea difícil de entender pero esta velocidad es normal para los lectores de pantalla.

# --hints--

Tu código debe tener una etiqueta `audio`.

```js
assert($('audio').length === 1);
```

El elemento `audio` debe tener una etiqueta de cierre.

```js
assert(
  code.match(/<\/audio>/g).length === 1 &&
    code.match(/<audio.*>[\s\S]*<\/audio>/g)
);
```

La etiqueta `audio` debe tener el atributo `controls`.

```js
assert($('audio').attr('controls'));
```

Tu código debe tener una etiqueta `source`.

```js
assert($('source').length === 1);
```

La etiqueta `source` debe estar adentro de las etiquetas `audio`.

```js
assert($('audio').children('source').length === 1);
```

El valor para el atributo `src` en `source` debe coincidir exactamente con el link en las instrucciones.

```js
assert(
  $('source').attr('src') ===
    'https://s3.amazonaws.com/freecodecamp/screen-reader.mp3'
);
```

El código debe incluir un atributo `type` en la etiqueta `source` con un valor de audio/mpeg.

```js
assert($('source').attr('type') === 'audio/mpeg');
```

# --seed--

## --seed-contents--

```html
<body>
  <header>
    <h1>Real Coding Ninjas</h1>
  </header>
  <main>
    <p>A sound clip of Zersiax's screen reader in action.</p>

  </main>
</body>
```

# --solutions--

```html
<body>
  <header>
    <h1>Real Coding Ninjas</h1>
  </header>
  <main>
    <p>A sound clip of Zersiax's screen reader in action.</p>
    <audio controls>
      <source src="https://s3.amazonaws.com/freecodecamp/screen-reader.mp3" type="audio/mpeg"/>
    </audio>
  </main>
</body>
```


text:
"""
Module for animating solutions in 1D.
Can also save them but requieres ffmpeg package
see save_animation method.
"""
import numpy as nm
from os.path import join as pjoin
from glob import glob

from matplotlib import animation
from matplotlib import pyplot as plt
from matplotlib import colors

from sfepy.discrete.fem.meshio import MeshioLibIO
from sfepy.discrete.fem.mesh import Mesh

# This would still use some refactoring so it is more flexible
__author__ = 'tomas_zitka'

ffmpeg_path = ''  # for saving animations

def head(l):
    """
    Maybe get head of the list.

    Parameters
    ----------
    l : indexable

    Returns
    -------
    head : first element in l or None is l is empty
    """
    if l:
        return l[0]
    else:
        return None

def animate1D_dgsol(Y, X, T, ax=None, fig=None, ylims=None, labs=None,
                    plott=None, delay=None):
    """Animates solution of 1D problem into current figure.
    Keep reference to returned animation object otherwise
    it is discarded

    Parameters
    ----------
    Y :
        solution, array |T| x |X| x n, where n is dimension of the solution
    X :
        space interval discetization
    T :
        time interval discretization
    ax :
        specify axes to plot to (Default value = None)
    fig :
        specifiy figure to plot to (Default value = None)
    ylims :
        limits for y axis, default are 10% offsets of Y extremes
    labs :
        labels to use for parts of the solution (Default value = None)
    plott :
        plot type - how to plot data: tested plot, step (Default value = None)
    delay :
         (Default value = None)

    Returns
    -------
    anim
        the animation object, keep it to see the animation, used for savig too
    """

    ax, fig, time_text = setup_axis(X, Y, ax, fig, ylims)

    if not isinstance(Y, nm.ndarray):
        Y = nm.stack(Y, axis=2)

    lines = setup_lines(ax, Y.shape, labs, plott)

    def animate(i):
        ax.legend()
        time_text.set_text("t= {0:3.2f} / {1:3.3}".format(T[i], T[-1]))
        # from sfepy.base.base import debug;
        # debug()
        if len(Y.shape) > 2:
            for ln, l in enumerate(lines):
                l.set_data(X, Y[i].swapaxes(0, 1)[ln])
            return tuple(lines) + (time_text,)
        # https://stackoverflow.com/questions/20624408/matplotlib-animating-multiple-lines-and-text
        else:
            lines.set_data(X, Y[i])
            return lines, time_text

    if delay is None:
        delay = int(nm.round(2000 * (T[-1] - T[0]) / len(T)))
    anim = animation.FuncAnimation(fig, animate, frames=len(T), interval=delay,
                                   blit=True, repeat=True, repeat_delay=250)

    return anim

def setup_axis(X, Y, ax=None, fig=None, ylims=None):
    """Setup axis, including timer for animation or snaps

    Parameters
    ----------
    X :
        space disctretization to get limits
    Y :
        solution to get limits
    ax :
        ax where to put everything, if None current axes are used (Default value = None)
    fig :
        fig where to put everything, if None current figure is used (Default value = None)
    ylims :
        custom ylims, if None y axis limits are calculated from Y (Default value = None)

    Returns
    -------
    ax

    fig

    time_text
        object to fill in text

    """
    if ax is None:
        fig = plt.gcf()
        ax = plt.gca()
    if ylims is None:
        lowery = nm.min(Y) - nm.min(Y) / 10
        uppery = nm.max(Y) + nm.max(Y) / 10
    else:
        lowery = ylims[0]
        uppery = ylims[1]
    ax.set_ylim(lowery, uppery)
    ax.set_xlim(X[0], X[-1])
    time_text = ax.text(X[0] + nm.sign(X[0]) * X[0] / 10,
                        uppery - uppery / 10,
                        'empty', fontsize=15)
    return ax, fig, time_text

def setup_lines(ax, Yshape, labs, plott):
    """Sets up artist for animation or solution snaps

    Parameters
    ----------
    ax :
        axes to use for artist
    Yshape : tuple
        shape of the solution array
    labs : list
        labels for the solution
    plott : str ("steps" or "plot")
        type of plot to use

    Returns
    -------

    lines
    """
    if plott is None:
        plott = ax.plot
    else:
        plott = ax.__getattribute__(plott)

    if len(Yshape) > 2:
        lines = [plott([], [], lw=2)[0] for foo in range(Yshape[2])]
        for i, l in enumerate(lines):
            if labs is None:
                l.set_label("q" + str(i + 1) + "(x, t)")
            else:
                l.set_label(labs[i])
    else:
        lines, = plott([], [], lw=2)
        if labs is None:
            lines.set_label("q(x, t)")
        else:
            lines.set_label(labs)
    return lines

def save_animation(anim, filename):
    """Saves animation as .mp4, requires ffmeg package

    Parameters
    ----------
    anim :
        animation object
    filename :
        name of the file, without the .mp4 ending
    """
    plt.rcParams['animation.ffmpeg_path'] = ffmpeg_path
    writer = animation.FFMpegWriter(fps=24)
    anim.save(filename + ".mp4", writer=writer)

def sol_frame(Y, X, T, t0=.5, ax=None, fig=None, ylims=None, labs=None, plott=None):
    """Creates snap of solution at specified time frame t0, basically gets one
    frame from animate1D_dgsol, but colors wont be the same :-(

    Parameters
    ----------
    Y :
        solution, array |T| x |X| x n, where n is dimension of the solution
    X :
        space interval discetization
    T :
        time interval discretization
    t0 :
        time to take snap at (Default value = .5)
    ax :
        specify axes to plot to (Default value = None)
    fig :
        specifiy figure to plot to (Default value = None)
    ylims :
        limits for y axis, default are 10% offsets of Y extremes
    labs :
        labels to use for parts of the solution (Default value = None)
    plott :
        plot type - how to plot data: tested plot, step (Default value = None)

    Returns
    -------
    fig
    """

    ax, fig, time_text = setup_axis(X, Y, ax, fig, ylims)

    if not isinstance(Y, nm.ndarray):
        Y = nm.stack(Y, axis=2)

    lines = setup_lines(ax, Y.shape, labs, plott)

    nt0 = nm.abs(T - t0).argmin()

    ax.legend()
    time_text.set_text("t= {0:3.2f} / {1:3.3}".format(T[nt0], T[-1]))
    if len(Y.shape) > 2:
        for ln, l in enumerate(lines):
            l.set_data(X, Y[nt0].swapaxes(0, 1)[ln])
    else:
        lines.set_data(X, Y[nt0])
    return fig

def save_sol_snap(Y, X, T, t0=.5, filename=None, name=None,
                  ylims=None, labs=None, plott=None):
    """Wrapper for sol_frame, saves the frame to file specified.

    Parameters
    ----------
    name :
        name of the solution e.g. name of the solver used (Default value = None)
    filename :
        name of the file, overrides automatic generation (Default value = None)
    Y :
        solution, array |T| x |X| x n, where n is dimension of the solution
    X :
        space interval discetization
    T :
        time interval discretization
    t0 :
        time to take snap at (Default value = .5)
    ylims :
        limits for y axis, default are 10% offsets of Y extremes
    labs :
        labels to use for parts of the solution (Default value = None)
    plott :
        plot type - how to plot data: tested plot, step (Default value = None)

    Returns
    -------
    fig
    """

    if filename is None:
        filename = "{0}_solsnap{1:3.2f}-{2:3.3}".format(name, t0, T[-1]).replace(".", "_")
        if name is None:
            name = "unknown_solver"
        filename = "{0}_solsnap{1:3.2f}-{2:3.3}".format(name, t0, T[-1]).replace(".", "_")
        filename = pjoin("semestralka", "figs", filename)

    fig = plt.figure(filename)

    snap1 = sol_frame(Y, X, T, t0=t0, ylims=ylims, labs=labs, plott=None)
    if not isinstance(Y, nm.ndarray):
        plt.plot(X, Y[0][0], label="q(x, 0)")
    else:
        if len(Y.shape) > 2:
            plt.plot(X, Y[0, :, 0], label="q(x, 0)")
        else:
            plt.plot(X, Y[0, :], label="q(x, 0)")
    plt.legend()
    snap1.savefig(filename)
    return fig

def plotsXT(Y1, Y2, YE, extent, lab1=None, lab2=None, lab3=None):
    """Plots Y1 and Y2 to one axes and YE to the second axes,
    Y1 and Y2 are presumed to be two solutions and YE their error

    Parameters
    ----------
    Y1 :
        solution 1, shape = (space nodes, time nodes)
    Y2 :
        solution 2, shape = (space nodes, time nodes)
    YE :
        soulutio 1 - soulution 2||
    extent :
        imshow extent
    lab1 :
         (Default value = None)
    lab2 :
         (Default value = None)
    lab3 :
         (Default value = None)
    """

    # >> Plot contours
    cmap1 = plt.cm.get_cmap("bwr")
    cmap1.set_bad('white')
    # cmap2 = plt.cm.get_cmap("BrBG")
    # cmap2.set_bad('white')
    bounds = nm.arange(-1, 1, .05)
    norm1 = colors.BoundaryNorm(bounds, cmap1.N)
    # norm2 = colors.BoundaryNorm(bounds, cmap2.N)

    fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, sharey=True)
    fig.suptitle("X-T plane plot")
    if lab1 is not None:
        ax1.set(title=lab1)
    c1 = ax1.imshow(Y1, extent=extent,
                    cmap=cmap1, norm=norm1,
                    interpolation='none',
                    origin='lower')
    ax1.grid()
    if lab2 is not None:
        ax2.set(title=lab2)
    c2 = ax2.imshow(Y2, extent=extent,
                    cmap=cmap1, norm=norm1,
                    interpolation='none',
                    origin='lower')
    ax2.grid()

    if lab3 is not None:
        ax3.set(title=lab3)
    c3 = ax3.imshow(YE, extent=extent,
                    cmap="bwr", norm=norm1,
                    interpolation='none',
                    origin='lower')
    ax3.grid()
    fig.colorbar(c3, ax=[ax1, ax2, ax3])

def load_state_1D_vtk(name):
    """Load one VTK file containing state in time

    Parameters
    ----------
    name : str

    Returns
    -------
    coors : ndarray
    u : ndarray
    """

    from sfepy.discrete.fem.meshio import MeshioLibIO
    io = MeshioLibIO(name)
    coors = io.read(Mesh()).coors[:, 0, None]
    data = io.read_data(step=0)
    var_name = head([k for k in data.keys() if "_modal" in k])[:-1]
    if var_name is None:
        print("File {} does not contain modal data.".format(name))
        return
    porder = len([k for k in data.keys() if var_name in k])

    u = nm.zeros((porder, coors.shape[0] - 1, 1, 1))
    for ii in range(porder):
        u[ii, :, 0, 0] = data[var_name+'{}'.format(ii)].data

    return coors, u

def load_1D_vtks(fold, name):
    """Reads series of .vtk files and crunches them into form
    suitable for plot10_DG_sol.

    Attempts to read modal cell data for variable mod_data. i.e.

    ``?_modal{i}``, where i is number of modal DOF

    Resulting solution data have shape:
    ``(order, nspace_steps, ntime_steps, 1)``

    Parameters
    ----------
    fold :
        folder where to look for files
    name :
        used in ``{name}.i.vtk, i = 0,1, ... tns - 1``

    Returns
    -------
    coors : ndarray
    mod_data : ndarray
        solution data

    """

    files = glob(pjoin(fold, name) + ".[0-9]*")

    if len(files) == 0: # no multiple time steps, try loading single file
        print("No files {} found in {}".format(pjoin(fold, name) + ".[0-9]*", fold))
        print("Trying {}".format(pjoin(fold, name) + ".vtk"))
        files = glob(pjoin(fold, name) + ".vtk")
        if files:
            return load_state_1D_vtk(files[0])
        else:
            print("Nothing found.")
            return

    io = MeshioLibIO(files[0])
    coors = io.read(Mesh()).coors[:, 0, None]
    data = io.read_data(step=0)
    var_name = head([k for k in data.keys() if "_modal" in k])[:-1]
    if var_name is None:
        print("File {} does not contain modal data.".format(files[0]))
        return
    porder = len([k for k in data.keys() if var_name in k])

    tn = len(files)
    nts = sorted([int(f.split(".")[-2]) for f in files])

    digs = len(files[0].split(".")[-2])
    full_name_form = ".".join((pjoin(fold, name), ("{:0" + str(digs) + "d}"), "vtk"))

    mod_data = nm.zeros((porder, coors.shape[0] - 1, tn, 1))
    for i, nt in enumerate(nts):
        io = MeshioLibIO(full_name_form.format(nt))
        # parameter "step" does nothing, but is obligatory
        data = io.read_data(step=0)
        for ii in range(porder):
            mod_data[ii, :, i, 0] = data[var_name+'{}'.format(ii)].data

    return coors, mod_data

def animate_1D_DG_sol(coors, t0, t1, u,
                      tn=None, dt=None,
                      ic=lambda x: 0.0, exact=lambda x, t: 0,
                      delay=None, polar=False):
    """Animates solution to 1D problem produced by DG:
        1. animates DOF values in elements as steps
        2. animates reconstructed solution with discontinuities

    Parameters
    ----------
    coors :
        coordinates of the mesh
    t0 : float
        starting time
    t1 : float
        final time
    u :
        vectors of DOFs, for each order one, shape(u) = (order, nspace_steps, ntime_steps, 1)
    ic :
        analytical initial condition, optional (Default value = lambda x: 0.0)
    tn :
        number of time steps to plot, starting at 0, if None and dt is not None run animation through
        all time steps, spaced dt within [t0, tn] (Default value = None)
    dt :
        time step size, if None and tn is not None computed as (t1- t0) / tn otherwise set to 1
        if dt and tn are both None, t0 and t1 are ignored and solution is animated as if in time 0 ... ntime_steps (Default value = None)
    exact :
         (Default value = lambda x)
    t: 0 :

    delay :
         (Default value = None)
    polar :
         (Default value = False)

    Returns
    -------
    anim_dofs : animation object of DOFs,
    anim_recon : animation object of reconstructed solution
    """

    # Setup space coordinates
    XN = coors[-1]
    X1 = coors[0]
    Xvol = XN - X1
    X = (coors[1:] + coors[:-1]) / 2
    XS = nm.linspace(X1, XN, 500)[:, None]

    if polar: # setup polar coorinates
        coors *= 2*nm.pi
        X *= 2*nm.pi
        XS *= 2*nm.pi

    # Setup times
    if tn is not None and dt is not None:
        T = nm.array(nm.cumsum(nm.ones(tn) * dt))
    elif tn is not None:
        T, dt = nm.linspace(t0, t1, tn, retstep=True)
    elif dt is not None:
        tn = int(nm.ceil(float(t1 - t0) / dt))
        T = nm.linspace(t0, t1, tn)
    else:
        T = nm.arange(nm.shape(u)[2])

    n_nod = len(coors)
    n_el_nod = nm.shape(u)[0]
    # prepend u[:, 0, ...] to all time frames for plotting step in left corner
    u_step = nm.append(u[:, 0:1, :, 0], u[:, :, :, 0], axis=1)

    # Plot DOFs directly
    figs = plt.figure()
    if polar:
        axs = plt.subplot(111, projection='polar')
        axs.set_theta_direction('clockwise')

    else:
        axs = plt.subplot(111)

    # Plot mesh
    axs.vlines(coors[:, 0], ymin=0, ymax=.5, colors="grey")
    axs.vlines((X1, XN), ymin=0, ymax=.5, colors="k")
    axs.vlines(X, ymin=0, ymax=.3, colors="grey", linestyles="--")

    axs.plot([X1, XN], [1, 1], 'k')

    # Plot IC and its sampling
    for i in range(n_el_nod):
        c0 = axs.plot(X, u[i, :, 0, 0],
                      label="IC-{}".format(i),
                      marker=".", ls="")[0].get_color()
        # c1 = plt.plot(X, u[1, :, 0, 0], label="IC-1", marker=".", ls="")[0].get_color()
        # # plt.plot(coors, .1*alones(n_nod), marker=".", ls="")
        axs.step(coors[1:], u[i, :, 0,  0], color=c0)
        # plt.step(coors[1:], u[1, :, 0,  0], color=c1)
        # plt.plot(coors[1:], sic[1, :], label="IC-1", color=c1)
    if ic is not None:
        ics = ic(XS)
        axs.plot(nm.squeeze(XS), nm.squeeze(ics), label="IC-ex")

    # Animate sampled solution DOFs directly
    anim_dofs = animate1D_dgsol(u_step.T, coors, T, axs, figs,
                                ylims=[-1, 2],
                                plott="step",
                                delay=delay)
    if not polar:
        axs.set_xlim(coors[0] - .1 * Xvol, coors[-1] + .1 * Xvol)
    axs.legend(loc="upper left")
    axs.set_title("Sampled solution")

    # Plot reconstructed solution
    figr = plt.figure()
    if polar:
        axr = plt.subplot(111, projection='polar')
        axr.set_theta_direction('clockwise')
    else:
        axr = plt.subplot(111)

    # Plot mesh
    axr.vlines(coors[:, 0], ymin=0, ymax=.5, colors="grey")
    axr.vlines((X1, XN), ymin=0, ymax=.5, colors="k")
    axr.vlines(X, ymin=0, ymax=.3, colors="grey", linestyles="--")

    axr.plot([X1, XN], [1, 1], 'k')

    # Plot discontinuously!
    # (order, space_steps, t_steps, 1)
    ww, xx = reconstruct_legendre_dofs(coors, tn, u)
    # plt.vlines(xx, ymin=0, ymax=.3, colors="green")

    # plot reconstructed IC
    axr.plot(xx, ww[:, 0], label="IC")

    # get exact solution values
    if exact is not None:
        exact_vals = exact(xx, T)[..., None]
        labs = ["q{}(x,t)".format(i) for i in range(ww.shape[-1])] + ["exact"]
        ww = nm.concatenate((ww, exact_vals), axis=-1)
    else:
        labs = None

    # Animate reconstructed solution
    anim_recon = animate1D_dgsol(ww.swapaxes(0, 1), xx, T, axr, figr,
                                 ylims=[-1, 2],
                                 labs=labs,
                                 delay=delay)
    if not polar:
        axr.set_xlim(coors[0] - .1 * Xvol, coors[-1] + .1 * Xvol)
    axr.legend(loc="upper left")
    axr.set_title("Reconstructed solution")

    # sol_frame(u[:, :, :, 0].T, nm.append(coors, coors[-1]), T, t0=0., ylims=[-1, 1], plott="step")
    plt.show()
    return anim_dofs, anim_recon

def plot1D_legendre_dofs(coors, dofss, fun=None):
    """Plots values of DOFs as steps

    Parameters
    ----------
    coors :
        coordinates of nodes of the mesh
    dofss :
        iterable of different projections' DOFs into legendre space
    fun :
        analytical function to plot (Default value = None)
    """
    X = (coors[1:] + coors[:-1]) / 2
    plt.figure("DOFs for function fun")
    plt.gcf().clf()
    for ii, dofs in enumerate(dofss):
        for i in range(dofs.shape[1]):
            c0 = plt.plot(X, dofs[:, i], label="fun-{}dof-{}".format(ii, i), marker=".", ls="")[0].get_color()
            # # plt.plot(coors, .1*alones(n_nod), marker=".", ls="")
            plt.step(coors[1:], dofs[:, i], color=c0)
            # plt.plot(coors[1:], sic[1, :], label="IC-1", color=c1)

    if fun is not None:
        xs = nm.linspace(nm.min(coors), nm.max(coors), 500)[:, None]
        plt.plot(xs, fun(xs), label="fun-ex")
    plt.legend()
    # plt.show()

def reconstruct_legendre_dofs(coors, tn, u):
    """Creates solution and coordinates vector which when plotted as

        plot(xx, ww)

    represent solution reconstructed from DOFs in Legendre poly space at
    cell borders.

    Works only as linear interpolation between cell boundary points

    Parameters
    ----------
    coors :
        coors of nodes of the mesh
    u :
        vectors of DOFs, for each order one,
        shape(u) = (order, nspace_steps, ntime_steps, 1)
    tn :
        number of time steps to reconstruct,
        if None all steps are reconstructed

    Returns
    -------
    ww : ndarray
        solution values vector, shape is (3 * nspace_steps - 1, ntime_steps, 1),
    xx : ndarray
        corresponding coordinates vector, shape is (3 * nspace_steps - 1, 1)
    """

    XN = coors[-1]
    X1 = coors[0]
    n_nod = len(coors) - 1
    if tn is None:
        tn = nm.shape(u)[2]
    n_el_nod = nm.shape(u)[0]

    ww = nm.zeros((3 * n_nod - 1, tn, 1))

    for i in range(n_el_nod):
        ww[0:-1:3] = ww[0:-1:3] + (-1)**i * u[i, :, :]  # left edges of elements
        ww[1::3] = ww[1::3] + u[i, :, :]  # right edges of elements
    # NaNs ensure plotting of discontinuities at element borders
    ww[2::3, :] = nm.NaN

    # nodes for plotting reconstructed solution
    xx = nm.zeros((3 * n_nod - 1, 1))
    xx[0] = X1
    xx[-1] = XN
    # the ending is still a bit odd, but hey, it works!
    xx[1:-1] = nm.repeat(coors[1:-1], 3)[:, None]
    return ww, xx


text:
package sg.ncl.common.jwt;

import io.jsonwebtoken.JwtParser;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import io.jsonwebtoken.SignatureException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import sg.ncl.common.authentication.AuthenticationProperties;

import javax.crypto.spec.SecretKeySpec;
import javax.inject.Inject;
import javax.validation.constraints.NotNull;
import java.security.Key;
import java.time.Duration;
import java.time.format.DateTimeParseException;
import java.util.UUID;

/**
 * Initializes the necessary components to create JWTs.
 *
 * @author Christopher Zhong
 * @version 1.0
 */
@Configuration
@ConditionalOnClass({SignatureAlgorithm.class, Key.class, Duration.class})
@EnableConfigurationProperties({JwtProperties.class, AuthenticationProperties.class})
@Slf4j
public class JwtAutoConfiguration {

    static final SignatureAlgorithm DEFAULT_SIGNATURE_ALGORITHM = SignatureAlgorithm.HS512;
    static final UUID DEFAULT_API_KEY = UUID.randomUUID();
    static final Duration DEFAULT_EXPIRY_DURATION = Duration.ofHours(24L);

    private final JwtProperties properties;

    @Inject
    JwtAutoConfiguration(@NotNull final JwtProperties properties) {
        this.properties = properties;
    }

    @Bean
    @ConditionalOnMissingBean(JwtFilter.class)
    public JwtFilter jwtFilter(@NotNull AuthenticationProperties authenticationProperties) {
        return new JwtFilter(authenticationProperties);
    }

    @Bean
    @ConditionalOnMissingBean(JwtParser.class)
    public JwtParser jwtParser(@NotNull final Key apiKey) {
        return Jwts.parser().setSigningKey(apiKey);
    }

    @Bean
    @ConditionalOnMissingBean(SignatureAlgorithm.class)
    public SignatureAlgorithm signatureAlgorithm() {
        final String value = properties.getSigningAlgorithm();
        if (value == null || value.isEmpty()) {
            log.warn("No signature algorithm was specified; using default: {}", DEFAULT_SIGNATURE_ALGORITHM);
            return DEFAULT_SIGNATURE_ALGORITHM;
        }
        try {
            final SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.forName(value);
            log.info("Using specified signature algorithm: {}", signatureAlgorithm);
            return signatureAlgorithm;
        } catch (SignatureException e) {
            log.warn("{}; using default: {}", e, DEFAULT_SIGNATURE_ALGORITHM);
            return DEFAULT_SIGNATURE_ALGORITHM;
        }
    }

    @Bean
    @ConditionalOnMissingBean(Key.class)
    public Key apiKey(@NotNull final SignatureAlgorithm signatureAlgorithm) {
        final String value = properties.getApiKey();
        if (value == null || value.isEmpty()) {
            log.warn("No api key was specified; using default: {}", DEFAULT_API_KEY);
            return new SecretKeySpec(DEFAULT_API_KEY.toString().getBytes(), signatureAlgorithm.getJcaName());
        }
        log.info("Using specified api key: {}", value);
        return new SecretKeySpec(value.getBytes(), signatureAlgorithm.getJcaName());
    }

    @Bean
    @ConditionalOnMissingBean(Duration.class)
    public Duration expiryDuration() {
        final String value = properties.getExpiryDuration();
        if (value == null || value.isEmpty()) {
            log.warn("No expiry duration was specified; using default: {}", DEFAULT_EXPIRY_DURATION);
            return DEFAULT_EXPIRY_DURATION;
        }
        try {
            final Duration duration = Duration.parse(value);
            log.info("Using specified expiry duration: {}", duration);
            return duration;
        } catch (DateTimeParseException e) {
            log.warn("{}: '{}'; using default: {}", e, value, DEFAULT_EXPIRY_DURATION);
            return DEFAULT_EXPIRY_DURATION;
        }
    }

}


text:
#pragma once
#include <string>
#include "kernel/environment.h"
#include "frontends/lean/token_table.h"
#include "frontends/lean/parse_table.h"
#include "frontends/lean/cmd_table.h"

namespace lean {
struct token_entry {
    std::string m_token;
    unsigned    m_prec;
    token_entry(std::string const & tk, unsigned prec): m_token(tk), m_prec(prec) {}
};
inline token_entry mk_token_entry(std::string const & tk, unsigned prec) { return token_entry(tk, prec); }

enum class notation_entry_kind { NuD, LeD, Numeral };
enum class notation_entry_group { Main, Reserve };
class notation_entry {
    typedef notation::transition transition;
    notation_entry_kind  m_kind;
    union {
        list<transition> m_transitions;
        mpz              m_num;
    };
    expr                 m_expr;
    bool                 m_overload;
    bool                 m_safe_ascii;
    notation_entry_group m_group;
    bool                 m_parse_only;
    unsigned             m_priority;
public:
    notation_entry();
    notation_entry(notation_entry const & e);
    notation_entry(bool is_nud, list<transition> const & ts, expr const & e, bool overload, unsigned priority,
                   notation_entry_group g, bool parse_only);
    notation_entry(mpz const & val, expr const & e, bool overload, bool parse_only);
    notation_entry(notation_entry const & e, bool overload);
    ~notation_entry();
    notation_entry_kind kind() const { return m_kind; }
    bool is_numeral() const { return m_kind == notation_entry_kind::Numeral; }
    bool is_nud() const { return m_kind == notation_entry_kind::NuD; }
    list<transition> const & get_transitions() const { lean_assert(!is_numeral()); return m_transitions; }
    mpz const & get_num() const { lean_assert(is_numeral()); return m_num; }
    expr const & get_expr() const { return m_expr; }
    bool overload() const { return m_overload; }
    bool is_safe_ascii() const { return m_safe_ascii; }
    notation_entry_group group() const { return m_group; }
    bool reserve() const { return group() == notation_entry_group::Reserve; }
    unsigned priority() const { return m_priority; }
    bool parse_only() const { return m_parse_only; }
};
bool operator==(notation_entry const & e1, notation_entry const & e2);
inline bool operator!=(notation_entry const & e1, notation_entry const & e2) {
    return !(e1 == e2);
}

/** \brief Apply \c f to expressions embedded in the notation entry */
notation_entry replace(notation_entry const & e, std::function<expr(expr const &)> const & f);

environment add_token(environment const & env, token_entry const & e, bool persistent = true);
environment add_notation(environment const & env, notation_entry const & e, bool persistent = true);
environment add_token(environment const & env, char const * val, unsigned prec);
token_table const & get_token_table(environment const & env);
parse_table const & get_nud_table(environment const & env);
parse_table const & get_led_table(environment const & env);
parse_table const & get_reserved_nud_table(environment const & env);
parse_table const & get_reserved_led_table(environment const & env);
cmd_table const & get_cmd_table(environment const & env);

/** \brief Add \c n as notation for \c e */
environment add_mpz_notation(environment const & env, mpz const & n, expr const & e, bool overload = true, bool parse_only = false);
/** \brief Return the additional interpretations for \c n in the current environment.

    \remark It does not include the default one based on the \c num inductive datatype.
*/
list<expr> get_mpz_notation(environment const & env, mpz const & n);

/** \brief Return the notation declaration that start with a given head symbol.

    \remark Notation declarations that contain C++ and Lua actions are not indexed.
    Thus, they are to included in the result.
*/
list<notation_entry> get_notation_entries(environment const & env, head_index const & idx);

void initialize_parser_config();
void finalize_parser_config();
}


text:
using System;
using System.Linq.Expressions;

namespace Ditto.Internal
{
    public class Toggler<TDest> : IToggle<TDest>
    {
        private readonly Expression<Func<TDest, object>> property;
        private ISourcedDestinationConfiguration<TDest> cfg;

        public Toggler(ISourcedDestinationConfiguration<TDest> cfg, Expression<Func<TDest, object>> property)
        {
            this.cfg = cfg;
            this.property = property;
        }

        public void By<TTrue, TFalse>()
        {
            cfg.UsingValue<TTrue>(true, property);
            cfg.UsingValue<TFalse>(false, property);
        }
    }
}


text:
module Types.UInt32List where

import Control.Applicative ((<$>))
import Prelude ()
import qualified Data.ProtoBufInt as PB

newtype UInt32List = UInt32List
  { value :: PB.Seq PB.Word32
  } deriving (PB.Show, PB.Eq, PB.Ord)

instance PB.Default UInt32List where
  defaultVal = UInt32List
    { value = PB.defaultVal
    }

instance PB.Mergeable UInt32List where
  merge a b = UInt32List
    { value = PB.merge (value a) (value b)
    }

instance PB.Required UInt32List where
  reqTags _ = PB.fromList []

instance PB.WireMessage UInt32List where
  fieldToValue (PB.WireTag 1 PB.VarInt) self = (\v -> self{value = PB.append (value self) v}) <$> PB.getUInt32
  fieldToValue tag self = PB.getUnknown tag self

  messageToFields self = do
    PB.putUInt32List (PB.WireTag 1 PB.VarInt) (value self)


text:
title: Android KitKat on Nexus 4 with Google Experience Launcher
author: Amarnath
excerpt: "What's in for Nexus 4 with Android KitKat!"
layout: post
permalink: /2013/11/android-kitkat-on-nexus-4-with-google-experience-launcher/
geo_latitude:
  - 12.9140138
geo_longitude:
  - 77.6160255
geo_public:
  - 1
categories:
  - General
---

I received the KitKat update over the air yesterday morning. And this is Google said about the update.

[][1]

[][2]

Just after the update, the first noticeable difference was the Phone app. And the new one is rather annoying.

[][3]

The worst part of it the dialer is not directly accessible. Who gave you this bright idea Google?

[][4]

Another change that strikes you are the color and shape of icons on Notification Bar and Notification Drawer.
[][5]

[][6]

Yet another improvement is the full screen album art on the lock screen.

[][7]

But the best part of all is getting Google Experience Launcher installed. And I really should mention it that the experience is great.
[][8]

[][9]

 [1]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-1385269166191.jpg
 [2]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-Screenshot_2013-11-24-10-23-33.png
 [3]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-PicsArt_1385269631930.jpg
 [4]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-PicsArt_1385269680671.jpg
 [5]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-Screenshot_2013-11-24-10-23-58.png
 [6]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-Screenshot_2013-11-24-10-23-19.png
 [7]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-Screenshot_2013-11-24-10-27-20.png
 [8]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-1385269174696.jpg
 [9]: https://raw.githubusercontent.com/vaamarnath/vaamarnath.github.io/master/content/2013/11/wpid-Screenshot_2013-11-24-10-28-26.png


text:
This is a Python port of the Face Frontalization code provided by Hassner *et al.* at http://www.openu.ac.il/home/hassner/projects/frontalize

The original code was written in Matlab and was ported to Python using Numpy and OpenCV.

![alt tag](https://raw.githubusercontent.com/dougsouza/face-frontalization/master/example.png)

### Dependencies
[Dlib Python Wraper](http://dlib.net) >= 18.17

[OpenCV Python Wraper](http://opencv.org/downloads.html) >= 3.0.0

[SciPy](http://www.scipy.org/install.html)

- Windows x64: I have provided compiled binaries for OpenCV 3.0.0 and Dib 18.18 [here](https://drive.google.com/file/d/0B7pvh2tbCWLLdElLYURTODdZSzg/view?usp=sharing). Just drag the files to your python packages folder (e.g. site-packages). If they don't work, you'll have to compile them yourself.
- Linux/OSX: You'll have to compile OpenCV and Dlib yourself.

### Other Dependencies
To run demo.py you must have:

[Matplotlib](http://matplotlib.org/)

### Citation
If you find this code useful please cite:

Tal Hassner, Shai Harel, Eran Paz and Roee Enbar, *Effective Face Frontalization in Unconstrained Images*, IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), Boston, June 2015


text:
from ubuntui.widgets.input import (
    PasswordEditor,
    SelectorHorizontal,
    StringEditor
)

from base import MockupView
from conjureup.models.provider import BaseProvider, Field
from conjureup.ui.views.base import SchemaFormView

class VSphere(BaseProvider):
    AUTH_TYPE = 'userpass'

    def __init__(self):
        self.endpoint = Field(
            label='api endpoint',
            widget=StringEditor(),
            key='endpoint',
            storable=False
        )
        self.user = Field(
            label='user',
            widget=StringEditor(),
            key='user'
        )
        self.password = Field(
            label='password',
            widget=PasswordEditor(),
            key='password'
        )
        self.external_network = Field(
            label='external network',
            widget=SelectorHorizontal([
                '10.0.0.1/24',
                '172.16.0.1/24']),
            key='external-network',
            storable=False
        )
        self.internal_network = Field(
            label='virtual switch',
            widget=SelectorHorizontal([
                'VMNet1',
                'VMNet1']),
            key='network',
            storable=False
        )
        self.datasource = Field(
            label='datasource',
            widget=SelectorHorizontal([
                'VMStorage1',
                'VMStorage2',
                'VMStorage3']),
            key='datasource',
            storable=False
        )

    def fields(self):
        return [
            self.endpoint,
            self.user,
            self.password,
            self.external_network,
            self.internal_network,
            self.datasource
        ]

class TestView(MockupView, SchemaFormView):
    title = "Credential Creation"
    subtitle = "New Credential Setup"

    def __init__(self, *args, **kwargs):
        self.header = "Enter your VSphere credentials"
        self.schema = VSphere()
        super().__init__(self.schema, None, *args, **kwargs)

if __name__ == '__main__':
    TestView().show()


text:
#ifndef REORDER_PD_HPP
#define REORDER_PD_HPP

#include <assert.h>
#include "mkldnn.h"

#include "c_types_map.hpp"
#include "memory_pd.hpp"
#include "nstl.hpp"
#include "primitive_attr.hpp"
#include "type_helpers.hpp"
#include "utils.hpp"

namespace mkldnn {
namespace impl {

struct reorder_pd_t: public primitive_desc_t {
    reorder_pd_t(engine_t *engine, const primitive_attr_t *attr)
        : primitive_desc_t(engine, attr, primitive_kind::reorder) {}
    virtual ~reorder_pd_t() {}

    virtual const op_desc_t *op_desc() const override { return nullptr; }
    virtual void init_info() override { init_info_mem(this, this->info_); }

    virtual int n_inputs() const override { return 1; }
    virtual int n_outputs() const override { return 1; }

    float alpha() const { return attr()->output_scales_.scales_[0]; }
    float beta() const {
        int sum_idx = attr()->post_ops_.find(primitive_kind::sum);
        if (sum_idx == -1) {
            return 0.0;
        } else {
            return attr()->post_ops_.entry_[sum_idx].sum.scale;
        }
    }
};

}
}

#endif

// vim: et ts=4 sw=4 cindent cino^=l0,\:0,N-s


text:
package org.eclipse.php.internal.core.typeinference.goals;

import org.eclipse.dltk.ast.ASTNode;
import org.eclipse.dltk.ast.expressions.Expression;
import org.eclipse.dltk.ti.IContext;
import org.eclipse.dltk.ti.goals.AbstractGoal;

public class ForeachStatementGoal extends AbstractGoal {

	private Expression expression;

	public ForeachStatementGoal(IContext context, Expression expression) {
		super(context);
		this.expression = expression;
	}

	public ASTNode getExpression() {
		return expression;
	}

	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((expression == null) ? 0 : expression.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		ForeachStatementGoal other = (ForeachStatementGoal) obj;
		if (expression == null) {
			if (other.expression != null)
				return false;
		} else if (!expression.equals(other.expression))
			return false;
		return true;
	}
}


text:
<component name="libraryTable">
  <library name="gradle-wrapper83">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/Lesson06-Visualizer-Preferences/T06.02-Exercise-MakeAPreferenceFragment/gradle/wrapper/gradle-wrapper.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
cat /proc/sys/vm/swappiness

Network & Hacking Series
- netstat

netstat -pawnt 2>/dev/null | grep 3001 | awk '{ print $7 }'

Parse SDK: The Lost Bits (unofficial)
- Diverging between Cloud Code
- Syntax, WTF?
- Swagger API Wrapper
- Login flow
- Browserify

Write about JADE template strategies
	- https://github.com/jossmac/jade-field-mixins

# Competeing platforms
	https://www.google.com/trends/explore#q=%2Fm%2F02p97%2C%20%2Fm%2F06ff5%2C%20%2Fm%2F09gbxjr%2C%20%2Fm%2F060kv%2C%20%2Fm%2F0chpd&date=1%2F2013%2027m&cmpt=q&tz=
US Trend:
<script type="text/javascript" src="//www.google.com/trends/embed.js?hl=en-US&q=/m/02p97,+/m/06ff5,+/m/09gbxjr,+/m/060kv,+/m/0chpd&geo=US&date=9/2011+43m&cmpt=q&tz&tz&content=1&cid=TIMESERIES_GRAPH_0&export=5&w=500&h=330"></script>

Code Rot Article

Gulp Grunt Organization Ideas

Learn SmallTalk!

#### OMFG, angular-hint
	npm install angular-hint

Ask module authors to automatically measure deps size including
	- un/minified
	- un/gziped

Bootstrap resources"
	- http://www.bootply.com/tagged/flexbox

3 Critical Grunt Practices
	IMPLEMENT SUPPORT FOR:
	SEE: http://dontkry.com/posts/code/grunt-tricks.html#configuring-tasks-dynamically
	rename: function(dest, src) {
		var path = require('path');

		// Get the name of the component folder (or first folder in src path)
		var component = src.split(path.sep).slice(0, 1)[0];

		// Prefix each javascript file with the
		// component folder name into the destination
		return path.join(dest, component + '_' + path.basename(src));
	}

#### The Real Cost Of IE7 and IE8


text:
'use strict'
const CronJob = require('cron').CronJob
const reminder = require('./config.js').reminder
const S = require('./clients.js').web

function init () {
  reminder.map(item => new CronJob(item.cron_time, () => S.chat.postMessage(item.channel, item.comment, { as_user: true }), null, true, 'America/New_York'))
}

exports.init = init


text:
/* global AFRAME */
AFRAME.registerComponent('hoverable', {
  init: function () {
    this.HOVERED_STATE = 'hovered'
    this.HOVER_EVENT = 'hover-start'
    this.UNHOVER_EVENT = 'hover-end'

    this.hoverers = []

    this.start = this.start.bind(this)
    this.end = this.end.bind(this)

    this.el.addEventListener(this.HOVER_EVENT, this.start)
    this.el.addEventListener(this.UNHOVER_EVENT, this.end)
  },
  remove: function () {
    this.el.removeEventListener(this.HOVER_EVENT, this.start)
    this.el.removeEventListener(this.UNHOVER_EVENT, this.end)
  },
  start: function (evt) {
    if (evt.defaultPrevented) { return }
    this.el.addState(this.HOVERED_STATE)
    if (this.hoverers.indexOf(evt.detail.hand) === -1) {
      this.hoverers.push(evt.detail.hand)
    }
    if (evt.preventDefault) { evt.preventDefault() }
  },
  end: function (evt) {
    if (evt.defaultPrevented) { return }
    const handIndex = this.hoverers.indexOf(evt.detail.hand)
    if (handIndex !== -1) {
      this.hoverers.splice(handIndex, 1)
    }
    if (this.hoverers.length < 1) {
      this.el.removeState(this.HOVERED_STATE)
    }
  }
})


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

namespace Model
{
    /// <summary>
    /// Google analystic account
    /// </summary>
    public class GAAccount : Base
    {
        /// <summary>
        /// GA view's id
        /// </summary>
        public string ViewID { get; set; } = "";

        /// <summary>
        /// GA view's name
        /// </summary>
        public string ViewName { get; set; } = "";

        /// <summary>
        /// GA property's id
        /// </summary>
        public string PropertyID { get; set; } = "";

        /// <summary>
        /// GA property's name
        /// </summary>
        public string PropertyName { get; set; } = "";

        /// <summary>
        /// GA account's id
        /// </summary>
        public string AccountID { get; set; } = "";

        /// <summary>
        /// GA account's name
        /// </summary>
        public string AccountName { get; set; } = "";

        /// <summary>
        /// GA table's id
        /// </summary>
        public string TableID { get; set; } = "";

        /// <summary>
        /// API key
        /// </summary>
        public string APIKey { get; set; } = "";

        /// <summary>
        /// Client id
        /// </summary>
        public string ClientID { get; set; } = "";

        /// <summary>
        /// Secrect key
        /// </summary>
        public string SecrectKey { get; set; } = "";

    }
}


text:
<?php

namespace War\BlogBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use War\BlogBundle\Entity\Blog;

class BlogFixtures extends AbstractFixture implements OrderedFixtureInterface
{
public function load(ObjectManager $manager)
{
$blog1 = new Blog();
$blog1->setTitle('A day with Symfony2');
$blog1->setBlog('Lorem ipsum dolor sit amet, consectetur adipiscing eletra electrify denim vel ports.\nLorem ipsum dolor sit amet, consectetur adipiscing elit.');
$blog1->setImage('beach.jpg');
$blog1->setAuthor('dsyph3r');
$blog1->setTags('symfony2, php, paradise, warblog');
$blog1->setCreated(new \DateTime());
$blog1->setUpdated($blog1->getCreated());
$manager->persist($blog1);

$blog2 = new Blog();
$blog2->setTitle('The pool on the roof must have a leak');
$blog2->setBlog('Vestibulum vulputate mauris eget erat congue dapibus imperdiet justo scelerisque. Na. Cras elementum molestie vestibulum. Morbi id quam nisl. ');
$blog2->setImage('pool_leak.jpg');
$blog2->setAuthor('Zero Cool');
$blog2->setTags('pool, leaky, hacked, movie, hacking, warblog');
$blog2->setCreated(new \DateTime("2011-07-23 06:12:33"));
$blog2->setUpdated($blog2->getCreated());
$manager->persist($blog2);

$blog3 = new Blog();
$blog3->setTitle('Misdirection. What the eyes see and the ears hear the mind believes');
$blog3->setBlog('Lorem ipsumvehicula nunc non leo hendrerit commodo. Vestibulum vulputate mauris eget erat congue dapibus imperdiet justo scelerisque.');
$blog3->setImage('misdirection.jpg');
$blog3->setAuthor('Gabriel');
$blog3->setTags('misdirection, magic, movie, hacking, warblog');
$blog3->setCreated(new \DateTime("2011-07-16 16:14:06"));
$blog3->setUpdated($blog3->getCreated());
$manager->persist($blog3);

$blog4 = new Blog();
$blog4->setTitle('The grid - A digital frontier');
$blog4->setBlog('Lorem commodo. Vestibulum vulputate mauris eget erat congue dapibus imperdiet justo scelerisque. Nulla consectetur tempus nisl vitae viverra.');
$blog4->setImage('the_grid.jpg');
$blog4->setAuthor('Kevin Flynn');
$blog4->setTags('grid, daftpunk, movie, warblog');
$blog4->setCreated(new \DateTime("2011-06-02 18:54:12"));
$blog4->setUpdated($blog4->getCreated());
$manager->persist($blog4);

$blog5 = new Blog();
$blog5->setTitle('You\'re either a one or a zero. Alive or dead');
$blog5->setBlog('Lorem ipsum dolor sit amet, consectetur adipiscing elittibulum vulputate mauris eget erat congue dapibus imperdiet justo scelerisque.');
$blog5->setImage('one_or_zero.jpg');
$blog5->setAuthor('Gary Winston');
$blog5->setTags('binary, one, zero, alive, dead !trusting, movie, warblog');
$blog5->setCreated(new \DateTime("2011-04-25 15:34:18"));
$blog5->setUpdated($blog5->getCreated());
$manager->persist($blog5);

$manager->flush();

$this->addReference('blog-1', $blog1);
$this->addReference('blog-2', $blog2);
$this->addReference('blog-3', $blog3);
$this->addReference('blog-4', $blog4);
$this->addReference('blog-5', $blog5);
}

public function getOrder()
{
return 1;
}
}


text:
var pg    = require('pg');
var async = require('async');

process.env.DATABASE_URL = process.env.DATABASE_URL || "tcp://localhost:5432/ovh-availability"

exports.up = function( next ) {

    pg.connect(process.env.DATABASE_URL, function( dbErr, client, done ) {
        async.series([

            function( callback ) {
                client.query("CREATE TYPE public.zones AS ENUM ('europe','canada','all')", function( err, result ) {
                    callback();
                });
            },

            function( callback ) {
                client.query('ALTER TABLE requests ADD COLUMN zone public.zones', function( err, result ) {
                    callback();
                });
            },

            function( callback ) {
                client.query('ALTER TABLE requests ALTER COLUMN zone SET NOT NULL', function( err, result ) {
                    callback();
                });
            }

        ], function( err, results ) {

            if( ! err ) next();

        });
    });

};

exports.down = function( next ) {

    pg.connect(process.env.DATABASE_URL, function( dbErr, client, done ) {

        async.series([

            function( callback ) {
                client.query('ALTER TABLE requests DROP COLUMN zone', function( err, result ) {
                    callback();
                });
            },

            function( callback ) {
                client.query("DROP TYPE zones", function( err, result ) {
                    callback();
                });
            }

        ], function( err, results ) {

            if( ! err ) next();

        });

    });

};


text:
Tables

              Type
              Column heading
              Column heading
              Column heading

              Active
              Column content
              Column content
              Column content

              Default
              Column content
              Column content
              Column content

              Primary
              Column content
              Column content
              Column content

              Secondary
              Column content
              Column content
              Column content

              Success
              Column content
              Column content
              Column content

              Danger
              Column content
              Column content
              Column content

              Warning
              Column content
              Column content
              Column content

              Info
              Column content
              Column content
              Column content

              Light
              Column content
              Column content
              Column content

              Dark
              Column content
              Column content
              Column content


text:
module.exports = function firstChildShim (element) {
  if (!element) {
    return null
  }

  if (element.hasOwnProperty('firstChild')) {
    return element
  }

  function firstChild () {
    return element && element.childNodes && element.childNodes[0] || null
  }

  Object.defineProperty(
    element,
    'firstChild',
    {
      get: firstChild
    }
  )

  return element
}


text:
<?php

namespace Crm\MainBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class GeoStatistic extends BaseEntity
{
    /**
     * @ORM\Column(type="string", nullable=true)
     */
    protected $region;

    /**
     * @ORM\Column(type="string", nullable=true)
     */
    protected $city;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    protected $count = 0;

    /**
     * @return mixed
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * @param mixed $region
     */
    public function setRegion($region)
    {
        $this->region = $region;
    }

    /**
     * @return mixed
     */
    public function getCity()
    {
        return $this->city;
    }

    /**
     * @param mixed $city
     */
    public function setCity($city)
    {
        $this->city = $city;
    }

    /**
     * @return mixed
     */
    public function getCount()
    {
        return $this->count;
    }

    /**
     * @param mixed $count
     */
    public function setCount($count = 0)
    {
        $this->count = $count;
    }

}


text:
package org.jetbrains.plugins.scala.codeInspection.types

import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.testFramework.EditorTestUtil
import org.jetbrains.plugins.scala.codeInspection.typeLambdaSimplify.AppliedTypeLambdaCanBeSimplifiedInspection
import org.jetbrains.plugins.scala.codeInspection.{InspectionBundle, ScalaQuickFixTestBase}
import org.jetbrains.plugins.scala.project.settings.ScalaCompilerConfiguration

/**
 * Author: Svyatoslav Ilinskiy
 * Date: 7/6/15
 */
class AppliedTypeLambdaCanBeSimplifiedTest extends ScalaQuickFixTestBase {

  import EditorTestUtil.{SELECTION_END_TAG => END, SELECTION_START_TAG => START}

  override protected val classOfInspection: Class[_ <: LocalInspectionTool] = classOf[AppliedTypeLambdaCanBeSimplifiedInspection]

  override protected val description: String = InspectionBundle.message("applied.type.lambda.can.be.simplified")

  private val hint: String = InspectionBundle.message("simplify.type")

  private def testFix(text: String, res: String): Unit = testQuickFix(text, res, hint)

  override protected def setUp(): Unit = {
    super.setUp()

    val defaultProfile = ScalaCompilerConfiguration.instanceIn(getProject).defaultProfile
    val newSettings = defaultProfile.getSettings
    newSettings.plugins :+= "kind-projector" //only some of the tests require kind-projector
    defaultProfile.setSettings(newSettings)
  }

  def testSimple(): Unit = {
    val text = s"def a: $START({type l[a] = Either[String, a]})#l[Int]$END)"
    checkTextHasError(text)
    val code = "def a: ({type l[a] = Either[String, a]})#l[Int]"
    val res = "def a: Either[String, Int]"
    testFix(code, res)
  }

  def testKindProjectorFunctionSyntax(): Unit = {
    val text = s"def a: ${START}Lambda[A => (A, A)][Int]$END"
    checkTextHasError(text)
    val code = "def a: Lambda[A => (A, A)][Int]"
    val res = "def a: (Int, Int)"
    testFix(code, res)
  }

  def testKindProjectorInlineSyntax(): Unit = {
    val text = s"def a: ${START}Either[+?, -?][String, Int]$END"
    checkTextHasError(text)
    val code = "def a: Either[+?, -?][String, Int]"
    val res = "def a: Either[String, Int]"
    testFix(code, res)
  }
}


text:
function init(){

    var base_hotosm = L.tileLayer(
        'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',{
        attribution: '© OpenStreetMap contributors, Humanitarian OpenStreetMap Team'}
    );

    var base_osm = L.tileLayer(
            'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
            attribution: '© OpenStreetMap contributors'}
    );

    var pamPath = L.geoJson(pam_path,{
        pointToLayer: function (feature, latlng) {
            return L.circleMarker(latlng);
        },
        style: pamPathStyle,
        onEachFeature: function (feature, layer) {
            layer.bindPopup(""+feature.properties.time+" - "+feature.properties.datelabel+"

Windspeed: "+feature.properties.windspeed+" mph"+"
Category: "+feature.properties.stormtype);
        }
    });

    var vanPop = L.geoJson(van_pop,{
        style: vanPopStyle,
        onEachFeature: function (feature, layer) {
            layer.bindPopup("2010 Enumeration Area: "+feature.properties.Enumeratio+"
Population Density (Per sq. km): "+feature.properties.PopDensity);
        }
    });

    var map = L.map('map', {
        center: [-17.7500,168.3000],
        zoom: 6,
        layers: [base_hotosm, pamPath]
    });

    L.control.layers({
        'HOT OSM':base_hotosm,
        'OSM':base_osm
    }, {
        'Cyclone Pam Path':pamPath,
        'Population Density 2010':vanPop
    }).addTo(map);

    var pamPathLegend = L.control({position: 'bottomleft'});

    pamPathLegend.onAdd = function (map) {
        var div = L.DomUtil.create('div', 'infolegend');
            div.innerHTML +=pamPathLegendContent();
        return div;
    };

    var vanPopLegend = L.control({position: 'bottomleft'});

    vanPopLegend.onAdd = function (map) {
        var div = L.DomUtil.create('div', 'infolegend');
            div.innerHTML +=vanPopLegendContent();
        return div;
    };

    map.on('overlayadd', function (eventLayer) {
        if(eventLayer.name=="Cyclone Pam Path"){
            pamPathLegend.addTo(this);
        };
        if(eventLayer.name=="Population Density 2010"){
            vanPopLegend.addTo(this);
        };
    });

    map.on('overlayremove', function (eventLayer) {
        if(eventLayer.name=="Cyclone Pam Path"){
            this.removeControl(pamPathLegend);
        };
        if(eventLayer.name=="Population Density 2010"){
            this.removeControl(vanPopLegend);
        };
    });

    pamPathLegend.addTo(map);

    return map;
}

function resize(){
    $('#map').height($(window).height()-$('#header').height()-10);
    map.invalidateSize(false);
}

$(window).load(function(){
    resize();
});
$(window).resize(function(){
    resize();
});

var map = init();


text:
#include "tensorflow/core/common_runtime/scoped_allocator.h"

#include "tensorflow/core/common_runtime/scoped_allocator_mgr.h"
#include "tensorflow/core/platform/dynamic_annotations.h"

namespace tensorflow {

ScopedAllocator::ScopedAllocator(const Tensor& backing_tensor, int32_t scope_id,
                                 const string& name,
                                 const gtl::ArraySlice<Field> fields,
                                 int32_t expected_call_count,
                                 ScopedAllocatorContainer* container)
    : backing_tensor_(backing_tensor),
      tbuf_(backing_tensor_.buf_),
      id_(scope_id),
      name_(name),
      container_(container),
      fields_(fields.begin(), fields.end()),
      expected_call_count_(expected_call_count),
      live_alloc_count_(0) {
  // Hold this until all aliases have been deallocated.
  tbuf_->Ref();
  // Hold this until all expected_calls have been made.
  container->Ref();
  CHECK_GE(tbuf_->size(), fields.back().offset + fields.back().bytes_requested);
}

ScopedAllocator::~ScopedAllocator() {
  mutex_lock l(mu_);
  VLOG(1) << "~ScopedAllocator " << this << " tbuf_ " << tbuf_ << " data "
          << static_cast<void*>(tbuf_->data());
  // In the absence of incomplete graph execution situations
  // (interruption by error status or control flow branch crossing
  // ScopedAllocation region) we expect expected_call_count_ == 0 at
  // exit.
  if (VLOG_IS_ON(1)) {
    if (expected_call_count_ > 0)
      VLOG(1) << "expected_call_count_ = " << expected_call_count_
              << " at deallocation";
  }
  if (tbuf_) tbuf_->Unref();
}

void* ScopedAllocator::AllocateRaw(int32_t field_index, size_t num_bytes) {
  VLOG(1) << "ScopedAllocator index " << id_ << " AllocateRaw "
          << "field " << field_index << " num_bytes " << num_bytes;
  void* ptr = nullptr;
  const Field* field = nullptr;
  {
    mutex_lock l(mu_);
    if (expected_call_count_ <= 0) {
      LOG(ERROR) << "Scoped allocator " << name_
                 << " could not satisfy request for " << num_bytes
                 << " bytes, expected uses exhausted. ";
      return nullptr;
    }

    int32_t num_fields = static_cast<int32>(fields_.size());
    if (field_index >= num_fields) {
      LOG(ERROR) << "ScopedAllocator " << name_
                 << " received unexpected field number " << field_index;
      return nullptr;
    }

    field = &fields_[field_index];
    if (num_bytes != field->bytes_requested) {
      LOG(ERROR) << "ScopedAllocator " << name_ << " got request for "
                 << num_bytes << " bytes from field " << field_index
                 << " which has precalculated size " << field->bytes_requested
                 << " and offset " << field->offset;
      return nullptr;
    }

    ptr = static_cast<void*>((tbuf_->template base<char>() + field->offset));

    ++live_alloc_count_;
    --expected_call_count_;
    if (0 == expected_call_count_) {
      for (auto& f : fields_) {
        container_->Drop(f.scope_id, this);
      }
      container_->Drop(id_, this);
      container_->Unref();
      container_ = nullptr;
    }
  }
  VLOG(2) << "AllocateRaw returning " << ptr << " bytes_requested "
          << field->bytes_requested << " bytes_allocated "
          << field->bytes_allocated;

  // If there is overshoot due to alignment, let MSAN believe that the padding
  // is initialized.  This is okay because we do not use this memory region for
  // anything meaningful.
  if (field->bytes_allocated > field->bytes_requested) {
    size_t extra_bytes = field->bytes_allocated - field->bytes_requested;
    void* extra_buf = static_cast<void*>(static_cast<char*>(ptr) +
                                         field->bytes_allocated - extra_bytes);
    VLOG(2) << "AllocateRaw requested " << num_bytes
            << " bytes which is not divisible by kAllocatorAlignment="
            << Allocator::kAllocatorAlignment << " and hence we allocated "
            << field->bytes_allocated << ". Annotating " << extra_bytes
            << " bytes starting at " << extra_buf
            << " with TF_ANNOTATE_MEMORY_IS_INITIALIZED";
    TF_ANNOTATE_MEMORY_IS_INITIALIZED(extra_buf, extra_bytes);
  }

  return ptr;
}

void ScopedAllocator::DeallocateRaw(void* p) {
  CHECK(VerifyPointer(p));

  bool dead = false;
  {
    mutex_lock l(mu_);
    CHECK_GT(live_alloc_count_, 0);
    if (0 == --live_alloc_count_) {
      if (0 == expected_call_count_) {
        dead = true;
      }
    }
  }
  if (dead) {
    delete this;
  }
}

bool ScopedAllocator::VerifyPointer(const void* p) {
  void* base = tbuf_->data();
  CHECK_GE(p, base);
  for (auto& f : fields_) {
    void* f_ptr = static_cast<void*>(static_cast<char*>(base) + f.offset);
    if (f_ptr == p) {
      return true;
      break;
    }
  }
  VLOG(1) << "ScopedAllocator index " << id_ << " VerifyPointer for p=" << p
          << " failed.";
  return false;
}

bool ScopedAllocator::VerifyTensor(const Tensor* t) {
  return VerifyPointer(t->buf_->data());
}

ScopedAllocatorInstance::ScopedAllocatorInstance(ScopedAllocator* sa,
                                                 int32_t field_index)
    : scoped_allocator_(sa),
      field_index_(field_index),
      allocated_(false),
      deallocated_(false),
      in_table_(true) {
  VLOG(1) << "new ScopedAllocatorInstance " << this << " on SA " << sa
          << " field_index " << field_index;
}

void ScopedAllocatorInstance::DropFromTable() {
  bool del = false;
  {
    mutex_lock l(mu_);
    CHECK(in_table_);
    in_table_ = false;
    VLOG(2) << "ScopedAllocatorInstance::DropFromTable " << this
            << " allocated_ " << allocated_ << " deallocated_ " << deallocated_
            << " in_table_ " << in_table_;
    // Single use is complete when it is allocated and deallocated.
    // This check prevents a race between Allocating the tensor slice and
    // Dropping it from the parent container's table.
    if (allocated_ && deallocated_) {
      del = true;
    }
  }
  if (del) delete this;
}

void* ScopedAllocatorInstance::AllocateRaw(size_t alignment, size_t num_bytes) {
  void* ptr = scoped_allocator_->AllocateRaw(field_index_, num_bytes);
  {
    mutex_lock l(mu_);
    if (nullptr == ptr) {
      VLOG(2) << "ScopedAllocatorInstance::AllocateRaw " << this
              << " call to underlying ScopedAllocator unsuccessful,"
              << " allocated_ " << allocated_ << " deallocated_ "
              << deallocated_ << " in_table_ " << in_table_
              << " returning nullptr.";
    } else {
      allocated_ = true;
      VLOG(2) << "ScopedAllocatorInstance::AllocateRaw " << this
              << " allocated_ " << allocated_ << " deallocated_ "
              << deallocated_ << " in_table_ " << in_table_
              << " returning ptr = " << ptr;
    }
  }
  return ptr;
}

void ScopedAllocatorInstance::DeallocateRaw(void* p) {
  scoped_allocator_->DeallocateRaw(p);
  bool del = false;
  {
    mutex_lock l(mu_);
    CHECK(allocated_);
    deallocated_ = true;
    VLOG(2) << "ScopedAllocatorInstance::DeallocateRaw " << this
            << " allocated_ " << allocated_ << " deallocated_ " << deallocated_
            << " in_table_ " << in_table_;
    // Single use is now complete, but only delete this instance when it is
    // no longer in a ScopedAllocatorContainer's table.
    if (!in_table_) {
      del = true;
    }
  }
  if (del) delete this;
}

string ScopedAllocatorInstance::Name() {
  return strings::StrCat(scoped_allocator_->name(), "_field_", field_index_);
}

}  // namespace tensorflow


text:
- have a cross review of Payment's Code.Reach out to Cris and today I plan to continue to reviewing the code
- And if you get feedback from ivans about new two issue?
---
## 工作记录
* IVANS premium
	* Problem Description
		* IVANS的totalcost标签的值和PC UI的不一样
	* Action List
		* 看一下Enhancement,Gautham check一下
			* Expectation
			* Result
			* Reach out people
	- Summary
- 了解Payment的requirement和具体实现
	- Question
		- What is batch total in host.file
---
## 工作总结
- Keep
- Problem
- Try


text:
/* jQuery Resizable Columns v0.1.0 | http://dobtco.github.io/jquery-resizable-columns/ | Licensed MIT | Built Thu Mar 12 2015 15:14:55 */
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
  __slice = [].slice;

(function($, window) {
  var ResizableColumns, parseWidth, pointerX, setWidth;
  parseWidth = function(node) {
    return parseFloat(node.style.width.replace('%', ''));
  };
  setWidth = function(node, width) {
    width = width.toFixed(2);
    width = width > 0 ? width : 0;
    return node.style.width = "" + width + "%";
  };
  pointerX = function(e) {
    if (e.type.indexOf('touch') === 0) {
      return (e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]).pageX;
    }
    return e.pageX;
  };
  ResizableColumns = (function() {
    ResizableColumns.prototype.defaults = {
      selector: 'tr th:visible',
      store: window.store,
      syncHandlers: true,
      resizeFromBody: true,
      maxWidth: null,
      minWidth: null
    };

    function ResizableColumns($table, options) {
      this.pointerdown = __bind(this.pointerdown, this);
      this.constrainWidth = __bind(this.constrainWidth, this);
      this.options = $.extend({}, this.defaults, options);
      this.$table = $table;
      this.setHeaders();
      this.restoreColumnWidths();
      this.syncHandleWidths();
      $(window).on('resize.rc', ((function(_this) {
        return function() {
          return _this.syncHandleWidths();
        };
      })(this)));
      if (this.options.start) {
        this.$table.bind('column:resize:start.rc', this.options.start);
      }
      if (this.options.resize) {
        this.$table.bind('column:resize.rc', this.options.resize);
      }
      if (this.options.stop) {
        this.$table.bind('column:resize:stop.rc', this.options.stop);
      }
    }

    ResizableColumns.prototype.triggerEvent = function(type, args, original) {
      var event;
      event = $.Event(type);
      event.originalEvent = $.extend({}, original);
      return this.$table.trigger(event, [this].concat(args || []));
    };

    ResizableColumns.prototype.getColumnId = function($el) {
      return this.$table.data('resizable-columns-id') + '-' + $el.data('resizable-column-id');
    };

    ResizableColumns.prototype.setHeaders = function() {
      this.$tableHeaders = this.$table.find(this.options.selector);
      this.assignPercentageWidths();
      return this.createHandles();
    };

    ResizableColumns.prototype.destroy = function() {
      var $table;
      $(this.$table.attr('ownerDocument')).off('.rc');
      this.$handleContainer.find('.rc-handle').each((function(_this) {
        return function(_, el) {
          var $handle;
          $handle = $(el);
          $handle.removeData('th');
          return $handle.off('mousedown touchstart');
        };
      })(this));
      this.$handleContainer.remove();
      this.$handleContainer = null;
      this.$table.removeData('resizableColumns');
      this.$table.add(window).off('.rc');
      this.$tableHeaders = null;
      $table = this.$table;
      this.$table = null;
      return $table;
    };

    ResizableColumns.prototype.assignPercentageWidths = function() {
      return this.$tableHeaders.each((function(_this) {
        return function(_, el) {
          var $el;
          $el = $(el);
          return setWidth($el[0], $el.outerWidth() / _this.$table.width() * 100);
        };
      })(this));
    };

    ResizableColumns.prototype.createHandles = function() {
      var _ref;
      if ((_ref = this.$handleContainer) != null) {
        _ref.remove();
      }
      this.$table.before((this.$handleContainer = $("
")));
      this.$tableHeaders.each((function(_this) {
        return function(i, el) {
          var $handle;
          if (_this.$tableHeaders.eq(i + 1).length === 0 || (_this.$tableHeaders.eq(i).attr('data-noresize') != null) || (_this.$tableHeaders.eq(i + 1).attr('data-noresize') != null)) {
            return;
          }
          $handle = $("
");
          $handle.data('th', $(el));
          return $handle.appendTo(_this.$handleContainer);
        };
      })(this));
      return this.$handleContainer.on('mousedown touchstart', '.rc-handle', this.pointerdown);
    };

    ResizableColumns.prototype.syncHandleWidths = function() {
      return this.$handleContainer.width(this.$table.width()).find('.rc-handle').each((function(_this) {
        return function(_, el) {
          var $el;
          $el = $(el);
          return $el.css({
            left: $el.data('th').outerWidth() + ($el.data('th').offset().left - _this.$handleContainer.offset().left),
            height: _this.options.resizeFromBody ? _this.$table.height() : _this.$table.find('thead').height()
          });
        };
      })(this));
    };

    ResizableColumns.prototype.saveColumnWidths = function() {
      return this.$tableHeaders.each((function(_this) {
        return function(_, el) {
          var $el;
          $el = $(el);
          if ($el.attr('data-noresize') == null) {
            if (_this.options.store != null) {
              return _this.options.store.set(_this.getColumnId($el), parseWidth($el[0]));
            }
          }
        };
      })(this));
    };

    ResizableColumns.prototype.restoreColumnWidths = function() {
      return this.$tableHeaders.each((function(_this) {
        return function(_, el) {
          var $el, width;
          $el = $(el);
          if ((_this.options.store != null) && (width = _this.options.store.get(_this.getColumnId($el)))) {
            return setWidth($el[0], width);
          }
        };
      })(this));
    };

    ResizableColumns.prototype.totalColumnWidths = function() {
      var total;
      total = 0;
      this.$tableHeaders.each((function(_this) {
        return function(_, el) {
          return total += parseFloat($(el)[0].style.width.replace('%', ''));
        };
      })(this));
      return total;
    };

    ResizableColumns.prototype.constrainWidth = function(width) {
      if (this.options.minWidth != null) {
        width = Math.max(this.options.minWidth, width);
      }
      if (this.options.maxWidth != null) {
        width = Math.min(this.options.maxWidth, width);
      }
      return width;
    };

    ResizableColumns.prototype.pointerdown = function(e) {
      var $currentGrip, $leftColumn, $ownerDocument, $rightColumn, newWidths, startPosition, widths;
      e.preventDefault();
      $ownerDocument = $(e.currentTarget.ownerDocument);
      startPosition = pointerX(e);
      $currentGrip = $(e.currentTarget);
      $leftColumn = $currentGrip.data('th');
      $rightColumn = this.$tableHeaders.eq(this.$tableHeaders.index($leftColumn) + 1);
      widths = {
        left: parseWidth($leftColumn[0]),
        right: parseWidth($rightColumn[0])
      };
      newWidths = {
        left: widths.left,
        right: widths.right
      };
      this.$handleContainer.add(this.$table).addClass('rc-table-resizing');
      $leftColumn.add($rightColumn).add($currentGrip).addClass('rc-column-resizing');
      this.triggerEvent('column:resize:start', [$leftColumn, $rightColumn, newWidths.left, newWidths.right], e);
      $ownerDocument.on('mousemove.rc touchmove.rc', (function(_this) {
        return function(e) {
          var difference;
          difference = (pointerX(e) - startPosition) / _this.$table.width() * 100;
          setWidth($leftColumn[0], newWidths.left = _this.constrainWidth(widths.left + difference));
          setWidth($rightColumn[0], newWidths.right = _this.constrainWidth(widths.right - difference));
          if (_this.options.syncHandlers != null) {
            _this.syncHandleWidths();
          }
          return _this.triggerEvent('column:resize', [$leftColumn, $rightColumn, newWidths.left, newWidths.right], e);
        };
      })(this));
      return $ownerDocument.one('mouseup.rc touchend.rc', (function(_this) {
        return function() {
          $ownerDocument.off('mousemove.rc touchmove.rc');
          _this.$handleContainer.add(_this.$table).removeClass('rc-table-resizing');
          $leftColumn.add($rightColumn).add($currentGrip).removeClass('rc-column-resizing');
          _this.syncHandleWidths();
          _this.saveColumnWidths();
          return _this.triggerEvent('column:resize:stop', [$leftColumn, $rightColumn, newWidths.left, newWidths.right], e);
        };
      })(this));
    };

    return ResizableColumns;

  })();
  return $.fn.extend({
    resizableColumns: function() {
      var args, option;
      option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
      return this.each(function() {
        var $table, data;
        $table = $(this);
        data = $table.data('resizableColumns');
        if (!data) {
          $table.data('resizableColumns', (data = new ResizableColumns($table, option)));
        }
        if (typeof option === 'string') {
          return data[option].apply(data, args);
        }
      });
    }
  });
})(window.jQuery, window);