text:
CHANGES
=======

### Version 1.24.0

Please see the [release notes](https://github.com/phpbrew/phpbrew/releases) on GitHub.

### Version 1.23.1
- Use default cURL timeouts in Downloader to avoid accidental installation failures (c9s/CurlKit#3).
- Fixed a PHP notice in --debug mode (#919).
- Improved handling of invalid arguments in `phpbrew use` (#822).
- Removed the warning about rootless mode in macOS (#879).
- Fixed handling failure to create a temporary file (#937).
- Fixed handling `$PATH`s containing whitespaces (#823).

### Version 1.23.0
- Changed the semantics of the `each` command (#888). Prior to this release, the arguments were interpreted as internal PHPBrew command (e.g. `phpbrew each install xdebug` would install the Xdebug extensions on all available builds). As of this release, the command is interpreted as a shell command, i.e. the previously mentioned command will now look like `phpbrew each phpbrew ext install xdebug`. This change opens the possibility to run shell commands like `phpbrew each phpunit` and internal PHPBrew commands implemented in shell like `phpbrew each phpbrew fpm restart`.
- Added support for php pre-release versions, including alpha, beta and RC (#915)
- Improved the "ext enable" command (#911)
  - Added support for bundled shared extension / pre-built extension
  - Generate absolute path for zend extension for php lower than 5.5
- Fixed proxy auth problem for wget downloader (#897)
- Fixed problems when installing packages with os or architecture dependency (#917, phpbrew/PEARX#8)
- Added the LDAP variant (#906)
- Use bundled GD if no prefix provided (#907)
- Fixed cURL extension being silently dropped if dependencies not found (#913)

### Version 1.22.8
- Use sha256 instead of md5 for newer release (#884)
- Implemented purging multiple PHP builds at one time (#881)
- Added phpcbf to App store (#853)
- Improved user experience (#880)

### Version 1.22.7
- Updated App store (#850)
- Improved warning messages about environment check
  - Added check for ctype for parsing yaml file (#819)
  - Added rootless check and tips for osX 10.11+ (#824)
  - Removed check for curl extension
- Fixed fish shell compatibility problems (#810, #860)
- Fixed --cache-file option escape
- Improved user experience (#798, #792)

### Version 1.22.6
- Fixed .phpbrew lookup in parent directories (#775)
- Improved MySQL socket path detection on Ubuntu
- Added psysh to app store
- Removed openssl extension requirement
- Improved user experience (#799, #807)

### Version 1.22.5
- Fixed downloading historic version from museum (#769)
- Fixed wget downloader failure when some special chars presents

### Version 1.22.4

- Fixed extension installer exception with Buildable interface.
- Added getBuildLogPath() method to Buildable interface.
- Check sd-daemon.h header for --with-fpm-systemd option.

### Version 1.22.2

- Refined init command to support --root option.
- Fixed is_writable check in fpm setup command.
- Fixed few bugs in fpm setup --initd option, there are some limitation:
  - The generated init.d script depends on lsb-base >= 4.0.
  - If initctl is based on upstart, the init.d script will not be executed.
      To check, please run /sbin/initctl --version in the command-line.

### Version 1.22.1

- The install command now patches the default listen path defined in php-fpm/www.conf
  for each different build.

- Fixed pgsql base dir finder

### Version 1.22.0

- Added fpm setup command:

    To setup systemctl service config for the current php:

        phpbrew fpm setup --systemctl

    To setup launchctl service config for the current php:

        phpbrew fpm setup --launchctl

    To setup init.d script for the current php:

        phpbrew fpm setup --initd

    To setup scripts for other php builds:

        phpbrew fpm setup --initd 5.6

- Added fpm which command to show which php-fpm will be used.

### Version 1.21.6

- Moved dtrace to variant option.
- Fixed downloader option
- Added options for `phpbrew ext known`
- Added --downloader support for PeclDownloader

### Version 1.21.5

- Fixed readline variant prefix
- Fixed lookup prefix ordering (prefer libraries from macports, homebrew, then system)
- Fixed build exception catching

### Version 1.21.4

- Fixed GithubProvider curl setup.
- Fixed PhpCurlDownloader options object singleton.
- Removed `tee` when using stdout, it doesn't report exit status when using pipe.
- Added more variant tests.
- Supported prefix from `brew --prefix pcre`.
- Fixed gettext prefix detection.
- Fixed curl prefix with curl-config.

### Version 1.21.3

- `mysql_config` lookup is improved.
- Added `pg_config` support for pgsql prefix.
- Improved `pdo_pgsql` prefix.
- readline will now prefered over editline and the two libraries conflicts.

    Users might prefer readline over libedit

    because only readline supports readline_list_history()
    (http://www.php.net/readline-list-history).  On the other hand we want
    libedit to be the default because its license is compatible with PHP's
    which means PHP can be distributable.

    related issue https://github.com/phpbrew/phpbrew/issues/497

- Deprecated icu variant, search for icu directory in +intl variant.
- Fixed extra options serialization
- Replaced "system" with "exec"
- Fixed timezone grepping issue for #557
- Fixed PHPBREW_BIN issue for #335

Bash

- Replaced "cd" with "builtin cd"
- Added "fpm current" command for #248

### Version 1.21.1

- Fixed BSD make issue - prefer gmake over make. remove --quiet flag when os == bsd
- Added more path detection for apxs2
- Added more path detection for gettext
- Added --with-mysql-sock option autodetection
- Run pkg-config only when pkg-config is found.

### Version 1.21.0 - Wed Apr 27 23:19:33 2016

- Refactored patch classes
- Supported new diff-based patches and regexp-based patches
- Added some default options for 5.3, 5.4, 5.5 and 5.6 separately
- Added BeforeConfigureTask and AfterConfigureTask to separate build phases.

Patches
- Added multiple-sapi patch for 5.3.29

### Version 1.20.8 - Sat Apr 23 01:41:37 2016

- Fixed openssl build issue on darwin https://github.com/phpbrew/phpbrew/issues/636
- Replaced ':' with `PATH_SEPARATOR` to make the path generation indenpendant.
- Few fixes

### Version 1.20.7 - Sun Apr 17 18:13:29 2016

- Commit e1fc2a4: Merge pull request #683 from Simplesmente/master

   add file README.pt-br.md and translating

- Commit 7ad9da5: Merge pull request #701 from zvook/master

   Network is unreachable php.net fix

- Commit f1fdd1d: Merge pull request #703 from jhdxr/develop

   fix issues about known command

- Commit 5ca79aa: Merge pull request #653 from jhdxr/feature/down

   refactor downloading related part ( #571 )

- Commit 1475c8c: Merge pull request #652 from jhdxr/feature/fish

   bugfix and improvements for fish

- Commit 2e41279: Merge pull request #637 from morozov/virtual-variant-value

   Do not override explicitly specified values with the default from virtual variants

### Version 1.20.6 - Fri Mar  4 13:41:32 2016

phpbrewrc:

- Improved .phpbrewrc searching effiency and fixed a bug related to $PWD.
- Added help message about enabling .phpbrewrc in init command.
- .phpbrewrc searching will be disabled by default and have to be enabled manually.

command improvement:
- Added arginfo to env command
- Fixed phar file for dump() function by updating package dependencies to avoid
  compiling packages from require-dev section (cliframework)
- Allow user value of variants contains dot character

fish:
- Added proper redirect to STDERR for Fish shell

### Version 1.20.4 - Mon Dec 14 19:37:01 2015

- Commit 2e41279: Merge pull request #637 from morozov/virtual-variant-value

   Do not override explicitly specified values with the default from virtual variants

- Commit 728ff9b: Merge pull request #634 from kurotaky/fix-phpbrew-bin-path-connection

   Does not connect the phpbrew bin path when `$PHPBREW_BIN` is blank

- Commit 3c5d6d8: Merge pull request #631 from Dexus/Dexus-patch-1

   Fix ReleaseList.php and Options forwarding

### Version 1.20.3 - Mon Dec  7 23:56:32 2015

- Fixed duplicated getBuild method in SystemCommandException
- Fixed class loading for symfony yaml component with new cliframework

### Version 1.20.2 - Mon Dec  7 09:15:23 2015

- added better php7 build support.
- fixed apxs2 patch for php7.
- improved travis-ci build speed.
- improved build process error message by dumping the last 5 lines of log to
  console directly.
- moved built phpbrew phar file into build/phpbrew
- created a symbol link 'phpbrew' under the root of project directory and make
  it pointing to 'build/phpbrew'

### Version 1.20.1 - Thu Jul 27 16:30:27 2015

- sensibly forces redownload when using wget #554
- adds MSSQL extension to php src bundled extensions list #551

### Version 1.20.0 - Thu Jul 16 00:11:58 2015

- Added php app store.

### Version 1.19.7 - Fri Jun 26 16:50:20 2015 -0300

- dries `ext clean` + gives status in all failure cases
- update completion
- fixes --old flag for known and update commands closes #526 improves
  description of --connect-timeout
- command download: update argument completion
- fix zsh completion: avoid single quote

Merged pull requests:

- Commit 060c6e0: Merge pull request #531 from jhdxr/fix/530

   update doc for known command, add --http-proxy and --http-proxy-auth

- Commit ae15d68: Merge pull request #525 from jhdxr/fix/524

   self-update download to a tmp file first instead of overwrite the exi…

### Version 1.19.1 - Tue May 19 23:05:20 2015

- Fixed OS X compatibility regarding `whereis -b` #503

### Version 1.19.0 - Mon May 18 21:17:13 2015

- PHP7 (next unstable version) install support
- Updadted completion scripts thanks to awesome CliFramework
- Fixed false failure of ./buildconf step
- Fixed PHP 5.3 error with JSON_PRETTY_PRINT
- Fixed phpbrew prepends $PATH on every cd command #487
- Deprecated php-releases.json use php.net json endpoint from now on
- Fix bug in variant parser #495
- List installed php versions in decrescent order
- Improved URL policy to locate older minor releases whenever URLs are altered
- Allow overriding PHP when runnning phpbrew #94

### Version 1.18.5 - Wed Apr 22 22:28:47 2015

- Always make sure phpbrew root/home exists for issue #475
- Added options to speicfy phpbrew root/home for install command.
- Fixed `use` command argument validation for supporting 'latest'
- Merged pull request #466 from vasiliy-pdk/error_during_tests_fix
- CONNECT_TIMEOUT env variable and --connect_timeout option was added. Fatal Error during tests fixed
- Added more variants to `+everything` #457
- Use log tail hint with "tail -F" instead of "tail -f"
- added support for SPL_Types extension install #456
- Use cp insteaad of mv on Makefile install task
- Removed redundant if statements in UrlDownloader.
- Merged pull request #444 from shinnya/fix/download_always_fai

### Version 1.15 - Tue Oct 14 20:23:54 2014

- Used CurlKit instead of command line curl or wget to download the distribution files.
- Added more options to the install command, added options:
  - `--no-clean`
  - `--no-install`
  - `--no-patch`
  - `--build-dir=DIR`
  - `--make-jobs=N` is now renamed to `--jobs=N`

  Please run `phpbrew help install` to see the details of the command options.

- Directory for the downloaded distribution files is now separated.
- date.timezone and phar.readonly ini file patch is fixed.
- Error redirection is now improved.
- Use JSON meta data for PHP releases.
- Added `--update` option to `known` command, this can update the release meta data:

    phpbrew known --update

- Improve command help generator.
- Since the release meta info is stored in the cache, known command is now faster.
- Included the multi-arch libdir fix.
- Use some of the default variants if `+default` is not set.
- Fix getoptionkit bug for variant parsing: https://github.com/phpbrew/phpbrew/issues/353
- Fix use, switch commands for switching to an aliased build.

Development updates:

- Variant info is refactored into BuildSettings class.
- VariantParser is refactored and simplified.
- Builder class is removed.
- Install command class is refactored with the `Build` class.
- Upgraded CLIFramework to 2.0.x
- Upgraded CurlKit to 1.0
- Upgraded PEARX 1.0.3 to fix 404 page not found when distribution file does not exist.

### Version 1.12 - Wed Dec 11 09:56:22 2013

- Install command now run commands below after installations:

    pear config-set temp_dir $HOME/.phpbrew/tmp/pear/temp
    pear config-set cache_dir $HOME/.phpbrew/tmp/pear/cache_dir
    pear config-set download_dir $HOME/.phpbrew/tmp/pear/download_dir
    pear config-set auto_discover 1

### Version 1.11.3 - Sun Dec  8 14:38:14 2013

- Fixed libdir detection
- Enabled `xml` variant by default
- Renamed `xml_all` variant to xml
- Fix +iconv variant ( --with-iconv=/usr won't be compiled on systems with gnu iconv  )
- Fix +gd variant ( --with-gd=/usr won't be compiled, --with-gd=shared,$prefix works)

### Version 1.11 - Wed Dec  4 13:28:00 2013

- Added platform prefix setup command:

        phpbrew lookup-prefix macports
        phpbrew lookup-prefix homebrew
        phpbrew lookup-prefix debian

- Variant builder is improved with the lookup-prefix
- Better path detection.
- Freetype include path fix for +gd variant

        +gd=shared should work for Mac OS platform

- platform libdir is supported, now supports for include/lib paths under

        $prefix/i386-linux-gnu/
        $prefix/x86_64-linux-gnu/

### Version 1.10 - Tue Dec  3 22:55:22 2013

- Added 'opcache' variant.
- Added fpm management support.
- Added quick commands to switch between directories.
- Added phpbrew/bin directory to install shared executables, e.g. composer, phpunit, onion ...etc

### Version 1.8.22 - Mon Nov 18 17:23:29 2013

- Copy php-fpm default config to {php-version}/etc/

### Version 1.8.3 - Sat Mar  9 19:38:22 2013

- Add new extension installer.
- Fix extension enable feature.
- Refactor installation tasks to task classes.
- Can save variant information.
- Show variants and options when listing phps
- Provide a patch for php5.3 msgformat libstdc++ bug on 64bit machines.

### Version 1.3.3 - 一  4/30 11:27:09 2012

- Added posix variant.
- Added calendar variant.
- Improve install-ext command.

### Version 1.3.1 - 三  3/14 02:20:08 2012

- Fixed bash shell redirection bug.
- Added install-ext command.
- Added iconv variant.
- Added PHP version info prompt.

### Version 1.2.0 - 二  3/ 6 10:50:51 2012

- SAPI confliction check.
- show tail command usage.
- pipe error and stdout to build.log.
- show default variants with star.
- Add bz2, fpm, cgi, cli variants.

### Version 1.1.0

- openssl variant
- variant command
- self-update command


text:
//
//  QQTextView.m
//  Teacher
//
//  Created by tlt on 16/11/4.
//  Copyright © 2016年 tlt. All rights reserved.
//

#import "QQTextView.h"

#define RGB(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
@implementation QQTextView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self initialize];
    }
    return self;
}
- (void)initialize
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:UITextViewTextDidChangeNotification object:nil];
    _maxLength = NSUIntegerMax;
    // 设置默认字体
    self.font = [UIFont systemFontOfSize:12];

    // 设置默认颜色
    self.placeholderColor = RGB(200, 199, 204);

}
- (void)awakeFromNib
{
    [super awakeFromNib];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textDidChange:) name:UITextViewTextDidChangeNotification object:nil];
    _maxLength = NSUIntegerMax;
    // 设置默认字体
    self.font = [UIFont systemFontOfSize:12];

    // 设置默认颜色
    self.placeholderColor = RGB(200, 199, 204);
}
- (void)textDidChange:(NSNotification *)notification
{
    if (_maxLength != NSUIntegerMax) {
        NSString    *toBeString    = self.text;

        if (!self.markedTextRange) {
            if (toBeString.length >_maxLength) {
                self.text = [toBeString substringToIndex:_maxLength]; // 截取最大限制字符数.
                [self resignFirstResponder];
            }
        }
    }
    // 会重新调用drawRect:方法
    [self setNeedsDisplay];
}
- (void)dealloc {
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}
/**
 * 每次调用drawRect:方法,都会将以前画的东西清除掉
 */
- (void)drawRect:(CGRect)rect
{
    // 如果有文字,就直接返回,不需要画占位文字
    if (self.hasText) return;

    // 属性
    NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
    attrs[NSFontAttributeName] = self.font;
    attrs[NSForegroundColorAttributeName] = self.placeholderColor;

    // 画文字
    rect.origin.x = 5;
    rect.origin.y = 8;
    rect.size.width -= 2 * rect.origin.x;
    [self.placeholder drawInRect:rect withAttributes:attrs];
}

- (void)layoutSubviews
{
    [super layoutSubviews];

    [self setNeedsDisplay];
}

#pragma mark - setter
- (void)setPlaceholder:(NSString *)placeholder
{
    _placeholder = [placeholder copy];

    [self setNeedsDisplay];
}

- (void)setPlaceholderColor:(UIColor *)placeholderColor
{
    _placeholderColor = placeholderColor;

    [self setNeedsDisplay];
}

- (void)setFont:(UIFont *)font
{
    [super setFont:font];

    [self setNeedsDisplay];
}

- (void)setText:(NSString *)text
{
    [super setText:text];

    [self setNeedsDisplay];
}

- (void)setAttributedText:(NSAttributedString *)attributedText
{
    [super setAttributedText:attributedText];

    [self setNeedsDisplay];
}
@end

redpajama_set_name: RedPajamaGithub


text:
package main

import (
	"encoding/json"
	"fmt"

	"github.com/codegangsta/cli"
)

var statsCommand = cli.Command{
	Name:  "stats",
	Usage: "display statistics for the container",
	Flags: []cli.Flag{
		cli.StringFlag{Name: "id", Value: "nsinit", Usage: "specify the ID for a container"},
	},
	Action: func(context *cli.Context) {
		container, err := getContainer(context)
		if err != nil {
			fatal(err)
		}
		stats, err := container.Stats()
		if err != nil {
			fatal(err)
		}
		data, err := json.MarshalIndent(stats, "", "\t")
		if err != nil {
			fatal(err)
		}
		fmt.Printf("%s", data)
	},
}


text:
package org.basex.query.util.fingertree;

/**
 * A slice of a finger tree, used as internal representation
 * for {@link FingerTree#slice(long, long)}.
 *
 * @author BaseX Team 2005-15, BSD License
 * @author Leo Woerteler
 *
 * @param <N> node type
 * @param <E> element type
 */
public final class TreeSlice<N, E> {
  /** A full sub-tree. */
  private FingerTree<N, E> tree;
  /** A partial node. */
  private NodeLike<N, E> partial;

  /**
   * Constructor for whole trees.
   * @param tree the tree
   */
  TreeSlice(final FingerTree<N, E> tree) {
    setTree(tree);
  }

  /**
   * Constructor for potentially partial nodes.
   * @param partial partial node
   */
  TreeSlice(final NodeLike<N, E> partial) {
    setNodeLike(partial);
  }

  /**
   * Checks if this slice contains a full finger tree.
   * @return {@code true} if this slice contains a full tree,
   *     {@code false} if it contains a partial node
   */
  public boolean isTree() {
    return tree != null;
  }

  /**
   * Getter for a contained full tree, should only be called if {@link #isTree()}
   * returns {@code true}.
   * @return the contained tree
   */
  public FingerTree<N, E> getTree() {
    return tree;
  }

  /**
   * Getter for a contained partial node, should only be called if {@link #isTree()}
   * returns {@code false}.
   * @return the contained partial node
   */
  public NodeLike<N, E> getPartial() {
    return partial;
  }

  /**
   * Sets the contents of this slice to the given tree and returns it with the correct type.
   * The value with the current type is invalid afterwards and should not be used.
   * @param <M> new node type
   * @param newTree the new contents
   * @return type-cast version of this slice
   */
  <M> TreeSlice<M, E> setTree(final FingerTree<M, E> newTree) {
    @SuppressWarnings("unchecked")
    final TreeSlice<M, E> out = (TreeSlice<M, E>) this;
    out.partial = null;
    out.tree = newTree;
    return out;
  }

  /**
   * Sets the contents of this slice to the given node and returns it with the correct type.
   * The value with the current type is invalid afterwards and should not be used.
   * @param <M> new node type
   * @param newNode new contents
   * @return type-cast version of this slice
   */
  <M> TreeSlice<M, E> setNodeLike(final NodeLike<M, E> newNode) {
    @SuppressWarnings("unchecked")
    final TreeSlice<M, E> out = (TreeSlice<M, E>) this;
    if(newNode instanceof Node) {
      out.partial = null;
      out.tree = new SingletonTree<>((Node<M, E>) newNode);
    } else {
      out.partial = newNode;
      out.tree = null;
    }
    return out;
  }

  /**
   * Populates this slice with the contents of the given node buffer.
   * @param <M> node type
   * @param arr node buffer
   * @param n number of nodes in the buffer
   * @param size number of elements in the buffer
   * @return type-cast version of this slice
   */
  <M> TreeSlice<M, E> setNodes(final NodeLike<M, E>[] arr, final int n, final long size) {
    if(n == 0) return setTree(EmptyTree.<M, E>getInstance());
    if(n == 1) return setNodeLike(arr[0]);
    final int mid = n / 2;
    final Node<M, E>[] left = DeepTree.slice(arr, 0, mid), right = DeepTree.slice(arr, mid, n);
    return setTree(DeepTree.get(left, right, size));
  }
}


text:
package edu.ucsc;

import java.util.*;

/***
* BED format provides a flexible way to define the data lines that are displayed in an annotation track.
* BED lines have three required fields and nine additional optional fields. The number of fields per line
* must be consistent throughout any single set of data in an annotation track. The order of the optional
* fields is binding: lower-numbered fields must always be populated if higher-numbered fields are used.
*
* The first three required BED fields are:
*

* chrom - The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671).
* chromStart - The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0.
* chromEnd - The ending position of the feature in the chromosome or scaffold. The chromEnd base is not
* included in the display of the feature. For example, the first 100 bases of a chromosome are defined
* as chromStart=0, chromEnd=100, and span the bases numbered 0-99.
* The 9 additional optional BED fields are:
*
* name - Defines the name of the BED line. This label is displayed to the left of the BED line in the
*        Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode.
* score -A score between 0 and 1000. If the track line useScore attribute is set to 1 for this
*        annotation data set, the score value will determine the level of gray in which this feature is displayed
* strand - Defines the strand - either '+' or '-'.
* thickStart - The starting position at which the feature is drawn thickly (for example, the start codon in gene displays).
* thickEnd - The ending position at which the feature is drawn thickly (for example, the stop codon in gene displays).
* itemRgb - An RGB value of the form R,G,B (e.g. 255,0,0). If the track line itemRgb attribute is set to "On",
* blockCount - The number of blocks (exons) in the BED line.
* blockSizes - A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.
* blockStarts - A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart.
*               The number of items in this list should correspond to blockCount.
*

* Example:

* Here's an example of an annotation track that uses a complete BED definition:

*

* track name=pairedReads description="Clone Paired Reads" useScore=1
* chr22 1000 5000 cloneA 960 + 1000 5000 0 2 567,488, 0,3512
* chr22 2000 6000 cloneB 900 - 2000 6000 0 2 433,399, 0,3601
*

*
*/

/***
* Example from Epigenomics dataset.. 8,605,199 lines.
*

* chr1    470     505     03_6:4:53:1761:816      1       +       0       0       255,0,0
* chr1    532     567     03_6:4:1:1544:1961      1       +       0       0       255,0,0
* chr1    2919    2954    03_6:4:95:1219:564      1       -       0       0       0,0,255
* chr1    4779    4814    03_6:4:72:1779:1880     1       +       0       0       255,0,0
* chr1    4782    4817    03_6:4:49:190:1071      1       -       0       0       0,0,255
* chr1    5222    5257    03_6:4:12:494:1872      1       -       0       0       0,0,255
* chr1    6037    6072    03_6:4:60:810:1740      1       -       0       0       0,0,255
*

*/

/***
*  A single item in a bed graph.  This is called simply Bed in the kent codebase
*  since it's a linked list and there is no separation between a single bed item and
*  a whole list of them.

*
*  Space is an issue, and someday I may want to do something more space efficient.

*
*  As it is, I am only implementing the fields I use.  If/when I add the other fields,
*  then I'll have to pay more attention to space.  Currently, this should take about
*  14+8 = 22 bytes/Item.   So, a typical 10 million entry ChIP-seq bed graph might take
*  220MB. So on a reasonable laptop, one could load two of these graphs and intersect
*  them, say.

*
*/

// TODO:  Make this inherit from BedGraphItem and have a separate BedGraph
//        in order to use less space when extra space not needed. Maybe make
//        BedGraphItem inherit from Coords.

public class BedItem {

	public byte chromID;         // 4 bytes
	public int  chromStart;      // 4 bytes
	public int  chromEnd;        // 4 bytes
	public byte score;          // 1 byte
	public byte strand;         // 1 byte

	// There are only a few actual chromosome IDs, so rather than save the
	// whole string over and over, just save a smaller ID for the string and look
	// it up as needed.
	static Map<Byte,String> id2Chrom = new HashMap<Byte,String>();
	static Map<String,Byte> chrom2ID = new HashMap<String,Byte>();
	static byte nextChromID = 0;

	public BedItem(String line) {
		this.parseLine(line);
	}

	public String toString() {
		String val = chromID+"\t"+chromStart+"\t"+chromEnd+"\t"+score+"\t"+((char)strand);
		return(val);
	}

	public String toCoords(){
	  String chrom = id2Chrom.get(chromID);
	  String val = chrom+"\t"+chromStart+"\t"+chromEnd;
		return(val);
	}

	public String toBedGraph(){
	  String chrom = id2Chrom.get(chromID);
	  String val = chrom+"\t"+chromStart+"\t"+chromEnd+"\t"+score;
		return(val);
	}

	public String toMinimalBed(){
	  String chrom = id2Chrom.get(chromID);
	  String val = chrom+"\t"+chromStart+"\t"+chromEnd+"\tNAME\t"+score+"\t"+((char)strand);
		return(val);
	}

	/***
	* Create a BitVector containing the information from one bed entry.
	*/
	public BedItem(String chrom,int chromStart,int chromEnd, int score,char strand) {
	  setChromID(chrom);
		this.chromStart = chromStart;
		this.chromEnd = chromEnd;
		this.score = (byte)score;
		this.strand = (byte)strand;
	}

	/***
	* Sets the chromosome ID by looking up the chrom in the map.
	* This trades some speed for space efficiency.
	*/
	public void setChromID(String chrom){
			// just save an ID for the chromosome
		this.chromID = (byte) nextChromID;
		if (chrom2ID.containsKey(chrom)) this.chromID = chrom2ID.get(chrom);
		else {
			byte id = nextChromID;
			nextChromID++;
			chrom2ID.put(chrom,id);
			id2Chrom.put(id,chrom);
		}
	}

	public static int getChromID(String chrom){
	  return(chrom2ID.get(chrom));
	}

	/***
	* parses a single line from a bed file, returning a single BedItem
	*/
	public void parseLine(String line) {
		String[] fields = line.split("\t");
		String chr = fields[0];
		setChromID(chr);
		this.chromStart = Integer.parseInt(fields[1]);
		this.chromEnd = Integer.parseInt(fields[2]);
		this.score = (byte) Integer.parseInt(fields[4]);
		this.strand = (byte) fields[5].charAt(0);
	}

}

// time testscripts/bedtest data/BI.H3K27me3.bed

// time ./testscripts/bedtest.groovy full/BI.H3K4me3.bed
// Reading full/BI.H3K4me3.bed...done.
// Bed size: 6655339
// real	0m26.612s
//
// 475MB file, effective throughput: 18MB/sec.


text:
package org.apache.commons.collections4.queue;

import java.util.LinkedList;
import java.util.Queue;

import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
 * Extension of {@link AbstractQueueTest} for exercising the {@link SynchronizedQueue} implementation.
 *
 * @since 4.2
 */
public class SynchronizedQueueTest<T> extends AbstractQueueTest<T> {

    public static junit.framework.Test suite() {
        return BulkTest.makeSuite(SynchronizedQueueTest.class);
    }

    public SynchronizedQueueTest() {
        super(SynchronizedQueueTest.class.getSimpleName());
    }

    @Override
    public String getCompatibilityVersion() {
        return "4.2";
    }

    @Override
    public Queue<T> makeObject() {
        return SynchronizedQueue.synchronizedQueue(new LinkedList<T>());
    }

    @Test
    @Disabled("Run once")
    public void testCreate() throws Exception {
        Queue<T> queue = makeObject();
        writeExternalFormToDisk((java.io.Serializable) queue,
            BulkTest.TEST_DATA_PATH + "SynchronizedQueue.emptyCollection.version4.2.obj");
        queue = makeFullCollection();
        writeExternalFormToDisk((java.io.Serializable) queue,
            BulkTest.TEST_DATA_PATH + "SynchronizedQueue.fullCollection.version4.2.obj");
    }

}


text:
package com.amazonaws.services.cloudfront.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *

 * A complex type that controls:
 *

 *

 *

 *

 * Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning
 * the response to the viewer.
 *

 *

 *

 *

 * How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
 *

 *

 *

 *

 * For more information about custom error pages, see Customizing Error
 * Responses in the Amazon CloudFront Developer Guide.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CustomErrorResponse implements Serializable, Cloneable {

    /**
     *

     * The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     *

     */
    private Integer errorCode;
    /**
     *

     * The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the
     * HTTP status code specified by ErrorCode, for example, /4xx-errors/403-forbidden.html.
     * If you want to store your objects and your custom error pages in different locations, your distribution must
     * include a cache behavior for which the following is true:
     *

     *

     *

     *

     * The value of PathPattern matches the path to your custom error messages. For example, suppose you
     * saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors.
     * Your distribution must include a cache behavior for which the path pattern routes requests for your custom error
     * pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     * The value of TargetOriginId specifies the value of the ID element for the origin that
     * contains your custom error pages.
     *

     *

     *

     *

     * If you specify a value for ResponsePagePath, you must also specify a value for
     * ResponseCode.
     *

     *

     * We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP
     * server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to
     * viewers because the origin server is unavailable.
     *

     */
    private String responsePagePath;
    /**
     *

     * The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are
     * a variety of reasons that you might want CloudFront to return a status code different from the status code that
     * your origin returned to CloudFront, for example:
     *

     *

     *

     *

     * Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent
     * the response from being returned to the viewer. If you substitute 200, the response typically won't
     * be intercepted.
     *

     *

     *

     *

     * If you don't care about distinguishing among different client errors or server errors, you can specify
     * 400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     * You might want to return a 200 status code (OK) and static website so your customers don't know that
     * your website is down.
     *

     *

     *

     *

     * If you specify a value for ResponseCode, you must also specify a value for
     * ResponsePagePath.
     *

     */
    private String responseCode;
    /**
     *

     * The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in
     * ErrorCode. When this time period has elapsed, CloudFront queries your origin to see whether the
     * problem that caused the error has been resolved and the requested object is now available.
     *

     *

     * For more information, see Customizing
     * Error Responses in the Amazon CloudFront Developer Guide.
     *

     */
    private Long errorCachingMinTTL;

    /**
     *

     * The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     *

     *
     * @param errorCode
     *        The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     */

    public void setErrorCode(Integer errorCode) {
        this.errorCode = errorCode;
    }

    /**
     *

     * The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     *

     *
     * @return The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     */

    public Integer getErrorCode() {
        return this.errorCode;
    }

    /**
     *

     * The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     *

     *
     * @param errorCode
     *        The HTTP status code for which you want to specify a custom error page and/or a caching duration.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CustomErrorResponse withErrorCode(Integer errorCode) {
        setErrorCode(errorCode);
        return this;
    }

    /**
     *

     * The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the
     * HTTP status code specified by ErrorCode, for example, /4xx-errors/403-forbidden.html.
     * If you want to store your objects and your custom error pages in different locations, your distribution must
     * include a cache behavior for which the following is true:
     *

     *

     *

     *

     * The value of PathPattern matches the path to your custom error messages. For example, suppose you
     * saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors.
     * Your distribution must include a cache behavior for which the path pattern routes requests for your custom error
     * pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     * The value of TargetOriginId specifies the value of the ID element for the origin that
     * contains your custom error pages.
     *

     *

     *

     *

     * If you specify a value for ResponsePagePath, you must also specify a value for
     * ResponseCode.
     *

     *

     * We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP
     * server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to
     * viewers because the origin server is unavailable.
     *

     *
     * @param responsePagePath
     *        The path to the custom error page that you want CloudFront to return to a viewer when your origin returns
     *        the HTTP status code specified by ErrorCode, for example,
     *        /4xx-errors/403-forbidden.html. If you want to store your objects and your custom error pages
     *        in different locations, your distribution must include a cache behavior for which the following is
     *        true:

     *

     *

     *

     *        The value of PathPattern matches the path to your custom error messages. For example, suppose
     *        you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named
     *        /4xx-errors. Your distribution must include a cache behavior for which the path pattern
     *        routes requests for your custom error pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     *        The value of TargetOriginId specifies the value of the ID element for the origin
     *        that contains your custom error pages.
     *

     *

     *

     *

     *        If you specify a value for ResponsePagePath, you must also specify a value for
     *        ResponseCode.
     *

     *

     *        We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on
     *        an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to
     *        return to viewers because the origin server is unavailable.
     */

    public void setResponsePagePath(String responsePagePath) {
        this.responsePagePath = responsePagePath;
    }

    /**
     *

     * The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the
     * HTTP status code specified by ErrorCode, for example, /4xx-errors/403-forbidden.html.
     * If you want to store your objects and your custom error pages in different locations, your distribution must
     * include a cache behavior for which the following is true:
     *

     *

     *

     *

     * The value of PathPattern matches the path to your custom error messages. For example, suppose you
     * saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors.
     * Your distribution must include a cache behavior for which the path pattern routes requests for your custom error
     * pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     * The value of TargetOriginId specifies the value of the ID element for the origin that
     * contains your custom error pages.
     *

     *

     *

     *

     * If you specify a value for ResponsePagePath, you must also specify a value for
     * ResponseCode.
     *

     *

     * We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP
     * server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to
     * viewers because the origin server is unavailable.
     *

     *
     * @return The path to the custom error page that you want CloudFront to return to a viewer when your origin returns
     *         the HTTP status code specified by ErrorCode, for example,
     *         /4xx-errors/403-forbidden.html. If you want to store your objects and your custom error
     *         pages in different locations, your distribution must include a cache behavior for which the following is
     *         true:

     *

     *

     *

     *         The value of PathPattern matches the path to your custom error messages. For example,
     *         suppose you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named
     *         /4xx-errors. Your distribution must include a cache behavior for which the path pattern
     *         routes requests for your custom error pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     *         The value of TargetOriginId specifies the value of the ID element for the
     *         origin that contains your custom error pages.
     *

     *

     *

     *

     *         If you specify a value for ResponsePagePath, you must also specify a value for
     *         ResponseCode.
     *

     *

     *         We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on
     *         an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want
     *         to return to viewers because the origin server is unavailable.
     */

    public String getResponsePagePath() {
        return this.responsePagePath;
    }

    /**
     *

     * The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the
     * HTTP status code specified by ErrorCode, for example, /4xx-errors/403-forbidden.html.
     * If you want to store your objects and your custom error pages in different locations, your distribution must
     * include a cache behavior for which the following is true:
     *

     *

     *

     *

     * The value of PathPattern matches the path to your custom error messages. For example, suppose you
     * saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named /4xx-errors.
     * Your distribution must include a cache behavior for which the path pattern routes requests for your custom error
     * pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     * The value of TargetOriginId specifies the value of the ID element for the origin that
     * contains your custom error pages.
     *

     *

     *

     *

     * If you specify a value for ResponsePagePath, you must also specify a value for
     * ResponseCode.
     *

     *

     * We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP
     * server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to
     * viewers because the origin server is unavailable.
     *

     *
     * @param responsePagePath
     *        The path to the custom error page that you want CloudFront to return to a viewer when your origin returns
     *        the HTTP status code specified by ErrorCode, for example,
     *        /4xx-errors/403-forbidden.html. If you want to store your objects and your custom error pages
     *        in different locations, your distribution must include a cache behavior for which the following is
     *        true:

     *

     *

     *

     *        The value of PathPattern matches the path to your custom error messages. For example, suppose
     *        you saved custom error pages for 4xx errors in an Amazon S3 bucket in a directory named
     *        /4xx-errors. Your distribution must include a cache behavior for which the path pattern
     *        routes requests for your custom error pages to that location, for example, /4xx-errors/*.
     *

     *

     *

     *

     *        The value of TargetOriginId specifies the value of the ID element for the origin
     *        that contains your custom error pages.
     *

     *

     *

     *

     *        If you specify a value for ResponsePagePath, you must also specify a value for
     *        ResponseCode.
     *

     *

     *        We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on
     *        an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to
     *        return to viewers because the origin server is unavailable.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CustomErrorResponse withResponsePagePath(String responsePagePath) {
        setResponsePagePath(responsePagePath);
        return this;
    }

    /**
     *

     * The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are
     * a variety of reasons that you might want CloudFront to return a status code different from the status code that
     * your origin returned to CloudFront, for example:
     *

     *

     *

     *

     * Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent
     * the response from being returned to the viewer. If you substitute 200, the response typically won't
     * be intercepted.
     *

     *

     *

     *

     * If you don't care about distinguishing among different client errors or server errors, you can specify
     * 400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     * You might want to return a 200 status code (OK) and static website so your customers don't know that
     * your website is down.
     *

     *

     *

     *

     * If you specify a value for ResponseCode, you must also specify a value for
     * ResponsePagePath.
     *

     *
     * @param responseCode
     *        The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
     *        There are a variety of reasons that you might want CloudFront to return a status code different from the
     *        status code that your origin returned to CloudFront, for example:

     *

     *

     *

     *        Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and
     *        prevent the response from being returned to the viewer. If you substitute 200, the response
     *        typically won't be intercepted.
     *

     *

     *

     *

     *        If you don't care about distinguishing among different client errors or server errors, you can specify
     *        400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     *        You might want to return a 200 status code (OK) and static website so your customers don't
     *        know that your website is down.
     *

     *

     *

     *

     *        If you specify a value for ResponseCode, you must also specify a value for
     *        ResponsePagePath.
     */

    public void setResponseCode(String responseCode) {
        this.responseCode = responseCode;
    }

    /**
     *

     * The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are
     * a variety of reasons that you might want CloudFront to return a status code different from the status code that
     * your origin returned to CloudFront, for example:
     *

     *

     *

     *

     * Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent
     * the response from being returned to the viewer. If you substitute 200, the response typically won't
     * be intercepted.
     *

     *

     *

     *

     * If you don't care about distinguishing among different client errors or server errors, you can specify
     * 400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     * You might want to return a 200 status code (OK) and static website so your customers don't know that
     * your website is down.
     *

     *

     *

     *

     * If you specify a value for ResponseCode, you must also specify a value for
     * ResponsePagePath.
     *

     *
     * @return The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
     *         There are a variety of reasons that you might want CloudFront to return a status code different from the
     *         status code that your origin returned to CloudFront, for example:

     *

     *

     *

     *         Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and
     *         prevent the response from being returned to the viewer. If you substitute 200, the response
     *         typically won't be intercepted.
     *

     *

     *

     *

     *         If you don't care about distinguishing among different client errors or server errors, you can specify
     *         400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     *         You might want to return a 200 status code (OK) and static website so your customers don't
     *         know that your website is down.
     *

     *

     *

     *

     *         If you specify a value for ResponseCode, you must also specify a value for
     *         ResponsePagePath.
     */

    public String getResponseCode() {
        return this.responseCode;
    }

    /**
     *

     * The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are
     * a variety of reasons that you might want CloudFront to return a status code different from the status code that
     * your origin returned to CloudFront, for example:
     *

     *

     *

     *

     * Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent
     * the response from being returned to the viewer. If you substitute 200, the response typically won't
     * be intercepted.
     *

     *

     *

     *

     * If you don't care about distinguishing among different client errors or server errors, you can specify
     * 400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     * You might want to return a 200 status code (OK) and static website so your customers don't know that
     * your website is down.
     *

     *

     *

     *

     * If you specify a value for ResponseCode, you must also specify a value for
     * ResponsePagePath.
     *

     *
     * @param responseCode
     *        The HTTP status code that you want CloudFront to return to the viewer along with the custom error page.
     *        There are a variety of reasons that you might want CloudFront to return a status code different from the
     *        status code that your origin returned to CloudFront, for example:

     *

     *

     *

     *        Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and
     *        prevent the response from being returned to the viewer. If you substitute 200, the response
     *        typically won't be intercepted.
     *

     *

     *

     *

     *        If you don't care about distinguishing among different client errors or server errors, you can specify
     *        400 or 500 as the ResponseCode for all 4xx or 5xx errors.
     *

     *

     *

     *

     *        You might want to return a 200 status code (OK) and static website so your customers don't
     *        know that your website is down.
     *

     *

     *

     *

     *        If you specify a value for ResponseCode, you must also specify a value for
     *        ResponsePagePath.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CustomErrorResponse withResponseCode(String responseCode) {
        setResponseCode(responseCode);
        return this;
    }

    /**
     *

     * The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in
     * ErrorCode. When this time period has elapsed, CloudFront queries your origin to see whether the
     * problem that caused the error has been resolved and the requested object is now available.
     *

     *

     * For more information, see Customizing
     * Error Responses in the Amazon CloudFront Developer Guide.
     *

     *
     * @param errorCachingMinTTL
     *        The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified
     *        in ErrorCode. When this time period has elapsed, CloudFront queries your origin to see
     *        whether the problem that caused the error has been resolved and the requested object is now available.

     *

     *        For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
     */

    public void setErrorCachingMinTTL(Long errorCachingMinTTL) {
        this.errorCachingMinTTL = errorCachingMinTTL;
    }

    /**
     *

     * The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in
     * ErrorCode. When this time period has elapsed, CloudFront queries your origin to see whether the
     * problem that caused the error has been resolved and the requested object is now available.
     *

     *

     * For more information, see Customizing
     * Error Responses in the Amazon CloudFront Developer Guide.
     *

     *
     * @return The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified
     *         in ErrorCode. When this time period has elapsed, CloudFront queries your origin to see
     *         whether the problem that caused the error has been resolved and the requested object is now
     *         available.

     *

     *         For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
     */

    public Long getErrorCachingMinTTL() {
        return this.errorCachingMinTTL;
    }

    /**
     *

     * The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in
     * ErrorCode. When this time period has elapsed, CloudFront queries your origin to see whether the
     * problem that caused the error has been resolved and the requested object is now available.
     *

     *

     * For more information, see Customizing
     * Error Responses in the Amazon CloudFront Developer Guide.
     *

     *
     * @param errorCachingMinTTL
     *        The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified
     *        in ErrorCode. When this time period has elapsed, CloudFront queries your origin to see
     *        whether the problem that caused the error has been resolved and the requested object is now available.

     *

     *        For more information, see Customizing Error Responses in the Amazon CloudFront Developer Guide.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CustomErrorResponse withErrorCachingMinTTL(Long errorCachingMinTTL) {
        setErrorCachingMinTTL(errorCachingMinTTL);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getErrorCode() != null)
            sb.append("ErrorCode: ").append(getErrorCode()).append(",");
        if (getResponsePagePath() != null)
            sb.append("ResponsePagePath: ").append(getResponsePagePath()).append(",");
        if (getResponseCode() != null)
            sb.append("ResponseCode: ").append(getResponseCode()).append(",");
        if (getErrorCachingMinTTL() != null)
            sb.append("ErrorCachingMinTTL: ").append(getErrorCachingMinTTL());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CustomErrorResponse == false)
            return false;
        CustomErrorResponse other = (CustomErrorResponse) obj;
        if (other.getErrorCode() == null ^ this.getErrorCode() == null)
            return false;
        if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == false)
            return false;
        if (other.getResponsePagePath() == null ^ this.getResponsePagePath() == null)
            return false;
        if (other.getResponsePagePath() != null && other.getResponsePagePath().equals(this.getResponsePagePath()) == false)
            return false;
        if (other.getResponseCode() == null ^ this.getResponseCode() == null)
            return false;
        if (other.getResponseCode() != null && other.getResponseCode().equals(this.getResponseCode()) == false)
            return false;
        if (other.getErrorCachingMinTTL() == null ^ this.getErrorCachingMinTTL() == null)
            return false;
        if (other.getErrorCachingMinTTL() != null && other.getErrorCachingMinTTL().equals(this.getErrorCachingMinTTL()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode());
        hashCode = prime * hashCode + ((getResponsePagePath() == null) ? 0 : getResponsePagePath().hashCode());
        hashCode = prime * hashCode + ((getResponseCode() == null) ? 0 : getResponseCode().hashCode());
        hashCode = prime * hashCode + ((getErrorCachingMinTTL() == null) ? 0 : getErrorCachingMinTTL().hashCode());
        return hashCode;
    }

    @Override
    public CustomErrorResponse clone() {
        try {
            return (CustomErrorResponse) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
import { Injectable } from "@angular/core";
import * as moment from "moment";

@Injectable()
export class MonthService {
  private range(size: Number): Number[] {
    return Array(size)
      .fill(0)
      .map((_, i) => i + 1);
  }

  get(currentMonth: moment.Moment): moment.Moment[] {
    const currentMonthStripped = moment([
      currentMonth.year(),
      currentMonth.month(),
      1
    ]);
    const startMonth = currentMonthStripped
      .subtract(1, "years")
      .subtract(1, "months");

    return this.range(36).map(offset =>
      startMonth.clone().add(offset.toString(), "months")
    );
  }
}


text:
/**
 *+
 *	ATimeTest.java
 *	1.0.0  Oct 1, 2014  Leo Hinterlang
 *-
 */
package com.fidelis.valface;

import static org.junit.Assert.*;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;

/**
 * ATimeTest
 *
 * @version 1.0.0
 * @author Leo Hinterlang
 *
 */
public class ATimeTest {

	@Rule public TestName testName = new TestName();

	private boolean passed;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp () throws Exception {
		String test = testName.getMethodName();
		System.out.printf("Testing: " + test);
		for (int n = test.length(); n < 30; n++) {
			System.out.print('.');
		}
		passed = false;
	}
	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown () throws Exception {
		 System.out.println(passed ? " passed" : " failed ***");
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#getHour()}.
	 */
	@Test
	public void testGetHour () {
		ATime time = ATime.of(12, 34);
		assertEquals(12, time.getHour());
		time = ATime.of(0, 44);
		assertEquals(0, time.getHour());
		time = ATime.of(23, 18);
		assertEquals(23, time.getHour());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#getMinute()}.
	 */
	@Test
	public void testGetMinute () {
		ATime time = ATime.of(12, 34);
		assertEquals(34, time.getMinute());
		time = ATime.of(0, 44);
		assertEquals(44, time.getMinute());
		time = ATime.of(23, 0);
		assertEquals(0, time.getMinute());
		time = ATime.of(14, 59);
		assertEquals(59, time.getMinute());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#getSecond()}.
	 */
	@Test
	public void testGetSecond () {
		ATime time = ATime.of(12, 34, 56);
		assertEquals(56, time.getSecond());
		time = ATime.of(0, 0, 5);
		assertEquals(5, time.getSecond());
		time = ATime.of(1, 2, 0);
		assertEquals(0, time.getSecond());
		time = ATime.of(17, 30);
		assertEquals(0, time.getSecond());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#getNano()}.
	 */
	@Test
	public void testGetNano () {
		ATime time = ATime.of(12, 34, 56, 7890);
		assertEquals(7890, time.getNano());
		time = ATime.of(0, 44, 0, 212313414);
		assertEquals(212313414, time.getNano());
		time = ATime.of(1, 2, 3);
		assertEquals(0, time.getNano());
		time = ATime.of(7, 23, 14, 0);
		assertEquals(0, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#of(int, int, int, int)}.
	 */
	@Test
	public void testOfIntIntIntInt () {
		ATime time = ATime.of(12, 34, 56, 7890);
		assertEquals(12, time.getHour());
		assertEquals(34, time.getMinute());
		assertEquals(56, time.getSecond());
		assertEquals(7890, time.getNano());
		time = ATime.of(23, 59, 59, 999999999);
		assertEquals(23, time.getHour());
		assertEquals(59, time.getMinute());
		assertEquals(59, time.getSecond());
		assertEquals(999999999, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#of(int, int, int)}.
	 */
	@Test
	public void testOfIntIntInt () {
		ATime time = ATime.of(12, 34, 56);
		assertEquals(12, time.getHour());
		assertEquals(34, time.getMinute());
		assertEquals(56, time.getSecond());
		assertEquals(0, time.getNano());
		time = ATime.of(23, 59, 59);
		assertEquals(23, time.getHour());
		assertEquals(59, time.getMinute());
		assertEquals(59, time.getSecond());
		assertEquals(0, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#of(int, int)}.
	 */
	@Test
	public void testOfIntInt () {
		ATime time = ATime.of(12, 34);
		assertEquals(12, time.getHour());
		assertEquals(34, time.getMinute());
		assertEquals(0, time.getSecond());
		assertEquals(0, time.getNano());
		time = ATime.of(23, 59);
		assertEquals(23, time.getHour());
		assertEquals(59, time.getMinute());
		assertEquals(0, time.getSecond());
		assertEquals(0, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#ofNanoOfDay(long)}.
	 */
	@Test
	public void testOfNanoOfDay () {
		long nanos = (14 * 3600 + 37 * 60 + 49) * 1000000000L + 987654321L;
		ATime time = ATime.ofNanoOfDay(nanos);
		assertEquals(14, time.getHour());
		assertEquals(37, time.getMinute());
		assertEquals(49, time.getSecond());
		assertEquals(987654321, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#ofSecondOfDay(long)}.
	 */
	@Test
	public void testOfSecondOfDay () {
		ATime time = ATime.ofSecondOfDay(14 * 3600 + 37 * 60 + 49);
		assertEquals(14, time.getHour());
		assertEquals(37, time.getMinute());
		assertEquals(49, time.getSecond());
		assertEquals(0, time.getNano());
		time = ATime.ofSecondOfDay(23 * 3600 + 59 * 60 + 59);
		assertEquals(23, time.getHour());
		assertEquals(59, time.getMinute());
		assertEquals(59, time.getSecond());
		assertEquals(0, time.getNano());
		try {
			time = ATime.ofSecondOfDay(24 * 3600 + 60 * 60 + 60);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		try {
			time = ATime.ofSecondOfDay(-123);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#compareTo(ATime)}.
	 */
	@Test
	public void testCompareTo () {
		ATime time1 = ATime.of(12, 34, 56);
		ATime time2 = ATime.of(12, 34, 55);
		assertTrue(time1.compareTo(time2) > 0);
		assertTrue(time2.compareTo(time1) < 0);
		time2 = ATime.of(12, 34, 56);
		assertTrue(time1.compareTo(time2) == 0);
		time1 = ATime.of(12, 34, 56, 100100100);
		time2 = ATime.of(12, 34, 56, 200200200);
		assertTrue(time1.compareTo(time2) < 0);
		assertTrue(time2.compareTo(time1) > 0);
		time2 = ATime.of(12, 34, 56, 100100100);
		assertTrue(time1.compareTo(time2) == 0);
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#equals(ATime)}.
	 */
	@Test
	public void testEquals () {
		ATime time1 = ATime.of(23, 59, 59);
		ATime time2 = ATime.of(23, 59, 59);
		assertTrue(time1.equals(time2));
		time2 = ATime.of(11, 12, 13);
		assertFalse(time1.equals(time2));
		time1 = ATime.of(10, 11, 12, 123456789);
		time2 = ATime.of(10, 11, 12, 123456789);
		assertTrue(time1.equals(time2));
		time2 = ATime.of(10, 11, 12, 987654321);
		assertFalse(time1.equals(time2));
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#isBefore(ATime)}.
	 */
	@Test
	public void testIsBefore () {
		ATime time1 = ATime.of(12, 34, 56, 7890);
		ATime time2 = ATime.of(12, 34, 56, 7891);
		assertTrue(time1.isBefore(time2));
		assertFalse(time2.isBefore(time1));
		time2 = ATime.of(12, 34, 56, 7890);
		assertFalse(time1.isBefore(time2));
		time1 = ATime.of(23, 59, 59, 100100100);
		time2 = ATime.of(10, 11, 13, 100100100);
		assertFalse(time1.isBefore(time2));
		assertTrue(time2.isBefore(time1));
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#isAfter(ATime)}.
	 */
	@Test
	public void testIsAfter () {
		ATime time1 = ATime.of(20, 10, 30);
		ATime time2 = ATime.of(20, 10, 15);
		assertTrue(time1.isAfter(time2));
		assertFalse(time2.isAfter(time1));
		time2 = ATime.of(20, 10, 30);
		assertFalse(time1.isAfter(time2));
		assertFalse(time2.isAfter(time1));
		time1 = ATime.of(5, 13, 40, 999);
		time2 = ATime.of(5, 13, 40, 1000);
		assertFalse(time1.isAfter(time2));
		assertTrue(time2.isAfter(time1));
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#withHour(int)}.
	 */
	@Test
	public void testWithHour () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.withHour(20);
		assertEquals(20, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.withHour(0);
		assertEquals(0, time2.getHour());
		try {
			time2 = time.withHour(99);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#withMinute(int)}.
	 */
	@Test
	public void testWithMinute () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.withMinute(55);
		assertEquals(12, time2.getHour());
		assertEquals(55, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.withMinute(0);
		assertEquals(0, time2.getMinute());
		try {
			time2 = time.withMinute(99);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#withSecond(int)}.
	 */
	@Test
	public void testWithSecond () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.withSecond(16);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(16, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.withSecond(0);
		assertEquals(0, time2.getSecond());
		try {
			time2 = time.withSecond(99);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#withNano(int)}.
	 */
	@Test
	public void testWithNano () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.withNano(9870);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(9870, time2.getNano());
		time2 = time.withNano(0);
		assertEquals(0, time2.getNano());
		try {
			time2 = time.withNano(1000000000);
			fail("Exception expected");
		} catch (IllegalArgumentException ex) {
			// expected
		}
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#plusHours(long)}.
	 */
	@Test
	public void testPlusHours () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.plusHours(4);
		assertEquals(16, time2.getHour());
		time2 = time.plusHours(8);
		assertEquals(20, time2.getHour());
		time2 = time.plusHours(12);
		assertEquals(0, time2.getHour());
		time2 = time.plusHours(16);
		assertEquals(4, time2.getHour());
		time2 = time.plusHours(20);
		assertEquals(8, time2.getHour());
		time2 = time.plusHours(24);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#plusMinutes(long)}.
	 */
	@Test
	public void testPlusMinutes () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.plusMinutes(10);
		assertEquals(44, time2.getMinute());
		time2 = time.plusMinutes(20);
		assertEquals(54, time2.getMinute());
		time2 = time.plusMinutes(30);
		assertEquals(13, time2.getHour());
		assertEquals(04, time2.getMinute());
		time = time.plusHours(11);
		assertEquals(23, time.getHour());
		time2 = time.plusMinutes(30);
		assertEquals(0, time2.getHour());
		assertEquals(4, time2.getMinute());
		time2 = time.plusMinutes(60);
		assertEquals(0, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#plusSeconds(long)}.
	 */
	@Test
	public void testPlusSeconds () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.plusSeconds(3);
		assertEquals(59, time2.getSecond());
		time2 = time.plusSeconds(4);
		assertEquals(0, time2.getSecond());
		assertEquals(35, time2.getMinute());
		time = ATime.of(23, 59, 56, 123456789);
		time2 = time.plusSeconds(4);
		assertEquals(0, time2.getHour());
		assertEquals(0, time2.getMinute());
		assertEquals(0, time2.getSecond());
		assertEquals(123456789, time2.getNano());
		time2 = time.plusSeconds(94);
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#plusNanos(long)}.
	 */
	@Test
	public void testPlusNanos () {
		ATime time = ATime.of(12, 34, 56, 0);
		ATime time2 = time.plusNanos(999999999);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(999999999, time2.getNano());
		time = ATime.of(23, 59, 59, 999999999);
		time2 = time.plusNanos(1);
		assertEquals(0, time2.getHour());
		assertEquals(0, time2.getMinute());
		assertEquals(0, time2.getSecond());
		assertEquals(0, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#minusHours(long)}.
	 */
	@Test
	public void testMinusHours () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.minusHours(4);
		assertEquals(8, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.minusHours(20);
		assertEquals(16, time2.getHour());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#minusMinutes(long)}.
	 */
	@Test
	public void testMinusMinutes () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.minusMinutes(30);
		assertEquals(12, time2.getHour());
		assertEquals(4, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.minusMinutes(34);
		assertEquals(12, time2.getHour());
		assertEquals(0, time2.getMinute());
		time2 = time.minusMinutes(35);
		assertEquals(11, time2.getHour());
		assertEquals(59, time2.getMinute());
		time2 = time.minusMinutes(12 * 60);
		assertEquals(0, time2.getHour());
		assertEquals(34, time2.getMinute());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#minusSeconds(long)}.
	 */
	@Test
	public void testMinusSeconds () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.minusSeconds(30);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(26, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time2 = time.minusSeconds(56);
		assertEquals(34, time2.getMinute());
		assertEquals(0, time2.getSecond());
		time2 = time.minusSeconds(57);
		assertEquals(33, time2.getMinute());
		assertEquals(59, time2.getSecond());
		time2 = time.minusSeconds(34 * 60);
		assertEquals(0, time2.getMinute());
		assertEquals(56, time2.getSecond());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#minusNanos(long)}.
	 */
	@Test
	public void testMinusNanos () {
		ATime time = ATime.of(12, 34, 56, 7890);
		ATime time2 = time.minusNanos(7000);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(890, time2.getNano());
		time2 = time.minusNanos(7890);
		assertEquals(56, time2.getSecond());
		assertEquals(0, time2.getNano());
		time2 = time.minusNanos(7891);
		assertEquals(55, time2.getSecond());
		assertEquals(999999999, time2.getNano());
		time2 = time.minusNanos((long) 56 * 1000000000);
		assertEquals(0, time2.getSecond());
		assertEquals(7890, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#toCalendar()}.
	 */
	@Test
	public void testToCalendar () {
		ATime time = ATime.of(12, 34, 56, 789000000);
		Calendar cal = time.toCalendar();
		assertEquals(12, cal.get(Calendar.HOUR_OF_DAY));
		assertEquals(34, cal.get(Calendar.MINUTE));
		assertEquals(56, cal.get(Calendar.SECOND));
		assertEquals(789, cal.get(Calendar.MILLISECOND));
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#toDate()}.
	 */
	@Test
	public void testToDate () {
		ATime time = ATime.of(22, 11, 44, 999999999);
		Date date = time.toDate();
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		assertEquals(22, cal.get(Calendar.HOUR_OF_DAY));
		assertEquals(11, cal.get(Calendar.MINUTE));
		assertEquals(44, cal.get(Calendar.SECOND));
		assertEquals(999, cal.get(Calendar.MILLISECOND));
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#toSecondOfDay()}.
	 */
	@Test
	public void testToSecondOfDay () {
		ATime time = ATime.of(12, 34, 56);
		int secondOfDay = time.toSecondOfDay();
		ATime time2 = ATime.ofSecondOfDay(secondOfDay);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(0, time2.getNano());
		time = ATime.of(23, 59, 59, 999999999);
		secondOfDay = time.toSecondOfDay();
		time2 = ATime.ofSecondOfDay(secondOfDay);
		assertEquals(23, time2.getHour());
		assertEquals(59, time2.getMinute());
		assertEquals(59, time2.getSecond());
		assertEquals(0, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#toNanoOfDay()}.
	 */
	@Test
	public void testToNanoOfDay () {
		ATime time = ATime.of(12, 34, 56, 7890);
		long nanoOfDay = time.toNanoOfDay();
		ATime time2 = ATime.ofNanoOfDay(nanoOfDay);
		assertEquals(12, time2.getHour());
		assertEquals(34, time2.getMinute());
		assertEquals(56, time2.getSecond());
		assertEquals(7890, time2.getNano());
		time = ATime.of(23, 59, 59, 999999999);
		nanoOfDay = time.toNanoOfDay();
		time2 = ATime.ofNanoOfDay(nanoOfDay);
		assertEquals(23, time2.getHour());
		assertEquals(59, time2.getMinute());
		assertEquals(59, time2.getSecond());
		assertEquals(999999999, time2.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#from(Date)}.
	 */
	@Test
	public void testFromDate () {
		Date date = new Date();
		ATime time = ATime.from(date);
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		assertEquals(cal.get(Calendar.HOUR_OF_DAY), time.getHour());
		assertEquals(cal.get(Calendar.MINUTE), time.getMinute());
		assertEquals(cal.get(Calendar.SECOND), time.getSecond());
		assertEquals(cal.get(Calendar.MILLISECOND), time.getNano() / 1000000);
		cal.set(Calendar.HOUR_OF_DAY, 12);
		cal.set(Calendar.MINUTE, 34);
		cal.set(Calendar.SECOND, 56);
		cal.set(Calendar.MILLISECOND, 789);
		date = cal.getTime();
		time = ATime.from(date);
		assertEquals(12, time.getHour());
		assertEquals(34, time.getMinute());
		assertEquals(56, time.getSecond());
		assertEquals(789000000, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#from(Calendar)}.
	 */
	@Test
	public void testFromCalendar () {
		Calendar cal = Calendar.getInstance();
		ATime time = ATime.from(cal);
		assertEquals(cal.get(Calendar.HOUR_OF_DAY), time.getHour());
		assertEquals(cal.get(Calendar.MINUTE), time.getMinute());
		assertEquals(cal.get(Calendar.SECOND), time.getSecond());
		assertEquals(cal.get(Calendar.MILLISECOND), time.getNano() / 1000000);
		cal.set(Calendar.HOUR_OF_DAY, 12);
		cal.set(Calendar.MINUTE, 34);
		cal.set(Calendar.SECOND, 56);
		cal.set(Calendar.MILLISECOND, 789);
		time = ATime.from(cal);
		assertEquals(12, time.getHour());
		assertEquals(34, time.getMinute());
		assertEquals(56, time.getSecond());
		assertEquals(789000000, time.getNano());
		passed = true;
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#parse(String)}.
	 */
	@Test
	public void testParse () {
		doParse("09", 9, 0, 0, 0);
		doParse("0910", 9, 10, 0, 0);
		doParse("091011", 9, 10, 11, 0);
		doParse("091011.123456789", 9, 10, 11, 123456789);
		doParse("23:24", 23, 24, 0, 0);
		doParse("23:24:25", 23, 24, 25, 0);
		doParse("23:59:59.999999999", 23, 59, 59, 999999999);
		doParse("24:59:59.999999999", -1, 0, 0, 0);
		doParse("23:60:59.999999999", -1, 0, 0, 0);
		doParse("23:59:60.999999999", -1, 0, 0, 0);
		doParse("23:59:59.9999999991", -1, 0, 0, 0);
		doParse("18:", -1, 0, 0, 0);
		passed = true;
	}

	private void doParse (String dateString, int h, int m, int s, int n) {
		try {
			ATime time = ATime.parse(dateString);
			if (h < 0) {
				fail("Exception expected");
			}
			assertEquals(h, time.getHour());
			assertEquals(m, time.getMinute());
			assertEquals(s, time.getSecond());
			assertEquals(n, time.getNano());
		} catch (IllegalArgumentException ex) {
			if (h >= 0) {
				fail("Exception not expected");
			}
		}
	}

	/**
	 * Test method for {@link com.fidelis.valface.ATime#format(String)}.
	 */
	@Test
	public void testFormat () {
		ATime time = ATime.of(20, 4, 6, 123456789);
		String f = time.format("hh:mm:ss nano");
		assertEquals("08:04:06 123456789", f);
		f = time.format("<Hour: >Hour <Minute: >Minute <Second: >Second <Nano: >Nano");
		assertEquals("Hour: 20 Minute: 4 Second: 6 Nano: 123456789", f);
		String fmt = "Hour hour HH hh - Minute minute mm - Second second ss - milli micro nano AMPM";
		f = time.format(fmt);
		assertEquals("20 8 20 08 - 4 04 04 - 6 06 06 - 123 123456 123456789 PM", f);
		f = time.format("hh : mm : ss  nn1,nn2,nn3 ampm");
		assertEquals("08 : 04 : 06  123,456,789 pm", f);
		passed = true;
	}

}


text:
;!function( lib, Name, PACKAGE ) {
//	"use strict"; // removed because debugging in safari web inspector is impossible in strict mode!!!


text:
package org.aksw.openqa.view.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;

import org.aksw.openqa.manager.log.ConsoleLog;
import org.aksw.openqa.manager.log.ConsoleLog.MemoryMeasure;
import org.apache.log4j.Logger;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.SeriesException;
import org.jfree.data.time.FixedMillisecond;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.XYDataset;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
import org.primefaces.model.chart.CartesianChartModel;

@ManagedBean(name="engineLogConsoleController")
@SessionScoped
public class EngineLogViewConsole implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = -4523518673061012743L;
	private static Logger logger = Logger.getLogger(EngineLogViewConsole.class);

	private String log;
	private CartesianChartModel linearMemoryConsumeModel;

	public EngineLogViewConsole() {
	}

	public String getLog() {
		String[] messages = ConsoleLog.getInstance().getLastLogMessages();
		log= "";
		for(String message : messages) {
			log += message;
		}
		return log;
	}

	public void cleanLogMessages(ActionEvent event) {
		ConsoleLog.getInstance().clearLogMessages();
	}

	public void cleanMemoryConsumeLog(ActionEvent event) {
		ConsoleLog.getInstance().clearMemoryConsumeLog();
	}

	public void setLog(String value) {
		log = value;
	}

	public StreamedContent getFile() {
		InputStream stream = null;
		try {
			stream = new FileInputStream(ConsoleLog.getInstance().getLoggerFile());
		} catch (FileNotFoundException e) {
			logger.error("Can not find the logger file", e);
		}
        return new DefaultStreamedContent(stream, "text/plain", ConsoleLog.LOG_FILE_NAME);
    }

	 /**
     * Creates a sample chart.
     *
     * @param dataset  the dataset.
     *
     * @return A sample chart.
     */
    private JFreeChart createChart(final XYDataset dataset) {
        return ChartFactory.createTimeSeriesChart(
            "Memory Usage",
            "Time",
            "Memory(MB)",
            dataset,
            false,
            false,
            false
        );
    }

    /**
     * Creates the memory series set.
     *
     * @return the memory series set.
     */
    private XYDataset createDataset(MemoryMeasure[] memoryMeasures) {
        final TimeSeries series = new TimeSeries("Memory Data");
        for (MemoryMeasure memoryMeasure: memoryMeasures) {
            try {
                series.add(new FixedMillisecond(memoryMeasure.date.getTime()), new Double(memoryMeasure.memory));
            }
            catch (SeriesException e) {
                System.err.println("Error adding to series");
            }
        }
        return new TimeSeriesCollection(series);
    }

	public CartesianChartModel getLinearMemoryConsumeModel() {
		return linearMemoryConsumeModel;
	}

	public StreamedContent getChart() {
		MemoryMeasure[] memoryMeasures = ConsoleLog.getInstance().getLastLogMemoryMeasures();
		StreamedContent chart = null;
		if(memoryMeasures.length > 0) {
	        XYDataset dataset = createDataset(memoryMeasures);
	        JFreeChart memoryChart = createChart(dataset);
	        File chartFile = new File("dynamichart");
			try {
				ChartUtilities.saveChartAsPNG(chartFile, memoryChart, 600, 300);
				chart = new DefaultStreamedContent(new FileInputStream(chartFile), "image/png");
			} catch (IOException e) {
				e.printStackTrace();
			}
        }
	 	return chart;
	}
}


text:
package com.sina.weibo.sdk.demo.openapi;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.sina.weibo.sdk.demo.AccessTokenKeeper;
import com.sina.weibo.sdk.demo.Constants;
import com.sina.weibo.sdk.exception.WeiboException;
import com.sina.weibo.sdk.net.RequestListener;
import com.sina.weibo.sdk.openapi.StatusesAPI;
import com.sina.weibo.sdk.openapi.models.ErrorInfo;
import com.sina.weibo.sdk.openapi.models.Status;
import com.sina.weibo.sdk.openapi.models.StatusList;
import com.sina.weibo.sdk.utils.LogUtil;

import org.ayo.http.R;

/**
 * 该类主要演示了如何使用微博 OpenAPI 来获取以下内容:
 *
获取最新的公共微博
 *
获取当前登录用户及其所关注用户的最新微博
 *
获取当前登录用户及其所关注用户的最新微博的ID
 *
...
 *
 * @author SINA
 * @since 2013-11-24
 */
public class WBStatusAPIActivity extends Activity implements OnItemClickListener {
    private static final String TAG = WBStatusAPIActivity.class.getName();

    /** UI 元素:ListView */
    private ListView mFuncListView;
    /** 功能列表 */
    private String[] mFuncList;
    /** 当前 Token 信息 */
    private Oauth2AccessToken mAccessToken;
    /** 用于获取微博信息流等操作的API */
    private StatusesAPI mStatusesAPI;

    /**
     * @see {@link Activity#onCreate}
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_open_api_base_layout);

        // 获取功能列表
        mFuncList = getResources().getStringArray(R.array.statuses_func_list);
        // 初始化功能列表 ListView
        mFuncListView = (ListView)findViewById(R.id.api_func_list);
        mFuncListView.setAdapter(new ArrayAdapter<String>(
                this, android.R.layout.simple_list_item_1, mFuncList));
        mFuncListView.setOnItemClickListener(this);

        // 获取当前已保存过的 Token
        mAccessToken = AccessTokenKeeper.readAccessToken(this);
        // 对statusAPI实例化
        mStatusesAPI = new StatusesAPI(this, Constants.APP_KEY, mAccessToken);
    }

    /**
     * @see {@link OnItemClickListener#onItemClick}
     */
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        if (view instanceof TextView) {
            if (mAccessToken != null && mAccessToken.isSessionValid()) {
                switch (position) {
                case 0:
                    mStatusesAPI.friendsTimeline(0L, 0L, 10, 1, false, 0, false, mListener);
                    break;

                case 1:
                    mStatusesAPI.mentions(0L, 0L, 10, 1, 0, 0, 0, false, mListener);
                    break;

                case 2:
                	mStatusesAPI.update("发送一条纯文字微博", null, null, mListener);
                    break;

                case 3:
                    Drawable drawable = getResources().getDrawable(R.drawable.ic_com_sina_weibo_sdk_logo);
                    Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
                    mStatusesAPI.upload("发送一条带本地图片的微博", bitmap, null, null, mListener);

                    /** 可以自行拼接参数,异步请求数据 */
                    /*
                    WeiboParameters wbparams = new WeiboParameters();
                    wbparams.put("access_token", mAccessToken.getToken());
                    wbparams.put("status",       "通过API发送微博-upload");
                    wbparams.put("visible",      "0");
                    wbparams.put("list_id",      "");
                    wbparams.put("pic",          bitmap);
                    wbparams.put("lat",          "14.5");
                    wbparams.put("long",         "23.0");
                    wbparams.put("annotations",  "");

                    AsyncWeiboRunner.requestAsync(
                            "https://api.weibo.com/2/statuses/upload.json",
                            wbparams,
                            "POST",
                            mListener);*/
                    break;

                case 4:
                    String photoURL = "http://hiphotos.baidu.com/lvpics/pic/item/b25aae51bc7a3474377abe75.jpg";
                    // 请注意:该接口暂不支持发布多图,即参数pic_id不可用(只能通过BD合作接入,不对个人申请)
                    mStatusesAPI.uploadUrlText("发送一条带网络图片的微博", photoURL, null, null, null, mListener);
                    break;

                default:
                    break;
                }
            } else {
                Toast.makeText(WBStatusAPIActivity.this,
                        R.string.weibosdk_demo_access_token_is_empty,
                        Toast.LENGTH_LONG).show();
            }
        }
    }

    /**
     * 微博 OpenAPI 回调接口。
     */
    private RequestListener mListener = new RequestListener() {
        @Override
        public void onComplete(String response) {
            if (!TextUtils.isEmpty(response)) {
                LogUtil.i(TAG, response);
                if (response.startsWith("{\"statuses\"")) {
                    // 调用 StatusList#parse 解析字符串成微博列表对象
                    StatusList statuses = StatusList.parse(response);
                    if (statuses != null && statuses.total_number > 0) {
                        Toast.makeText(WBStatusAPIActivity.this,
                                "获取微博信息流成功, 条数: " + statuses.statusList.size(),
                                Toast.LENGTH_LONG).show();
                    }
                } else if (response.startsWith("{\"created_at\"")) {
                    // 调用 Status#parse 解析字符串成微博对象
                    Status status = Status.parse(response);
                    Toast.makeText(WBStatusAPIActivity.this,
                            "发送一送微博成功, id = " + status.id,
                            Toast.LENGTH_LONG).show();
                } else {
                    Toast.makeText(WBStatusAPIActivity.this, response, Toast.LENGTH_LONG).show();
                }
            }
        }

        @Override
        public void onWeiboException(WeiboException e) {
            LogUtil.e(TAG, e.getMessage());
            ErrorInfo info = ErrorInfo.parse(e.getMessage());
            Toast.makeText(WBStatusAPIActivity.this, info.toString(), Toast.LENGTH_LONG).show();
        }
    };
}


text:
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../bower_components/polymer/polymer.html">

<dom-module id="color-button">
    <template>
        <style>
            :host {
                display: block;
            }
            paper-button {
                margin: 1em 2em;
            }
        </style>
        <paper-button class="color-me" id="root-color-{{color}}">{{color}}s</paper-button>
    </template>
    <script>
        (function () {
            'use strict';

            Polymer({
                is: 'color-button',

                properties: {
                    foo: {
                        type: String,
                        value: 'color-button',
                        notify: true
                    },
                    color: {
                        type: String,
                        value: '',
                        notify: true
                    },
                },
                ready: function () {
                    this.elementToColor = this.querySelector('.color-me');
                    this.elementToColor.style.backgroundColor = this.color.toLowerCase();
                }
            });
        })();
    </script>
</dom-module>


text:
/**@jsx*/
const {builder, types} = require('focus').component;
const i18nBehaviour = require('../../common/i18n/mixin');
const styleBehaviour = require('../../mixin/stylable');

const TopicDisplayer = require('../../common/topic-displayer').component;
const Button = require('../../common/button/action').component;
const numberFormatter = Focus.definition.formatter.number;

const listSummaryMixin = {
    mixins: [i18nBehaviour, styleBehaviour],
    /**
     * Display name.
     */
    displayName: 'list-summary',

    /**
     * Init the default props.
     * @returns {objet} default props.
     */
    getDefaultProps () {
        return {
            scopeList: {},
            /**
             * Action on click on scope.
             */
            scopeClickAction() {}
        };
    },
    /** @inheritdoc */
    propTypes: {
        nb: types('number'),
        queryText: types('string'),
        scopeList: types('array').isRequired,
        scopeClickAction: types('func'),
        exportAction: types('func')
    },
    /**
     * Return result sentence.
     * @return {object} Result sentence
     */
    _getResultSentence() {
        const {nb, queryText} = this.props;
        return (

                {numberFormatter.format(nb)} {this.i18n('result.for')} "{queryText}"

        );
    },
    /**
     * Render the html.
     * @returns {JSX} Html rendering.
     */
    render() {
        const {exportAction, scopeList, scopeClickAction} = this.props;
        return (

                {exportAction &&

                        <Button handleOnClick={exportAction} icon="print" label="result.export" shape="link" />

                }
                {this._getResultSentence()}

                    <TopicDisplayer topicClickAction={scopeClickAction} topicList={scopeList} />

        );
    }
};

module.exports = builder(listSummaryMixin);


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tesseract: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

tesseract
    4.00.00dev

tesseract::DPPoint Member List

This is the complete list of members for tesseract::DPPoint, including all inherited members.

AddLocalCost(int new_cost)	tesseract::DPPoint	inline

best_prev() const	tesseract::DPPoint	inline

CostFunc typedef	tesseract::DPPoint

CostWithVariance(const DPPoint *prev)	tesseract::DPPoint

DPPoint()	tesseract::DPPoint	inline

Pathlength() const	tesseract::DPPoint	inline

Solve(int min_step, int max_step, bool debug, CostFunc cost_func, int size, DPPoint *points)	tesseract::DPPoint	static

total_cost() const	tesseract::DPPoint	inline

Generated on Wed Mar 28 2018 19:53:46 for tesseract by

     1.8.13


text:
#ifndef CLIENT_BG_MANAGER_H
#define CLIENT_BG_MANAGER_H

#include <pthread.h>

#include "../util/lock.h"

#include "login_server.h"

extern pthread_t bg_manager;
extern pthread_mutex_t bg_lock;
extern pthread_cond_t bg_wait;

extern pthread_mutex_t net_lock;

/* checks in on sys-status and then acquires netlock */
int acquire_netlock();
void release_netlock();

int start_bg_thread(struct server_connection *sc);

#endif


text:
   /**
    *  Gets URI that identifies the test.
    *  @return uri identifier of test
    */
function getTargetURI() {
      return "http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentgetdocumenturi03";
   }

var docsLoaded = -1000000;
var builder = null;

//
//   This function is called by the testing framework before
//      running the test suite.
//
//   If there are no configuration exceptions, asynchronous
//        document loading is started.  Otherwise, the status
//        is set to complete and the exception is immediately
//        raised when entering the body of the test.
//
function setUpPage() {
   setUpPageStatus = 'running';
   try {
     //
     //   creates test document builder, may throw exception
     //
     builder = createConfiguredBuilder();

      docsLoaded = 0;

      var docRef = null;
      if (typeof(this.doc) != 'undefined') {
        docRef = this.doc;
      }
      docsLoaded += preload(docRef, "doc", "hc_staff");

       if (docsLoaded == 1) {
          setUpPageStatus = 'complete';
       }
    } catch(ex) {
        catchInitializationError(builder, ex);
        setUpPageStatus = 'complete';
    }
}

//
//   This method is called on the completion of
//      each asychronous load started in setUpTests.
//
//   When every synchronous loaded document has completed,
//      the page status is changed which allows the
//      body of the test to be executed.
function loadComplete() {
    if (++docsLoaded == 1) {
        setUpPageStatus = 'complete';
    }
}

/**
*
    Import the documentElement node of this document into a new document.  Since this node is
    now owned by the importing document, its documentURI attribute value should be null

* @author IBM
* @author Neil Delima
* @see http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core#Document3-documentURI
*/
function documentgetdocumenturi03() {
   var success;
    if(checkInitialization(builder, "documentgetdocumenturi03") != null) return;
    var doc;
      var newDoc;
      var importedOwner;
      var docElem;
      var docElemImported;
      var docURI;
      var domImpl;
      var nullDocType = null;

      var rootNS;
      var rootName;

      var docRef = null;
      if (typeof(this.doc) != 'undefined') {
        docRef = this.doc;
      }
      doc = load(docRef, "doc", "hc_staff");
      domImpl = doc.implementation;
docElem = doc.documentElement;

      rootNS = docElem.namespaceURI;

      rootName = docElem.tagName;

      newDoc = domImpl.createDocument(rootNS,rootName,nullDocType);
      docElemImported = newDoc.importNode(docElem,false);
      importedOwner = docElemImported.ownerDocument;

      docURI = importedOwner.documentURI;

      assertNull("documentgetdocumenturi03",docURI);

}

function runTest() {
   documentgetdocumenturi03();
}