text:
` .clearfix:after {
  content: ".";
  display: block;
  height: 0;
  clear: both;
  visibility: hidden; }

.clearfix {
  display: inline-table;
  min-height: 1%; }
  .clearfix:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden; }

* html .clearfix {
  height: 1%; }

.clearfix {
  display: block; }

body {
  background: #fff url(/images/bg_body.gif) center top repeat-y;
  font: 12px/18px Arial, Helvetica, sans-serif;
  color: #333; }

a {
  text-decoration: underline;
  color: #149ACC;
  cursor: pointer; }
  a:hover {
    text-decoration: underline; }

h2 {
  padding: 2px 2px 2px 2px;
  font-size: 14px;
  color: #333; }

#container {
  width: 982px;
  margin: 0 auto;
  border-right: 1px solid #E6E7E8;
  border-left: 1px solid #E6E7E8; }

.hide, hr {
  display: none; }

#ajax-indicator {
  position: absolute;
  top: 185px;
  left: 95%;
  float: right;
  z-index: 105;
  color: green;
  font-weight: bold;
  font-size: 125%; }

.divider {
  border-top: 3px solid #ccc;
  margin-top: 5px;
  margin-bottom: 7px; }

.smalltext {
  color: #959595;
  font-size: 11px; }

#message_area {
  color: green;
  font-weight: bold; }

#header {
  position: relative;
  height: 90px;
  padding-top: 21px;
  z-index: 999;
  background: url(/images/bg_header.gif) left top repeat-x; }
  #header h1 {
    float: left; }
    #header h1 a {
      position: relative;
      display: block;
      overflow: hidden;
      width: 158px;
      height: 90px; }
      #header h1 a span {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: url(/images/eol_logo_header.png) left top no-repeat; }
  #header #personal-space {
    padding: 8px 0 0 10px;
    width: 310px;
    float: left; }
    #header #personal-space .desc-personal {
      float: left;
      width: 541px;
      padding: 7px 0 0 12px; }
      #header #personal-space .desc-personal p {
        font-size: 10px;
        color: #999; }
        #header #personal-space .desc-personal p strong {
          font-size: 14px;
          color: #000; }

ul#global-navigation {
  position: absolute;
  right: 18px;
  top: 0;
  border-left: 1px dotted #fff;
  font: 9px/18px Verdana, Arial, Helvetica, sans-serif;
  text-align: left;
  z-index: 50; }
  ul#global-navigation li {
    position: relative;
    float: left;
    border-right: 1px dotted #fff;
    border-left: 1px dotted #93B52B; }
    ul#global-navigation li.last {
      border-right: none; }
    ul#global-navigation li a {
      display: block;
      overflow: hidden;
      padding-left: 10px;
      padding-top: 1px;
      width: 106px;
      height: 20px;
      text-transform: uppercase;
      color: #000;
      text-decoration: none; }
      ul#global-navigation li a.dropdown {
        padding-right: 14px;
        background: url(/images/m_gn_dropdown.gif) right top no-repeat; }
  ul#global-navigation ul li a.dropdown:active {
    padding-right: 14px;
    background: #fff url(/images/m_gn_dropdown_hover.gif) right top no-repeat;
    color: #000; }
  ul#global-navigation li ul {
    position: absolute;
    width: 168px;
    left: -1px;
    top: 21px;
    display: none;
    background-color: #fff;
    border: 1px solid #ccc;
    border-top: none;
    z-index: 9000;
    display: none; }
  ul#global-navigation li:hover ul {
    display: block; }
  ul#global-navigation li ul li {
    position: relative;
    float: none;
    border: none;
    border-bottom: 1px dotted #DCDDDE;
    height: 19px;
    z-index: 9000; }
    ul#global-navigation li ul li a {
      width: 168px;
      height: 21px;
      display: block;
      text-transform: capitalize; }
  ul#global-navigation li ul.uppercase li a {
    text-transform: uppercase; }
  ul#global-navigation li ul li a:hover {
    background: url(/images/bg_gn_dropdown.gif) left top no-repeat;
    width: 158px; }
  ul#global-navigation li ul li a em {
    position: absolute;
    left: 115px; }

#header #quick-search {
  float: left;
  padding: 10px 10px 5px;
  width: 234px;
  height: 76px;
  z-index: 0;
  position: relative;
  font: 9px/15px Verdana, Arial, Helvetica, sans-serif; }
  #header #quick-search .search_box {
    height: 30px; }
  #header #quick-search .search_options {
    font-size: 12px; }
  #header #quick-search fieldset {
    padding: 5px 0 0; }
    #header #quick-search fieldset input.left {
      float: left; }

#left-pane {
  float: left;
  padding-right: 10px;
  padding-bottom: 20px;
  width: 200px;
  height: 100%;
  clear: both; }
  #left-pane legend {
    color: #246f8a;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 70%;
    margin: 0 0 0 5px;
    padding: 2px;
    background-color: #FFF;
    letter-spacing: 1px; }

#right-pane {
  margin-left: 245px; }

#left-pane fieldset {
  margin-top: 10px;
  color: #666666;
  border: 1px solid #CCC; }

#right-pane h3 {
  font-size: 16px;
  margin-bottom: 5px; }

#advanced_search_message {
  font-size: 14px; }

#page-title {
  position: relative;
  padding-top: 8px;
  border-bottom: 1px solid #E5E5E5; }
  #page-title p {
    padding: 0 0 15px 20px; }

* html #page-title {
  background-position: left 10px; }

#page-separator-general {
  border-top: 6px solid #959595; }

.page-separator {
  height: 18px;
  background-image: url(/images/bg_page_title-white.gif);
  background-repeat: repeat-x; }

#page-separator-animalia {
  border-top: 10px solid #C01C3E;
  background-color: #C01C3E; }

#page-separator-archaea {
  border-top: 10px solid #B9D22C;
  background-color: #B9D22C; }

#page-separator-bacteria {
  border-top: 10px solid #5FC4E7;
  background-color: #5FC4E7; }

#page-separator-chromista {
  border-top: 10px solid #FFA626;
  background-color: #FFA626; }

#page-separator-fungi {
  border-top: 10px solid #666666;
  background-color: #666666; }

#page-separator-plantae {
  border-top: 10px solid #4D8139;
  background-color: #4D8139; }

#page-separator-protozoa {
  border-top: 10px solid #0585a0;
  background-color: #0585a0; }

#page-separator-viruses {
  border-top: 10px solid #FD619E;
  background-color: #FD619E; }

.page-mode {
  float: right;
  text-transform: uppercase;
  font-weight: 700;
  text-align: right;
  height: 85px;
  font-size: 10px;
  color: #666666;
  margin-right: 10px;
  margin-top: 5px; }

.popup {
  z-index: 105;
  font-size: 12px;
  color: #333;
  width: 375px;
  text-align: left;
  border: 2px solid #6a8d00 !important;
  padding: 6px;
  background-color: #E6E7E8; }

.close-button {
  float: right; }

#page-title h1 {
  padding: 0 0 10px 20px;
  font-size: 32px;
  line-height: 32px;
  font-weight: 700;
  color: #333; }
#page-title h2 {
  padding: 0 0 15px 20px;
  font-size: 15px;
  color: #333; }

* html #page-title ul {
  top: 47px; }

#page-title ul li {
  float: left;
  margin-left: 5px; }
  #page-title ul li a {
    position: relative;
    overflow: hidden;
    display: block;
    padding-top: 4px;
    width: 50px;
    height: 11px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font: 8px/8px Verdana, Arial, Helvetica, sans-serif; }
    #page-title ul li a#link-bookmark {
      width: 70px;
      margin-top: 21px; }
    #page-title ul li a span {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: #fff;
      background-position: center top; }

#post-info {
  border-top: 1px solid #E5E5E5;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 10px; }
  #post-info .iucn-status {
    float: left;
    padding-left: 20px;
    width: 471px;
    text-align: left;
    color: #333; }
  #post-info .iucn-status-value {
    font-weight: 400;
    color: #f63; }
    #post-info .iucn-status-value a {
      font-weight: 400;
      color: #f63;
      text-decoration: none; }
  #post-info .page-status {
    float: right;
    padding-right: 20px;
    width: 471px;
    text-align: right;
    color: #666;
    text-decoration: none; }

#page-cite {
  font-size: 12px;
  color: #333;
  width: 190px;
  text-align: left;
  border: 1px solid #333;
  padding: 20px;
  background: #E6E7E8;
  position: absolute;
  left: -90px;
  top: 0px;
  z-index: 110; }

#page-curator {
  margin: 0px; }
  #page-curator h2 {
    border-bottom: 1px solid #E6E7E8;
    font-size: 15px;
    padding: 20px 0 4px 20px;
    text-transform: uppercase;
    width: 220px; }
  #page-curator .curator_name {
    padding: 0 0 0 30px; }

#page-citation {
  border-top: 3px solid #ccc;
  margin-bottom: 7px;
  padding-top: 5px;
  color: #959595;
  text-align: center; }

#number-of-curators {
  font-size: 10px;
  padding-left: 5px;
  text-align: left;
  width: 200px; }

#page-media-center {
  position: relative;
  width: 982px;
  height: 435px;
  background: url(/images/bg_media_center.gif) left top repeat-x;
  z-index: 1000; }

div#media-videos {
  position: relative;
  z-index: 1000; }
  div#media-videos div.attribution_link {
    position: absolute;
    top: 369px;
    left: 19px; }

#media-maps {
  background-color: #f4f4f4;
  position: relative;
  z-index: 1000; }

#left-mc {
  float: left;
  width: 701px;
  height: 420px; }

ul#tab_media_center {
  padding: 10px 0 0 15px;
  width: 687px;
  height: 29px; }
  ul#tab_media_center li {
    margin-right: 5px;
    float: left;
    height: 29px; }
    ul#tab_media_center li a {
      float: left;
      height: 29px; }
    ul#tab_media_center li#image, ul#tab_media_center li#sounds, ul#tab_media_center li#maps, ul#tab_media_center li#videos, ul#tab_media_center li#image a, ul#tab_media_center li#sounds a, ul#tab_media_center li#maps a, ul#tab_media_center li#videos a {
      width: 80px; }
    ul#tab_media_center li#taxa-comments {
      width: 80px; }
      ul#tab_media_center li#taxa-comments a {
        width: 80px; }
    ul#tab_media_center li a {
      position: relative;
      display: block;
      overflow: hidden; }
      ul#tab_media_center li a:hover {
        background-color: #fff; }
      ul#tab_media_center li a span {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: #fff; }
    ul#tab_media_center li#image a span {
      background: url(/images/mc_nav_images.gif) left top no-repeat; }
    ul#tab_media_center li#sounds a span {
      background: url(/images/mc_nav_sounds.gif) left top no-repeat; }
    ul#tab_media_center li#maps a span {
      background: url(/images/mc_nav_maps.gif) left top no-repeat; }
    ul#tab_media_center li#videos a span {
      background: url(/images/mc_nav_videos.gif) left top no-repeat; }
    ul#tab_media_center li#taxa-comments a span {
      background: url(/images/mc_nav_comments.gif) left top no-repeat; }
    ul#tab_media_center li#image a:hover span, ul#tab_media_center li#sounds a:hover span, ul#tab_media_center li#maps a:hover span, ul#tab_media_center li#videos a:hover span, ul#tab_media_center li#taxa-comments a:hover span {
      background-position: left -30px; }
    ul#tab_media_center li#image a.active span, ul#tab_media_center li#sounds a.active span, ul#tab_media_center li#maps a.active span, ul#tab_media_center li#videos a.active span, ul#tab_media_center li#taxa-comments a.active span {
      background-position: left -60px; }

#left-mc .wrapper-mc {
  position: relative;
  width: 702px;
  height: 410px; }
  #left-mc .wrapper-mc #large-image {
    float: left;
    width: 460px;
    padding: 11px 5px 14px 10px; }
  #left-mc .wrapper-mc .mc-info {
    float: right;
    width: 223px; }
    #left-mc .wrapper-mc .mc-info .noimages {
      margin: 20px; }
    #left-mc .wrapper-mc .mc-info .mc-header {
      position: relative;
      margin: 4px 0 0 7px;
      padding: 3px 0 3px 0;
      width: 207px;
      border-top: 2px solid #ccc;
      border-bottom: 1px solid #ccc; }
      #left-mc .wrapper-mc .mc-info .mc-header h3 {
        text-transform: uppercase;
        font-size: 15px;
        color: #666; }
      #left-mc .wrapper-mc .mc-info .mc-header a {
        position: absolute;
        overflow: hidden;
        right: 0;
        top: 8px;
        width: 70px;
        height: 15px;
        text-transform: uppercase;
        text-align: center;
        font: 8px/14px Verdana, Arial, Helvetica, sans-serif;
        background: #ccc; }
        #left-mc .wrapper-mc .mc-info .mc-header a span {
          position: absolute;
          left: 0;
          top: 0;
          width: 100%;
          height: 100%;
          background: #99CC00 url(/images/bg_contribute.gif) center top no-repeat; }
    #left-mc .wrapper-mc .mc-info select {
      margin: 7px 0 7px 7px;
      width: 207px; }
#left-mc .wrapper-mc .mc-img {
  height: 175px;
  text-align: center; }
  #left-mc .wrapper-mc .mc-img a {
    float: left;
    display: block;
    padding: 2px 2px 2px 0px;
    margin: 2px 0 0 2px;
    width: 68px;
    height: 48px;
    background-color: #f4f4f4; }
    #left-mc .wrapper-mc .mc-img a.selected, #left-mc .wrapper-mc .mc-img a:hover {
      background: url(/images/bg_thumbs.gif) left top no-repeat; }
    #left-mc .wrapper-mc .mc-img a img {
      padding: 0;
      margin: 0; }
    #left-mc .wrapper-mc .mc-img a ul {
      position: relative;
      top: -53px;
      left: -20px; }
  #left-mc .wrapper-mc .mc-img div#thumbnails a span {
    display: block;
    margin-left: 4px;
    width: 60px;
    height: 48px;
    text-align: left; }

.mc-navigation {
  margin: 1px 0 0 5px;
  width: 210px;
  height: 21px;
  border-bottom: 1px solid #ccc;
  background: #fff url(/images/bg_mc_navigation.gif) center top no-repeat; }
  .mc-navigation.no-pagination {
    background: none; }
  .mc-navigation span {
    height: 16px;
    display: block;
    font: 9px/16px Verdana, Arial, Helvetica, sans-serif;
    text-transform: uppercase; }
  .mc-navigation a {
    text-decoration: none;
    color: #666; }
  .mc-navigation span a {
    text-decoration: none;
    color: #666; }
    .mc-navigation span a:hover {
      text-decoration: none;
      color: #333; }
    .mc-navigation span a.active {
      color: #139ACC; }
  .mc-navigation span#back {
    float: left;
    padding-left: 15px;
    width: 50px;
    text-align: left;
    background: url(/images/arrow_left.gif) 7px 5px no-repeat; }
  .mc-navigation span#noback {
    float: left;
    padding-left: 15px;
    width: 50px;
    text-align: left; }
  .mc-navigation span#pages {
    float: left;
    width: 70px;
    text-align: center;
    letter-spacing: 1px;
    font-size: 9px;
    display: inline; }
  .mc-navigation span#next {
    float: left;
    padding-right: 15px;
    width: 55px;
    text-align: right;
    background: url(/images/arrow_right.gif) 60px 5px no-repeat; }

.mc-info .mc-notes {
  position: relative;
  overflow: auto;
  margin: 0px 0 0 9px;
  padding: 0 4px;
  width: 200px;
  height: 110px;
  background-color: #f4f4f4; }

#unknown-text-warning-box {
  margin-bottom: 1em;
  border: 1px solid #FFCC00;
  border-left: 10px solid #FFCC00;
  padding: 7px;
  background-color: #FFFF99;
  margin-bottom: 1em; }

#untrusted-text-warning-box {
  margin-bottom: 1em;
  border: 1px solid #FF0000;
  border-left: 10px solid #FF0000;
  padding: 7px;
  background-color: #FF9999;
  margin-bottom: 1em; }

#unknown-thumbnail-warning-box {
  padding: 2px;
  border: 1px solid #FFCC00;
  border-left: 6px solid #FFCC00;
  text-align: left;
  background-color: #FFFF99;
  margin: 2px 0 2px 6px;
  width: 190px;
  top: 38px;
  left: 486px; }

#untrusted-thumbnail-warning-box {
  padding: 2px;
  border: 1px solid #FF0000;
  border-left: 6px solid #FF0000;
  text-align: left;
  background-color: #FF9999;
  margin: 2px 0 2px 6px;
  width: 190px;
  top: 38px;
  left: 486px; }

#untrusted-video-warning-box {
  padding: 2px;
  border: 1px solid #FF0000;
  border-left: 6px solid #FF0000;
  padding-left: 5px;
  text-align: left;
  background-color: #FF9999;
  margin: 2px 0 2px 6px;
  width: 190px;
  top: 38px;
  left: 486px; }

#unknown-video-warning-box {
  padding: 2px;
  border: 1px solid #FFCC00;
  border-left: 6px solid #FFCC00;
  text-align: left;
  background-color: #FFFF99;
  margin: 2px 0 2px 6px;
  width: 190px;
  top: 38px;
  left: 486px;
  margin-left: 6px; }

.untrusted-background-text {
  border-top: 1px solid #FF0000;
  border-bottom: medium none;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: #FF9999 !important;
  margin-bottom: 2em; }

.unknown-background-text {
  border-top: 1px solid rgb(255, 204, 0);
  border-bottom: medium none;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: #FFFF99 !important;
  margin-bottom: 2em; }

.unvetted-title-names {
  border-top: 1px solid rgb(255, 204, 0);
  border-bottom: medium none;
  background-color: #FFFF99 !important;
  border-left: 6px solid #FFCC00;
  padding: 2px 2px 2px 2px; }

.untrusted-background-image {
  border: 1px solid #FF0000;
  background-color: #FF9999 !important; }

.trusted-background-image {
  border: 1px solid #FFFFFF; }

.unknown-background-image {
  border: 1px solid #FFCC00;
  background-color: #FFFF99 !important; }

.unvetted-background-color, .unknown-background-color {
  background-color: #FFFF99 !important; }

.untrusted-background-color {
  background-color: #FF9999 !important; }

#unvetted-page-warning-box {
  border-style: solid;
  border: 1px solid #FC0;
  border-left: 10px solid #FFCC00;
  padding: 7px;
  position: absolute;
  top: 10px;
  left: 690px;
  width: 250px;
  background-color: #FFFF99; }

.message-box {
  font-weight: bold;
  line-height: 1.2em;
  font-size: 12px; }

.mc-notes span em {
  font-style: italic; }
.mc-notes h4 {
  text-transform: uppercase;
  font-size: 14px;
  line-height: 28px;
  color: #999;
  border-bottom: 3px solid #ccc; }
.mc-notes span {
  position: absolute;
  color: black;
  line-height: 100%;
  margin: 1px;
  text-align: left;
  font-size: 10px;
  text-transform: none; }
.mc-notes p {
  font-size: 10px;
  line-height: 24px;
  color: #333;
  border-bottom: 1px solid #ccc; }
.mc-notes a.image-attribution-larger {
  font-size: 12px;
  line-height: 14px;
  padding-top: 2px; }

#notes-attribution-area {
  font-size: 10px;
  line-height: 13px; }

.mc-video-notes {
  position: relative;
  overflow: auto;
  margin: 7px 0 0 9px;
  padding: 0 10px;
  width: 186px;
  height: 178px;
  background-color: #f4f4f4; }
  .mc-video-notes h4 {
    text-transform: uppercase;
    font-size: 14px;
    line-height: 28px;
    color: #999;
    border-bottom: 3px solid #ccc; }
  .mc-video-notes span {
    position: absolute;
    color: black;
    line-height: 100%;
    margin: 5px;
    text-align: left;
    font-size: 10px;
    text-transform: none; }
  .mc-video-notes p {
    font-size: 10px;
    line-height: 24px;
    color: #333;
    border-bottom: 1px solid #ccc; }

div.attribution .credit {
  width: 100%;
  text-align: left; }
  div.attribution .credit .footer {
    width: 100%;
    border-bottom: 1px solid #E6E7E8;
    clear: both;
    overflow: hidden;
    height: 1px; }

.credit-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 9px;
  color: #999;
  margin-left: 3px; }

.credit-caption {
  width: 77px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 9px;
  color: #999;
  margin-left: 3px;
  float: left;
  text-align: right; }

.credit-value {
  text-align: left;
  font-size: 10px;
  float: left;
  width: 200px;
  padding-left: 5px; }
  .credit-value a {
    width: auto !important; }

td.credit-text {
  text-align: left;
  font-size: 10px;
  line-height: 16px;
  margin-left: 5px; }

.credit-close {
  position: absolute;
  display: block;
  left: 25px;
  bottom: 20px;
  padding-top: 47px;
  width: 25px;
  height: 25px;
  z-index: 200; }

.expand-text-attribution {
  float: right;
  position: relative;
  top: -26px; }

#video-player {
  float: left;
  width: 460px;
  padding: 11px 6px 14px 13px;
  background-color: #f4f4f4;
  height: 344px; }

#video-collection {
  margin-left: 6px;
  border-bottom: 1px solid #ddd;
  height: 134px;
  width: 205px;
  overflow: auto; }
  #video-collection ul {
    list-style: disc;
    list-style-position: inside; }

#sliding-close {
  position: absolute;
  top: 0;
  right: 0;
  background: #fff;
  z-index: 100;
  padding: 5px;
  border-left: 1px solid #e6e7e9;
  border-bottom: 1px solid #e6e7e9;
  width: 269px; }

#browser-flash {
  background-color: #c7e2ff;
  width: 270px;
  height: 390px;
  margin-left: 0px auto;
  margin-top: 10px auto;
  margin-right: 0px auto;
  margin-bottom: 0px;
  border: 0px;
  padding: 0px; }

#classification-attribution {
  z-index: 105;
  float: left;
  font-size: 12px;
  color: #333;
  width: 230px;
  text-align: left;
  border: 2px solid #6a8d00 !important;
  padding: 6px;
  background-color: #E6E7E8;
  margin-right: 20px;
  position: absolute;
  left: 20px;
  top: 32px; }

#sliding-open {
  position: absolute;
  top: 0;
  right: 0;
  width: 982px;
  height: 408px;
  z-index: 200; }

#place-holder {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 300; }

ul#tab_taxonomic_browser {
  padding: 5px 0 0 15px;
  width: 687px;
  height: 19px; }
  ul#tab_taxonomic_browser li {
    margin-right: 5px;
    float: left;
    height: 19px;
    text-decoration: none; }
    ul#tab_taxonomic_browser li a {
      float: left;
      height: 19px;
      text-decoration: none; }

#taxonomic-text-container {
  width: 269px;
  height: 390px;
  border: 0px;
  margin-left: 10px auto;
  margin-top: 10px auto;
  margin-right: 10px auto;
  margin-bottom: 0px;
  padding: 0px;
  background: url(/images/bg.gif) top;
  font-size: 12px;
  overflow: auto; }

.nopages {
  color: #959595; }

#taxonomic-top-link {
  position: relative;
  text-align: right; }

#browser-text a.nopages {
  color: #959595; }
#browser-text a.secondary {
  color: #FF6666; }

#taxonomictext {
  font-size: 100%;
  font-weight: bold;
  margin-left: 0px; }
  #taxonomictext li ul {
    font-weight: normal;
    padding: 0;
    margin-left: 5px;
    list-style: none; }

#taxonomictext-upone {
  padding-left: 10px;
  background-image: url(/images/jump_up.gif);
  background-repeat: no-repeat;
  background-position: 0 .5em;
  list-style: none; }

#taxonomictext a {
  font-weight: normal;
  font-family: arial, helvetica, sans-serif;
  padding-bottom: 0;
  color: #31a7d2;
  text-decoration: none;
  border-bottom: 1px solid #dbd5c5; }
  #taxonomictext a.expand {
    text-decoration: none;
    border-bottom: 0px;
    font-size: larger; }
#taxonomictext li.lastone {
  font-family: arial, helvetica, sans-serif;
  font-weight: 700;
  color: #000;
  text-decoration: none;
  border: 0; }
#taxonomictext li.kingdom {
  font-family: arial, helvetica, sans-serif;
  font-weight: 700;
  text-decoration: none;
  border: 0; }

li.current_kingdom {
  font-family: arial, helvetica, sans-serif;
  font-weight: 700;
  text-decoration: none;
  border: 0; }

#taxonomictext li.kingdom {
  color: #bbb; }

#main-image {
  border: 0px solid #ddd;
  vertical-align: middle;
  position: relative; }

#main-image-bg {
  background-color: #f4f4f4;
  width: 460px;
  height: 358px;
  line-height: 345px;
  text-align: center;
  overflow: auto;
  background-image: url(/images/eol_logo_gray.gif);
  background-position: center;
  background-repeat: no-repeat; }

#main-image-table {
  cellspacing: 0px;
  cellpadding: 0px;
  border: 0px;
  width: 100%;
  height: 100%; }
  #main-image-table tr {
    valign: middle; }
  #main-image-table td {
    align: center; }

#container > #content {
  background: #ffffff;
  min-height: 600px;
  height: auto !important;
  height: 600px; }

#content #page-content {
  width: 982px;
  border-top: 5px solid #E6E7E8;
  padding-bottom: 10px; }
#content #page-content-bgfauxinside {
  background-image: url(/images/faux_columns_no_rt.gif); }
#content #page-content-bgfaux {
  background: #FFF url(/images/page_content_bgfaux.gif) center top repeat-y;
  clear: both; }
#content #page-content form {
  margin-top: 10px;
  padding: 0;
  overflow: hidden; }
#content #page-content fieldset {
  background-color: #FFF;
  padding: 10px; }
#content #page-content legend {
  font-weight: bold;
  font-size: 14px; }

.preference-header {
  padding-bottom: 1.5em !important; }

#content #page-content label {
  display: block;
  font-weight: bold; }
#content #page-content input {
  font-size: 12px; }
#content #page-content .button {
  font-size: 14px; }
  #content #page-content .button input {
    margin-top: 15px;
    font-size: 16px; }
#content #page-content #full-page-content h1 {
  padding: 2px 0 2px 0;
  font-size: 18px;
  font-weight: 700;
  color: #333; }
#content #page-content #center-page-content h2, #content #page-content #full-page-content h2 {
  padding: 2px 0 2px 0;
  font-size: 16px;
  font-weight: 700;
  color: #333; }

#home-content-wrap h2 {
  padding: 2px 0 2px 0;
  font-size: 16px;
  font-weight: 700;
  color: #333; }

#content #page-content #center-page-content h3, #content #page-content #full-page-content h3 {
  padding: 2px 0 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: #333; }

#home-content-wrap h3 {
  padding: 2px 0 2px 0;
  font-size: 14px;
  font-weight: 700;
  color: #333; }

#content #page-content #center-page-content sup a {
  text-decoration: none; }
#content #page-content #center-page-content ul {
  list-style: square;
  padding-left: 4px;
  border: 0px; }
#content #page-content #full-page-content ul {
  list-style: square;
  padding-left: 4px;
  border: 0px; }

#home-content-wrap ul {
  list-style: square;
  padding-left: 4px;
  border: 0px; }

#content #page-content #center-page-content ol, #content #page-content #full-page-content ol {
  list-style: decimal;
  list-style-position: inside;
  padding-left: 4px;
  border: 0px; }

#home-content-wrap ol {
  list-style: decimal;
  list-style-position: inside;
  padding-left: 4px;
  border: 0px; }

#content #page-content #center-page-content li, #content #page-content #full-page-content li {
  padding: 0px; }

#home-content-wrap li {
  padding: 0px; }

#content #page-content #full-page-content {
  padding: 20px;
  min-height: 300px; }
  #content #page-content #full-page-content #inside-columns {
    width: 982px;
    border-top: 1px solid #E6E7E8; }
  #content #page-content #full-page-content strong {
    font-weight: bold; }

#home-content-wrap strong {
  font-weight: bold; }

#content #page-content #full-page-content em, #home-content-wrap em {
  font-style: italic; }

#content #page-content .cpc-content em {
  font-style: italic; }
#content #page-content #center-page-content p {
  padding: 8px 0; }

#home-content-wrap p {
  padding: 8px 0; }

#content #page-content #center-page-content strong {
  font-weight: bold; }

#center-page-content-loading {
  position: absolute;
  left: 530px;
  margin-top: 150px;
  z-index: 100; }

.classification-attribution-name {
  margin-left: 20px;
  font: 10px Arial, Helvetica, sans-serif;
  color: grey; }

.collection_icon {
  max-width: 50px;
  max-height: 50px;
  width: expression(this.width > 50 ? "50px" : true);
  height: expression(this.height > 50 ? "50px" : true); }

#content #page-content #left-page-content {
  float: left;
  width: 240px; }

h4.margin-header {
  background-color: #F6F7F8;
  border-bottom: 1px solid #E6E7E8;
  color: #303030;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 15px;
  padding: 12px 0 12px 0;
  text-align: center;
  text-transform: uppercase;
  border-top: 1px solid #E6E7E8; }
h4.left-margin-header {
  width: 240px;
  border-right: 5px solid #E6E7E8; }
h4.right-margin-header {
  width: 246px;
  margin-left: -1px; }

ul.content_partner {
  list-style: none !important;
  margin-left: -25px !important;
  padding-left: -25px !important; }
ul#toc li {
  width: 240px;
  border-bottom: 1px solid #E6E7E8; }
  ul#toc li ul {
    display: inline-block;
    padding-top: 2px; }
    ul#toc li ul li {
      width: 211px; }
      ul#toc li ul li.status_icon {
        width: 22px;
        height: 22px; }
  ul#toc li a.toc_item {
    width: 200px;
    display: block;
    padding-left: 36px;
    line-height: 21px;
    color: #959595;
    text-decoration: none;
    background: url(/images/toc.gif) 20px 1px no-repeat; }
  ul#toc li a.nested {
    margin-left: 10px; }

.add_text_button {
  background: url(/images/icons/dual-states/add-text.png) 0px 0px no-repeat;
  width: 20px;
  height: 22px;
  float: right;
  padding-right: 7px; }
  .add_text_button:hover {
    background: url(/images/icons/dual-states/add-text.png) 0px -32px no-repeat; }

ul#toc li.add_text {
  height: 24px;
  padding-left: 22px;
  padding-top: 2px;
  width: 220px; }

span.no_toc_link {
  width: 200px;
  display: block;
  padding-left: 36px;
  line-height: 21px;
  color: #959595;
  font-weight: 700;
  text-decoration: none; }

ul#toc li a.toc_item:hover, ul#toc li a.toc_item.active {
  text-decoration: none;
  color: #666;
  background: url(/images/toc_hover.gif) 20px 1px no-repeat; }
ul#toc li.li-sub a {
  width: 190px;
  display: block;
  padding-left: 50px;
  line-height: 21px;
  color: #959595;
  text-decoration: none; }
  ul#toc li.li-sub a:hover {
    text-decoration: none;
    color: #666; }

li.li-sub a.active {
  text-decoration: none;
  color: #666; }

#content #page-content #center-page-content {
  position: relative;
  padding-left: 20px;
  padding-right: 10px;
  float: left;
  width: 447px; }
  #content #page-content #center-page-content #wrapper-cpc {
    padding-bottom: 30px; }
  #content #page-content #center-page-content .cpc-header {
    margin-bottom: 12px;
    padding-bottom: 11px; }
    #content #page-content #center-page-content .cpc-header .add_text_button {
      margin-top: 10px; }
    #content #page-content #center-page-content .cpc-header a.contribute {
      position: absolute;
      top: 13px;
      right: 20px;
      width: 70px;
      overflow: hidden;
      height: 15px;
      text-align: center; }
    #content #page-content #center-page-content .cpc-header h3 {
      padding: 13px 0 3px 0;
      text-transform: uppercase;
      font-size: 24px;
      line-height: 26px;
      font-weight: 700;
      color: #333;
      border-bottom: 2px solid #ccc; }
    #content #page-content #center-page-content .cpc-header p {
      width: 447px; }
      #content #page-content #center-page-content .cpc-header p span {
        padding: 0 7px;
        text-transform: uppercase;
        font-weight: 700;
        font-size: 11px;
        color: #666;
        border-right: 1px solid #999; }

.source a {
  font-weight: 700; }

#content #page-content #center-page-content .cpc-content p {
  padding-bottom: 0px; }

.text-area-header {
  font-weight: 600;
  color: #999;
  text-transform: uppercase; }

.attribution-header {
  border-bottom: 1px solid #ccc;
  height: 23px; }

.content-attribution-area {
  margin-top: 2px;
  padding-top: 2px;
  padding-bottom: 4px; }

.references ul {
  list-style-type: none !important;
  padding-left: 2em  !important; }

.references-header {
  border-bottom: 1px solid #ccc;
  height: 23px;
  margin-bottom: 4pt;
  margin-top: 2em; }

a.footnote {
  text-decoration: none; }

#content #page-content #right-page-content {
  float: right;
  width: 245px;
  padding-left: 1px;
  background-color: #FFF; }
  #content #page-content #right-page-content #internal-nav {
    padding: 0;
    border-bottom: solid #E6E7E8 1px; }
  #content #page-content #right-page-content #contribute {
    padding: 16px 0 15px 0;
    background: #F6F6F7 url(/images/bg_contributetoeol.gif) left top no-repeat; }
    #content #page-content #right-page-content #contribute h4 {
      width: 224px;
      padding-left: 21px;
      text-transform: uppercase;
      font-size: 15px;
      color: #333; }
    #content #page-content #right-page-content #contribute ol {
      list-style-type: decimal;
      list-style-position: inside;
      padding: 9px 0 11px 0; }
      #content #page-content #right-page-content #contribute ol li {
        padding-left: 21px;
        line-height: 21px;
        font-size: 14px;
        font-weight: 500;
        color: #ccc;
        border-bottom: 1px solid #E6E7E8; }
        #content #page-content #right-page-content #contribute ol li.last {
          border-bottom: none; }
        #content #page-content #right-page-content #contribute ol li a {
          text-decoration: none;
          font-size: 10px;
          color: #999; }

* html #content #page-content #right-page-content #contribute ol li a {
  padding-left: 8px; }

#content #page-content #right-page-content #contribute ol li a:hover {
  text-decoration: underline; }
#content #page-content #right-page-content #contribute ol li a strong {
  font-style: italic;
  font-size: 12px;
  color: #666; }
#content #page-content #right-page-content #contribute p {
  padding-left: 21px;
  padding-bottom: 0px;
  font-size: 11px;
  color: #fff; }
#content #page-content #right-page-content #internal-nav #related dt {
  margin: 0;
  padding: 0; }
  #content #page-content #right-page-content #internal-nav #related dt img {
    float: left;
    display: block;
    margin: 2px 10px 0 4px;
    padding: 1px;
    border: 3px solid #E6E7E8; }
#content #page-content #right-page-content #internal-nav #related dd {
  margin: 10px 0 45px 0 !important;
  padding: 0; }

#related-species-table {
  width: 240px;
  padding: 0;
  margin: 0;
  font-size: 13px; }
  #related-species-table img {
    padding: 1px;
    border: solid 4px #e6e7e9; }
  #related-species-table td {
    padding: 5px 6px 5px 3px;
    color: #666666; }
    #related-species-table td.alt {
      color: #666666; }

.results_table {
  padding: 0;
  margin: 0; }
  .results_table th {
    font: bold 11px Arial, Helvetica, sans-serif;
    color: #246f8a;
    border-right: 1px solid #e6e7e9;
    border-bottom: 1px solid #e6e7e9;
    border-top: 1px solid #e6e7e9;
    border-left: 1px solid #e6e7e9;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: left;
    padding: 6px 6px 6px 12px;
    background: #9cdef6; }
    .results_table th.nobg {
      border-top: 0;
      border-left: 0;
      border-right: 1px solid #C1DAD7;
      background: none; }
  .results_table td.odd {
    border-right: 1px solid #e6e7e9;
    border-bottom: 1px solid #e6e7e9;
    border-left: 1px solid #e6e7e9;
    background: #fff;
    padding: 6px 6px 6px 12px;
    color: #666666; }
  .results_table td.even {
    border-right: 1px solid #e6e7e9;
    border-bottom: 1px solid #e6e7e9;
    border-left: 1px solid #e6e7e9;
    background: #F5FAFA;
    padding: 6px 6px 6px 12px;
    color: #666666; }
  .results_table td.odd_unvetted {
    border-right: 1px solid #e6e7e9;
    border-bottom: 1px solid #e6e7e9;
    border-left: 1px solid #e6e7e9;
    background: #FFFFCC;
    padding: 6px 6px 6px 12px;
    color: #666666; }
  .results_table td.even_unvetted {
    border-right: 1px solid #e6e7e9;
    border-bottom: 1px solid #e6e7e9;
    border-left: 1px solid #e6e7e9;
    background: #FFFFAA;
    padding: 6px 6px 6px 12px;
    color: #666666; }

#footer {
  width: 962px;
  padding: 15px 0 5px 20px;
  background-color: #ccc;
  color: #666;
  text-transform: uppercase;
  font-size: 11px;
  line-height: 13px; }

#errorExplanation {
  padding: 10px;
  border: 2px solid #C20404;
  background-color: #F7E9E9; }
  #errorExplanation h2 {
    color: #C20404;
    font-weight: bold;
    font-size: 16px;
    padding: 5px 0; }
  #errorExplanation p {
    color: #000; }
  #errorExplanation ul {
    list-style: disc;
    color: #C20404; }
    #errorExplanation ul li {
      margin-left: 30px;
      padding: 0px; }

ul.errors {
  list-style: none;
  padding: 0 0 5px 15px; }
  ul.errors li {
    color: red; }

span.error {
  color: #B00000;
  font-size: 1.0em;
  line-height: 1em; }
span.warn {
  display: none;
  color: #B00000;
  font-size: 0.8em;
  line-height: 1em; }

fieldset.invalid {
  border-color: #B00000; }

label.invalid {
  color: #B00000; }
label span {
  font-size: 1.5em;
  color: #B00000; }
label.invalid span.warn {
  display: inline;
  color: #B00000;
  font-style: italic; }

input.invalid {
  border-color: #B00000;
  background: #FFF3F3 url(/images/stop.png) no-repeat 98% 50%; }

textarea.invalid {
  border-color: #B00000;
  background: #FFF3F3 url(/images/stop.png) no-repeat 100% 0; }

fieldset.warn {
  border-color: #555; }

label.warn {
  color: #B00000; }
  label.warn span.warn {
    display: inline;
    color: #B00000;
    font-style: italic; }

input.warn, textarea.warn {
  border-color: #aaa;
  background-image: none; }

#progress-open {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 100%;
  background: #000000;
  opacity: .50; }

#progress-bar {
  z-index: 10001;
  text-align: center;
  position: absolute;
  top: 35%;
  left: 0px;
  width: 100%;
  height: 1px;
  overflow: visible;
  visibility: visible;
  display: block; }

#flash-good {
  background: #D4ECB8;
  border: 2px solid #38BD17;
  padding: 7px 10px;
  margin-bottom: 1em;
  margin: 0px 20px 10px 20px;
  color: #38BD17;
  position: absolute;
  left: 50%;
  width: 250px;
  top: -35px;
  margin-left: -125px;
  visibility: visible;
  font-size: 14px; }

#flash-warning, #flash-error {
  padding: 7px 10px;
  margin-bottom: 1em;
  margin: 0px 20px 10px 20px;
  background: #FF6966;
  border: 2px solid #FF4A47;
  color: #fff;
  position: absolute;
  left: 50%;
  width: 250px;
  top: -35px;
  margin-left: -125px;
  visibility: visible;
  font-size: 14px; }

.pop-up-panel {
  background: #D4ECB8;
  border: 2px solid #38BD17;
  padding: 7px 10px;
  margin-bottom: 1em;
  margin: 0px 20px 10px 20px;
  color: black;
  position: absolute;
  left: 50%;
  width: 250px;
  top: -35px;
  margin-left: -125px;
  visibility: visible;
  text-align: left;
  font-size: 14px; }

.photo_slider {
  position: relative;
  width: 946px;
  margin: 0 auto 5px auto;
  background: #ffffff; }

#photos_area_slider {
  overflow: hidden;
  width: 934px;
  background: #ffffff; }

#top-photos-table {
  border-top: 1px solid  #E6E7E8;
  width: 936px;
  height: 204px;
  margin-top: 10px; }
  #top-photos-table img {
    padding: 0px;
    margin: 0px; }
  #top-photos-table td.image {
    padding: 4px;
    width: 147px;
    height: 147px;
    vertical-align: top;
    text-align: center;
    border-right: 1px solid #E6E7E8; }
  #top-photos-table td.name {
    padding-left: 4px;
    width: 147px;
    height: 40px;
    vertical-align: top;
    border-right: 1px solid #E6E7E8; }
  #top-photos-table td.image-last {
    padding: 4px;
    width: 147px;
    height: 147px;
    vertical-align: top;
    text-align: center;
    border-right: 0px; }
  #top-photos-table td.name-last {
    padding-left: 4px;
    width: 147px;
    height: 40px;
    vertical-align: top; }

#photo-area-wrapper {
  width: 983px;
  margin-bottom: 10px;
  padding: 0;
  border-bottom: 6px solid #d1d960;
  background: #ffffff; }
  #photo-area-wrapper h1 {
    font-size: 24px;
    margin: 20px 0 10px 4px;
    color: #666666; }

#home-content-wrap {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  background: #fff url(/images/homepage/faux_columns.gif) repeat-y 50% 0; }

#home-center-content {
  padding: 10px;
  height: 100%;
  min-height: 100px; }

#home-content-wrap h1 {
  font-size: 20px;
  margin: 10px 0 15px 7px;
  color: #333; }

#sidebar-a {
  float: left;
  width: 315px;
  margin: 0;
  padding: 10px;
  height: 100%; }
  #sidebar-a p {
    margin-left: 7px;
    margin-right: 10px; }

#sidebar-b {
  float: right;
  width: 315px;
  margin: 0;
  padding: 10px;
  height: 100%;
  background: #ffffff; }
  #sidebar-b p {
    margin-left: 7px;
    margin-right: 10px; }

.bulletlist {
  list-style-image: url(/images/homepage/bullet_icon.gif) !important;
  margin: 20px 0 0 30px;
  padding: 0; }

#home-content-wrap .helplist {
  list-style-image: url(/images/homepage/bullet_icon.gif);
  margin: 20px 0 0 30px;
  padding: 0; }

.helplist li {
  margin: 7px 0 0 0;
  padding: 0; }

#footer {
  clear: both;
  margin-top: 1px; }

#top-species-table {
  width: 300px;
  padding: 0;
  margin: 0;
  font-size: 13px; }
  #top-species-table img {
    padding: 1px;
    border: solid 4px #e6e7e9; }
  #top-species-table td {
    padding: 5px 6px 5px 3px;
    color: #666666;
    text-align: left; }
    #top-species-table td.image {
      padding: 5px 6px 5px 3px;
      color: #666666;
      text-align: right; }

#featured-species-table {
  padding: 0px;
  margin: 0px;
  font-size: 13px; }
  #featured-species-table img {
    padding: 1px;
    border: solid 4px #e6e7e9; }
  #featured-species-table td {
    padding: 5px 6px 5px 3px;
    color: #666666; }

.quote {
  font-style: italic;
  font: normal "Times New Roman"; }

.nav_buttons {
  position: absolute;
  top: 4px;
  right: 10px; }
  .nav_buttons #more-button a {
    font: normal 16px arial, sans-serif;
    padding: 0px;
    text-decoration: none;
    color: #149ACC; }
  .nav_buttons .more a {
    float: left;
    display: block;
    font: normal 18px arial, sans-serif;
    padding-top: 4px;
    padding-right: 30px;
    text-decoration: none;
    color: #149ACC; }
  .nav_buttons p {
    float: left;
    margin-left: 4px; }
  .nav_buttons #next-button {
    padding-left: 9px; }
  .nav_buttons p.play {
    background-position: -30px -572px; }

.current_node {
  font-weight: bold;
  font-style: italic; }

#textarea {
  text-transform: uppercase;
  border-bottom: medium solid #CCC;
  text-align: center; }
  #textarea .attribution-icon {
    vertical-align: bottom; }
  #textarea a {
    font-weight: normal;
    font-style: none;
    text-decoration: none; }
    #textarea a. {
      color: #CCC; }

#pages .pagination span {
  display: inline; }

#attribution-example {
  margin: 1em 0;
  padding: 1em;
  background-color: #eaeaea;
  border: 1px solid silver; }
  #attribution-example h3 {
    border-bottom: 1px solid #CCCCCC !important;
    color: #999999 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important; }
  #attribution-example h2 {
    border-bottom: 2px solid #CCCCCC !important;
    color: #333333 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 26px !important;
    padding: 13px 0 3px !important;
    text-transform: uppercase !important;
    margin-bottom: 1.5em !important; }
  #attribution-example table {
    border-bottom: 1px solid #ccc;
    margin-bottom: 1em;
    width: 100%; }
    #attribution-example table tr td {
      vertical-align: top; }

#content_partner_edit_area a:hover {
  text-decoration: none; }
#content_partner_edit_area ul.status {
  list-style: none;
  font-size: 14px;
  margin-top: 6px; }
  #content_partner_edit_area ul.status li {
    list-style: none;
    margin-bottom: 10px; }

#special-announcement {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid #FCD5D2;
  background-color: #FCF7E8; }

#right-pane table {
  margin-top: 6px; }
#right-pane thead {
  background-color: #eee;
  border-bottom: 1px solid #ddd; }
#right-pane th {
  color: #111;
  padding: 4px; }
#right-pane td {
  padding: 4px; }

input.openid {
  border: 1px solid #666;
  width: 232px;
  background: url(/images/openid_small_logo.png) no-repeat;
  padding-left: 18px; }

table.lmNav {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px; }

.lmNav td {
  background: #f9f9f9;
  padding: 10px 6px; }
  .lmNav td.num {
    width: 20px;
    text-align: right;
    padding-right: 0; }
.lmNav a {
  text-decoration: none;
  color: #4f4f4f;
  font-size: 11px; }
  .lmNav a:visited {
    text-decoration: none;
    color: #4f4f4f;
    font-size: 11px; }
  .lmNav a em {
    font-style: normal;
    font-size: 22px;
    vertical-align: middle;
    margin-right: 6px;
    position: relative;
    top: -2px;
    line-height: 22px; }
  .lmNav a:hover {
    color: #97C22B !important;
    background: none; }
.lmNav td.selected {
  background: #ddd;
  font-weight: bold; }
  .lmNav td.selected a em {
    color: #97C22B; }
  .lmNav td.selected a:hover {
    color: #4f4f4f !important;
    cursor: default; }

#resources table {
  border: 2px solid silver; }

.resources_table_head {
  border: 2px solid silver;
  vertical-align: bottom;
  font-weight: bold;
  background-color: #eee; }

.resource_rowsep {
  border-bottom: 1px solid silver; }

.resource_indented {
  padding-left: 2em !important; }

.form_item {
  margin-bottom: 2em; }

form div#browser-text li {
  list-style-type: none; }

#media-images {
  position: relative;
  z-index: 1000; }
  #media-images #large-image #large-image-buttons {
    min-height: 15px;
    margin-top: 0px;
    padding: 0px; }
    #media-images #large-image #large-image-buttons #left-image-buttons {
      float: left;
      padding-left: 6px; }
      #media-images #large-image #large-image-buttons #left-image-buttons ul {
        text-align: left; }

li.status_icon {
  position: relative;
  background-repeat: no-repeat;
  height: 22px;
  width: 22px;
  display: inline-block; }
li.unpublished_icon {
  background-image: url('/images/icons/unpublished.png'); }
li.published_icon {
  background-image: url('/images/icons/published.png'); }
li.inappropriate_icon {
  background-image: url('/images/icons/inappropriate.png'); }
li.invisible_icon {
  background-image: url('/images/icons/invisible.png'); }

#media-images #large-image #large-image-buttons #right-image-buttons {
  float: right;
  position: relative;
  width: 180px; }

#large-image-buttons ul#large-image-button-group {
  padding: 0; }
  #large-image-buttons ul#large-image-button-group li {
    text-align: center;
    vertical-align: middle;
    position: relative;
    display: inline-block;
    width: 25px;
    height: 24px; }
  #large-image-buttons ul#large-image-button-group li>a {
    display: inline-block;
    width: 100%;
    height: 100%; }
#large-image-buttons ul.large-image-button-group li>a div {
  width: 25px;
  height: 24px; }
#large-image-buttons ul.large-image-button-group li#large-image-comment-button {
  text-align: center;
  width: 31px; }
  #large-image-buttons ul.large-image-button-group li#large-image-comment-button a {
    color: #98CB00;
    font-family: sans-serif;
    font-size: smaller; }

#curator-popup {
  width: 465px;
  left: -200px;
  top: 30px;
  text-align: left;
  line-height: normal;
  max-height: 400px;
  float: left; }

#media-taxa-comments-body {
  background-color: #EEF7D5;
  border: 4px solid #9C0;
  height: 353px;
  margin-left: 0;
  margin-top: 0;
  overflow: auto;
  padding: 0 2em;
  width: 641px; }

div#user_show {
  padding: 10px;
  border-bottom: 2px solid #CCCCCC; }
  div#user_show #about {
    text-align: center; }
  div#user_show #account, div#user_show #activity {
    margin: 20px;
    width: 300px;
    float: right;
    clear: right;
    color: #909090; }
  div#user_show #credentials {
    margin: 30px;
    width: 500px;
    font-size: 12pt; }
  div#user_show h1 {
    font-size: 28pt;
    margin: 0px 0;
    padding: 10px 0px; }
  div#user_show h2 {
    font-size: 22pt;
    margin: 0px 0;
    padding: 10px 0px; }
  div#user_show h3 {
    font-size: 14pt;
    margin: 0px 0;
    padding: 10px 0px;
    color: #606060; }
  div#user_show tr.odd {
    background-color: #f8f8f8; }
  div#user_show td {
    padding: 1px 4px; }
div#usage_report_stats {
  border: 1px solid #ccc;
  max-height: 400px;
  overflow: auto;
  width: 365px; }
  div#usage_report_stats table {
    width: 100%; }
    div#usage_report_stats table thead th {
      font-weight: bold; }
div.generic_report div.settings fieldset {
  border: 1px solid rgb(204, 204, 204);
  width: 280px;
  float: right;
  margin-left: 20px; }

form#search_form div.search_options {
  padding-top: 5px; }

div.content-article {
  padding: 5px; }
div.text_buttons {
  height: 25px;
  margin-top: 0px;
  padding: 0px; }
  div.text_buttons #left_text_buttons_group {
    float: left;
    padding-right: 2px; }
    div.text_buttons #left_text_buttons_group ul {
      text-align: left; }
  div.text_buttons #right_text_buttons_group {
    float: right;
    position: relative; }
  div.text_buttons #right_text_button {
    float: left;
    position: relative;
    width: 24px;
    margin-right: 5px;
    top: 0px;
    bottom: 0px; }

#span_block {
  display: block;
  width: 24px;
  height: 25px; }

ul.tree {
  margin: 10px; }
  ul.tree li {
    padding-left: 20px;
    font-weight: normal; }
    ul.tree li a {
      text-decoration: none; }
      ul.tree li a:hover {
        text-decoration: underline; }
    ul.tree li.selected {
      font-weight: bold; }

#loading-comments {
  padding: 100px 0 0 220px; }

.pagination {
  background: transparent;
  color: #959595;
  padding: 8px 0 0 0; }
  .pagination a {
    padding: 1px 2px;
    color: #959595 !important;
    text-decoration: none; }

form .pagination a:link, form .pagination a:active {
  padding: 1px 2px;
  color: #959595 !important;
  text-decoration: none; }

.pagination a:hover {
  color: black !important; }
.pagination .current {
  background: #a3d117;
  color: #fff;
  padding: 1px 2px; }
.pagination span {
  color: #959595;
  display: inline; }

div#report_from_eol .pagination {
  background: transparent;
  color: #959595;
  padding: 8px 0 0 0; }
  div#report_from_eol .pagination a {
    padding: 1px 2px;
    color: #959595 !important;
    text-decoration: none; }
    div#report_from_eol .pagination a:link, div#report_from_eol .pagination a:active {
      padding: 1px 2px;
      color: #959595 !important;
      text-decoration: none; }
    div#report_from_eol .pagination a:hover {
      color: black !important; }
  div#report_from_eol .pagination .current {
    background: #a3d117;
    color: #fff;
    padding: 1px 2px; }
  div#report_from_eol .pagination span {
    color: #959595;
    display: inline; }

#left-pane h3 {
  margin-left: 20px; }

.text-slidebox-container {
  padding: 10px;
  background-color: #F4F4F4; }

.text-slidebox-border {
  border: 2px solid #6A8D00 !important; }

div.text_curation_close {
  height: 13px; }

.comment-button-image {
  background: transparent url(/images/icons/icons.gif) no-repeat -72px 0px; }
  .comment-button-image:hover {
    background: transparent url(/images/icons/icons.gif) no-repeat -72px -32px; }

.curate-button-image {
  background: transparent url(/images/icons/icons.gif) no-repeat -23px 0px; }
  .curate-button-image:hover {
    background: transparent url(/images/icons/icons.gif) no-repeat -23px -32px; }

.thumbs-up-image {
  background: transparent url(/images/icons/dual-states/thumbs_up.png) no-repeat 0px 0px; }
  .thumbs-up-image:hover {
    background: transparent url(/images/icons/dual-states/thumbs_up.png) no-repeat 0px -32px; }

.thumbs-down-image {
  background: transparent url(/images/icons/dual-states/thumbs_down.png) no-repeat 0px 0px; }
  .thumbs-down-image:hover {
    background: transparent url(/images/icons/dual-states/thumbs_down.png) no-repeat 0px -32px; }

.image-rating {
  float: left;
  padding-left: 10px;
  padding-top: 3px; }

.text-rating {
  float: left;
  padding-left: 7px; }

ul.small-star {
  padding-left: 0px !important; }

div.edit_text {
  width: 20px;
  height: 22px;
  float: right;
  padding-right: 5px;
  text-align: right; }
div#report_from_eol h2 {
  padding: 0px 0px 5px !important; }
div#report_from_eol ul {
  padding-left: 14px !important; }

span#left_top_text {
  padding-left: 13px; }

div#add_user_text_references {
  text-align: right;
  width: 275px; }
  div#add_user_text_references input#add_more_user_text_reference {
    margin-top: 2px; }

table#content-partners-species {
  border-collapse: separate; }
  table#content-partners-species td {
    height: 147px;
    padding: 4px;
    text-align: center;
    vertical-align: top; }
    table#content-partners-species td.image {
      border-right: 1px solid #E6E7E8;
      border-bottom: 1px solid #E6E7E8; }
    table#content-partners-species td.image-last {
      border-bottom: 1px solid #E6E7E8; }

div#browse_content_partner_species .pagination a:link {
  color: #149ACC !important; }
div#content_partner_stats {
  font-size: 16px;
  font-style: italic;
  padding: 10px; }


text:
package ca.uhn.fhir.jpa.term;

import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.term.api.ITermVersionAdapterSvc;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.util.UrlUtil;
import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_30_40;
import org.hl7.fhir.convertors.factory.VersionConvertorFactory_30_40;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.ConceptMap;
import org.hl7.fhir.dstu3.model.ValueSet;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.instance.model.api.IIdType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;

import static org.apache.commons.lang3.StringUtils.isBlank;

public class TermVersionAdapterSvcDstu3 extends BaseTermVersionAdapterSvcImpl implements ITermVersionAdapterSvc {

	private IFhirResourceDao<ConceptMap> myConceptMapResourceDao;
	private IFhirResourceDao<CodeSystem> myCodeSystemResourceDao;
	private IFhirResourceDao<ValueSet> myValueSetResourceDao;

	@Autowired
	private ApplicationContext myAppCtx;

	public TermVersionAdapterSvcDstu3() {
		super();
	}

	/**
	 * Initialize the beans that are used by this service.
	 * <p>
	 * Note: There is a circular dependency here where the CodeSystem DAO
	 * needs terminology services, and the term services need the CodeSystem DAO.
	 * So we look these up in a refresh event instead of just autowiring them
	 * in order to avoid weird circular reference errors.
	 */
	@SuppressWarnings({"unchecked", "unused"})
	@EventListener
	public void start(ContextRefreshedEvent theEvent) {
		myCodeSystemResourceDao = (IFhirResourceDao<CodeSystem>) myAppCtx.getBean("myCodeSystemDaoDstu3");
		myValueSetResourceDao = (IFhirResourceDao<ValueSet>) myAppCtx.getBean("myValueSetDaoDstu3");
		myConceptMapResourceDao = (IFhirResourceDao<ConceptMap>) myAppCtx.getBean("myConceptMapDaoDstu3");
	}

	@Override
	public IIdType createOrUpdateCodeSystem(org.hl7.fhir.r4.model.CodeSystem theCodeSystemResource, RequestDetails theRequestDetails) {
		CodeSystem resourceToStore;
		try {
			resourceToStore = (CodeSystem) VersionConvertorFactory_30_40.convertResource(theCodeSystemResource, new BaseAdvisor_30_40(false));
		} catch (FHIRException e) {
			throw new InternalErrorException(e);
		}
		validateCodeSystemForStorage(theCodeSystemResource);
		if (isBlank(resourceToStore.getIdElement().getIdPart())) {
			String matchUrl = "CodeSystem?url=" + UrlUtil.escapeUrlParam(theCodeSystemResource.getUrl());
			return myCodeSystemResourceDao.update(resourceToStore, matchUrl, theRequestDetails).getId();
		} else {
			return myCodeSystemResourceDao.update(resourceToStore, theRequestDetails).getId();
		}
	}

	@Override
	public void createOrUpdateConceptMap(org.hl7.fhir.r4.model.ConceptMap theConceptMap) {
		ConceptMap resourceToStore;
		try {
			resourceToStore = (ConceptMap) VersionConvertorFactory_30_40.convertResource(theConceptMap, new BaseAdvisor_30_40(false));
		} catch (FHIRException e) {
			throw new InternalErrorException(e);
		}
		if (isBlank(resourceToStore.getIdElement().getIdPart())) {
			String matchUrl = "ConceptMap?url=" + UrlUtil.escapeUrlParam(theConceptMap.getUrl());
			myConceptMapResourceDao.update(resourceToStore, matchUrl);
		} else {
			myConceptMapResourceDao.update(resourceToStore);
		}
	}

	@Override
	public void createOrUpdateValueSet(org.hl7.fhir.r4.model.ValueSet theValueSet) {
		ValueSet valueSetDstu3;
		try {
			valueSetDstu3 = (ValueSet) VersionConvertorFactory_30_40.convertResource(theValueSet, new BaseAdvisor_30_40(false));
		} catch (FHIRException e) {
			throw new InternalErrorException(e);
		}

		if (isBlank(valueSetDstu3.getIdElement().getIdPart())) {
			String matchUrl = "ValueSet?url=" + UrlUtil.escapeUrlParam(theValueSet.getUrl());
			myValueSetResourceDao.update(valueSetDstu3, matchUrl);
		} else {
			myValueSetResourceDao.update(valueSetDstu3);
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
set -e

if [ ${TEST_SUITE:-python2} == python2 ]; then
  echo Running tests using Python2:

  python -m unittest discover

  # These files have doctests.
  python codesearch/language_utils.py
  python -m doctest README.md
fi

if [ ${TEST_SUITE:-python3} == python3 ]; then
  # Exit if python3 is not installed.
  command -v python3 >/dev/null 2>&1

  echo Running tests using Python3:

  python3 -m unittest discover
  python3 codesearch/language_utils.py
  python3 -m doctest README.md
fi

if [[ -n "$TYPE_CHECK" ]]; then
  echo Static analysis via mypy:
  mypy codesearch
fi

if [[ -n "$FLAKE8" ]]; then
  echo Running flake8
  python3 -m flake8
fi


text:
local anim8 = require 'vendor/anim8'
local sound = require 'vendor/TEsound'
local gamestate = require 'vendor/gamestate'
local Platform = require 'nodes/platform'
local utils = require 'utils'
local options = require 'options'

local Airplane = {}
Airplane.__index = Airplane

local AirplaneSprite = love.graphics.newImage('images/sprites/greendale/airplane.png')
local g = anim8.newGrid(168, 24, AirplaneSprite:getWidth(), AirplaneSprite:getHeight())

function Airplane.new(node, collider)
  local airplane = {}
  setmetatable(airplane, Airplane)

  airplane.node = node
  airplane.speed = 100
  airplane.noiseRadius = 500

  airplane.airplane = anim8.newAnimation('loop', g('1,1-2'), 0.5)

  airplane.platform_node = utils.deepcopy(node)
  airplane.platform_node.width = 15
  airplane.platform_node.height = 3
  airplane.platform = Platform.new( airplane.platform_node, collider )

  airplane.bb = collider:addRectangle(node.x, node.y, node.width, node.height)
  airplane.bb.node = airplane
  collider:setPassive(airplane.bb)

  return airplane
end

function Airplane:enter(dt)
  self.map = gamestate.currentState().map
  self.engineNoise = sound.startSfx( 'click', nil, self.node.x, self.node.y, self.noiseRadius )
end

function Airplane:collide(node, dt, mtv_x, mtv_y)
  if not node.isPlayer then return end

  if not node.currentplatform then
    node.currentplatform = self
  end
  if mtv_x == 0 and mtv_y < 0 then
    self.ontop = true
  else
    self.ontop = false
  end
end

function Airplane:collide_end(node,dt)
  if node.isPlayer and node.currentplatform == self then
    node.currentplatform = nil
  end
end

function Airplane:leave()
  sound.stopSfx( self.engineNoise )
end

function Airplane:update(dt, player)

  self.node.x = self.node.x - dt * self.speed

  -- move the player along with the bounding box
  if player.currentplatform == self and self.ontop then
    player.position.x = player.position.x - dt * self.speed
    player:moveBoundingBox()
  end

  self.platform.bb:moveTo( self.node.x + 20,
                           self.node.y + 3)
  self.bb:moveTo( self.node.x + self.node.width / 2,
                  self.node.y + (self.node.height / 2) + 1 )

  if self.node.x < -self.noiseRadius then
    self.node.x = self.map.width * self.map.tilewidth + self.noiseRadius
  end
  if self.engineNoise then
    if options.option_map['SFX VOLUME'].range[3] ~= 0 then
      self.engineNoise.x = self.node.x
    end
  end
end

function Airplane:draw()
  self.airplane:draw( AirplaneSprite, self.node.x, self.node.y )
end

return Airplane


text:
//
//  SPDY.m
//  SPDY library implementation.
//
//  Created by Jim Morrison on 1/31/12.
//  Copyright 2012 Twist Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import "SPDY.h"

#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <CFNetwork/CFNetwork.h>

#include <assert.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>

#include "openssl/ssl.h"
#include "spdylay/spdylay.h"

#import "SpdySession.h"
#import "SpdyInputStream.h"
#import "SpdyStream.h"
#import "SpdyUrlConnection.h"
#import "SpdySessionKey.h"
#import "SpdyCallback.h"

// The shared spdy instance.
static SPDY *spdy = NULL;
NSString *kSpdyErrorDomain = @"SpdyErrorDomain";
NSString *kOpenSSLErrorDomain = @"OpenSSLErrorDomain";

static int select_next_proto_cb(SSL *ssl,
                                unsigned char **out, unsigned char *outlen,
                                const unsigned char *in, unsigned int inlen,
                                void *arg) {
  SpdySession *sc = (__bridge SpdySession *)SSL_get_app_data(ssl);
  int spdyVersion = spdylay_select_next_protocol(out, outlen, in, inlen);
  if (spdyVersion > 0) {
    sc.spdyVersion = spdyVersion;
    sc.spdyNegotiated = YES;
  }

  return SSL_TLSEXT_ERR_OK;
}

#ifdef CONF_Debug
@interface SpdyLogImpl : NSObject<SpdyLogger>
@end

@implementation SpdyLogImpl

- (void)writeSpdyLog:(NSString *)msg file:(const char *)file line:(int)line {
  NSLog(@"[%s:%d]", file, line);
  NSLog(@"%@", msg);
}
@end
#endif

@interface SPDY ()
- (SpdySession*)fetchFromMessage:(CFHTTPMessageRef)request delegate:(SpdyCallback *)delegate body:(NSInputStream *)body;
+ (SpdyNetworkStatus)reachabilityStatusForHost:(NSString *)host;

- (void)setUpSslCtx;

@property (nonatomic, strong) NSMutableDictionary *sessions;
@property (nonatomic, assign) SSL_CTX *ssl_ctx;

@end

@implementation SPDY

#ifdef CONF_Debug
@synthesize logger = _logger;
#endif
@synthesize sessions = _sessions;
@synthesize ssl_ctx =  _ssl_ctx;

#if TARGET_OS_IPHONE
// This logic was stripped from Apple's Reachability.m sample application.
+ (SpdyNetworkStatus)networkStatusForReachabilityFlags:(SCNetworkReachabilityFlags)flags {
  // Host not reachable.
  if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
    return kSpdyNetworkStatusNotReachable;

  // Host reachable by WWAN.
  if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN)
    return kSpdyNetworkStatusReachableViaWWAN;

  // Host reachable and no connection is required. Assume wifi.
  if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)
    return kSpdyNetworkStatusReachableViaWiFi;

  // Host reachable. Connection is on-demand or on-traffic. No user intervention needed. Assume wifi.
  if (((flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0) ||
      ((flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) {
    if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0)
      return kSpdyNetworkStatusReachableViaWiFi;
  }

  return kSpdyNetworkStatusNotReachable;
}
#else
// this is for macosx
+ (SpdyNetworkStatus)networkStatusForReachabilityFlags:(SCNetworkReachabilityFlags)flags {
  // Host not reachable.
  if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
    return kSpdyNetworkStatusNotReachable;
  else
    return kSpdyNetworkStatusReachable;
}
#endif

+ (SpdyNetworkStatus)reachabilityStatusForHost:(NSString *)host {
  SpdyNetworkStatus status = kSpdyNetworkStatusNotReachable;
  SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [host UTF8String]);
  if (ref) {
    SCNetworkReachabilityFlags flags = 0;
    if (SCNetworkReachabilityGetFlags(ref, &flags))
      status = [self networkStatusForReachabilityFlags:flags];

    CFRelease(ref);
  }
  return status;
}

-(SSL_SESSION *)resetSession:(SpdySession*)session  withKey:(SpdySessionKey*)key {
  [session resetStreamsAndGoAway];
  SSL_SESSION * oldSslSession = [session getSslSession];
  SPDY_LOG(@"removing session object (%p) for key %@", self, key);
  [self.sessions removeObjectForKey:key];
  SPDY_LOG(@"after remove we have %lu sessions", (unsigned long)self.sessions.count);
  return oldSslSession;
}

-(SSL_SESSION *)resetSession:(SpdySession*)session  withUrl:(NSURL*)key {
  return [self resetSession:session
	       withKey:[[SpdySessionKey alloc]
			 initFromUrl:key]];
}

- (SpdySession *)getSession:(NSURL *)url withError:(NSError **)error voip:(BOOL)voip create:(BOOL)create {

  SPDY_LOG(@"getSession:%@ withError: voip:%d create:%d", url, voip, create);
  assert(error != NULL);
  SpdySessionKey *key = [[SpdySessionKey alloc] initFromUrl:url];
  SPDY_LOG(@"we have %lu sessions", (unsigned long)self.sessions.count);
  for(SpdySessionKey *sessionKey in self.sessions) {
    SPDY_LOG(@"\tsession key %@", sessionKey);
  }
  SpdySession *session = [self.sessions objectForKey:key];
  SPDY_LOG(@"Looking up %@, found %p", key, session);
  SpdyNetworkStatus currentStatus = [self.class reachabilityStatusForHost:key.host];
  SSL_SESSION *oldSslSession =  NULL;
  SpdySession *oldSpdySession = nil;
  if (session != nil && ([session isInvalid] ||
			 (currentStatus != session.networkStatus
#if TARGET_OS_IPHONE
 &&
			  !(session.networkStatus == kSpdyNetworkStatusReachableViaWWAN &&
			    currentStatus == kSpdyNetworkStatusReachableViaWiFi)
#endif
                          ))) {

    SPDY_LOG(@"Resetting %@ because invalid: %i or %@ != %@", session, [session isInvalid], [SPDY networkStatusString:currentStatus], [SPDY networkStatusString:session.networkStatus]);
    oldSslSession = [self resetSession:session withKey:key];
    oldSpdySession = session;
    session = nil;
  }
  if (create && session == nil) {
    session = [[SpdySession alloc] init:self.ssl_ctx oldSession:oldSslSession];
    SPDY_LOG(@"creating new session %p w/ old session %@", session, oldSpdySession);
    session.voip = voip;

    SPDY_LOG(@"callbacks are %@ %@ %@", oldSpdySession.readCallback,
	     oldSpdySession.writeCallback, oldSpdySession.connectionStateCallback);

    session.readCallback = oldSpdySession.readCallback;
    session.writeCallback = oldSpdySession.writeCallback;
    session.connectionStateCallback = oldSpdySession.connectionStateCallback;
    *error = [session connect:url];
    if (*error != nil) {
      SPDY_LOG(@"Could not connect to %@ because %@", url, *error);
      return nil;
    }
    SPDY_LOG(@"Adding %@ to sessions (size = %lu)", key, (unsigned long)([self.sessions count] + 1));
    currentStatus = [self.class reachabilityStatusForHost:key.host];
    session.networkStatus = currentStatus;
    if(session.networkStatusCallback != NULL)
      session.networkStatusCallback(currentStatus);

    [self.sessions setObject:session forKey:key];
    SPDY_LOG(@"self.sessions has %lu elements", (unsigned long)self.sessions.count);
  } else {
    SPDY_LOG(@"not creating new session, returing %@", session);
  }
  return session;
}

- (int)pingWithCallback:(void (^)(BOOL success))callback {
  int ret = 0;
  SPDY_LOG(@"pingWithCallback w/ %lu sessions", (unsigned long)self.sessions.count);
  for(SpdySessionKey *sessionKey in self.sessions) {
    SpdySession *session = [self.sessions objectForKey:sessionKey];
    if (session != nil) {
      ret++;
      SPDY_LOG(@"pinging session %@", session);
      [session sendPingWithCallback:callback];
    }
  }
  if(ret == 0) callback(NO);
  return ret;
}

- (void)pingRequest:(NSURLRequest*)request callback:(void (^)(BOOL success))callback {
  NSURL *url = [request URL];
  NSError *error;
  SpdySession *session = [self getSession:(NSURL *)url withError:&error voip:NO create:YES];
  if (session == nil) {
    SPDY_LOG(@"could not ping: no session");
    callback(NO);
    return;
  }
  [session sendPingWithCallback:callback];
}

- (void)pingUrlString:(NSString*)url callback:(void (^)(BOOL success))callback {
  NSURL *u = [NSURL URLWithString:url];
  if (u == nil || u.host == nil) {
    //NSError *error = [NSError errorWithDomain:(NSString *)kCFErrorDomainCFNetwork code:kCFHostErrorHostNotFound userInfo:nil];
    SPDY_LOG(@"could not ping: bad host");
    callback(NO);
    return;
  }
  NSError *error = nil;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:YES];
  if (session == nil) {
    SPDY_LOG(@"could not ping: no session");
    callback(NO);
    return;
  }
  [session sendPingWithCallback:callback];
}

-(SpdySession*)fetch_internal:(NSString*)url delegate:(SpdyCallback *)delegate voip:(BOOL)voip {
  SPDY_LOG(@"fetch_internal");
  NSURL *u = [NSURL URLWithString:url];
  if (u == nil || u.host == nil) {
    NSError *error = [NSError errorWithDomain:(NSString *)kCFErrorDomainCFNetwork code:kCFHostErrorHostNotFound userInfo:nil];
    [delegate onError:error];
    return nil;
  }
  NSError *error = nil;
  SpdySession *session = [self getSession:u withError:&error voip:voip create:YES];
  if (session == nil) {
    [delegate onError:error];
    return nil;
  }
  session.voip = voip;
  SPDY_LOG(@"calling fetch on session %@", session);
  [session fetch:u delegate:delegate];
  return session;
}

- (void)teardownForRequest:(NSURLRequest*)request {
  NSURL *url = [request URL];
  NSError *error;
  SpdySession *session = [self getSession:url withError:&error voip:NO create:NO];
  if (session == nil) {
    SPDY_LOG(@"Warning, session == nil in teardownForRequest:%@", request);
   return;
  }
  [self resetSession:session withUrl:url];
}

- (void)teardown:(NSString*)url {
  NSURL *u = [NSURL URLWithString:url];
  if (u == nil || u.host == nil) {
    return;
  }
  NSError *error = nil;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:NO];
  if (session == nil) {
    SPDY_LOG(@"Warning, session == nil in teardown:%@", url);
    return;
  }
  SPDY_LOG(@"tearing down spdy session %p", session);
  [self resetSession:session withUrl:u];
}

- (SpdyConnectState)connectStateForUrlString:(NSString*)url {
  NSURL *u = [NSURL URLWithString:url];
  if (u == nil || u.host == nil) {
    return kSpdyConnectStateHostNotFound;
  }
  NSError *error = nil;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:NO];
  if (session == nil) {
    return kSpdyConnectStateStreamNotFound;
  }
  return session.connectState;
}

- (SpdyConnectState)connectStateForRequest:(NSURLRequest*)request {
  NSURL * u = request.URL;
  NSError *error;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:NO];
  if (session == nil) {
    return kSpdyConnectStateStreamNotFound;
  }
  return session.connectState;
}

- (SpdyNetworkStatus)networkStatusForUrlString:(NSString*)url {
  NSURL *u = [NSURL URLWithString:url];
  if (u == nil || u.host == nil) {
    return kSpdyNetworkStatusHostNotFound;
  }
  NSError *error = nil;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:NO];
  if (session == nil) {
    return kSpdyNetworkStatusStreamNotFound;
  }
  return session.networkStatus;
}

- (SpdyNetworkStatus)networkStatusForRequest:(NSURLRequest*)request {
  NSURL *u = request.URL;
  if (u == nil || u.host == nil) {
    return kSpdyNetworkStatusHostNotFound;
  }
  NSError *error;
  SpdySession *session = [self getSession:u withError:&error voip:NO create:NO];
  if (session == nil) {
    return kSpdyNetworkStatusStreamNotFound;
  }
  return session.networkStatus;
}

- (SpdySession*)fetch:(NSString *)url delegate:(SpdyCallback *)delegate {
  SPDY_LOG(@"fetch:");
  return [self fetch_internal:url delegate:delegate voip:NO];
}

- (SpdySession*)fetch:(NSString *)url delegate:(SpdyCallback *)delegate voip:(BOOL)voip {
  SPDY_LOG(@"fetch:");
  return [self fetch_internal:url delegate:delegate voip:voip];
}

- (SpdySession*)fetchFromMessage:(CFHTTPMessageRef)request delegate:(SpdyCallback *)delegate {
  SPDY_LOG(@"fetch:");
  return [self fetchFromMessage:request delegate:delegate body:nil];
}

- (SpdySession*)fetchFromMessage:(CFHTTPMessageRef)request delegate:(SpdyCallback *)delegate body:(NSInputStream *)body {
  SPDY_LOG(@"fetch:");
    CFURLRef url = CFHTTPMessageCopyRequestURL(request);
    NSError *error;
    SpdySession *session = [self getSession:(__bridge NSURL *)url withError:&error voip:NO create:YES];
    if (session == nil) {
        [delegate onError:error];
    } else {
        [session fetchFromMessage:request delegate:delegate body:body];
    }
    CFRelease(url);
    return session;
}

- (SpdySession*)fetchFromRequest:(NSURLRequest *)request delegate:(SpdyCallback *)delegate {
  SPDY_LOG(@"fetch:");
  return [self fetchFromRequest:request delegate:delegate voip:NO];
}

- (SpdySession*)fetchFromRequest:(NSURLRequest *)request delegate:(SpdyCallback *)delegate voip:(BOOL)voip {
  SPDY_LOG(@"fetch:");
  NSURL *url = [request URL];
  NSError *error;
  SpdySession *session = [self getSession:(NSURL *)url withError:&error voip:voip create:YES];
  if (session == nil) {
    [delegate onError:error];
  } else {
    [session fetchFromRequest:request delegate:delegate];
  }
  return session;
}

- (NSInteger)closeAllSessions {
  SPDY_LOG(@"closeAllSessions");
  NSInteger cancelledRequests = 0;
  NSEnumerator *enumerator = [self.sessions objectEnumerator];
  SpdySession *session;

  while ((session = (SpdySession *)[enumerator nextObject])) {
    cancelledRequests += [session resetStreamsAndGoAway];
  }
  [self.sessions removeAllObjects];
  return cancelledRequests;
}

- (NSInteger)closeAllSessionsForURL:(NSURL *)url {
    NSInteger cancelledRequests = 0;
    SpdySessionKey *urlKey = [[SpdySessionKey alloc] initFromUrl:url];
    SpdySession *session = [self.sessions objectForKey:urlKey];
    if (session != nil) {
        cancelledRequests = [session resetStreamsAndGoAway];
        [self.sessions removeObjectForKey:urlKey];
    }
    return cancelledRequests;

}

- (SPDY *)init {
  self = [super init];
  if (self) {
#ifdef CONF_Debug
    if(self.logger == nil)
      self.logger = [[SpdyLogImpl alloc] init];
#endif
    self.sessions = [[NSMutableDictionary alloc] init];
    [self setUpSslCtx];
  }
  return self;
}

- (void)dealloc {
    SSL_CTX_free(_ssl_ctx);
}

- (void)setUpSslCtx {
    self.ssl_ctx = SSL_CTX_new(SSLv23_client_method());
    assert(self.ssl_ctx);

    /* Disable SSLv2 and enable all workarounds for buggy servers */
    SSL_CTX_set_options(self.ssl_ctx, SSL_OP_ALL|SSL_OP_NO_SSLv2);
    SSL_CTX_set_mode(self.ssl_ctx, SSL_MODE_AUTO_RETRY);
    SSL_CTX_set_mode(self.ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
    SSL_CTX_set_mode(self.ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
    SSL_CTX_set_next_proto_select_cb(self.ssl_ctx, select_next_proto_cb, (__bridge void *)(self));
    SSL_CTX_set_session_cache_mode(self.ssl_ctx, SSL_SESS_CACHE_CLIENT);
}

+ (SPDY *)sharedSPDY {
    if (spdy == NULL) {
        SSL_library_init();
        spdy = [[SPDY alloc] init];
        [SpdyStream staticInit];
    }
    return spdy;
}

#pragma mark - NSURLConnection related methods.

// These methods are object methods so that sharedSpdy is called before registering SpdyUrlConnection with NSURLConnection.
- (void)registerForNSURLConnection {
    [SpdyUrlConnection registerSpdy];
}

- (void)registerForNSURLConnectionWithCallback:(id <SpdyUrlConnectionCallback>)callback {
    [SpdyUrlConnection registerSpdyWithCallback:callback];
}

- (BOOL)isSpdyRegistered {
    return [SpdyUrlConnection isRegistered];
}

- (BOOL)isSpdyRegisteredForUrl:(NSURL *)url {
    return [SpdyUrlConnection isRegistered] && [SpdyUrlConnection canInitWithUrl:url];
}

- (void)unregisterForNSURLConnection {
    [SpdyUrlConnection unregister];
}

+(NSString*)connectionStateString:(SpdyConnectState) state {
  switch(state) {
  case kSpdyConnectStateNotConnected:
    return @"NotConnected";
  case kSpdyConnectStateConnecting:
    return @"Connecting";
  case kSpdyConnectStateSslHandshake:
    return @"SslHandshake";
  case kSpdyConnectStateConnected:
    return @"Connected";
  case kSpdyConnectStateError:
    return @"Error";
  case kSpdyConnectStateGoAwaySubmitted:
    return @"Sent GoAway";
  case kSpdyConnectStateGoAwayReceived:
    return @"Got GoAway";
  case kSpdyConnectStateHostNotFound:
    return @"NO HOST";
  case kSpdyConnectStateStreamNotFound:
    return @"NO STREAM";
  }

  return @"Unknown";

}

+(NSString*)radioAccessString:(SpdyRadioAccessTechnology)status {
  switch(status) {
  case SpdyRadioAccessTechnologyNone:
    return @"None";
    break;
  case SpdyRadioAccessTechnologyGPRS:
    return @"GPRS";
    break;
  case SpdyRadioAccessTechnologyEdge:
    return @"Edge";
    break;
  case SpdyRadioAccessTechnologyWCDMA:
    return @"WCDMA";
    break;
  case SpdyRadioAccessTechnologyHSDPA:
    return @"HSDPA";
    break;
  case SpdyRadioAccessTechnologyHSUPA:
    return @"HSUPA";
    break;
  case SpdyRadioAccessTechnologyCDMA1x:
    return @"CDMA1x";
    break;
  case SpdyRadioAccessTechnologyCDMAEVDORev0:
    return @"CDMAEVDORev0";
    break;
  case SpdyRadioAccessTechnologyCDMAEVDORevA:
    return @"CDMAEVDORevA";
    break;
  case SpdyRadioAccessTechnologyCDMAEVDORevB:
    return @"CDMAEVDORevB";
    break;
  case SpdyRadioAccessTechnologyeHRPD:
    return @"eHRPD";
    break;
  case SpdyRadioAccessTechnologyLTE:
    return @"LTE";
    break;
  default:
  case SpdyRadioAccessTechnologyUnknown:
    return @"Unknown";
    break;
  }
}

+(NSString*)networkStatusString:(SpdyNetworkStatus)status {
  switch(status) {
  case kSpdyNetworkStatusNotReachable:
    return @"Not";
#if TARGET_OS_IPHONE
  case kSpdyNetworkStatusReachableViaWWAN:
    return @"WWAN";
  case kSpdyNetworkStatusReachableViaWiFi:
    return @"WIFI";
#else
  case kSpdyNetworkStatusReachable:
    return @"Reachable";
#endif
  case kSpdyNetworkStatusHostNotFound:
    return @"NO HOST";
  case kSpdyNetworkStatusStreamNotFound:
    return @"NO STREAM";
  }

  return @"Unknown";
}

@end

// Create a delegate derived class of SpdyCallback.  Create a context struct.
// Convert this to an objective-C object that derives from SpdyCallback.
@interface _SpdyCFStream : SpdyCallback {
    CFWriteStreamRef writeStreamPair;  // read() will write into writeStreamPair.
    unsigned long long requestBytesWritten;
};

@property (assign) BOOL opened;
@property (assign) int error;
@property (strong) SpdyInputStream *readStreamPair;

@end

@implementation _SpdyCFStream

@synthesize opened;
@synthesize error;
@synthesize readStreamPair;

- (_SpdyCFStream *)init:(CFAllocatorRef)a {
    self = [super init];

    CFReadStreamRef baseReadStream;
    CFStreamCreateBoundPair(a, &baseReadStream, &writeStreamPair, 16 * 1024);
    self.readStreamPair = [[SpdyInputStream alloc] init:(__bridge NSInputStream *)baseReadStream];
    self.opened = NO;
    requestBytesWritten = 0;
    return self;
}

- (void)dealloc {
    self.readStreamPair.requestId = nil;
    if ([self.readStreamPair streamStatus] != NSStreamStatusClosed) {
        [self.readStreamPair close];
    }
    if (CFWriteStreamGetStatus(writeStreamPair) != kCFStreamStatusClosed) {
        CFWriteStreamClose(writeStreamPair);
    }
    CFRelease(writeStreamPair);
}

- (void)setResponseHeaders:(CFHTTPMessageRef)h {

}

// Methods that implementors should override.
- (void)onConnect:(id<SpdyRequestIdentifier>)requestId {
    [self.readStreamPair setRequestId:requestId];
    CFWriteStreamOpen(writeStreamPair);
    self.opened = YES;
}

- (void)onRequestBytesSent:(NSInteger)bytesSend {
    requestBytesWritten += bytesSend;
    CFNumberRef totalBytes = CFNumberCreate(kCFAllocatorDefault, kCFNumberLongLongType, &requestBytesWritten);
    CFReadStreamSetProperty((CFReadStreamRef)readStreamPair, kCFStreamPropertyHTTPRequestBytesWrittenCount, totalBytes);
    CFRelease(totalBytes);
}

- (void)onResponseHeaders:(CFHTTPMessageRef)headers {
    CFReadStreamSetProperty((CFReadStreamRef)readStreamPair, kCFStreamPropertyHTTPResponseHeader, headers);
}

- (size_t)onResponseData:(const uint8_t *)bytes length:(size_t)length {
    // TODO(jim): Ensure that any errors from write() get transfered to the SpdyStream.
    return CFWriteStreamWrite(writeStreamPair, bytes, length);
}

- (void)onStreamClose {
    self.opened = NO;
    CFWriteStreamClose(writeStreamPair);
}

- (void)onNotSpdyError:(id<SpdyRequestIdentifier>)identifier {
    self.readStreamPair.error = [NSError errorWithDomain:kSpdyErrorDomain code:kSpdyConnectionNotSpdy userInfo:[NSDictionary dictionaryWithObject:[identifier url] forKey:@"url"]];
}

- (void)onError:(NSError *)error_code {
    self.readStreamPair.error = error_code;
    self.opened = NO;
}
@end

CFReadStreamRef SpdyCreateSpdyReadStream(CFAllocatorRef alloc, CFHTTPMessageRef requestHeaders, CFReadStreamRef requestBody) {
    _SpdyCFStream *ctx = [[_SpdyCFStream alloc] init:alloc];
    if (ctx) {
        SPDY *spdy = [SPDY sharedSPDY];
        [spdy fetchFromMessage:requestHeaders delegate:ctx body:(__bridge NSInputStream *)requestBody];
        return (CFReadStreamRef)CFBridgingRetain([ctx readStreamPair]);
     }
     return NULL;
}


text:
namespace fvc {

class KShiftingCondition {
public:
  KShiftingCondition(std::vector<KjGraph> graphs);

  int calculate_longest_shifting(std::map<int, int>& bounds) const;

  const std::map<int, int> *get_subsequent(int index) const;

  int get_width(int index) const;

private:

  int graph_count_;

  std::vector<std::map<int, int>> subsequent_;

  std::vector<int> widths_;

  std::map<int, utils::RBitmap> vc_bitmap_;

  utils::SBitmap vv_bitmap_;

  unsigned long default_mask_;

};

}

#endif //PVXMATCHING_FVC_KSHIFTINGCONDITION_HPP


text:
var net = require('net');

function Header(buf, version, type, length, xid) {
  if(buf) {
    this.version = buf.readUIntBE(0, 1);
    this.type    = buf.readUIntBE(1, 1);
    this.length  = buf.readUIntBE(2, 2);
    this.xid     = buf.readUIntBE(4, 4);
  } else {
    this.version = verson;
    this.type    = type;
    this.length  = length;
    this.xid     = xid;
  }
}

net.createServer(function(socket) {

  socket.on('connect', function(sk) {
    console.log('connected');
  });
  socket.on('data', function(data) {
    if(data.length >= 8) {
      var hdr = new Header(data);
      console.log(hdr);
      console.log(data.length);
    }
  });
  socket.on('close', function() {
    console.log('closed');
  });
}).listen(6633);


text:
layout:     post
title:      "Recall vs Precision"
subtitle:   "an alternative way to understand and remember recall and precision"
date:       2016-06-03 19:11:00 +0700
categories: articles
tags:       [machine learning, recall, precision]
author:     "Supasate Choochaisri"
header-img: "img/post-bg-01.jpg"
comments:   true
---

In machine learning, `recall` and `precision` are heavily used for measuring algorithm performance.

To make myself able to remember their meaning without thinking about `true positive/false positive/false negative` jargon, I conceptualize them as follows:

Imagine that, your girlfriend gave you a birthday surprise every year in last **10** years. (Sorry, I didn't intend to depress you if you don't have one.)

However, one day, your girlfriend asks you:

> 'Sweetie, do you remember all birthday surprises from me?'

This simple question makes your life in danger.

To extend your life, you need to **recall** all **10** surprising events from your memory.

So, `recall` is the ratio of a number of **events you can *correctly* recall** to a number of **all correct events**.

If you can recall all **10** events correctly, then, your recall ratio is **1.0** (**100%**). If you can recall **7** events correctly, your recall ratio is **0.7** (**70%**).

Now, it's easier to map the word `recall` to real life usage of that word.

However, you might be wrong in some answers.

For example, you answers **15** times, **10** events are correct and **5** events are wrong. This means you can recall all events but it's not so `precise`.

So, `precision` is the ratio of a number of **events you can *correctly* recall** to a number **all events you recall** *(mix of correct and wrong recalls)*. In other words, it is how precise of your recall.

From the previous example (10 real events, 15 answers: 10 correct answers, 5 wrong answers), you get **100%** recall but your precision is only **66.67%** (10 / 15).

Yes, you can guess what I'm going to say next. If a machine learning algorithm is good at `recall`, it doesn't mean that algorithm is good at `precision`. That's why we also need [`F1 score`](https://en.wikipedia.org/wiki/F1_score) which is the [*(harmonic)* mean](https://en.wikipedia.org/wiki/Harmonic_mean) of `recall` and `precision` to evaluate an algorithm.

Hope that this way of conceptualization could be an alternative way to help you understand and remember the difference between `recall` and `precision`.

---

**NOTE:**

>
A number of events you can correctly recall
  = True positive (they're correct and you recall them)
>
A number of all correct events
  = True positive (they're correct and you recall them)
    + False negative (they're correct but you don't recall them)
>
A number of all events you recall
  = True positive (they're correct and you recall them)
    + False positive (they're not correct but you recall them)
>
recall = True positive / (True positive + False negative)
>
precision = True positive / (True positive + False positive)


text:
<?php

class Google_Service_CloudKMS_CryptoKeyVersionTemplate extends Google_Model
{
  public $algorithm;
  public $protectionLevel;

  public function setAlgorithm($algorithm)
  {
    $this->algorithm = $algorithm;
  }
  public function getAlgorithm()
  {
    return $this->algorithm;
  }
  public function setProtectionLevel($protectionLevel)
  {
    $this->protectionLevel = $protectionLevel;
  }
  public function getProtectionLevel()
  {
    return $this->protectionLevel;
  }
}


text:
{% extends "results.html" %}
{% block body %}

Docker housekeeping

cleanup commands

Useful cleanup aliases

Keeping disk usage to a minimum

How docker stores files:

Location of docker images

    OS X

$HOME/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
       qcow is a file format for disk image files used by QEMU, a hosted virtual machine monitor.
       It stands for "QEMU Copy On Write" and uses a disk storage optimization strategy that delays
       allocation of storage until it is actually needed

    Linux

The contents of the /var/lib/docker directory vary depending on the driver Docker is using for storage.
By default this will be aufs.  RedHat chose devicemapper as thier driver.

You can manually set the storage driver with the -s or --storage-driver= option to the Docker daemon.

In the case of aufs:

/var/lib/docker/aufs/diff/<id> has the file contents of the images.
/var/lib/docker/repositories-aufs is a JSON file containing local image information. This can be viewed with the command docker images.

In the case of devicemapper:

/var/lib/docker/devicemapper/devicemapper/data stores the images
/var/lib/docker/devicemapper/devicemapper/metadata the metadata

cleanup commands

Delete one image

docker images <==to get repository/image_name
docker rmi -f repository/image_name

Kill all running containers

docker kill $(docker ps -q)

Delete all stopped containers (including data-only containers)

docker rm $(docker ps -a -q)

Delete all 'untagged/dangling' (<none>) images

docker rmi $(docker images -q -f dangling=true)

Delete ALL images

docker rmi $(docker images -q)

docker volume mgmt
 - Pre docker 1.9

docker volume ls -qf dangling=true | xargs -r docker volume rm

  Docker volume mgmt > 1.9

docker volume prune

cleanup aliases

# ~/.bash_aliases

# Kill all running containers.
alias dkrkillall='docker kill $(docker ps -q)'

# Delete all stopped containers.
alias dkrdelc='printf "\n>>> Deleting stopped containers\n\n" && docker rm $(docker ps -a -q)'

# Delete all untagged images.
alias dkrdeli='printf "\n>>> Deleting untagged images\n\n" && docker rmi $(docker images -q -f dangling=true)'

# Delete all stopped containers and untagged images.
alias dkrclean='dkrdelc || true && dkrdeli'

Keeping disk usage to a minimum

Most docker commands leave a disk trace behind, make a copy of something or replace an item without removing the previous version. Let's take a look at the most common ones:

docker pull and docker build create new docker images. Each layer is cached and uses aufs, so it decreases disk usage by itself, but it's also leaving previous versions / layers dangling.

You can remove untagged images by running:

OS X users: your version of xargs won't have the -r switch

so just skip it (you may encounter an error if there are no

images to clean up)

docker images --no-trunc | grep '<none>' | awk '{ print $3 }' \
   | xargs -r docker rmi

docker run leaves the container by default. This is convenient if you'd like to review the process later -- look at the logs or exit status. This also stores the aufs filesystem changes, so you can commit the container as a new image.

This can be expensive in terms of disk space usage, especially during testing. Remember to use docker run --rm flag if you don't need to inspect the container later. This flag doesn't work with background containers (-d), so you'll be left with finished containers anyway. Clean up dead and exited containers using command:

docker ps --filter status=dead --filter status=exited -aq \
 | xargs docker rm -v

docker rm does not remove the volumes created by the container. You need to use the -v flag to remove the volumes along the container.

Docker filesystem storage and volumes

By default, everything you save to disk inside the container is saved in the aufs layer. Clean up unused containers and images will take care of this.

If you mount a file or directory from the host (using docker run -v /host/path:/container/path …) the files are stored in the host filesystem, so it's easy to track them down.

A third way is using docker volumes. Those are special paths that are mapped to a special directory in /var/lib/docker/volumes/ path on the host. A lot of images use volumes to share files between containers (using the volumes-from option) or persist data so you won't lose them after the process exits (the data-only containers pattern).

A named volume referencing a volume plugin to vendor network storage rounds out the options.

{% endblock %}}


text:
import numpy as np
import preprocess
import logging
import math
import random
import io

logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger("fluid")
logger.setLevel(logging.INFO)

class NumpyRandomInt(object):
    def __init__(self, a, b, buf_size=1000):
        self.idx = 0
        self.buffer = np.random.random_integers(a, b, buf_size)
        self.a = a
        self.b = b

    def __call__(self):
        if self.idx == len(self.buffer):
            self.buffer = np.random.random_integers(self.a, self.b,
                                                    len(self.buffer))
            self.idx = 0

        result = self.buffer[self.idx]
        self.idx += 1
        return result

class Word2VecReader(object):
    def __init__(self,
                 dict_path,
                 data_path,
                 filelist,
                 trainer_id,
                 trainer_num,
                 window_size=5):
        self.window_size_ = window_size
        self.data_path_ = data_path
        self.filelist = filelist
        self.word_to_id_ = dict()
        self.id_to_word = dict()
        self.word_count = dict()
        self.trainer_id = trainer_id
        self.trainer_num = trainer_num

        word_all_count = 0
        id_counts = []
        word_id = 0

        with io.open(dict_path, 'r', encoding='utf-8') as f:
            for line in f:
                word, count = line.split()[0], int(line.split()[1])
                self.word_count[word] = count
                self.word_to_id_[word] = word_id
                self.id_to_word[word_id] = word  #build id to word dict
                word_id += 1
                id_counts.append(count)
                word_all_count += count

        self.word_all_count = word_all_count
        self.corpus_size_ = word_all_count
        self.dict_size = len(self.word_to_id_)
        self.id_counts_ = id_counts
        #write word2id file
        print("write word2id file to : " + dict_path + "_word_to_id_")
        with io.open(dict_path + "_word_to_id_", 'w+', encoding='utf-8') as f6:
            for k, v in self.word_to_id_.items():
                f6.write(k + " " + str(v) + '\n')

        print("corpus_size:", self.corpus_size_)
        self.id_frequencys = [
            float(count) / word_all_count for count in self.id_counts_
        ]
        print("dict_size = " + str(self.dict_size) + " word_all_count = " + str(
            word_all_count))

        self.random_generator = NumpyRandomInt(1, self.window_size_ + 1)

    def get_context_words(self, words, idx):
        """
        Get the context word list of target word.
        words: the words of the current line
        idx: input word index
        window_size: window size
        """
        target_window = self.random_generator()
        start_point = idx - target_window  # if (idx - target_window) > 0 else 0
        if start_point < 0:
            start_point = 0
        end_point = idx + target_window
        targets = words[start_point:idx] + words[idx + 1:end_point + 1]
        return targets

    def train(self):
        def nce_reader():
            for file in self.filelist:
                with io.open(
                        self.data_path_ + "/" + file, 'r',
                        encoding='utf-8') as f:
                    logger.info("running data in {}".format(self.data_path_ +
                                                            "/" + file))
                    count = 1
                    for line in f:
                        if self.trainer_id == count % self.trainer_num:
                            word_ids = [int(w) for w in line.split()]
                            for idx, target_id in enumerate(word_ids):
                                context_word_ids = self.get_context_words(
                                    word_ids, idx)
                                for context_id in context_word_ids:
                                    yield [target_id], [context_id]
                        count += 1

        return nce_reader


text:
int main(){
    TrainingPara trainingPara;
    trainingPara.discount = 0.99;
    trainingPara.learningRate = 0.1;
    trainingPara.maxIter = 50;
    trainingPara.numEpisodes = 1000;
    trainingPara.defaultBigValue = 100;
    trainingPara.targetState = State(1,1);
    int numActions = 4;
    std::string mapfile;
    Model model("map.txt");

    MultiGraph_QL g(numActions);

   RLSolver solver(model,g,trainingPara);
    solver.train();
    return 0;
}


text: module.exports.controller = require('./controller');