text:
<!DOCTYPE html>

    <title>ViRangeTableViewCell Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>

ViSearchWidgets Docs (66% documented)

View on GitHub

        ViSearchWidgets Reference

        ViRangeTableViewCell Class Reference

            Classes

                CameraGlobals

                CameraView

                CameraViewController

                ConfirmViewController

                ImageFetcher

                PhotoLibraryViewController

                RangeSliderThumbLayer

                RangeSliderTrackLayer

                SingleImageFetcher

                SingleImageSaver

                ViBaseSearchViewController

                ViColorPickerModalViewController

                ViColorSearchViewController

                ViFilterCategoryViewController

                ViFilterItem

                ViFilterItemCategory

                ViFilterItemCategoryOption

                ViFilterItemRange

                ViFilterTableView

                ViFilterViewController

                ViFindSimilarViewController

                ViFont

                ViGridSearchViewController

                ViHorizontalSearchViewController

                ViImageView

                ViProduct

                ViProductCardLayout

                ViProductCardLayoutBuilder

                ViProductCollectionViewCell

                ViQueryProductLayout

                ViRangeSlider

                ViRangeTableViewCell

                ViRecommendationViewController

                ViSchemaHelper

                ViSearchImageViewController

                ViSearchResultsView

                ViTheme

                VolumeControl

            Enums

                ImageFormat

                ViBorderType

                ViDefaultTrackingAction

                ViFilterItemType

                ViProductCardTag

                ViReservedTrackingAction

                ViSearchType

            Extensions

                String

                UIColor

                UIFont

                UIImage

                UIView

            Functions

                takePhoto(_:videoOrientation:cropSize:completion:)

            Protocols

                ViColorPickerDelegate

                ViFilterCategoryViewControllerDelegate

                ViFilterViewControllerDelegate

                ViProductCellDelegate

                ViSearchViewControllerDelegate

                ViSearchViewControllerProtocol

            Structs

                ViButtonConfig

                ViIcon

                ViImageConfig

                ViLabelConfig

                ViProductSchemaMapping

            Typealiases

                PhotoLibraryViewSelectionComplete

ViRangeTableViewCell

open class ViRangeTableViewCell: UITableViewCell

Table view cell for range filter. This will contain the range filter title, the range slider and the upper/lower labels
The upper/lower labels will be updated when the range filter upper/lower thumbs are dragged.

                    filterItem

associated range filter item

Declaration

Swift

open var filterItem: ViFilterItemRange? = nil

                    rangeSlider

Range slider

Declaration

Swift

open var rangeSlider : ViRangeSlider? = nil

                    titleLabel

Display title

Declaration

Swift

open var titleLabel : UILabel? = nil

                    lowerLabel

Undocumented

Declaration

Swift

open class ViRangeTableViewCell: UITableViewCell

                    upperLabel

upper value label e.g. selected upper price

Declaration

Swift

open var upperLabel : UILabel? = nil

                    init(style:reuseIdentifier:)

Undocumented

Declaration

Swift

open class ViRangeTableViewCell: UITableViewCell

                    init(coder:)

Undocumented

Declaration

Swift

open class ViRangeTableViewCell: UITableViewCell

                    prepareForReuse()

Undocumented

Declaration

Swift

open class ViRangeTableViewCell: UITableViewCell

                    setup()

create all views and init

Declaration

Swift

open func setup()

                    rangeSliderValueChanged(_:)

Range slider change events. Upper / lower labels will be updated accordingly.
Selected value for filterItem will also be updated

Parameter

    Parameter rangeSlider: the changed rangeSlider

Declaration

Swift

open func rangeSliderValueChanged(_ rangeSlider: ViRangeSlider)

Parameters

                                rangeSlider

the changed rangeSlider

                    layoutSubviews()

Undocumented

Declaration

Swift

open class ViRangeTableViewCell: UITableViewCell

© 2017 ViSenze. All rights reserved. (Last updated: 2017-02-06)

Generated by jazzy ♪♫ v0.7.2, a Realm project.


text:
package me.doshou.admin.maintain.notification.exception;

/**
 *
User: Zhang Kaitao
 *
Date: 13-7-8 下午5:34
 *
Version: 1.0
 */
public class TemplateNotFoundException extends TemplateException {
    public TemplateNotFoundException(String templateName) {
        super("notification.template.not.found", new Object[] {templateName});
    }
}

redpajama_set_name: RedPajamaGithub


text:
@import url(http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic);
/******************************************************************
Site Name: The Classy Theme
Author: Theme Spectre, LLC

Stylesheet: Main Stylesheet

******************************************************************/
/*! normalize.css 2012-07-07T09:50 UTC - http://github.com/necolas/normalize.css */
/* ==========================================================================
   HTML5 display definitions
   ========================================================================== */
/*
 * Corrects `block` display not defined in IE6/7/8/9 & FF3.
 */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section,
summary {
  display: block; }

/*
 * Corrects `inline-block` display not defined in IE6/7/8/9 & FF3.
 */
audio,
canvas,
video {
  display: inline-block;
  *display: inline;
  *zoom: 1; }

/*
 * Prevents modern browsers from displaying `audio` without controls.
 * Remove excess height in iOS5 devices.
 */
audio:not([controls]) {
  display: none;
  height: 0; }

/*
 * Addresses styling for `hidden` attribute not present in IE7/8/9, FF3, S4.
 * Known issue: no IE6 support.
 */
[hidden] {
  display: none; }

/* ==========================================================================
   Base
   ========================================================================== */
/*
 * 1. Corrects text resizing oddly in IE6/7 when body `font-size` is set using
 *    `em` units.
 * 2. Prevents iOS text size adjust after orientation change, without disabling
 *    user zoom.
 */
html {
  font-size: 100%;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
  -ms-text-size-adjust: 100%;
  /* 2 */ }

/*
 * Addresses `font-family` inconsistency between `textarea` and other form
 * elements.
 */
html,
button,
input,
select,
textarea {
  font-family: sans-serif; }

/*
 * Addresses margins handled incorrectly in IE6/7.
 */
body {
  margin: 0; }

/* ==========================================================================
   Links
   ========================================================================== */
/**
 * Remove the gray background color from active links in IE 10.
 */
a {
  background: transparent; }

/*
 * Addresses `outline` inconsistency between Chrome and other browsers.
 */
a:focus {
  outline: thin dotted; }

/*
 * Improves readability when focused and also mouse hovered in all browsers.
 * people.opera.com/patrickl/experiments/keyboard/test
 */
a:active,
a:hover {
  outline: 0; }

/* ==========================================================================
   Typography
   ========================================================================== */
/*
 * Addresses font sizes and margins set differently in IE6/7.
 * Addresses font sizes within `section` and `article` in FF4+, Chrome, S5.
 */
h1 {
  font-size: 2em;
  margin: 0.67em 0; }

h2 {
  font-size: 1.5em;
  margin: 0.83em 0; }

h3 {
  font-size: 1.17em;
  margin: 1em 0; }

h4 {
  font-size: 1em;
  margin: 1.33em 0; }

h5 {
  font-size: 0.83em;
  margin: 1.67em 0; }

h6 {
  font-size: 0.75em;
  margin: 2.33em 0; }

/*
 * Addresses styling not present in IE7/8/9, S5, Chrome.
 */
abbr[title] {
  border-bottom: 1px dotted; }

/*
 * Addresses style set to `bolder` in FF3+, S4/5, Chrome.
 */
b,
strong {
  font-weight: bold; }

blockquote {
  margin: 1em 40px; }

/*
 * Addresses styling not present in S5, Chrome.
 */
dfn {
  font-style: italic; }

/*
 * Addresses styling not present in IE6/7/8/9.
 */
mark {
  background: #ff0;
  color: #000; }

/*
 * Addresses margins set differently in IE6/7.
 */
p,
pre {
  margin: 1em 0; }

/*
 * Corrects font family set oddly in IE6, S4/5, Chrome.
 * en.wikipedia.org/wiki/User:Davidgothberg/Test59
 */
code,
kbd,
pre,
samp {
  font-family: monospace, serif;
  _font-family: 'courier new', monospace;
  font-size: 1em; }

/*
 * Improves readability of pre-formatted text in all browsers.
 */
pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word; }

/*
 * Addresses CSS quotes not supported in IE6/7.
 */
q {
  quotes: none; }

/*
 * Addresses `quotes` property not supported in S4.
 */
q:before,
q:after {
  content: '';
  content: none; }

small {
  font-size: 75%; }

/*
 * Prevents `sub` and `sup` affecting `line-height` in all browsers.
 * gist.github.com/413930
 */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline; }

sup {
  top: -0.5em; }

sub {
  bottom: -0.25em; }

/* ==========================================================================
   Lists
   ========================================================================== */
/*
 * Addresses margins set differently in IE6/7.
 */
dl,
menu,
ol,
ul {
  margin: 1em 0; }

dd {
  margin: 0 0 0 40px; }

/*
 * Addresses paddings set differently in IE6/7.
 */
menu,
ol,
ul {
  padding: 0 0 0 40px; }

/*
 * Corrects list images handled incorrectly in IE7.
 */
nav ul,
nav ol {
  list-style: none;
  list-style-image: none; }

/* ==========================================================================
   Embedded content
   ========================================================================== */
/*
 * 1. Removes border when inside `a` element in IE6/7/8/9, FF3.
 * 2. Improves image quality when scaled in IE7.
 *    code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
 */
img {
  border: 0;
  /* 1 */
  -ms-interpolation-mode: bicubic;
  /* 2 */ }

/*
 * Corrects overflow displayed oddly in IE9.
 */
svg:not(:root) {
  overflow: hidden; }

/* ==========================================================================
   Figures
   ========================================================================== */
/*
 * Addresses margin not present in IE6/7/8/9, S5, O11.
 */
figure {
  margin: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
/*
 * Corrects margin displayed oddly in IE6/7.
 */
form {
  margin: 0; }

/*
 * Define consistent border, margin, and padding.
 */
fieldset {
  border: 1px solid #c0c0c0;
  margin: 0 2px;
  padding: 0.35em 0.625em 0.75em; }

/*
 * 1. Corrects color not being inherited in IE6/7/8/9.
 * 2. Corrects text not wrapping in FF3.
 * 3. Corrects alignment displayed oddly in IE6/7.
 */
legend {
  border: 0;
  /* 1 */
  padding: 0;
  white-space: normal;
  /* 2 */
  *margin-left: -7px;
  /* 3 */ }

/*
 * 1. Corrects font size not being inherited in all browsers.
 * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome.
 * 3. Improves appearance and consistency in all browsers.
 */
button,
input,
select,
textarea {
  font-size: 100%;
  /* 1 */
  margin: 0;
  /* 2 */
  vertical-align: baseline;
  /* 3 */
  *vertical-align: middle;
  /* 3 */ }

/*
 * Addresses FF3/4 setting `line-height` on `input` using `!important` in the
 * UA stylesheet.
 */
button,
input {
  line-height: normal; }

/*
 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
 *    and `video` controls.
 * 2. Corrects inability to style clickable `input` types in iOS.
 * 3. Improves usability and consistency of cursor style between image-type
 *    `input` and others.
 * 4. Removes inner spacing in IE7 without affecting normal text inputs.
 *    Known issue: inner spacing remains in IE6.
 */
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
  -webkit-appearance: button;
  /* 2 */
  cursor: pointer;
  /* 3 */
  *overflow: visible;
  /* 4 */ }

/*
 * Re-set default cursor for disabled elements.
 */
button[disabled],
input[disabled] {
  cursor: default; }

/*
 * 1. Addresses box sizing set to content-box in IE8/9.
 * 2. Removes excess padding in IE8/9.
 * 3. Removes excess padding in IE7.
 *    Known issue: excess padding remains in IE6.
 */
input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  /* 1 */
  padding: 0;
  /* 2 */
  *height: 13px;
  /* 3 */
  *width: 13px;
  /* 3 */ }

/*
 * 1. Addresses `appearance` set to `searchfield` in S5, Chrome.
 * 2. Addresses `box-sizing` set to `border-box` in S5, Chrome (include `-moz`
 *    to future-proof).
 */
input[type="search"] {
  -webkit-appearance: textfield;
  /* 1 */
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box;
  /* 2 */
  box-sizing: content-box; }

/*
 * Removes inner padding and search cancel button in S5, Chrome on OS X.
 */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none; }

/*
 * Removes inner padding and border in FF3+.
 */
button::-moz-focus-inner,
input::-moz-focus-inner {
  border: 0;
  padding: 0; }

/*
 * 1. Removes default vertical scrollbar in IE6/7/8/9.
 * 2. Improves readability and alignment in all browsers.
 */
textarea {
  overflow: auto;
  /* 1 */
  vertical-align: top;
  /* 2 */ }

/* ==========================================================================
   Tables
   ========================================================================== */
/*
 * Remove most spacing between table cells.
 */
table {
  border-collapse: collapse;
  border-spacing: 0; }

/******************************************************************
CUSTOMIZED RESET VALUES
I added these extra styles as a more personalized reset. Feel free
to remove them if you like or add your own. If you want to update
the normalize styles, make sure to edit from this point up.
******************************************************************/
p {
  -webkit-hyphens: auto;
  -epub-hyphens: auto;
  -moz-hyphens: auto;
  hyphens: auto; }

b, strong, .strong {
  font-weight: bold; }

dfn, em, .em {
  font-style: italic; }

small, .small {
  font-size: 75%; }

ul, ol {
  padding: 0;
  list-style-type: none; }

dd {
  margin: 0; }

.sidebar ul,
.sidebar ol,
.commentlist {
  list-style: none; }

/******************************************************************
Site Name: The Classy Theme
Author: Theme Spectre, LLC

Stylesheet: Mixins & Constants Stylesheet

******************************************************************/
/*********************
CLEARFIXIN'
*********************/
.clearfix {
  zoom: 1; }
  .clearfix:before, .clearfix:after {
    content: "";
    display: table; }
  .clearfix:after {
    clear: both; }

/*********************
TOOLS
*********************/
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box; }

.image-replacement {
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden; }

/*********************
COLORS
Need help w/ choosing your colors? Try this site out:
http://0to255.com/
*********************/
/*
Here's a great tutorial on how to
use color variables properly:
http://sachagreif.com/sass-color-variables/
*/
/*********************
TYPOGRAPHY
*********************/
/* 	To embed your own fonts, use this syntax
	and place your fonts inside the
	library/fonts folder. For more information
	on embedding fonts, go to:
	http://www.fontsquirrel.com/
	Be sure to remove the comment brackets.
*/
/*	@font-face {
    	font-family: 'Font Name';
    	src: url('library/fonts/font-name.eot');
    	src: url('library/fonts/font-name.eot?#iefix') format('embedded-opentype'),
             url('library/fonts/font-name.woff') format('woff'),
             url('library/fonts/font-name.ttf') format('truetype'),
             url('library/fonts/font-name.svg#font-name') format('svg');
    	font-weight: normal;
    	font-style: normal;
	}
*/
/*
use the best ampersand
http://simplebits.com/notebook/2008/08/14/ampersands-2/
*/
span.amp {
  font-family: Baskerville,'Goudy Old Style',Palatino,'Book Antiqua',serif !important;
  font-style: italic; }

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

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

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

.alert-help, .alert-info, .alert-error, .alert-success {
  margin: 10px;
  padding: 5px 18px;
  border: 1px solid; }

.alert-help {
  border-color: #e8dc59;
  background: #ebe16f; }

.alert-info {
  border-color: #bfe4f4;
  background: #d5edf8; }

.alert-error {
  border-color: #f8cdce;
  background: #fbe3e4; }

.alert-success {
  border-color: #deeaae;
  background: #e6efc2; }

/*********************
TRANSITION
*********************/
/*
I totally rewrote this to be cleaner and easier to use.
You'll need to be using Sass 3.2+ for these to work.
Thanks to @anthonyshort for the inspiration on these.
USAGE: @include transition(all 0.2s ease-in-out);
*/
/*********************
CSS3 GRADIENTS
Be careful with these since they can
really slow down your CSS. Don't overdo it.
*********************/
/* @include css-gradient(#dfdfdf,#f8f8f8); */
/*********************
BOX SIZING
*********************/
/* @include box-sizing(border-box); */
/* NOTE: value of "padding-box" is only supported in Gecko. So
probably best not to use it. I mean, were you going to anyway? */
/*********************
BOX SHADOW
*********************/
/*********************
BUTTONS
*********************/
.button, .button:visited {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  border: 1px solid #be0d37;
  border-top-color: #db0f3f;
  border-left-color: #db0f3f;
  padding: 4px 12px;
  color: white;
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  text-shadow: 0 1px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  margin-bottom: 20px;
  line-height: 21px;
  border-radius: 4px;
  background-color: #e40f42;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#f01d4f), to(#e40f42));
  background-image: -webkit-linear-gradient(top, #f01d4f, #e40f42);
  background-image: -moz-linear-gradient(top, #f01d4f, #e40f42);
  background-image: -o-linear-gradient(top, #f01d4f, #e40f42);
  background-image: linear-gradient(to bottom, #f01d4f, #e40f42); }
  .button:hover, .button:focus, .button:visited:hover, .button:visited:focus {
    color: white;
    border: 1px solid #be0d37;
    border-top-color: #9d0a2d;
    border-left-color: #9d0a2d;
    background-color: #cc0e3b;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#e40f42), to(#cc0e3b));
    background-image: -webkit-linear-gradient(top, #e40f42, #cc0e3b);
    background-image: -moz-linear-gradient(top, #e40f42, #cc0e3b);
    background-image: -o-linear-gradient(top, #e40f42, #cc0e3b);
    background-image: linear-gradient(to bottom, #e40f42, #cc0e3b); }
  .button:active, .button:visited:active {
    background-color: #f01d4f;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#e40f42), to(#f01d4f));
    background-image: -webkit-linear-gradient(top, #e40f42, #f01d4f);
    background-image: -moz-linear-gradient(top, #e40f42, #f01d4f);
    background-image: -o-linear-gradient(top, #e40f42, #f01d4f);
    background-image: linear-gradient(to bottom, #e40f42, #f01d4f); }

.blue-button, .blue-button:visited {
  border-color: #1472ad;
  text-shadow: 0 1px 1px #1472ad;
  background-color: #1681c4;
  background-image: -webkit-gradient(linear, left top, left bottom, from(#1990db), to(#1681c4));
  background-image: -webkit-linear-gradient(top, #1990db, #1681c4);
  background-image: -moz-linear-gradient(top, #1990db, #1681c4);
  background-image: -o-linear-gradient(top, #1990db, #1681c4);
  background-image: linear-gradient(to bottom, #1990db, #1681c4);
  box-shadow: inset 0 0 3px #59b3ec; }
  .blue-button:hover, .blue-button:focus, .blue-button:visited:hover, .blue-button:visited:focus {
    border-color: #116396;
    background-color: #1472ad;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#1784c9), to(#1472ad));
    background-image: -webkit-linear-gradient(top, #1784c9, #1472ad);
    background-image: -moz-linear-gradient(top, #1784c9, #1472ad);
    background-image: -o-linear-gradient(top, #1784c9, #1472ad);
    background-image: linear-gradient(to bottom, #1784c9, #1472ad); }
  .blue-button:active, .blue-button:visited:active {
    background-color: #1990db;
    background-image: -webkit-gradient(linear, left top, left bottom, from(#1681c4), to(#1990db));
    background-image: -webkit-linear-gradient(top, #1681c4, #1990db);
    background-image: -moz-linear-gradient(top, #1681c4, #1990db);
    background-image: -o-linear-gradient(top, #1681c4, #1990db);
    background-image: linear-gradient(to bottom, #1681c4, #1990db); }

/*********************
BORDERS
*********************/
/******************************************************************
Site Name: The Classy Theme
Author: Theme Spectre, LLC

Stylesheet: Web Fonts

******************************************************************/
#site-title, .hentry header h1, .search-form input[type="submit"], .copyright, div#layout {
  font-family: 'PT Sans';
  font-weight: 700;
  color: #333; }

/*
*  MUSEO SLAB
*/
@font-face {
  font-family: 'Museo Slab';
  src: url("../fonts/museo-slab/Museo_Slab_500_2-webfont.eot");
  src: url("../fonts/museo-slab/Museo_Slab_500_2-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/museo-slab/Museo_Slab_500_2-webfont.woff") format("woff"), url("../fonts/museo-slab/Museo_Slab_500_2-webfont.ttf") format("truetype"), url("../fonts/museo-slab/Museo_Slab_500_2-webfont.svg#museo_slab500") format("svg");
  font-weight: 'normal';
  font-style: normal; }

@font-face {
  font-family: 'Museo Slab';
  src: url("../fonts/museo-slab/Museo_Slab_500italic-webfont.eot");
  src: url("../fonts/museo-slab/Museo_Slab_500italic-webfont.eot?#iefix") format("embedded-opentype"), url("../fonts/museo-slab/Museo_Slab_500italic-webfont.woff") format("woff"), url("../fonts/museo-slab/Museo_Slab_500italic-webfont.ttf") format("truetype"), url("../fonts/museo-slab/Museo_Slab_500italic-webfont.svg#MuseoSlab500Italic") format("svg");
  font-weight: 'normal-italic';
  font-style: italic; }

#site-description h2, .byline, .entry-content blockquote p, .article-footer, .pagination, .recent, .search-form input[type="text"] {
  font-family: 'Museo Slab';
  font-weight: normal;
  color: #888; }

/*
 * MONO SOCIAL ICONS FONT
 * http://drinchev.github.io/monosocialiconsfont/
*/
@font-face {
  font-family: 'Mono Social Icons Font';
  src: url("../fonts/monosocial/MonoSocialIconsFont-1.10.eot");
  src: url("../fonts/monosocial/MonoSocialIconsFont-1.10.eot?#iefix") format("embedded-opentype"), url("../fonts/monosocial/MonoSocialIconsFont-1.10.woff") format("woff"), url("../fonts/monosocial/MonoSocialIconsFont-1.10.ttf") format("truetype"), url("../fonts/monosocial/MonoSocialIconsFont-1.10.svg#MonoSocialIconsFont") format("svg");
  src: url("../fonts/monosocial/MonoSocialIconsFont-1.10.ttf") format("truetype");
  font-weight: normal;
  font-style: normal; }

.symbol, a.symbol:before {
  font-family: 'Mono Social Icons Font';
  -webkit-text-rendering: optimizeLegibility;
  -moz-text-rendering: optimizeLegibility;
  -ms-text-rendering: optimizeLegibility;
  -o-text-rendering: optimizeLegibility;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-font-smoothing: antialiased;
  -ms-font-smoothing: antialiased;
  -o-font-smoothing: antialiased;
  font-smoothing: antialiased; }

a.symbol:before {
  content: attr(title);
  margin-right: 0.3em;
  font-size: 130%; }

/*
BASE (MOBILE) SIZE
This are the mobile styles. It's what people see on their phones.
*/
/******************************************************************
Site Name: The Classy Theme
Author: Theme Spectre, LLC

Stylesheet: Base Mobile Stylesheet

******************************************************************/
/******************************************************************
AVAILABLE MIXINS

Source: _mixins.scss

@include border($stroke, $style, $color, $radius);
@include css-gradient($from, $to);
@include box-sizing($type);
@include box-shadow($position, $x-offset, $y-offset, $blur, $color);
@include inset-shadow($position, $x-offset, $y-offset, $blur, $color);

******************************************************************/
/*********************
GENERAL STYLES
*********************/
body {
  font-family: Times, Garamond, serif;
  font-size: 62.5%;
  font-weight: normal;
  font-style: normal;
  color: #333;
  background: #fbfbfb;
  -webkit-text-stroke: 1px transparent; }

/*********************
LAYOUT & GRID STYLES
*********************/
.wrap {
  width: auto;
  margin: 0 20px; }

/*********************
LINK STYLES
*********************/
a, a:visited {
  color: #333;
  -webkit-transition: color 0.25s;
  -ms-transition: color 0.25s;
  -o-transition: color 0.25s;
  -transition: color 0.25s;
  transition: color 0.25s;
  text-decoration: none;
  /* on hover */
  /* on click */
  /* mobile tap color */ }
  a:hover, a:focus, a:visited:hover, a:visited:focus {
    color: #00e4ff; }
  a:active, a:visited:active {
    color: #00e4ff; }
  a:link, a:visited:link {
    /*
    this highlights links on iPhones/iPads.
    so it basically works like the :hover selector
    for mobile devices.
    */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.3); }

/******************************************************************
H1, H2, H3, H4, H5 STYLES
******************************************************************/
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 {
  font-family: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-rendering: optimizelegibility;
  font-weight: 700;
  line-height: 1em;
  margin: 0;
  /* removing text decoration from all headline links */ }
  h1 a, .h1 a, h2 a, .h2 a, h3 a, .h3 a, h4 a, .h4 a, h5 a, .h5 a {
    text-decoration: none; }

h1, .h1 {
  font-size: 4.5em; }

h2, .h2 {
  font-size: 2.6em; }

h3, .h3 {
  font-size: 2.1em; }

h4, .h4 {
  font-size: 1.4em; }

h5, .h5 {
  font-size: 1.3em; }

/*********************
HEADER STYLES
*********************/
.header {
  width: 100%;
  text-align: center;
  margin: 20px 0 40px 0; }

#site-description h2 {
  margin-top: 0.3em; }

/*********************
NAVIGATION STYLES
*********************/
/* The {{nav}} helper outputs a site-navigation div */
#site-navigation {
  border-bottom: 1px solid #dbdbdb;
  margin-top: 1.8em; }
  #site-navigation ul {
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 500; }
  #site-navigation li {
    border-top: rgba(0, 0, 0, 0.1) 1px solid;
    margin: 0;
    line-height: 1.3em; }
    #site-navigation li a {
      display: block;
      padding: 10px 0;
      color: #333;
      text-decoration: none;
      background: transparent;
      /*
      remember this is for mobile ONLY, so there's no need
      to even declare hover styles here, you can do it in
      the style.scss file where it's relevant. We want to
      keep this file as small as possible!
      */ }

/* end .nav */
/*********************
POSTS & CONTENT STYLES
*********************/
#content {
  margin: 0 0 40px 0; }

.hentry header {
  text-align: center; }
  .hentry header h1 {
    font-size: 3.3em;
    padding-bottom: 0.2em; }

/* end .hentry */
/* post meta */
.byline {
  font-size: 1.5em;
  margin: 0; }

/* entry content */
.entry-content {
  font-family: 'Museo Slab';
  font-size: 1.6em;
  font-weight: normal;
  line-height: 1.4em;
  margin-top: 2em; }
  .entry-content a {
    color: #888;
    -webkit-transition: color 0.25s;
    -ms-transition: color 0.25s;
    -o-transition: color 0.25s;
    -transition: color 0.25s;
    transition: color 0.25s;
    text-decoration: none;
    /* on hover */
    /* on click */ }
    .entry-content a:hover, .entry-content a:focus {
      color: #00e4ff; }
    .entry-content a:active {
      color: #00e4ff; }
  .entry-content h1 {
    padding: 0.4em 0; }
  .entry-content h2 {
    padding: 0.35em 0; }
  .entry-content h3 {
    padding: 0.3em 0; }
  .entry-content h4 {
    padding: 0.25em 0;
    font-weight: bold; }
  .entry-content h5 {
    padding: 0.25em 0;
    color: #888888; }
  .entry-content h6 {
    padding: 0.2em 0;
    margin: 0; }
  .entry-content p {
    text-align: justify;
    margin: 1em 0;
    line-height: 1.6em; }
    .entry-content p:first-child {
      margin-top: 0; }
    .entry-content p:last-child {
      margin-bottom: 0; }
  .entry-content ul, .entry-content ol {
    list-style-position: inside; }
  .entry-content ul {
    padding: 0 1.2em; }
    .entry-content ul li {
      list-style-type: disc;
      padding: 0.4em 0;
      line-height: 1.6em; }
  .entry-content ol {
    padding: 0 1.2em; }
    .entry-content ol li {
      padding: 0.4em 0;
      list-style-type: decimal;
      line-height: 1.6em; }
  .entry-content blockquote {
    margin: 0;
    padding: 30px;
    color: #dbdbdb; }
    .entry-content blockquote:before {
      background: url("../images/quote@2x.png") no-repeat;
      background-size: 18px 13px; }
    .entry-content blockquote p {
      color: #888;
      position: relative;
      top: 0; }
  .entry-content dd {
    margin-left: 0;
    font-size: 0.9em;
    color: #787878;
    margin-bottom: 1.5em; }
  .entry-content img {
    margin: 0 0 1.5em 0;
    max-width: 100%;
    height: auto; }
  .entry-content p img {
    margin: 2em 0; }
  .entry-content video, .entry-content object {
    max-width: 100%;
    height: auto; }
  .entry-content pre {
    background: #eee;
    border: 1px solid #cecece;
    padding: 10px; }
  .entry-content hr {
    border: 0;
    background-color: #cdcdcd;
    height: 1px;
    margin: 15px 0 35px 0; }
  .entry-content code {
    padding: 2px 5px;
    background: #eee;
    border: 1px solid #cecece;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    -o-border-radius: 2px;
    border-radius: 2px; }
  .entry-content pre {
    border: 1px solid inherit;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    -o-border-radius: 2px;
    border-radius: 2px; }
  .entry-content pre code {
    padding: 0;
    border: 0;
    background: transparent; }

/* end .entry-content */
/* Article Tags    */
.article-footer {
  margin: 1.2em 0;
  font-size: 1.5em;
  text-align: center; }
  .article-footer .tag-label:after {
    content: ","; }
  .article-footer .tag-label:last-child:after {
    content: ""; }

.tags-title {
  font-size: 1.15em; }
  .tags-title a.tag-label:after {
    content: ","; }
  .tags-title a.tag-label:last-child:after {
    content: ""; }

/******************************************************************
PAGINATION STYLES
******************************************************************/
/* The main wrapper for our pagination links */
.pagination {
  font-size: 1.5em;
  position: relative;
  width: 100%;
  margin: 40px auto;
  text-align: center; }

.pagination a {
  color: #9EABB3; }

/* Push the previous/next links out to the left/right */
.older-posts,
.newer-posts {
  position: absolute;
  display: inline-block;
  padding: 0 15px;
  text-decoration: none; }

.older-posts {
  right: 0; }

.page-number {
  display: inline-block; }

.newer-posts {
  left: 0; }

/*********************
FOOTER STYLES
*********************/
/******** RECENT POSTS *********/
.recent article {
  margin-bottom: 3em; }
.recent .article-footer {
  margin: .5em 0;
  text-align: left;
  font-size: 1em; }
.recent p.byline {
  margin: 6px 0 0 0; }
.recent .tags {
  font-size: 1.3em; }

.footer {
  margin: 80px 0 0 0; }

/******** SIDEBAR *********/
.sidebar {
  padding: 1.4em 0;
  background: #333333;
  font-size: 1.8em;
  text-transform: uppercase;
  color: #fbfbfb; }
  .sidebar .sidebar-header {
    display: none; }
  .sidebar nav {
    text-align: center; }
    .sidebar nav li {
      padding: 0.4em 0; }
      .sidebar nav li:first-child {
        padding-top: 0; }
      .sidebar nav li:last-child {
        padding-bottom: 0; }
    .sidebar nav a {
      font-family: 'PT Sans';
      font-weight: 700;
      color: #fbfbfb;
      -webkit-transition: color 0.25s;
      -ms-transition: color 0.25s;
      -o-transition: color 0.25s;
      -transition: color 0.25s;
      transition: color 0.25s; }
      .sidebar nav a:hover, .sidebar nav a:focus {
        color: #fbfbfb; }
      .sidebar nav a:link {
        -webkit-tap-highlight-color: #fbfbfb; }
  .sidebar .social {
    color: #fbfbfb;
    text-align: center; }
    .sidebar .social a.symbol {
      color: #fbfbfb;
      font-size: 1.8em; }

.search-form input[type="text"] {
  background: #fff;
  box-shadow: inset 0px 2px 6px rgba(136, 136, 136, 0.5);
  border: 1px solid #888;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
  width: 60%;
  margin: 15px 0;
  padding: 8px 5px;
  outline: none; }
.search-form input[type="submit"] {
  cursor: pointer;
  font-size: 1.3em;
  text-transform: uppercase;
  text-shadow: 1px 1px #fff;
  border: 1px solid #888;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  border-left: none;
  box-shadow: inset 0px 1px 1px #fff;
  width: 76px;
  height: 33px;
  margin: 0;
  margin-left: -3px;
  padding: 8px auto;
  -o-transition: .25s;
  -ms-transition: .25s;
  -moz-transition: .25s;
  -webkit-transition: .25s;
  transition: .25s; }

.copyright {
  width: 100%;
  margin: 0 auto;
  padding: 1.3em 0;
  font-weight: normal;
  color: #888;
  font-size: 1.5em;
  text-align: center; }

/*********************
DISQUS STYLES
*********************/
/*
Desktop and Large Tablet View
This is the average viewing window. So Desktops, Laptops, and
in general anyone not viewing on a small mobile device.
*/
@media only screen and (min-width: 768px) {
  /******************************************************************
  Site Name: The Classy Theme
  Author: Theme Spectre, LLC

  Stylesheet: Grid Stylesheet

  ******************************************************************/
  .onecol {
    width: 5.801104972%; }

  /* 4.85%;  } /* grid_1  */
  .twocol {
    width: 14.364640883%; }

  /* 13.45%; } /* grid_2  */
  .threecol {
    width: 22.928176794%; }

  /* 22.05%; } /* grid_3  */
  .fourcol {
    width: 31.491712705%; }

  /* 30.75%; } /* grid_4  */
  .fivecol {
    width: 40.055248616%; }

  /* 39.45%; } /* grid_5  */
  .sixcol {
    width: 48.618784527%; }

  /* 48%;    } /* grid_6  */
  .sevencol {
    width: 57.182320438000005%; }

  /* 56.75%; } /* grid_7  */
  .eightcol {
    width: 65.74585634900001%; }

  /* 65.4%;  } /* grid_8  */
  .ninecol {
    width: 74.30939226%; }

  /* 74.05%; } /* grid_9  */
  .tencol {
    width: 82.87292817100001%; }

  /* 82.7%;  } /* grid_10 */
  .elevencol {
    width: 91.436464082%; }

  /* 91.35%; } /* grid_11 */
  .twelvecol {
    width: 99.999999993%; }

  /* 100%;   } /* grid_12 */
  .onecol, .twocol, .threecol, .fourcol, .fivecol, .sixcol, .sevencol, .eightcol, .ninecol, .tencol, .elevencol, .twelvecol {
    position: relative;
    float: left;
    margin-left: 2.762430939%; }

  .first {
    margin-left: 0; }

  .last {
    float: right; }

  /******************************************************************
  Site Name: The Classy Theme
  Author: Theme Spectre, LLC

  Stylesheet: Tablet & Small Desktop Stylesheet

  ******************************************************************/
  /*********************
  GENERAL STYLES
  *********************/
  #site-title, .hentry header h1, .search-form input[type="submit"], .copyright, div#layout {
    font-family: 'PT Sans';
    font-weight: 700;
    color: #333; }

  /*********************
  LAYOUT & GRID STYLES
  *********************/
  #container {
    max-width: 729px;
    height: 100%;
    margin: 0 auto; }

  .wrap {
    margin: 0 auto; }

  /*********************
  HEADER STYLES
  *********************/
  .header {
    margin-bottom: 45px;
    padding: 60px 0 5px 0; }

  /*********************
  NAVIGATION STYLES
  *********************/
  #site-navigation {
    font-family: 'PT Sans';
    font-weight: 700;
    font-size: 1.3em;
    text-align: center;
    margin-top: 60px;
    /* end .menu ul li */ }
    #site-navigation ul {
      margin: 20px 0 0 0; }
      #site-navigation ul:after {
        content: " ";
        display: table;
        clear: both; }
    #site-navigation li {
      border: none;
      display: inline-block;
      text-transform: uppercase;
      text-align: center;
      font-size: 1.3em;
      /* showing sub-menus */ }
      #site-navigation li a {
        border-bottom: 0;
        padding: 10px 30px;
        color: #333;
        -webkit-transition: color 0.25s;
        -ms-transition: color 0.25s;
        -o-transition: color 0.25s;
        -transition: color 0.25s;
        transition: color 0.25s; }
        #site-navigation li a:hover, #site-navigation li a:focus {
          color: #00e4ff; }
      #site-navigation li:hover ul {
        top: auto;
        display: block; }

  /* end .nav */
  /*********************
  SIDEBARS / FOOTER
  *********************/
  /******** RECENT POSTS *********/
  .recent {
    float: left;
    margin-left: 0; }

  /******** SIDEBAR *********/
  .sidebar {
    float: right;
    margin-left: 0;
    padding: 0;
    background: transparent;
    font-size: 1.8em;
    color: #333333; }
    .sidebar .sidebar-header {
      border-bottom: 1px solid #dbdbdb;
      color: #333333;
      display: block; }
      .sidebar .sidebar-header h3 {
        margin: 0 0 0.2em 0;
        text-transform: none; }
      .sidebar .sidebar-header h4 {
        margin: 0.4em 0;
        text-transform: none;
        font-family: 'Museo Slab', serif;
        font-weight: normal;
        font-size: 1.0em;
        color: #888; }
    .sidebar nav {
      text-align: left; }
      .sidebar nav a {
        color: #333333;
        text-transform: uppercase; }
        .sidebar nav a:hover, .sidebar nav a:focus {
          color: #00e4ff; }
    .sidebar .social {
      color: #fbfbfb;
      text-align: left; }
      .sidebar .social a.symbol {
        color: #333333; } }
/*
RETINA (2x RESOLUTION DEVICES)
This applies to the retina iPhone (4s) and iPad (2,3) along with
other displays with a 2x resolution. You can also create a media
query for retina AND a certain size if you want. Go Nuts.
*/
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-device-pixel-ratio: 1.5) {
  /******************************************************************
  Site Name: The Classy Theme
  Author: Theme Spectre, LLC

  Stylesheet: Retina Screens & Devices Stylesheet

  ******************************************************************/
  /*

  EXAMPLE
  .icon {
  	background: url(img/test@2x.png) no-repeat;
  	background-size: 24px 24px;
  }

  */ }
/*
PRINT STYLESHEET
Feel free to customize this. Remember to add things that won't make
sense to print at the bottom. Things like nav, ads, and forms should
be set to display none.
*/
@media print {
  /******************************************************************
  Site Name: The Classy Theme
  Author: Theme Spectre, LLC

  Stylesheet: Print Stylesheet

  ******************************************************************/
  * {
    background: transparent !important;
    color: black !important;
    text-shadow: none !important;
    filter: none !important;
    -ms-filter: none !important; }

  a, a:visited {
    color: #444 !important;
    text-decoration: underline; }
    a:after, a:visited:after {
      content: " (" attr(href) ")"; }
    a abbr[title]:after, a:visited abbr[title]:after {
      content: " (" attr(title) ")"; }

  .ir a:after,
  a[href^="javascript:"]:after,
  a[href^="#"]:after {
    content: ""; }

  pre, blockquote {
    border: 1px solid #999;
    page-break-inside: avoid; }

  thead {
    display: table-header-group; }

  tr, img {
    page-break-inside: avoid; }

  img {
    max-width: 100% !important; }

  @page {
    margin: 0.5cm; }

  p, h2, h3 {
    orphans: 3;
    widows: 3; }

  h2,
  h3 {
    page-break-after: avoid; }

  .sidebar,
  .page-navigation,
  .wp-prev-next,
  .respond-form,
  nav {
    display: none; } }


text:
package org.javafunk.funk.builders;

import org.javafunk.funk.Classes;
import org.javafunk.funk.functors.functions.UnaryFunction;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class CollectionBuilder<E>
        extends AbstractBuilder<E, CollectionBuilder<E>, Collection<E>>
        implements AbstractBuilder.WithCustomImplementationSupport<E, Collection, Collection<E>> {
    private Collection<E> elements = new ArrayList<E>();

    public static <E> CollectionBuilder<E> collectionBuilder() {
        return new CollectionBuilder<E>();
    }

    public static <E> CollectionBuilder<E> collectionBuilder(Class<E> elementClass) {
        return new CollectionBuilder<E>();
    }

    @Override public Collection<E> build() {
        return Collections.unmodifiableList(new ArrayList<E>(elements));
    }

    @Override public Collection<E> build(Class<? extends Collection> implementationClass) {
        @SuppressWarnings("unchecked")
        Collection<E> collection = Classes.uncheckedInstantiate(implementationClass);
        collection.addAll(elements);
        return collection;
    }

    @Override public <T extends Collection<E>> T build(UnaryFunction<? super Iterable<E>, ? extends T> builderFunction) {
        return builderFunction.call(Collections.unmodifiableCollection(elements));
    }

    @Override protected void handle(E element) {
        elements.add(element);
    }

    @Override protected CollectionBuilder<E> updatedBuilder() {
        return this;
    }
}


text:
require 'json'
require 'yaml'

json = IO.read("rightscale.json")
data = JSON.parse(json)
yml = YAML::dump(data)

puts yml


text:
package uk.ac.ebi.embl.api.validation;

import org.junit.Test;
import uk.ac.ebi.embl.api.entry.AssemblySequenceInfo;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;

public class GenomeUtilsTest {

    private void addComponent(Set<String> components, String component) {
        components.add(component.toUpperCase());
    }

    @Test
    public void testInvalidAssemblyLevel() {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, -1, "contig1"));
        assertThrows("Unexpected assembly level", ValidationEngineException.class, () -> GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents));
    }

    @Test
    public void testContigsOnly() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, 0, "contig1"));
        sequenceInfo.put("contig2", new AssemblySequenceInfo(150, 0, "contig2"));
        sequenceInfo.put("contig3", new AssemblySequenceInfo(200, 0, "contig3"));
        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 100 + 150 + 200);
    }

    @Test
    public void testChromosomesOnly() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("chr1", new AssemblySequenceInfo(100, 2, "chr1"));
        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 100);
    }

    @Test
    public void testContigsScaffolds_PlacedContigs() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, 0, "contig1"));
        sequenceInfo.put("contig2", new AssemblySequenceInfo(150, 0, "contig2"));
        sequenceInfo.put("contig3", new AssemblySequenceInfo(200, 0, "contig3"));

        // AGP
        // scaffold1 contig1
        // scaffold1 gap
        // scaffold1 contig2
        // scaffold2 contig3
        sequenceInfo.put("scaffold1", new AssemblySequenceInfo(250, 1, "scaffold1"));
        sequenceInfo.put("scaffold2", new AssemblySequenceInfo(200, 1, "scaffold2"));

        addComponent(agpPlacedComponents,"contig1");
        addComponent(agpPlacedComponents,"contig2");
        addComponent(agpPlacedComponents,"contig3");

        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 250 + 200);
    }

    @Test
    public void testContigsScaffolds_PlacedContigsAndScaffolds() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, 0, "contig1"));
        sequenceInfo.put("contig2", new AssemblySequenceInfo(150, 0, "contig2"));
        sequenceInfo.put("contig3", new AssemblySequenceInfo(200, 0, "contig3"));
        sequenceInfo.put("contig4", new AssemblySequenceInfo(300, 0, "contig4"));

        // AGP
        // scaffold1 contig1
        // scaffold1 gap
        // scaffold1 contig2
        // scaffold2 contig3
        // scaffold3 scaffold2
        sequenceInfo.put("scaffold1", new AssemblySequenceInfo(250, 1, "scaffold1"));
        sequenceInfo.put("scaffold2", new AssemblySequenceInfo(200, 1, "scaffold2"));
        sequenceInfo.put("scaffold3", new AssemblySequenceInfo(200, 1, "scaffold3"));

        addComponent(agpPlacedComponents,"contig1");
        addComponent(agpPlacedComponents,"contig2");
        addComponent(agpPlacedComponents,"contig3");
        addComponent(agpPlacedComponents,"scaffold2");

        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 250 + 200 + 300);
    }

    @Test
    public void testContigsScaffoldsChromosomes() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, 0, "contig1")); //placed
        sequenceInfo.put("contig2", new AssemblySequenceInfo(150, 0, "contig2")); //placed
        sequenceInfo.put("contig3", new AssemblySequenceInfo(200, 0, "contig3")); //placed
        sequenceInfo.put("contig4", new AssemblySequenceInfo(300, 0, "contig4")); //placed

        // AGP
        // scaffold1 contig1
        // scaffold1 gap
        // scaffold1 contig2
        // scaffold2 contig3
        // chr1 contig4
        // chr1 scaffold2
        sequenceInfo.put("scaffold1", new AssemblySequenceInfo(250, 1, "scaffold1")); //unplaced
        sequenceInfo.put("scaffold2", new AssemblySequenceInfo(200, 1, "scaffold2")); //placed

        sequenceInfo.put("chr1", new AssemblySequenceInfo(250, 2, "chr1"));

        addComponent(agpPlacedComponents,"contig1");
        addComponent(agpPlacedComponents,"contig2");
        addComponent(agpPlacedComponents,"contig3");
        addComponent(agpPlacedComponents,"contig4");
        addComponent(agpPlacedComponents,"scaffold2");

        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 250 + 250);
    }

    @Test
    public void testContigsChromosomes() throws ValidationEngineException {
        Map<String, AssemblySequenceInfo> sequenceInfo = new LinkedHashMap();
        Set<String> agpPlacedComponents = new HashSet<>();

        sequenceInfo.put("contig1", new AssemblySequenceInfo(100, 0, "contig1"));
        sequenceInfo.put("contig2", new AssemblySequenceInfo(150, 0, "contig2"));
        sequenceInfo.put("contig3", new AssemblySequenceInfo(200, 0, "contig3"));
        sequenceInfo.put("contig4", new AssemblySequenceInfo(300, 0, "contig4"));

        // AGP
        // chr1 contig1
        // chr1 contig2
        // chr1 contig3
        // chr1 contig4
        sequenceInfo.put("chr1", new AssemblySequenceInfo(600, 2, "chr1"));

        addComponent(agpPlacedComponents,"contig1");
        addComponent(agpPlacedComponents,"contig2");
        addComponent(agpPlacedComponents,"contig3");
        addComponent(agpPlacedComponents,"contig4");

        assertTrue(GenomeUtils.calculateGenomeSize(sequenceInfo, agpPlacedComponents) == 600);
    }
}


text:
@class TweetSendLocationResponse;

@interface TweetDetailCell : UITableViewCell <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIWebViewDelegate>
@property (strong, nonatomic) Tweet *tweet;
@property (nonatomic, copy) void (^commentClickedBlock) (id sender);
@property (nonatomic, copy) void (^likeBtnClickedBlock) ();
@property (nonatomic, copy) void (^deleteClickedBlock) ();
@property (nonatomic, copy) void (^userBtnClickedBlock) (User *curUser);
@property (nonatomic, copy) void (^moreLikersBtnClickedBlock) ();
@property (nonatomic, copy) void (^cellHeightChangedBlock) ();
@property (nonatomic, copy) void (^loadRequestBlock)(NSURLRequest *curRequest);

@property (nonatomic, copy) void (^locationClickedBlock) (Tweet *curTweet);

+ (CGFloat)cellHeightWithObj:(id)obj;
@end


text:
#include "DT3Core/Scripting/ScriptingBase.hpp"

//==============================================================================
//==============================================================================

namespace DT3 {

//==============================================================================
/// Forward declarations
//==============================================================================

//==============================================================================
/// Timer is active when input is active. Resets when inactive.
//==============================================================================

class ScriptingTimerSuper: public ScriptingBase {
    public:
        DEFINE_TYPE(ScriptingTimerSuper,ScriptingBase)
		DEFINE_CREATE_AND_CLONE
		DEFINE_PLUG_NODE

                                    ScriptingTimerSuper     (void);
									ScriptingTimerSuper     (const ScriptingTimerSuper &rhs);
        ScriptingTimerSuper &		operator =				(const ScriptingTimerSuper &rhs);
        virtual                     ~ScriptingTimerSuper	(void);

        virtual void                archive                 (const std::shared_ptr<Archive> &archive);

		/// Object was added to a world
		/// world world that object was added to
        virtual void                add_to_world            (World *world);

		/// Object was removed from a world
        virtual void                remove_from_world       (void);

	public:
        /// Registered with world to tick this node
		/// \param dt delta time
        void                        tick                    (const DTfloat dt);

		/// Called to initialize the object
		virtual void				initialize				(void);

	private:
        enum {
            STATE_CHANGE_BEHAVIOUR_COUNT_UP = 0,
            STATE_CHANGE_BEHAVIOUR_COUNT_UP_FROM_LOWER = 1,
            STATE_CHANGE_BEHAVIOUR_COUNT_DOWN = 2,
            STATE_CHANGE_BEHAVIOUR_COUNT_DOWN_FROM_UPPER = 3,
            STATE_CHANGE_BEHAVIOUR_COUNT_STOP = 4,
            STATE_CHANGE_BEHAVIOUR_COUNT_STOP_RESET_LOWER = 5,
            STATE_CHANGE_BEHAVIOUR_COUNT_STOP_RESET_UPPER = 6
        };

        Plug<DTint>                     _when_activated;
        Plug<DTint>                     _when_deactivated;

        enum {
            STATE_RANGE_CONTINUE = 0,
            STATE_RANGE_STOP = 1,
            STATE_RANGE_REVERSE = 2,
            STATE_RANGE_WRAP = 3
        };

        Plug<DTint>                     _when_reach_upper;
        Plug<DTint>                     _when_reach_lower;

		Plug<DTfloat>                   _upper_range;
		Plug<DTfloat>                   _lower_range;

		Plug<DTfloat>                   _counting_up_speed;
		Plug<DTfloat>                   _counting_down_speed;
		Plug<DTfloat>                   _current_speed;

		Plug<DTboolean>                 _last_active;
		Plug<DTboolean>                 _active;

        // State
		Plug<DTfloat>                   _time;
		Plug<DTfloat>                   _t;

        Event                           _upper_reached;
        Event                           _lower_reached;
		Plug<DTboolean>                 _counting_down;
		Plug<DTboolean>                 _counting_up;

};

//==============================================================================
//==============================================================================

} // DT3

#endif


text:
package com.google.checkstyle.test.chapter6programpractice.rule64finalizers;

public class NoFinalizerInput
{
    public void finalize() //warn
    {
        // It's not enough to check if the METHOD_DEF branch contains a PARAMETER_DEF, as that would
        // treat this method as having a parameter.
        Runnable runnable = new Runnable() {

            public void run() {
                reallyFinalize("hi");
            }

            // generates a PARAMETER_DEF AST inside the METHOD_DEF of finalize()
            private void reallyFinalize(String s)
            {
            }
        };
        runnable.run();
    }

    // should not be reported by NoFinalizer check
    public void finalize(String x)
    {
    }
}


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.42
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace WebsitePanel.Portal.ProviderControls {

    public partial class hMailServer_EditDomain {
        protected System.Web.UI.WebControls.Label lblCatchAll;
        protected System.Web.UI.WebControls.DropDownList ddlCatchAllAccount;
    }
}


text:
package org.wso2.carbon.identity.application.authentication.framework.config.model;

import org.wso2.carbon.identity.application.common.model.Claim;
import org.wso2.carbon.identity.application.common.model.ClaimConfig;
import org.wso2.carbon.identity.application.common.model.ClaimMapping;
import org.wso2.carbon.identity.application.common.model.IdentityProvider;
import org.wso2.carbon.identity.application.common.model.JustInTimeProvisioningConfig;
import org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig;
import org.wso2.carbon.identity.application.common.model.RoleMapping;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ExternalIdPConfig implements Serializable {

    private static final long serialVersionUID = -8973637869824303767L;

    private IdentityProvider identityProvider;
    private ClaimConfig claimConfiguration;
    private PermissionsAndRoleConfig roleConfiguration;
    private JustInTimeProvisioningConfig justInTimeProConfig;

    private Map<String, String> parameterMap = new HashMap<String, String>();
    private Map<String, String> roleMappings = new HashMap<String, String>();

    public ExternalIdPConfig() {
    }

    /**
     * @param identityProvider
     */
    public ExternalIdPConfig(IdentityProvider identityProvider) {
        this.identityProvider = identityProvider;

        claimConfiguration = identityProvider.getClaimConfig();
        roleConfiguration = identityProvider.getPermissionAndRoleConfig();
        justInTimeProConfig = identityProvider.getJustInTimeProvisioningConfig();

        RoleMapping[] mappings = roleConfiguration.getRoleMappings();

        if (mappings != null && mappings.length > 0) {
            for (RoleMapping roleMapping : mappings) {
                this.roleMappings.put(roleMapping.getRemoteRole(), roleMapping.getLocalRole()
                        .getLocalRoleName());
            }
        }
    }

    /**
     * @return
     */
    public String getIdPName() {
        return identityProvider.getIdentityProviderName();
    }

    /**
     * @return
     */
    public String getPublicCert() {
        return identityProvider.getCertificate();
    }

    /**
     * @return
     */
    public boolean isPrimary() {
        return identityProvider.isPrimary();
    }

    /**
     * @return
     */
    public String getName() {
        return identityProvider.getIdentityProviderName();
    }

    /**
     * @return
     */
    public Map<String, String> getParameterMap() {
        return parameterMap;
    }

    /**
     * @param parameterMap
     */
    public void setParameterMap(Map<String, String> parameterMap) {
        this.parameterMap = parameterMap;
    }

    /**
     * @return
     */
    public String getDomain() {
        return identityProvider.getHomeRealmId();
    }

    /*
     *
     */
    public boolean isFederationHubIdP() {
        return identityProvider.isFederationHub();
    }

    /**
     * @return
     */
    public ClaimMapping[] getClaimMappings() {
        if (claimConfiguration != null) {
            return claimConfiguration.getClaimMappings();
        }
        return new ClaimMapping[0];
    }

    /**
     * @return
     */
    public String[] getRoles() {
        if (roleConfiguration != null) {
            return roleConfiguration.getIdpRoles();
        }
        return new String[0];
    }

    /**
     * @return
     */
    public Map<String, String> getRoleMappings() {
        return roleMappings;
    }

    /**
     * @return
     */
    public Claim[] getClaims() {
        if (claimConfiguration != null) {
            return claimConfiguration.getIdpClaims();
        }
        return new Claim[0];
    }

    /**
     * @return
     */
    public String getProvisioningUserStoreId() {
        if (justInTimeProConfig != null) {
            return justInTimeProConfig.getProvisioningUserStore();
        }
        return null;
    }

    /**
     * @return
     */
    public String getProvisioningUserStoreClaimURI() {
        if (justInTimeProConfig != null) {
            return justInTimeProConfig.getUserStoreClaimUri();
        }
        return null;
    }

    /**
     * @return
     */
    public String getTokenEndpointAlias() {
        return identityProvider.getAlias();
    }

    /**
     * @return
     */
    public boolean isProvisioningEnabled() {
        if (justInTimeProConfig != null) {
            return justInTimeProConfig.isProvisioningEnabled();
        }
        return false;
    }

    /**
     * @return
     */
    public String getRoleClaimUri() {
        if (identityProvider.getClaimConfig() != null) {
            return identityProvider.getClaimConfig().getRoleClaimURI();
        }
        return null;
    }

    /**
     * @return
     */
    public String getUserIdClaimUri() {
        if (identityProvider.getClaimConfig() != null) {
            return identityProvider.getClaimConfig().getUserClaimURI();
        }
        return null;
    }

    /**
     * @return
     */
    public boolean useDefaultLocalIdpDialect() {
        if (claimConfiguration != null) {
            return claimConfiguration.isLocalClaimDialect();
        }

        return false;
    }

    /**
     * @return
     */
    public IdentityProvider getIdentityProvider() {
        return identityProvider;
    }

}


text:
{% load i18n %}
{% if object.file.url %}

		{% if object.get_icon_url %}{% endif %}
		{% if object.title %}{{ object.title }}{% else %}{{ object.get_file_name }}{% endif %} {% if object.file_exists %}({{ object.file.size|filesizeformat }}){% else %}({% trans "file missing!" %}){% endif %}{% if object.title %}{% endif %}

{% endif %}


text:
package com.lsjwzh.orm.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Specify that a this columns is a key column. It will be used to check existence of this model in the database.
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Ignore {

}


text:
namespace Microsoft.Graph
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// The type WorkbookChartSeriesCollectionRequestBuilder.
    /// </summary>
    public partial class WorkbookChartSeriesCollectionRequestBuilder : BaseRequestBuilder, IWorkbookChartSeriesCollectionRequestBuilder
    {
        /// <summary>
        /// Constructs a new WorkbookChartSeriesCollectionRequestBuilder.
        /// </summary>
        /// <param name="requestUrl">The URL for the built request.</param>
        /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param>
        public WorkbookChartSeriesCollectionRequestBuilder(
            string requestUrl,
            IBaseClient client)
            : base(requestUrl, client)
        {
        }

        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <returns>The built request.</returns>
        public IWorkbookChartSeriesCollectionRequest Request()
        {
            return this.Request(null);
        }

        /// <summary>
        /// Builds the request.
        /// </summary>
        /// <param name="options">The query and header options for the request.</param>
        /// <returns>The built request.</returns>
        public IWorkbookChartSeriesCollectionRequest Request(IEnumerable<Option> options)
        {
            return new WorkbookChartSeriesCollectionRequest(this.RequestUrl, this.Client, options);
        }

        /// <summary>
        /// Gets an <see cref="IWorkbookChartSeriesRequestBuilder"/> for the specified WorkbookChartWorkbookChartSeries.
        /// </summary>
        /// <param name="id">The ID for the WorkbookChartWorkbookChartSeries.</param>
        /// <returns>The <see cref="IWorkbookChartSeriesRequestBuilder"/>.</returns>
        public IWorkbookChartSeriesRequestBuilder this[string id]
        {
            get
            {
                return new WorkbookChartSeriesRequestBuilder(this.AppendSegmentToRequestUrl(id), this.Client);
            }
        }

        /// <summary>
        /// Gets the request builder for WorkbookChartSeriesItemAt.
        /// </summary>
        /// <returns>The <see cref="IWorkbookChartSeriesItemAtRequestBuilder"/>.</returns>
        public IWorkbookChartSeriesItemAtRequestBuilder ItemAt(
            Int32 index)
        {
            return new WorkbookChartSeriesItemAtRequestBuilder(
                this.AppendSegmentToRequestUrl("microsoft.graph.itemAt"),
                this.Client,
                index);
        }

        /// <summary>
        /// Gets the request builder for WorkbookChartSeriesCount.
        /// </summary>
        /// <returns>The <see cref="IWorkbookChartSeriesCountRequestBuilder"/>.</returns>
        public IWorkbookChartSeriesCountRequestBuilder Count()
        {
            return new WorkbookChartSeriesCountRequestBuilder(
                this.AppendSegmentToRequestUrl("microsoft.graph.count"),
                this.Client);
        }
    }
}


text:
// Package logger is logging that is specific to this application
// Need to track the game, and the player, so we can see
// everything that is going on.
package logger

import (
	"bytes"
	"fmt"
	"log"
	"sync"

	"golang.org/x/net/context"
)

var (
	data = map[context.Context]map[string]string{}
	// this is to track keys in the order they are set
	keys = map[context.Context][]string{}
	lock sync.RWMutex
)

// Set set a value for this context
func Set(ctx context.Context, key, value string) {
	lock.Lock()
	defer lock.Unlock()

	if _, ok := data[ctx]; !ok {
		data[ctx] = map[string]string{}
	}

	data[ctx][key] = value
	keys[ctx] = append(keys[ctx], key)

}

// Clear clears the data for this context. Very important
// to do at the end of a request, to ensure no memory leaks
func Clear(ctx context.Context) {
	lock.Lock()
	defer lock.Unlock()

	delete(data, ctx)
	delete(keys, ctx)
}

// Info informational level logging.
func Info(ctx context.Context, category, msg string, args ...interface{}) {
	printf(ctx, "Info", category, msg, args...)
}

// Error error level logging.
func Error(ctx context.Context, category, msg string, args ...interface{}) {
	printf(ctx, "Error", category, msg, args...)
}

func printf(ctx context.Context, level, category, msg string, args ...interface{}) {
	lock.RLock()
	defer lock.RUnlock()

	buf := new(bytes.Buffer)
	_, err := buf.WriteString(fmt.Sprintf("[%v][%v]", level, category))

	if err != nil {
		log.Println("[Error][Logging] Could not write level and category to buffer.")
	}

	for _, k := range keys[ctx] {
		_, err = buf.WriteString(fmt.Sprintf("[%v: %v]", k, data[ctx][k]))
		if err != nil {
			log.Println("[Error][Logging] Could not write key, value to the buffer")
		}
	}

	_, err = buf.WriteString(fmt.Sprintf(" "+msg, args...))

	if err != nil {
		log.Println("[Error][Logging] Could not write message to buffer.")
	}

	log.Println(buf.String())
}


text:
namespace ash {

// A singleton class used to create and cache icu::SimpleDateFormat objects, so
// that they don't have to be recreated each time we format a base::Time object.
// This improves performance since creating icu::SimpleDateFormat objects is
// expensive.
class DateFormatter {
 public:
  // Returns the singleton instance.
  static DateFormatter* GetInstance();

  // Creates a formatter object used to format dates from the given `pattern`.
  icu::SimpleDateFormat CreateSimpleDateFormatter(const char* pattern);

  // Returns a formatted string of a `time` using the given `formatter`.
  std::u16string GetFormattedTime(const icu::DateFormat* formatter,
                                  const base::Time& time);

  icu::SimpleDateFormat& day_of_month_formatter() {
    return day_of_month_formatter_;
  }

  icu::SimpleDateFormat& month_day_formatter() { return month_day_formatter_; }

  icu::SimpleDateFormat& month_day_year_formatter() {
    return month_day_year_formatter_;
  }

  icu::SimpleDateFormat& month_name_formatter() {
    return month_name_formatter_;
  }

  icu::SimpleDateFormat& month_name_year_formatter() {
    return month_name_year_formatter_;
  }

  icu::SimpleDateFormat& time_zone_formatter() { return time_zone_formatter_; }

  icu::SimpleDateFormat& twelve_hour_clock_formatter() {
    return twelve_hour_clock_formatter_;
  }

  icu::SimpleDateFormat& year_formatter() { return year_formatter_; }

 private:
  friend base::DefaultSingletonTraits<DateFormatter>;
  DateFormatter();
  DateFormatter(const DateFormatter& other) = delete;
  DateFormatter& operator=(const DateFormatter& other) = delete;
  ~DateFormatter();

  // Formatter for getting the day of month.
  icu::SimpleDateFormat day_of_month_formatter_;

  // Formatter for getting the month name and day of month.
  icu::SimpleDateFormat month_day_formatter_;

  // Formatter for getting the month name, day of month, and year.
  icu::SimpleDateFormat month_day_year_formatter_;

  // Formatter for getting the name of month.
  icu::SimpleDateFormat month_name_formatter_;

  // Formatter for getting the month name and year.
  icu::SimpleDateFormat month_name_year_formatter_;

  // Formatter for getting the time zone.
  icu::SimpleDateFormat time_zone_formatter_;

  // Formatter for 12 hour clock hours and minutes.
  icu::SimpleDateFormat twelve_hour_clock_formatter_;

  // Formatter for getting the year.
  icu::SimpleDateFormat year_formatter_;
};

}  // namespace ash

#endif  // ASH_SYSTEM_TIME_DATE_FORMATTER_H_


text:
#ifndef ARCHINCLUDE_ARCH_H
#define ARCHINCLUDE_ARCH_H
#include "machine.h"
#include "ArchFastMath.h"
#endif


text:
//
// Created by zeph on 11/25/16.
//
/*
 * In the interview prep at coogle, Sam Greenfiled pointed out that
 *   o map's basic operations run in O(log n) since it's backed by a BST
 *   while
 *   o unordered_map's is a true hash table with O(1) operations
 *
 *  Let's test this theory out.
 */

#include <iostream>
#include <map>
#include <unordered_map>
#include <cassert>

#include "../helpers/coutFriends.cpp"

using namespace std;
using namespace std::chrono;
using hires = std::chrono::high_resolution_clock;

vector<int> makeRandomVector (size_t N) {
    vector<int> randVect(N);
    generate(randVect.begin(), randVect.end(), [](){return rand();});
    return randVect;
}

template <typename M>
long long int populateMap (const vector<int> &v, M &table) {
    chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
    for(auto x: v){
        table[x] = x;
    }
    chrono::steady_clock::time_point t2 = chrono::steady_clock::now();
    auto duration = duration_cast<chrono::microseconds>(t2 - t1 ).count();
    return duration;
}

template <typename M>
long long int retrieveAllFromMap (const vector<int> &v, const M &table) {
    chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
    for(auto x: v){
        assert(table.count(x) == 1);
    }
    chrono::steady_clock::time_point t2 = chrono::steady_clock::now();
    auto duration = duration_cast<chrono::microseconds>(t2 - t1 ).count();
    return duration;
}

template <typename M>
long long int retrieveNonExistingFromMap (const vector<int> &v, const M &table) {
    chrono::steady_clock::time_point t1 = chrono::steady_clock::now();
    for(auto x: v){
        assert(table.count(837497) == 0);
    }
    chrono::steady_clock::time_point t2 = chrono::steady_clock::now();
    auto duration = duration_cast<chrono::microseconds>(t2 - t1 ).count();
    return duration;
}

void runExperiment (size_t N) {
    cout << "\n************************\n" << "Experiment with size N = " << N << endl;
    cout << "************************\n" << endl;
    vector<int> randVect{makeRandomVector(N)};
    //cout << "randVect = \n" << randVect << endl << endl;

    map<int, int> tableBST;
    long long int duration1a = populateMap(randVect, tableBST);
    cout << duration1a << " microseconds to populate Map with " << randVect.size() << " elements\n";

    unordered_map<int, int> tableHash;
    long long int duration1b = populateMap(randVect, tableHash);
    cout << duration1b << " microseconds for Unordered_Map with " << randVect.size() << " elements\n";

    long long int duration2a  = retrieveAllFromMap(randVect, tableBST);
    cout << duration2a << " microseconds to find all " << randVect.size() << " existing elements in Map\n";

    long long int duration2b  = retrieveAllFromMap(randVect, tableHash);
    cout << duration2b << " microseconds to find all " << randVect.size() << " existing elements in Unordered_Map\n";

    long long int duration3a  = retrieveNonExistingFromMap(randVect, tableBST);
    cout << duration3a << " microseconds to find all " << randVect.size() << " NON-existing elements in Map\n";

    long long int duration3b  = retrieveNonExistingFromMap(randVect, tableHash);
    cout << duration3b << " microseconds to find all " << randVect.size() << " NON-existing elements in Unordered_Map\n";

    cout << "----------SUMMARY----------\n";
    string u("UNDEFINED");
    cout << "Map is " << (duration1b ? to_string(duration1a / double(duration1b)) : u) << "X slower than unordered_map for population\n";
    cout << "Map is " << (duration3b ? to_string(duration2a / double(duration2b)) : u) << "X slower than unordered_map for retrieval existing\n";
    cout << "Map is " << (duration3b ? to_string(duration3a / double(duration3b)) : u) << "X slower than unordered_map for retrieval NON-existing\n";
}

int main (int argc, char* argv[])
{
    std::srand((unsigned int)std::time(0));

    for(size_t N = 1; N <= 10000000; N*=10) {
        runExperiment(N);
    }

    return 0;
}


text:
package ch.idsia.utils.statistics;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Vector;

/**
 * This class is used to model the statistics
 * of a fix of numbers.  For the statistics
 * we choose here it is not necessary to store
 * all the numbers - just keeping a running total
 * of how many, the sum and the sum of the squares
 * is sufficient (plus max and min, for max and min).
 * <p>
 * Warning: the geometric mean calculation is only valid if all numbers
 * added to the summary are positive (>0) - no warnings
 * are given if this is not the case - you'll just get a wrong answer
 * for the gm() !!!
 */

public class StatisticalSummary implements java.io.Serializable
{

    // a temporary fix for an immediate need
    // this should really be handled with a more general
    // predicate class

    public static class Watch
    {

        double x;
        public int count;

        public Watch(double x)
        {
            this.x = x;
            count = 0;
        }

        public void note(double val)
        {
            if (val == x)
            {
                count++;
            }
        }

        public String toString()
        {
            return x + " occured " + count + " times ";
        }

        public void reset()
        {
            count = 0;
        }
    }

    // following line can cause prog to hang - bug in Java?
    // protected long serialVersionUID = new Double("-1490108905720833569").longValue();
    // protected long serialVersionUID = 123;
    public String name; // defaults to ""
    private double logsum; // for calculating the geometric mean
    private double sum;
    private double sumsq;
    private double min;
    private double max;

    private double mean;
    private double gm; // geometric mean
    private double sd;

    // trick class loader into loading this now
    //    private static StatisticalTests dummy = new StatisticalTests();

    int n;
    boolean valid;
    public Watch watch;

    public StatisticalSummary()
    {
        this("");
        // System.out.println("Exited default...");
    }

    public StatisticalSummary(String name)
    {
        // System.out.println("Creating SS");
        this.name = name;
        n = 0;
        sum = 0;
        sumsq = 0;
        // ensure that the first number to be
        // added will fix up min and max to
        // be that number
        min = Double.POSITIVE_INFINITY;
        max = Double.NEGATIVE_INFINITY;
        // System.out.println("Finished Creating SS");
        watch = null;
        valid = false;
    }

    public final void reset()
    {
        n = 0;
        sum = 0;
        sumsq = 0;
        logsum = 0;
        // ensure that the first number to be
        // added will fix up min and max to
        // be that number
        min = Double.POSITIVE_INFINITY;
        max = Double.NEGATIVE_INFINITY;
        if (watch != null)
        {
            watch.reset();
        }
    }

    public double max()
    {
        return max;
    }

    public double min()
    {
        return min;
    }

    public double mean()
    {
        if (!valid)
        {
            computeStats();
        }
        return mean;
    }

    public double gm()
    {
        if (!valid)
        {
            computeStats();
        }
        return gm;
    }
/* erroneous
  public static double sigDiff( StatisticalSummary s1 , StatisticalSummary s2 ) {
    return StatisticalTests.tNotPaired(
      s1.mean(), s2.mean(), s1.sumsq, s2.sumsq, s1.n, s2.n, true);
  }
*/

    public static double sigDiff(StatisticalSummary s1, StatisticalSummary s2)
    {
        return StatisticalTests.tNotPaired(
                s1.mean(), s2.mean(), s1.sumSquareDiff(), s2.sumSquareDiff(), s1.n, s2.n, true);
    }

    /**
     * returns the sum of the squares of the differences
     * between the mean and the ith values
     */
    public double sumSquareDiff()
    {
        return sumsq - n * mean() * mean();
    }

    private void computeStats()
    {
        if (!valid)
        {
            mean = sum / n;
            gm = Math.exp(logsum / n);
            double num = sumsq - (n * mean * mean);
            if (num < 0)
            {
                // avoids tiny negative numbers possible through imprecision
                num = 0;
            }
            // System.out.println("Num = " + num);
            sd = Math.sqrt(num / (n - 1));
            // System.out.println(" Test: sd = " + sd);
            // System.out.println(" Test: n = " + n);
            valid = true;
        }
    }

    public double sd()
    {
        if (!valid)
        {
            computeStats();
        }
        return sd;
    }

    public int n()
    {
        return n;
    }

    public double stdErr()
    {
        return sd() / Math.sqrt(n);
    }

    public void add(StatisticalSummary ss)
    {
        // implications for Watch?
        n += ss.n;
        sum += ss.sum;
        sumsq += ss.sumsq;
        logsum += ss.logsum;
        max = Math.max(max, ss.max);
        min = Math.min(min, ss.min);
        valid = false;
    }

    public void add(double d)
    {
        n++;
        sum += d;
        sumsq += d * d;
        if (d > 0)
        {
            logsum += Math.log(d);
        }
        min = Math.min(min, d);
        max = Math.max(max, d);
        if (watch != null)
        {
            watch.note(d);
        }
        valid = false;
    }

    public void add(Number n)
    {
        add(n.doubleValue());
    }

    public void add(double[] d)
    {
        for (int i = 0; i < d.length; i++)
        {
            add(d[i]);
        }
    }

    public void add(Vector v)
    {
        for (int i = 0; i < v.size(); i++)
        {
            try
            {
                add(((Number) v.elementAt(i)).doubleValue());
            }
            catch (Exception e)
            {
            }
        }
    }

    public String toString()
    {
        String s = (name == null) ? "" : name + "\n";
        s += " min = " + min() + "\n" +
                " max = " + max() + "\n" +
                " ave = " + mean() + "\n" +
                " sd  = " + sd() + "\n" +
                // " se  = " + stdErr() + "\n" +
                // " sum  = " + sum + "\n" +
                // " sumsq  = " + sumsq + "\n" +
                // " watch = " + watch + "\n" +
                " n   = " + n;
        return s;

    }

    public void save(String path)
    {
        try
        {
            ObjectOutputStream oos =
                    new ObjectOutputStream(
                            new FileOutputStream(path));
            oos.writeObject(this);
            oos.close();
        }
        catch (Exception e)
        {
            System.out.println(e);
        }
    }

    public static StatisticalSummary load(String path)
    {
        try
        {
            ObjectInputStream ois =
                    new ObjectInputStream(
                            new FileInputStream(path));
            StatisticalSummary ss = (StatisticalSummary) ois.readObject();
            ois.close();
            return ss;
        }
        catch (Exception e)
        {
            System.out.println(e);
            return null;
        }
    }

    public static void main(String[] args) throws Exception
    {
        // demonstrate some possible usage...

        StatisticalSummary ts1 = new StatisticalSummary();
        StatisticalSummary ts2 = new StatisticalSummary();
        for (int i = 0; i < 100; i++)
        {
            ts1.add(i / 10);
            ts2.add(i / 10 + new Double(args[0]).doubleValue());
        }

        System.out.println(ts1);
        System.out.println(ts2);
        System.out.println(StatisticalSummary.sigDiff(ts1, ts2));
        System.out.println((ts2.mean() - ts1.mean()) / ts1.stdErr());

        System.exit(0);

        System.out.println("Creating summaries");

        StatisticalSummary trainSummary = new StatisticalSummary();
        System.out.println("1");
        // StatisticalSummary testSummary = new VisualSummary("EA");
        System.out.println("2");
        // testSummary.watch = new StatisticalSummary.Watch( 1.0 );
        System.out.println("3");
        // StatisticalSummary ostiaTrainSummary = new StatisticalSummary();
        System.out.println("4");
        // ostiaTestSummary = new VisualSummary("OSTIA");
        System.out.println("5");
        // ostiaTestSummary.watch = new StatisticalSummary.Watch( 1.0 );

        System.out.println("Created summaries");

        StatisticalSummary s10 = new StatisticalSummary();
        StatisticalSummary s20 = new StatisticalSummary();
        StatisticalSummary s3 = new StatisticalSummary();
        StatisticalSummary s4 = new StatisticalSummary();
        StatisticalSummary s5 = new StatisticalSummary();
        StatisticalSummary ss = new StatisticalSummary("Hello");
        for (int i = 0; i < 20; i++)
        {
            ss.add(0.71);
        }
        System.out.println(ss);
        System.exit(0);

        StatisticalSummary s1 = new StatisticalSummary();
        StatisticalSummary s2 = new StatisticalSummary();

        System.out.println(sigDiff(s1, s2));

        for (int i = 0; i < 20; i++)
        {
            s1.add(Math.random());
            s2.add(Math.random() + 0.5);
            // s1.add(i);
            // s2.add(i+2);
            System.out.println(sigDiff(s1, s2));
        }
    }
}


text:
namespace aqlib
{

const int TextFile::BUFFER_SIZE = 256 * 1024;  // 256 Kb

TextFile::TextFile(const std::string &filename):
    mInstanceName(std::string("File.") + filename)
{
    mHandle = fopen(filename.c_str(), "r");
    if (NULL == mHandle)
    {
        throw Exception(std::string("Failed to open file: ") + filename);
    }

    mBuffer.resize(BUFFER_SIZE);

    // Read initial data chunk into the buffer
    readFile();
}

TextFile::~TextFile()
{
    fclose((FILE *)mHandle);
}

bool TextFile::exists(const std::string &filename)
{
    struct stat attributes;
    bool success = (0 == stat(filename.c_str(), &attributes));
    return success;
}

bool TextFile::readLine(std::string &line)
{
    if (mCount <= 0)
    {
        return false;
    }

    // Read buffer
    while (mPos < mCount)
    {
        char value = mBuffer[mPos];
        mPos++;

        // Look for newline character
        if (value != '\n')
        {
            // Add to current line
            mLine += value;
            if (mLine.length() > BUFFER_SIZE)
            {
                // It's weird not to have encountered a line until now
                throw Exception("Buffer overfow!");
            }
            continue;
        }

        // Copy current line result and prepare reading the next line
        line = mLine;
        mLine.clear();

        // Remove eventual DOS newline terminal character
        if ((line.size() > 0) && ('\r' == line[line.size() - 1]))
        {
            line = line.substr(0, line.size() - 1);
        }

        // Succeeded
        return true;
    }

    // Read next data chunk into the buffer
    readFile();
    return readLine(line);
}

void TextFile::readFile()
{
    FILE *file = (FILE *)mHandle;
    void *data = (void *)mBuffer.data();
    mCount = fread(data, 1, BUFFER_SIZE, file);
    mPos = 0;
}

/////////////////////////////////////////////////////
const std::string TextFileWriter::NEWLINE("\n");

TextFileWriter::TextFileWriter(const std::string &filename):
    mInstanceName(std::string("FileWriter.") + filename)
{
    mHandle = fopen(filename.c_str(), "w");
    if (NULL == mHandle)
    {
        throw Exception(std::string("Failed to open file: ") + filename);
    }
}

TextFileWriter::~TextFileWriter()
{
    flush();
    close();
}

void TextFileWriter::close()
{
    fclose((FILE *)mHandle);
    mHandle = NULL;
}

void TextFileWriter::flush()
{
    fflush((FILE *)mHandle);
}

bool TextFileWriter::writeLine(const std::string &line)
{
    // Write line data
    int count = fwrite(line.data(), 1, line.size(), (FILE *)mHandle);
    if (line.size() != count)
    {
        return false;
    }

    // Write newline character
    count = fwrite(NEWLINE.data(), 1, NEWLINE.size(), (FILE *)mHandle);
    if (NEWLINE.size() != count)
    {
        return false;
    }

    return true;
}

CsvFileWriter::CsvFileWriter(const std::string &filename):
    TextFileWriter(filename)
{
}

CsvFileWriter::~CsvFileWriter()
{
    flush();
}

void CsvFileWriter::addRecord(const Record &record)
{
    mRecords.push_back(record);
}

void CsvFileWriter::flush()
{
    for (Records::const_iterator itRecord = mRecords.begin(); itRecord != mRecords.end(); ++itRecord)
    {
        const Record &record = *itRecord;
        writeRecord(record);
    }

    mRecords.clear();
}

void CsvFileWriter::writeRecord(const Record &record)
{
    std::stringstream strm;
    for (Record::const_iterator it = record.begin(); it != record.end(); ++it)
    {
        const std::string &item = *it;
        strm << (record.begin() != it ? "," : "") << item;
    }

    writeLine(strm.str());
}

CsvFileReader::CsvFileReader(const std::string &fileName):
    mTextFile(fileName)
{
}

bool CsvFileReader::readRecord(Record &record)
{
    record.clear();

    std::string line;
    if (!mTextFile.readLine(line))
    {
        return false;
    }

    StringTokenizer tokenizer(line, ",");
    while (tokenizer.hasMoreTokens())
    {
        std::string token = tokenizer.nextToken();
        record.push_back(token);
    }

    return true;
}

} // namespace aqlib


text:
import mock

from oslo_config import cfg

from mistral.actions import std_actions
from mistral.db.v2 import api as db_api
from mistral.services import workbooks as wb_service
from mistral.tests.unit.engine import base
from mistral.workflow import states

# Use the set_default method to set value otherwise in certain test cases
# the change in value is not permanent.
cfg.CONF.set_default('auth_enable', False, group='pecan')

SIMPLE_WORKBOOK = """
---
version: '2.0'
name: wb1
workflows:
  wf1:
    type: direct
    tasks:
      t1:
        action: std.echo output="Task 1"
        publish:
          v1: <% $.t1.get($foobar) %>
        on-success:
          - t2
      t2:
        action: std.echo output="Task 2"
        on-success:
          - t3
      t3:
        action: std.echo output="Task 3"
"""

class TaskPublishTest(base.EngineTestCase):

    @mock.patch.object(
        std_actions.EchoAction,
        'run',
        mock.MagicMock(
            side_effect=[
                'Task 1',               # Mock task1 success.
                'Task 2',               # Mock task2 success.
                'Task 3'                # Mock task3 success.
            ]
        )
    )
    def test_publish_failure(self):
        wb_service.create_workbook_v2(SIMPLE_WORKBOOK)

        # Run workflow and fail task.
        wf_ex = self.engine.start_workflow('wb1.wf1')

        self.await_workflow_error(wf_ex.id)

        with db_api.transaction():
            wf_ex = db_api.get_workflow_execution(wf_ex.id)

            task_execs = wf_ex.task_executions

        self.assertEqual(states.ERROR, wf_ex.state)
        self.assertEqual(1, len(task_execs))

        task_1_ex = self._assert_single_item(task_execs, name='t1')

        # Task 1 should have failed.
        self.assertEqual(states.ERROR, task_1_ex.state)
        self.assertIn('Can not evaluate YAQL expression', task_1_ex.state_info)

        # Action execution of task 1 should have succeeded.
        task_1_action_exs = db_api.get_action_executions(
            task_execution_id=task_1_ex.id
        )

        self.assertEqual(1, len(task_1_action_exs))
        self.assertEqual(states.SUCCESS, task_1_action_exs[0].state)


text:
//  Created by Monte Hurd on 10/9/14.
//  Copyright (c) 2014 Wikimedia Foundation. Provided under MIT-style license; please copy and modify!

#import "AccountCreator.h"
#import "AFHTTPRequestOperationManager.h"
#import "MWNetworkActivityIndicatorManager.h"
#import "SessionSingleton.h"
#import "NSObject+Extras.h"
#import "WikipediaAppUtils.h"

@interface AccountCreator ()

@property (strong, nonatomic) NSString* token;
@property (strong, nonatomic) NSString* domain;
@property (strong, nonatomic) NSString* userName;
@property (strong, nonatomic) NSString* password;

@property (strong, nonatomic) NSString* realName;
@property (strong, nonatomic) NSString* email;
@property (strong, nonatomic) NSString* captchaId;
@property (strong, nonatomic) NSString* captchaWord;

@end

@implementation AccountCreator

- (instancetype)initAndCreateAccountForUserName:(NSString*)userName
                                       realName:(NSString*)realName
                                         domain:(NSString*)domain
                                       password:(NSString*)password
                                          email:(NSString*)email
                                      captchaId:(NSString*)captchaId
                                    captchaWord:(NSString*)captchaWord
                                          token:(NSString*)token
                                    withManager:(AFHTTPRequestOperationManager*)manager
                             thenNotifyDelegate:(id <FetchFinishedDelegate>)delegate {
    self = [super init];
    if (self) {
        self.userName    = userName ? userName : @"";
        self.realName    = realName ? realName : @"";
        self.domain      = domain ? domain : @"";
        self.password    = password ? password : @"";
        self.email       = email ? email : @"";
        self.captchaId   = captchaId ? captchaId : @"";
        self.captchaWord = captchaWord ? captchaWord : @"";
        self.token       = token ? token : @"";

        self.fetchFinishedDelegate = delegate;
        [self creationAccountWithManager:manager];
    }
    return self;
}

- (void)creationAccountWithManager:(AFHTTPRequestOperationManager*)manager {
    NSURL* url = [[SessionSingleton sharedInstance] urlForLanguage:self.domain];

    NSDictionary* params = [self getParams];

    [[MWNetworkActivityIndicatorManager sharedManager] push];

    [manager POST:url.absoluteString parameters:params success:^(AFHTTPRequestOperation* operation, id responseObject) {
        //NSLog(@"JSON: %@", responseObject);
        [[MWNetworkActivityIndicatorManager sharedManager] pop];

        // Fake out an error if non-dictionary response received.
        if (![responseObject isDict]) {
            responseObject = @{@"error": @{@"info": @"Account creation data not found."}};
        }

        //NSLog(@"ACCT CREATION DATA RETRIEVED = %@", responseObject);

        // Handle case where response is received, but API reports error.
        NSError* error = nil;
        if (responseObject[@"error"]) {
            NSMutableDictionary* errorDict = [responseObject[@"error"] mutableCopy];
            errorDict[NSLocalizedDescriptionKey] = errorDict[@"info"];
            error = [NSError errorWithDomain:@"Acct Creation Fetcher"
                                        code:ACCOUNT_CREATION_ERROR_API
                                    userInfo:errorDict];
        }

        NSString* result = @"";
        if (!error) {
            result = [self getSanitizedResultFromResponse:responseObject];

            if ([result isEqualToString:@"NeedCaptcha"]) {
                NSMutableDictionary* errorDict = @{}.mutableCopy;

                if (responseObject[@"createaccount"][@"captcha"]) {
                    errorDict[NSLocalizedDescriptionKey] = MWLocalizedString(@"account-creation-captcha-required", nil);

                    // Make the capcha id and url available from the error.
                    errorDict[@"captchaId"] = responseObject[@"createaccount"][@"captcha"][@"id"];
                    errorDict[@"captchaUrl"] = responseObject[@"createaccount"][@"captcha"][@"url"];
                }

                error = [NSError errorWithDomain:@"Account Creation Fetcher"
                                            code:ACCOUNT_CREATION_ERROR_NEEDS_CAPTCHA
                                        userInfo:errorDict];
            }
        }

        [self finishWithError:error
                  fetchedData:result];
    } failure:^(AFHTTPRequestOperation* operation, NSError* error) {
        //NSLog(@"ACCT CREATION TOKEN FAIL = %@", error);

        [[MWNetworkActivityIndicatorManager sharedManager] pop];

        [self finishWithError:error
                  fetchedData:nil];
    }];
}

- (NSMutableDictionary*)getParams {
    NSMutableDictionary* params =
        @{
        @"action": @"createaccount",
        @"name": self.userName,
        @"password": self.password,
        @"realname": self.realName,
        @"email": self.email,
        @"reason": ([self.domain isEqualToString:@"test"] ? @"iOS App Account Creation Testing" : @"iOS App Account Creation"),
        @"language": ([self.domain isEqualToString:@"test"] ? @"en" : self.domain),
        @"format": @"json"
    }.mutableCopy;

    if (self.token && self.token.length > 0) {
        params[@"token"] = self.token;
    }
    if (self.captchaId && self.captchaId.length > 0) {
        params[@"captchaid"] = self.captchaId;
    }
    if (self.captchaWord && self.captchaWord.length > 0) {
        params[@"captchaword"] = self.captchaWord;
    }

    //NSLog(@"params = %@", params);
    return params;
}

- (NSString*)getSanitizedResultFromResponse:(NSDictionary*)rawResponse {
    if (![rawResponse isDict]) {
        return @"";
    }

    id createaccount = rawResponse[@"createaccount"];

    if (![createaccount isDict]) {
        return @"";
    }

    NSString* result = createaccount[@"result"];

    return (result ? result : @"");
}

/*
   -(void)dealloc
   {
    NSLog(@"DEALLOC'ING PAGE HISTORY FETCHER!");
   }
 */

@end