text:
require 'json'

# Find the build object
module BuildFinder
  def self.get_build
    builds = []
    ObjectSpace.each_object(Build) { |x| builds << x }
    if builds.length != 1
      fail "Only one Build object may exist, found #{builds.length}"
    end
    builds[0]
  end
end

# Aggregates top-level targets
class Build
  def initialize(*targets)
    @targets = targets
  end

  def to_json
    jsonify.to_json
  end

  def jsonify
    @targets.map { |t| t.jsonify }
  end
end

def build(*targets)
  Build.new(*targets)
end

# A build target
class Target
  attr_reader :outputs, :command, :dependencies, :implicits

  def initialize(outputs, command = '', dependencies = [], implicits = [])
    @outputs = arrayify(outputs)
    @command = jsonifiable(command, ShellCommand)
    @dependencies = dependify(dependencies, FixedDependencies)
    @implicits = dependify(implicits, FixedDependencies)
  end

  def to_json
    jsonify.to_json
  end

  def jsonify
    { type: 'fixed',
      command: @command.jsonify,
      outputs: @outputs,
      dependencies: @dependencies.jsonify,
      implicits: @implicits.jsonify
    }
  end
end

def target(outputs, command = '', dependencies = [], implicits = [])
  Target.new(outputs, command, dependencies, implicits)
end

# A shell command
class ShellCommand
  def initialize(cmd = '')
    @cmd = cmd
  end

  def jsonify
    @cmd == '' ? {} : { type: 'shell', cmd: @cmd }
  end
end

private def arrayify(arg)
  arg.class == Array ? arg : [arg]
end

private def jsonifiable(arg, klass)
  (arg.respond_to? :jsonify) ? arg : klass.new(arg)
end

private def dependify(arg, klass)
  if arg.is_a? Dependencies
    return arg
  end

  if arg.is_a?(Array) && arg.length > 1 && \
     arg.any? { |x| x.is_a? DynamicDependencies }
    return target_concat(arg)
  end

  klass.new(arg)
end

private def target_concat(targets)
  DynamicDependencies.new('targetConcat', dependencies: targets.map { |x| x.jsonify })
end

# Equivalent to link in the D version
class LinkCommand
  def initialize(flags)
    @flags = flags
  end

  def jsonify
    { type: 'link', flags: @flags }
  end
end

def link(exe_name:, flags: '', dependencies: [], implicits: [])
  Target.new([exe_name], LinkCommand.new(flags), dependencies, implicits)
end

def object_files(src_dirs: [], exclude_dirs: [],
                 src_files: [], exclude_files: [],
                 flags: '',
                 includes: [], string_imports: [])
  DynamicDependencies.new('objectFiles',
                          { src_dirs: src_dirs,
                            exclude_dirs: exclude_dirs,
                            src_files: src_files,
                            exclude_files: exclude_files,
                            flags: flags,
                            includes: includes,
                            string_imports: string_imports })
end

class Dependencies
end

# A 'compile-time' known list of dependencies
class FixedDependencies < Dependencies
  def initialize(deps)
    @deps = arrayify(deps)
  end

  def jsonify
    { type: 'fixed', targets: @deps.map { |t| t.jsonify } }
  end
end

# a rule to create a static library
def static_library(name,
                   src_dirs: [],
                   exclude_dirs: [],
                   src_files: [],
                   exclude_files: [],
                   flags: '',
                   includes: [],
                   string_imports: [])
    DynamicDependencies.new('staticLibrary',
                            { name: name,
                              src_dirs: src_dirs,
                              exclude_dirs: exclude_dirs,
                              src_files: src_files,
                              exclude_files: exclude_files,
                              flags: flags,
                              includes: includes,
                              string_imports: string_imports })
end

def scriptlike(src_name:,
               exe_name:,
               flags: '',
               includes: [],
               string_imports: [],
               link_with: [])

  Dynamic.new('scriptlike',
              { src_name: src_name,
                exe_name: exe_name,
                flags: flags,
                includes: includes,
                string_imports: string_imports,
                link_with: dependify(link_with, FixedDependencies) })
end

# A run-time determined list of dependencies
class DynamicDependencies < Dependencies
  def initialize(func_name, args)
    @func_name = func_name
    @args = args
  end

  def jsonify
    base = { type: 'dynamic', func: @func_name }
    base.merge(@args)
  end
end

# dynamic target
class Dynamic
  def initialize(func_name, args)
    @func_name = func_name
    @args = args
  end

  def jsonify
    hash = { type: 'dynamic', func: @func_name }
    @args.each do |k, v|
      if v.respond_to? :jsonify
        hash[k] = v.jsonify
      else
        hash[k] = v
      end
    end
    hash
  end
end


text:
layout: page
title: "Korri Roach"
comments: true
description: "blanks"
keywords: "Korri Roach,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: ENGL 1260, ENGL 1600, ENGL 3060, WRTG 1150

#### ENGL 1260: INTRO WOMEN'S LITERATURE

**Terms taught**: Fall 2006, Fall 2006, Spring 2007, Spring 2007

**Instructor rating**: 5.55

**Standard deviation in instructor rating**: 0.06

**Average grade** (4.0 scale): 3.0

**Standard deviation in grades** (4.0 scale): 0.16

**Average workload** (raw): 2.4

**Standard deviation in workload** (raw): 0.21

#### ENGL 1600: MASTERPIECES-AMER LIT

**Terms taught**: Fall 2009, Fall 2009

**Instructor rating**: 5.02

**Standard deviation in instructor rating**: 0.02

**Average grade** (4.0 scale): 2.79

**Standard deviation in grades** (4.0 scale): 0.02

**Average workload** (raw): 2.57

**Standard deviation in workload** (raw): 0.11

#### ENGL 3060: MODERN/CONTEMPORARY LIT

**Terms taught**: Fall 2007, Fall 2007, Spring 2008, Spring 2008, Fall 2008, Fall 2008, Spring 2009, Spring 2009, Spring 2010, Spring 2010

**Instructor rating**: 5.34

**Standard deviation in instructor rating**: 0.28

**Average grade** (4.0 scale): 2.91

**Standard deviation in grades** (4.0 scale): 0.18

**Average workload** (raw): 2.63

**Standard deviation in workload** (raw): 0.1

#### WRTG 1150: First-Year Writing and Rhetoric

**Terms taught**: Fall 2010, Spring 2011, Spring 2011, Fall 2011, Fall 2011, Spring 2012, Spring 2012

**Instructor rating**: 5.38

**Standard deviation in instructor rating**: 0.4

**Average grade** (4.0 scale): 2.89

**Standard deviation in grades** (4.0 scale): 0.16

**Average workload** (raw): 2.64

**Standard deviation in workload** (raw): 0.26

redpajama_set_name: RedPajamaGithub


text:
module JustinCredible.SmartHomeMobile.Controllers {

    export class PassphraseEntryController extends BaseDialogController<ViewModels.PassphraseEntryViewModel, any, any> {

        //#region Injection

        public static ID = "PassphraseEntryController";
        public static TemplatePath = "templates/Dialogs/Passphrase-Entry.html";

        public static get $inject(): string[] {
            return [
                "$scope",
                Services.Utilities.ID,
                Services.Preferences.ID,
                Services.UiHelper.ID
            ];
        }

        constructor(
            $scope: ng.IScope,
            private Utilities: Services.Utilities,
            private Preferences: Services.Preferences,
            private UiHelper: Services.UiHelper) {
            super($scope, ViewModels.PassphraseEntryViewModel, PassphraseEntryController.ID);
        }

        //#endregion

        //#region BaseController Overrides

        protected dialog_shown() {
            super.dialog_shown();

            this.viewModel.passphrase = "";
        }

        //#endregion

        //#region Controller Methods

        protected ok_click() {
            if (this.Preferences.isPassphraseValid(this.viewModel.passphrase)) {
                this.Preferences.setPassphraseForSession(this.viewModel.passphrase);
                this.close();
            }
            else {
                this.UiHelper.alert("Invalid passphrase; please try again.");
            }
        }

        //#endregion
    }
}


text:
<?php declare(strict_types=1);

namespace Sunfox\Spayd\Model;

final class SlovakAccount extends DefaultAccount
{
	protected string $accountPattern = '~^
		(?:
			(?P<prefix>\d{0,6})
			(?:\-{1}) # prefix delimiter
		){0,1}
		(?:
			(?P<accountNumber>\d{2,10})
			(?:\/{1}) # bank code delimiter
			(?P<bankCode>\d{3,4}|[A-Z]{4,7})
		)
		$~Dix';

	public function __construct(string $accountString)
	{
		parent::__construct($accountString, 'CZ');
		$this->buildAccountParts($accountString);
	}

	protected function buildAccountParts(string $accountString): void
	{
		$this->isValid = (bool) preg_match($this->accountPattern, $accountString, $accountParts);

		if (empty($accountParts['prefix']) === false) {
			$this->prefix = $accountParts['prefix'];
		}

		if (empty($accountParts['accountNumber']) === false) {
			$this->accountNumber = $accountParts['accountNumber'];
		}

		if (empty($accountParts['bankCode']) === false) {
			$this->bankCode = $accountParts['bankCode'];
		}
	}
}


text:
android-geofeed
===============

A lightweight library for Android to parse Atom and RSS feeds.


text:
\begin{figure}[H]
\centering
\includegraphics[width=6in]{figs/run_47/run_47_turb_visc_by_vtheta_vs_r_meshscatter}
\caption{Scatter plot of total viscosity $\nu$ calculated by mean $\bar{v}_{\theta}$ equation with non-equilibrium pressure at $z/c$=9.00, $V_{free}$=27.08, station 5.}
\label{fig:run_47_turb_visc_by_vtheta_vs_r_meshscatter}
\end{figure}


text:
SET search_path TO mimiciii;

DROP MATERIALIZED VIEW IF EXISTS heightweight CASCADE;
CREATE MATERIALIZED VIEW heightweight
AS
WITH FirstVRawData AS
  (SELECT c.charttime,
    c.itemid,c.subject_id,c.icustay_id,
    CASE
      WHEN c.itemid IN (762, 763, 3723, 3580, 3581, 3582, 226512)
        THEN 'WEIGHT'
      WHEN c.itemid IN (920, 1394, 4187, 3486, 3485, 4188, 226707)
        THEN 'HEIGHT'
    END AS parameter,
    -- Ensure that all weights are in kg and heights are in centimeters
    CASE
      WHEN c.itemid   IN (3581, 226531)
        THEN c.valuenum * 0.45359237
      WHEN c.itemid   IN (3582)
        THEN c.valuenum * 0.0283495231
      WHEN c.itemid   IN (920, 1394, 4187, 3486, 226707)
        THEN c.valuenum * 2.54
      ELSE c.valuenum
    END AS valuenum
  FROM chartevents c
  WHERE c.valuenum   IS NOT NULL
  -- exclude rows marked as error
  AND c.error IS DISTINCT FROM 1
  AND ( ( c.itemid  IN (762, 763, 3723, 3580, -- Weight Kg
    3581,                                     -- Weight lb
    3582,                                     -- Weight oz
    920, 1394, 4187, 3486,                    -- Height inches
    3485, 4188                                -- Height cm
    -- Metavision
    , 226707 -- Height, cm
    , 226512 -- Admission Weight (Kg)

    -- note we intentionally ignore the below ITEMIDs in metavision
    -- these are duplicate data in a different unit
    -- , 226531 -- Admission Weight (lbs.)
    -- , 226707 -- Height (inches)
    )
  AND c.valuenum <> 0 )
    ) )
  --)

  --select * from FirstVRawData
, SingleParameters AS (
  SELECT DISTINCT subject_id,
         icustay_id,
         parameter,
         first_value(valuenum) over
            (partition BY subject_id, icustay_id, parameter
             order by charttime ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
             AS first_valuenum,
         MIN(valuenum) over
            (partition BY subject_id, icustay_id, parameter
            order by charttime ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
            AS min_valuenum,
         MAX(valuenum) over
            (partition BY subject_id, icustay_id, parameter
            order by charttime ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
            AS max_valuenum
    FROM FirstVRawData

--   ORDER BY subject_id,
--            icustay_id,
--            parameter
  )
--select * from SingleParameters
, PivotParameters AS (SELECT subject_id, icustay_id,
    MAX(case when parameter = 'HEIGHT' then first_valuenum else NULL end) AS height_first,
    MAX(case when parameter = 'HEIGHT' then min_valuenum else NULL end)   AS height_min,
    MAX(case when parameter = 'HEIGHT' then max_valuenum else NULL end)   AS height_max,
    MAX(case when parameter = 'WEIGHT' then first_valuenum else NULL end) AS weight_first,
    MAX(case when parameter = 'WEIGHT' then min_valuenum else NULL end)   AS weight_min,
    MAX(case when parameter = 'WEIGHT' then max_valuenum else NULL end)   AS weight_max
  FROM SingleParameters
  GROUP BY subject_id,
    icustay_id
  )
--select * from PivotParameters
SELECT f.icustay_id,
  f.subject_id,
  ROUND( cast(f.height_first as numeric), 2) AS height_first,
  ROUND(cast(f.height_min as numeric),2) AS height_min,
  ROUND(cast(f.height_max as numeric),2) AS height_max,
  ROUND(cast(f.weight_first as numeric), 2) AS weight_first,
  ROUND(cast(f.weight_min as numeric), 2)   AS weight_min,
  ROUND(cast(f.weight_max as numeric), 2)   AS weight_max

FROM PivotParameters f
ORDER BY subject_id, icustay_id;

--COMMENT ON MATERIALIZED VIEW mimiciii.icustay_detail IS
-- '
--   Expands the table "ICUSTAYEVENTS" to show:
--
--      +  Each ICU stay is order by the column HOSPITAL_ICUSTAY_SEQ per
--         hospitalization
--      +  Each ICU stay is order by the column ICUSTAY_SEQ
--      +  The first and last ICU stays per hospitalization
--      +  First/last hospitalizations
--      +  The icu expiration flag is assigned to the last icu_stay in the last
--         hospitalization.
--  ';

--COMMENT ON COLUMN mimic2v26.icustay_detail.subject_id is 'Unique subject identifier';
--COMMENT ON COLUMN mimic2v26.icustay_detail.gender is 'Subject''s gender "M" or "F"';
--COMMENT ON COLUMN mimic2v26.icustay_detail.dob is 'Subject''s date of birth';
--COMMENT ON COLUMN mimic2v26.icustay_detail.icustay_id is 'Unique ICU stay identifier';
--COMMENT ON COLUMN mimic2v26.icustay_detail.height is 'The first entered height of the patient';
--COMMENT ON COLUMN mimic2v26.icustay_detail.weight_first is 'The first entered weight of the patient';
--COMMENT ON COLUMN mimic2v26.icustay_detail.weight_max is 'The maximum entered weight of the patient';
--COMMENT ON COLUMN mimic2v26.icustay_detail.weight_min is 'The minimum entered weight of the patient';

--execute DBMS_SNAPSHOT.REFRESH( 'icustay_detail','c');
--execute DBMS_SNAPSHOT.REFRESH( 'd_chartitems_detail','c');
--execute DBMS_SNAPSHOT.REFRESH( 'icustay_days','c');


text:
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Header.css';
import Link from '../Link';
import Navigation from '../Navigation';

class Header extends React.Component {
  render() {
    return (

          <Navigation />
          <Link className={s.brand} to="/">
            Your Company
          </Link>

React

Complex web apps made easy

    );
  }
}

export default withStyles(s)(Header);


text:
require 'spec_helper'

module Tim
  describe "/tim/provider_images/_provider_image" do
    before(:each) do
      Tim::TargetImage.any_instance
        .stub(:create_factory_target_image)
      Tim::TargetImage.any_instance.stub(:template)
        .and_return FactoryGirl.build(:template)
      Tim::TargetImage.any_instance.stub(:imported?).and_return(false)

      view.stub(:provider_image).and_return FactoryGirl.build(:provider_image)
      [:provider_image_url, :target_image_url].each do |method|
        view.stub(method)
      end
    end

    it "should render custom content partial when it is defined" do
      render
      view.should render_template(:partial => "_custom", :count => 1)
      Hash.from_xml(rendered)["provider_image"].keys.include?("custom_content")
        .should == true
    end

    it "should not fail to render when a content partial is not defined" do
      view.controller.stub(:template_exists?).and_return false
      render
      view.should render_template(:partial => "_custom", :count => 0)
    end
  end
end


text:
define("p3/widget/viewer/DataType", [
	"dojo/_base/declare", "dojo/_base/lang", "dojo/when", "dojo/request", "dojo/string", "dojo/topic",
	"dojo/dom-construct", "dojo/query", "dojo/dom-class", "dojo/dom-style",
	"dijit/layout/ContentPane", "dijit/_WidgetBase", "dijit/_TemplatedMixin",
	"d3/d3",
	"./Base", "../../util/PathJoin", "../D3StackedBarChart", "../D3HistogramChart", "../D3HorizontalBarChart"
], function(declare, lang, when, request, String, Topic,
			domConstruct, domQuery, domClass, domStyle,
			ContentPane, WidgetBase, Templated,
			d3,
			ViewerBase, PathJoin, StackedBarChart, HistogramChart, HorizontalBarChart){

	var pathwayNavBarHtml = [
		"Scale",
		"
",
		"
Real Values
",
		"
Normalize
",
		"
",
		"Order by",
		"
",
		"
Genus
",
		"
Conserved
",
		"
"
	].join("\n");

	var proteinfamilyNavBarHtml = [
		"Scale",
		"
",
		"
Real Values
",
		"
Normalize
",
		"
",
		"Data Set",
		"
",
		"
Functional vs. Hypothetical
",
		"
Core vs. Accessory
",
		"
",
		"Order by",
		"
",
		"
Genus
",
		"
Functional
",
		"
Hypothetical
",
		"
Core
",
		"
Accessory
",
		"
"
	].join("\n");

	var proteinfamilyLegend = {"fvh": ["Functional", "Hypothetical"], "cva": ["Core", "Accessory"]};

	var proteinFamiliesChart = declare([StackedBarChart], {
		sort: function(){
			var self = this;
			var sortCriteria = domQuery(".chart-wrapper .sort .active")[0].className.split(" ")[0];

			if(sortCriteria === this.currentSort){
				this.ascendSort = !this.ascendSort;
			}else{
				this.currentSort = sortCriteria;
			}

			switch(this.currentSort){
				case "label":
					this.bars.sort(function(a, b){
						var orderCode = 0;
						if(a.label  b.label){
							orderCode = 1;
						}

						if(!self.ascendSort){
							orderCode = orderCode * -1;
						}
						return orderCode;
					});
					break;
				case "functional":
				case "core":
					this.bars.sort(function(a, b){
						var aValue = self.barHeight(a[self.dataSet][0], a.total);
						var bValue = self.barHeight(b[self.dataSet][0], b.total);

						var orderCode = aValue - bValue;
						if(!self.ascendSort){
							orderCode = orderCode * -1;
						}
						return orderCode;
					});
					break;
				case "hypothetical":
				case "accessory":
					this.bars.sort(function(a, b){
						var aValue = self.barHeight(a[self.dataSet][1], a.total);
						var bValue = self.barHeight(b[self.dataSet][1], b.total);

						var orderCode = aValue - bValue;
						if(!self.ascendSort){
							orderCode = orderCode * -1;
						}
						return orderCode;
					});
					break;
				default:
					break;
			}
			for(var index = 0; index < this.seriesSize; index++){
				this.bars.select(lang.replace('rect.block-{0}', [index]))
					.transition().duration(600)
					.delay(function(d, i){
						return 10 * i
					})
					.attr("x", function(d, i){
						return self.barPosition(i)
					});
			}

			this.bars.select("text").transition().duration(600)
				.delay(function(d, i){
					return 10 * i
				})
				.attr("x", function(d, i){
					return self.textPosition(i)
				})
				.attr("transform", function(d, i){
					var y = Math.round(self.canvasHeight - 11);
					var x = self.pf_x_scale(i) + self.pf_x_scale(1) / 2;
					return lang.replace('rotate(270, {0}, {1})', [x, y]);
				})
		},
		renderNav: function(html){
			this.inherited(arguments);
			var self = this;
			var dataToggle = domQuery(".chart-wrapper nav .dataset li");

			if(dataToggle !== null){
				dataToggle.on('click', function(evt){
					dataToggle.removeClass("active");
					var target = evt.srcElement || evt.target;

					self.changeDataSet(target.className);
					domClass.add(target, "active");

					self.scale(function(){
						return self.sort();
					});
				})
			}
		},
		dataSet: "fvh",
		changeDataSet: function(d){
			this.dataSet = d;
			if(d === "fvh"){
				this.renderLegend("Legend: ", proteinfamilyLegend[d]);
				domStyle.set(domQuery(".chart-wrapper nav .sort li.functional")[0], "display", "inline");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.hypothetical")[0], "display", "inline");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.core")[0], "display", "none");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.accessory")[0], "display", "none");

			}else if(d === "cva"){
				this.renderLegend("Legend: ", proteinfamilyLegend[d]);
				domStyle.set(domQuery(".chart-wrapper nav .sort li.functional")[0], "display", "none");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.hypothetical")[0], "display", "none");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.core")[0], "display", "inline");
				domStyle.set(domQuery(".chart-wrapper nav .sort li.accessory")[0], "display", "inline");
			}
		}
	});

	var attributeTemplate = [
		"",
		"{attr.data}",
		"",
		"{attr.description}",
		"

"
	].join("\n");

	var tooltipLayer = d3.select("body").append("div")
		.attr("class", "tooltip")
		.style("opacity", 0);

	var convertCountryNameToAlpha2Code = function(name){
		// have top 10 countries for now.
		// use i18n-iso-countries module later
		var code;

		switch(name){
			case "United States":
			case "USA":
				code = "us";
				break;
			case "United Kingdom":
				code = "gb";
				break;
			case "Thailand":
				code = "th";
				break;
			case "Netherlands":
				code = "nl";
				break;
			case "China":
				code = "cn";
				break;
			case "Canada":
				code = "ca";
				break;
			case "Russia":
			case "Russian Federation":
				code = "ru";
				break;
			case "India":
				code = "in";
				break;
			case "Germany":
				code = "de";
				break;
			case "Australia":
				code = "au";
				break;
			default:
				code = "us";
				break;
		}

		return code;
	};

	return declare([ViewerBase], {

		onSetState: function(attr, oldVal, state){
			// console.log("DataType view onSetState", state);

			if(!state){
				return;
			}

			var parts = state.pathname.split("/");
			var dataType = parts[parts.length - 1];

			if(!dataType) return;

			this.dataType = dataType;

			window.document.title = dataType;

			// when(request.get(PathJoin(this.apiServiceUrl, "content/dlp/", dataType), {
			when(request.get(PathJoin(window.App.docsServiceURL, "website/data_landing_pages/", dataType + '.html'), {
				handleAs: "text"
			}), lang.hitch(this, function(data){

				data = data.replace('','')
				doc = domConstruct.toDom(data)
				// console.log(doc.childNodes.length, doc.childNodes)

				len = doc.childNodes.length
				for(i = 0; i < len; i++){
					// console.log(i, doc.childNodes[i].tagName)
					if (doc.childNodes[i].tagName === 'DIV'){
						// console.log(i, doc.childNodes[i])
						rootDivNode = doc.childNodes[i]
						sectionDivNode = rootDivNode.children[1]
						contentDivNode = sectionDivNode.children[1]
						articleNode = contentDivNode.children[0].children[1]
						articleBody = articleNode.children[0]
						content = articleBody.children[0].children[1]
					}
				}

				this.template = content;
				this.viewer.set('content', content);
				var self = this;

				when(request.get(PathJoin(self.apiServiceUrl, "content/dlp/", dataType + ".json"), {
					handleAs: "json"

				}), lang.hitch(this, function(data){

					this.set(dataType, data);
				}));
			}));
		},

		_buildPopularGenomeList: function(popularList){

			var popularListUl = ["
"];

			popularList.forEach(function(genome, idx){
				popularListUl.push(lang.replace("
{2}

", [genome.link, (idx + 1), genome.popularName]));
			});
			popularListUl.push("
");

			return popularListUl;
		},

		_initialSelection: function(el){

			var event;
			if(document.createEvent){
				event = document.createEvent("HTMLEvents");
				event.initEvent("mouseover", true, true);
			}else{
				event = document.createEventObject();
				event.eventType = "mouseover";
			}
			event.eventName = "initialMouseOver";

			if(document.createEvent){
				el.dispatchEvent(event);
			}else{
				el.fireEvent("on" + event.eventType, event);
			}
		},

		_activatePopularGenomeListTab: function(){
			var links = domQuery(".data-box.popular-box .genome-link");
			links.forEach(function(link){

				link.addEventListener('click', function(evt){
					var target = evt.target || evt.srcElement;
					var link = target.dataset.genomeHref;

					if(event.preventDefault) event.preventDefault();
					else event.returnValue = false;

					Topic.publish('/navigate', {href: link});
				});
				link.addEventListener('mouseover', function(evt){
					var target = evt.target || evt.srcElement;
					var targetTab = target.hash;

					domQuery(".data-box.popular-box .genome-list li").forEach(function(l){
						domClass.remove(l, "ui-state-active");
					});
					domClass.add(target.parentElement, "ui-state-active");

					domQuery(".genome-data").forEach(function(panel){
						if("#" + panel.id == targetTab){
							domClass.remove(panel, "hidden");
						}else{
							domClass.add(panel, "hidden");
						}
					});
				});
			});

			this._initialSelection(links[0]);
		},

		_setAntibioticResistanceAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildAntibioticResistancePopularPanel(popularList);
			var popularListUl = this._buildPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			this._activatePopularGenomeListTab();
		},
		_buildAntibioticResistancePopularPanel: function(popularList){

			var template = [
				"
",
				"
",
				"
",
				"
Antibiotic Resistance Genes:
",
				"{1}",
				"
",
				"

",
				"
",
				"
Explore Genomic Features in
",
				"
{2}
",
				"
"
			].join("\n");

			return popularList.map(function(genome, idx){

				var specialtyGenes = genome.specialtyGenes.map(function(spg){
					return lang.replace(attributeTemplate, {attr: spg});
				}).join("\n");

				var links = genome.links.map(function(link, i){

					if(i % 2){ // odd
						return lang.replace("{1}
", [link.link, link.name]);
					}else{
						return lang.replace("{1}", [link.link, link.name]);
					}
				}).join("\n");

				return lang.replace(template, [(idx + 1), specialtyGenes, links]);
			});
		},

		_setGenomicFeaturesAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildFeaturesPopularPanel(popularList);
			var popularListUl = this._buildPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			this._activatePopularGenomeListTab();
		},
		_buildFeaturesPopularPanel: function(popularList){

			var template = [
				"
",
				"
",
				"
",
				"
Features:
",
				"{1}",
				"
",
				"
",
				"
Proteins by Attributes:
",
				"{2}",
				"
",
				"
",
				"
Specialty Genes:
",
				"{3}",
				"
",
				"

",
				"
",
				"
Explore Genomic Features in
",
				"
{4}
",
				"
"].join("\n");

			return popularList.map(function(genome, idx){

				var featureTypes = genome['featureTypes'].map(function(type){
					return lang.replace(attributeTemplate, {attr: type});
				}).join("\n");
				var proteinSummary = genome['proteinSummary'].map(function(protein){
					return lang.replace(attributeTemplate, {attr: protein});
				}).join("\n");
				var specialtyGenes = genome['specialtyGenes'].map(function(gene){
					return lang.replace(attributeTemplate, {attr: gene});
				}).join("\n");

				var links = genome.links.map(function(link, i){
					if(i % 2){ // odd
						return lang.replace("{1}
", [link.link, link.name]);
					}else{
						return lang.replace("{1}", [link.link, link.name]);
					}
				}).join("\n");

				return lang.replace(template, [(idx + 1), featureTypes, proteinSummary, specialtyGenes, links]);
			});
		},

		_setGenomesAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildGenomesPopularPanel(popularList);
			var popularListUl = this._buildPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			this._activatePopularGenomeListTab();
			// render genome_status chart
			this._renderGenomeStatusChart(data['genomeStatus']);
			// render genome_count chart
			this._renderGenomeNumbersChart(data['numberGenomes']);
			// render top5 charts
			this._renderGenomeTopChart('dlp-genomes-chart-tab1', data['top5_1']['data']);
			this._renderGenomeTopChart('dlp-genomes-chart-tab2', data['top5_2']['data']);
			// handle tabs
			var tabs = domQuery(".tabbed .tab-headers.inline li span");
			tabs.forEach(function(tab){
				tab.addEventListener('click', function(evt){

					// console.log(evt);
					var targetTab = evt.srcElement.dataset.href;

					domQuery(".tabbed .tab-headers.inline li").forEach(function(l){
						domClass.remove(l, "ui-state-active");
					});
					domClass.add(evt.srcElement.parentElement, "ui-state-active");

					["#dlp-genomes-chart-tab1", "#dlp-genomes-chart-tab2"].forEach(function(div){
						if(div == targetTab){
							domClass.remove(domQuery(div)[0], "hidden");
						}else{
							domClass.add(domQuery(div)[0], "hidden");
						}
					});
				});
			});
		},

		_buildGenomesPopularPanel: function(popularList){

			var template = ["
",
				"{1}",
				"{2}",
				"

",
				"
View This Genome in Genome Browser
",
				"
"].join("\n");

			var metadataTemplate = ["
",
				"
",
				"Genome Status: 	",
				" {metadata.genome_status}	",
				"Isolation Country: 	",
				" {metadata.isolation_country}	",
				"
",
				"
",
				"Genomic Sequences: 	",
				"1 Chromosome	",
				"Host Name: 	",
				" {metadata.host_name}	",
				"
",
				"
",
				"Genome Length: 	",
				" {metadata.genome_length} bp	",
				"Disease: 	",
				" {metadata.disease}	",
				"
",
				"
",
				"Completion Date: 	",
				" {metadata.completion_date}	",
				"Collection Year: 	",
				" {metadata.collection_year}	",
				"Collection Date: 	",
				" {metadata.collection_date}	",
				"
",
				"
"].join("\n");

			var dataTypeTemplate = ["
",
				"",
				"

",
				"
{dataType.features.data}
",
				"
Features
",
				"",
				"",
				"

",
				"
{dataType.experiments.data}
",
				"
Transcriptomic Experiments
",
				"",
				"
",
				"
",
				"",
				"

",
				"
{dataType.pathways.data}
",
				"
Pathways
",
				"",
				"",
				"

",
				"
{dataType.proteinfamily.data}
",
				"
Protein Families
",
				"",
				"
"].join("\n");

			return popularList.map(function(genome, idx){

				var meta = lang.replace(metadataTemplate, genome);
				var dataType = lang.replace(dataTypeTemplate, genome);

				return lang.replace(template, [(idx + 1), meta, dataType, genome.gb_link]);
			});
		},

		_renderGenomeStatusChart: function(data){

			var chartCanvas = d3.select("#dlp-genomes-genomeStatus .chart")
				.append("div").attr("class", "chartContainer")
				.style("height", "272px")
				.append("div")
				.attr("class", "chartCanvas group").style("width", "100%");

			var dataset = data['data'];

			var x_scale = d3.scale.linear().range([0, 272]).domain([
				0, d3.sum(dataset, function(d){
					return d.value;
				})
			]);

			var chart = chartCanvas.selectAll("div").data(dataset).enter();

			chart.append("div").attr("class", function(d){
				return "gsc_bar " + d['m_label'];
			}).style("height", function(d){
				return x_scale(d.value) + "px";
			}).on("click", function(d){
				var url;
				switch(d.label){
					case "Whole Genome Shotgun":
						url = "/view/Taxonomy/2#view_tab=genomes&filter=eq(genome_status,WGS)";
						break;
					case "Complete":
						url = "/view/Taxonomy/2#view_tab=genomes&filter=eq(genome_status,Complete)";
						break;
					default:
						url = "/view/Taxonomy/2#view_tab=genomes&filter=eq(genome_status,Plasmid)";
						break;
				}
				Topic.publish("/navigate", {href: url});
			}).on("mouseover", function(d){
				tooltipLayer.transition()
					.duration(200)
					.style("opacity", .95);

				tooltipLayer.html(d.label)
					.style("left", d3.event.pageX + "px")
					.style("top", d3.event.pageY + "px");
			}).on("mouseout", function(){
				tooltipLayer.transition()
					.duration(500)
					.style("opacity", 0);
			});

			var bars = chartCanvas.selectAll(".gsc_bar").data(dataset);

			bars.append("span").attr("class", "value").text(function(d){
				return d.reported;
			});

			bars.append("span").attr("class", "reportedLabel").text(function(d){
				return d.label;
			});
		},

		_renderGenomeNumbersChart: function(data){

			var dataset = data['data'];

			var yearLables = [];
			dataset.forEach(function(d){
				yearLables.push(d.year);
			});

			var chart = d3.select("#dlp-genomes-numberGenomes .chart")
				.insert("svg", ":first-child")
				.attr("class", "svgChartContainer")
				.attr("width", 288)
				.attr("height", 272);

			var canvas = chart.append("g")
				.attr("class", "svgChartCanvas")
				.attr("width", 232)
				.attr("height", 241)
				.attr("transform", "translate(50,6)");

			var drawTarget = {
				chart: chart,
				canvas: canvas,
				canvas_size: {
					height: 241,
					width: 232
				},
				margins: [6, 6, 25, 50]
			};

			var chartheight = drawTarget.canvas_size.height;
			var chartwidth = drawTarget.canvas_size.width;

			var maxGenomes = d3.max(dataset, function(d){
				return d3.max([d.complete, d['wgs']]);
			});

			var genome_scale = d3.scale.linear().domain([0, (maxGenomes + 500)]).range([chartheight, 0]);
			var year_scale = d3.scale.ordinal().domain(yearLables).rangeBands([0, chartwidth]);

			var genome_axis = d3.svg.axis().scale(genome_scale).orient("left").tickSubdivide(1).tickSize(-chartwidth).tickPadding(15);
			var year_axis = d3.svg.axis().scale(year_scale).orient("bottom").tickSize(0).tickPadding(10).tickFormat(d3.format("d"));

			// add Background
			canvas.append("rect").attr("class", "chart-background")
				.attr("width", chartwidth + 4).attr("height", chartheight + 4).attr("transform", "translate(-2,-2)");

			canvas.append("g").attr("class", "y axis").call(genome_axis);
			canvas.append("g").attr("class", "x axis").call(year_axis);
			canvas.select(".x.axis").attr("transform", "translate(0," + chartheight + ")");

			var datagroups = canvas.selectAll("datapoints").data(dataset);

			offset = (year_scale.rangeBand()) / 2;
			var lineSeries1 = d3.svg.line().x(function(d, i){
				//return year_scale(d.year);
				return year_scale.rangeBand() * i + offset;
			}).y(function(d){
				return genome_scale(d.wgs);
			});

			var lineSeries2 = d3.svg.line().x(function(d, i){
				//return year_scale(d.year);
				return year_scale.rangeBand() * i + offset;
			}).y(function(d){
				return genome_scale(d.complete);
			});
			canvas.append("path").attr("d", lineSeries1(dataset)).attr("class", "total line");
			canvas.append("path").attr("d", lineSeries2(dataset)).attr("class", "sequenced line");

			// Now add the rectangles for each data point for both lines.
			datagroups.enter().append("g").attr("class", "datapoints");

			// WGS
			canvas.selectAll(".datapoints").data(dataset)
				.append("rect")
				.attr("class", "point-total").attr("x", function(d, i){
				return year_scale.rangeBand() * i + offset - 3;
			}).attr("y", function(d){
				return genome_scale(d['wgs']) - 3;
			}).attr("width", "6")
				.attr("height", "6")
				.on("click", function(d){
					var url = "/view/Taxonomy/2#view_tab=genomes&filter=and(eq(genome_status,WGS),lt(completion_date," + (d.year + 1) + "-01-01T00%3A00%3A00Z))";

					Topic.publish("/navigate", {href: url});
				}).on("mouseover", function(d){
				tooltipLayer.transition()
					.duration(200)
					.style("opacity", .95);

				tooltipLayer.html("WGS: " + d.wgs)
					.style("left", d3.event.pageX + "px")
					.style("top", d3.event.pageY + "px");
			}).on("mouseout", function(){
				tooltipLayer.transition()
					.duration(500)
					.style("opacity", 0);
			});

			// complete
			canvas.selectAll(".datapoints").data(dataset)
				.append("rect")
				.attr("class", "point-sequenced")
				.attr("x", function(d, i){
					return year_scale.rangeBand() * i + offset - 3;
				}).attr("y", function(d){
				return genome_scale(d.complete) - 3;
			}).attr("width", "6").attr("height", "6")
				.on("click", function(d){
					var url = "/view/Taxonomy/2#view_tab=genomes&filter=and(eq(genome_status,Complete),lt(completion_date," + (d.year + 1) + "-01-01T00%3A00%3A00Z))";

					Topic.publish("/navigate", {href: url});
				}).on("mouseover", function(d){
				tooltipLayer.transition()
					.duration(200)
					.style("opacity", .95);

				tooltipLayer.html("Complete: " + d.complete)
					.style("left", d3.event.pageX + "px")
					.style("top", d3.event.pageY + "px");
			}).on("mouseout", function(){
				tooltipLayer.transition()
					.duration(500)
					.style("opacity", 0);
			});
		},

		_renderGenomeTopChart: function(target, data){

			var breakstr = "M 0 6 L 6 0 L 12 6 L 18 0 L 24 6 L 30 0 L 36 6 L 42 0 L 48 6 L 54 0";
			breakstr += "L 54 28 L 48 22 L 42 28 L 36 22 L 30 28 L 24 22 L 18 28 L 12 22 L 6 28 L 0 22 Z";
			var chart = d3.select("#" + target + " .chart")
				.insert("svg", ":first-child")
				.attr("class", "svgChartContainer")
				.attr("width", 288)
				.attr("height", 232);

			var canvas = chart.append("g")
				.attr("class", "svgChartCanvas")
				.attr("width", 288)
				.attr("height", 266)
				.attr("transform", "translate(0,22)");

			var chartHeight = 266; //this.drawtarget.canvas_size.height;
			var chartWidth = 288; //this.drawtarget.canvas_size.width;
			var upperBound = d3.max(data, function(d){
				return d.reported || d.value;
			});
			var yScale = d3.scale.linear().range([30, chartHeight]).domain([0, upperBound]);
			var xScale = d3.scale.linear().range([0, chartWidth]).domain([0, data.length]);
			var bars = canvas.selectAll("g.bar").data(data);
			bars.enter().append("g");

			// add rect bar
			bars.append("rect").attr("class", function(d, i){
				return "bar bar-" + i;
			}).attr("height", function(d){
				var val;
				val = d.reported || d.value;
				return yScale(val);
			}).attr("width", Math.floor(xScale(.8)))
			.attr("x", function(d, i){
				return (i * xScale(1)) + xScale(.1);
			}).attr("y", function(d){
				var val = d.reported || d.value;
				return chartHeight - yScale(val);
			}).on("click", function(d){
				var url = "/view/Taxonomy/2#view_tab=genomes&filter=";

				if(target === "dlp-genomes-chart-tab1"){
					url += "eq(host_name," + encodeURIComponent(d.label) + ")";
				}else{
					url += "eq(isolation_country," + encodeURIComponent(d.label) + ")";
				}
				Topic.publish("/navigate", {href: url});

			}).on("mouseover", function(d){
				tooltipLayer.transition()
					.duration(200)
					.style("opacity", .95);

				tooltipLayer.html(d.label + " (" + d.value + ")")
					.style("left", d3.event.pageX + "px")
					.style("top", d3.event.pageY + "px");
			}).on("mouseout", function(){
				tooltipLayer.transition()
					.duration(500)
					.style("opacity", 0);
			});
			// add text
			bars.append("text")
			.attr("class", "label")
			.attr("x", function(d, i){
				return (i * xScale(1)) + xScale(.5);
			}).attr("y", function(d){
				var val = d.reported || d.value;
				return chartHeight - yScale(val) - 6;
			}).attr("text-anchor", "middle")
			.text(function(d){
				if(target === "dlp-genomes-chart-tab1"){
					return d.label.split(",")[0];
				}else{
					return d.value;
				}
			}).on("click", function(d){
				var url = "/view/Taxonomy/2#view_tab=genomes&filter=";

				if(target === "dlp-genomes-chart-tab1"){
					url += "eq(host_name," + encodeURIComponent(d.label) + ")";
				}else{
					url += "eq(isolation_country," + encodeURIComponent(d.label) + ")";
				}
				Topic.publish("/navigate", {href: url});
			}).on("mouseover", function(d){
				tooltipLayer.transition()
					.duration(200)
					.style("opacity", .95);

				tooltipLayer.html(d.label + " (" + d.value + ")")
					.style("left", d3.event.pageX + "px")
					.style("top", d3.event.pageY + "px");
			}).on("mouseout", function(){
				tooltipLayer.transition()
					.duration(500)
					.style("opacity", 0);
			});

			// add flag for isolation country tab
			if(target === "dlp-genomes-chart-tab2"){
				bars.append("image")
					.attr("xlink:href", function(d){
						return "/public/js/flag-icon-css/flags/1x1/" + convertCountryNameToAlpha2Code(d.label) + ".svg";
					})
					.attr("height", 32)
					.attr("width", 32)
				.attr("x", function(d, i){
					return (i * xScale(1)) + xScale(.1) + 7;
				})
				.attr("y", 178)
				.on("click", function(d){
					var url = "/view/Taxonomy/2#view_tab=genomes&filter=eq(isolation_country," + encodeURIComponent(d.label) + ")";
					Topic.publish("/navigate", {href: url});
				})
				.on("mouseover", function(d){
					tooltipLayer.transition()
						.duration(200)
						.style("opacity", .95);

					tooltipLayer.html(d.label + " (" + d.value + ")")
						.style("left", d3.event.pageX + "px")
						.style("top", d3.event.pageY + "px");
				}).on("mouseout", function(){
					tooltipLayer.transition()
						.duration(500)
						.style("opacity", 0);
				});
			}

			// add sawtooth
			bars.select(function(d){
				if((d.reported != null) && d.reported !== d.value){
					return this;
				}else{
					return null;
				}
			}).append("path").attr("d", breakstr).attr("class", "sawtooth").attr("transform", function(d, i){
				var scaleFactor, xpos, ypos;
				xpos = (i * xScale(1)) + xScale(.1);
				ypos = chartHeight - yScale(d.reported / 2) - 14;
				scaleFactor = xScale(.8) / 54;
				return "translate(" + xpos + "," + ypos + ") scale(" + scaleFactor + ")";
			});
		},

		_setPathwaysAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildPathwaysPopularPanel(popularList);
			var popularListUl = this._buildPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			this._activatePopularGenomeListTab();

			// render pathway conservation chart
			this._renderPathwayConservation(data['conservation']['data']);
		},

		_renderPathwayConservation: function(data){

			var legend = ["80 ~ 100 %", "60 ~ 80 %", "40 ~ 60 %", "20 ~ 40 %", "< 20 %"];
			var processed = data.map(function(d, idx){
				return {
					"index": idx,
					"label": d.pathogen,
					"total": d.total,
					"tooltip": function(d, idx){
						return lang.replace('Genus: {0}
Conservation: {1}
Count: {2}', [d.label, legend[idx], d.dist[idx]]);
					},
					"dist": d.dist
				};
			});

			var targetNode = domQuery("#dlp-pathways-conservation")[0];
			var pathwayChart = new StackedBarChart();
			pathwayChart.init(targetNode);
			pathwayChart.renderNav(pathwayNavBarHtml);
			pathwayChart.renderLegend("Pathway Conservation Across %Genomes: ", legend);
			pathwayChart.render(processed);
		},

		_buildPathwaysPopularPanel: function(popularList){

			var template = [
				"
",
				"
",
				"
Summary of Top 10 Pathways:
",
				"
",
				"
",
				"EC numbers	",
				"Genes	",
				"Pathway Name	",
				"
",
				"{1}",
				"
",
				"View All Pathways in This Genome",
				"
",
				"
"
			].join("\n");

			var pathwayTableTemplate = [
				"
",
				"{p.ec_count}	",
				"{p.gene_count}	",
				"{p.name}	",
				"
"
			].join("\n");

			return popularList.map(function(genome, idx){

				var pathwayTable = genome.popularData.map(function(p){
					return lang.replace(pathwayTableTemplate, {p: p});
				}).join("\n");

				return lang.replace(template, [(idx + 1), pathwayTable, genome.link]);
			});
		},

		_setProteinFamiliesAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildProteinFamiliesPopularPanel();
			var popularListUl = this._buildProteinFamiliesPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			// render protein family distribution chart
			this._renderProteinFamiliesDistribution(data['FIGfams']['data']);
			// render popular genome chart
			this._renderProteinFamiliesByGenus();

			// this._activatePopularGenomeListTab();
			this._activateProteinFamiliesPopularGenomeListTab();
		},

		_buildProteinFamiliesPopularGenomeList: function(popularList){

			var template = [
				"
",
				"{3}",
				"

",
				"
",
				"
",
				"{7}",
				"

",
				"
"
			].join("\n");

			var rtn = ["
"];
			for(var i = 0, len = popularList.length / 2; i < len; i++){
				var idxLeft = i;
				var idxRight = i + 11;

				rtn.push(lang.replace(template, [JSON.stringify(popularList[idxLeft].popularData), popularList[idxLeft].link, idxLeft, popularList[idxLeft].popularName, JSON.stringify(popularList[idxRight].popularData), popularList[idxRight].link, idxRight, popularList[idxRight].popularName]));
			}
			rtn.push("
");

			return rtn;
		},
		_activateProteinFamiliesPopularGenomeListTab: function(){
			var links = domQuery(".data-box.popular-box .genome-link");
			links.forEach(function(link){

				link.addEventListener('click', function(evt){
					var target = evt.target || evt.srcElement;
					var link = target.dataset.genomeHref;
					Topic.publish('/navigate', {href: link, target: "blank"});
				});
				link.addEventListener('mouseover', function(evt){
					var target = evt.target || evt.srcElement;
					// var targetTab = target.hash;

					domQuery(".data-box.popular-box .genome-list li").forEach(function(l){
						domClass.remove(l, "ui-state-active");
					});
					domClass.add(target.parentElement, "ui-state-active");
				});
			});

			this._initialSelection(links[0]);
		},

		_buildProteinFamiliesPopularPanel: function(){

			return [
				"
",
				"
",
				"
",
				"
"];
		},

		_renderProteinFamiliesByGenus: function(){

			window.ProteinFamilyDistChart = new HistogramChart();
			window.ProteinFamilyDistChart.init("#dlp-proteinfamilies-dist-genus", "dlp");
			window.ProteinFamilyDistChart.renderTitle("Conservation Across %Genomes", "# of Protein Families");
		},

		_renderProteinFamiliesDistribution: function(data){

			var processed = data.map(function(datum, i){
				return {
					"index": i,
					"label": datum.pathogen,
					"genomes": datum.genomes,
					"total": parseInt(datum.total),
					"tooltip": function(d, idx, dataSet){
						return lang.replace('Genus: {0}
Data: {1}
Count: {2}', [d.label, legend[dataSet][idx], d[dataSet][idx]]);
					},
					"cva": [parseInt(datum.core), parseInt(datum.accessory)],
					"fvh": [parseInt(datum.functional), parseInt(datum.hypothetical)]
				};
			});

			var targetNode = domQuery("#dlp-proteinfamilies-dist-genera")[0];
			var pfChart = new proteinFamiliesChart();
			pfChart.init(targetNode);
			pfChart.renderNav(proteinfamilyNavBarHtml);
			pfChart.renderLegend("Legend: ", proteinfamilyLegend["fvh"]);
			pfChart.render(processed);
		},

		_setSpecialtyGenesAttr: function(data){

			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildSpecialtyGenesPopularPanel(popularList);
			var popularListUl = this._buildPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			this._activatePopularGenomeListTab();
		},

		_buildSpecialtyGenesPopularPanel: function(popularList){

			var template = [
				"
",
				"
",
				"
",
				"
Specialty Genes:
",
				"{1}",
				"

",
				"
",
				"

",
				"
",
				"
Explore Genomic Features in
",
				"
{2}
",
				"
"
			].join("\n");

			return popularList.map(function(genome, idx){

				var specialtyGenes = genome.specialtyGenes.map(function(spg){
					return lang.replace(attributeTemplate, {attr: spg});
				}).join("\n");

				var links = genome.links.map(function(link, i){
					if(i % 2){ // odd
						return lang.replace("{1}
", [link.link, link.name]);
					}else{
						return lang.replace("{1}", [link.link, link.name]);
					}
				}).join("\n");

				return lang.replace(template, [(idx + 1), specialtyGenes, links]);
			});
		},

		_setTranscriptomicsAttr: function(data){

			// select genomes
			var popularList = data['popularGenomes']['popularList'];

			var popularTabList = this._buildTranscriptomicsPopularPanel();
			var popularListUl = this._buildTranscriptomicsPopularGenomeList(popularList);

			var tabDiv = domQuery(".data-box.popular-box div.group")[0];

			var popularTabNode = domConstruct.toDom(popularTabList.join(""));
			var popularListNode = domConstruct.toDom(popularListUl.join(""));

			domConstruct.place(popularTabNode, tabDiv);
			domConstruct.place(popularListNode, tabDiv);

			// render top 5 species
			this._renderTranscriptomicsTopSpecies(data['topSpecies']['data']);

			// render featured experiments
			this._renderTranscriptomicsFeaturedExperiments(data['featuredExperiment']['data']);

			// render select genomes
			this._renderTranscriptomicsPopularPanelChart();

			// this._activatePopularGenomeListTab();
			this._activateTranscriptomicsPopularGenomeListTab();
		},

		_buildTranscriptomicsPopularGenomeList: function(popularList){

			var popularListUl = ["
"];

			var template = [
				"
",
				"{3}",
				"

",
				"
"
			].join("\n");

			popularList.forEach(function(genome, idx){
				popularListUl.push(lang.replace(template, [encodeURIComponent(JSON.stringify(genome)), (idx + 1), genome.link, genome.popularName]));
			});
			popularListUl.push("
");

			return popularListUl;
		},

		_activateTranscriptomicsPopularGenomeListTab: function(){
			var links = domQuery(".data-box.popular-box .genome-link");
			links.forEach(function(link){

				link.addEventListener('click', function(evt){
					var target = evt.target || evt.srcElement;
					var link = target.dataset.genomeHref;

					if(event.preventDefault) event.preventDefault();
					else event.returnValue = false;

					Topic.publish('/navigate', {href: link});
				});
				link.addEventListener('mouseover', function(evt){
					var target = evt.target || evt.srcElement;
					// var targetTab = target.hash;

					domQuery(".data-box.popular-box .genome-list li").forEach(function(l){
						domClass.remove(l, "ui-state-active");
					});
					domClass.add(target.parentElement, "ui-state-active");
				});
			});

			this._initialSelection(links[0]);
		},

		_renderTranscriptomicsPopularPanelChart: function(){

			var self = this;

			self.topGeneModificationChart = new HorizontalBarChart();
			self.topGeneModificationChart.init("#dlp-transcriptomics-top-mutants", "dlp-tr-gm", {
				top: 0,
				bottom: 38,
				left: 145
			});
			self.topGeneModificationChart.renderTitle("Experiments");
			self.topExperimentConditionChart = new HorizontalBarChart();
			self.topExperimentConditionChart.init("#dlp-transcriptomics-top-conditions", "dlp-tr-ec", {
				top: 0,
				bottom: 38,
				left: 145
			});
			self.topExperimentConditionChart.renderTitle("Experiments");

			window.TranscriptomicsSelectGenome = (function(){
				return {
					update: function(data){

						var processed = JSON.parse(decodeURIComponent(data));

						self.topGeneModificationChart.update(processed['GeneModifications']['data']);
						self.topExperimentConditionChart.update(processed['ExperimentConditions']['data']);
						domQuery('#dlp-transcriptomics-linkout')[0].href = processed.link;
					}
				};
			})();
		},

		_buildTranscriptomicsPopularPanel: function(){

			return [
				"
",
				"
",
				"Top 5 Gene Modifications",
				"
",
				"
",
				"Top 5 Experiment Conditions",
				"
",
				"
View All Experiment for This Genome
",
				"
"
			];
		},

		_renderTranscriptomicsTopSpecies: function(data){

			// var chart = new HorizontalBarChart();
			// chart.init("#dlp-transcriptomics-top-species", "dlp-tr-top-sp", {top: 0, bottom: 0, left: 10});
			// chart.render(data);

			var container = d3.select("#dlp-transcriptomics-top-species .chart");
			var containerWidth = domStyle.get(container, "width") || 408;
			var containerHeight = domStyle.get(container, "height") || 272;

			var chart = d3.select(".chart")
				.insert("svg", ":first-child")
				.attr("class", "svgChartContainer")
				.attr("width", containerWidth)
				.attr("height", containerHeight);

			var chartWidth = domStyle.get(chart, "width") || 408;
			var chartHeight = domStyle.get(chart, "height") || 272;

			var canvas = chart.append("g")
				.attr("class", "svgChartCanvas")
				.attr("width", chartWidth)
				.attr("height", chartHeight);

			var upperBound = d3.max(data, function(d){
				return d.count;
			});
			var xScale = d3.scale.linear().domain([0, upperBound]).range([0, chartWidth]);
			var yScale = d3.scale.linear().domain([0, data.length]).range([0, chartHeight]);

			var bars = canvas.selectAll("g.bar").data(data).enter().append("g");

			// add rect bar
			bars.append("rect").attr("class", function(d, i){
				return "bar-" + i;
			}).attr("height", 45)
				.attr("width", function(d){
					return xScale(d.count);
				}).attr("y", function(d, i){
				return yScale(i);
			}).attr("rx", 3).attr("ry", 3)
				.on("click", function(d){

					var url = "/view/Taxonomy/2#view_tab=transcriptomics&filter=eq(organism," + encodeURIComponent(d.label) + ")";
					Topic.publish("/navigate", {href: url});
				});

			// add text
			bars.append("text").attr("class", "label1")
				.attr("x", "10")
				.attr("y", function(d, i){
					return yScale(i) + 20;
				}).text(function(d){
				return d.label;
			})
				.on("click", function(d){
					var url = "/view/Taxonomy/2#view_tab=transcriptomics&filter=eq(organism," + encodeURIComponent(d.label) + ")";
					Topic.publish("/navigate", {href: url});
				});
			bars.append("text").attr("class", "label2")
				.attr("x", "10")
				.attr("y", function(d, i){
					return yScale(i) + 38;
				}).text(function(d){
				return d.count + " Experiments";
			})
				.on("click", function(d){
					var url = "/view/Taxonomy/2#view_tab=transcriptomics&filter=eq(organism," + encodeURIComponent(d.label) + ")";
					Topic.publish("/navigate", {href: url});
				});
		},

		_renderTranscriptomicsFeaturedExperiments: function(list){

			var targetNode = domQuery("#dlp-transcriptomics-featured-experiments h3")[0];

			var template = [
				"
",
				"",
				"
",
				"{exp.title}",
				"
{exp.organism}
",
				"
",
				"Accession: {exp.accession},",
				"PubMed: {exp.pmid}",
				"
",
				"
",
				"
"
			].join("\n");

			var renderedList = list.map(function(exp){
				return lang.replace(template, {exp: exp});
			}).join("\n");

			domConstruct.place(domConstruct.toDom(renderedList), targetNode, "after");
		},

		postCreate: function(){
			if(!this.state){
				this.state = {};
			}

			this.inherited(arguments);

			this.viewer = new ContentPane({
				region: "center",
				style: "padding:0",
				content: ""
			});

			this.addChild(this.viewer);
		}
	});
});


text:
@class NSArray, NSString;

@interface ActionGridRow : NSObject <NSCoding>
{
    NSArray *_rowItemList;
    NSString *_title;
}

@property(retain, nonatomic) NSString *title; // @synthesize title=_title;
@property(retain, nonatomic) NSArray *rowItemList; // @synthesize rowItemList=_rowItemList;
- (void).cxx_destruct;
- (id)init;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)toXml;

@end


text:
package slieb.kute.providers;

import com.google.common.collect.Sets;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import slieb.kute.KuteIO;
import slieb.kute.api.Resource;
import slieb.kute.api.ResourcePredicate;

import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

import static org.slieb.throwables.FunctionWithThrowable.castFunctionWithThrowable;

public class FilteredResourceProviderTest implements ProviderTestInterface {

    private FilteredResourceProvider provider;

    private ResourcePredicate filter;

    private ConcurrentMapResourceProvider memoryProvider;

    @Before
    public void setUp() throws Exception {
        memoryProvider = new ConcurrentMapResourceProvider();
        filter = new PassFilter("pass");
        provider = new FilteredResourceProvider(memoryProvider, filter);
        createContent("/directory/pass/index.html", "index content");
        createContent("/directory/fail/index.html", "other content");
    }

    private void createContent(String path, String content) throws Exception {
        KuteIO.writeResource(memoryProvider.create(path), content);
    }

    @Override
    @Test
    public void shouldNotProvideDirectoriesInStream() throws Exception {
        Assert.assertFalse(provider.stream().anyMatch(r -> r.getPath().equals("/directory")));
        Assert.assertTrue(provider.stream().anyMatch(r -> r.getPath().equals("/directory/pass/index.html")));
        Assert.assertEquals(1, provider.stream().count());

    }

    @Override
    @Test
    public void shouldNotProvideDirectoriesInGetByPath() throws Exception {
        Assert.assertFalse(provider.getResourceByName("/directory").isPresent());
        Assert.assertFalse(provider.getResourceByName("/directory/pass").isPresent());
    }

    @Override

    @Test
    public void shouldNeverReturnNullOnGetByPath() throws Exception {
        Assert.assertNotNull(provider.getResourceByName("/does"));
        Assert.assertNotNull(provider.getResourceByName("/does/not"));
        Assert.assertNotNull(provider.getResourceByName("/does/not exist!"));
    }

    @Override

    @Test
    public void shouldReturnElementsInStream() throws Exception {
        Assert.assertEquals(1, provider.stream().count());
    }

    @Override

    @Test
    public void shouldReturnPresentOptionalInGetByPath() throws Exception {
        Assert.assertTrue(provider.getResourceByName("/directory/pass/index.html").isPresent());
    }

    @Override

    @Test
    public void shouldReturnResourceWithCorrectContentInStream() throws Exception {
        Assert.assertEquals(
                Sets.newHashSet("index content"),
                provider.stream().map(castFunctionWithThrowable(KuteIO::readResource)).collect(Collectors.toSet()));
    }

    @Override

    @Test
    public void shouldReturnResourceWithCorrectContentInGetByPath() throws Exception {
        Assert.assertEquals(
                "index content",
                KuteIO.readResource(provider.getResourceByName("/directory/pass/index.html").get())
        );
    }

    @Override
    @Test
    public void shouldReturnAllResourcesInStreamInGetByPath() throws Exception {
        Assert.assertTrue(provider.stream()
                .map(Resource::getPath)
                .map(provider::getResourceByName)
                .allMatch(Optional::isPresent));
    }

    @Override
    @Test
    public void shouldBeSerializable() throws Exception {
        Resource.Provider loaded = KuteIO.deserialize(KuteIO.serialize(provider), Resource.Provider.class);
        Assert.assertEquals(provider.toString(), loaded.toString());
        Assert.assertEquals(provider.hashCode(), loaded.hashCode());
        Assert.assertEquals(provider, loaded);
    }
}

class PassFilter implements ResourcePredicate<Resource> {

    private final String value;

    public PassFilter(String value) {
        this.value = value;
    }

    @Override
    public boolean test(Resource resource) {
        return resource.getPath().contains(value);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PassFilter)) return false;
        PassFilter that = (PassFilter) o;
        return Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value);
    }

    @Override
    public String toString() {
        return "PassFilter{" +
                "value='" + value + '\'' +
                '}';
    }
}


text:
#pragma once

#include "proxygen/lib/http/codec/compress/HPACKHeader.h"

#include <folly/Memory.h>
#include <folly/dynamic.h>
#include <memory>
#include <string>
#include <vector>

namespace proxygen {

class HTTPArchive {
 public:

  std::vector<std::vector<HPACKHeader>> requests;
  std::vector<std::vector<HPACKHeader>> responses;

  static std::unique_ptr<HTTPArchive> fromFile(const std::string& filename);

  // helper function for extracting a list of headers from a json array
  static void extractHeaders(folly::dynamic& obj,
                             std::vector<HPACKHeader>& msg);

  static uint32_t getSize(const std::vector<HPACKHeader>& headers);
};

}


text:
include(FindPackageHandleStandardArgs)

find_path(TOLUAPP_H_PATH NAMES tolua++.h)
find_library(TOLUAPP_LIB NAMES tolua++-5.1 tolua++5.1 toluapp-5.1 tolua++ toluapp PATH_SUFFIXES dynamic/${CEGUI_ARCH_SUFFIX})
find_library(TOLUAPP_LIB_DBG NAMES tolua++-5.1_d tolua++5.1_d toluapp-5.1_d tolua++_d toluapp_d PATH_SUFFIXES dynamic/${CEGUI_ARCH_SUFFIX})
mark_as_advanced(TOLUAPP_H_PATH TOLUAPP_LIB TOLUAPP_LIB_DBG)

if (WIN32 OR APPLE)
    find_library(TOLUAPP_LIB_STATIC NAMES tolua++5.1 tolua++ toluapp PATH_SUFFIXES static/${CEGUI_ARCH_SUFFIX})
    find_library(TOLUAPP_LIB_STATIC_DBG NAMES tolua++5.1_d tolua++_d toluapp_d PATH_SUFFIXES static/${CEGUI_ARCH_SUFFIX})
    mark_as_advanced(TOLUAPP_LIB_STATIC TOLUAPP_LIB_STATIC_DBG)
endif()

cegui_find_package_handle_standard_args(TOLUAPP TOLUAPP_LIB TOLUAPP_H_PATH)

# set up output vars
if (TOLUAPP_FOUND)
    set (TOLUAPP_INCLUDE_DIR ${TOLUAPP_H_PATH})
    set (TOLUAPP_LIBRARIES ${TOLUAPP_LIB})
    if (TOLUAPP_LIB_DBG)
        set (TOLUAPP_LIBRARIES_DBG ${TOLUAPP_LIB_DBG})
    endif()
    if (TOLUAPP_LIB_STATIC)
        set (TOLUAPP_LIBRARIES_STATIC ${TOLUAPP_LIB_STATIC})
    endif()
    if (TOLUAPP_LIB_STATIC_DBG)
        set (TOLUAPP_LIBRARIES_STATIC_DBG ${TOLUAPP_LIB_STATIC_DBG})
    endif()
else()
    set (TOLUAPP_INCLUDE_DIR)
    set (TOLUAPP_LIBRARIES)
    set (TOLUAPP_LIBRARIES_DBG)
    set (TOLUAPP_LIBRARIES_STATIC)
    set (TOLUAPP_LIBRARIES_STATIC_DBG)
endif()


text:
package easy;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class FibonachiSeries {
public static void main(String[] args) throws NumberFormatException, IOException{
	int num=getInput("Enter a positive position to get the fibonachi number ");
	int fnum=getFibonachinum(num);
	System.out.println("the fibonachi num is : "+ fnum);
}

private static int getFibonachinum(int num) {
	if(num==0){return 0;}
	if(num==1){return 1;}
	else{
	int fnum= getFibonachinum(num-1)+getFibonachinum(num-2);
	return fnum;
	}
}

private static int getInput(String string) throws NumberFormatException, IOException {
	System.out.println(string);
	InputStreamReader isr= new InputStreamReader(System.in);
	BufferedReader br=new BufferedReader(isr);
	return Integer.parseInt(br.readLine());
}
}


text:
package com.baidu.rigel.biplatform.tesseract.isservice.meta;

import java.io.File;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;

import com.baidu.rigel.biplatform.ac.query.data.DataSourceInfo;
import com.baidu.rigel.biplatform.tesseract.store.meta.StoreMeta;

/**
 *
 * 索引元数据
 *
 * @author lijin
 *
 */
public class IndexMeta extends StoreMeta implements Serializable {
    /**
     * 存储区名称
     */
    private static final String DATA_STORE_NAME_INDEX_META = "DATA_STORE_NAME_INDEX_META";
    /**
     * 索引元数据中key的联字符
     */
    // private static final String INDEX_META_KEY_SPLITTER = "_";
    /**
     * 如果是分表的话,表前缀与正则的分隔符
     */
    private static final String FACTTABLE_REGEX_SPLITTER = "_";
    /**
     * 提供索引服务的路径前缀
     */
    private static final String INDEX_FILE_PATH_INDEX = "index_0/";
    /**
     * 更新索引的路径前缀
     */
    private static final String INDEX_FILE_PATH_UPDATE = "index_1/";

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 3211554735307147462L;

    /**
     * clusterName 所属集群名称
     */
    private String clusterName;

    /**
     * indexMetaId 索引元数据ID
     */
    private String indexMetaId;

    /**
     * cube名称集合
     */
    private Set<String> cubeIdSet;

    /**
     * 所属产品线
     */
    private String productLine;
    /**
     * 数据描述信息
     */
    private DataDescInfo dataDescInfo;
    /**
     * 数据源信息
     */
    private DataSourceInfo dataSourceInfo;
    /**
     * 维度信息
     */
    private Set<String> dimSet;
    /**
     * 指标信息
     */
    private Set<String> measureSet;

    /**
     * 分片维度
     */
    private String shardDimBase;

    // /**
    // * 索引分片规则
    // */
    // private Set<IndexShardRule> idxShardRule;

    /**
     * 索引分片列表,在建索引时创建
     */
    private List<IndexShard> idxShardList;
    /**
     * 复本个数
     */
    private int replicaNum;
    /**
     * 索引元数据状态,索引元数据有如下几个状态 1、INDEX_AVAILABLE,对应的索引数据已完成初始化可以提供服务
     * 2、INDEX_UNINIT,对应的索引数据还没有,不能提供服务 3、INDEX_AVAILABLE_NEEDMERGE,需要进行索引合并
     */
    private IndexState idxState;

    /**
     * 索引元数据锁:当更新或者建索引时,加锁
     */
    private Boolean locked=Boolean.FALSE;

    /**
     * 记录索引更新的版本(以第一个索引分片更新完的时间:System.currentTimeMillis()为当前的版本) 其它分片在执行:
     * 1、查询前,先看一下当前的idxVersion是否比整体版本号小,如果小,则暂停服务;
     * 2、更新索引时,取idxMeta的idxVersion更新到自己的idxVersion中
     */
    private long idxVersion;

    /**
     * ------------------------------索引元数据进行合并时,设置如下属性--------------------------
     *
     **/

    /**
     * 待合并的cubeId
     */
    private Set<String> cubeIdMergeSet;
    /**
     * 待合并的维度
     */
    private Set<String> dimInfoMergeSet;
    /**
     * 待合并的指标
     */
    private Set<String> measureInfoMergeSet;

    /**
     * 默认构造函数
     */
    public IndexMeta() {

    }

    /**
     * 构造函数
     *
     * @param cubeIdSet
     *            cubeId
     * @param productLine
     *            所属产品线
     */
    public IndexMeta(Set<String> cubeIdSet, String productLine) {
        super();
        this.cubeIdSet = cubeIdSet;
        this.productLine = productLine;
    }

    /**
     *
     * getCubeNameSet
     *
     * @return Set<String>
     */
    public Set<String> getCubeIdSet() {
        if (this.cubeIdSet == null) {
            this.cubeIdSet = new HashSet<String>();
        }
        return cubeIdSet;
    }

    /**
     * getIdxShardList
     *
     * @return List<IndexShard>
     */
    public List<IndexShard> getIdxShardList() {
        if (this.idxShardList == null) {
            this.idxShardList = new ArrayList<IndexShard>();
        }
        return idxShardList;
    }

    /**
     *
     * 获取存储区域名称
     *
     * @return String 字符串
     */
    public static String getDataStoreName() {
        return DATA_STORE_NAME_INDEX_META;
    }

    @Override
    public String getStoreKey() {
        StringBuffer sb = new StringBuffer();
        if (this.dataSourceInfo != null
            && !StringUtils.isEmpty(this.dataSourceInfo.getDataSourceKey())) {
            sb.append(this.dataSourceInfo.getDataSourceKey());
        }

        return sb.toString();
    }

    /**
     * getter method for property clusterName
     *
     * @return the clusterName
     */
    public String getClusterName() {
        return clusterName;
    }

    /**
     * setter method for property clusterName
     *
     * @param clusterName
     *            the clusterName to set
     */
    public void setClusterName(String clusterName) {
        this.clusterName = clusterName;
    }

    /**
     * getter method for property productLine
     *
     * @return the productLine
     */
    public String getProductLine() {
        return productLine;
    }

    /**
     * setter method for property productLine
     *
     * @param productLine
     *            the productLine to set
     */
    public void setProductLine(String productLine) {
        this.productLine = productLine;
    }

    /**
     * getter method for property dataDescInfo
     *
     * @return the dataDescInfo
     */
    public DataDescInfo getDataDescInfo() {
        return dataDescInfo;
    }

    /**
     * setter method for property dataDescInfo
     *
     * @param dataDescInfo
     *            the dataDescInfo to set
     */
    public void setDataDescInfo(DataDescInfo dataDescInfo) {
        this.dataDescInfo = dataDescInfo;
    }

    /**
     * getter method for property dataSourceInfo
     *
     * @return the dataSourceInfo
     */
    public DataSourceInfo getDataSourceInfo() {
        return dataSourceInfo;
    }

    /**
     * setter method for property dataSourceInfo
     *
     * @param dataSourceInfo
     *            the dataSourceInfo to set
     */
    public void setDataSourceInfo(DataSourceInfo dataSourceInfo) {
        this.dataSourceInfo = dataSourceInfo;
    }

    /**
     * getter method for property replicaNum
     *
     * @return the replicaNum
     */
    public int getReplicaNum() {
        return replicaNum;
    }

    /**
     * setter method for property replicaNum
     *
     * @param replicaNum
     *            the replicaNum to set
     */
    public void setReplicaNum(int replicaNum) {
        this.replicaNum = replicaNum;
    }

    /**
     * getter method for property idxState
     *
     * @return the idxState
     */
    public IndexState getIdxState() {
        return idxState;
    }

    /**
     * setter method for property idxState
     *
     * @param idxState
     *            the idxState to set
     */
    public void setIdxState(IndexState idxState) {
        this.idxState = idxState;
    }

    /**
     * setter method for property cubeNameSet
     *
     * @param cubeIdSet
     *            the cubeNameSet to set
     */
    public void setCubeIdSet(Set<String> cubeIdSet) {
        this.cubeIdSet = cubeIdSet;
    }

    /**
     * setter method for property idxShardList
     *
     * @param idxShardList
     *            the idxShardList to set
     */
    public void setIdxShardList(List<IndexShard> idxShardList) {
        this.idxShardList = idxShardList;
    }

    /**
     * 获取事实表名
     *
     * @return String
     */
    public String getFacttableName() {
        String factTable = "";
        if (this.dataDescInfo != null && !StringUtils.isEmpty(this.dataDescInfo.getTableName())) {
            factTable = this.dataDescInfo.getTableName();
            if (this.dataDescInfo.isSplitTable()) {
                factTable = this.dataDescInfo.getTableName().split(FACTTABLE_REGEX_SPLITTER)[0];
            }
        }
        return factTable;
    }

    /**
     * 获取索引元数据所在目录前缀
     * @return String
     */
    public String getIndexMetaFileDirPath(){
    	StringBuffer sb=new StringBuffer();
    	if(this.getDataSourceInfo()!=null && StringUtils.isNotEmpty(this.getDataSourceInfo().getDataSourceKey())
    			&& StringUtils.isNotEmpty(this.getFacttableName())
    			&& StringUtils.isNotEmpty(this.getIndexMetaId())){
    		sb.append(this.getDataSourceInfo().getDataSourceKey() + File.separator);
    		sb.append(this.getFacttableName() + File.separator);
    		sb.append(this.getIndexMetaId() + File.separator);

    	}else{
    		throw new IllegalArgumentException();
    	}

    	return sb.toString();
    }

    /**
     * getter method for property indexFilePathIndex
     *
     * @return the indexFilePathIndex
     */
    public static String getIndexFilePathIndex() {
        return INDEX_FILE_PATH_INDEX;
    }

    /**
     * getter method for property indexFilePathUpdate
     *
     * @return the indexFilePathUpdate
     */
    public static String getIndexFilePathUpdate() {
        return INDEX_FILE_PATH_UPDATE;
    }

    /**
     * getter method for property idxVersion
     *
     * @return the idxVersion
     */
    public long getIdxVersion() {
        return idxVersion;
    }

    /**
     * setter method for property idxVersion
     *
     * @param idxVersion
     *            the idxVersion to set
     */
    public void setIdxVersion(long idxVersion) {
        this.idxVersion = idxVersion;
    }

    /**
     * getter method for property cubeIdMergeSet
     *
     * @return the cubeIdMergeSet
     */
    public Set<String> getCubeIdMergeSet() {
        if (this.cubeIdMergeSet == null) {
            this.cubeIdMergeSet = new HashSet<String>();
        }
        return cubeIdMergeSet;
    }

    /**
     * setter method for property cubeIdMergeSet
     *
     * @param cubeIdMergeSet
     *            the cubeIdMergeSet to set
     */
    public void setCubeIdMergeSet(Set<String> cubeIdMergeSet) {
        this.cubeIdMergeSet = cubeIdMergeSet;
    }

    /**
     * getter method for property indexMetaId
     *
     * @return the indexMetaId
     */
    public String getIndexMetaId() {
        return indexMetaId;
    }

    /**
     * setter method for property indexMetaId
     *
     * @param indexMetaId
     *            the indexMetaId to set
     */
    public void setIndexMetaId(String indexMetaId) {
        this.indexMetaId = indexMetaId;
    }

    /**
     * @return the dimSet
     */
    public Set<String> getDimSet() {
        if(dimSet==null){
            dimSet=new HashSet<String>();
        }
        return dimSet;
    }

    /**
     * @param dimSet the dimSet to set
     */
    public void setDimSet(Set<String> dimSet) {
        this.dimSet = dimSet;
    }

    /**
     * @return the measureSet
     */
    public Set<String> getMeasureSet() {
        if(measureSet==null){
            measureSet=new HashSet<String>();
        }
        return measureSet;
    }

    /**
     * @param measureSet the measureSet to set
     */
    public void setMeasureSet(Set<String> measureSet) {
        this.measureSet = measureSet;
    }

    /**
     * @return the dimInfoMergeSet
     */
    public Set<String> getDimInfoMergeSet() {
        if(dimInfoMergeSet==null){
            dimInfoMergeSet=new HashSet<String>();
        }
        return dimInfoMergeSet;
    }

    /**
     * @param dimInfoMergeSet the dimInfoMergeSet to set
     */
    public void setDimInfoMergeSet(Set<String> dimInfoMergeSet) {
        this.dimInfoMergeSet = dimInfoMergeSet;
    }

    /**
     * @return the measureInfoMergeSet
     */
    public Set<String> getMeasureInfoMergeSet() {
        if(measureInfoMergeSet==null){
            measureInfoMergeSet=new HashSet<String>();
        }
        return measureInfoMergeSet;
    }

    /**
     * @param measureInfoMergeSet the measureInfoMergeSet to set
     */
    public void setMeasureInfoMergeSet(Set<String> measureInfoMergeSet) {
        this.measureInfoMergeSet = measureInfoMergeSet;
    }

    /**
	 * @return the locked
	 */
	public Boolean getLocked() {
		return locked;
	}

	/**
	 * @param locked the locked to set
	 */
	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	/**
	 * @return the shardDimBase
	 */
	public String getShardDimBase() {
		return shardDimBase;
	}

	/**
	 * @param shardDimBase the shardDimBase to set
	 */
	public void setShardDimBase(String shardDimBase) {
		this.shardDimBase = shardDimBase;
	}

	/*
     * (non-Javadoc)
     *
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((indexMetaId == null) ? 0 : indexMetaId.hashCode());
        return result;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        IndexMeta other = (IndexMeta) obj;
        if (indexMetaId == null) {
            if (other.indexMetaId != null) {
                return false;
            }
        } else if (!indexMetaId.equals(other.indexMetaId)) {
            return false;
        }
        return true;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "IndexMeta [clusterName=" + clusterName + ", indexMetaId="
				+ indexMetaId + ", cubeIdSet=" + cubeIdSet + ", dimSet="
				+ dimSet + ", measureSet=" + measureSet + ", idxState="
				+ idxState + ", locked=" + locked + ", idxVersion="
				+ idxVersion + "]";
	}

	/**
	 * getSelectList
	 * @param needMerge
	 * @return Set<String>
	 */
	public Set<String> getSelectList(boolean needMerge) {
        Set<String> selectList = new HashSet<String>();
        if (!CollectionUtils.isEmpty(this.getDimSet())) {
            for (String dimKey : this.getDimSet()) {
                selectList.add(dimKey);
            }
        }

        if (!CollectionUtils.isEmpty(this.getMeasureSet())) {
            for (String measureKey : this.getMeasureSet()) {
                selectList.add(measureKey);
            }
        }

        if (needMerge) {
            if (!CollectionUtils.isEmpty(this.getDimInfoMergeSet())) {
                for (String dimKey : this.getDimInfoMergeSet()) {
                    selectList.add(dimKey);
                }
            }

            if (!CollectionUtils.isEmpty(this.getMeasureInfoMergeSet())) {
                for (String measureKey : this.getMeasureInfoMergeSet()) {
                    selectList.add(measureKey);
                }
            }
        }

        return selectList;
    }

}


text:
<!--
  $Id: package.html 35198 2011-07-22 14:57:42Z juergens $
  @version $Rev: 35198 $
  @ConQAT.Rating GREEN Hash: C16CF70D79B81BB388C8FC957856F9D4
-->
<body>
This package defines resources that provide a textual representation of
the content. The elements also support preprocessing of the content by
filtering and normalization.
</body>


text:
using System.Numerics;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Hosting;

namespace CustomItemContainerTransitions.Controls
{
    /// <summary>
    /// Custom transition animation for making items appear in an horizontal slide in motion.
    /// As an improvement, the slide in axis and direction could be done through dependency properties.
    /// </summary>
    public sealed class SlideInCompositionTransition :  ItemCompositionTransitionBase
    {
        /// <summary>
        /// Applies the animation to the target <see cref="UIElement"/>.
        /// </summary>
        /// <param name="container"></param>
        public override void Animate(UIElement container)
        {
            // Get Composition visual.
            var visual = ElementCompositionPreview.GetElementVisual(container);
            var compositor = visual.Compositor;

            var firstControlPoint = new Vector2(0.0f, 0.5f);
            var secondControlPoint = new Vector2(0.5f, 1.0f);

            // Create cubic easing function from the control points specified.
            var easingFunction = compositor.CreateCubicBezierEasingFunction(firstControlPoint, secondControlPoint);

            // Animation for the offset change (horizontal slide in).
            var offsetAnimation = compositor.CreateVector3KeyFrameAnimation();
            offsetAnimation.Duration = this.Duration.TimeSpan;
            offsetAnimation.InsertKeyFrame(0.0f, new Vector3(150.0f, 0.0f, 0.0f), easingFunction);
            offsetAnimation.InsertKeyFrame(1.0f, new Vector3(0.0f, 0.0f, 0.0f), easingFunction);

            // Animation for the opacity change (appear).
            var opacityAnimation = compositor.CreateScalarKeyFrameAnimation();
            opacityAnimation.Duration = this.Duration.TimeSpan;
            opacityAnimation.InsertKeyFrame(0.0f, 0.0f, easingFunction);
            opacityAnimation.InsertKeyFrame(1.0f, 1.0f, easingFunction);

            // Start the slide in and appear animations.
            visual.StartAnimation(nameof(visual.Offset), offsetAnimation);
            visual.StartAnimation(nameof(visual.Opacity), opacityAnimation);
        }
    }
}


text:
/*
 * sha512.h
 * Author: Fabjan Sukalia(fsukalia@gmail.com)
 * Date: 2014-05-01
 */
#ifndef SHA512_H
#define SHA512_H

#include "block.h"
#include "sha512_core.h"

/* SHA-512, SHA-512/224 and SHA-512/256 */
typedef struct {
	uint8_t buffer[SHA512_BLOCK_SIZE];
	uint64_t hash[8];
	block b;
} sha512_context;

void sha512_init(sha512_context* ctxt);
void sha512_224_init(sha512_context* ctxt);
void sha512_256_init(sha512_context* ctxt);

void sha512_add(sha512_context* ctxt, const uint8_t data[], size_t length);
void sha512_finalize(sha512_context* ctxt);
void sha512_get_digest(sha512_context* ctxt, uint8_t digest[SHA512_DIGEST_SIZE]);
void sha512_224_get_digest(sha512_context* ctxt, uint8_t digest[SHA512_224_DIGEST_SIZE]);
void sha512_256_get_digest(sha512_context* ctxt, uint8_t digest[SHA512_256_DIGEST_SIZE]);

/* SHA-384 */
typedef sha512_context sha384_context;

void sha384_init(sha384_context* ctxt);
void sha384_add(sha384_context* ctxt, const uint8_t data[], size_t length);
void sha384_finalize(sha384_context* ctxt);
void sha384_get_digest(sha384_context* ctxt, uint8_t digest[SHA384_DIGEST_SIZE]);

#endif


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Package etri.sdn.controller.module.staticentrypusher</title>
<meta name="date" content="2013-09-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
etri.sdn.controller.module.staticentrypusher

Packages that use etri.sdn.controller.module.staticentrypusher

Package
Description

etri.sdn.controller.module.staticentrypusher

Classes in etri.sdn.controller.module.staticentrypusher used by etri.sdn.controller.module.staticentrypusher

Class and Description

FlowEntryTable

This table is of type TreeMap<String, Map<String, Object>>.

FlowModEntryTable

This table is of type ConcurrentHashMap<String, Map<String, OFFlowMod>>.

IStaticFlowEntryPusherService

This interface represents a service that the implementation of interface
 provides to other IRIS modules.

OFMStaticFlowEntryPusher

 This module is responsible for maintaining a set of static flows on switches.

StaticFlowEntryStorage

StaticFlowEntryType.SubActionStruct

subaction class.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>VOD with CTA set from VAST with no friendly url</title>
    <%= htmlWebpackPlugin.tags.headTags %>
    <style lang="css">
        #fluid-player-e2e-case {
            width: 90%;
        }
    </style>
</head>
<body>

<video id="fluid-player-e2e-case">
    <source src='https://cdn.fluidplayer.com/videos/valerian-1080p.mkv' data-fluid-hd title="1080p" type='video/mp4'/>
    <source src='https://cdn.fluidplayer.com/videos/valerian-720p.mkv' data-fluid-hd title="720p" type='video/mp4'/>
    <source src='https://cdn.fluidplayer.com/videos/valerian-480p.mkv' title="480p" type='video/mp4'/>
</video>

<%= htmlWebpackPlugin.tags.bodyTags %>

<script>
    var instance = fluidPlayer('fluid-player-e2e-case', {
        vastOptions: {
            adCTATextVast: true, // Enables getting CTA from the VAST tag
            adList: [
                {
                    roll: 'preRoll',
                    vastTag: '/static/vast_cta_no_friendly_url.xml', // VAST Tag with TitleCTA extension with CTA information
                }
            ]
        }
    });
</script>

</body>
</html>


text:
using System;
using System.Linq;
using RabbitMQ.Client;
using System.Text;

class EmitLogTopic
{
    public static void Main(string[] args)
    {
        var factory = new ConnectionFactory() { HostName = "localhost" };
        using(var connection = factory.CreateConnection())
        using(var channel = connection.CreateModel())
        {
            channel.ExchangeDeclare(exchange: "topic_logs", type: "topic");

            var routingKey = (args.Length > 0) ? args[0] : "anonymous.info";
            var message = (args.Length > 1) ? string.Join(" ", args.Skip(1).ToArray()) : "Hello World!";
            var body = Encoding.UTF8.GetBytes(message);
            channel.BasicPublish(exchange: "topic_logs", routingKey: routingKey, basicProperties: null, body: body);
            Console.WriteLine(" [x] Sent '{0}':'{1}'", routingKey, message);
        }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using MetroRadiance.Core.Win32;

namespace MetroRadiance.Chrome.Internal
{
	internal class GlowWindowProcessorLeft : GlowWindowProcessor
	{
		public override Orientation Orientation => Orientation.Vertical;

		public override HorizontalAlignment HorizontalAlignment => HorizontalAlignment.Right;

		public override VerticalAlignment VerticalAlignment => VerticalAlignment.Stretch;

		public override double GetLeft(double ownerLeft, double ownerWidth)
		{
			return ownerLeft - GlowSize;
		}

		public override double GetTop(double ownerTop, double ownerHeight)
		{
			return ownerTop - GlowSize;
		}

		public override double GetWidth(double ownerLeft, double ownerWidth)
		{
			return GlowSize;
		}

		public override double GetHeight(double ownerTop, double ownerHeight)
		{
			return ownerHeight + GlowSize * 2;
		}

		public override HitTestValues GetHitTestValue(Point point, double actualWidht, double actualHeight)
		{
			var leftTop = new Rect(0, 0, actualWidht, EdgeSize);
			var leftBottom = new Rect(0, actualHeight - EdgeSize, actualWidht, EdgeSize);

			return leftTop.Contains(point)
				? HitTestValues.HTTOPLEFT
				: leftBottom.Contains(point) ? HitTestValues.HTBOTTOMLEFT : HitTestValues.HTLEFT;
		}

		public override Cursor GetCursor(Point point, double actualWidht, double actualHeight)
		{
			var leftTop = new Rect(0, 0, actualWidht, EdgeSize);
			var leftBottom = new Rect(0, actualHeight - EdgeSize, actualWidht, EdgeSize);

			return leftTop.Contains(point)
				? Cursors.SizeNWSE
				: leftBottom.Contains(point) ? Cursors.SizeNESW : Cursors.SizeWE;
		}
	}
}


text:
class EmailNotifier < ActionMailer::Base

  # Send a message to a user when their account is created by an administrator.
  # Pass the new User instance and the ActionDispatch::Request instance for the
  # current controller action, so that URLs can be generated with a known host
  # and port.
  #
  def signup_notification( user, request )

    EmailNotifier.default_url_options[ :host ] = request.host_with_port

    @user        = user
    @site_name   = I18n.t( :'uk.org.pond.trackrecord.site_name' )
    @account_url = url_for(
      {
        :protocol   => 'https',
        :host       => EMAIL_HOST,
        :controller => 'users',
        :action     => 'edit',
        :id         => user.id
      }
    )

    mail(
      :to      => "#{ user.name } <#{ user.email }>",
      :from    => EMAIL_ADMIN,
      :subject => "[#{ @site_name }] Your account has been created"
    )
  end

  # Send a message to a user when their account settings are changed. Pass the
  # Pass the updated User instance and the ActionDispatch::Request instance for
  # the current controller action, so that URLs can be generated with a known
  # host and port.
  #
  def admin_update_notification( user, request )

    EmailNotifier.default_url_options[ :host ] = request.host_with_port

    @user      = user
    @site_name = I18n.t( :'uk.org.pond.trackrecord.site_name' )

    mail(
      :to      => "#{ user.name } <#{ user.email }>",
      :from    => EMAIL_ADMIN,
      :subject => "[#{ @site_name }] Your account settings have been changed"
    )
  end

end


text:
<?php

require_once 'Zend/Feed/Reader.php';

/**
 * @category   Zend
 * @package    Zend_Feed
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @group      Zend_Feed
 * @group      Zend_Feed_Reader
 */
class Zend_Feed_Reader_Integration_PodcastRss2Test extends PHPUnit_Framework_TestCase
{

    protected $_feedSamplePath = null;

    public function setup()
    {
        Zend_Feed_Reader::reset();
        $this->_feedSamplePath = dirname(__FILE__) . '/_files/podcast.xml';
        $this->_options = Zend_Date::setOptions();
        foreach($this->_options as $k=>$v) {
            if (is_null($v)) {
                unset($this->_options[$k]);
            }
        }
        Zend_Date::setOptions(array('format_type'=>'iso'));
    }

    public function teardown()
    {
        Zend_Date::setOptions($this->_options);
    }

    /**
     * Feed level testing
     */

    public function testGetsNewFeedUrl()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('http://newlocation.com/example.rss', $feed->getNewFeedUrl());
    }

    public function testGetsOwner()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('john.doe@example.com (John Doe)', $feed->getOwner());
    }

    public function testGetsCategories()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals(array(
            'Technology' => array(
                'Gadgets' => null
            ),
            'TV & Film' => null
        ), $feed->getCategories());
    }

    public function testGetsTitle()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('All About Everything', $feed->getTitle());
    }

    public function testGetsCastAuthor()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('John Doe', $feed->getCastAuthor());
    }

    public function testGetsFeedBlock()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('no', $feed->getBlock());
    }

    public function testGetsCopyright()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('℗ & © 2005 John Doe & Family', $feed->getCopyright());
    }

    public function testGetsDescription()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('All About Everything is a show about everything.
            Each week we dive into any subject known to man and talk
            about it as much as we can. Look for our Podcast in the
            iTunes Store', $feed->getDescription());
    }

    public function testGetsLanguage()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('en-us', $feed->getLanguage());
    }

    public function testGetsLink()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('http://www.example.com/podcasts/everything/index.html', $feed->getLink());
    }

    public function testGetsEncoding()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('UTF-8', $feed->getEncoding());
    }

    public function testGetsFeedExplicit()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('yes', $feed->getExplicit());
    }

    public function testGetsEntryCount()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals(3, $feed->count());
    }

    public function testGetsImage()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $this->assertEquals('http://example.com/podcasts/everything/AllAboutEverything.jpg', $feed->getImage());
    }

    /**
     * Entry level testing
     */

    public function testGetsEntryBlock()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('yes', $entry->getBlock());
    }

    public function testGetsEntryId()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('http://example.com/podcasts/archive/aae20050615.m4a', $entry->getId());
    }

    public function testGetsEntryTitle()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('Shake Shake Shake Your Spices', $entry->getTitle());
    }

    public function testGetsEntryCastAuthor()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('John Doe', $entry->getCastAuthor());
    }

    public function testGetsEntryExplicit()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('no', $entry->getExplicit());
    }

    public function testGetsSubtitle()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('A short primer on table spices
            ', $entry->getSubtitle());
    }

    public function testGetsSummary()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('This week we talk about salt and pepper
                shakers, comparing and contrasting pour rates,
                construction materials, and overall aesthetics. Come and
                join the party!', $entry->getSummary());
    }

    public function testGetsDuration()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('7:04', $entry->getDuration());
    }

    public function testGetsKeywords()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('salt, pepper, shaker, exciting
            ', $entry->getKeywords());
    }

    public function testGetsEntryEncoding()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();
        $this->assertEquals('UTF-8', $entry->getEncoding());
    }

    public function testGetsEnclosure()
    {
        $feed = Zend_Feed_Reader::importString(
            file_get_contents($this->_feedSamplePath)
        );
        $entry = $feed->current();

        $expected = new stdClass();
        $expected->url    = 'http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a';
        $expected->length = '8727310';
        $expected->type   = 'audio/x-m4a';

        $this->assertEquals($expected, $entry->getEnclosure());
    }
}


text:
require 'optparse'

class Codespicuous

  attr_reader :repositories, :commit_history, :committers, :teams, :config

  def initialize
    @config = CodespicuousConfig.new
    @commit_history = CommitHistory.new
  end

  def run(argv)

    puts "Stage 1: Configuring"
    return false unless configure(argv)

    puts "Stage 2: Collecting input data"
    collect

    if @config.list_repositories
      puts "Stage 3: Listing repositories committed to"
      list_committed_repositories
    else
      puts "Stage 3: Generating output"
      generate_output
    end
    true
  end

  def configure(argv)
    configurator = CodespicuousConfigurator.new(@config)
    return false unless configurator.configure(argv)

    @commit_history.configure(configurator.teams, configurator.repositories)

    true
  end

  def collect
    collector = SVNDataCollector.new(config, @commit_history)
    collector.collect_commit_history(@commit_history.repositories)
  end

  def generate_output
    generator = MetricsGenerator.new
    generator.generate(@config, @commit_history)
  end

  def list_committed_repositories
    repository_lister = RepositoryLister.new
    repository_lister.list(@commit_history)
  end
end


text:
#ifndef SLINKLIST_H
#define SLINKLIST_H

#include "utilities.h"

/*abstraction for singly linked lists*/
typedef struct slinklist_st
{
	struct slinklist_st* next;
}slinklist;

#define sladdhead(plist, node) ((node)->next = *(plist), *(plist) = node)

/*return the number of elements in the list*/
int slcount(const void* const list);

/*reverse order of  a list*/
void slreverse(void* plist);

/*remove the item from the list*/
void* slremove(void* plist, void* const node);

/*free the list and set the pointer to the list to be NULL*/
void slfreelist(void* plist);

/* sort the linked list with qsort and a temporary array*/
void slsort(void* plist,
		    int(*compare)(const void* const elem1, const void* const elem2));
#endif