text:
@import url(https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic);
/* -------------------------------------
    GLOBAL RESETS
------------------------------------- */
table,
td,
div,
a {
  box-sizing: border-box; }

img {
  -ms-interpolation-mode: bicubic;
  max-width: 100%; }

body {
  font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  height: 100% !important;
  line-height: 1.5;
  margin: 0 !important;
  padding: 0;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  width: 100% !important;
  background-color: #f3f3f3;
  background: url("https://www.compandsave.com/v/vspfiles/templates/10/images/template12/bg-stripe-e7.png") repeat scroll 0 0 #f3f3f3; }

table {
  border-collapse: collapse !important;
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
  width: 100%; }
  table td {
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    font-size: 14px;
    vertical-align: top;
    padding: 0; }

img {
  border: 0; }

.ExternalClass {
  width: 100%; }

.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
  line-height: 100%; }

/* -------------------------------------
    BODY & MAIN CONTAINER
------------------------------------- */
body {
  width: 100% !important;
  background-color: #f3f3f3; }

.wrapper {
  width: 100%;
  background-color: #f3f3f3;
  background: url("https://www.compandsave.com/v/vspfiles/templates/10/images/template12/bg-stripe-e7.png") repeat scroll 0 0 #f3f3f3;
  table-layout: fixed;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%; }

.webkit {
  max-width: 640px;
  margin: 0 auto; }

.outer {
  margin: 0 auto;
  width: 100%;
  max-width: 640px; }

/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
.container {
  display: block;
  margin: 0 auto !important;
  /* makes it centered */
  max-width: 640px;
  padding: 10px;
  width: auto !important;
  width: 640px; }

/* This should also be a block element, so that it will fill 100% of the .container */
.content {
  display: block;
  margin: 0 auto;
  max-width: 640px;
  padding: 10px; }

div {
  overflow-x: inherit !important; }

/* -------------------------------------
    BLOCK CONTAINER LAYOUT
------------------------------------- */
.inner {
  padding: 0px; }

/* One column layout */
/*Two column layout*/
.two-column {
  text-align: center;
  font-size: 0; }

.two-column .column {
  width: 100%;
  max-width: 320px;
  display: inline-block;
  vertical-align: top; }

/* Right sidebar layout */
.right-container, .left-container {
  text-align: center;
  font-size: 0; }

.right-container .column, .left-container .column {
  width: 100%;
  display: inline-block;
  vertical-align: middle; }

.right-container .left, .left-container .left {
  max-width: 315px; }

.right-container .right, .left-container .right {
  max-width: 315px; }

.right-container .contents {
  font-size: 14px;
  text-align: center; }

.column.left.fixed, .column.right.fixed {
  width: 45% !important;
  max-width: 290px !important; }

.column.middle.fixed {
  width: 10% !important;
  max-width: 30px !important; }

/* Set maximum size of the image for two columns */
.column .contents img {
  max-width: 310px;
  width: 100%;
  text-align: center; }

/* -------------------------------------
    PRE HEADER
------------------------------------- */
.pre-header {
  color: transparent;
  display: none;
  height: 0;
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  mso-hide: all;
  visibility: hidden;
  width: 0; }

/* -------------------------------------
    HEADER LOGO
------------------------------------- */
.header-logo {
  width: 100% !important;
  max-width: 640px; }
  .header-logo td {
    mso-line-height-rule: exactly;
    padding: 0;
    margin: 0;
    text-align: center;
    width: 100%;
    max-width: 640px; }
    .header-logo td a {
      color: #ffffff;
      font-size: 14px;
      line-height: 1;
      margin-top: 0;
      margin-bottom: 0;
      text-align: center; }

/* -------------------------------------
    TYPOGRAPHY
------------------------------------- */
h1,
h2,
h3,
h4 {
  color: #333333;
  font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
  font-weight: 700;
  line-height: 1.2em;
  margin: 0; }

h1 {
  font-size: 38px; }

h2 {
  font-size: 24px; }

h3 {
  font-size: 18px;
  font-weight: 400; }

h4 {
  font-size: 14px;
  font-weight: 400; }

p,
span,
ul,
ol {
  font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
  font-size: 14px;
  font-weight: normal;
  margin: 0; }
  p li,
  span li,
  ul li,
  ol li {
    list-style-position: inside; }

a {
  color: #0073c0;
  text-decoration: none; }

code,
pre,
.word-wrap {
  word-break: break-word;
  word-wrap: break-word;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto; }

/* -------------------------------------
    BUTTONS
------------------------------------- */
.button-cyan {
  width: 100%;
  max-width: 300px;
  text-align: center; }
  .button-cyan > tr > td {
    padding-bottom: 15px; }
  .button-cyan table {
    width: auto; }
    .button-cyan table td {
      background-color: #00ADEF;
      border-radius: 4px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      padding: 10px 30px; }
  .button-cyan a {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    margin: 0;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    background-color: #00ADEF;
    border-color: #00ADEF; }

.button-magenta {
  width: 100%;
  max-width: 300px;
  text-align: center; }
  .button-magenta > tr > td {
    padding-bottom: 15px; }
  .button-magenta table {
    width: auto; }
    .button-magenta table td {
      background-color: #ec008c;
      border-radius: 4px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      padding: 10px 30px; }
  .button-magenta a {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    margin: 0;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    background-color: #ec008c;
    border-color: #ec008c; }

.button-yellow {
  width: 100%;
  max-width: 300px;
  text-align: center; }
  .button-yellow > tr > td {
    padding-bottom: 15px; }
  .button-yellow table {
    width: auto; }
    .button-yellow table td {
      background-color: #fff200;
      border-radius: 4px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      padding: 10px 30px; }
  .button-yellow a {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    margin: 0;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    background-color: #fff200;
    border-color: #fff200; }

.button-cms-blue {
  width: 100%;
  max-width: 300px;
  text-align: center; }
  .button-cms-blue > tr > td {
    padding-bottom: 15px; }
  .button-cms-blue table {
    width: auto; }
    .button-cms-blue table td {
      background-color: #0073c0;
      border-radius: 4px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      padding: 10px 30px; }
  .button-cms-blue a {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    margin: 0;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    background-color: #0073c0;
    border-color: #0073c0; }

.button-cms-yellow {
  width: 100%;
  max-width: 300px;
  text-align: center; }
  .button-cms-yellow > tr > td {
    padding-bottom: 15px; }
  .button-cms-yellow table {
    width: auto; }
    .button-cms-yellow table td {
      background-color: #ffbb00;
      border-radius: 4px;
      text-align: center;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
      cursor: pointer;
      padding: 10px 30px; }
  .button-cms-yellow a {
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    font-family: "PT Sans", Helvetica, Arial, Verdana, sans-serif;
    margin: 0;
    text-decoration: none;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    background-color: #ffbb00;
    border-color: #ffbb00; }

/* -------------------------------------
  DIVIDERS
------------------------------------- */
.divider {
  border-collapse: separate; }
  .divider-spacer {
    padding: 20px 0; }
  .divider td {
    border-top: 1px solid #cccccc;
    line-height: 0;
    font-size: 0;
    height: 1px;
    margin: 0;
    padding: 0; }

/* -------------------------------------
    SPACER
------------------------------------- */
.spacer-5 {
  height: 5px !important;
  font-size: 5px !important;
  line-height: 5px !important; }

.spacer-10 {
  height: 10px !important;
  font-size: 10px !important;
  line-height: 10px !important; }

.spacer-15 {
  height: 15px !important;
  font-size: 15px !important;
  line-height: 15px !important; }

.spacer-20 {
  height: 20px !important;
  font-size: 20px !important;
  line-height: 20px !important; }

.spacer-30 {
  height: 30px !important;
  font-size: 30px !important;
  line-height: 30px !important; }

.spacer-40 {
  height: 40px !important;
  font-size: 40px !important;
  line-height: 40px !important; }

/* -------------------------------------
    OTHER STYLES THAT MIGHT BE USEFUL
------------------------------------- */
.last {
  margin-bottom: 0; }

.first {
  margin-top: 0; }

.align-center {
  text-align: center; }

.align-right {
  text-align: right; }

.align-left {
  text-align: left; }

.clear {
  clear: both; }

.mt0 {
  margin-top: 0; }

.mb0 {
  margin-bottom: 0; }

.valign-top {
  vertical-align: top !important; }

.valign-bottom {
  vertical-align: bottom !important; }

.valign-middle {
  vertical-align: middle !important; }

/* -------------------------------------
    VIEW IN BROWSERS
------------------------------------- */
.view-in-browser-container {
  border-collapse: separate;
  background-color: #ffffff !important;
  width: 100% !important; }
  .view-in-browser-container td {
    font-size: 14px;
    line-height: 1;
    text-align: center;
    height: 30px;
    vertical-align: middle; }
    .view-in-browser-container td span {
      text-align: center; }
    .view-in-browser-container td a {
      color: #0073c0;
      text-decoration: underline !important; }

/* -------------------------------------
    HEADER LOGO AND NAVIGATION
------------------------------------- */
.logo-left {
  max-width: 180px;
  text-align: center;
  font-weight: normal !important; }
  .logo-left .contents img {
    width: 100% !important;
    max-width: 150px !important;
    font-weight: normal !important; }

td.header-nav-item {
  max-width: 65px !important;
  vertical-align: middle !important; }

div.column.nav-right {
  vertical-align: middle !important; }

.nav-right {
  max-width: 440px;
  vertical-align: middle !important; }
  .nav-right td.inner.contents {
    vertical-align: middle !important; }
  .nav-right .header-nav table {
    width: 100%;
    border: 0 !important;
    max-width: 62px !important;
    vertical-align: middle !important; }
    .nav-right .header-nav table td {
      text-align: center;
      vertical-align: middle !important; }
    .nav-right .header-nav table span {
      width: 100%;
      max-width: 62px;
      color: #333333;
      font-size: 14px;
      line-height: 1;
      text-align: center;
      vertical-align: middle !important; }
      .nav-right .header-nav table span a {
        color: #333333;
        font-size: 14px;
        text-decoration: none;
        text-align: center;
        line-height: 1; }
        .nav-right .header-nav table span a img {
          color: #333333;
          font-size: 14px;
          text-align: center;
          line-height: 1; }

/* -------------------------------------
    SOCIAL MEDIA ICONS
------------------------------------- */
@media only screen and (min-width: 640px) {
  a.social-media-icons {
    color: #0073c0;
    text-decoration: underline; }
    a.social-media-icons:hover {
      display: inline-block;
      background-size: 25px auto !important;
      background-repeat: no-repeat !important;
      background-position: 0 0 !important;
      color: #ffbb00;
      text-decoration: none; }
      a.social-media-icons:hover img {
        visibility: hidden;
        color: #ffbb00;
        text-decoration: none; }
  a.facebook:hover {
    background-image: url("https://www.compandsave.com/v/newsletter/general-images/email/facebook-h-y.png") !important; }
  a.twitter:hover {
    background-image: url("https://www.compandsave.com/v/newsletter/general-images/email/twitter-h-y.png") !important; }
  a.google:hover {
    background-image: url("https://www.compandsave.com/v/newsletter/general-images/email/google-h-y.png") !important; }
  a.blogger:hover {
    background-image: url("https://www.compandsave.com/v/newsletter/general-images/email/blogger-h-y.png") !important; }
  a.wordpress:hover {
    background-image: none; }
  a.pinterest:hover {
    background-image: url("https://www.compandsave.com/v/newsletter/general-images/email/pinterest-h-y.png") !important; } }

/* -------------------------------------
    RESPONSIVE AND MOBILE FRIENDLY STYLES
------------------------------------- */
@media only screen and (max-width: 680px) {
  table[class=body] h1,
  table[class=body] h2,
  table[class=body] h3,
  table[class=body] h4 {
    font-weight: 600 !important; }
  table[class=body] h1 {
    font-size: 22px !important; }
  table[class=body] h2 {
    font-size: 18px !important; }
  table[class=body] h3 {
    font-size: 16px !important; }
  table[class=body] .content,
  table[class=body] .wrapper {
    padding: 10px !important; }
  table[class=body] .container {
    padding: 0 !important;
    width: 100% !important; }
  table[class=body] .button table,
  table[class=body] .button a {
    width: 100% !important; } }

@media only screen and (max-width: 414px) {
  .nav-right .header-nav table span {
    font-size: 14px !important; }
    .nav-right .header-nav table span a {
      font-size: 14px !important; } }

/* -------------------------------------
    GLOBAL RESPONSIVE
------------------------------------- */
@media only screen and (min-width: 320px) {
  /* Header navigations hover style */
  .nav-right a:hover {
    text-decoration: underline !important; }
  /* IOS links color fix */
  .apple-links-white a {
    color: #ffffff !important;
    text-decoration: none;
    font-size: 10px; }
  .apple-links-black a {
    color: #000000 !important;
    text-decoration: none;
    font-size: 10px; }
  .apple-links-grey a {
    color: #cccccc !important;
    text-decoration: none;
    font-size: 10px; }
  .apple-links-cms-black a {
    color: #333333 !important;
    text-decoration: none !important;
    font-size: 10px; } }

.button-cyan a {
  color: #ffffff; }

.button-magenta a {
  color: #ffffff; }

.button-yellow a {
  color: #333333; }

.button-cms-blue a {
  color: #ffffff; }

.button-cms-yellow a {
  color: #333333; }

/* -------------------------------------
    COLOR BLOCKS & SOCIAL MEDIA ICONS
------------------------------------- */
.color-blocks {
  height: 5px !important;
  margin: 0;
  padding: 0;
  vertical-align: top;
  text-align: center;
  font-size: 5px !important;
  line-height: 5px !important; }
  .color-blocks table {
    mso-line-height-rule: exactly;
    border-spacing: 0;
    margin: 0;
    padding: 0;
    border-collapse: collapse;
    width: 100%;
    max-width: 640px; }
    .color-blocks table td {
      width: 25% !important;
      height: 5px !important;
      max-width: 160px !important;
      text-align: center;
      vertical-align: top;
      display: inline-block;
      margin: 0;
      padding: 0; }
      .color-blocks table td span {
        display: inline-block;
        height: 5px;
        width: 100% !important;
        margin: 0 !important;
        max-width: 160px !important; }
        .color-blocks table td span.cyan {
          background-color: #00ADEF; }
        .color-blocks table td span.magenta {
          background-color: #ec008c; }
        .color-blocks table td span.yellow {
          background-color: #fff200; }
        .color-blocks table td span.black {
          background-color: #000000; }

.selling-points {
  background: #ffffff;
  vertical-align: middle; }
  .selling-points td {
    width: 33.3%;
    max-width: 212px;
    text-align: center;
    vertical-align: top;
    padding: 0; }
    .selling-points td div {
      display: block;
      margin: 0 auto;
      padding: 0; }
      .selling-points td div span {
        font-size: 12px;
        line-height: 1;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0; }
        .selling-points td div span.sp-title {
          font-weight: 700 !important;
          font-size: 14px; }

/* -------------------------------------
    DEFAULT FOOTER
------------------------------------- */
.footer-links {
  max-width: 350px; }
  .footer-links td.copyright span {
    font-size: 11px !important;
    font-style: italic !important; }
  .footer-links td {
    vertical-align: bottom !important; }
    .footer-links td span {
      color: #333333;
      line-height: 1;
      margin-top: 0;
      margin-bottom: 0 !important;
      padding: 0;
      vertical-align: bottom !important;
      font-size: 13px; }
      .footer-links td span unsubscribe, .footer-links td span a {
        color: #0073c0;
        text-decoration: underline;
        vertical-align: bottom !important;
        font-size: 13px; }

.social-media {
  max-width: 286px; }
  .social-media a, .social-media img {
    display: inline-block;
    color: #0073c0;
    font-weight: normal !important;
    font-size: 12px;
    line-height: 1;
    margin-top: 0;
    margin-bottom: 0;
    text-decoration: underline;
    width: 25px; }

.footer-note {
  max-width: 480px;
  text-align: center; }
  .footer-note td {
    mso-line-height-rule: exactly;
    padding: 3px 10px;
    vertical-align: middle; }
    .footer-note td div {
      display: inline-block;
      font-size: 10px;
      line-height: 1.2;
      text-align: center;
      color: #4d4d4d;
      margin-top: 0;
      margin-bottom: 10px; }
      .footer-note td div a {
        color: #0073c0;
        font-weight: 700;
        text-decoration: none !important; }
      .footer-note td div span.apple-links-white, .footer-note td div span.apple-links-black, .footer-note td div span.apple-links-grey, .footer-note td div span.apple-links-cms-black {
        font-size: 10px !important; }
      .footer-note td div span.footer-note-highlight {
        font-size: 10px !important;
        color: #0073c0 !important;
        font-weight: 700; }

.content-table-bg {
  background: url("http://www.compandsave.com/v/newsletter/2016-Q2Campaign/apr1/email-bg.jpg") no-repeat 0 0 #facd0e;
  background-color: #facd0e;
  background-position: center top; }

.email-artwork img {
  width: 100%;
  max-width: 600px;
  height: auto;
  color: #333333;
  font-size: 16px; }

.email-main-tagline h1 {
  color: #333333;
  font-size: 26px;
  line-height: 1.2;
  font-weight: bold;
  margin: 0; }

.email-sub-tagline h3 {
  color: #333333;
  font-size: 18px;
  line-height: 1.2;
  margin: 0; }

.exp-date {
  vertical-align: middle;
  color: #333333;
  font-size: 15px;
  line-height: 1;
  font-weight: normal; }
  .exp-date span {
    color: #333333;
    font-size: 15px;
    line-height: 1;
    font-weight: normal; }


text:
/*
 * app.less is responsible for including other files, but these must be listed as dependencies here
 * to be compiled automatically.
 *
 *= depend_on variables
 *= depend_on mixins
 *= require app
 *
 *= require octicons/octicons/sprockets-octicons
 *= require font-awesome
 */

redpajama_set_name: RedPajamaGithub


text:
namespace app { namespace Fuse { namespace Animations { struct MixerBase; } } }
namespace app { namespace Uno { namespace UX { struct Property__Fuse_Elements_TextAlignment; } } }

namespace app {
namespace Fuse {
namespace Animations {

struct MasterProperty__Fuse_Elements_TextAlignment;

struct MasterProperty__Fuse_Elements_TextAlignment__uType : ::app::Fuse::Animations::MasterBase__Fuse_Elements_TextAlignment__uType
{
    ::app::Fuse::Animations::MasterPropertyGet __interface_1;
};

MasterProperty__Fuse_Elements_TextAlignment__uType* MasterProperty__Fuse_Elements_TextAlignment__typeof();

void MasterProperty__Fuse_Elements_TextAlignment___ObjInit_1(MasterProperty__Fuse_Elements_TextAlignment* __this, ::app::Uno::UX::Property__Fuse_Elements_TextAlignment* property, ::app::Fuse::Animations::MixerBase* mixerBase);
int MasterProperty__Fuse_Elements_TextAlignment__get_RestValue(MasterProperty__Fuse_Elements_TextAlignment* __this);
::uObject* MasterProperty__Fuse_Elements_TextAlignment__GetPropertyObject(MasterProperty__Fuse_Elements_TextAlignment* __this);
void MasterProperty__Fuse_Elements_TextAlignment__OnInactive(MasterProperty__Fuse_Elements_TextAlignment* __this);

struct MasterProperty__Fuse_Elements_TextAlignment : ::app::Fuse::Animations::MasterBase__Fuse_Elements_TextAlignment
{
    ::uStrong< ::app::Uno::UX::Property__Fuse_Elements_TextAlignment*> Property;

    void _ObjInit_1(::app::Uno::UX::Property__Fuse_Elements_TextAlignment* property, ::app::Fuse::Animations::MixerBase* mixerBase) { MasterProperty__Fuse_Elements_TextAlignment___ObjInit_1(this, property, mixerBase); }
    ::uObject* GetPropertyObject() { return MasterProperty__Fuse_Elements_TextAlignment__GetPropertyObject(this); }
};

}}}

#endif


text:
package com.datatorrent.lib.appdata.query;

import java.util.Map;

import com.google.common.collect.Maps;

import org.apache.commons.lang3.mutable.MutableLong;

import com.datatorrent.lib.appdata.query.QueueList.QueueListNode;
import com.datatorrent.lib.appdata.schemas.Query;

/**
 * This {@link QueueManager} behaves like {@link WindowEndQueueManager} except that if another query is added to the queue with
 * the same query id as an existing query in the queue, the existing query is replaced with the new query.
 * @param <QUERY> The type of queries kept in the queue.
 * @param <META_QUERY> The type of query meta data kept in the queue.
 * @since 3.0.0
 */
public class AppDataWindowEndQueueManager<QUERY extends Query, META_QUERY> extends WindowEndQueueManager<QUERY, META_QUERY>
{
  /**
   * A map from query IDs to queue nodes.
   */
  private final Map<String, QueueListNode<QueryBundle<QUERY, META_QUERY, MutableLong>>> queryIDToNode = Maps.newHashMap();

  public AppDataWindowEndQueueManager()
  {
  }

  @Override
  public boolean enqueue(QUERY query, META_QUERY metaQuery, MutableLong context)
  {
    if(context != null) {
      query.setCountdown(context.getValue());
    }

    if(query.isOneTime()) {
      return super.enqueue(query, metaQuery, new MutableLong(1L));
    }
    else {
      return super.enqueue(query, metaQuery, new MutableLong(query.getCountdown()));
    }
  }

  @Override
  public void addedNode(QueueListNode<QueryBundle<QUERY, META_QUERY, MutableLong>> queryQueueable)
  {
    queryIDToNode.put(queryQueueable.getPayload().getQuery().getId(), queryQueueable);
  }

  @Override
  public void removedNode(QueueListNode<QueryBundle<QUERY, META_QUERY, MutableLong>> queryQueueable)
  {
    queryIDToNode.remove(queryQueueable.getPayload().getQuery().getId());
  }

  @Override
  public boolean addingFilter(QueryBundle<QUERY, META_QUERY, MutableLong> queryBundle)
  {
    QueueListNode<QueryBundle<QUERY, META_QUERY, MutableLong>> queryNode =
    queryIDToNode.get(queryBundle.getQuery().getId());

    if(queryNode == null) {
      return true;
    }

    queryNode.setPayload(queryBundle);

    return false;
  }
}


text:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { WebAPISvc } from '../common/services/webapi.service';
import { IUsers } from '../common/objects/usersModel';

@Component({
    selector: 'mrg-user-admin',
    templateUrl: 'usersAdmin.component.html',
    styleUrls: [ 'usersAdmin.component.css' ]
})

export class UsersAdminComponent implements OnInit {
    constructor(private _webApiSvc: WebAPISvc, private _router:Router) {
     }

     allUsers:IUsers[] = [];
     allRoles:string[] = [];
     curUser:IUsers = {
         firstName: '',
         lastName: ''
     };
     showDetails: boolean = false;

     ngOnInit():void {
        this.load();
     }

     load() {
        this.getAllUsers();
        this.getAllRoles();
     }

     getAllUsers() {
         this._webApiSvc.GetUsers().subscribe(resp => {
            if (resp){
                let json = resp.json();
                this.allUsers = JSON.parse(resp.json());
            }
        });
     }

     getAllRoles() {
         this.allRoles = ['Admin', 'Client'];
     }

     showDetailsToggle(show:boolean, user:IUsers){
         this.showDetails = show;
         this.curUser = user;
     }

     saveUser(){
        this.showDetails = false;
        this._webApiSvc.UpdateUser(this.curUser).subscribe(resp => {
            if (resp){
                this._router.navigate(['usersAdmin']);
            }
        });
     }
     assignedRolesChanged(ev){
        let isChecked: boolean = ev.currentTarget.checked;
        if (ev.currentTarget.value && this.isChecked(ev.currentTarget.value)) {
            if (!isChecked){
                if (this.curUser.roles) {
                    let index:number = this.curUser.roles.indexOf(ev.currentTarget.value, 0);
                    if (index > -1){
                        this.curUser.roles.splice(index, 1);
                    }
                }
            }
        }
        else {
            if (isChecked){
                if (this.curUser.roles){
                    this.curUser.roles.push(ev.currentTarget.value);
                }
                else {
                    this.curUser.roles = [ev.currentTarget.value];
                }
            }
        }
     }
     isChecked(role){
        if (this.curUser.roles){
            return this.curUser.roles.indexOf(role) > -1;
        }
        return false;
     }
}


text:
namespace containers {
namespace lmctfy {

class CgroupFactory;
class PerfController;

// Factory for PerfControllers.
//
// Class is thread-safe.
class PerfControllerFactory
    : public CgroupControllerFactory<PerfController, CGROUP_PERF_EVENT> {
 public:
  // Does not own the cgroup_factory or kernel.
  PerfControllerFactory(const CgroupFactory *cgroup_factory,
                        const KernelApi *kernel,
                        EventFdNotifications *eventfd_notifications)
      : CgroupControllerFactory<PerfController, CGROUP_PERF_EVENT>(
            cgroup_factory, kernel, eventfd_notifications) {}
  virtual ~PerfControllerFactory() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(PerfControllerFactory);
};

// Controller for perf events.
//
// Class is thread-safe.
class PerfController : public CgroupController {
 public:
  // Does not take ownership of kernel.
  PerfController(const string &hierarchy_path, const string &cgroup_path,
                 bool owns_cgroup, const KernelApi *kernel,
                 EventFdNotifications *eventfd_notifications);
  virtual ~PerfController() {}

 private:
  DISALLOW_COPY_AND_ASSIGN(PerfController);
};

}  // namespace lmctfy
}  // namespace containers

#endif  // SRC_CONTROLLERS_PERF_CONTROLLER_H_


text:
<html>
  <head><meta name="viewport" content="minimal-ui"></head>
  <body style="background-color:black;margin:0;padding:0" align="center">
  </body>
</html>


text:
import random
import math
import logging

import pygame

from .. import Collage

class RecursiveSplit(Collage):
    name = 'recursive split'

    def __init__(self, config):
        super(RecursiveSplit, self).__init__(config)

    def generate(self, size):
        wallpapers = self._get_wallpapers()

        logging.debug('Generating...')
        collage = self.generate_split(size, wallpapers)
        logging.debug('Generation complete')

        return collage

    def generate_split(self, split_size, wallpapers, i=0):
        split = pygame.Surface(split_size)

        # get cell size
        size = (int(math.ceil(split_size[0]/2.0)),
                int(math.ceil(split_size[1]/2.0)))

        # a bounding box of each cell
        placement = ((0,0,1,1), (1,0,2,1), (0,1,1,2), (1,1,2,2))
        for i in range(4):
            offset = [0,0]
            if type(wallpapers[i]) is list:
                wp = self.generate_split(size, wallpapers[i], i+1)
            else:
                offset, wp = self._resize_wallpaper(wallpapers[i], size)

            pos = [size[j%2]*placement[i][j] for j in range(4)]

            split.blit(wp, pos[:2], pygame.Rect(offset[0], offset[1], *pos[2:]))

        return split

    def _get_wallpapers(self, i=1):
        # Get wallpaper for each split, breadth-first
        wallpapers = self.wallpaper_source.pop(4)

        if i < self.config['recursive_split.recursion-depth']:
            for n in range(4):
                if not random.randint(0, i*(3)):
                    wallpapers[n] = self._get_wallpapers(i+1)

        return wallpapers


text:
package spyglass

import (
	"context"
	"fmt"
	"strings"

	"github.com/sirupsen/logrus"

	"k8s.io/apimachinery/pkg/util/sets"
	"k8s.io/test-infra/prow/config"
	"k8s.io/test-infra/prow/io/providers"
	"k8s.io/test-infra/prow/spyglass/api"
	"k8s.io/test-infra/prow/spyglass/lenses/common"
)

// ListArtifacts gets the names of all artifacts available from the given source
func (s *Spyglass) ListArtifacts(ctx context.Context, src string) ([]string, error) {
	keyType, key, err := splitSrc(src)
	if err != nil {
		return []string{}, fmt.Errorf("error parsing src: %w", err)
	}
	gcsKey := ""
	switch keyType {
	case prowKeyType:
		storageProvider, key, err := s.prowToGCS(key)
		if err != nil {
			logrus.Warningf("Failed to get gcs source for prow job: %v", err)
		}
		gcsKey = fmt.Sprintf("%s://%s", storageProvider, key)
	default:
		if keyType == gcsKeyType {
			keyType = providers.GS
		}
		gcsKey = fmt.Sprintf("%s://%s", keyType, key)
	}

	artifactNames, err := s.StorageArtifactFetcher.artifacts(ctx, gcsKey)
	// Don't care errors that are not supposed logged as http errors, for example
	// context cancelled error due to user cancelled request.
	if err != nil && err != context.Canceled {
		if config.IsNotAllowedBucketError(err) {
			logrus.WithError(err).WithField("gcs-key", gcsKey).Debug("error retrieving artifact names from gcs storage")
		} else {
			logrus.WithError(err).WithField("gcs-key", gcsKey).Warn("error retrieving artifact names from gcs storage")
		}
	}

	artifactNamesSet := sets.NewString(artifactNames...)

	jobName, buildID, err := common.KeyToJob(src)
	if err != nil {
		return artifactNamesSet.List(), fmt.Errorf("error parsing src: %w", err)
	}

	job, err := s.jobAgent.GetProwJob(jobName, buildID)
	if err != nil {
		// we don't return the error because we assume that if we cannot get the prowjob from the jobAgent,
		// then we must already have all the build-logs in gcs
		logrus.Infof("unable to get prowjob from Pod: %v", err)
		return artifactNamesSet.List(), nil
	}

	if job.Spec.PodSpec != nil {
		jobContainers := job.Spec.PodSpec.Containers

		for _, container := range jobContainers {
			logName := singleLogName
			if len(jobContainers) > 1 {
				logName = fmt.Sprintf("%s-%s", container.Name, singleLogName)
			}
			artifactNamesSet.Insert(logName)
		}
	}

	return artifactNamesSet.List(), nil
}

// prowToGCS returns the GCS key corresponding to the given prow key
func (s *Spyglass) prowToGCS(prowKey string) (string, string, error) {
	return common.ProwToGCS(s.JobAgent, s.config, prowKey)
}

// FetchArtifacts constructs and returns Artifact objects for each artifact name in the list.
// This includes getting any handles needed for read write operations, direct artifact links, etc.
func (s *Spyglass) FetchArtifacts(ctx context.Context, src string, podName string, sizeLimit int64, artifactNames []string) ([]api.Artifact, error) {
	return common.FetchArtifacts(ctx, s.JobAgent, s.config, s.StorageArtifactFetcher, s.PodLogArtifactFetcher, src, podName, sizeLimit, artifactNames)
}

func splitSrc(src string) (keyType, key string, err error) {
	split := strings.SplitN(src, "/", 2)
	if len(split) < 2 {
		err = fmt.Errorf("invalid src %s: expected <key-type>/<key>", src)
		return
	}
	keyType = split[0]
	key = split[1]
	return
}


text:
import {Component} from '@angular/core';
import {FormGroup, AbstractControl, FormBuilder, Validators} from '@angular/forms';
import {EmailValidator, EqualPasswordsValidator} from '../../theme/validators';

@Component({
  selector: 'register',
  templateUrl: './register.html',
  styleUrls: ['./register.scss']
})
export class Register {

  public form:FormGroup;
  public name:AbstractControl;
  public email:AbstractControl;
  public password:AbstractControl;
  public repeatPassword:AbstractControl;
  public passwords:FormGroup;

  public submitted:boolean = false;

  constructor(private fb:FormBuilder) {
    this.getform()

  }
  getform(){
       this.form = this.fb.group({
      'name': ['', Validators.compose([Validators.required, Validators.minLength(4)])],
      'email': ['', Validators.compose([Validators.required, EmailValidator.validate])],
      passwords: this.fb.group({
        password: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
        repeatPassword: ['', Validators.compose([Validators.required, Validators.minLength(4)])],
      }, {validator: EqualPasswordsValidator.validate('password', 'repeatPassword')})
    });

    this.name = this.form.controls['name'];
    this.email = this.form.controls['email'];
    this.passwords = <FormGroup> this.form.controls['passwords'];
    this.password = this.passwords.controls['password'];
    this.repeatPassword = this.passwords.controls['repeatPassword'];
  }

  public onSubmit(values:Object):void {
    this.submitted = true;
    if (this.form.valid) {
      // your code goes here
      // console.log(values);
    }
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/ll_package_row"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:orientation="horizontal"
        android:paddingBottom="10dp" >

        <TextView
            android:id="@+id/tv_item_head"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/item"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_call_type"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/call_type"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_unit_price"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/unit_price"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_min_price"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/min_price"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_off_peak_price"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/off_peak_price"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_unit"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/unit"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <TextView
            android:id="@+id/tv_min_unit"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:paddingLeft="5dp"
            android:paddingTop="5dp"
            android:text="@string/min_unit"
            android:textAppearance="?android:attr/textAppearanceSmall" />
    </LinearLayout>

</LinearLayout>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Scheduler;
using System.ComponentModel;

namespace VitaminD.Views
{
    public partial class ReminderListView : PhoneApplicationPage
    {
        #region Attributes

        private ApplicationBarIconButton deleteButton = new ApplicationBarIconButton();
        private ApplicationBarIconButton selectButton = new ApplicationBarIconButton();
        private ApplicationBarIconButton back = new ApplicationBarIconButton();
        private List<ScheduledNotification> notifications = ScheduledActionService.GetActions<ScheduledNotification>() as List<ScheduledNotification>;

        #endregion

        #region constructor

        public ReminderListView()
        {
            InitializeComponent();
            BuildApplicationBar();
            Long.ItemsSource = Notifications;
        }

        #endregion

        #region properties

        public List<ScheduledNotification> Notifications
        {
            get { return notifications; }
            set
            {
                if (notifications != null)
                {
                    notifications = value;
                    NotifyPropertyChanged("Notifications");
                }
            }
        }

        #endregion

        #region methods

        private void BuildApplicationBar()
        {
            ApplicationBar = new ApplicationBar();
            ApplicationBar.Mode = ApplicationBarMode.Default;
            ApplicationBar.Opacity = 0.2;
            ApplicationBar.IsVisible = true;
            ApplicationBar.IsMenuEnabled = false;

            back.IconUri = new Uri("/Assets/back.png", UriKind.Relative);
            back.Text = "back";
            ApplicationBar.Buttons.Add(back);
            back.Click += (s, e) =>
            {
                NavigationService.GoBack();
            };

            selectButton.IconUri = new Uri("/Assets/ApplicationBar.Select.png", UriKind.Relative);
            selectButton.Text = "select";
            selectButton.IsEnabled = true;
            ApplicationBar.Buttons.Add(selectButton);

            selectButton.Click += (s, e) =>
            {
                Long.IsSelectionEnabled = !Long.IsSelectionEnabled;
            };

            deleteButton.IconUri = new Uri("/Assets/delete.png", UriKind.Relative);
            deleteButton.Text = "delete";
            deleteButton.IsEnabled = false;
            ApplicationBar.Buttons.Add(deleteButton);

            deleteButton.Click += (s, e) =>
            {
                DeleteReminder();
            };
        }

        public void DeleteReminder()
        {
            if (Long.SelectedItems.Count == 1)
            {
                if (MessageBox.Show("Do you want to remove this reminder?", "Confirmation", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    ScheduledNotification remind = Notifications.First(r => r.Name == ((ScheduledNotification)(Long.SelectedItems[0])).Name);
                    ScheduledActionService.Remove(remind.Name);
                    MessageBox.Show("Reminder removed");
                    NavigationService.GoBack();
                }
            }
            else
            {
                if (MessageBox.Show("Do you want to remove these reminders?", "Confirmation", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    foreach (ScheduledNotification item in Long.SelectedItems)
                    {
                        ScheduledNotification remind = Notifications.First(r => r.Name == item.Name);
                        ScheduledActionService.Remove(remind.Name);
                    }
                    MessageBox.Show("Reminders removed");
                    NavigationService.GoBack();
                }
            }
        }

        private void Long_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            deleteButton.IsEnabled = (Long.SelectedItems.Count > 0);
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion

    }
}


text:
from horizon import views

class IndexView(views.APIView):
    # A very simple class-based view...
    template_name = 'market/vms/index.html'

    def get_data(self, request, context, *args, **kwargs):
        # Add data to the context here...
	vm1 = {'name': 'Matlab','compute': 'Dell','storage':'HP'}
	vm2 = {'name':'Web Server','compute':'Compute','storage':'Storage'}
	context['virtualMachines'] = [vm1, vm2]
        return context


text:
ESNEXT=./node_modules/.bin/esnext

# By default compile everything and run the tests.
all: test

# Remove the built files.
clean:
	rm -f lib/index.es5.js

# Transpile the source file into ES5 using esnext.
lib/index.es5.js: lib/index.js
	$(ESNEXT) --include-runtime -o $@ $<

# Test both native and transpiled versions by default.
test: test-native test-esnext

# Test that the version built with node's native generator support passes.
test-native: test/shrinker_test.js lib/index.js
	mocha --harmony-generators -R spec test

# Test that the version built with esnext passes.
test-esnext: test/shrinker_test.js lib/index.es5.js
	mocha -R spec test

# Shorthand for transpiling the required files.
transpile: lib/index.es5.js

.PHONY: all clean transpile test test-native test-esnext


text:
package checkpostgresql

import (
	"database/sql"
	"fmt"
	"os"

	"github.com/jessevdk/go-flags"
	"github.com/mackerelio/checkers"
)

type connectionOpts struct {
	postgresqlSetting
	Warn int `short:"w" long:"warning" default:"70" description:"warning if the number of connection is over"`
	Crit int `short:"c" long:"critical" default:"90" description:"critical if the number of connection is over"`
}

func checkConnection(args []string) *checkers.Checker {
	opts := connectionOpts{}
	psr := flags.NewParser(&opts, flags.Default)
	psr.Usage = "connection [OPTIONS]"
	_, err := psr.ParseArgs(args)
	if err != nil {
		os.Exit(1)
	}

	db, err := sql.Open(opts.getDriverAndDataSourceName())
	if err != nil {
		return checkers.Unknown(err.Error())
	}
	defer db.Close()

	statActivityCount := 0
	err = db.QueryRow("SELECT COUNT(*) AS cnt FROM pg_stat_activity").Scan(&statActivityCount)
	if err != nil {
		return checkers.Unknown(err.Error())
	}

	checkSt := checkers.OK
	msg := fmt.Sprintf("%d connections", statActivityCount)
	if statActivityCount > opts.Crit {
		checkSt = checkers.CRITICAL
	} else if statActivityCount > opts.Warn {
		checkSt = checkers.WARNING
	}
	return checkers.NewChecker(checkSt, msg)
}


text:
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## Reporting a Bug

If you don't mind running the problem command (if applicable) in debug
mode and dumping the output in your GitHub issue, it'd be very helpful.

    gethub --debug [<command>]

## Development Environment

To add a feature, fix a bug, or to run a development build of `gethub`
on your machine, you'll need to have [go](http://golang.org/) installed.

You can then build a binary:

    $ go build

And run it:

    $ ./gethub

To install the development binary on your system:

    $ go install

Or run the tests:

    $ go test github.com/pearkes/gethub/steps -v

If you need help with your environment, feel free to open an issue.

## Building Releases

    goxc -pv 0.1.1 -os=linux,arm,windows,darwin
    s3cmd put --recursive  ~/path/to/bin/gethub-xc/VERSION s3://gethub.jack.ly


text:
package nl.han.ica.ap.nlp.model;

/**
 * @author Joell
 *
 */
public class Association {
	private String name;
	private Class childClass;
	private IMultiplicity parentMultiplicity;
	private IMultiplicity childMultiplicity;

	public Association(Class child,String name) {
		this.name = name;
		this.childClass = child;
		childMultiplicity = new ChildMultiplicity();
		parentMultiplicity = new ParentMultiplicity();
	}

	public IMultiplicity getChildMultiplicity() {
		return childMultiplicity;
	}

	public IMultiplicity getParentMultiplicity() {
		return parentMultiplicity;
	}

	public Class getChildClass() {
		return childClass;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setChild(Class child) {
		this.childClass = child;
	}
}


text:
<?php

// get file directory locations
$mc = __DIR__ . '/src/SyHolloway/MrColor/';
$ex = $mc . 'Extension/';
$fm = $mc . 'Format/';

// include all classes
include($mc . 'Color.php');
include($mc . 'Extension.php');
include($mc . 'Format.php');
include($mc . 'ExtensionCollection.php');
include($mc . 'FormatCollection.php');
include($ex . 'Test.php');
include($ex . 'Toolkit.php');
include($ex . 'Formatter.php');
include($fm . 'Rgb.php');
include($fm . 'Hsl.php');


text:
/* eslint-disable */
import * as constants from "./constants";

describe("button/constants", () => {
  it("has an array of available indicators", () => {
    expect(constants).toHavePropertyOfConstants("AVAILABLE_INDICATORS");
  });
});


text:
//
//  Card.h
//  Clock Signal
//
//  Created by Thomas Harte on 23/04/2018.
//  Copyright 2018 Thomas Harte. All rights reserved.
//

#ifndef Card_h
#define Card_h

#include "../../../Processors/6502/6502.hpp"
#include "../../../ClockReceiver/ClockReceiver.hpp"
#include "../../../Activity/Observer.hpp"

namespace Apple {
namespace II {

/*!
	This provides a small subset of the interface offered to cards installed in
	an Apple II, oriented pragmatically around the cards that are implemented.

	The main underlying rule is as it is elsewhere in the emulator: no
	_inaccurate_ simplifications — no provision of information that shouldn't
	actually commute, no interfaces that say they do one thing but which by both
	both sides are coupled through an unwritten understanding of abuse.

	Special notes:

		Devices that announce a select constraint, being interested in acting only
		when their IO or Device select is active will receive just-in-time @c run_for
		notifications, as well as being updated at the end of each of the Apple's
		@c run_for periods, prior to a @c flush.

		Devices that do not announce a select constraint will prima facie receive a
		@c perform_bus_operation every cycle. They'll also receive a @c flush.
		It is **highly** recomended that such devices also implement @c Sleeper
		as they otherwise prima facie require a virtual method call every
		single cycle.
*/
class Card {
	public:
		virtual ~Card() {}
		enum Select: int {
			None		= 0,		// No select line is active.
			IO			= 1 << 0,	// IO select is active; i.e. access is in range $C0x0 to $C0xf.
			Device		= 1 << 1,	// Device select is active; i.e. access is in range $Cx00 to $Cxff.

			C8Region	= 1 << 2,	// Access is to the region $c800 to $cfff, was preceded by at least
									// one Device access to this card, and has not yet been followed up
									// by an access to $cfff.
		};

		/*!
			Advances time by @c cycles, of which @c stretches were stretched.

			This is posted only to cards that announced a select constraint. Cards with
			no constraints, that want to be informed of every machine cycle, will receive
			a call to perform_bus_operation every cycle and should use that for time keeping.
		*/
		virtual void run_for([[maybe_unused]] Cycles cycles, [[maybe_unused]] int stretches) {}

		/// Requests a flush of any pending audio or video output.
		virtual void flush() {}

		/*!
			Performs a bus operation.

			@param select The state of the card's select lines: indicates whether the Apple II
				thinks this card should respond as though this were an IO access, a Device access,
				or it thinks that the card shouldn't respond.
			@param is_read @c true if this is a read cycle; @c false otherwise.
			@param address The current value of the address bus.
			@param value A pointer to the value of the data bus, not accounting input from cards.
				If this is a read cycle, the card is permitted to replace this value with the value
				output by the card, if any. If this is a write cycle, the card should only read
				this value.
		*/
		virtual void perform_bus_operation(Select select, bool is_read, uint16_t address, uint8_t *value) = 0;

		/*!
			Returns the type of bus selects this card is actually interested in.
			As specified, the default is that cards will ask to receive perform_bus_operation
			only when their select lines are active.

			There's a substantial caveat here: cards that register to receive @c None
			will receive a perform_bus_operation every cycle. To reduce the number of
			virtual method calls, they **will not** receive run_for. run_for will propagate
			only to cards that register for IO and/or Device accesses only.
		*/
		int get_select_constraints() const {
			return select_constraints_;
		}

		/*! Cards may supply a target for activity observation if desired. */
		virtual void set_activity_observer([[maybe_unused]] Activity::Observer *observer) {}

		struct Delegate {
			virtual void card_did_change_select_constraints(Card *card) = 0;
		};
		void set_delegate(Delegate *delegate) {
			delegate_ = delegate;
		}

	protected:
		int select_constraints_ = IO | Device;
		Delegate *delegate_ = nullptr;
		void set_select_constraints(int constraints) {
			if(constraints == select_constraints_) return;
			select_constraints_ = constraints;
			if(delegate_) delegate_->card_did_change_select_constraints(this);
		}
};

}
}

#endif /* Card_h */


text:
ssh_authorized_keys_test CHANGELOG
==================================

This file is used to list changes made in each version of the ssh_authorized_keys_test cookbook.

0.1.0
-----
- [your_name] - Initial release of ssh_authorized_keys_test

- - -
Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.

The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.


text:
package org.androidsummit.eventapp.fragments;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;

import org.androidsummit.eventapp.cache.managers.DataManager;
import com.parse.ParseObject;
import com.parse.ParseQuery;

import java.util.List;

/**
 * Abstract fragment used for retrieving a list of parse objects.  It does not define its own UI, therefore the extending must
 * define their own view.
 *
 * Created on 4/20/15.
 */
public abstract class ParseDataListRetrievalFragment<T extends ParseObject> extends Fragment implements DataManager.DataCallbacks {

    public static final String TAG = ParseDataListRetrievalFragment.class.getSimpleName();

    private DataManager mDataManager;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (mDataManager == null) {
            mDataManager = new DataManager(this, getActivity().getApplicationContext());
        }
    }

    /**
     * Subclasses are required to call this method to initiate data retrieval.  You must initialize your view before calling this method
     * since the data request may return instantly.
     */
    public void retrieveData() {
        retrieveData(getQuery());
    }

    public void retrieveDataFromLocal() {
        retrieveDataFromLocal(getQuery());
    }

    /**
     * Callers do not need to specify where to obtain the data from.  This Fragment will attempt to retrieve data from the local data store
     * If no data is found, a request will be made to the server to obtain data.
     */
    protected void retrieveData(final ParseQuery<T> query) {
        mDataManager.retrieveDataObjectList(query, getServerQuery());
    }

    protected void retrieveFromServer(final ParseQuery<T> query) {
        mDataManager.retrieveDataObjectListFromServer(query);
    }

    protected void retrieveDataFromLocal(final ParseQuery<T> query) {
        mDataManager.retrieveDataObjectListFromLocal(query);
    }

    /**
     * Checks the local data base for the same query and clears out any data that may be in there but does not exists on server anymore.
     * Then adds/updates any data that may have changed on the server.
     *
     * @param serverList the list of objects obtained from the server
     */
    protected void syncLocalDataStore(final List<T> serverList) {
        mDataManager.syncLocalDataStore(serverList, getServerQuery());
    }

    /**
     * Save data to local after retrieving from the server so we do not make a network request again.
     *
     * @param list the retrieved data.
     */
    protected void saveToLocal(List<T> list) {
        mDataManager.saveToLocal(list);
    }

    /**
     * This call back is received from the data retriever which will create the same instance of
     * the object that was specified in the query. Therefore it safe to cast it to T
     */
    @SuppressWarnings("unchecked")
    @Override
    public <E extends ParseObject> void onDataRetrieved(E obj, int requestCode) {
        onDataLoaded(obj, requestCode);
    }

    @Override
    public void onDataRetrievalError(int requestCode) {
        onDataError(requestCode);
    }

    /**
     * Invoked when data is successfully retrieved for a secondary query requested by the fragment
     *
     * @param obj the retrieved object
     * @param requestCode the request code for the query
     */
    protected void onDataLoaded(ParseObject obj, int requestCode){
        Log.w(TAG, "Subclass requested data but did not override callback: onDataLoaded(T, int)");
    }

    /**
     * Invoked if the data for secondary query cannot be retrieved
     *
     * @param requestCode the request used for retrieving the data
     */
    protected void onDataError(int requestCode) {
        Log.w(TAG, "Subclass requested data but did not override callback: onDataError(int)");
    }

    /**
     * Invoked if data cannot be retrieved for any reason.
     */
    protected abstract void onDataError();

    /**
     * Invoked when data is successfully retrieved
     *
     * @param list               the list of data
     * @param isLoadedFromServer a boolean specifying whether it was loaded from server
     */
    protected abstract void onDataLoaded(List<T> list, boolean isLoadedFromServer);

    /**
     * Subclasses must define their query which will be used to retrieve data
     *
     * @return a parse query used for retrieving data
     */
    public abstract ParseQuery<T> getQuery();

    /**
     * Invoked if query on local data store fails.  Since parse has no way of resetting the localData store flag.  The caller must provide a
     * separate query in order to retrieve from server
     *
     * @return the query used to retrieve data from server.
     */
    public abstract ParseQuery<T> getServerQuery();

    /**
     * Invoked when data is successfully retrieved either from server or local data store.
     *
     * @param dataList     the list of data objects retrieved
     * @param isFromServer a boolean specifying whether data was retrieved from server or local data store
     */
    @SuppressWarnings("unchecked")
    @Override
    public <E extends ParseObject> void onDataRetrieved(List<E> dataList, boolean isFromServer) {
        onDataLoaded((List<T>) dataList, isFromServer);
    }

    @Override
    public <E extends ParseObject> void onDataRetrieved(E data) {
        //Nothing to do here since only lists are retrieved by this fragment
    }

    @Override
    public void onDataRetrievalError() {
        onDataError();
    }

    @Override
    public void onDataSaved(boolean onServer) {
        Log.w(TAG, "Subclass invoked data save but did not override callback: onDataSaved(boolean)");
    }

    @Override
    public void onDataSaveError() {
        Log.w(TAG, "Subclass invoked data save but did not override callback: onDataSaveError()");
    }

    @Override
    public void onDataDelete(boolean onServer) {
        Log.w(TAG, "Subclass invoked data delete but did not override callback: onDataDelete(boolean)");
    }

    @Override
    public void onDataDeleteError() {
        Log.w(TAG, "Subclass invoked data delete but did not override callback: onDataDeleteError()");
    }
}


text:
<nd2-include data-src="templates/fragments/panel.left.html">
</nd2-include>

    <nd2-include data-src="templates/fragments/bottom.sheet.html"></nd2-include>

Hiligaynun Krush

                    Cards are a convenient means of displaying content composed of different elements. They're also well-suited for showcasing elements whose size or supported actions vary, like photos with captions of variable length.

                    Cards are a convenient means of displaying content composed of different elements. They're also well-suited for showcasing elements whose size or supported actions vary, like photos with captions of variable length.

                    Cards are a convenient means of displaying content composed of different elements. They're also well-suited for showcasing elements whose size or supported actions vary, like photos with captions of variable length.

                    Cards are a convenient means of displaying content composed of different elements. They're also well-suited for showcasing elements whose size or supported actions vary, like photos with captions of variable length.

                    Cards are a convenient means of displaying content composed of different elements. They're also well-suited for showcasing elements whose size or supported actions vary, like photos with captions of variable length.


text:
// $Id: PrintStreamMessenger.java,v 1.2 2003/10/07 21:46:09 idgay Exp $

package net.tinyos.util;

import java.io.*;

public class PrintStreamMessenger implements Messenger {
  private PrintStream ps;

  public PrintStreamMessenger(PrintStream ps) {
    this.ps = ps;
  }

  public void message(String s) {
    ps.println(s);
  }

  public static PrintStreamMessenger err = new PrintStreamMessenger(System.err);
  public static PrintStreamMessenger out = new PrintStreamMessenger(System.out);
}


text:
import { flow, map, sortBy } from 'lodash/fp'

/**
 * API endpoint to search all cerebro plugins
 * @type {String}
 */
const URL = 'https://registry.npmjs.com/-/v1/search?from=0&size=500&text=keywords:cerebro-plugin,cerebro-extracted-plugin'

/**
 * Get all available plugins for Cerebro
 * @return {Promise<Object>}
 */
export default () => (
  fetch(URL)
    .then(response => response.json())
    .then(json => flow(
        sortBy(p => -p.score.detail.popularity),
        map(p => ({
          name: p.package.name,
          version: p.package.version,
          description: p.package.description,
          homepage: p.package.links.homepage,
          repo: p.package.links.repository
        }))
      )(json.objects)
    )
)


text:
> A wrapper for deku components to facilitate easier unit-testing.

## Usage

```js
var Mock = require('component-mock');

var Component = {
  defaultProps: {
    name: 'a'
  },
  render: function ({ props }) {
    return <div>{props.name}</div>;
  }
}

var mock = Mock(Component);

var node = mock.render();
assert.isNode(node, 'div');
assert.hasChildren(node, [ 'a' ]);

var node = mock.render({ props: { name: 'b' } });
assert.isNode(node, 'div');
assert.hasChildren(node, [ 'b' ]);
```

## Mock(Component)

Returns a wrapper object for the `Component`. The goal is that there will be
many methods that reflect various lifecycle events for the deku component.
Currently, we only deal with `render`, but others will be added over time as
we develop good testing strategies.

## mock.render(component)

Calls `Component.render()`. The render function will have all the parameters
it would normally expect generated automatically. (eg: `props`,
`props.children` and `state`)

This also uses `Component.defaultProps` and `Component.initialState()` to ensure
the `component` object is generated accurately.

The `setState` function that is passed is simply a no-op, it won't trigger any
other changes. (as it shouldn't, since this is designed for unit-testing)


text:
<?php

namespace Dashboard\Data;

use Application\Data\ApiResources;
use DvsaCommon\UrlBuilder\NotificationUrlBuilder;

/**
 * Handles calls to API, paths:
 *      /notification/:notificationId[/action]
 *      /notification/person/:personId[/read].
 */
class ApiNotificationResource extends ApiResources
{
    /**
     * @param int $notificationId
     *
     * @return array
     */
    public function markAsRead($notificationId)
    {
        $path = $this->notificationResource($notificationId)->read()->toString();

        return $this->restUpdate($path, [])['data'];
    }

    /**
     * @param int $notificationId
     *
     * @return array
     */
    public function get($notificationId)
    {
        $path = $this->notificationResource($notificationId)->toString();

        return $this->restGet($path)['data'];
    }

    /**
     * @param int $notificationId
     *
     * @return array
     */
    public function archive($notificationId)
    {
        $path = $this->notificationResource($notificationId)->archive()->toString();

        return $this->restUpdate($path, []);
    }

    /**
     * @param int $personId
     *
     * @return array
     */
    public function getInboxNotifications($personId)
    {
        $path = $this->notificationForPersonResource($personId)->toString();

        return $this->restGet($path)['data'];
    }

    /**
     * @param int $personId
     *
     * @return array
     */
    public function getUnreadCount($personId)
    {
        $path = $this->notificationUnreadCountForPerson($personId)->toString();

        return $this->restGet($path)['data'];
    }
    /**
     * @param int $personId
     *
     * @return array
     */
    public function getArchivedNotifications($personId)
    {
        $path = $this->notificationForPersonResource($personId)->queryParam('archived', 1)->toString();

        return $this->restGet($path)['data'];
    }

    /**
     * Calls notification action (nomination).
     *
     * @param int    $personId
     * @param int    $notificationId
     * @param string $action
     *
     * @return array
     */
    public function notificationAction($personId, $notificationId, $action)
    {
        $path = $this->notificationResource($notificationId)->action()->toString();

        $data = [
            'action' => $action,
        ];

        return $this->restUpdate($path, $data)['data'];
    }

    /**
     * @param int $personId
     *
     * @return NotificationUrlBuilder
     */
    private function notificationUnreadCountForPerson($personId)
    {
        return NotificationUrlBuilder::unreadNotificationsCountForPerson($personId);
    }

    /**
     * @param int $personId
     *
     * @return NotificationUrlBuilder
     */
    private function notificationForPersonResource($personId)
    {
        return NotificationUrlBuilder::notificationForPerson()->routeParam('personId', $personId);
    }

    /**
     * @param int $notification
     *
     * @return NotificationUrlBuilder
     */
    private function notificationResource($notification)
    {
        return NotificationUrlBuilder::notification($notification);
    }
}


text:
package jadx.tests.integration.usethis;

import jadx.core.dex.nodes.ClassNode;
import jadx.tests.api.IntegrationTest;

import org.junit.Test;

import static jadx.tests.api.utils.JadxMatchers.containsOne;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.assertThat;

public class TestInlineThis extends IntegrationTest {

	public static class TestCls {
		public int field;

		private void test() {
			TestCls something = this;
			something.method();
			something.field = 123;
		}

		private void method() {
		}
	}

	@Test
	public void test() {
		ClassNode cls = getClassNode(TestCls.class);
		String code = cls.getCode().toString();

		assertThat(code, not(containsString("something")));
		assertThat(code, not(containsString("something.method()")));
		assertThat(code, not(containsString("something.field")));
		assertThat(code, not(containsString("= this")));

		assertThat(code, containsOne("this.field = 123;"));
		assertThat(code, containsOne("method();"));
	}
}


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

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>2.1.27. Exercise: Mechanisms for One-Bit Sensing — 16-223 Introduction to Physical Computing</title>

    <link rel="stylesheet" href="../../../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/guide.css" type="text/css" />

    <link rel="top" title="16-223 Introduction to Physical Computing" href="../../../index.html" />
    <link rel="up" title="2.1. Unit 1 Exercises: Energy, Information, Transduction" href="../../../unit1.html" />
    <link rel="next" title="2.2. Unit 2 Exercises: Signals, Time, and Dynamics" href="../../../unit2.html" />
    <link rel="prev" title="2.1.26. Exercise: Laser Cutting Features and Tolerances" href="../laser-tolerance/laser-tolerance.html" />

Navigation

          index

          modules |

          next |

          previous |

16-223 Introduction to Physical Computing »

2. Assignments »

2.1. Unit 1 Exercises: Energy, Information, Transduction »

2.1.27. Exercise: Mechanisms for One-Bit Sensing¶

Note: this is a new exercise, please provide feedback on errors and
clarity.

2.1.27.1. Objective¶

Design and test a simple mechanical transmission which couples a
mechanical state of interest to a one-bit sensor such as a microswitch.

2.1.27.2. Overview¶

Simple two-state sensors are found throughout many machine designs. They
are often the most efficient feedback solution in terms of cost,
complexity and robustness. Essentially, they reduce the state of the
world down to one bit with carefully chosen semantics, the most
reductionist state model possible. This was phrased elegantly in a 1983
essay by the
late Professor John
McCarthy:

Keep in mind that the thermostat can only be properly considered to
have just three possible thoughts or beliefs. It may believe that
the room is too hot, or that it is too cold, or that it is ok. It
has no other beliefs; for example, it does not believe that it is a
thermostat.

In actual practice, many furnace-only thermostats have only two
beliefs: it is too cold, or it is fine.

The key is arranging the physical design of the system to respond to the
world state in a bimodal way. This exercise explores this idea in
practice through a simple limit switch arrangement.

2.1.27.3. Exercise Details¶

For this exercise, we are providing a sample design to explain the idea,
but we would like you to draw your own design from scratch. However, the
sources for the design can be found in the
physcomp-solidworks
git repository on github.

A common use of switches in machine design is as a limit switch which
detects when a movement has reached one end of the acceptable limit of
travel. This is a type of one-bit touch sensor which uses the fact that
the presence of an object pressing on the switch can have only one
meaning, namely, that the axis has traveled too far. The same approach
applies to door switches, drawer switches, and through-beam limits: the
activation of the switch can have only one semantic meaning in the
context of the process, so it is useful as a one-bit sensor.

The example below is a simple lever extension of a microswitch with the
following features: the pivoting lever responds to an object brushing
past the curved end, the two limit-stop screws prevent the lever from
either damaging the switch or leaving the sensed region, and the switch
flag can be bent for fine-tuning the exact threshold.

2.1.27.4. Steps and observations¶

Choose a simple mechanical process from which to sense a one-bit
state. Some ideas: motor reaching a limit, door opening, person
bumping a table, hook catching a ring, weight exceeding a limit, etc.

Analyze the movement to determine what mechanical position could
serve as a threshold for the state of interest.

Design a simple mechanism to couple the movement to a binary sensor.
The example below can serve as a starting point. A microswitch is a
good sensor for this test as it is cost-effective and
power-efficient. You may also use a magnet and Hall effect sensor or
a photointerrupter and flag if either are more suitable.

Be sure to include travel limits as necessary to keep the sensor
itself in a safe condition.

Test your mechanism. Does it reliably trigger on the condition of
interest? Can you find conditions which induce false positives or
false negatives? How much did you expand the range of motion of the
sensor?

2.1.27.5. Comments¶

This exercise actually understates the potential of one-bit sensors,
because the other available axis is time. A one-bit sensor activating
over time can be viewed as a binary trajectory which can reveal much
about the underlying process via statistical analysis or machine
learning.

2.1.27.6. Other Files¶

DXF with sample cutting plan: switch_trigger_cutting_plan.dxf

Table Of Contents

2.1.27. Exercise: Mechanisms for One-Bit Sensing

2.1.27.1. Objective

2.1.27.2. Overview

2.1.27.3. Exercise Details

2.1.27.4. Steps and observations

2.1.27.5. Comments

2.1.27.6. Other Files

Previous topic

2.1.26. Exercise: Laser Cutting Features and Tolerances

Next topic

2.2. Unit 2 Exercises: Signals, Time, and Dynamics

Quick search

    <form class="search" action="../../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

16-223 Introduction to Physical Computing »

2. Assignments »

2.1. Unit 1 Exercises: Energy, Information, Transduction »

        © Copyright 2015, Garth Zeglin.
      Last updated on 2015-11-10.
      Created using Sphinx 1.3.1.


text:
package systemobject.terminal;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author guy.arieli
 *
 */
public abstract class InOutInputStream extends InputStream {
	protected InputStream in;
	public void setInputStream(InputStream in){
		this.in = in;
	}
	public void close() throws IOException{
		if(in != null){
			in.close();
		}
	}

}


text:
import * as actions from './redux'
import React, {PureComponent} from 'react'
import {connect} from 'react-redux'
import {compact} from '../../utils'
import config from '../../config'
import InputLookup from '../../components/input-lookup'
import Select from 'react-select'

function Option({id, name}) {
  return (
    <option value={id}>{name}</option>
  )
}

class ProductAction extends PureComponent {
  constructor(props) {
    super(props)

    this.state = {
      shelf: null,
      selectedOption: [],
    }

    this.handleFilter = this.handleFilter.bind(this)
    this.handleExport = this.handleExport.bind(this)
    this.parseParams = this.parseParams.bind(this)
    this.onShelfChange = this.onShelfChange.bind(this)
    this.handleOptionChange = this.handleOptionChange.bind(this)
    this.updateProductPriority = this.updateProductPriority.bind(this)
  }

  isMultIdKeyword() {
    const numReg = /^\d+$/
    let ids = this.keyword_node.value.split(',')
    return _.every(ids, id => numReg.test(id.trim()))
  }

  parseParams() {
    const params = {
      keyword: !this.isMultIdKeyword() ? this.keyword_node.value : null,
      id__in: this.isMultIdKeyword() ? this.keyword_node.value : null,
      status__in: this.state.selectedOption.toString(),
      product_type: this.product_type_node.value,
      order_by: this.product_order_node.value,
    }
    if (this.state.shelf != null) {
      params.shelf_id = this.state.shelf.id
    }

    return compact(params)
  }

  handleFilter(e) {
    e.preventDefault()
    this.props.getProductList({
      params: this.parseParams(),
    })
  }

  updateProductPriority(e) {
    this.props.updateProductPriority()
  }

  handleOptionChange(selectedOption) {
    this.setState({selectedOption})
  }

  handleExport(e) {
    e.preventDefault()
    this.props.exportProduct(this.export_node, this.parseParams())
  }

  onShelfChange(shelf) {
    this.setState({
      shelf,
    })
  }

  render() {
    const {selectedOption} = this.state

    return (

          <form onSubmit={this.handleFilter}>

                  关键字

                    <input
                      type='text'
                      className='form-control'
                      placeholder='请输入商品名称、商品 ID'
                      ref={(keyword_node) => { this.keyword_node = keyword_node }}
                    />

                  所属货架
                  <InputLookup onChange={this.onShelfChange} />

                  商品状态

                    <Select
                      onChange={this.handleOptionChange}
                      placeholder='不限'
                      multi
                      simpleValue
                      className='form-select-control'
                      closeOnSelect={false}
                      removeSelected={false}
                      value={selectedOption}
                      options={
                        config
                          .getEnums('product_status')
                          .map(s => ({value: s.id, label: s.name}))
                      }
                    />

                  商品类型

                    <select
                      className='form-control'
                      ref={product_type_node => (this.product_type_node = product_type_node)}
                    >
                      <option value={''}>不限</option>
                      {config.getEnums('product_type').map(s => <Option key={s.id} {...s} />)}
                    </select>

                  排序

                    <select
                      className='form-control'
                      ref={product_order_node => (this.product_order_node = product_order_node)}
                    >
                      <option value={''}>不限</option>
                      {config.getEnums('product_order_by').map(s => <Option key={s.id} {...s} />)}
                    </select>

                    <button
                      className='btn btn-bordered btn-primary'
                      type='submit'
                    >
                      筛选
                    </button>
                    <button
                      className='btn btn-bordered btn-default'
                      type='button'
                      onClick={this.updateProductPriority}
                    >
                      更新优先级
                    </button>
                    <button
                      type='button'
                      className='btn btn-bordered btn-default'
                      ref={(export_node) => { this.export_node = export_node }}
                      onClick={this.handleExport}
                    >
                      导出商品
                    </button>

          </form>

    )
  }
}

export default connect(
  state => ({
    ...state.shelf_list,
  }),
  actions
)(ProductAction)


text:
package teetime.framework;

import org.slf4j.Logger;

public abstract class AbstractConsumerStage<I> extends AbstractStage {

	// Creation of this input port requires to use super and null for both parameters
	// in order to invoke the original AbstractStage.createInputPort() instead of
	// the one overridden in this stage.
	protected final InputPort<I> inputPort = super.createInputPort(null, null);

	public AbstractConsumerStage() {
		super();
	}

	/**
	 * @param logger
	 *            a custom logger (potentially shared by multiple stage instances)
	 */
	public AbstractConsumerStage(final Logger logger) {
		super(logger);
	}

	public final InputPort<I> getInputPort() {
		return this.inputPort;
	}

	@Override
	protected final void execute() throws Exception {
		final I element = this.getInputPort().receive();
		if (null == element) {
			return;
		}

		this.execute(element);
	}

	/**
	 * Contains the logic of this stage and is invoked (possibly multiple times) by the framework.
	 *
	 * @param element
	 *            the next non-null element from the (only) input port of this stage
	 *
	 * @throws Exception
	 *             arbitrary exception triggered by the logic of this stage
	 */
	protected abstract void execute(I element) throws Exception;

	@Override
	protected <T> InputPort<T> createInputPort(final Class<T> type, final String name) {
		String message = String.format("A subtype of %s cannot have more than one input port. Extend %s instead.",
				AbstractConsumerStage.class.getName(),
				AbstractStage.class.getName());
		throw new IllegalStateException(message);
	}

}


text:
/*

Editor controls.

- Creates a WOOT client.
- Connects the web socket.
- Provides display functions for the WOOT client to call.
- Broadcasts changes to the web socket.
*/
//var trace = function() { if (console & console.log) console.log.apply(console, arguments); };
var trace = function() {};

//
// Not all changes need to be broadcast down the web socket
//
// For example, when we insert a character we've received,
// we don't rebroadcast that.
//

var onAir = true; // Are we broadcasting changes?

// Execute a code block without broadcasting the change
function offAir(thunk) {
  var was = onAir;
  onAir = false;
  thunk();
  onAir = was;
}

//
// The editor itself
//

var editor = ace.edit("editor");
editor.setTheme("ace/theme/merbivore");
editor.getSession().getDocument().setNewLineMode("unix");
editor.getSession().setMode("ace/mode/markdown");

//
// Translation of WOOT changes into Ace changes (deltas)
//

// Convert ACE "position" (row/column) to WOOT "index":
function idx(position) {
  return editor.getSession().getDocument().positionToIndex(position);
}

// Covert a WOOT "index" into an ACE "position"
function pos(idx) {
  return editor.getSession().getDocument().indexToPosition(idx);
}

// Convert a WOOT operation to an ACE delta object for WOOT index i:
function asDelta(ch, isVisible, i) {
  return {
    action: isVisible ? "insertText" : "removeText",
    range: {
      start: pos(i),
      end:   pos(i+1)
    },
    text: ch
  };
}

//
// Call back for the WOOT client to trigger side-effects in the editor
// I.e., add and remove characters
//

var updateEditor = function(ch, isVisible, visiblePos) {
  trace("Updating Editor", ch, isVisible, visiblePos);
  var delta = asDelta(ch, isVisible, visiblePos);
  offAir(function() {
    editor.getSession().getDocument().applyDeltas([delta]);
  });
}

// Populate the editor with an existing document
var setEditor = function(text) {
  offAir(function() {
    editor.getSession().getDocument().setValue(text);
  });
};

//
// On page load, create a client and establish a web socket connection
//
// TODO: Make editor read-only until connected to server?

var client;
jQuery(document).ready(function() {
  client = new client.WootClient(setEditor, updateEditor);
  wsInit();
});

//
// Functions to broadcast updates down the web socket
//

// `text` is of arbitrary size. For now we serialize as individual operations:
var broadcast = function(op, text, range) {
  var base = idx(range.start), len = text.length;
  // When removing multiple character, the position for delete does not change:
  function charpos(p) { return op == "insertText" ? base+p : base; }

  for(var p=0; p<len; p++)
    broadcast1(op, text[p], charpos(p));
};

var broadcast1 = function(opType, ch, pos) {
  trace("Broadcasting: ",opType," on ",ch," @ ",pos);
  var op = opType === "insertText" ? client.insert(ch, pos) : client.delete(pos);
  trace("Back out to "+op);
  doSend(op);
};

function cat(lines) {
  var nl = editor.getSession().getDocument().getNewLineCharacter();
  var combined =
   (_.chain(lines)
      .map(function(line) {return line+nl; })
      .reduce(function(acc,line) { return acc+line; })
      .value());
  return combined;
}

//
// Wiring up actions to ACE events
//

var aceCommands = {
  insertText:  function(text,range) { broadcast("insertText", text, range); },
  removeText:  function(text,range) { broadcast("removeText", text, range); },
  insertLines: function(text,range,event) { aceCommands.insertText(cat(event.data.lines), range); },
  removeLines: function(text,range,event) { aceCommands.removeText(cat(event.data.lines), range); }
};

function dispatch(f, text, range, event) {
  _.isFunction(f) ? f(text, range, event) : trace("Ignoring Command ",event.data.action);
}

editor.getSession().on('change', function(e) {
  $('#lastAceEvent').html(e.data.action);
  if (onAir) dispatch(aceCommands[e.data.action], e.data.text, e.data.range, e);
});


text:
#ifndef USERSSUGGESTIONS_H
#define USERSSUGGESTIONS_H

#include "abstracttwittermodel.h"

class TWITTER4QML_EXPORT UsersSuggestions : public AbstractTwitterModel
{
    Q_OBJECT
    Q_PROPERTY(QString lang READ lang WRITE lang NOTIFY langChanged)
    Q_DISABLE_COPY(UsersSuggestions)
public:
    enum Roles {
        name_role = Qt::UserRole + 1
        , slug_role
        , size_role
    };
    explicit UsersSuggestions(QObject *parent = 0);

signals:
    void langChanged(const QString &lang);

protected:
    virtual AuthorizeBy authenticationMethod() const { return AuthorizeByHeader; }
    QString httpMethod() const { return "GET"; }
    QUrl api() const { return QUrl("https://api.twitter.com/1.1/users/suggestions.json"); }
    void parseDone(const QVariant &result);

private:
    ADD_PROPERTY(const QString &, lang, QString)
};

#endif // USERSSUGGESTIONS_H


text:
using NRules.IntegrationTests.TestAssets;

namespace NRules.IntegrationTests.TestRules
{
    public class TwoFactOneForAllCheckRule : BaseRule
    {
        public override void Define()
        {
            FactType1 fact1 = null;

            When()
                .Match<FactType1>(() => fact1, f => f.TestProperty.StartsWith("Valid"))
                .All<FactType2>(f => f.JoinProperty == fact1.TestProperty,
                    f => f.TestProperty.StartsWith("Valid"));
            Then()
                .Do(ctx => Action());
        }
    }
}


text:
@interface ABI42_0_0AIRMapWMSTile : MKAnnotationView <MKOverlay>

@property (nonatomic, weak) ABI42_0_0AIRMap *map;

@property (nonatomic, strong) MKTileOverlay *tileOverlay;
@property (nonatomic, strong) MKTileOverlayRenderer *renderer;
@property (nonatomic, copy) NSString *urlTemplate;
@property NSInteger maximumZ;
@property NSInteger minimumZ;
@property NSInteger tileSize;
@property BOOL shouldReplaceMapContent;

#pragma mark MKOverlay protocol

@property(nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property(nonatomic, readonly) MKMapRect boundingMapRect;
- (BOOL)canReplaceMapContent;
@end

@interface ABI42_0_0TileOverlay : MKTileOverlay
@property (nonatomic) double MapX,MapY,FULL;
@end


text:
var view;
var application;
var set = Ember.set, get = Ember.get;
var trim = Ember.$.trim;

module("Ember.Application", {
  setup: function() {
    Ember.$("#qunit-fixture").html("

HI

HI
");
    Ember.run(function() {
      application = Ember.Application.create({ rootElement: '#one', router: null });
    });
  },

  teardown: function() {
    if (application) {
      Ember.run(function(){ application.destroy(); });
    }
  }
});

test("you can make a new application in a non-overlapping element", function() {
  var app;
  Ember.run(function() {
    app = Ember.Application.create({ rootElement: '#two', router: null });
  });
  Ember.run(function() {
    app.destroy();
  });
  ok(true, "should not raise");
});

test("you cannot make a new application that is a parent of an existing application", function() {
  raises(function() {
    Ember.run(function() {
      Ember.Application.create({ rootElement: '#qunit-fixture' });
    });
  }, Error);
});

test("you cannot make a new application that is a descendent of an existing application", function() {
  raises(function() {
    Ember.run(function() {
      Ember.Application.create({ rootElement: '#one-child' });
    });
  }, Error);
});

test("you cannot make a new application that is a duplicate of an existing application", function() {
  raises(function() {
    Ember.run(function() {
      Ember.Application.create({ rootElement: '#one' });
    });
  }, Error);
});

test("you cannot make two default applications without a rootElement error", function() {
  // Teardown existing
  Ember.run(function() {
    application.destroy();
  });

  Ember.run(function() {
    application = Ember.Application.create({ router: false });
  });
  raises(function() {
    Ember.run(function() {
      Ember.Application.create({ router: false });
    });
  }, Error);
});

test("acts like a namespace", function() {
  var originalLookup = Ember.lookup;

  try {
    var lookup = Ember.lookup = {}, app;
    Ember.run(function() {
      app = lookup.TestApp = Ember.Application.create({ rootElement: '#two', router: false });
    });
    Ember.BOOTED = false;
    app.Foo = Ember.Object.extend();
    equal(app.Foo.toString(), "TestApp.Foo", "Classes pick up their parent namespace");
    Ember.run(function() {
      app.destroy();
    });
  } finally {
    Ember.lookup = originalLookup;
  }
});

var app;

module("Ember.Application initialization", {
  teardown: function() {
    Ember.TEMPLATES = {};
    Ember.run(function(){ app.destroy(); });
  }
});

test('initialized application go to initial route', function() {
  Ember.$("#qunit-fixture").empty();

  Ember.run(function() {
    app = Ember.Application.create({
      rootElement: '#qunit-fixture'
    });

    app.Router.reopen({
      location: 'none'
    });

    app.register('template', 'application',
      Ember.Handlebars.compile("{{outlet}}")
    );

    Ember.TEMPLATES.index = Ember.Handlebars.compile(
      "
Hi from index
"
    );
  });

  equal(Ember.$('#qunit-fixture h1').text(), "Hi from index");
});

test("initialize application via initialize call", function() {
  Ember.$("#qunit-fixture").empty();

  Ember.run(function() {
    app = Ember.Application.create({
      rootElement: '#qunit-fixture'
    });

    app.Router.reopen({
      location: 'none'
    });

    app.ApplicationView = Ember.View.extend({
      template: function() { return "
Hello!
"; }
    });
  });

  // This is not a public way to access the container; we just
  // need to make some assertions about the created router
  var router = app.__container__.lookup('router:main');
  equal(router instanceof Ember.Router, true, "Router was set from initialize call");
  equal(router.location instanceof Ember.NoneLocation, true, "Location was set from location implementation name");
});

test("initialize application with stateManager via initialize call from Router class", function() {
  Ember.$("#qunit-fixture").empty();

  Ember.run(function() {
    app = Ember.Application.create({
      rootElement: '#qunit-fixture'
    });

    app.Router.reopen({
      location: 'none'
    });

    app.register('template', 'application', function() {
      return "
Hello!
";
    });
  });

  var router = app.__container__.lookup('router:main');
  equal(router instanceof Ember.Router, true, "Router was set from initialize call");
  equal(Ember.$("#qunit-fixture h1").text(), "Hello!");
});

test("ApplicationView is inserted into the page", function() {
  Ember.$("#qunit-fixture").empty();

  Ember.run(function() {
    app = Ember.Application.create({
      rootElement: '#qunit-fixture'
    });

    app.ApplicationView = Ember.View.extend({
      render: function(buffer) {
        buffer.push("
Hello!
");
      }
    });

    app.ApplicationController = Ember.Controller.extend();

    app.Router.reopen({
      location: 'none'
    });
  });

  equal(Ember.$("#qunit-fixture").text(), "Hello!");
});

test("Application initialized twice raises error", function() {
  Ember.run(function() {
    app = Ember.Application.create({
      router: false,
      rootElement: '#qunit-fixture'
    });
  });

  raises(function(){
    Ember.run(function() {
      app.initialize();
    });
  }, Error, 'raises error');
});

test("Minimal Application initialized with just an application template", function() {
  Ember.$('#qunit-fixture').html('');
  Ember.run(function () {
    app = Ember.Application.create({
      rootElement: '#qunit-fixture'
    });
  });

  equal(trim(Ember.$('#qunit-fixture').text()), 'Hello World');
});


text:
sudo apt-get update
sudo apt-get install -y autoconf automake libtool
sudo apt-get install -y libpng12-dev
sudo apt-get install -y libjpeg62-dev
sudo apt-get install -y g++
sudo apt-get install -y libtiff4-dev
sudo apt-get install -y libopencv-dev libtesseract-dev
sudo apt-get install -y git
sudo apt-get install -y cmake
sudo apt-get install -y build-essential
sudo apt-get install -y libleptonica-dev
sudo apt-get install -y liblog4cplus-dev
sudo apt-get install -y libcurl3-dev
sudo apt-get install -y python2.7-dev
sudo apt-get install -y tk8.5 tcl8.5 tk8.5-dev tcl8.5-dev
sudo apt-get build-dep -y python-imaging --fix-missing
sudo apt-get install -y imagemagick

# Build Leptonica
wget http://www.leptonica.org/source/leptonica-1.70.tar.gz
tar -zxvf leptonica-1.70.tar.gz
cd leptonica-1.70/
./autobuild
./configure
make
sudo make install
sudo ldconfig

# Build Tesseract
cd ..
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz
tar -zxvf tesseract-ocr-3.02.02.tar.gz
cd tesseract-ocr/
./autogen.sh
./configure
make
sudo make install
sudo ldconfig

# Set Environment Variable
TESSDATA_PREFIX=/usr/local/share/

# Download the relevant Tesseract English Language Packages
cd ..
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
tar -xf tesseract-ocr-3.02.eng.tar.gz
sudo cp -r tesseract-ocr/tessdata $TESSDATA_PREFIX


text:
namespace Entitas {
    public interface IExecuteSystem : ISystem {
        void Execute();
    }
}


text:
package io.t28.shade.processor.factory;

import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;

import java.util.Collections;
import java.util.List;
import java.util.Optional;

import javax.annotation.Nonnull;
import javax.lang.model.element.Modifier;

@SuppressWarnings("NewApi")
public abstract class TypeFactory implements Factory<TypeSpec> {
    @Nonnull
    protected abstract String getName();

    @Nonnull
    protected List<AnnotationSpec> getAnnotations() {
        return Collections.emptyList();
    }

    @Nonnull
    protected List<Modifier> getModifiers() {
        return Collections.emptyList();
    }

    @Nonnull
    protected Optional<TypeName> getSuperClass() {
        return Optional.empty();
    }

    @Nonnull
    protected List<TypeName> getInterfaces() {
        return Collections.emptyList();
    }

    @Nonnull
    protected List<FieldSpec> getFields() {
        return Collections.emptyList();
    }

    @Nonnull
    protected List<MethodSpec> getMethods() {
        return Collections.emptyList();
    }

    @Nonnull
    protected List<TypeSpec> getEnclosedTypes() {
        return Collections.emptyList();
    }

    @Nonnull
    @Override
    public TypeSpec create() {
        final TypeSpec.Builder builder = TypeSpec.classBuilder(getName());
        builder.addAnnotations(getAnnotations());
        getModifiers().forEach(builder::addModifiers);
        getSuperClass().ifPresent(builder::superclass);
        getInterfaces().forEach(builder::addSuperinterface);
        builder.addFields(getFields());
        getMethods().forEach(builder::addMethod);
        getEnclosedTypes().forEach(builder::addType);
        return builder.build();
    }
}


text:
<?php

namespace PEIP\Service;

/**
 * ServiceActivator.
 *
 * @author Timo Michna <timomichna/yahoo.de>
 * @extends \PEIP\ABS\Service\ServiceActivator
 * @implements \PEIP\INF\Message\MessageBuilder, \PEIP\INF\Handler\Handler, \PEIP\INF\Channel\Channel, \PEIP\INF\Channel\SubscribableChannel, \PEIP\INF\Event\Connectable
 */
class ServiceActivator extends \PEIP\ABS\Service\ServiceActivator
{
    /**
     * @param $serviceCallable
     * @param $inputChannel
     * @param $outputChannel
     *
     * @return
     */
    public function __construct($serviceCallable, \PEIP\INF\Channel\Channel $inputChannel = null, \PEIP\INF\Channel\Channel $outputChannel = null)
    {
        $this->serviceCallable = $serviceCallable;
        if (is_object($inputChannel)) {
            $this->setInputChannel($inputChannel);
        }
        if (is_object($outputChannel)) {
            $this->setOutputChannel($outputChannel);
        }
    }
}


text:
package pgproto3

import (
	"encoding/json"
)

type ReadyForQuery struct {
	TxStatus byte
}

// Backend identifies this message as sendable by the PostgreSQL backend.
func (*ReadyForQuery) Backend() {}

// Decode decodes src into dst. src must contain the complete message with the exception of the initial 1 byte message
// type identifier and 4 byte message length.
func (dst *ReadyForQuery) Decode(src []byte) error {
	if len(src) != 1 {
		return &invalidMessageLenErr{messageType: "ReadyForQuery", expectedLen: 1, actualLen: len(src)}
	}

	dst.TxStatus = src[0]

	return nil
}

// Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.
func (src *ReadyForQuery) Encode(dst []byte) []byte {
	return append(dst, 'Z', 0, 0, 0, 5, src.TxStatus)
}

// MarshalJSON implements encoding/json.Marshaler.
func (src ReadyForQuery) MarshalJSON() ([]byte, error) {
	return json.Marshal(struct {
		Type     string
		TxStatus string
	}{
		Type:     "ReadyForQuery",
		TxStatus: string(src.TxStatus),
	})
}


text:
define([
    'dijit/_WidgetBase',
    'dijit/_TemplatedMixin',
    'dijit/_WidgetsInTemplateMixin',
    'dojo/query',
    'dojo/string',
    'dojo/_base/declare',
    'dojo/text!./templates/BooleanProperty.html',
    'xstyle/css!./Hello.css'
], function(_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, query, stringUtil, declare, template) {
    return declare([
        _WidgetBase,
        _TemplatedMixin,
        _WidgetsInTemplateMixin
    ], {

        templateString: template,

        /**
         * the key of the boolean property, default value
         */
        name: 'booleanProperty',

        no_display: '否',
        no_value: 'false',

        yes_display: '是',
        yes_value: 'true',

        startup: function() {
            // call inherited
            this.inherited(arguments);

            // set value
            this._setValueAttr(this.value);
        },

        _setValueAttr: function(/*String*/ value) {
            var valueObject = {};
            valueObject[this.name] = value +'';

            this.formNode.set('value', valueObject);
        },

        _getValueAttr: function() {
            return this.formNode.get('value')[this.name];
        },

        toJson: function() {
            return {
                "type": "boolean",
                "label": this.label,
                "key": this.name,
                "value": this.getValue()[this.name]
            }
        }

    });
});


text:
<p id="wilson_g" data-toggle="tooltip" title="">
Greg Wilson
co-founded the Software Carpentry project in 1998 after receiving
his PhD in Computer Science from the University of Edinburgh. He is
currently the Director of Instructor Training for the Software Carpentry Foundation.
Greg tweets at @gvwilson.