text:
@charset "UTF-8";
/* normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
html {
  font-family: sans-serif;
  line-height: 1.15;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
}
article,
aside,
footer,
header,
nav,
section {
  display: block;
}
h1 {
  font-size: 2em;
  margin: 0.67em 0;
}
figcaption,
figure,
main {
  display: block;
}
figure {
  margin: 1em 40px;
}
hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}
pre {
  font-family: monospace, monospace;
  font-size: 1em;
}
a {
  background-color: transparent;
  -webkit-text-decoration-skip: objects;
}
a:active,
a:hover {
  outline-width: 0;
}
abbr[title] {
  border-bottom: none;
  text-decoration: underline;
  text-decoration: underline dotted;
}
b,
strong {
  font-weight: inherit;
}
b,
strong {
  font-weight: bolder;
}
code,
kbd,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}
dfn {
  font-style: italic;
}
mark {
  background-color: #ff0;
  color: #000;
}
small {
  font-size: 80%;
}
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub {
  bottom: -0.25em;
}
sup {
  top: -0.5em;
}
audio,
video {
  display: inline-block;
}
audio:not([controls]) {
  display: none;
  height: 0;
}
img {
  border-style: none;
}
svg:not(:root) {
  overflow: hidden;
}
button,
input,
optgroup,
select,
textarea {
  font-family: sans-serif;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}
button,
input {
  overflow: visible;
}
button,
select {
  text-transform: none;
}
[type=reset],
[type=submit],
button,
html [type=button] {
  -webkit-appearance: button;
}
[type=button]::-moz-focus-inner,
[type=reset]::-moz-focus-inner,
[type=submit]::-moz-focus-inner,
button::-moz-focus-inner {
  border-style: none;
  padding: 0;
}
[type=button]:-moz-focusring,
[type=reset]:-moz-focusring,
[type=submit]:-moz-focusring,
button:-moz-focusring {
  outline: 1px dotted ButtonText;
}
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em;
}
legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
}
progress {
  display: inline-block;
  vertical-align: baseline;
}
textarea {
  overflow: auto;
}
[type=checkbox],
[type=radio] {
  box-sizing: border-box;
  padding: 0;
}
[type=number]::-webkit-inner-spin-button,
[type=number]::-webkit-outer-spin-button {
  height: auto;
}
[type=search] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}
[type=search]::-webkit-search-cancel-button,
[type=search]::-webkit-search-decoration {
  -webkit-appearance: none;
}
::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}
details,
menu {
  display: block;
}
summary {
  display: list-item;
}
canvas {
  display: inline-block;
}
template {
  display: none;
}
[hidden] {
  display: none;
}
* {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  transition-duration: 0.35s;
  -moz-transition-duration: 0.35s;
  -webkit-transition-duration: 0.35s;
  outline: none;
}
::-webkit-scrollbar {
  width: 6px;
  height: 1px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background-color: #f0f0f0;
}
::-webkit-scrollbar-thumb {
  background-color: #666;
}
::selection {
  background-color: #ddd;
}
::-webkit-selection {
  background-color: #ddd;
}
body {
  height: 0;
  -webkit-font-smoothing: antialiased;
}
a {
  -webkit-tap-highlight-color: transparent;
}
.highlight.html:after {
  content: "HTML";
}
.highlight.js:after {
  content: "JavaScript";
}
.highlight.ts:after {
  content: "TypeScript";
}
.highlight.bash:after {
  content: "BASH";
}
.highlight.sh:after {
  content: "Shell";
}
.highlight.css:after {
  content: "CSS";
}
.highlight.scss:after {
  content: "SCSS";
}
.highlight.diff:after {
  content: "Diff";
}
.highlight.java:after {
  content: "JAVA";
}
.highlight.xml:after {
  content: "XML";
}
.highlight.python:after {
  content: "Python";
}
.highlight.yml:after {
  content: "YAML";
}
.highlight.swift:after {
  content: "Swift";
}
.highlight.ruby:after {
  content: "Ruby";
}
.highlight.perl:after {
  content: "Perl";
}
.highlight.php:after {
  content: "PHP";
}
.highlight.c:after {
  content: "CLang";
}
.highlight.cpp:after {
  content: "C++";
}
.highlight.cs:after {
  content: "C#";
}
@-moz-keyframes indeterminate {
  from {
    left: -90%;
    right: 100%;
  }
  60% {
    left: -90%;
    right: 100%;
  }
  to {
    left: 100%;
    right: -35%;
  }
}
@-webkit-keyframes indeterminate {
  from {
    left: -90%;
    right: 100%;
  }
  60% {
    left: -90%;
    right: 100%;
  }
  to {
    left: 100%;
    right: -35%;
  }
}
@-o-keyframes indeterminate {
  from {
    left: -90%;
    right: 100%;
  }
  60% {
    left: -90%;
    right: 100%;
  }
  to {
    left: 100%;
    right: -35%;
  }
}
@keyframes indeterminate {
  from {
    left: -90%;
    right: 100%;
  }
  60% {
    left: -90%;
    right: 100%;
  }
  to {
    left: 100%;
    right: -35%;
  }
}
@-moz-keyframes indeterminate-short {
  from {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  to {
    left: 107%;
    right: -8%;
  }
}
@-webkit-keyframes indeterminate-short {
  from {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  to {
    left: 107%;
    right: -8%;
  }
}
@-o-keyframes indeterminate-short {
  from {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  to {
    left: 107%;
    right: -8%;
  }
}
@keyframes indeterminate-short {
  from {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  to {
    left: 107%;
    right: -8%;
  }
}
@font-face {
  font-family: "LedFont";
  font-style: normal;
  src: url("../font/lcd.ttf") format('truetype');
}
@font-face {
  font-family: "iconfont";
  src: url("../font/iconfont/iconfont.eot");
  src: url("../font/iconfont/iconfont.eot") format('embedded-opentype'), url("../font/iconfont/iconfont.woff") format('woff'), url("../font/iconfont/iconfont.ttf") format('truetype'), url("../font/iconfont/iconfont.svg") format('svg');
}
.iconfont {
  font-family: 'iconfont';
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}
.icon-mail:before {
  content: "\e694";
}
.icon-alipay:before {
  content: "\e695";
}
.icon-facebook:before {
  content: "\e696";
}
.icon-linkedin:before {
  content: "\e697";
}
.icon-ins:before {
  content: "\e698";
}
.icon-zhihu:before {
  content: "\e69a";
}
.icon-twitter:before {
  content: "\e69b";
}
.icon-weibo:before {
  content: "\e69e";
}
.icon-moments:before {
  content: "\e6a0";
}
.icon-right:after {
  content: "\e78b";
}
.icon-up:before {
  content: "\e7a8";
}
.icon-left:before {
  content: "\e833";
}
.icon-github:before {
  content: "\e6ed";
}
.icon-more:before {
  content: "\e652";
}
.icon-visit:before {
  content: "\e637";
}
.icon-people:before {
  content: "\e651";
}
.container {
  width: 800px;
  margin: 0 auto;
}
@media screen and (max-width: 800px) {
  .container {
    width: 100%;
  }
}
.main {
  margin: 24px auto;
}
.body {
  display: none;
}
.header {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
}
.header .table {
  display: table;
  height: 100%;
  width: 100%;
}
.header .table .connect {
  display: table-cell;
  vertical-align: middle;
}
.header .table .connect .connect-inner {
  box-sizing: border-box;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}
.header .table .connect .connect-inner span a {
  font-family: 'LedFont', cursive, 'Microsoft YaHei', sans-serif;
  font-weight: 300;
  font-size: 40px;
  color: #666;
  text-decoration: none;
}
.header .title {
  flex: 2;
  height: 100%;
  text-align: center;
  padding-right: 24px;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
.header #subtitle {
  font-size: 12px;
  margin-top: 8px;
}
.header .main-nav {
  flex: 3;
  text-align: center;
  padding-left: 24px;
}
.header .main-nav .menu {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 40px 0;
}
.header .main-nav .menu .menu-item {
  display: inline-table;
  margin: 0 16px;
}
.header .main-nav .menu .menu-item a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #666;
  font-size: 16px;
}
.header .main-nav .menu .menu-item a:hover {
  color: #000;
}
.header .main-nav .menu .menu-item .menu-item-label {
  font-size: 12px;
}
@media screen and (max-width: 800px) {
  .header .title {
    padding-right: 0;
  }
  .header .main-nav {
    padding-left: 0;
  }
  .header .menu {
    padding: 0;
  }
}
@media screen and (max-width: 650px) {
  .header .main-nav .menu {
    margin: 16px 0;
    padding: 0;
  }
  .header .main-nav .menu .menu-item {
    margin: 0 8px;
  }
  .header .main-nav .menu .menu-item a {
    font-size: 12px;
  }
}
@media screen and (max-width: 650px) {
  .header {
    height: inherit;
    display: block;
  }
}
.mobile-header {
  display: none;
}
@media screen and (max-width: 650px) {
  .mobile-header {
    z-index: 50;
    position: fixed;
    top: -300px;
    left: 0;
    right: 0;
    height: auto;
    box-shadow: 0px 2px 2px #c4c4c4;
    display: block;
  }
  .mobile-header .mobile-header-nav {
    background-color: #666;
    color: #fff;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 48px;
    height: 48px;
  }
  .mobile-header .mobile-header-nav .mobile-header-item {
    flex: 0.5;
    width: 100%;
    height: 100%;
    color: inherit;
  }
  .mobile-header .mobile-header-nav .mobile-header-item.item-clicked .header-menu-line {
    background-color: transparent;
  }
  .mobile-header .mobile-header-nav .mobile-header-item.item-clicked .header-menu-line:before {
    top: 0;
    transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
  }
  .mobile-header .mobile-header-nav .mobile-header-item.item-clicked .header-menu-line:after {
    top: 0;
    transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
  }
  .mobile-header .mobile-header-nav .mobile-header-title {
    flex: 3;
    text-align: center;
    margin: 0.2rem;
    color: inherit;
  }
  .mobile-header .mobile-header-nav .mobile-header-title a {
    font-family: 'LedFont', cursive, 'Microsoft YaHei', sans-serif;
    text-decoration: none;
    font-size: 32px;
    color: inherit;
    font-weight: 200;
    line-height: 1;
  }
  .mobile-header .mobile-header-body .mobile-header-list {
    background-color: #666;
    opacity: 0.9;
    box-sizing: border-box;
    padding: 8px 0;
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item {
    position: relative;
    box-sizing: border-box;
    padding: 8px 24px;
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item a {
    text-decoration: none;
    color: #fff;
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item .mobile-nav-tagcloud {
    position: absolute;
    overflow-x: auto;
    top: 8px;
    left: 24px;
    right: 24px;
    width: 80%;
    transform: translateX(120%);
    -ms-transform: translateX(120%);
    -moz-transform: translateX(120%);
    -webkit-transform: translateX(120%);
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item .mobile-nav-tagcloud .mobile-tagcloud-inner {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item .mobile-nav-tagcloud .mobile-tagcloud-inner a {
    margin: 0 4px;
  }
  .mobile-header .mobile-header-body .mobile-header-list .mobile-nav-item .mobile-nav-tagcloud .mobile-tagcloud-inner a:before {
    content: '#';
  }
  .header-menu-item {
    position: relative;
    padding: 0 12px;
    box-sizing: border-box;
    height: 100%;
  }
  .header-menu-item .header-menu-line {
    position: absolute;
    top: 50%;
    background-color: #fff;
    height: 1px;
    width: 24px;
  }
  .header-menu-item .header-menu-line:before {
    content: '';
    position: absolute;
    top: -6px;
    background-color: #fff;
    height: 1px;
    width: 24px;
    transition: transform 0.3s;
    -moz-transition: transform 0.3s;
    -webkit-transition: transform 0.3s;
    transition: top 0.3s;
    -moz-transition: top 0.3s;
    -webkit-transition: top 0.3s;
  }
  .header-menu-item .header-menu-line:after {
    content: '';
    position: absolute;
    top: 6px;
    background-color: #fff;
    height: 1px;
    width: 24px;
    transition-property: top, transform;
    transition-duration: 0.3s;
    -moz-transition-duration: 0.3s;
    -webkit-transition-duration: 0.3s;
  }
}
.posts {
  padding: 0 8px;
}
.post {
  position: relative;
  background-color: #fefefe;
  padding: 16px;
  margin-bottom: 16px;
}
.post:before {
  z-index: -1;
  content: '';
  width: 50px;
  height: 50px;
  background-color: #777;
  box-shadow: -1px -1px 1px #bbb;
  position: absolute;
  top: -1px;
  left: -1px;
  -webkit-animation: fadeIn 0.5s ease-in-out backwards 0.5s;
  animation: fadeIn 0.5s ease-in-out backwards 0.5s;
}
.post:after {
  z-index: -1;
  content: '';
  width: 50px;
  height: 50px;
  background-color: #777;
  box-shadow: 1px 1px 1px #bbb;
  position: absolute;
  bottom: -1px;
  right: -1px;
  -webkit-animation: fadeIn 0.5s ease-in-out backwards 0.5s;
  animation: fadeIn 0.5s ease-in-out backwards 0.5s;
}
.post .post-header {
  z-index: 10;
}
.post .post-header .post-time {
  padding-left: 16px;
  font-family: "Source Sans Pro", "Helvetica Neue";
  font-weight: 400;
  font-size: 14px;
  color: #666;
}
.post .post-header .post-time .post-category {
  font-size: inherit;
}
.post .post-header .post-time .post-category a {
  text-decoration: none;
  color: #666;
}
.post .post-header .post-time .post-category:before {
  content: ' · ';
}
.post .post-header .post-title {
  margin: 0;
  padding: 5px 0;
  font-weight: 300;
  font-size: 28px;
}
.post .post-header .post-title a {
  text-decoration: none;
  color: #000;
}
@media screen and (max-width: 650px) {
  .post .post-header .post-time {
    font-size: 12px;
  }
  .post .post-header .post-title {
    font-size: 20px;
  }
}
@media screen and (max-width: 800px) {
  .post {
    margin: 8px;
  }
}
@media screen and (max-width: 650px) {
  .post {
    margin: 8px;
    padding: 8px;
  }
}
.post-content h1 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h1:before {
  content: '∮ ';
}
.post-content h2 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h2:before {
  content: '∮ ';
}
.post-content h3 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h3:before {
  content: '∮ ';
}
.post-content h4 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h4:before {
  content: '∮ ';
}
.post-content h5 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h5:before {
  content: '∮ ';
}
.post-content h6 {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  font-weight: 400;
  margin: 16px 0;
}
.post-content h6:before {
  content: '∮ ';
}
.post-content a {
  color: #666;
  text-decoration: underline;
}
.post-content a:hover {
  color: #000;
}
.post-content p {
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
  margin: 8px 0;
  line-height: 1.5em;
  font-weight: 400;
}
.post-content code {
  border: 1px solid #999;
  background-color: #f0f0f0;
  padding: 0 4px;
  margin: 0 4px;
  font-size: 13px;
  font-family: 'Menlo';
}
.post-content strong {
  font-weight: bold;
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
}
.post-content i {
  font-weight: 100;
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
}
.post-content img {
  max-width: 100%;
  display: inline;
}
@media screen and (max-width: 650px) {
  .post-content {
    font-size: 14px;
  }
}
.content-link {
  margin: 8px 0;
  display: inline-block;
}
.content-link:hover {
  transform: translateX(10%);
  -ms-transform: translateX(10%);
  -moz-transform: translateX(10%);
  -webkit-transform: translateX(10%);
}
.content-link a {
  color: #666;
  text-decoration: none;
}
.content-link a:hover {
  color: #000;
}
.post-tags {
  display: inline-block;
  padding: 4px 16px;
  font-size: 12px;
  border-bottom: 1px solid #ddd;
}
.post-tags a {
  text-decoration: none;
  color: #666;
  margin: 0 4px;
}
.post-tags a:before {
  content: '#';
}
.post-tags a:hover {
  color: #000;
}
blockquote {
  position: relative;
  margin: 8px 8px;
  padding: 8px 16px;
  background-color: #f0f0f0;
  border-left: 5px solid #999;
}
blockquote:before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 16px 16px 0;
  border-color: #fff #fff transparent transparent;
  background: transparent;
  border-style: solid;
  width: 0;
  box-shadow: -1px 1px 1px #ddd;
}
blockquote p {
  margin: 0;
  font-family: 'Avenir Next', 'Optima', 'PingFang SC', 'Roboto', 'Noto SansCJK', 'Helvetica Neue', 'Helvetica', "微软雅黑", "YaHei-Consolas-Hybrid", sans-serif;
}
.archive {
  margin: 0 48px;
}
.archive .archive-title {
  display: inline-block;
  margin: 0;
  font-family: Athelas, "PingFang SC", serif;
  font-weight: 300;
  color: #666;
}
.archive .archive-num {
  margin: 8px;
  font-weight: 100;
}
.archive .archive-name {
  font-family: Athelas, "PingFang SC", serif;
  font-weight: 300;
}
.archive .archive-list .archive-year {
  font-family: Athelas, "PingFang SC", serif;
  font-weight: 100;
}
.archive .archive-list ul {
  list-style: none;
  padding: 0;
}
.archive .archive-list .archive-post {
  border-left: 1px solid #ddd;
  padding: 0 8px;
}
.archive .archive-list .archive-post:hover {
  padding: 0 16px;
  background-color: $main-back;
  border-left: 3px solid #666;
  border-right: 3px solid #666;
}
.archive .archive-list .archive-post-time {
  font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  color: #999;
}
.archive .archive-list .archive-post-link {
  display: inline-block;
  line-height: 1.5em;
}
.archive .archive-list .archive-post-link a {
  margin: 0 8px;
  text-decoration: none;
  color: #666;
}
.archive .archive-list .archive-post-link a:hover {
  color: #000;
}
.pagination {
  width: 80%;
  margin: 24px auto;
  font-weight: 500;
}
.pagination .page-number {
  display: none;
}
.pagination:before,
.pagination:after,
.article-page:after {
  content: '';
  display: table;
}
.pagination:after {
  clear: both;
}
.pagination .extend {
  text-decoration: none;
  color: #666;
  font-size: 18px;
}
.pagination .extend.next {
  float: right;
}
.pagination .extend.next:hover {
  color: #000;
  transform: translateX(10%);
  -ms-transform: translateX(10%);
  -moz-transform: translateX(10%);
  -webkit-transform: translateX(10%);
}
.pagination .extend.prev {
  float: left;
}
.pagination .extend.prev:hover {
  color: #000;
  transform: translateX(-10%);
  -ms-transform: translateX(-10%);
  -moz-transform: translateX(-10%);
  -webkit-transform: translateX(-10%);
}
@media screen and (max-width: 650px) {
  .pagination .extend {
    font-size: 14px;
  }
}
.article-page {
  width: 80%;
  margin: 24px auto;
  font-weight: 300;
}
@media screen and (max-width: 650px) {
  .article-page {
    text-align: center;
  }
}
.article-page a {
  text-decoration: none;
  color: #666;
  font-size: 16px;
}
@media screen and (max-width: 650px) {
  .article-page a {
    font-size: 12px;
  }
}
.article-page a:hover {
  color: #000;
}
.article-page .next-title i,
.article-page .prev-title i {
  vertical-align: middle;
}
.article-page:before {
  content: '';
  display: table;
}
.article-page:after {
  clear: both;
}
.article-page .art-right {
  float: right;
}
@media screen and (max-width: 650px) {
  .article-page .art-right {
    float: none;
    display: block;
    margin-bottom: 16px;
  }
}
.article-page .art-right:hover {
  transform: translateX(10%);
  -ms-transform: translateX(10%);
  -moz-transform: translateX(10%);
  -webkit-transform: translateX(10%);
}
.article-page .art-left {
  float: left;
}
@media screen and (max-width: 650px) {
  .article-page .art-left {
    float: none;
    display: block;
    margin-top: 16px;
  }
}
.article-page .art-left:hover {
  transform: translateX(-10%);
  -ms-transform: translateX(-10%);
  -moz-transform: translateX(-10%);
  -webkit-transform: translateX(-10%);
}
.footer {
  margin: 8px 0;
  width: 100%;
  height: 100%;
}
.footer hr {
  border: none;
  height: 1px;
  background-color: #666;
  background-image: -webkit-linear-gradient(0deg, #fff, #666, #fff);
}
.footer .footer-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
}
@media screen and (max-width: 650px) {
  .footer .footer-wrapper {
    flex-direction: column;
  }
}
.footer .left {
  flex: 1;
  padding: 16px;
  border-right: 1px solid #ddd;
  border-image: -webkit-linear-gradient(#fff, #ddd, #fff) 0 10 0 0;
}
@media screen and (max-width: 650px) {
  .footer .left {
    border: none;
    padding: 8px;
  }
}
.footer .left .contact-icon {
  display: flex;
  justify-content: center;
}
.footer .left .contact-icon a {
  margin: 4px 8px;
  text-decoration: none;
  color: #666;
  font-size: 26px;
}
.footer .left .icon-github:hover {
  color: #24292e;
}
.footer .left .icon-weibo:hover {
  color: #e6162d;
}
.footer .left .icon-twitter:hover {
  color: #1ab2e8;
}
.footer .left .icon-zhihu:hover {
  color: #0767c8;
}
.footer .left .icon-linkedin:hover {
  color: #5290bc;
}
.footer .left .icon-facebook:hover {
  color: #4e69a2;
}
.footer .left .icon-ins:hover {
  color: #d10869;
}
.footer .right {
  flex: 2;
  display: block;
  padding: 16px;
}
@media screen and (max-width: 650px) {
  .footer .right {
    padding: 8px;
  }
}
.footer .right .copyright {
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
}
.footer .right .copyright span {
  color: #666;
  font-size: 11px;
}
.footer .right .copyright a {
  font-family: Arial;
  text-decoration: none;
  color: #666;
}
.footer .right .copyright a:hover {
  color: #000;
  text-decoration: underline;
}
.footer .visit_count {
  color: #666;
  display: flex;
  align-items: center;
}
.footer .visit_count .iconfont {
  font-size: 14px;
}
.footer .visit_count span {
  margin: 4px 4px;
}
.about {
  padding: 16px 56px;
  font-family: Athelas, "PingFang SC", serif;
  font-weight: 300;
}
.about .title {
  font-family: Athelas, "PingFang SC", serif;
  font-weight: 300;
}
.about .content {
  padding: 8px 16px;
}
.about p {
  line-height: 1.5em;
}
.copy-line {
  border: none;
  border-bottom: 2px dashed #ddd;
  height: 16px;
}
.post-copyright .copy-author,
.post-copyright .copy-url,
.post-copyright .copy-origin,
.post-copyright .copy-license {
  margin: 8px 8px;
  font-family: "Open Sans", sans-serif;
  font-weight: 300;
  font-size: 14px;
}
.post-copyright .copy-author a,
.post-copyright .copy-url a,
.post-copyright .copy-origin a,
.post-copyright .copy-license a {
  color: #666;
}
.post-copyright .copy-author a:hover,
.post-copyright .copy-url a:hover,
.post-copyright .copy-origin a:hover,
.post-copyright .copy-license a:hover {
  color: #000;
}
.post-reward {
  width: 100%;
}
.post-reward .reward-btn {
  display: block;
  margin: 8px auto;
  padding: 8px;
  text-align: center;
  border: 1px solid #666;
  width: 48px;
  border-radius: 8px;
}
.post-reward .reward-btn:hover {
  color: #fff;
  background-color: #666;
  cursor: pointer;
}
.post-reward .reward-wrapper {
  margin: 24px 0;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}
.post-reward .reward-wrapper .reward-item {
  margin: 0 2%;
}
.post-reward .reward-wrapper img {
  width: 150px;
  height: 150px;
}
.post-toc {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  width: 200px;
  margin: auto 40px auto 0;
  border: none;
  line-height: 1.5rem;
  word-wrap: break-word;
  box-sizing: border-box;
}
.post-toc .toc-inner {
  height: 80%;
  overflow: auto;
  white-space: nowrap;
  padding: 8px;
}
.post-toc .toc-inner::-webkit-scrollbar {
  width: 1px;
  height: 1px;
}
.post-toc ol {
  list-style: none;
  padding-left: 16px;
}
.post-toc .title {
  display: block;
  margin: 0 auto;
  text-align: center;
  width: 50%;
  position: relative;
}
.post-toc .title:before {
  content: '';
  position: absolute;
  height: 1px;
  bottom: 0;
  left: 0;
  right: 100%;
  background: #999;
  transition-property: right;
  animation: lane-right 0.35s linear both;
}
.post-toc .title-link {
  list-style: none;
  margin-top: 16px;
}
.post-toc .title-link a {
  text-decoration: none;
  color: #666;
  padding: 0 8px;
  font-size: 14px;
}
.post-toc .title-link a.active {
  border-left: 2px solid #666;
}
.post-toc .toc {
  margin: 0;
  padding: 0;
  list-style: none;
}
.post-toc .toc .toc-item {
  color: #666;
}
.post-toc .toc .toc-item .toc-link {
  color: #666;
  text-decoration: none;
  padding: 0 8px;
  font-size: 14px;
}
.post-toc .toc .toc-item .toc-link.active {
  border-left: 2px solid #666;
}
@media screen and (max-width: 650px) {
  .post-toc {
    display: none;
  }
}
@media screen and (max-width: 800px) {
  .post-toc {
    display: none;
  }
}
@-moz-keyframes lane-right {
  from {
    right: 100%;
  }
  to {
    right: 0;
  }
}
@-webkit-keyframes lane-right {
  from {
    right: 100%;
  }
  to {
    right: 0;
  }
}
@-o-keyframes lane-right {
  from {
    right: 100%;
  }
  to {
    right: 0;
  }
}
@keyframes lane-right {
  from {
    right: 100%;
  }
  to {
    right: 0;
  }
}
.highlight {
  position: relative;
  background-color: #f7f7f7;
  width: 100%;
  margin: 8px 0;
  overflow-x: auto;
}
.highlight:after {
  content: 'plain';
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-weight: 100;
  color: #ddd;
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 8px;
}
.highlight table {
  position: relative;
}
.highlight pre {
  font-family: 'Menlo';
}
.highlight .gutter {
  width: 10px;
  color: #bbb;
}
.highlight .gutter pre {
  padding: 0 8px;
}
.highlight .code {
  color: #2c2c2c;
}
.highlight .code pre {
  padding: 0 8px;
}
.highlight .code pre span {
  font-family: 'Menlo';
  font-size: 13px;
}
.highlight .line {
  height: 1.5em;
}
.highlight tr,
.highlight td {
  margin: 0;
}
.highlight .code .comment,
.highlight .code .quote {
  color: #a1a4aa;
}
.highlight .code .keyword,
.highlight .code .selector-tag,
.highlight .code .addition {
  color: #c678dd;
}
.highlight .code .number,
.highlight .code .string,
.highlight .code .meta .meta-string,
.highlight .code .literal,
.highlight .code .doctag,
.highlight .code .regexp {
  color: #d19a66;
}
.highlight .code .title,
.highlight .code .section,
.highlight .code .name,
.highlight .code .selector-id,
.highlight .code .selector-class {
  color: #e06c75;
}
.highlight .code .attribute,
.highlight .code .attr,
.highlight .code .variable,
.highlight .code .template-variable,
.highlight .code .class .title,
.highlight .code .type {
  color: #61aeee;
}
.highlight .code .symbol,
.highlight .code .bullet,
.highlight .code .subst,
.highlight .code .meta,
.highlight .code .meta .keyword,
.highlight .code .selector-attr,
.highlight .code .selector-pseudo,
.highlight .code .link {
  color: #cb4b16;
}
.highlight .code .built_in,
.highlight .code .deletion {
  color: #e6c07b;
}
.highlight .code .params {
  color: #5799de;
}
.show-tag {
  transform: translateY(0px);
  -ms-transform: translateY(0px);
  -moz-transform: translateY(0px);
  -webkit-transform: translateY(0px);
}
.tagcloud {
  z-index: 500;
  position: absolute;
  transform: translateY(-120px);
  -ms-transform: translateY(-120px);
  -moz-transform: translateY(-120px);
  -webkit-transform: translateY(-120px);
  display: block;
  width: 100%;
  min-height: 120px;
  text-align: center;
  box-sizing: border-box;
  background-color: #666;
  border-bottom: 3px solid #666;
  box-shadow: inset 0px -8px 10px 0px #585858;
}
.tagcloud-mask {
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  transition: background 0.3s backwards 0.1s;
  -moz-transition: background 0.3s backwards 0.1s;
  -webkit-transition: background 0.3s backwards 0.1s;
}
.tagcloud-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-flow: row wrap;
  min-height: inherit;
  width: 100%;
  height: 100%;
}
.tagcloud-inner a {
  flex: 0 0 17%;
  text-decoration: none;
  color: #fff;
}
.tagcloud-inner a:before {
  content: '#';
}
.tagcloud-inner a:hover {
  text-shadow: 1px 1px 1px #fff;
}
@media screen and (max-width: 650px) {
  .tagcloud .tagcloud-inner {
    justify-content: center;
  }
  .tagcloud .tagcloud-inner a {
    font-size: 9px !important;
  }
}
.backtop {
  display: flex;
  flex-direction: column;
  z-index: 10;
  position: fixed;
  bottom: 32px;
  right: 32px;
}
.backtop:hover {
  -webkit-animation-name: float-in;
  animation-name: float-in;
  -webkit-animation-duration: 2.33s;
  animation-duration: 2.33s;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
}
.backtop i {
  font-size: 24px;
  font-weight: 100;
}
.progress .progress-inner {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  background-color: transparent;
  height: 3px;
  width: 100%;
}
.progress .progress-inner:before {
  content: '';
  height: inherit;
  position: absolute;
  width: auto;
  will-change: left right;
  background: #666;
  -webkit-animation: indeterminate 2.2s ease-out infinite;
  animation: indeterminate 2.2s ease-out infinite;
}
.progress .progress-inner:after {
  content: '';
  height: inherit;
  position: absolute;
  width: auto;
  will-change: left right;
  background: #666;
  -webkit-animation: indeterminate-short 2.2s ease-out infinite;
  animation: indeterminate-short 2.2s ease-out infinite;
}
.search {
  display: none;
}
.search .slide {
  transform: translateY(-100px);
  -ms-transform: translateY(-100px);
  -moz-transform: translateY(-100px);
  -webkit-transform: translateY(-100px);
}
.search .mask {
  position: fixed;
  z-index: 500;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
}
.search .search-wrapper {
  background: transparent;
  width: 100%;
  max-width: 100%;
  position: absolute;
  top: 20%;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.search .search-wrapper h1 {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  color: #fff;
  font-weight: 100;
  font-size: 3.6rem;
}
@media screen and (max-width: 800px) {
  .search .search-wrapper h1 {
    font-size: 3rem;
  }
}
@media screen and (max-width: 650px) {
  .search .search-wrapper h1 {
    font-size: 1.2rem;
  }
}
.search .search-wrapper input {
  width: 800px;
  height: 60px;
  outline: none;
  border: none;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  font-size: 32px;
  padding: 8px;
  font-weight: 100;
}
@media screen and (max-width: 800px) {
  .search .search-wrapper input {
    width: 570px;
    font-size: 24px;
  }
}
@media screen and (max-width: 650px) {
  .search .search-wrapper input {
    width: 230px;
    font-size: 18px;
    height: 24px;
  }
}
.search #local-search-result {
  background-color: rgba(0,0,0,0.2);
}
@media screen and (max-width: 800px) {
  .search #local-search-result {
    width: 590px;
  }
}
@media screen and (max-width: 650px) {
  .search #local-search-result {
    width: 100%;
  }
}
.search #local-search-result .search-result-list {
  font-weight: 300;
  list-style: none;
  width: 800px;
  color: #fff;
  padding: 8px;
}
@media screen and (max-width: 800px) {
  .search #local-search-result .search-result-list {
    width: auto;
  }
}
.search #local-search-result .search-result-list .search-result-title {
  color: #fff;
  text-decoration: none;
  font-weight: 400;
}
.search #local-search-result .search-result-list .search-keyword {
  font-weight: 400;
}
.search #local-search-result .search-result-list .search-result-item {
  padding: 8px;
  border-top: 1px solid #707070;
}
.search #local-search-result .search-result-list .search-result-item:hover {
  background-color: rgba(0,0,0,0.2);
}
.search .end-line {
  border: none;
  border-top: 1px dashed #fff;
}


text:
"""empty message

Revision ID: a2677e70d93c
Revises: 1b366d9bd057
Create Date: 2017-08-15 18:11:28.932011

"""
from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision = 'a2677e70d93c'
down_revision = '1b366d9bd057'
branch_labels = None
depends_on = None

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=False),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('user',
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=False),
    sa.Column('password', sa.String(length=120), nullable=False),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('last_login_at', sa.DateTime(), nullable=True),
    sa.Column('current_login_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('roles_users',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    # ### end Alembic commands ###

def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('roles_users')
    op.drop_table('user')
    op.drop_table('role')
    # ### end Alembic commands ###

redpajama_set_name: RedPajamaGithub


text:
function initTimeline($scope) {
   /* setInterval(function() {
        var ichecks = $('input[type="checkbox"].flat-red, input[type="radio"].flat-red');
        ichecks.iCheck({
            checkboxClass: 'icheckbox_flat-red',
            radioClass: 'iradio_flat-red',
            disabledClass: 'non-clickable'
        });
    }, 300); */
}


text:
layout: post
title: Curriculum vitae
---

* Do not remove this line (it will not be displayed)
{:toc}

Web developer and Experienced software test engineer with excellent test automation background working on high profile projects within HM Land Registry.

## Skills

* Good Knowledge of Python using the Flask framework, with experience of using Django
* Knowledge of Ruby, experience of using the Sinatra and Rails frameworks
* Expert level Cucumber/Ruby Test Automation:
    * Leading BDD implementation in a team
    * Solid Gherkin skills
    * Experience in creating living documentation which logs the user stories and behavioural scenarios of the users
* Experience in using HTML, CSS and JavaScript for frontend development
* Excellent Knowledge of web accessibility implementation and testing using WCAG standards
* Experienced in User Testing, extracting requirements and user needs and implementing them
* Good knowledge of SOAP and RESTful API's
* Version control with Git and Subversion using various branching workflows such GitFlow, Feature Branch)
* Knowledge of DevOps practices:
    * Using TravisCI and Jenkins
    * Using Vagrant to provision my local development environments
    * Experience in using Heroku to deploy and monitor services
* Good Knowledge of SQL and dealing with databases such as IBM DB2 and Postgres in both automated testing and development
* Expert level in traditional testing skills such as:
	* Requirements analysis
	* Manual and Exploratory testing
   * Getting all aspects of the team to communicate and have an overall understanding of requirements/user stories, with consistent language usable by all the team
    * Experience in using Gatling with Scala for automated performance testing

## Current project
**Find property information**

* Developed parts of the micro service using Python and Flask implementing databases, queues, frontends and API's.  Additionally completed a variety of tasks to support the team in achieving the beta release.

* Leading the use of BDD in one of the Land Registry's first agile projects.  Developed the automated test library using Ruby and Cucumber.  This was implemented to run against the Property Search Information micro services in a vagrant dev environment, held in GitHub and ran in an integration environment using Jenkins for automation.

## Past projects

**Virtual Post Room (VPR)**

* Worked on developing an automated test suite for our business e-services using SoapUI.

**Training and Skills (TRILL)**

* Developed the alpha of the Training and Skills application that would help record peoples skills and training allowing for easier resource management and training requests.  This was written in Ruby on Rails.

**Local Land Charges Pilot**

* Was one of the first agile teams working on pilot that helped the Land Registry to learn more about Local Land Charges.  The project was written in Ruby and was my first implementation of Automated tests using Cucumber.

## Employment

**HM Land Registry**
Software test engineer
(_Nov 2011 - Ongoing_)

**HM Land Registry**
Tester
(_Sept 2007 - Nov 2011_)

## Qualifications

**ISEB**

* ISEB Foundation in Software Testing
* ISEB Intermediate in Software Testing
* ISEB Foundation in Business Analysis

## Education

**University of Lincoln**
(_Sep 2004 - Jun 2007_)
BSc Software Development (Games Computing)


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

namespace Labo2
{
    public static class Comm
    {
        public static void commSendTT(Intracommunicator comm, Tuple<Tuple<int, int>, double> stubNew, int target, int tag)
        {
            //ConsoleWriteLine(tag);
            string s = stubNew.Item1.Item1 + ";" + stubNew.Item1.Item2 + "," + stubNew.Item2;

            ConsoleWriteLine($"{comm.Rank} try send TT to {target} - {s}");
            comm.Send<string>(s, target, tag);
            ConsoleWriteLine($"{comm.Rank} did send TT to {target} - {s}");

        }

        public static (Board, CompletedStatus) commRecvB(Intracommunicator comm)
        {
            ConsoleWriteLine($"{comm.Rank} try get B");
            comm.Receive<string>(Communicator.anySource, Communicator.anyTag, out string value, out CompletedStatus status);
            ConsoleWriteLine($"{comm.Rank} did get B - {value.Replace("\n", "")}");

            var b = Board.Parse(value);
            return (b, status);
        }

        public static (Tuple<int,int>, CompletedStatus) commRecvT(Intracommunicator comm)
        {
            ConsoleWriteLine($"{comm.Rank} try get T");
            comm.Receive<string>(Communicator.anySource, Communicator.anyTag, out string value, out CompletedStatus status);
            ConsoleWriteLine($"{comm.Rank} did get T - {value}");

            var v = value.Split(',');
            var t = Tuple.Create(int.Parse(v[0]), int.Parse(v[1]));
            return (t, status);
        }

        public static (Tuple<Tuple<int,int>, double>, CompletedStatus) commRecvTT(Intracommunicator comm)
        {
            string valueO;
            CompletedStatus status;

            try
            {
                ConsoleWriteLine($"{comm.Rank} try get TT");
                comm.Receive<string>(Communicator.anySource, Communicator.anyTag, out valueO, out status);
                ConsoleWriteLine($"{comm.Rank} did get TT - {valueO}");
            }
            catch (Exception e)
            {
                //Debugger.Launch();
                Console.WriteLine("exception at " + comm.Rank);
                throw e;
            }

            var value = valueO as string;

            var v = value.Split(',');
            var vv = v[0].Split(';');

            var t = Tuple.Create(Tuple.Create(int.Parse(vv[0]), int.Parse(vv[1])), double.Parse(v[1]));
            return (t, status);
        }

        public static void commSendB(Intracommunicator comm, Board stubNew, int target, int tag)
        {
            //ConsoleWriteLine(tag);
            string s = stubNew.ToString();

            ConsoleWriteLine($"{comm.Rank} try send B to {target} - {s.Replace("\n", "")}");
            comm.Send<string>(s, target, tag);
            ConsoleWriteLine($"{comm.Rank} did send B to {target} - {s.Replace("\n", "")}");
        }

        public static void commSendT(Intracommunicator comm, Tuple<int, int> stubNew, int target, int tag)
        {
            //ConsoleWriteLine(tag);
            string s = stubNew.Item1 + "," + stubNew.Item2;

            ConsoleWriteLine($"{comm.Rank} try send T to {target} - {s}");
            comm.Send<string>(s, target, tag);
            ConsoleWriteLine($"{comm.Rank} did send T to {target} - {s}");
        }

        public static void ConsoleWriteLine(string v)
        {
            //Console.WriteLine(v);
        }
    }
}


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

class Migration_tags extends CI_Migration
{
	public function up()
	{
		$this->db->query('CREATE TABLE IF NOT EXISTS `tags` ( `tag_id` INT(11) NOT NULL AUTO_INCREMENT ,
		`tag_name` VARCHAR(255) NOT NULL ,
		PRIMARY KEY (`tag_id`))
		ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci;');

		$this->db->query("INSERT INTO `tags` (`tag_id`, `tag_name`) VALUES
		('1', 'наука'),
		('2', 'китай'),
		('3', 'іт'),
		('4', 'медицина'),
		('5', 'коти');");
	}

	public function down()
	{
		$this->db->query("TRUNCATE TABLE `tags`");//очищення
        $this->db->query("DROP TABLE IF EXISTS `tags`");//видаленн¤ таблиці
	}
}


text:
"""
Code related to providing parameters following certain patterns.
"""
__authors__ = "Nicu Tofan"
__copyright__ = "Copyright 2015, Nicu Tofan"
__credits__ = ["Nicu Tofan"]
__license__ = "3-clause BSD"
__maintainer__ = "Nicu Tofan"
__email__ = "nicu.tofan@gmail.com"

from pylearn2.utils.rng import make_np_rng

class ParamStore(object):
    """
    Stores valid ranges for parameters and returns them according to plan.

    Following modes are defined:

    - rand_one: keep all parameters fixed except one that gets its value
      randomly from a list of possible values; on next iteration another
      parameter will get its value changed in the same way;
    - rand_all: change the values for all parameters on all passes, each
      according to its list of possible values;
    - seq_one: keep all parameters fixed except one that gets its value
      sequentially from its list of possible values
    - seq_all: change the values for all parameters on all passes; each
      parameter takes next value from its list of possible values.

    Assume two parameters (color and size) with following list of
    possible values:

    - color: white, red, green, blue, black
    - size: 1, 2, 3

    In this example:

    =========  =======  =======  =======  =======
      Mode        I       II       III      IV
    =========  =======  =======  =======  =======
    rand_one:  red/3    red/1    black/1  black/2
    rand_all:  white/3  red/1    blue/1   red/2
    seq_one:   white/1  white/2  red/2    green/2
    seq_all:   white/1  red/2    green/4  blue/1
    =========  =======  =======  =======  =======

    Parameters
    ----------
    parameters : list of lists
        Top level list contains one list for each parameter. Constituent
        lists are valid values for that particular parameter.
    mode : str, optional
        Indicates the way this instance is going to spit parameters.
    rng : RNG object or integer or list of integers, optional
        Used to generate random indices with ``rand_`` modes.
    """
    def __init__(self, parameters, mode=None, rng=None):
        if mode is None:
            mode = 'rand_one'
        #: the list of valid values for parameters
        self.parameters = []
        for par in parameters:
            self.parameters.append(tuple(par))
        #: mode used to generate ext set of parameters
        self.mode = mode
        #: random number generator
        self.rng = make_np_rng(rng, which_method="random_integers")
        #: index of current parameter (used with ``_one`` variants)
        self.param_idx = None

        super(ParamStore, self).__init__()
        self.reset()

    def reset(self, mode=None):
        """
        Sets initial status.

        Parameters
        ----------
        mode : str, optional
            Indicates the way this instance is going to spit parameters.
            By default previous mode is used.
        """
        if not mode is None:
            self.mode = mode
        self.param_idx = 0
        self.crt_status = []
        # make sure we use first value in seq_all
        if self.mode == 'seq_all':
            init_crt = -1
        else:
            init_crt = 0
        for i in range(len(self.parameters)):
            self.crt_status.append(init_crt)
        # make sure we use first value in seq_one
        if self.mode == 'seq_one':
            self.crt_status[self.param_idx] = -1

    def next_seq_all(self):
        """
        Returns next value for all parameters.

        A parameter that reaches the end of its spectrum will be reset
        to first position.
        """
        result = []
        for i in range(len(self.parameters)):
            self.crt_status[i] = self.crt_status[i] + 1
            if self.crt_status[i] >= len(self.parameters[i]):
                self.crt_status[i] = 0
            result.append(self.parameters[i][self.crt_status[i]])
        return tuple(result)

    def next_seq_one(self):
        """
        Returns next value for one parameter while keeping others fixed.

        A parameter that reaches the end of its spectrum will be reset
        to first position.
        """
        result = []
        for i in range(len(self.parameters)):
            if i == self.param_idx:
                self.crt_status[i] = self.crt_status[i] + 1
                if self.crt_status[i] >= len(self.parameters[i]):
                    self.crt_status[i] = 0
            result.append(self.parameters[i][self.crt_status[i]])

        # update the parameter that will be chenged next time
        self.param_idx = self.param_idx + 1
        if self.param_idx >= len(self.parameters):
            self.param_idx = 0
        return tuple(result)

    def next_rnd_all(self):
        """
        Returns a random value fopr all parameters
        """
        result = []
        for i in range(len(self.parameters)):
            high = len(self.parameters[i])-1
            self.crt_status[i] = self.rng.random_integers(low=0,
                                                          high=high,
                                                          size=1)
            result.append(self.parameters[i][self.crt_status[i]])
        return tuple(result)

    def next_rnd_one(self):
        """
        Returns a random value for one parameter while keeping others fixed.
        """
        result = []
        for i in range(len(self.parameters)):
            if i == self.param_idx:
                high = len(self.parameters[i])-1
                self.crt_status[i] = self.rng.random_integers(low=0,
                                                              high=high,
                                                              size=1)
            result.append(self.parameters[i][self.crt_status[i]])

        # update the parameter that will be chenged next time
        self.param_idx = self.param_idx + 1
        if self.param_idx >= len(self.parameters):
            self.param_idx = 0
        return tuple(result)

    def next(self):
        """
        Retreive next set of parameters according to internal mode.
        """
        if self.mode == 'rand_one':
            return self.next_rnd_one()
        elif self.mode == 'rand_all':
            return self.next_rnd_all()
        elif self.mode == 'seq_one':
            return self.next_seq_one()
        elif self.mode == 'seq_all':
            return self.next_seq_all()
        else:
            raise AssertionError('%s is not among known modes for ParamStore'
                                 % self.mode)

    def __next__(self):
        """
        Interface for iterators.
        """
        self.next()

    def __iter__(self):
        """
        Interface for iterators.
        """
        return self


text:
// Copyright (c) Christof Senn. All rights reserved. See license.txt in the project root for license information.

namespace Aqua.Tests.TypeSystem.TypeResolver
{
    using Aqua.TypeSystem;
    using Shouldly;
    using System;
    using System.Diagnostics.CodeAnalysis;
    using Xunit;

    public class When_resolving_array_type_of_generic_type
    {
        [SuppressMessage("Major Code Smell", "S2326:Unused type parameters should be removed", Justification = "Generic type required for testing")]
        private class A<T>
        {
        }

        private class B
        {
        }

        private readonly Type type;

        public When_resolving_array_type_of_generic_type()
        {
            var typeInfo = new TypeInfo(typeof(A<B>[]));

            type = TypeResolver.Instance.ResolveType(typeInfo);
        }

        [Fact]
        public void Type_should_be_expected_array_type()
        {
            type.ShouldBe(typeof(A<B>[]));
        }
    }
}


text:
import time
import logging
import os
import json
import requests
import traceback

ser_url='http://192.168.0.102:8080/performs/'

loger=logging.getLogger(__name__)

def exc_cmd(cmd):
    _ch=os.popen(cmd)
    _re=_ch.read()
    _ch.close()
    return _re

def get_ip():
    _cmd="ifconfig eth1|grep -w inet"
    _re=exc_cmd(_cmd)
    ip=_re.strip().split()[1]
    return ip

def collect_cpu():
    _cmd="top -n1|grep Cpu"
    _re=exc_cmd(_cmd)
    free_cpu=float(_re.strip().split(',')[3].strip().split()[1])
    return 100 - free_cpu

def collect_ram():
    with open('/proc/meminfo') as e:
        _total=float(e.readline().split()[1])
        _free=float(e.readline().split()[1])
        _buffer=float(e.readline().split()[1])
    return 100 - 100*(_free+_buffer)/_total

def collect():
    _rt={}
    _rt['ip']=get_ip()
    _rt['time']=time.strftime('%Y-%m-%d %H:%M:%S')
    _rt['cpu']=collect_cpu()
    _rt['ram']=collect_ram()
    return _rt

def send():
    try:
        _data=collect()
        _response=requests.post(ser_url,data=json.dumps(_data),headers={'Content-Type':'application/json'})
        if not _response.ok:
            loger.error('error send %s failed'% _data)
    except BaseException as e:
        loger.error(traceback.format_exc())

if __name__ == '__main__':
    while True:
        try:
            logging.basicConfig(level=logging.INFO,
                                format="%(asctime)s %(name)s %(lineno)d %(message)s",
                                filename="agent.log")

            send()
            time.sleep(60)
        except BaseException as e:
            loger.error(traceback.format_exc())


text:
from django.shortcuts import render
from django.http import HttpResponse

# Create your views here.

"""
# 1:
def hello(request):
    return HttpResponse('
Hello, maizi
')
"""

# 2:
def hello(request, offset):
    return HttpResponse('
Hello, maizi: %s
' % offset)


text:
package protocol

var (
	Version13HelloMagic uint32 = 0x9F79BC40
)

type Version13HelloMessage struct {
	DeviceName    string // max:64
	ClientName    string // max:64
	ClientVersion string // max:64
}

func (m Version13HelloMessage) Magic() uint32 {
	return Version13HelloMagic
}

func (m Version13HelloMessage) Marshal() ([]byte, error) {
	return m.MarshalXDR()
}


text:
var expect = require('expect.js'),
	sinon = require('sinon');

expect = require('sinon-expect').enhance(expect, sinon, 'was');

var coffeeBreak = require('../coffeebreak');
coffeeBreak.init('ci', {
	disableServer: true
});

describe('HTMLBuilder', function() {

	var HTMLBuilder = require('../modules/htmlBuilder'),
		htmlBuilder;

	beforeEach(function() {
		var req = {};
		var res = {
			render: sinon.stub()
		};

		htmlBuilder = new HTMLBuilder(req, res);
	});

	afterEach(function() {

	});

	describe('instance', function() {
		it('Should be a HTMLBUilder instance', function() {
			expect(htmlBuilder).to.be.a(HTMLBuilder);
		});
	});

	describe('renderSpecRunner', function() {
		it('Should render a specRunner html', function() {
			var conf = {};

			var runTasksStub = sinon.stub(coffeeBreak.taskRunner, 'runTasks');

			htmlBuilder.renderSpecRunner(conf);
			expect(htmlBuilder.res.render).was.calledOnce();

			expect(runTasksStub).was.calledOnce();
			expect(runTasksStub).was.calledWith('source', conf, sinon.match.func);

			runTasksStub.restore();
		});
	});
});


text:
@import CocoaLumberjack;

#import <CocoaLumberjackSwift/SwiftLogLevel.h>


text:
using DotNetCore.Localization.Web.Resources.Default.Controllers;

namespace DotNetCore.Localization.Web.Resources.EsMx
{
    public class ResourceRoot : Default.ResourceRoot
    {
        public override HomeControllerResource HomeController => new Controllers.HomeControllerResource();
    }
}


text:
package com.amazonaws.services.iotsitewise.waiters;

import javax.annotation.Generated;

import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.waiters.SdkFunction;
import com.amazonaws.services.iotsitewise.model.DescribePortalRequest;
import com.amazonaws.services.iotsitewise.model.DescribePortalResult;
import com.amazonaws.services.iotsitewise.AWSIoTSiteWise;

@SdkInternalApi
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribePortalFunction implements SdkFunction<DescribePortalRequest, DescribePortalResult> {

    /**
     * Represents the service client
     */
    private final AWSIoTSiteWise client;

    /**
     * Constructs a new DescribePortalFunction with the given client
     *
     * @param client
     *        Service client
     */
    public DescribePortalFunction(AWSIoTSiteWise client) {
        this.client = client;
    }

    /**
     * Makes a call to the operation specified by the waiter by taking the corresponding request and returns the
     * corresponding result
     *
     * @param describePortalRequest
     *        Corresponding request for the operation
     * @return Corresponding result of the operation
     */
    @Override
    public DescribePortalResult apply(DescribePortalRequest describePortalRequest) {
        return client.describePortal(describePortalRequest);
    }
}


text:
package com.alexhennieroed.musikrlib.model;

import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.List;

/**
 * Represents an album
 * @author Alexander Hennie-Roed
 * @version 1.0.0
 */
public class Album {

    private String name;
    private Artist artist;
    private List<Song> songs;

    /**
     * Creates a new album based on general album data
     * @param name the name of the album
     * @param artist the album's artist
     */
    public Album(String name, Artist artist) {
        this.name = name;
        this.artist = artist;
        this.songs = new ArrayList<>();
    }

    /**
     * Returns the name of the album
     * @return the name of the album
     */
    public String getName() { return name; }

    /**
     * Returns the album's artist
     * @return the album's artist
     */
    public Artist getArtist() { return artist; }

    /**
     * Returns the list of the album's songs
     * @return a list of the album's songs
     */
    public List<Song> getSongs() { return songs; }

    /**
     * Adds the given song to the list of songs
     * @param s the song to add
     * @throws InvalidParameterException if the song to add is null
     */
    public void addSong(Song s) throws InvalidParameterException {
        if (s != null) {
            songs.add(s);
        } else {
            throw new InvalidParameterException("The song given to add to the album's songs is null.");
        }
    }

    @Override
    public boolean equals(Object o) {
        if (o instanceof Album) {
            Album a = (Album) o;
            if (this.getName().equals(a.getName())
                    && this.getArtist().equals(a.getArtist())) {
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        return 19 * getName().hashCode() * getArtist().hashCode() * getSongs().hashCode();
    }

}


text:
<?php
require_once('TG_mongoDocument_IPs.php');

class TG_client_usageChargesArchive extends TG_mongoDocument_IPs{
    public $fieldsStruct = array(
        'clientID',
        'usagechargeID',
        'price',
        'dateBilling', //The date when the charge was done (given by shopify)
        'dateCreate', //The date we created this entry
        'details',
    );

    //OVERWRITE parent's function to get a different DB
    protected function getMongoURI(){
        $ini_array = parse_ini_file(dirname(__FILE__)."/../tgparams.ini",true);
        if(isset($ini_array['tg']['DBMONGOURI_TG'])){
            return $ini_array['tg']['DBMONGOURI_TG'];
        }
        return null;

    }

    //OVERWRITE parent's function to get a different DB
    protected function getDbName(){
        $ini_array = parse_ini_file(dirname(__FILE__)."/../tgparams.ini",true);
        if(isset($ini_array['tg']['DBNAME_TG'])){
            return $ini_array['tg']['DBNAME_TG'];
        }
        return null;
    }

    public function getFieldsArrayStructure(){
        return $this->fieldsStruct;
    }

    public function getCollectionName()
    {

        return 'clientusagechargearchive';

    }
    /**
     * Returns the static model of the specified AR class.
     * @return TG_mongoDocument_IPs the static model class
     */
    public static function model()
    {
        return new self;
    }

    /**
     * Prepare a new entry for the collection clientplanusearchive. With the
     * strict minimum.
     * @param type $clientID
     * @return \self
     */
    public static function createNewModel($clientID=null,$usageChargeResponse=null){
        \date_default_timezone_set("UTC");
        if(\is_null($clientID) || \is_null($usageChargeResponse)){return null;}

        $modelAlreadyExist = self::model()->findOne(array('planarchiveid'=>$usageChargeResponse['id']));
        if($modelAlreadyExist){return null;}

        $model = new self;
        $model->_fields['clientID'] = $clientID;
        $model->_fields['usagechargeID'] = $usageChargeResponse['id'];
        $model->_fields['price'] = $usageChargeResponse['price'];
        $dateCharge = new DateTime($usageChargeResponse['billing_on']);
        $model->_fields['dateBilling'] = $dateCharge->format('Y-m-d H:i:s');
        $model->_fields['dateCreate'] = TG_Utility::dateString_now();
        $model->_fields['details'] = $usageChargeResponse;
        $model->save();
        return $model;
    }

}


text:
layout: post
title:  "Object Oriented Design Principles"
category: "Software Development"
---

If you have ever tried to build an OOP application, most of the time you end with dissatisfaction, the reason would be you fell some thing as missing or some thing might be over engineered, or some thing you might have created but you will not be in need of it.

The reason for all such problems is, you can verify and validate a software, but you cannot so easily verify or validate its OOD , for example if you have a god object, having all behaviours, or if you create multiple classes with out using inheritance, Or you never make any thing as private you make every behaviour as public there by ignoring encapsulation.

With all these bad practices, neither the developer nor the QA nor the bussiness loose some thing, because end of the day every body wants a functional software which meets the requirements.

So the effects of such bad designs would be during the maintenance phase of any product which is built and delivered. Object oriented design principles are actually evolved to validate the application to make sure that the application is properly built by exploiting the 4 pillars of OOP ( Inheritance, Polymorphism, Encapsulation, Abstraction).

These principles are not exactly used to validate the system but they are used to employ some best practices in our development phase, hence these things are called as principles not rules.

More than these pillars today's agile methodologies or iterative development methodologies have made a considerable impact on the way we design and deliver a software, As a result of this you can observe a thin line between design principles and Agile methodologies, i.e most of these object oriented and design principles are employed in software development process by considering Agile practices.

Whether its Agile or Waterfall two of the most commonly used generic software design principles are.

1.  **DRY**\-- Don't repeat yourself
2.  **YAGNI**\-- You Ain't gonna need it

### DRY

As the acronym says don't repeat yourself, its an obvious statement and its agnostic to OOPS, whether you use OOPs or not you should not re invent the wheel . This principle is applied almost in every aspect with in the development life cycle, for eg, applying this principle might prevent you copying code from class to class or having same function in a non inherited class or you build some thing new by leaving out the old one because you cannot understand the old one, Or you might be storing same data in multiple tables, your application might have multiple bootstraps, your application might have multiple ways to connect to same database Or you are trying to solve something which is already solved and many more.

The easiest way to prevent your repetition is by reasoning every aspect, and properly seperating the concerns across objects for eg if you are writing a function, list down the reasons for having a new function, check if any other function exists and you can reuse. If its a function written in a class, then you should think of inheritance.

### YAGNI

It is a common problem for passionate developers to think of future problems, or think of future exceptions, when he/she is asked to work on an user story. Some people argue, saying "we code for future enhancement" but that's not so great, no business analyst could anticipate current and future expectations of a client. Some people also argue saying what is the problem in having some extra code ? , a standard code is not simply a code, its a code with test cases and some assertions to execute test cases, which will be part of our test suite, which adds an extra overhead of maintenance.

So if you miss applying DRY or YAGNI principles, I meant if you have code repeatations or you have extra unnessary code, then you endup having a smelling code.

**Some of the most commonly encountered code which smells would be**

1.  Long methods
2.  A huge class
3.  Repeated instance variables
4.  Unnecessary comments
5.  If it takes too much time to handle change requests

**YAGNI and DRY are the global principles, when it comes to OOPs specific, two of the most commonly employed principles are**

1.  SOLID
2.  GRASP

SOLID
-----

Its not an acronym actually, each letter in the acronym describes a principle.

S : - Single responsibility principle

O : - Open close principle

L : - Liskov substitution principle

I : - Interface segregation principle

D : - Dependency inversion principle

I do not want to explain the history behind these principles, because its very huge. These principles are extremely simple though it looks so complex. Most of the time after getting to know these principles you confess a lot about your past mistakes :) .

### Single responsibility principle

An object should have one single concern or responsibility. It should represent one single business entity or one single sub entity of your business entity, meaning all those concerns should be encapsulated with in that class. One of the most easiest way to apply this principle, is cultivating the habit of commenting each class, once you comment, just read out once and observe the conjunctions in the comment if you find 'and' conjunctions a lot then its more likely that you are breaking this principle.

### Open close principle

What ever class you create, it should be open for extension but closed for modification. This principle is applied most of the time, when we need to add new entities which inherit some behaviours of existing entities with in the system.

### Liskov substitution principle

Derived Classes must be substitutable for their base classes. For example you have a class called animal and you have an inherited class called mammals, then you should be able to pass mammal object to a function which expects animal object.

### Interface segregation principle

Interfaces are basically used to reduce coupling or dependencies when it comes to communication between objects. For example we build database interface because we want to build an application in a database agnostic way, so that if you want to change the RDBMS used you can just implement the parent interface and add required functions.

This principle says that, encourage having multiple interfaces then one single interface which is generic. Adding more interfaces reduce coupling between application layers, more than that it reduces coupling between entities across layer.

### Dependency inversion principle

Its the most complex of all the five, needs some amount of relative thinking to apply.

We use Abstract classes when you want to share some code among several closely related classes also we expect classes that extend our abstract class have many common methods or fields, or require access modifiers other than public (such as protected and private) and enables us to define methods that can access and modify the state of the object to which they belong.

The principle says to depend on abstractions and not on concretions, for example

If you have a class called file, and you might require functionality such as write to video file or read from video file or write into text file or read from text file .

Instead of directly inheriting the file class, create an abstract class called file implement that class as two another abstract classes name it as read and write , later for audio write functionality implement write abstract class and for video read functionality implement read abstract class. So that you can reduce the dependencies across various flavours of same entity with in same layer.

GRASP
-----

GRASP is another set of object oriented design principles just like SOLID, Its an acronym for General responsibility assignment software principles.

These principles take slightly different perspective then SOLID, If you can observe the vision behind SOLID principles, its only dependency. In case of GRASP its all about responsibility and concerns. SOLID and GRASP are not competing in each other actually, you can use either of them or ignore one of them. Some people prefer GRASP in Extreme Programming.

GRASP has many principles like the way we have 5 principles in SOLID

1.  Creator
2.  Controller
3.  Pure Fabrication
4.  Expert
5.  High Cohesion
6.  Indirection
7.  Low coupling
8.  Polymorphism
9.  Protected variations

I guess some of them are self explanatory. Most of the time we face situations to apply these principles after designing them by applying SOLID, though they are called as design principles, you can consider it for refactoring or re organizing phase of the design. These principles are applied on each class and its subclasses.

### Creator

This principle is applied to every class to identify who is responsible for creating its object. If you have designed an OOPs system, I guess the most common problem would be to identify the birth of the object with in the system and its life cycle.

### Low coupling Or High Cohesion : -

This principle suggests us to gather 2 attributes for every class, Cohesion and Coupling. Cohesion describes the level of related behaviours exhibited by class and coupling describes the level of dependencies that a class has on other classes. The principle enforce us to reduce coupling and increase cohesion.

### Expert Or Information Expert : -

This principle suggests us to assign the responsibility to a class which has sufficient data to full fill it.

### Controller : -

This principle suggests us to create an intermediate class to communicate between objects, for example in any MVC application we never want to have our Model classes to communicate with views, instead we have a controller in the middle which works as a communicator.

### Pure Fabrication : -

This principle suggests us to create a new class to add behaviours which don't belong to any of the existing classes.

### Indirection : -

This principle suggests us to reduce coupling by creating intermediate object,

Okay let me stop here, I guess most of the things in GRASP are self explanatory, these are just like hints and tips that could make our life easy when we design a class.

Whether you apply SOLID or GRASP the intention to have principles in place is just to make sure the code we write is more readable, testable and maintainable and it wont smell :).

I hope you enjoyed reading this post, and some of you might have confessed yourself for building code by ignoring these principles. UML diagrams help us a lot to apply these principles.

If you are not satisfied with the explanations given here, you can find out [uncle bob's book on writing clean code in agile](http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445)


text:
#define COBJMACROS
#define CONST_VTABLE
#include "wine/test.h"

#include <d3dx9.h>

#include "resources.h"

static HRESULT create_file(const char *filename, const char *data, const unsigned int size)
{
    DWORD received;
    HANDLE hfile;

    hfile = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
    if(hfile == INVALID_HANDLE_VALUE) return HRESULT_FROM_WIN32(GetLastError());

    if(WriteFile(hfile, data, size, &received, NULL))
    {
        CloseHandle(hfile);
        return D3D_OK;
    }

    CloseHandle(hfile);
    return D3DERR_INVALIDCALL;
}

static HRESULT WINAPI testD3DXInclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type,
        const char *filename, const void *parent_data, const void **data, UINT *bytes)
{
    char *buffer;
    static const char shader[] =
            "#include \"incl.vsh\"\n"
            "mov REGISTER, v0\n";
    static const char include[] = "#define REGISTER r0\nvs.1.1\n";
    static const char include2[] = "#include \"incl3.vsh\"\n";
    static const char include3[] = "vs.1.1\n";

    trace("filename %s.\n", filename);
    trace("parent_data %p: %s.\n", parent_data, parent_data ? (char *)parent_data : "(null)");

    if (!strcmp(filename, "shader.vsh"))
    {
        buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(shader));
        memcpy(buffer, shader, sizeof(shader));
        *bytes = sizeof(shader);
    }
    else if (!strcmp(filename, "incl.vsh"))
    {
        buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
        memcpy(buffer, include, sizeof(include));
        *bytes = sizeof(include);
        /* This is included from the first D3DXAssembleShader with non-null ID3DXInclude test
         * (parent_data == NULL) and from shader.vsh / shader[] (with matching parent_data).
         * Allow both cases. */
        ok(parent_data == NULL || !strncmp(shader, parent_data, strlen(shader)), "wrong parent_data value\n");
    }
    else if (!strcmp(filename, "incl2.vsh"))
    {
        buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include2));
        memcpy(buffer, include2, sizeof(include2));
        *bytes = sizeof(include2);
    }
    else if (!strcmp(filename, "incl3.vsh"))
    {
        buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include3));
        memcpy(buffer, include3, sizeof(include3));
        *bytes = sizeof(include3);
        /* Also check for the correct parent_data content */
        ok(parent_data != NULL && !strncmp(include2, parent_data, strlen(include2)), "wrong parent_data value\n");
    }
    else
    {
        ok(0, "Unexpected #include for file %s.\n", filename);
        return D3DERR_INVALIDCALL;
    }
    *data = buffer;
    return S_OK;
}

static HRESULT WINAPI testD3DXInclude_close(ID3DXInclude *iface, const void *data)
{
    HeapFree(GetProcessHeap(), 0, (void *)data);
    return S_OK;
}

static const struct ID3DXIncludeVtbl D3DXInclude_Vtbl = {
    testD3DXInclude_open,
    testD3DXInclude_close
};

struct D3DXIncludeImpl {
    ID3DXInclude ID3DXInclude_iface;
};

static void assembleshader_test(void)
{
    static const char test1[] =
        "vs.1.1\n"
        "mov DEF2, v0\n";
    static const char testincl[] =
        "#define REGISTER r0\n"
        "vs.1.1\n";
    static const char testshader[] =
        "#include \"incl.vsh\"\n"
        "mov REGISTER, v0\n";
    static const char testshader2[] =
        "#include \"incl2.vsh\"\n"
        "mov REGISTER, v0\n";
    static const char testshader3[] =
        "#include \"include/incl3.vsh\"\n"
        "mov REGISTER, v0\n";
    static const char testincl3[] =
        "#include \"incl4.vsh\"\n";
    static const char testincl4_ok[] =
        "#define REGISTER r0\n"
        "vs.1.1\n";
    static const char testincl4_wrong[] =
        "#error \"wrong include\"\n";
    HRESULT hr;
    ID3DXBuffer *shader, *messages;
    static const D3DXMACRO defines[] = {
        {
            "DEF1", "10 + 15"
        },
        {
            "DEF2", "r0"
        },
        {
            NULL, NULL
        }
    };
    struct D3DXIncludeImpl include;
    HRESULT shader_vsh_res;
    static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};

    /* pDefines test */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShader(test1, strlen(test1),
                            defines, NULL, D3DXSHADER_SKIPVALIDATION,
                            &shader, &messages);
    ok(hr == D3D_OK, "pDefines test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* NULL messages test */
    shader = NULL;
    hr = D3DXAssembleShader(test1, strlen(test1),
                            defines, NULL, D3DXSHADER_SKIPVALIDATION,
                            &shader, NULL);
    ok(hr == D3D_OK, "NULL messages test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(shader) ID3DXBuffer_Release(shader);

    /* NULL shader test */
    messages = NULL;
    hr = D3DXAssembleShader(test1, strlen(test1),
                            defines, NULL, D3DXSHADER_SKIPVALIDATION,
                            NULL, &messages);
    ok(hr == D3D_OK, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }

    /* pInclude test */
    shader = NULL;
    messages = NULL;
    include.ID3DXInclude_iface.lpVtbl = &D3DXInclude_Vtbl;
    hr = D3DXAssembleShader(testshader, strlen(testshader), NULL, &include.ID3DXInclude_iface,
                            D3DXSHADER_SKIPVALIDATION, &shader, &messages);
    ok(hr == D3D_OK, "pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* "unexpected #include file from memory" test */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShader(testshader, strlen(testshader),
                            NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                            &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* recursive #include test */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShader(testshader2, strlen(testshader2), NULL, &include.ID3DXInclude_iface,
                            D3DXSHADER_SKIPVALIDATION, &shader, &messages);
    ok(hr == D3D_OK, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("recursive D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    shader_vsh_res = create_file("shader.vsh", testshader, sizeof(testshader) - 1);
    if(SUCCEEDED(shader_vsh_res)) {
        create_file("incl.vsh", testincl, sizeof(testincl) - 1);

        /* D3DXAssembleShaderFromFile + #include test */
        shader = NULL;
        messages = NULL;
        hr = D3DXAssembleShaderFromFileA("shader.vsh",
                                         NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                                         &shader, &messages);
        ok(hr == D3D_OK, "D3DXAssembleShaderFromFile test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
        if(messages) {
            trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if(shader) ID3DXBuffer_Release(shader);

        /* D3DXAssembleShaderFromFile + pInclude test */
        shader = NULL;
        messages = NULL;
        hr = D3DXAssembleShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
                                         D3DXSHADER_SKIPVALIDATION, &shader, &messages);
        ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
        if(messages) {
            trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if(shader) ID3DXBuffer_Release(shader);

        create_file("shader3.vsh", testshader3, sizeof(testshader3) - 1);
        create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong) - 1);
        if(CreateDirectoryA("include", NULL)) {
            create_file("include/incl3.vsh", testincl3, sizeof(testincl3) - 1);
            create_file("include/incl4.vsh", testincl4_ok, sizeof(testincl4_ok) - 1);

            /* path search #include test */
            shader = NULL;
            messages = NULL;
            hr = D3DXAssembleShaderFromFileA("shader3.vsh", NULL, NULL,
                                             D3DXSHADER_SKIPVALIDATION,
                                             &shader, &messages);
            ok(hr == D3D_OK, "D3DXAssembleShaderFromFile path search test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
            if(messages) {
                trace("D3DXAssembleShaderFromFile path search messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
                ID3DXBuffer_Release(messages);
            }
            if(shader) ID3DXBuffer_Release(shader);
        } else skip("Couldn't create \"include\" directory\n");

        DeleteFileA("shader.vsh");
        DeleteFileA("incl.vsh");
        DeleteFileA("shader3.vsh");
        DeleteFileA("incl4.vsh");
        DeleteFileA("include/incl3.vsh");
        DeleteFileA("include/incl4.vsh");
        RemoveDirectoryA("include");

        /* The main shader is also to be loaded through the ID3DXInclude object. */
        shader = NULL;
        messages = NULL;
        hr = D3DXAssembleShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
                D3DXSHADER_SKIPVALIDATION, &shader, &messages);
        ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                hr, hr & 0x0000ffff);
        if (messages)
        {
            trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if (shader)
            ID3DXBuffer_Release(shader);

        shader = NULL;
        messages = NULL;
        hr = D3DXAssembleShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
                D3DXSHADER_SKIPVALIDATION, &shader, &messages);
        ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                hr, hr & 0x0000ffff);
        if (messages)
        {
            trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if (shader)
            ID3DXBuffer_Release(shader);
    } else skip("Couldn't create \"shader.vsh\"\n");

    /* NULL shader tests */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShader(NULL, 0,
                            NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                            &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA, "NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShaderFromFileA("nonexistent.vsh",
                                     NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                                     &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA || hr == E_FAIL, /* I get this on WinXP */
        "D3DXAssembleShaderFromFile nonexistent file test failed with error 0x%x - %d\n",
        hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* D3DXAssembleShaderFromResource test */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShaderFromResourceA(NULL, MAKEINTRESOURCEA(IDB_ASMSHADER),
                                         NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                                         &shader, &messages);
    ok(hr == D3D_OK, "D3DXAssembleShaderFromResource test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* D3DXAssembleShaderFromResource with missing shader resource test */
    shader = NULL;
    messages = NULL;
    hr = D3DXAssembleShaderFromResourceA(NULL, "notexisting",
                                         NULL, NULL, D3DXSHADER_SKIPVALIDATION,
                                         &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA, "D3DXAssembleShaderFromResource NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXAssembleShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);
}

static void d3dxpreprocess_test(void)
{
    static const char testincl[] =
            "#define REGISTER r0\n"
            "vs.1.1\n";
    static const char testshader[] =
            "#include \"incl.vsh\"\n"
            "mov REGISTER, v0\n";
    static const char testshader3[] =
            "#include \"include/incl3.vsh\"\n"
            "mov REGISTER, v0\n";
    static const char testincl3[] =
            "#include \"incl4.vsh\"\n";
    static const char testincl4_ok[] =
            "#define REGISTER r0\n"
            "vs.1.1\n";
    static const char testincl4_wrong[] =
            "#error \"wrong include\"\n";
    HRESULT hr;
    ID3DXBuffer *shader, *messages;
    HRESULT shader_vsh_res;
    static struct D3DXIncludeImpl include = {{&D3DXInclude_Vtbl}};
    static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};

    shader_vsh_res = create_file("shader.vsh", testshader, sizeof(testshader) - 1);
    if(SUCCEEDED(shader_vsh_res)) {
        create_file("incl.vsh", testincl, sizeof(testincl) - 1);
        create_file("shader3.vsh", testshader3, sizeof(testshader3) - 1);
        create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong) - 1);
        if(CreateDirectoryA("include", NULL)) {
            create_file("include/incl3.vsh", testincl3, sizeof(testincl3) - 1);
            create_file("include/incl4.vsh", testincl4_ok, sizeof(testincl4_ok) - 1);

            /* path search #include test */
            shader = NULL;
            messages = NULL;
            hr = D3DXPreprocessShaderFromFileA("shader3.vsh", NULL, NULL,
                                               &shader, &messages);
            ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile path search test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
            if(messages) {
                trace("D3DXPreprocessShaderFromFile path search messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
                ID3DXBuffer_Release(messages);
            }
            if(shader) ID3DXBuffer_Release(shader);
        } else skip("Couldn't create \"include\" directory\n");

        /* D3DXPreprocessShaderFromFile + #include test */
        shader = NULL;
        messages = NULL;
        hr = D3DXPreprocessShaderFromFileA("shader.vsh",
                                           NULL, NULL,
                                           &shader, &messages);
        ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
        if(messages) {
            trace("D3DXPreprocessShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if(shader) ID3DXBuffer_Release(shader);

        /* D3DXPreprocessShaderFromFile + pInclude test */
        shader = NULL;
        messages = NULL;
        hr = D3DXPreprocessShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
                                           &shader, &messages);
        ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
        if(messages) {
            trace("D3DXPreprocessShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if(shader) ID3DXBuffer_Release(shader);

        DeleteFileA("shader.vsh");
        DeleteFileA("incl.vsh");
        DeleteFileA("shader3.vsh");
        DeleteFileA("incl4.vsh");
        DeleteFileA("include/incl3.vsh");
        DeleteFileA("include/incl4.vsh");
        RemoveDirectoryA("include");

        /* The main shader is also to be loaded through the ID3DXInclude object. */
        shader = NULL;
        messages = NULL;
        hr = D3DXPreprocessShaderFromFileA("shader.vsh", NULL, &include.ID3DXInclude_iface,
                &shader, &messages);
        ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                hr, hr & 0x0000ffff);
        if (messages)
        {
            trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if (shader)
            ID3DXBuffer_Release(shader);

        shader = NULL;
        messages = NULL;
        hr = D3DXPreprocessShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
                &shader, &messages);
        ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                hr, hr & 0x0000ffff);
        if (messages)
        {
            trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
            ID3DXBuffer_Release(messages);
        }
        if (shader)
            ID3DXBuffer_Release(shader);
    } else skip("Couldn't create \"shader.vsh\"\n");

    /* NULL shader tests */
    shader = NULL;
    messages = NULL;
    hr = D3DXPreprocessShaderFromFileA("nonexistent.vsh",
                                       NULL, NULL,
                                       &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA || hr == E_FAIL, /* I get this on WinXP */
        "D3DXPreprocessShaderFromFile nonexistent file test failed with error 0x%x - %d\n",
        hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXPreprocessShaderFromFile messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* D3DXPreprocessShaderFromResource test */
    shader = NULL;
    messages = NULL;
    hr = D3DXPreprocessShaderFromResourceA(NULL, MAKEINTRESOURCEA(IDB_ASMSHADER),
                                           NULL, NULL,
                                           &shader, &messages);
    ok(hr == D3D_OK, "D3DXPreprocessShaderFromResource test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXPreprocessShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);

    /* D3DXPreprocessShaderFromResource with missing shader resource test */
    shader = NULL;
    messages = NULL;
    hr = D3DXPreprocessShaderFromResourceA(NULL, "notexisting",
                                           NULL, NULL,
                                           &shader, &messages);
    ok(hr == D3DXERR_INVALIDDATA, "D3DXPreprocessShaderFromResource NULL shader test failed with error 0x%x - %d\n", hr, hr & 0x0000FFFF);
    if(messages) {
        trace("D3DXPreprocessShaderFromResource messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
        ID3DXBuffer_Release(messages);
    }
    if(shader) ID3DXBuffer_Release(shader);
}

START_TEST(asm)
{
    assembleshader_test();

    d3dxpreprocess_test();
}


text:
package com.ning.metrics.collector.guice;

import com.ning.arecibo.jmx.AreciboMonitoringModule;
import com.ning.arecibo.metrics.guice.AreciboMetricsModule;
import com.ning.metrics.collector.binder.config.CollectorConfig;
import com.ning.metrics.collector.binder.config.CollectorConfigurationObjectFactory;
import com.ning.metrics.collector.endpoint.resources.ScribeModule;
import com.ning.metrics.collector.hadoop.writer.HdfsModule;
import com.ning.metrics.collector.nagios.CollectorServiceCheck;
import com.ning.metrics.collector.nagios.NagiosMonitor;
import com.ning.metrics.collector.realtime.RealTimeQueueModule;
import com.ning.metrics.collector.util.F5PoolMemberControl;
import com.ning.nagios.FakeNagiosMonitor;
import com.ning.nagios.ServiceCheck;
import com.ning.nagios.ServiceMonitor;

import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import com.google.inject.servlet.ServletModule;
import com.sun.jersey.api.core.PackagesResourceConfig;
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
import com.yammer.metrics.guice.InstrumentationModule;
import org.atmosphere.guice.GuiceManagedAtmosphereServlet;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.skife.config.ConfigurationObjectFactory;
import org.weakref.jmx.guice.ExportBuilder;
import org.weakref.jmx.guice.MBeanModule;

import javax.management.MBeanServer;
import java.lang.management.ManagementFactory;
import java.util.HashMap;

public class ServerModule extends ServletModule
{
    static final String EVENTS_RESOURCES_PATTERN = "/[^a](.*)";
    static final String ASYNC_RESOURCES_PATTERN = "/a(.*)";

    @Override
    protected void configureServlets()
    {
        final ConfigurationObjectFactory configFactory = new CollectorConfigurationObjectFactory(System.getProperties());
        final CollectorConfig config = configFactory.build(CollectorConfig.class);
        bind(ConfigurationObjectFactory.class).toInstance(configFactory);
        bind(CollectorConfig.class).toInstance(config);

        installStats();
        installHealthChecks();
        installJMX();
        installArecibo(config);
        installNagios(config);
        installF5();
        installJaxrsSupport(config);
        installScribe();
        installPersistentSink();
        installHDFS();
        installRealtimeSink();

        // Static files
        bind(DefaultServlet.class).asEagerSingleton();
        serve("/media/*").with(DefaultServlet.class);

        serveRegex(ASYNC_RESOURCES_PATTERN).with(GuiceManagedAtmosphereServlet.class, new HashMap<String, String>()
        {
            {
                put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.ning.metrics.collector.jaxrs");
            }
        });
        serveRegex(EVENTS_RESOURCES_PATTERN).with(GuiceContainer.class, new HashMap<String, String>()
        {
            {
                put(PackagesResourceConfig.PROPERTY_PACKAGES, "com.ning.metrics.collector.jaxrs");
            }
        });
    }

    protected void installStats()
    {
        install(new InstrumentationModule());
    }

    protected void installHealthChecks()
    {
        install(new HealthChecksModule());
    }

    protected void installJMX()
    {
        bind(MBeanServer.class).toInstance(ManagementFactory.getPlatformMBeanServer());
        install(new MBeanModule());
    }

    protected void installArecibo(final CollectorConfig config)
    {
        if (config.isAreciboEnabled()) {
            install(new AreciboMonitoringModule(config.getAreciboProfile()));
            // Expose metrics objects to Arecibo
            // TODO There is a leak in arecibo-metrics. The AreciboMetricsReporter doesn't unregister
            // removed metrics from the registry
            install(new AreciboMetricsModule());
        }
    }

    protected void installNagios(final CollectorConfig config)
    {
        bind(ServiceCheck.class).to(CollectorServiceCheck.class).asEagerSingleton();
        if (config.isNagiosEnabled()) {
            bind(ServiceMonitor.class).to(NagiosMonitor.class).asEagerSingleton();
        }
        else {
            final ServiceMonitor monitor = new FakeNagiosMonitor(config.getNagiosCheckRate());
            bind(ServiceMonitor.class).toInstance(monitor);
        }
    }

    protected void installF5()
    {
        bind(F5PoolMemberControl.class).asEagerSingleton();

        final ExportBuilder builder = MBeanModule.newExporter(binder());
        builder.export(F5PoolMemberControl.class).as("com.ning.metrics.collector:name=F5poolMemberControl");
    }

    protected void installJaxrsSupport(final CollectorConfig config)
    {
        bind(JacksonJsonProvider.class).asEagerSingleton();

        install(new RequestHandlersModule());
        install(new FiltersModule(config));
    }

    protected void installScribe()
    {
        install(new ScribeModule());
    }

    protected void installPersistentSink()
    {
        install(new EventCollectorModule());
    }

    protected void installHDFS()
    {
        install(new HdfsModule());
    }

    protected void installRealtimeSink()
    {
        install(new RealTimeQueueModule());
    }
}


text:
DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WindowState*);

namespace ash {
namespace internal {
DEFINE_WINDOW_PROPERTY_KEY(bool, kStayInSameRootWindowKey, false);
DEFINE_WINDOW_PROPERTY_KEY(bool, kUsesScreenCoordinatesKey, false);
DEFINE_OWNED_WINDOW_PROPERTY_KEY(wm::WindowState,
                                 kWindowStateKey, NULL);
}  // namespace internal
}  // namespace ash