text:
/**
 * Adaptive profiling of transaction duration. The goal of this profiler is to
 * gather more precise information about transaction durations without overheads of
 * collecting precise information about reads, writes, etc.
 *
 * @author Aleksandar Dragojevic aleksandar.dragojevic@epfl.ch
 *
 */

#ifndef WLPDSTM_PROFILING_NON_TX_DURATION_SIMPLE_H_
#define WLPDSTM_PROFILING_NON_TX_DURATION_SIMPLE_H_

#include <stdint.h>

#include "../word.h"
#include "../timing.h"

namespace wlpdstm {

	template<class STATS, class STATS_TYPE>
	class NonTxDurationProfilingSimple {
		public:
			static void GlobalInit() {
				// empty
			}

			void ThreadInit(STATS *stats_);
			void ThreadShutdown();

			/////////////////////
			// callbacks start //
			/////////////////////

			void ThreadStart();
			void ThreadEnd();

			void TxStartStart(int lex_tx_id);
			void TxStartEnd();

			void TxCommitStart();
			void TxCommitEnd();

			void ReadWordStart(Word *addr);
			void ReadWordEnd(Word res);

			void WriteWordStart(Word *addr, Word val, Word mask = LOG_ENTRY_UNMASKED);
			void WriteWordEnd();

			void TxMallocStart(size_t size);
			void TxMallocEnd(void *ptr);

			void TxFreeStart(void *ptr, size_t size);
			void TxFreeEnd();

			void TxRestartStart();
			void TxRestartEnd();

			void TxAbortStart();
			void TxAbortEnd();

			///////////////////
			// callbacks end //
			///////////////////

		protected:
			void RecordDuration();

		protected:
			STATS *stats;

			uint64_t tx_start_cycles;

			enum LastTransactionState {
				NO_TX,
				COMMITTED,
				RESTARTED
			};

			LastTransactionState last_tx_state;
	};
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ThreadInit(STATS *stats_) {
	stats = stats_;
	last_tx_state = NO_TX;
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ThreadShutdown() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::RecordDuration() {
	if(last_tx_state == COMMITTED) {
		stats->IncrementStatisticsPerTxType(STATS_TYPE::TX_DURATION_COMMITTED, get_clock_count() - tx_start_cycles);
		stats->IncrementStatisticsPerTxType(STATS_TYPE::TX_PROFILED_COMMITS);
	} else if(last_tx_state == RESTARTED) {
		stats->IncrementStatisticsPerTxType(STATS_TYPE::TX_DURATION_RESTARTED, get_clock_count() - tx_start_cycles);
		stats->IncrementStatisticsPerTxType(STATS_TYPE::TX_PROFILED_RESTARTS);
	}

	last_tx_state = COMMITTED;
	tx_start_cycles = get_clock_count();
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxStartStart(int lex_tx_id) {
	RecordDuration();
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxStartEnd() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxCommitStart() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxCommitEnd() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ReadWordStart(Word *addr) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ReadWordEnd(Word res) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::WriteWordStart(Word *addr, Word val, Word mask) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::WriteWordEnd() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxMallocStart(size_t size) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxMallocEnd(void *ptr) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxFreeStart(void *ptr, size_t size) {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxFreeEnd() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxRestartStart() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxRestartEnd() {
	last_tx_state = RESTARTED;
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxAbortStart() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::TxAbortEnd() {
	// empty
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ThreadStart() {
	RecordDuration();
}

template<class STATS, class STATS_TYPE>
inline void wlpdstm::NonTxDurationProfilingSimple<STATS, STATS_TYPE>::ThreadEnd() {
	RecordDuration();
}

#endif /* WLPDSTM_PROFILING_NON_TX_DURATION_H_ */


text:
/* @author rich
 * Created on 29-Oct-2003
 *
 * This code is covered by a Creative Commons
 * Attribution, Non Commercial, Share Alike license
 * License
 */
package org.lsmp.djep.djep;
import org.nfunk.jep.*;
import org.lsmp.djep.xjep.*;

import java.util.Observable;
import java.util.Observer;
/**
 * Contains infomation about a PartialDerivative of a variable.
 * Should
 * @author Rich Morris
 * Created on 29-Oct-2003
 */
public class PartialDerivative extends XVariable  implements Observer {

	private DVariable root;
	private String dnames[] = null;
	private String printString;
	/**
	 * Protected constructor, should only be constructed
	 * through the findDerivative method in {@link DVariable DVariable}.
	**/
	protected PartialDerivative(DVariable var, String derivnames[],Node deriv)
	{
		super(var.getName());
		root = var;
		dnames = derivnames;
		setEquation(deriv);
		printString = DVariable.makeDerivString(root.getName(),derivnames);
		root.addObserver(this);
	}

	public String getName() { return printString; }

	/**
	 * Every partial derivative has a root variable
	 * for instance the root variable of dy/dx is y.
	 * This method returns than variable.
	 */
	public DVariable getRoot() { return root; }
	public String[] getDnames() { return dnames; }

	public String toString()
	{
		return printString;
	}

	public PartialDerivative findDerivative(String name,DJep jep)
		throws ParseException
	{
		return root.findDerivative(this,name,jep);
	}

	/**
	 * When the value of the root object is changed
	 * makes the value of this partial derivative invalid.
	 *
	 * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
	 */
	public void update(Observable arg0, Object arg1) {
		if(root.equals(arg0))
		{
			setValidValue(false);
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
package org.drools.eclipse.flow.ruleflow.editor.editpart;

import org.drools.eclipse.DroolsEclipsePlugin;
import org.drools.eclipse.flow.common.editor.core.ModelEvent;
import org.drools.eclipse.flow.common.editor.editpart.ElementEditPart;
import org.drools.eclipse.flow.common.editor.editpart.figure.AbstractElementFigure;
import org.drools.eclipse.flow.ruleflow.core.JoinWrapper;
import org.drools.eclipse.flow.ruleflow.skin.SkinManager;
import org.drools.eclipse.flow.ruleflow.skin.SkinProvider;
import org.drools.eclipse.preferences.IDroolsConstants;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.EllipseAnchor;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.Request;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

/**
 * EditPart for a join node.
 */
public class JoinEditPart extends ElementEditPart {

    private String SKIN =
        DroolsEclipsePlugin.getDefault().getPreferenceStore().getString(IDroolsConstants.SKIN);

    private static final Color color = new Color(Display.getCurrent(), 70, 130, 180);

    protected IFigure createFigure() {
        SkinProvider skinProvider = SkinManager.getInstance().getSkinProvider(SKIN);
        IFigure result = skinProvider.createJoinFigure();
        Rectangle constraint = getElementWrapper().getConstraint();
        if (constraint.width == -1) {
            constraint.width = result.getSize().width;
        }
        if (constraint.height == -1) {
            constraint.height = result.getSize().height;
        }
        getElementWrapper().setConstraint(constraint);
        return result;
    }

    public void modelChanged(ModelEvent event) {
        if (event.getChange() == JoinWrapper.CHANGE_TYPE) {
            refreshVisuals();
        } else {
            super.modelChanged(event);
        }
    }

    protected void refreshVisuals() {
        super.refreshVisuals();
        int type = ((JoinWrapper) getModel()).getJoin().getType();
        ((JoinFigureInterface) getFigure()).setType(type);
    }

    public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart connection) {
        return new EllipseAnchor(getFigure());
    }

    public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart connection) {
        return new EllipseAnchor(getFigure());
    }

    public ConnectionAnchor getSourceConnectionAnchor(Request request) {
        return new EllipseAnchor(getFigure());
    }

    public ConnectionAnchor getTargetConnectionAnchor(Request request) {
        return new EllipseAnchor(getFigure());
    }

    public static interface JoinFigureInterface extends IFigure {
        void setType(int type);
    }

    public static class JoinFigure extends AbstractElementFigure implements JoinFigureInterface {

        private Ellipse ellipse;

        protected void customizeFigure() {
            ellipse = new Ellipse();
            add(ellipse, 0);
            ellipse.setBackgroundColor(color);
            ellipse.setBounds(getBounds());
        }

        public void setBounds(Rectangle rectangle) {
            super.setBounds(rectangle);
            ellipse.setBounds(rectangle);
        }

        public void setSelected(boolean b) {
            super.setSelected(b);
            ellipse.setLineWidth(b ? 3 : 1);
            repaint();
        }

        public void setType(int type) {
            // Do nothing
        }

    }

}


text:
This sample Android app demonstrates
the basics of implementing a Gradle plugin, with an eye towards using it for Android development.

This app is covered in
[the chapter on writing Gradle plugins](https://commonsware.com/Android/previews/writing-a-gradle-plugin)
in [*The Busy Coder's Guide to Android Development*](https://commonsware.com/Android/).


text:
module Fog
  module Compute
    class Cloudstack

      class Real
        # Adds detail for the Resource.
        #
        # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.4/root_admin/addResourceDetail.html]
        def add_resource_detail(*args)
          options = {}
          if args[0].is_a? Hash
            options = args[0]
            options.merge!('command' => 'addResourceDetail')
          else
            options.merge!('command' => 'addResourceDetail',
            'resourcetype' => args[0],
            'details' => args[1],
            'resourceid' => args[2])
          end
          request(options)
        end
      end

    end
  end
end


text:
package com.mcleodmoores.financial.function.credit.configs;

import java.util.Map;
import java.util.Set;

import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.BeanDefinition;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;

import com.opengamma.analytics.financial.credit.creditdefaultswap.StandardCDSQuotingConvention;
import com.opengamma.core.config.Config;
import com.opengamma.core.config.ConfigGroups;
import com.opengamma.financial.analytics.curve.CurveDefinition;
import com.opengamma.financial.analytics.ircurve.strips.CurveNode;
import com.opengamma.id.ObjectId;
import com.opengamma.id.ObjectIdentifiable;
import com.opengamma.util.credit.CreditCurveIdentifier;

/**
 * A definition for a credit spread curve that contains the nodes and information about the type of the quote (e.g. quoted spread, points up-front).
 */
@BeanDefinition
@Config(description = "Credit curve definition", group = ConfigGroups.CURVES)
public class CreditCurveDefinition extends CurveDefinition implements ObjectIdentifiable {
  private static final long serialVersionUID = 1L;

  /**
   * The object identifier, which should be derived from a {@link CreditCurveIdentifier}.
   */
  @PropertyDefinition(validate = "notNull")
  private ObjectId _objectId;

  /**
   * The type of the quote.
   */
  @PropertyDefinition(validate = "notNull")
  private StandardCDSQuotingConvention _quoteConvention;

  /**
   * For the builder.
   */
  CreditCurveDefinition() {
    super();
  }

  /**
   * Constructs a definition.
   *
   * @param name
   *          the name of the definition, not null
   * @param creditCurveIdentifier
   *          the identifier of the curve, not null
   * @param nodes
   *          the curve nodes, not null
   * @param quoteConvention
   *          the convention of the quotes, not null
   */
  public CreditCurveDefinition(final String name, final CreditCurveIdentifier creditCurveIdentifier, final Set<CurveNode> nodes,
      final StandardCDSQuotingConvention quoteConvention) {
    super(name, nodes);
    setObjectId(creditCurveIdentifier.getObjectId());
    setQuoteConvention(quoteConvention);
  }

  //------------------------- AUTOGENERATED START -------------------------
  ///CLOVER:OFF
  /**
   * The meta-bean for {@code CreditCurveDefinition}.
   * @return the meta-bean, not null
   */
  public static CreditCurveDefinition.Meta meta() {
    return CreditCurveDefinition.Meta.INSTANCE;
  }

  static {
    JodaBeanUtils.registerMetaBean(CreditCurveDefinition.Meta.INSTANCE);
  }

  @Override
  public CreditCurveDefinition.Meta metaBean() {
    return CreditCurveDefinition.Meta.INSTANCE;
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the object identifier, which should be derived from a {@link CreditCurveIdentifier}.
   * @return the value of the property, not null
   */
  public ObjectId getObjectId() {
    return _objectId;
  }

  /**
   * Sets the object identifier, which should be derived from a {@link CreditCurveIdentifier}.
   * @param objectId  the new value of the property, not null
   */
  public void setObjectId(ObjectId objectId) {
    JodaBeanUtils.notNull(objectId, "objectId");
    this._objectId = objectId;
  }

  /**
   * Gets the the {@code objectId} property.
   * @return the property, not null
   */
  public final Property<ObjectId> objectId() {
    return metaBean().objectId().createProperty(this);
  }

  //-----------------------------------------------------------------------
  /**
   * Gets the type of the quote.
   * @return the value of the property, not null
   */
  public StandardCDSQuotingConvention getQuoteConvention() {
    return _quoteConvention;
  }

  /**
   * Sets the type of the quote.
   * @param quoteConvention  the new value of the property, not null
   */
  public void setQuoteConvention(StandardCDSQuotingConvention quoteConvention) {
    JodaBeanUtils.notNull(quoteConvention, "quoteConvention");
    this._quoteConvention = quoteConvention;
  }

  /**
   * Gets the the {@code quoteConvention} property.
   * @return the property, not null
   */
  public final Property<StandardCDSQuotingConvention> quoteConvention() {
    return metaBean().quoteConvention().createProperty(this);
  }

  //-----------------------------------------------------------------------
  @Override
  public CreditCurveDefinition clone() {
    return JodaBeanUtils.cloneAlways(this);
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == this) {
      return true;
    }
    if (obj != null && obj.getClass() == this.getClass()) {
      CreditCurveDefinition other = (CreditCurveDefinition) obj;
      return JodaBeanUtils.equal(getObjectId(), other.getObjectId()) &&
          JodaBeanUtils.equal(getQuoteConvention(), other.getQuoteConvention()) &&
          super.equals(obj);
    }
    return false;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = hash * 31 + JodaBeanUtils.hashCode(getObjectId());
    hash = hash * 31 + JodaBeanUtils.hashCode(getQuoteConvention());
    return hash ^ super.hashCode();
  }

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(96);
    buf.append("CreditCurveDefinition{");
    int len = buf.length();
    toString(buf);
    if (buf.length() > len) {
      buf.setLength(buf.length() - 2);
    }
    buf.append('}');
    return buf.toString();
  }

  @Override
  protected void toString(StringBuilder buf) {
    super.toString(buf);
    buf.append("objectId").append('=').append(JodaBeanUtils.toString(getObjectId())).append(',').append(' ');
    buf.append("quoteConvention").append('=').append(JodaBeanUtils.toString(getQuoteConvention())).append(',').append(' ');
  }

  //-----------------------------------------------------------------------
  /**
   * The meta-bean for {@code CreditCurveDefinition}.
   */
  public static class Meta extends CurveDefinition.Meta {
    /**
     * The singleton instance of the meta-bean.
     */
    static final Meta INSTANCE = new Meta();

    /**
     * The meta-property for the {@code objectId} property.
     */
    private final MetaProperty<ObjectId> _objectId = DirectMetaProperty.ofReadWrite(
        this, "objectId", CreditCurveDefinition.class, ObjectId.class);
    /**
     * The meta-property for the {@code quoteConvention} property.
     */
    private final MetaProperty<StandardCDSQuotingConvention> _quoteConvention = DirectMetaProperty.ofReadWrite(
        this, "quoteConvention", CreditCurveDefinition.class, StandardCDSQuotingConvention.class);
    /**
     * The meta-properties.
     */
    private final Map<String, MetaProperty<?>> _metaPropertyMap$ = new DirectMetaPropertyMap(
        this, (DirectMetaPropertyMap) super.metaPropertyMap(),
        "objectId",
        "quoteConvention");

    /**
     * Restricted constructor.
     */
    protected Meta() {
    }

    @Override
    protected MetaProperty<?> metaPropertyGet(String propertyName) {
      switch (propertyName.hashCode()) {
        case 90495162:  // objectId
          return _objectId;
        case 2049149709:  // quoteConvention
          return _quoteConvention;
      }
      return super.metaPropertyGet(propertyName);
    }

    @Override
    public BeanBuilder<? extends CreditCurveDefinition> builder() {
      return new DirectBeanBuilder<CreditCurveDefinition>(new CreditCurveDefinition());
    }

    @Override
    public Class<? extends CreditCurveDefinition> beanType() {
      return CreditCurveDefinition.class;
    }

    @Override
    public Map<String, MetaProperty<?>> metaPropertyMap() {
      return _metaPropertyMap$;
    }

    //-----------------------------------------------------------------------
    /**
     * The meta-property for the {@code objectId} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<ObjectId> objectId() {
      return _objectId;
    }

    /**
     * The meta-property for the {@code quoteConvention} property.
     * @return the meta-property, not null
     */
    public final MetaProperty<StandardCDSQuotingConvention> quoteConvention() {
      return _quoteConvention;
    }

    //-----------------------------------------------------------------------
    @Override
    protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
      switch (propertyName.hashCode()) {
        case 90495162:  // objectId
          return ((CreditCurveDefinition) bean).getObjectId();
        case 2049149709:  // quoteConvention
          return ((CreditCurveDefinition) bean).getQuoteConvention();
      }
      return super.propertyGet(bean, propertyName, quiet);
    }

    @Override
    protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
      switch (propertyName.hashCode()) {
        case 90495162:  // objectId
          ((CreditCurveDefinition) bean).setObjectId((ObjectId) newValue);
          return;
        case 2049149709:  // quoteConvention
          ((CreditCurveDefinition) bean).setQuoteConvention((StandardCDSQuotingConvention) newValue);
          return;
      }
      super.propertySet(bean, propertyName, newValue, quiet);
    }

    @Override
    protected void validate(Bean bean) {
      JodaBeanUtils.notNull(((CreditCurveDefinition) bean)._objectId, "objectId");
      JodaBeanUtils.notNull(((CreditCurveDefinition) bean)._quoteConvention, "quoteConvention");
      super.validate(bean);
    }

  }

  ///CLOVER:ON
  //-------------------------- AUTOGENERATED END --------------------------
}


text:
"use strict";
var argv = require("yargs").argv;
var critical = require("critical").stream;
var gulp = require("gulp");
var gzip = require("gulp-gzip");
var htmlmin = require("gulp-htmlmin");
var prettyData = require("gulp-pretty-data");
var size = require("gulp-size");
var when = require("gulp-if");

// include paths file
var paths = require("../paths");

// 'gulp html' -- does nothing
// 'gulp html --prod' -- minifies and gzips HTML files for production
gulp.task("html", () => {
  return gulp
    .src(paths.siteFolderName + paths.htmlPattern)
    .pipe(
      when(
        argv.prod,
        htmlmin({
          removeComments: true,
          collapseWhitespace: true,
          collapseBooleanAttributes: false,
          removeAttributeQuotes: false,
          removeRedundantAttributes: false,
          minifyJS: true,
          minifyCSS: true
        })
      )
    )
    .pipe(when(argv.prod, size({ title: "optimized HTML" })))
    .pipe(when(argv.prod, gulp.dest(paths.siteFolderName)))
    .pipe(when(argv.prod, gzip({ append: true })))
    .pipe(
      when(
        argv.prod,
        size({
          title: "gzipped HTML",
          gzip: true
        })
      )
    )
    .pipe(when(argv.prod, gulp.dest(paths.siteFolderName)));
});

// 'gulp xml' -- does nothing
// 'gulp xml' --prod'  -- minifies XML and JSON files for production
gulp.task("xml", () => {
  return gulp
    .src(paths.siteFolderName + paths.xmlPattern)
    .pipe(
      when(
        argv.prod,
        prettyData({
          type: "minify",
          preserveComments: true
        })
      )
    )
    .pipe(when(argv.prod, size({ title: "optimized XML" })))
    .pipe(when(argv.prod, gulp.dest(paths.siteFolderName)));
});

// Page dimensions for critical CSS
var pageDimensions = [
  {
    width: 320,
    height: 480
  },
  {
    width: 768,
    height: 1024
  },
  {
    width: 1024,
    height: 1024
  },
  {
    width: 1440,
    height: 1280
  }
];

// 'gulp styles:critical:archive' -- extract layout.archive critical CSS
//   into /_includes/critical-archive.css
gulp.task("styles:critical:archive", () => {
  return gulp
    .src(paths.tempDir + paths.siteDir + "mastering-paper/index.html")
    .pipe(
      critical({
        base: paths.tempDir,
        inline: false,
        css: [paths.sassFilesTemp + "/main.css"],
        dimensions: pageDimensions,
        dest:
          paths.sourceDir + paths.includesFolderName + "/critical-archive.css",
        minify: true,
        extract: false,
        ignore: ["@font-face", "/print/", /url\(/, ".popular-list"] // defer loading of webfonts and background images
      })
    );
});

// 'gulp styles:critical:post' -- extract layout.post critical CSS
//   into /_includes/critical-post.css
gulp.task("styles:critical:post", () => {
  return gulp
    .src(paths.tempDir + paths.siteDir + "articles/ipad-pro/index.html")
    .pipe(
      critical({
        base: paths.tempDir,
        inline: false,
        css: [paths.sassFilesTemp + "/main.css"],
        dimensions: pageDimensions,
        dest: paths.sourceDir + paths.includesFolderName + "/critical-post.css",
        minify: true,
        extract: false,
        ignore: ["@font-face", "/print/", /url\(/, ".popular-list"] // defer loading of webfonts and background images
      })
    );
});

// 'gulp styles:critical:home' -- extract layout.home critical CSS
//   into /_includes/critical-home.css
gulp.task("styles:critical:home", () => {
  return gulp.src(paths.tempDir + paths.siteDir + "index.html").pipe(
    critical({
      base: paths.tempDir,
      css: [paths.sassFilesTemp + "/main.css"],
      dimensions: pageDimensions,
      dest: paths.sourceDir + paths.includesFolderName + "/critical-home.css",
      minify: true,
      extract: false,
      ignore: ["@font-face", "/print/", /url\(/, ".popular-list"] // defer loading of webfonts and background images
    })
  );
});


text:
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="Pregnancies - Current">
    <columns>
        <column name="updatelink"/>
        <column name="id"/>
        <column name="sireid"/>
        <!--<column name="date"/>-->
        <column name="date_conception"/>
        <column name="conception_range"/>
        <column name="date_conception_plus_30"/>
        <column name="date_conception_plus_60"/>
        <column name="date_conception_plus_90"/>
        <column name="date_conception_plus_120"/>
        <column name="date_conception_plus_150"/>
        <column name="date_conception_plus_165"/>
        <column name="date_due_range"/>
        <column name="gestation_day_range"/>
        <column name="date_due"/>
        <column name="gestation_day"/>
    </columns>
    <filters>
        <filter column="outcome_date"   operator="isblank"/>
    </filters>
</customView>


text:
package http

import (
	"fmt"
	dsl "github.com/Cepave/query/dsl/nqm_parser"
	"github.com/Cepave/query/nqm"
	"github.com/Cepave/query/g"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/context"
	"github.com/bitly/go-simplejson"
	"log"
	"net/http"
	"strings"
	"time"
	"runtime/debug"
	"strconv"
)

const (
	jsonIndent = false
	jsonCoding = false
)

var nqmService nqm.ServiceController
func configNqmRoutes() {
	nqmService = nqm.GetDefaultServiceController()
	nqmService.Init()

	/**
	 * Registers the handler of RESTful service on beego
	 */
	serviceController := beego.NewControllerRegister()
	setupUrlMappingAndHandler(serviceController)
	// :~)

	http.Handle("/nqm/", serviceController)
}

func setupUrlMappingAndHandler(serviceRegister *beego.ControllerRegister) {
	serviceRegister.AddMethod(
		"get", "/nqm/icmp/list/by-provinces",
		listIcmpByProvinces,
	)
	serviceRegister.AddMethod(
		"get", "/nqm/icmp/province/:province_id([0-9]+)/list/by-targets",
		listIcmpByTargetsForAProvince,
	)
	serviceRegister.AddMethod(
		"get", "/nqm/province/:province_id([0-9]+)/agents",
		listAgentsInProvince,
	)
}

type resultWithDsl struct {
	queryParams *dsl.QueryParams
	resultData interface{}
}

func (result *resultWithDsl) MarshalJSON() ([]byte, error) {
	jsonObject := simplejson.New()

	jsonObject.SetPath([]string{ "dsl", "start_time" }, result.queryParams.StartTime.Unix())
	jsonObject.SetPath([]string{ "dsl", "end_time" }, result.queryParams.EndTime.Unix())
	jsonObject.Set("result", result.resultData)

	return jsonObject.MarshalJSON()
}

// Lists agents(grouped by city) for a province
func listAgentsInProvince(ctx *context.Context) {
	provinceId, _ := strconv.ParseInt(ctx.Input.Param(":province_id"), 10, 16)
	ctx.Output.JSON(nqm.ListAgentsInCityByProvinceId(int32(provinceId)), jsonIndent, jsonCoding)
}

// Lists statistics data of ICMP, which would be grouped by provinces
func listIcmpByProvinces(ctx *context.Context) {
	defer outputJsonForPanic(ctx)

	dslParams, isValid := processDslAndOutputError(ctx, ctx.Input.Query("dsl"))
	if !isValid {
		return
	}

	listResult := nqmService.ListByProvinces(dslParams)

	ctx.Output.JSON(&resultWithDsl{ queryParams: dslParams, resultData: listResult }, jsonIndent, jsonCoding)
}

// Lists data of targets, which would be grouped by cities
func listIcmpByTargetsForAProvince(ctx *context.Context) {
	defer outputJsonForPanic(ctx)

	dslParams, isValid := processDslAndOutputError(ctx, ctx.Input.Query("dsl"))
	if !isValid {
		return
	}

	dslParams.AgentFilter.MatchProvinces = make([]string, 0) // Ignores the province of agent

	provinceId, _ := strconv.ParseInt(ctx.Input.Param(":province_id"), 10, 16)
	dslParams.AgentFilterById.MatchProvinces = []int16 { int16(provinceId) } // Use the id as the filter of agent

	if agentId, parseErrForAgentId := strconv.ParseInt(ctx.Input.Query("agent_id"), 10, 16)
		parseErrForAgentId == nil {
		dslParams.AgentFilterById.MatchIds = []int32 { int32(agentId) } // Set the filter by agent's id
	} else if cityId, parseErrForCityId := strconv.ParseInt(ctx.Input.Query("city_id_of_agent"), 10, 16)
		parseErrForCityId == nil {
		dslParams.AgentFilterById.MatchCities = []int16 { int16(cityId) } // Set the filter by city's id
	}

	listResult := nqmService.ListTargetsWithCityDetail(dslParams)
	ctx.Output.JSON(&resultWithDsl{ queryParams: dslParams, resultData: listResult }, jsonIndent, jsonCoding)
}

type jsonDslError struct {
	Code int `json:"error_code"`
	Message string `json:"error_message"`
}
func outputDslError(ctx *context.Context, err error) {
	ctx.Output.SetStatus(http.StatusBadRequest)
	ctx.Output.JSON(
		&jsonDslError {
			Code: 1,
			Message: err.Error(),
		}, jsonIndent, jsonCoding,
	)
}

// Used to output JSON message even if the execution is panic
func outputJsonForPanic(ctx *context.Context) {
	r := recover()
	if r == nil {
		return
	}

	if g.Config().Debug {
		debug.PrintStack()
	}

	log.Printf("Error on HTTP Request[%v/%v]. Error: %v", ctx.Input.Method(), ctx.Input.URI(), r)

	ctx.Output.SetStatus(http.StatusBadRequest)
	ctx.Output.JSON(&jsonDslError{
		Code: -1,
		Message: fmt.Sprintf("%v", r),
	}, jsonIndent, jsonCoding)
}

const (
	defaultDaysForTimeRange = 7
	after7Days = defaultDaysForTimeRange * 24 * time.Hour
	before7Days = after7Days * -1
)

// Process DSL and output error
// Returns: true if the DSL is valid
func processDslAndOutputError(ctx *context.Context, dslText string) (*dsl.QueryParams, bool) {
	dslParams, err := processDsl(dslText)

	if err != nil {
		outputDslError(ctx, err)
		return nil, false
	}

	return dslParams, true
}

// The query of DSL would be inner-province(used for phase 1)
func processDsl(dslParams string) (*dsl.QueryParams, error) {
	strNqmDsl := strings.TrimSpace(dslParams)

	/**
	 * If any of errors for parsing DSL
	 */
	result, parseError := dsl.Parse(
		"Query.nqmdsl", []byte(strNqmDsl),
	)
	if parseError != nil {
		return nil, parseError
	}
	// :~)

	resultDsl := result.(*dsl.QueryParams)

	setupTimeRange(resultDsl)
	setupInnerProvince(resultDsl)

	paramsError := resultDsl.CheckRationalOfParameters()
	if paramsError != nil {
		return nil, paramsError
	}

	return resultDsl, nil
}

// Sets-up the time range with provided-or-not value of parameters
// 1. Without any parameter of time range
// 2. Has only start time
// 3. Has only end time
func setupTimeRange(queryParams *dsl.QueryParams) {
	if queryParams.StartTime.IsZero() && queryParams.EndTime.IsZero() {
		now := time.Now()

		queryParams.StartTime = now.Add(before7Days) // Include 7 days before
		queryParams.EndTime = now.Add(24 * time.Hour) // Include today
		return
	}

	if queryParams.StartTime.IsZero() && !queryParams.EndTime.IsZero() {
		queryParams.StartTime = queryParams.EndTime.Add(before7Days)
		return
	}

	if !queryParams.StartTime.IsZero() && queryParams.EndTime.IsZero() {
		queryParams.EndTime = queryParams.StartTime.Add(after7Days)
		return
	}

	if queryParams.StartTime.Unix() == queryParams.EndTime.Unix() {
		queryParams.EndTime = queryParams.StartTime.Add(24 * time.Hour)
	}
}

/**
 * !IMPORTANT!
 * This default value is just used in phase 1 funcion of NQM reporting(inner-province)
 */
func setupInnerProvince(queryParams *dsl.QueryParams) {
	queryParams.ProvinceRelation = dsl.SAME_VALUE
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>citrus-model</artifactId>
    <groupId>com.consol.citrus.model</groupId>
    <version>2.7-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <groupId>com.consol.citrus.model</groupId>
  <artifactId>citrus-model-zookeeper</artifactId>
  <name>citrus-model-zookeeper</name>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <encoding>${file.encoding}</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jaxb2-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>xjc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <extension>true</extension>
          <sourceType>xmlschema</sourceType>
          <sources>
            <source>src/main/resources/com/consol/citrus/schema/citrus-zookeeper-config.xsd</source>
            <source>src/main/resources/com/consol/citrus/schema/citrus-zookeeper-testcase.xsd</source>
          </sources>
          <xjbSources>
            <xjbSource>src/main/resources/binding.xjb</xjbSource>
          </xjbSources>
        </configuration>
      </plugin>

    </plugins>
  </build>

</project>


text:
<?xml version="1.0" encoding="utf-8" ?>
<results>
<result>
<athlete_id>121786</athlete_id>
<gender>M</gender>
<personalBest>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.65</result>
<wind></wind>
<rank>3</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12847990</competition_ID>
<compName></compName>
<date>2014-02-15</date>
<venue>Potsdam</venue>
<venueCountry>GER</venueCountry>
</personalBest>
<personalBest>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.70</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12871518</competition_ID>
<compName></compName>
<date>2016-04-02</date>
<venue>Austin TX</venue>
<venueCountry>USA</venueCountry>
</personalBest>
<seasonalBest>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.70</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12871518</competition_ID>
<compName></compName>
<date>2016-04-02</date>
<venue>Austin TX</venue>
<venueCountry>USA</venueCountry>
</seasonalBest>
<athleteresulthistory>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.06</result>
<wind></wind>
<rank>1</rank>
<round>-16</round>
<roundstage>Final</roundstage>
<agegroup>Under 17</agegroup>
<competition_ID>12794136</competition_ID>
<compName></compName>
<date>2010-02-28</date>
<venue>Norrköping</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.00</result>
<wind></wind>
<rank>1</rank>
<round>-17</round>
<roundstage>Final</roundstage>
<agegroup>Under 18</agegroup>
<competition_ID>12797320</competition_ID>
<compName></compName>
<date>2010-05-23</date>
<venue>Moskva</venue>
<venueCountry>RUS</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.11</result>
<wind></wind>
<rank>1</rank>
<round>-17</round>
<roundstage>Final</roundstage>
<agegroup>Under 18</agegroup>
<competition_ID>12799284</competition_ID>
<compName></compName>
<date>2010-07-03</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.00</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12800242</competition_ID>
<compName></compName>
<date>2010-07-17</date>
<venue>Halmstad</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.10</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12800239</competition_ID>
<compName></compName>
<date>2010-08-03</date>
<venue>Malmö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>4.85</result>
<wind></wind>
<rank>4</rank>
<round>-17</round>
<roundstage>Final</roundstage>
<agegroup>Under 18</agegroup>
<competition_ID>12800536</competition_ID>
<compName></compName>
<date>2010-08-23</date>
<venue>Singapore</venue>
<venueCountry>SIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.00</result>
<wind></wind>
<rank>1</rank>
<round>-16</round>
<roundstage>Final</roundstage>
<agegroup>Under 17</agegroup>
<competition_ID>12801911</competition_ID>
<compName></compName>
<date>2010-09-11</date>
<venue>Västerås</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12805059</competition_ID>
<compName></compName>
<date>2011-01-15</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.25</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12805623</competition_ID>
<compName></compName>
<date>2011-01-22</date>
<venue>Malmö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.20</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12805836</competition_ID>
<compName>Pallas Spelen, Atleticum</compName>
<date>2011-01-29</date>
<venue>Malmö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.45</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12806077</competition_ID>
<compName>Finland-Sweden-Norway International Match</compName>
<date>2011-02-05</date>
<venue>Tampere</venue>
<venueCountry>FIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.25</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12806732</competition_ID>
<compName>Sparta hallen</compName>
<date>2011-02-15</date>
<venue>København</venue>
<venueCountry>DEN</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.31</result>
<wind></wind>
<rank>1</rank>
<round>-17</round>
<roundstage>Final</roundstage>
<agegroup>Under 18</agegroup>
<competition_ID>12806928</competition_ID>
<compName>Swedish U23, U20 and U18 National Championships</compName>
<date>2011-02-19</date>
<venue>Sätra</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.35</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12807207</competition_ID>
<compName>National Indoor Championships</compName>
<date>2011-02-26</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.33</result>
<wind></wind>
<rank>6</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12811296</competition_ID>
<compName></compName>
<date>2011-06-03</date>
<venue>Recklinghausen</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12811486</competition_ID>
<compName>Poks Memorial, Folksam Challenge, Göingevallen</compName>
<date>2011-06-12</date>
<venue>Hässleholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>4.80</result>
<wind></wind>
<rank>7=</rank>
<round>q-17</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12812827</competition_ID>
<compName></compName>
<date>2011-07-08</date>
<venue>Villeneuve d'Ascq</venue>
<venueCountry>FRA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.15</result>
<wind></wind>
<rank>2</rank>
<round>-17</round>
<roundstage>Final</roundstage>
<agegroup>Under 18</agegroup>
<competition_ID>12812827</competition_ID>
<compName></compName>
<date>2011-07-10</date>
<venue>Villeneuve d'Ascq</venue>
<venueCountry>FRA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.02</result>
<wind></wind>
<rank>10</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12823228</competition_ID>
<compName>9th Tadeusz Ślusarski Memorial</compName>
<date>2012-05-20</date>
<venue>Żary</venue>
<venueCountry>POL</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12823642</competition_ID>
<compName></compName>
<date>2012-06-02</date>
<venue>Örebro</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.24</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12823612</competition_ID>
<compName>Folksam Challenge, Göingevallen</compName>
<date>2012-06-06</date>
<venue>Hässleholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.05</result>
<wind></wind>
<rank>12=</rank>
<round>q-19</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12824526</competition_ID>
<compName></compName>
<date>2012-07-10</date>
<venue>Barcelona</venue>
<venueCountry>ESP</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.35</result>
<wind></wind>
<rank>6</rank>
<round>-19</round>
<roundstage>Final</roundstage>
<agegroup>Under 20</agegroup>
<competition_ID>12824526</competition_ID>
<compName></compName>
<date>2012-07-12</date>
<venue>Barcelona</venue>
<venueCountry>ESP</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12824747</competition_ID>
<compName>Karlstad Grand Prix, Folksam Grand Prix</compName>
<date>2012-07-19</date>
<venue>Karlstad</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.22</result>
<wind></wind>
<rank>1</rank>
<round>-19</round>
<roundstage>Final</roundstage>
<agegroup>Under 20</agegroup>
<competition_ID>12825315</competition_ID>
<compName>Nordic Junior Championships</compName>
<date>2012-08-19</date>
<venue>Växjö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.39</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12825373</competition_ID>
<compName></compName>
<date>2012-08-25</date>
<venue>Stockholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.48</result>
<wind></wind>
<rank>3</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12825477</competition_ID>
<compName></compName>
<date>2012-09-02</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.20</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12828364</competition_ID>
<compName>Pallas Spelen, Atleticum</compName>
<date>2013-01-26</date>
<venue>Malmö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.40</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12838822</competition_ID>
<compName>Tähtien Kisat, Stars' Games, Pirkkahalli</compName>
<date>2013-02-03</date>
<venue>Tampere</venue>
<venueCountry>FIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.23</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12839005</competition_ID>
<compName>Nordenkampen, Sweden, Finland & Norway International Match, Nordenkampen</compName>
<date>2013-02-09</date>
<venue>Växjö</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.45</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12839228</competition_ID>
<compName></compName>
<date>2013-02-17</date>
<venue>Norrköping</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.50</result>
<wind></wind>
<rank>14</rank>
<round>q</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12839558</competition_ID>
<compName>32nd European Athletics Indoor Championships, Scandinavium</compName>
<date>2013-03-02</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.14</result>
<wind></wind>
<rank>4</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12845606</competition_ID>
<compName></compName>
<date>2013-05-24</date>
<venue>Recklinghausen</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12841924</competition_ID>
<compName>AtletiCAGenève</compName>
<date>2013-06-01</date>
<venue>Genève</venue>
<venueCountry>SUI</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.20</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12843202</competition_ID>
<compName>Rosenbomsspelen</compName>
<date>2013-06-16</date>
<venue>Karlskrona</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.50</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12843647</competition_ID>
<compName></compName>
<date>2013-07-05</date>
<venue>Rieti</venue>
<venueCountry>ITA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>1</rank>
<round>-19</round>
<roundstage>Final</roundstage>
<agegroup>Under 20</agegroup>
<competition_ID>12844213</competition_ID>
<compName>National U23, U20 and U18 Championships</compName>
<date>2013-08-09</date>
<venue>Västerås</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>1</rank>
<round>-19</round>
<roundstage>Final</roundstage>
<agegroup>Under 20</agegroup>
<competition_ID>12844248</competition_ID>
<compName></compName>
<date>2013-08-18</date>
<venue>Espoo</venue>
<venueCountry>FIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12844362</competition_ID>
<compName>National Championships, Friidrotts-SM, Ryavallen (Shot put Stora Torget)</compName>
<date>2013-08-30</date>
<venue>Borås</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12844419</competition_ID>
<compName>63rd Memorial Boris Hanžeković, Športski park Mladost, IAAF World Challenge</compName>
<date>2013-09-03</date>
<venue>Zagreb</venue>
<venueCountry>CRO</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12844470</competition_ID>
<compName></compName>
<date>2013-09-08</date>
<venue>Stockholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12847450</competition_ID>
<compName>Gugl Indoor</compName>
<date>2014-01-30</date>
<venue>Linz</venue>
<venueCountry>AUT</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.25</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12847627</competition_ID>
<compName>KA 2-spelen</compName>
<date>2014-02-02</date>
<venue>Karlskrona</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.55</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12847727</competition_ID>
<compName>Indoor Match FIN-SWE-NOR-DEN, Pirkkahalli (300m track)</compName>
<date>2014-02-08</date>
<venue>Tampere</venue>
<venueCountry>FIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.65</result>
<wind></wind>
<rank>3</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12847990</competition_ID>
<compName></compName>
<date>2014-02-15</date>
<venue>Potsdam</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12848219</competition_ID>
<compName></compName>
<date>2014-02-22</date>
<venue>Göteborg</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.54</result>
<wind></wind>
<rank>4</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12848296</competition_ID>
<compName>Praha Indoor 2014, O2 Arena</compName>
<date>2014-02-25</date>
<venue>Praha</venue>
<venueCountry>CZE</venueCountry>
</record>
<record>
<IndoorOutdoor>Indoor</IndoorOutdoor>
<event>PV</event>
<result>5.54</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12848349</competition_ID>
<compName></compName>
<date>2014-03-01</date>
<venue>Bad Oeynhausen</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.60</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12851531</competition_ID>
<compName>EM-Normwettkampf Stabhochsprung</compName>
<date>2014-05-31</date>
<venue>Soest</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.35</result>
<wind></wind>
<rank>8</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12851686</competition_ID>
<compName>AA-Drink Fanny Blankers-Koen Games, IAAF World Challenge</compName>
<date>2014-06-08</date>
<venue>Hengelo</venue>
<venueCountry>NED</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.51</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12851999</competition_ID>
<compName>AtletiCAGeneve, Mémorial Georges Caillat, 27th Meeting International de Genève, State du Bont-du-Monde</compName>
<date>2014-06-14</date>
<venue>Genève</venue>
<venueCountry>SUI</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.43</result>
<wind></wind>
<rank>8</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12852032</competition_ID>
<compName></compName>
<date>2014-06-17</date>
<venue>Ostrava</venue>
<venueCountry>CZE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12852330</competition_ID>
<compName>5th European Athletics Team Championships</compName>
<date>2014-06-22</date>
<venue>Braunschweig</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.42</result>
<wind></wind>
<rank>1</rank>
<round>-22</round>
<roundstage>Final</roundstage>
<agegroup>Under 23</agegroup>
<competition_ID>12853414</competition_ID>
<compName></compName>
<date>2014-07-27</date>
<venue>København</venue>
<venueCountry>DEN</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.32</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12853510</competition_ID>
<compName></compName>
<date>2014-08-02</date>
<venue>Umeå</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.30</result>
<wind></wind>
<rank>19</rank>
<round>q</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12853650</competition_ID>
<compName>22nd European Athletics Championships, Letzigrund Stadium</compName>
<date>2014-08-14</date>
<venue>Zürich</venue>
<venueCountry>SUI</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.45</result>
<wind></wind>
<rank>4</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12853754</competition_ID>
<compName>DN Galan, IAAF Diamond League, Olympic Stadium</compName>
<date>2014-08-21</date>
<venue>Stockholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.40</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12853854</competition_ID>
<compName></compName>
<date>2014-08-31</date>
<venue>Helsinki</venue>
<venueCountry>FIN</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12853955</competition_ID>
<compName>64th Memorial Boris Hanžeković, Športski park Mladost, IAAF World Challenge</compName>
<date>2014-09-02</date>
<venue>Zagreb</venue>
<venueCountry>CRO</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.15</result>
<wind></wind>
<rank>8</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12854010</competition_ID>
<compName></compName>
<date>2014-09-07</date>
<venue>Rieti</venue>
<venueCountry>ITA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.70</result>
<wind></wind>
<rank>2</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12871518</competition_ID>
<compName></compName>
<date>2016-04-02</date>
<venue>Austin TX</venue>
<venueCountry>USA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.55</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12871851</competition_ID>
<compName>Rafer Johnson-Jackie Joyner Kersee Invitational, Drake Stadium</compName>
<date>2016-04-09</date>
<venue>Westwood CA</venue>
<venueCountry>USA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.60</result>
<wind></wind>
<rank>1</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12872044</competition_ID>
<compName></compName>
<date>2016-04-16</date>
<venue>Norwalk CA</venue>
<venueCountry>USA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.45</result>
<wind></wind>
<rank>4</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12872380</competition_ID>
<compName>Chula Vista Throws/Vault</compName>
<date>2016-04-21</date>
<venue>Chula Vista CA</venue>
<venueCountry>USA</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.35</result>
<wind></wind>
<rank>4</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12875314</competition_ID>
<compName>Himmelsstürmer-Cup</compName>
<date>2016-06-12</date>
<venue>Zweibrücken</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.50</result>
<wind></wind>
<rank>5</rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12875503</competition_ID>
<compName></compName>
<date>2016-06-16</date>
<venue>Stockholm</venue>
<venueCountry>SWE</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12876010</competition_ID>
<compName>7th Stabhochsprung-Classics</compName>
<date>2016-06-24</date>
<venue>Leverkusen</venue>
<venueCountry>GER</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result>5.50</result>
<wind></wind>
<rank>9=</rank>
<round>q</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12876245</competition_ID>
<compName>23rd European Athletics Championships, Olympic Stadium</compName>
<date>2016-07-06</date>
<venue>Amsterdam</venue>
<venueCountry>NED</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round></round>
<roundstage>Final</roundstage>
<agegroup></agegroup>
<competition_ID>12876245</competition_ID>
<compName></compName>
<date>2016-07-08</date>
<venue>Amsterdam</venue>
<venueCountry>NED</venueCountry>
</record>
<record>
<IndoorOutdoor>Outdoor</IndoorOutdoor>
<event>PV</event>
<result></result>
<wind></wind>
<rank></rank>
<round>q</round>
<roundstage>Prelim</roundstage>
<agegroup></agegroup>
<competition_ID>12877460</competition_ID>
<compName></compName>
<date>2016-08-13</date>
<venue>Río de Janeiro</venue>
<venueCountry>BRA</venueCountry>
</record>
</athleteresulthistory>
</result>
</results>


text:
'use strict';

const RuleExecutor = require('./rule_executor');
const RetryExecutor = require('./retry_executor');
const Rule = require('./rule');
const P = require('bluebird');
const stringify = require('fast-json-stable-stringify');

class BasicSubscription {
    constructor(options, kafkaFactory, hyper, ruleName, ruleSpec) {
        this._kafkaFactory = kafkaFactory;
        this._options = options;
        this._hyper = hyper;
        ruleSpec.sample =  ruleSpec.sample || options.sample;
        this._rule = new Rule(ruleName, ruleSpec);
        this._subscribed = false;
        this._executor = new RuleExecutor(this._rule, this._kafkaFactory,
            hyper, this._options);
        this._retryExecutor = new RetryExecutor(this._rule, this._kafkaFactory,
            hyper, this._options);
    }

    subscribe() {
        if (this._subscribed) {
            throw new Error('Already subscribed!');
        }

        this._hyper.logger.log('info/subscription', {
            message: 'Subscribing based on basic topics',
            rule: this._rule.name,
            topics: this._rule.topics
        });

        return P.join(this._executor.subscribe(), this._retryExecutor.subscribe())
        .tap(() => {
            this._subscribed = true;
        });
    }

    unsubscribe() {
        if (this._subscribed) {
            this._executor.close();
            this._retryExecutor.close();
        }
    }
}
// TODO: rewrite this one
class RegexTopicSubscription {
    constructor(options, kafkaFactory, hyper, ruleName, ruleSpec, metadataWatch) {
        this._kafkaFactory = kafkaFactory;
        this._options = options;
        this._hyper = hyper;
        this._ruleName = ruleName;
        this._ruleSpec = ruleSpec;
        ruleSpec.sample =  ruleSpec.sample || options.sample;
        this._topicTester = (ruleSpec.topics || (ruleSpec.topic && [ ruleSpec.topic ]))
        .map((topic) => {
            if (/^\/.+\/$/.test(topic)) {
                // Ok, we've got a regex topic! Compile the regex.
                return new RegExp(topic.substring(1, topic.length - 1));
            }
            return topic;
        });
        this._metadataWatch = metadataWatch;
        this._metadataWatch.on('topics_changed', (topics) => {
            const newFilteredTopics = this._filterTopics(topics);
            if (stringify(newFilteredTopics) !== stringify(this._filteredTopics)) {
                const removedTopics = this._filteredTopics.filter(topic =>
                    !newFilteredTopics.includes(topic));
                const addedTopics = newFilteredTopics.filter(topic =>
                    !this._filteredTopics.includes(topic));
                this._hyper.logger.log('info/topics_changed', {
                    message: 'Subscribed topics list changed',
                    added_topics: addedTopics,
                    removed_topics: removedTopics,
                    rule: this._ruleName
                });

                this.unsubscribe()
                .delay(5000) // Give some time for all the in-process consumption loops to finish up
                .then(() => this._subscribeTopics(newFilteredTopics));
            }
        });
        // Ignore the emitted errors - in 10 seconds it will retry
        this._metadataWatch.on('error', e => this._hyper.logger.log('error/metadata_refresh', e));

        this._subscribed = false;
        this._executors = [];
        this._filteredTopics = undefined;
    }

    /**
     * Filters out which topic names are ok to subscribe to.
     *
     * @param {Array} proposedTopicNames a set of available topic names
     *                to check which to subscribe to
     * @return {Array}
     * @private
     */
    _filterTopics(proposedTopicNames) {
        return proposedTopicNames.filter((topic) => {
            return this._topicTester.some((topicTester) => {
                if (topicTester instanceof RegExp) {
                    return topicTester.test(topic);
                }
                return topicTester === topic;
            });
        }).sort();
    }

    _subscribeTopics(topicNames) {
        this._filteredTopics = topicNames;
        const topicRule = Rule.newWithTopicNames(this._ruleName,
            this._ruleSpec, this._filteredTopics);

        this._hyper.logger.log('info/subscription', {
            message: 'Subscribing based on regex',
            rule: this._ruleName,
            topics: topicRule.topics
        });

        const executor = new RuleExecutor(topicRule, this._kafkaFactory,
            this._hyper, this._options);
        this._executors.push(executor);

        const retryExecutor = new RetryExecutor(topicRule, this._kafkaFactory,
            this._hyper, this._options);
        this._executors.push(retryExecutor);

        return P.join(executor.subscribe(), retryExecutor.subscribe())
        .tap(() => {
            this._subscribed = true;
        });
    }

    subscribe() {
        return this._metadataWatch.getTopics()
        .then(topics => this._subscribeTopics(this._filterTopics(topics)));
    }

    unsubscribe() {
        if (this._subscribed) {
            this._subscribed = false;
            return P.each(this._executors, (executor => executor.close()));
        }
        return P.resolve();
    }
}

class Subscriber {
    constructor(options, kafkaFactory) {
        this._kafkaFactory = kafkaFactory;
        this._options = options;

        this._subscriptions = [];
        this._metadataWatch = undefined;
    }

    _createSubscription(hyper, ruleName, ruleSpec) {
        if (Rule.isBasicRule(ruleSpec)) {
            return P.resolve(new BasicSubscription(this._options,
                this._kafkaFactory, hyper, ruleName, ruleSpec));
        }
        let maybeCreateWatchAction;
        if (!this._metadataWatch) {
            maybeCreateWatchAction =
                this._kafkaFactory.createMetadataWatch('metadata_refresher')
                .tap((refresher) => {
                    this._metadataWatch = refresher;
                });
        } else {
            maybeCreateWatchAction = P.resolve(this._metadataWatch);
        }

        return maybeCreateWatchAction
        .then(() => new RegexTopicSubscription(this._options, this._kafkaFactory,
            hyper, ruleName, ruleSpec, this._metadataWatch));
    }

    /**
     * Subscribe a rule spec under a certain rule name
     *
     * @param {HyperSwitch} hyper the request dispatcher
     * @param {string} ruleName the name of the rule
     * @param {Object} ruleSpec the rule specification
     * @return {Promise}
     */
    subscribe(hyper, ruleName, ruleSpec) {
        return this._createSubscription(hyper, ruleName, ruleSpec)
        .then((subscription) => {
            this._subscriptions.push(subscription);
            return subscription.subscribe();
        });
    }

    unsubscribeAll() {
        this._subscriptions.forEach(subscription => subscription.unsubscribe());
        if (this._metadataWatch) {
            this._metadataWatch.disconnect();
        }
    }
}

module.exports = Subscriber;


text:
namespace PBD
{
	class SimulationModel;

	class GhostPointEdgeDistanceConstraint : public Constraint
	{
	public:
		static int TYPE_ID;
		Real m_restLength;

		GhostPointEdgeDistanceConstraint() : Constraint(3) {}
		virtual int &getTypeId() const { return TYPE_ID; }

		bool initConstraint(PositionBasedElasticRodsModel &model, const unsigned int particle1, const unsigned int particle2, const unsigned int particle3);
		virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter);
	};

	class PerpendiculaBisectorConstraint : public Constraint
	{
	public:
		static int TYPE_ID;

		PerpendiculaBisectorConstraint() : Constraint(3) {}
		virtual int &getTypeId() const { return TYPE_ID; }

		bool initConstraint(SimulationModel &model, const unsigned int particle1, const unsigned int particle2, const unsigned int particle3);
		virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter);
	};

	class DarbouxVectorConstraint : public Constraint
	{
	public:
		static int TYPE_ID;
		Matrix3r m_dA; //material frame A
		Matrix3r m_dB; //material frame B

		DarbouxVectorConstraint() : Constraint(5) {}
		virtual int &getTypeId() const { return TYPE_ID; }

		virtual bool initConstraint(PositionBasedElasticRodsModel &model, const unsigned int particle1, const unsigned int particle2,
			const unsigned int particle3, const unsigned int particle4, const unsigned int particle5);

		virtual bool solvePositionConstraint(SimulationModel &model, const unsigned int iter);
	};

}

#endif


text:
namespace Zu.ChromeDevTools.Animation
{
    using Newtonsoft.Json;

    /// <summary>
    /// Sets the playback rate of the document timeline.
    /// </summary>
    public sealed class SetPlaybackRateCommand : ICommand
    {
        private const string ChromeRemoteInterface_CommandName = "Animation.setPlaybackRate";

        [JsonIgnore]
        public string CommandName
        {
            get { return ChromeRemoteInterface_CommandName; }
        }

        /// <summary>
        /// Playback rate for animations on page
        /// </summary>
        [JsonProperty("playbackRate")]
        public double PlaybackRate
        {
            get;
            set;
        }
    }

    public sealed class SetPlaybackRateCommandResponse : ICommandResponse<SetPlaybackRateCommand>
    {
    }
}


text:
var fs = require('fs'),
    path = require('path'),
    regex = require('./regex.js');

exports.getSolutionProjects = function(solution) {
    if (!fs.existsSync(solution)) throw new Error('Solution file not found: ' + path.resolve(solution));
    var projectRegEx = /Project\s*\(\s*\".*?\"\s*\)\s*=\s*\".*?\"\s*,\s*\"(.*?)\"\s*,\s*\".*?\"/ig;
    var solutionDirectory = path.dirname(solution);
    return regex.matchAll(projectRegEx, fs.readFileSync(solution, 'utf8')).
        map(function(projectPath) { return projectPath.replace(/\\/g, path.sep); }).
        map(function(projectPath) { return path.normalize(path.join(solutionDirectory, projectPath)); });
};

exports.getProjectFiles = function(project, filename) {
    if (!fs.existsSync(project)) throw new Error('Project file not found: ' + path.resolve(project));
    var fileRegEx = /Include\s*=\s*\"(.*?)\"/ig;
    var projectDirectory = path.dirname(project);
    return regex.matchAll(fileRegEx, fs.readFileSync(project, 'utf8')).
        map(function(projectPath) { return projectPath.replace(/\\/g, path.sep); }).
        filter(function(filePath) { return path.basename(filePath) === filename; }).
        map(function(filePath) { return path.normalize(path.join(projectDirectory, filePath)); });
};

exports.getSolutionFiles = function(solution, filename) {
    return [].concat.apply([], exports.getSolutionProjects(solution).
        map(function(project) { return exports.getProjectFiles(project, filename); }));
};


text:
export TF_VAR_region=${TF_VAR_region:-lon1}
export TF_VAR_do_token=${TF_VAR_do_token:?"Need to set TF_VAR_do_token non-empty"}

export ANSIBLE_SSH_ARGS="-F ${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}/ssh.config -i ${APOLLO_ROOT}/terraform/${APOLLO_PROVIDER}/id_rsa -q"

export APOLLO_consul_dc=${APOLLO_consul_dc:-$TF_VAR_region}
export APOLLO_mesos_cluster_name=${APOLLO_mesos_cluster_name:-$TF_VAR_region}
export APOLLO_ansible_ssh_user=core
export APOLLO_traefik_network_interface=eth1


text:
'use strict';

goog.provide('tachyfont.Cff');

goog.require('tachyfont.BinaryFontEditor');
goog.require('tachyfont.CffDict');
goog.require('tachyfont.CffIndex');

/**
 * The CFF classes (tachyfont.Cff, tachyfont.CffIndex, tachyfont.CffDict) read
 * the CFF (Adobe's Compact Font Format) table in an OpenType/CFF font.
 * To support TachyFont's lazy loading the CFF code can insert new data into the
 * CharStrings INDEX and fix up:
 *    - the OpenType (sfnt) table of contents offsets
 *    - the CFF Top DICT offsets
 *    - the CFF CharStrings INDEX offsets and length
 *    - the offsets in the CFF Private Font DICTs
 *
 * In a TachyFont there is a large 'empty' (zeroed) space behind the CharStrings
 * INDEX. As chars/glyphs are lazily added the CharStrings INDEX expands into
 * this empty space.
 *
 * In a Compact TachyFont the empty space is removed and as chars/glyphs are
 * lazily added the CharStrings INDEX is expanded. This expansion requires the
 * CFF table be expanded. The CFF table expansion requires the OpenType table of
 * contents be adjusted.
 *
 * For a detailed description of the CFF format @see
 * http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5176.CFF.pdf
 * For a detailed description of the OpenType font format @see
 * http://www.microsoft.com/typography/otspec/otff.htm
 *
 * For reference: How to read/parse the CFF table
 * ----------------------------------------------
 * The items in the CFF table are organized as:
 *     1) Items that are placed one after another.
 *        - Header
 *        - Name INDEX
 *        - Top DICT INDEX
 *        - etc.
 *     2) Items found by their offset in the Top DICT.
 *        - CharStrings INDEX
 *        - Font DICT INDEX
 *        - Private DICTs (which are found relative to the Font DICT INDEX)
 *
 * To read the CFF table the code:
 *     - Determines the sizes of the items before the Top DICT INDEX
 *     - Reads the Top DICT INDEX
 *     - Uses the first element in the Top DICT INDEX as the Top DICT
 *     - Reads the other items using the offsets in the Top DICT
 *
 * @param {number} cffTableOffset The offset in the OpenType font to the CFF
 *     table.
 * @param {!DataView} fontData The font data.
 * @constructor @struct @final
 */
tachyfont.Cff = function(cffTableOffset, fontData) {

  /**
   * Font data bytes.
   * @private {!DataView}
   */
  this.fontData_ = fontData;

  /**
   * Helper class to edit the binary data.
   * @private {!tachyfont.BinaryFontEditor}
   */
  this.binaryEditor_ = new tachyfont.BinaryFontEditor(fontData, cffTableOffset);

  // Find the offset to the Top DICT INDEX.
  // First move past the CFF Header.
  var offset = tachyfont.Cff.getHeaderSize(this.binaryEditor_);
  // Next move past the CFF Name INDEX
  offset += tachyfont.CffIndex.computeLength(offset, this.binaryEditor_);

  // Read the Top DICT INDEX.
  var topDictIndex = tachyfont.Cff.readTopDictIndex(offset, this.binaryEditor_);
  var topDict = topDictIndex.getDictElement(0);
  if (!topDict) {
    // Library fatal error: without a Top DICT the font cannot be read nor
    // modified.
    throw new Error('missing Top DICT: font cannot be processed');
  }
  /**
   * The CFF Top DICT.
   * The Top DICT has the offsets to other items with the CFF table (as well as
   * other meta information about the font).
   * @private @const {!tachyfont.CffDict}
   */
  this.topDict_ = topDict;

  /**
   * The CFF CharStrings INDEX:
   *   - found by an offset in the Top DICT
   *   - holds the glyph data.
   * This item is poorly named:
   *   - 'Char': this holds data about glyphs not about chars.
   *   - 'Strings': this hold binary data not human readable strings.
   * @private @const {!tachyfont.CffIndex}
   */
  this.charStringsIndex_ =
      tachyfont.Cff.readCharStringsIndex(this.topDict_, this.binaryEditor_);

  /**
   * The CFF Font DICT INDEX:
   *   - found by an offset in the Top DICT
   *   - holds per-font information such as 'nominal width' of the glyphs.
   * @private @const {!tachyfont.CffIndex}
   */
  this.fontDictIndex_ =
      tachyfont.Cff.readFontDictIndex(this.topDict_, this.binaryEditor_);
};

/**
 * Gets the font data bytes.
 * @return {!DataView}
 */
tachyfont.Cff.prototype.getFontData = function() {
  return this.fontData_;
};

/**
 * Gets the binaryEditor.
 * @return {!tachyfont.BinaryFontEditor}
 */
tachyfont.Cff.prototype.getBinaryEditor = function() {
  return this.binaryEditor_;
};

/**
 * Gets the Top DICT.
 * @return {!tachyfont.CffDict}
 */
tachyfont.Cff.prototype.getTopDict = function() {
  return this.topDict_;
};

/**
 * Gets the Font DICT INDEX.
 * This has the relative offsets to the Private Font DICTs.
 * @return {!tachyfont.CffIndex}
 */
tachyfont.Cff.prototype.getFontDictIndex = function() {
  return this.fontDictIndex_;
};

/**
 * Gets the CFF header size.
 * The CFF Header holds it own length to provide upward compatibility if more
 * header space is needed.
 * @param {!tachyfont.BinaryFontEditor} binaryEditor Helper class to edit the
 *     binary data.
 * @return {number} The size of the CFF header.
 */
tachyfont.Cff.getHeaderSize = function(binaryEditor) {
  binaryEditor.seek(2);  // Skip the major and minor number.
  return binaryEditor.getUint8();
};

/**
 * Reads the CFF Top DICT.
 * The Top DICT has the offsets to the CharStrings INDEX and Font DICT INDEX.
 * @param {number} offset The offset in the CFF table to the Top DICT INDEX.
 * @param {!tachyfont.BinaryFontEditor} binaryEditor Helper class to edit the
 *     binary data.
 * @return {!tachyfont.CffIndex}
 */
tachyfont.Cff.readTopDictIndex = function(offset, binaryEditor) {
  var topDictIndex = new tachyfont.CffIndex('TopDICT', offset,
      tachyfont.CffIndex.type.DICT, binaryEditor);
  topDictIndex.loadDicts(binaryEditor);
  return topDictIndex;
};

/**
 * Reads the CFF Font DICT INDEX.
 * This has info on the per-font Private DICTs. Even though a CFF table in an
 * OpenType font can only one main font that font can be used as if it were
 * multiple fonts. For example, some of the glyph data could be 'changed'
 * making one version have square ends and the other have round ends.
 * @param {!tachyfont.CffDict} topDict The CFF Top DICT with the offset to the
 *     CharStrings INDEX.
 * @param {!tachyfont.BinaryFontEditor} binaryEditor Helper class to edit the
 * @return {!tachyfont.CffIndex}
 */
tachyfont.Cff.readFontDictIndex = function(topDict, binaryEditor) {
  var fontDictIndexOffset = /** @type {?number} */ (
      topDict.getOperand(tachyfont.CffDict.Operator.FD_ARRAY, 0));
  if (fontDictIndexOffset == null) {
    // Library fatal error: without the (Private) Font DICT offset the CFF font
    // cannot be read nor modified.
    throw new Error('missing FD_ARRAY operator');
  }
  var fontDictIndex = new tachyfont.CffIndex('FontDICT', fontDictIndexOffset,
      tachyfont.CffIndex.type.DICT, binaryEditor);
  fontDictIndex.loadDicts(binaryEditor);
  return fontDictIndex;
};

/**
 * Reads the CFF CharStrings INDEX.
 * This holds the glyph data. This INDEX is expanded as chars/glyphs are lazily
 * loaded.
 * @param {!tachyfont.CffDict} topDict The CFF Top DICT with the offset to the
 *     CharStrings INDEX.
 * @param {!tachyfont.BinaryFontEditor} binaryEditor Helper class to edit the
 * @return {!tachyfont.CffIndex}
 */
tachyfont.Cff.readCharStringsIndex = function(topDict, binaryEditor) {
  var charStringsIndexOffset =
      topDict.getOperand(tachyfont.CffDict.Operator.CHAR_STRINGS, 0);
  if (charStringsIndexOffset == null) {
    // Library fatal error: without the CharStrings INDEX offset the CFF font
    // cannot be read nor modified.
    throw new Error('missing CHAR_STRINGS operator');
  }
  var charStringsIndex = new tachyfont.CffIndex('CharStrings',
      /** @type {number} */ (charStringsIndexOffset),
      tachyfont.CffIndex.type.BINARY_STRING, binaryEditor);
  charStringsIndex.loadStrings(binaryEditor);
  return charStringsIndex;
};

/**
 * Gets the CharStrings INDEX object.
 * @return {!tachyfont.CffIndex}
 */
tachyfont.Cff.prototype.getCharStringsIndex = function() {
  return this.charStringsIndex_;
};

/**
 * Gets a block of the font data.
 * @param {number} offset The starting offset.
 * @param {number} length One greater than the last byte.
 * @return {!Uint8Array}
 */
tachyfont.Cff.prototype.getData = function(offset, length) {
  offset += this.binaryEditor_.getBaseOffset();
  return new Uint8Array(this.fontData_.buffer, offset, length);
};

/**
 * Gets the specified operand for an operator.
 * CFF DICTs store values as sets of (1 or more) operands followed by an
 * operator. For example the font bounding box is specified by four operands
 * (eg, -991 -1050 2930 1810) followed by the FontBBox (5) operator.
 * @param {string} operator The operator.
 * @param {number} index The index of the operand to get.
 * @return {?tachyfont.CffDict.Operand}
 */
tachyfont.Cff.prototype.getTopDictOperand = function(operator, index) {
  return this.topDict_.getOperand(operator, index);
};

/**
 * Lists the items in the CFF table whose offsets can change when the
 * CharStrings INDEX is resized.
 * @private @const {!Array<string>}
 */
tachyfont.Cff.repositionedItemsOperators_ = [
  tachyfont.CffDict.Operator.CHARSET,
  tachyfont.CffDict.Operator.FD_SELECT,
  tachyfont.CffDict.Operator.FD_ARRAY
];

/**
 * Updates the offsets in the CFF table when the CharStrings INDEX changes size.
 * Given a delta size update the offsets in the Top DICT and Private DICTs.
 * @param {number} deltaSize The size change.
 */
tachyfont.Cff.prototype.updateCharStringsSize = function(deltaSize) {
  var charStringsIndexOffset = this.charStringsIndex_.getOffsetToIndex();
  for (var i = 0; i < tachyfont.Cff.repositionedItemsOperators_.length; i++) {
    var operator = tachyfont.Cff.repositionedItemsOperators_[i];
    var offset = this.topDict_.getOperand(operator, 0);
    if (offset > charStringsIndexOffset) {
      this.topDict_.updateDictEntryOperand(operator, 0, deltaSize);
    }
  }

  // Update the offsets to the Private DICTs.
  var count = this.fontDictIndex_.getNumberOfElements();
  for (var i = 0; i < count; i++) {
    var dict = this.fontDictIndex_.getDictElement(i);
    if (dict == null) {
      // Library fatal error: something is deeply wrong and recovery is not
      // possible.
      throw new Error('missing Private DICT ' + i);
    }
    var offset = dict.getOperand(tachyfont.CffDict.Operator.PRIVATE, 1);
    if (offset > charStringsIndexOffset) {
      dict.updateDictEntryOperand(tachyfont.CffDict.Operator.PRIVATE, 1,
          deltaSize);
    }
  }
};


text:
<?php
$this->breadcrumbs=array(
	'Pelanggans'=>array('index'),
	$model->kode_pelanggan=>array('view','id'=>$model->kode_pelanggan),
	'Update',
);

$this->menu=array(
	array('label'=>'List Pelanggan','url'=>array('index')),
	array('label'=>'Create Pelanggan','url'=>array('create')),
	array('label'=>'View Pelanggan','url'=>array('view','id'=>$model->kode_pelanggan)),
	array('label'=>'Manage Pelanggan','url'=>array('admin')),
);
?>

Update Pelanggan <?php echo $model->kode_pelanggan; ?>

<?php echo $this->renderPartial('_form',array('model'=>$model)); ?>


text:
package org.apache.gobblin.data.management.retention;

import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.Test;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

import org.apache.gobblin.configuration.ConfigurationKeys;
import org.apache.gobblin.data.management.policy.EmbeddedRetentionSelectionPolicy;
import org.apache.gobblin.data.management.policy.NewestKSelectionPolicy;
import org.apache.gobblin.data.management.retention.dataset.ConfigurableCleanableDataset;
import org.apache.gobblin.data.management.version.FileSystemDatasetVersion;
import org.apache.gobblin.data.management.version.finder.WatermarkDatasetVersionFinder;

public class ConfigurableCleanableDatasetTest {

  @Test
  public void testConfigureWithRetentionPolicy() throws Exception {

    Config conf =
        ConfigFactory.parseMap(ImmutableMap.<String, String> of("gobblin.retention.version.finder.class",
            "org.apache.gobblin.data.management.version.finder.WatermarkDatasetVersionFinder",
            "gobblin.retention.retention.policy.class",
            "org.apache.gobblin.data.management.retention.policy.NewestKRetentionPolicy",
            "gobblin.retention.newestK.versions.retained", "2"));

    ConfigurableCleanableDataset<FileSystemDatasetVersion> dataset =
        new ConfigurableCleanableDataset<FileSystemDatasetVersion>(FileSystem.get(new URI(ConfigurationKeys.LOCAL_FS_URI),
            new Configuration()), new Properties(), new Path("/someroot"), conf, LoggerFactory.getLogger(ConfigurableCleanableDatasetTest.class));

    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionSelectionPolicy().getClass(), EmbeddedRetentionSelectionPolicy.class);
    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionFinder().getClass(), WatermarkDatasetVersionFinder.class);
    Assert.assertEquals(dataset.isDatasetBlacklisted(), false);
  }

  @Test
  public void testConfigureWithSelectionPolicy() throws Exception {

    Config conf =
        ConfigFactory.parseMap(ImmutableMap.<String, String> of("gobblin.retention.version.finder.class",
            "org.apache.gobblin.data.management.version.finder.WatermarkDatasetVersionFinder",
            "gobblin.retention.selection.policy.class",
            "org.apache.gobblin.data.management.policy.NewestKSelectionPolicy",
            "gobblin.retention.selection.newestK.versionsSelected", "2"));

    ConfigurableCleanableDataset<FileSystemDatasetVersion> dataset =
        new ConfigurableCleanableDataset<FileSystemDatasetVersion>(FileSystem.get(new URI(ConfigurationKeys.LOCAL_FS_URI),
            new Configuration()), new Properties(), new Path("/someroot"), conf, LoggerFactory.getLogger(ConfigurableCleanableDatasetTest.class));

    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionSelectionPolicy().getClass(), NewestKSelectionPolicy.class);
    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionFinder().getClass(), WatermarkDatasetVersionFinder.class);
    Assert.assertEquals(dataset.isDatasetBlacklisted(), false);
  }

  @Test
  public void testConfigureWithMulitplePolicies() throws Exception {

    Map<String, String> partitionConf =
        ImmutableMap.<String, String> of("version.finder.class",
            "org.apache.gobblin.data.management.version.finder.WatermarkDatasetVersionFinder", "selection.policy.class",
            "org.apache.gobblin.data.management.policy.NewestKSelectionPolicy", "selection.newestK.versionsSelected", "2");
    Config conf = ConfigFactory.parseMap(ImmutableMap.<String, List<Map<String, String>>> of("gobblin.retention.dataset.partitions",
            ImmutableList.of(partitionConf, partitionConf)));

    ConfigurableCleanableDataset<FileSystemDatasetVersion> dataset =
        new ConfigurableCleanableDataset<FileSystemDatasetVersion>(FileSystem.get(new URI(ConfigurationKeys.LOCAL_FS_URI),
            new Configuration()), new Properties(), new Path("/someroot"), conf, LoggerFactory.getLogger(ConfigurableCleanableDatasetTest.class));

    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionSelectionPolicy().getClass(), NewestKSelectionPolicy.class);
    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(0).getVersionFinder().getClass(), WatermarkDatasetVersionFinder.class);

    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(1).getVersionSelectionPolicy().getClass(), NewestKSelectionPolicy.class);
    Assert.assertEquals(dataset.getVersionFindersAndPolicies().get(1).getVersionFinder().getClass(), WatermarkDatasetVersionFinder.class);
    Assert.assertEquals(dataset.isDatasetBlacklisted(), false);
  }

  @Test
  public void testDatasetIsBlacklisted() throws Exception {

    Config conf =
        ConfigFactory.parseMap(ImmutableMap.<String, String> of("gobblin.retention.version.finder.class",
            "org.apache.gobblin.data.management.version.finder.WatermarkDatasetVersionFinder",
            "gobblin.retention.selection.policy.class",
            "org.apache.gobblin.data.management.policy.NewestKSelectionPolicy",
            "gobblin.retention.selection.newestK.versionsSelected", "2",
            "gobblin.retention.dataset.is.blacklisted", "true"));

    ConfigurableCleanableDataset<FileSystemDatasetVersion> dataset =
        new ConfigurableCleanableDataset<FileSystemDatasetVersion>(FileSystem.get(new URI(ConfigurationKeys.LOCAL_FS_URI),
            new Configuration()), new Properties(), new Path("/someroot"), conf, LoggerFactory.getLogger(ConfigurableCleanableDatasetTest.class));

    Assert.assertEquals(dataset.isDatasetBlacklisted(), true);
  }
}


text:
load '\\raspberry\d_work\ifcb1\ifcb_data_mvco_jun06\manual_fromClass\summary\count_biovol_manual_20Mar2012_day'
ii = find(floor(matdate_bin) == datenum('2-9-2010')); %skip this day with one partial sample
classbiovol_bin(ii,:) = []; classcount_bin(ii,:) = []; ml_analyzed_mat_bin(ii,:) = []; matdate_bin(ii) = [];

class_dino = {'Ceratium' 'dino30' 'Dinophysis' 'Gyrodinium' 'Prorocentrum' 'Gonyaulax'};
class_nonphyto = {'Thalassiosira_dirty' 'bad' 'ciliate' 'detritus' 'not_ciliate' 'ciliate_mix' 'tintinnid' 'Myrionecta' 'Laboea'};
class_mix = {'mix' 'clusterflagellate' 'crypto' 'Euglena' 'flagellate' 'kiteflagellates' 'Phaeocystis' 'Pyramimonas' 'roundCell' 'mix_elongated'};
class_diatom = {'Asterionellopsis' 'Cerataulina' 'Chaetoceros' 'Corethron' 'Coscinodiscus' 'Cylindrotheca' 'DactFragCerataul' 'Dactyliosolen'...
    'Ditylum' 'Ephemera' 'Eucampia' 'Guinardia' 'Guinardia_flaccida' 'Guinardia_striata' 'Hemiaulus' 'Lauderia' 'Leptocylindrus' 'Licmophora'...
    'Odontella' 'Paralia' 'Pleurosigma' 'Pseudonitzschia' 'Rhizosolenia' 'Skeletonema' 'Stephanopyxis' 'Thalassionema' 'Thalassiosira' 'pennate'};
class_ciliate = {'ciliate' 'ciliate_mix' 'tintinnid' 'Myrionecta' 'Laboea'};
%skip: 'Eucampia_groenlandica' 'Tropidoneis' 'dino10'
%'other' 'bad'
[~,ind_diatoms] = intersect(class2use, class_diatom);
[~,ind_dino] = intersect(class2use, class_dino);
[~,ind_mix] = intersect(class2use, class_mix);
[~,ind_ciliate] = intersect(class2use, class_ciliate); ind_ciliate = sort(ind_ciliate);

class_label = class2use;
class_label(strmatch('Leptocylindrus', class_label, 'exact')) = {'\itLeptocylindrus \rmspp.'};
class_label(strmatch('Guinardia', class_label, 'exact')) = {'\itGuinardia delicatula'};
class_label(strmatch('Rhizosolenia', class_label, 'exact')) = {'\itRhizosolenia \rmspp.'};
class_label(strmatch('Chaetoceros', class_label, 'exact')) = {'\itChaetoceros \rmspp.'};
class_label(strmatch('Eucampia_groenlandica', class_label, 'exact')) = {'\itEucampia groenlandica'};
class_label(strmatch('Thalassiosira', class_label, 'exact')) = {'\itThalassiosira \rmspp.'};
class_label(strmatch('DactFragCerataul', class_label, 'exact')) = {'\itDactyliosolen fragilissimus'};
class_label(strmatch('Asterionellopsis', class_label, 'exact')) = {'\itAsterionellopsis glacialis'};
class_label(strmatch('Skeletonema', class_label, 'exact')) = {'\itSkeletonema \rmspp.'};
class_label(strmatch('Ditylum', class_label, 'exact')) = {'\itDitylum brightwellii'};
class_label(strmatch('Thalassionema', class_label, 'exact')) = {'\itThalassionema \rmspp.'};
class_label(strmatch('Dactyliosolen', class_label, 'exact')) = {'\itDactyliosolen blavyanus'};
class_label(strmatch('Corethron', class_label, 'exact')) = {'\itCorethron hystrix'};
class_label(strmatch('Guinardia_striata', class_label, 'exact')) = {'\itGuinardia striata'};
class_label(strmatch('Cylindrotheca', class_label, 'exact')) = {'\itCylindrotheca \rmspp.'};
class_label(strmatch('Pleurosigma', class_label, 'exact')) = {'\itPleurosigma \rmspp.'};
class_label(strmatch('Pseudonitzschia', class_label, 'exact')) = {'\itPseudonitzschia \rmspp.'};
class_label(strmatch('Guinardia_flaccida', class_label, 'exact')) = {'\itGuinardia flaccida'};
class_label(strmatch('Ephemera', class_label, 'exact')) = {'\itEphemera \rmspp.'};
class_label(strmatch('Eucampia', class_label, 'exact')) = {'\itEucampia cornuta'};
class_label(strmatch('Ephemera', class_label, 'exact')) = {'\itEphemera \rmspp.'};
class_label(strmatch('pennate', class_label, 'exact')) = {'pennate, misc.'};
class_label(strmatch('Lauderia', class_label, 'exact')) = {'\itLauderia annulata'};
class_label(strmatch('Licmophora', class_label, 'exact')) = {'\itLicmophora \rmspp.'};
class_label(strmatch('Stephanopyxis', class_label, 'exact')) = {'\itStephanopyxis \rmspp.'};
class_label(strmatch('Cerataulina', class_label, 'exact')) = {'\itCerataulina pelagica'};
class_label(strmatch('Odontella', class_label, 'exact')) = {'\itOdontella \rmspp.'};
class_label(strmatch('Coscinodiscus', class_label, 'exact')) = {'\itCoscinodiscus \rmspp.'};
class_label(strmatch('Paralia', class_label, 'exact')) = {'\itParalia sulcata'};

yd_ifcb = datevec(matdate_bin);
yd_ifcb = matdate_bin-datenum(yd_ifcb(:,1),0,0);

x = sum(classbiovol_bin(:,ind_diatoms)./ml_analyzed_mat_bin(:,ind_diatoms),2); indall = find(~isnan(x));
x = classbiovol_bin(indall,ind_diatoms)./ml_analyzed_mat_bin(indall,ind_diatoms); %class specific biomass/mL for cases with all diatom classes counted
xsum = sum(x,2);
matdate_int = (matdate_bin(1):matdate_bin(end));
dsum_int = interp1(matdate_bin(indall), xsum, matdate_int);

[yint, mint, dint] = datevec(matdate_int);

dsum_month_integral = NaN(9,12);
for yii = 2003:2011,
    for mii = 1:12,
        ind = find(yint == yii & mint == mii);
        dsum_month_integral(yii-2002,mii) = nansum(dsum_int(ind));
    end;
end;


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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>POSIXThread: /home/martin/Repositorios/Fwk_Cliente_Servidor/Pthread/src Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

POSIXThread
    14/6/14

Main Page

Classes

Files

src

src Directory Reference

Files

file  	MultiHiloExcepcion.cpp

file  	MultiHiloExcepcion.h [code]

file  	Mutex.cpp

file  	Mutex.h [code]

file  	Thread.cpp

file  	Thread.h [code]

<address class="footer">
Generated on Sat Jun 14 2014 18:55:59 for POSIXThread by

 1.8.6
</address>