text:
namespace Fixtures.AcceptanceTestsHttp
{
    using Models;

    /// <summary>
    /// HttpClientFailure operations.
    /// </summary>
    public partial interface IHttpClientFailure
    {
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Head400WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get400WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Put400WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Patch400WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Post400WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 400 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Delete400WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 401 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Head401WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 402 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get402WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 403 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get403WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 404 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Put404WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 405 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Patch405WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 406 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Post406WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 407 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Delete407WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 409 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Put409WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 410 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Head410WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 411 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get411WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 412 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get412WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 413 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Put413WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 414 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Patch414WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 415 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Post415WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 416 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Get416WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 417 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='booleanValue'>
        /// Simple boolean value true
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Delete417WithHttpMessagesAsync(bool? booleanValue = default(bool?), System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
        /// <summary>
        /// Return 429 status code - should be represented in the client as an
        /// error
        /// </summary>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Error>> Head429WithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
    }
}


text:
FactoryGirl.define do
  factory :namespace do
    sequence(:name) { |n| "namespace#{n}" }
    path { name.downcase.gsub(/\s/, '_') }
    owner
  end
end

redpajama_set_name: RedPajamaGithub


text:
layout: post
date: 2017-04-06
title: "Stella York Lace and Organza A-Line Wedding Dress
 Style 5959 Sleeveless Chapel Train Aline/Princess"
category: Stella York
tags: [Stella York,Aline/Princess ,Sweetheart,Chapel Train,Sleeveless]
---
### Stella York Lace and Organza A-Line Wedding Dress
 Style 5959
Just **$329.99**
###   Sleeveless Chapel Train Aline/Princess

BRANDS	Stella York

Silhouette	Aline/Princess

Neckline	Sweetheart

Hemline/Train	Chapel Train

Sleeve	Sleeveless

Buy it: [https://www.readybrides.com/en/stella-york/13515-stella-york-lace-and-organza-a-line-wedding-dress-style-5959.html](https://www.readybrides.com/en/stella-york/13515-stella-york-lace-and-organza-a-line-wedding-dress-style-5959.html)


text:
title: Johan Nordberg
summary: Freelance developer (Wintersmith)
date: 2016-06-07
categories:
- designer
- developer
- linux
- mac
---

### Who are you, and what do you do?

I'm [Johan Nordberg](https://johan-nordberg.com/ "Johan's website."), a freelance software developer and creative with a somewhat nomadic lifestyle, alternating between Sweden (where I'm [from](https://en.wikipedia.org/wiki/Luleå "The Wikipedia entry for Luleå.")), Italy (where I have my [main base](https://en.wikipedia.org/wiki/Florence "The Wikipedia entry for Florence.")) and Japan.

When not working for a client, I like to experiment with new technologies and make [open-source](https://github.com/jnordberg "Johan's GitHub account.") tools and libraries.

### What hardware do you use?

My main computer is a [13" MacBook Air][macbook-air] and I have a [15" MacBook Pro][macbook-pro] that I use for graphics work. And I'm not sure if this counts as hardware, but I use [Amazon EC2][ec2] to offload my laptop for heavy workloads like 3D rendering and data processing.

Besides that, there isn't much else needed for my work. I have pile of iPhones and iPads for application testing, or that's what I tell myself when I want to get the latest model anyways :D

Oh, and my portable speaker, the "[iLoud][]". I love music and this speaker sounds great, plus the batteries last for a whole day!

### And what software?

I use lots and lots of software! What I use varies greatly with the type project I'm working on, but I'll try list the tools and libraries I keep coming back to.

[Sublime Text 3][sublime-text] is probably where I spend most of my time - it's where I do all my coding. Except for [iOS][] and [OS X][macos] apps, though, where [Xcode][] is the only sane option. My second-most used app must be [iTerm2][], which is a great replacement for OS X's [Terminal.app][terminal]. I especially love the "visor" feature that lets you have a system-wide hotkey to quickly toggle a terminal. And in that terminal, my shell is [zsh][] with [oh-my-zsh][].

I use the [Creative Suite][creative-suite] (mainly [Photoshop][], [Illustrator][] and [Lightroom][]) for design and mockups, and [Final Cut Pro][final-cut-pro] for video editing. And when things need to get automated I use [GraphicsMagick][] and [ffmpeg][] respectively.

For 3D modelling and rendering I use a combination of [Fusion 360][fusion-360], [Cinema 4D][cinema-4d] and [Maxwell Render][maxwell-render]. And when I need something sliced for 3D printing I use [Simplify3D][], which I found through countless hours of experimenting to produce the best results. [Slic3r][] is pretty good too, if you want a hackable alternative.

To organize my work I use [Timings][] to track where I spend my time, and [Slack][] to communicate with clients and collaborators. All code is managed with [git][] (with [GitX][] as front-end) and self-hosted on a server running [Gogs][], except for open-source stuff which lives on [GitHub][].

My favourite programming language is [CoffeeScript][], which basically is [JavaScript][] with a better syntax. I also use [Python][], [Go][], [Swift][swift.2] and occasionally a bit of [C][].

For web development my stack usually consists of [Wintersmith][], [Browserify][] (with [Coffeeify][]), [Browsernizr][] and [Stylus][] for the front-end. And [Node.js][] + [hapi][] for the back-end. Or just Go with the standard library if performance is key. I would also like to mention [d3.js][] - it's mostly used for data visualizations but has almost everything you could ever want for working with 2D graphics and the DOM; I've built entire web apps using nothing but d3.js.

On my servers -- which I host on [Scaleway][] and [Vultr][] -- I use [FreeBSD][] or [Debian][], and I usually put [nginx][] in front of whatever web app is running on them. And I use [rsub][] to remote edit files on them.

I manage backups with a self-hosted [Syncthing][] cloud that has servers in both hemispheres so I can get decent speeds wherever I'm located. I also use [Carbon Copy Cloner][carbon-copy-cloner] to make bootable full-disk backup images.

I use [Alfred][] as an easily accessible calculator, [1Password][] to manage my passwords, and I try to install everything through [Homebrew][] with [Cask][homebrew-cask].

That's about it, I think. I also use a lot of paper to get my thoughts organised before they go into the computer in some form.

### What would be your dream setup?

I'm super excited for VR! I have a [HTC Vive][vive] on preorder and I'm currently building a beast of a rig that will power it. I have this vision of a virtual workspace that I want to explore, and I plan to spend the next year following that, experimenting with UI concepts in VR.

So I guess my dream setup would be a device with a small screen you keep in your pocket, just like a smartphone, but with a pair of goggles you put on to enter your virtual office to get stuff done.

Or if all that fails... the new line of [MacBooks][macbook.2] looks nice! One of those and a $5k monthly allowance on Amazon EC2 would be pretty sweet :)

[1password]: https://1password.com "Password management software for Mac OS X."
[alfred]: https://www.alfredapp.com/ "A launcher app for the Mac."
[browserify]: http://browserify.org/ "A Node.js dependency manager."
[browsernizr]: https://github.com/jnordberg/browsernizr "A Modernizer module for Browserify."
[c]: https://en.wikipedia.org/wiki/C_(programming_language) "A compiled programming language."
[carbon-copy-cloner]: https://bombich.com/ "Mac disk backup software."
[cinema-4d]: https://www.maxon.net/en/products/cinema-4d-prime/who-should-use-it.html "3D rendering software."
[coffeeify]: https://github.com/jnordberg/coffeeify "A CoffeeScript module for Browserify."
[coffeescript]: https://coffeescript.org/ "A language that compiles into Javascript."
[creative-suite]: https://www.adobe.com/creativecloud.html "A collection of design tools."
[d3.js]: https://d3js.org/ "A Javascript framework for manipulating data."
[debian]: https://www.debian.org/ "A Linux distribution."
[ec2]: https://aws.amazon.com/ec2/ "A web service for virtualised processing."
[ffmpeg]: http://www.ffmpeg.org/ "Comprehensive audio/video software."
[final-cut-pro]: https://en.wikipedia.org/wiki/Final_Cut_Pro "A nonlinear video editor."
[freebsd]: https://www.freebsd.org/ "An open source operating system."
[fusion-360]: https://www.autodesk.com/products/fusion-360/overview "Cloud-based CAD/CAM software."
[git]: https://git-scm.com/ "A version control system."
[github]: https://github.com/ "A Git code repository service."
[gitx]: http://gitx.frim.nl/ "A git GUI for Mac OS X."
[go]: https://golang.org/ "A compiled programming language."
[gogs]: https://gogs.io/ "A self-hosted git service."
[graphicsmagick]: http://www.graphicsmagick.org/ "Image editing and converting software."
[hapi]: https://hapijs.com/ "A web framework."
[homebrew-cask]: https://github.com/caskroom/homebrew-cask "A command-line tool for installing Mac applications."
[homebrew]: http://brew.sh "Command-line package manager for Mac OS X."
[illustrator]: https://www.adobe.com/products/illustrator.html "A vector graphics editor."
[iloud]: https://www.ikmultimedia.com/products/iloud/ "A portable Bluetooth speaker."
[ios]: https://www.apple.com/ios/ios-10/ "A mobile operating system."
[iterm2]: https://iterm2.com/ "An alternative terminal application for Mac OS X."
[javascript]: https://en.wikipedia.org/wiki/JavaScript "An interpreted scripting language."
[lightroom]: https://www.adobe.com/products/photoshop-lightroom.html "Photo management and editing software."
[macbook-air]: https://www.apple.com/macbook-air/ "A very thin laptop."
[macbook-pro]: https://www.apple.com/macbook-pro/ "A laptop."
[macbook.2]: https://en.wikipedia.org/wiki/MacBook_(2015_version) "A very thin 12 inch laptop."
[macos]: https://en.wikipedia.org/wiki/MacOS "An operating system for Mac hardware."
[maxwell-render]: http://www.maxwellrender.com/products/maxwell-render-suite "3D rendering software."
[nginx]: http://nginx.org/ "A very fast web/mail server."
[node.js]: https://nodejs.org/en/ "A Javascript application platform."
[oh-my-zsh]: https://github.com/robbyrussell/oh-my-zsh "A framework of extensions and themes for the zsh shell."
[photoshop]: https://www.adobe.com/products/photoshop.html "A bitmap image editor."
[python]: https://www.python.org/ "An interpreted scripting language."
[rsub]: https://github.com/henrikpersson/rsub "Software for editing file remotely via Sublime Text."
[scaleway]: https://www.scaleway.com/ "An SSD-based web hosting service."
[simplify3d]: https://www.simplify3d.com/ "3D printing software."
[slack]: https://slack.com/ "A collaboration service."
[slic3r]: https://slic3r.org/ "3D printing software."
[stylus]: http://stylus-lang.com/ "A dynamic language for generating CSS."
[sublime-text]: http://www.sublimetext.com/ "A coder's text editor."
[swift.2]: https://swift.org/ "A compiled programming language."
[syncthing]: https://syncthing.net/ "Self-hosted file syncing software."
[terminal]: https://en.wikipedia.org/wiki/Terminal_(OS_X) "A console application included with Mac OS X."
[timings]: https://www.mediaatelier.com/Timings2/ "Time tracking software for the Mac."
[vive]: http://www.htcvr.com/ "A SteamVR headset."
[vultr]: https://www.vultr.com/ "An SSD-based web hosting service."
[wintersmith]: http://wintersmith.io/ "A static site generator."
[xcode]: https://en.wikipedia.org/wiki/Xcode "An IDE for Mac developers."
[zsh]: http://www.zsh.org/ "An interactive shell and scripting language."


text:
using namespace std;
using namespace Imath;
using namespace IECore;
using namespace Gaffer;
using namespace GafferScene;

//////////////////////////////////////////////////////////////////////////
// RootTree
//////////////////////////////////////////////////////////////////////////

namespace
{

// Used to represent the tree of locations specified by `rootNamesPlug()`.
// This allows us to quickly find the matching root for any output location
// via `locationOrAncestor()`.
class RootTree : public IECore::Data
{

	public :

		struct Location;
		using LocationPtr = std::unique_ptr<Location>;
		using ChildMap = boost::container::flat_map<IECore::InternedString, LocationPtr>;

		struct Location
		{

			Location( size_t depth )
				:	depth( depth ), childNames( new InternedStringVectorData() )
			{
			}

			bool isRoot() const
			{
				return !rootVariableValue.empty();
			}

			// The path to this location, but exactly as the user spelled
			// it in `rootNamesPlug()` (may or may not have a leading or
			// trailing '/'). Empty if not a collection root.
			string rootVariableValue;
			size_t depth;
			ChildMap children;
			InternedStringVectorDataPtr childNames;

		};

		RootTree( const IECore::StringVectorData *roots )
			:	m_treeRoot( new Location( 0 ) )
		{
			ScenePlug::ScenePath path;
			for( const auto &root : roots->readable() )
			{
				ScenePlug::stringToPath( root, path );
				if( path.empty() )
				{
					continue;
				}

				Location *location = m_treeRoot.get();
				for( const auto &name : path )
				{
					const auto inserted = location->children.insert( ChildMap::value_type( name, LocationPtr() ) );
					if( inserted.second )
					{
						if( location->isRoot() )
						{
							throw IECore::Exception( boost::str( boost::format( "\"%1%\" contains nested roots" ) % location->rootVariableValue ) );
						}
						inserted.first->second.reset( new Location( location->depth + 1 ) );
						location->childNames->writable().push_back( name );
					}
					location = inserted.first->second.get();
				}

				if( location->isRoot() )
				{
					// Duplicate found - skip.
					continue;
				}

				if( !location->children.empty() )
				{
					throw IECore::Exception( boost::str( boost::format( "\"%1%\" contains nested roots" ) % root ) );
				}

				location->rootVariableValue = root;
				m_roots.push_back( root );
			}
		}

		const Location *locationOrAncestor( const ScenePlug::ScenePath &path ) const
		{
			const Location *result = m_treeRoot.get();
			for( const auto &name : path )
			{
				const auto it = result->children.find( name );
				if( it != result->children.end() )
				{
					result = it->second.get();
				}
				else
				{
					break;
				}
			}
			return result;
		}

		const vector<string> &roots() const
		{
			return m_roots;
		}

	private :

		LocationPtr m_treeRoot;
		vector<string> m_roots;

};

IE_CORE_DECLAREPTR( RootTree )

} // namespace

//////////////////////////////////////////////////////////////////////////
// SourceScope and SourcePathScope
//////////////////////////////////////////////////////////////////////////

class CollectScenes::SourceScope : public Context::EditableScope
{

	public :

		SourceScope( const Context *context, const InternedString &rootVariable )
			:	EditableScope( context ), m_rootVariable( rootVariable )
		{
		}

		void setRoot( const std::string *root )
		{
			if( !m_rootVariable.string().empty() )
			{
				set( m_rootVariable, root );
			}
		}

	private :

		InternedString m_rootVariable;

};

class CollectScenes::SourcePathScope : public SourceScope
{

	public :

		SourcePathScope( const Context *context, const CollectScenes *collectScenes, const ScenePlug::ScenePath &downstreamPath )
			:	SourceScope( context, collectScenes->rootNameVariablePlug()->getValue() )
		{
			// Evaluate RootTree in global scope.
			remove( ScenePlug::scenePathContextName );
			m_rootTree = boost::static_pointer_cast<const RootTree>( collectScenes->rootTreePlug()->getValue() );
			m_rootTreeLocation = m_rootTree->locationOrAncestor( downstreamPath );
			if( m_rootTreeLocation->isRoot() )
			{
				setRoot( &m_rootTreeLocation->rootVariableValue );
				// We evaluate the sourceRootPlug _after_ setting the root name,
				// so that users can use the root name in expressions and
				// substitutions.
				ScenePlug::stringToPath( collectScenes->sourceRootPlug()->getValue(), m_upstreamPath );
				m_upstreamPath.insert( m_upstreamPath.end(), downstreamPath.begin() + m_rootTreeLocation->depth, downstreamPath.end() );
				set( ScenePlug::scenePathContextName, &m_upstreamPath );
			}
			else
			{
				set( ScenePlug::scenePathContextName, &downstreamPath );
			}
		}

		const RootTree::Location *rootTreeLocation() const
		{
			return m_rootTreeLocation;
		}

		static bool affectedBy( const CollectScenes *collectScenes, const Plug *input )
		{
			return
				input == collectScenes->rootNameVariablePlug() ||
				input == collectScenes->rootTreePlug() ||
				input == collectScenes->sourceRootPlug()
			;
		}

	private :

		ScenePlug::ScenePath m_upstreamPath;
		ConstRootTreePtr m_rootTree;
		const RootTree::Location *m_rootTreeLocation;

};

//////////////////////////////////////////////////////////////////////////
// CollectScenes
//////////////////////////////////////////////////////////////////////////

GAFFER_NODE_DEFINE_TYPE( CollectScenes );

size_t CollectScenes::g_firstPlugIndex = 0;

CollectScenes::CollectScenes( const std::string &name )
	:	SceneProcessor( name )
{
	storeIndexOfNextChild( g_firstPlugIndex );

	addChild( new StringVectorDataPlug( "rootNames", Plug::In, new StringVectorData() ) );
	addChild( new StringPlug( "rootNameVariable", Plug::In, "collect:rootName" ) );
	addChild( new StringPlug( "sourceRoot", Plug::In, "/" ) );
	addChild( new BoolPlug( "mergeGlobals" ) );
	addChild( new ObjectPlug( "__rootTree", Plug::Out, IECore::NullObject::defaultNullObject() ) );

	outPlug()->childBoundsPlug()->setFlags( Plug::AcceptsDependencyCycles, true );
}

CollectScenes::~CollectScenes()
{
}

Gaffer::StringVectorDataPlug *CollectScenes::rootNamesPlug()
{
	return getChild<StringVectorDataPlug>( g_firstPlugIndex + 0 );
}

const Gaffer::StringVectorDataPlug *CollectScenes::rootNamesPlug() const
{
	return getChild<StringVectorDataPlug>( g_firstPlugIndex + 0 );
}

Gaffer::StringPlug *CollectScenes::rootNameVariablePlug()
{
	return getChild<StringPlug>( g_firstPlugIndex + 1 );
}

const Gaffer::StringPlug *CollectScenes::rootNameVariablePlug() const
{
	return getChild<StringPlug>( g_firstPlugIndex + 1 );
}

Gaffer::StringPlug *CollectScenes::sourceRootPlug()
{
	return getChild<StringPlug>( g_firstPlugIndex + 2 );
}

const Gaffer::StringPlug *CollectScenes::sourceRootPlug() const
{
	return getChild<StringPlug>( g_firstPlugIndex + 2 );
}

Gaffer::BoolPlug *CollectScenes::mergeGlobalsPlug()
{
	return getChild<BoolPlug>( g_firstPlugIndex + 3 );
}

const Gaffer::BoolPlug *CollectScenes::mergeGlobalsPlug() const
{
	return getChild<BoolPlug>( g_firstPlugIndex + 3 );
}

Gaffer::ObjectPlug *CollectScenes::rootTreePlug()
{
	return getChild<ObjectPlug>( g_firstPlugIndex + 4 );
}

const Gaffer::ObjectPlug *CollectScenes::rootTreePlug() const
{
	return getChild<ObjectPlug>( g_firstPlugIndex + 4 );
}

void CollectScenes::affects( const Gaffer::Plug *input, AffectedPlugsContainer &outputs ) const
{
	SceneProcessor::affects( input, outputs );

	if( input == rootNamesPlug() )
	{
		outputs.push_back( rootTreePlug() );
	}

	if(
		input == outPlug()->childBoundsPlug() ||
		SourcePathScope::affectedBy( this, input ) ||
		input == inPlug()->boundPlug()
	)
	{
		outputs.push_back( outPlug()->boundPlug() );
	}

	if( SourcePathScope::affectedBy( this, input ) || input == inPlug()->transformPlug() )
	{
		outputs.push_back( outPlug()->transformPlug() );
	}

	if( SourcePathScope::affectedBy( this, input ) || input == inPlug()->attributesPlug() )
	{
		outputs.push_back( outPlug()->attributesPlug() );
	}

	if( SourcePathScope::affectedBy( this, input ) || input == inPlug()->objectPlug() )
	{
		outputs.push_back( outPlug()->objectPlug() );
	}

	if(
		SourcePathScope::affectedBy( this, input ) ||
		input == inPlug()->existsPlug() ||
		input == inPlug()->childNamesPlug()
	)
	{
		outputs.push_back( outPlug()->childNamesPlug() );
	}

	if(
		input == rootTreePlug() ||
		input == rootNameVariablePlug() ||
		input == inPlug()->globalsPlug() ||
		input == mergeGlobalsPlug()
	)
	{
		outputs.push_back( outPlug()->globalsPlug() );
	}

	if(
		input == rootTreePlug() ||
		input == inPlug()->setNamesPlug() ||
		input == rootNameVariablePlug()
	)
	{
		outputs.push_back( outPlug()->setNamesPlug() );
	}

	if(
		input == rootTreePlug() ||
		input == inPlug()->setPlug() ||
		input == sourceRootPlug() ||
		input == rootNameVariablePlug()
	)
	{
		outputs.push_back( outPlug()->setPlug() );
	}
}

void CollectScenes::hash( const Gaffer::ValuePlug *output, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
	SceneProcessor::hash( output, context, h );

	if( output == rootTreePlug() )
	{
		rootNamesPlug()->hash( h );
	}
}

void CollectScenes::compute( Gaffer::ValuePlug *output, const Gaffer::Context *context ) const
{
	if( output == rootTreePlug() )
	{
		ConstStringVectorDataPtr roots = rootNamesPlug()->getValue();
		static_cast<ObjectPlug *>( output )->setValue(
			new RootTree( roots.get() )
		);
		return;
	}

	SceneProcessor::compute( output, context );
}

void CollectScenes::hashBound( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		h = outPlug()->childBoundsPlug()->hash();
	}
	else
	{
		h = inPlug()->boundPlug()->hash();
	}
}

Imath::Box3f CollectScenes::computeBound( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		return outPlug()->childBoundsPlug()->getValue();
	}
	else
	{
		return inPlug()->boundPlug()->getValue();
	}
}

void CollectScenes::hashTransform( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		SceneProcessor::hashTransform( path, context, parent, h );
	}
	else
	{
		h = inPlug()->transformPlug()->hash();
	}
}

Imath::M44f CollectScenes::computeTransform( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		return M44f();
	}
	else
	{
		return inPlug()->transformPlug()->getValue();
	}
}

void CollectScenes::hashAttributes( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		SceneProcessor::hashAttributes( path, context, parent, h );
	}
	else
	{
		h = inPlug()->attributesPlug()->hash();
	}
}

IECore::ConstCompoundObjectPtr CollectScenes::computeAttributes( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		return outPlug()->attributesPlug()->defaultValue();
	}
	else
	{
		return inPlug()->attributesPlug()->getValue();
	}
}

void CollectScenes::hashObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		SceneProcessor::hashObject( path, context, parent, h );
	}
	else
	{
		h = inPlug()->objectPlug()->hash();
	}
}

IECore::ConstObjectPtr CollectScenes::computeObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		return outPlug()->objectPlug()->defaultValue();
	}
	else
	{
		return inPlug()->objectPlug()->getValue();
	}
}

void CollectScenes::hashChildNames( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		h = sourcePathScope.rootTreeLocation()->childNames->Object::hash();
	}
	else
	{
		if( path.size() == sourcePathScope.rootTreeLocation()->depth )
		{
			if( !inPlug()->existsPlug()->getValue() )
			{
				h = inPlug()->childNamesPlug()->defaultValue()->Object::hash();
				return;
			}
		}
		h = inPlug()->childNamesPlug()->hash();
	}
}

IECore::ConstInternedStringVectorDataPtr CollectScenes::computeChildNames( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	SourcePathScope sourcePathScope( context, this, path );
	if( !sourcePathScope.rootTreeLocation()->isRoot() )
	{
		return sourcePathScope.rootTreeLocation()->childNames;
	}
	else
	{
		if( path.size() == sourcePathScope.rootTreeLocation()->depth )
		{
			if( !inPlug()->existsPlug()->getValue() )
			{
				return inPlug()->childNamesPlug()->defaultValue();
			}
		}
		return inPlug()->childNamesPlug()->getValue();
	}
}

void CollectScenes::hashGlobals( const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	ConstRootTreePtr rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );
	if( !rootTree->roots().size() )
	{
		h = inPlug()->globalsPlug()->defaultHash();
		return;
	}

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );

	if( mergeGlobalsPlug()->getValue() )
	{
		SceneProcessor::hashGlobals( context, parent, h );
		for( const auto &root : rootTree->roots() )
		{
			sourceScope.setRoot( &root );
			inPlug()->globalsPlug()->hash( h );
		}
	}
	else
	{
		sourceScope.setRoot( &rootTree->roots()[0] );
		h = inPlug()->globalsPlug()->hash();
	}
}

IECore::ConstCompoundObjectPtr CollectScenes::computeGlobals( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstRootTreePtr rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );
	if( !rootTree->roots().size() )
	{
		return inPlug()->globalsPlug()->defaultValue();
	}

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );

	if( mergeGlobalsPlug()->getValue() )
	{
		CompoundObjectPtr result = new CompoundObject;
		for( const auto &root : rootTree->roots() )
		{
			sourceScope.setRoot( &root );
			ConstCompoundObjectPtr globals = inPlug()->globalsPlug()->getValue();
			for( const auto &m : globals->members() )
			{
				result->members()[m.first] = m.second;
			}
		}
		return result;
	}
	else
	{
		sourceScope.setRoot( &rootTree->roots()[0] );
		return inPlug()->globalsPlug()->getValue();
	}
}

void CollectScenes::hashSetNames( const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneProcessor::hashSetNames( context, parent, h );

	ConstRootTreePtr rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );
	const ValuePlug *inSetNamesPlug = inPlug()->setNamesPlug();

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );
	for( const auto &root : rootTree->roots() )
	{
		sourceScope.setRoot( &root );
		inSetNamesPlug->hash( h );
	}
}

IECore::ConstInternedStringVectorDataPtr CollectScenes::computeSetNames( const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstRootTreePtr rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );

	InternedStringVectorDataPtr setNamesData = new InternedStringVectorData;
	vector<InternedString> &setNames = setNamesData->writable();

	const InternedStringVectorDataPlug *inSetNamesPlug = inPlug()->setNamesPlug();

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );
	for( const auto &root : rootTree->roots() )
	{
		sourceScope.setRoot( &root );
		ConstInternedStringVectorDataPtr inSetNamesData = inSetNamesPlug->getValue();
		for( const auto &setName : inSetNamesData->readable() )
		{
			if( find( setNames.begin(), setNames.end(), setName ) == setNames.end() )
			{
				setNames.push_back( setName );
			}
		}
	}

	return setNamesData;
}

void CollectScenes::hashSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
	SceneProcessor::hashSet( setName, context, parent, h );

	ConstRootTreePtr rootTree;
	{
		ScenePlug::GlobalScope globalScope( context );
		rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );
	}

	const PathMatcherDataPlug *inSetPlug = inPlug()->setPlug();
	const StringPlug *sourceRootPlug = this->sourceRootPlug();

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );
	for( const auto &root : rootTree->roots() )
	{
		sourceScope.setRoot( &root );
		inSetPlug->hash( h );
		sourceRootPlug->hash( h );
		h.append( root );
	}
}

IECore::ConstPathMatcherDataPtr CollectScenes::computeSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent ) const
{
	ConstRootTreePtr rootTree;
	{
		ScenePlug::GlobalScope globalScope( context );
		rootTree = boost::static_pointer_cast<const RootTree>( rootTreePlug()->getValue() );
	}

	PathMatcherDataPtr setData = new PathMatcherData;
	PathMatcher &set = setData->writable();

	const PathMatcherDataPlug *inSetPlug = inPlug()->setPlug();
	const StringPlug *sourceRootPlug = this->sourceRootPlug();

	SourceScope sourceScope( context, rootNameVariablePlug()->getValue() );
	ScenePlug::ScenePath prefix;
	for( const auto &root : rootTree->roots() )
	{
		sourceScope.setRoot( &root );
		ConstPathMatcherDataPtr inSetData = inSetPlug->getValue();
		const PathMatcher &inSet = inSetData->readable();
		if( !inSet.isEmpty() )
		{
			ScenePlug::stringToPath( root, prefix );
			const string root = sourceRootPlug->getValue();
			if( !root.empty() )
			{
				set.addPaths( inSet.subTree( root ), prefix );
			}
			else
			{
				set.addPaths( inSet, prefix );
			}
		}
	}

	return setData;
}


text:
package com.nepxion.thunder.testcase.collection;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.nepxion.thunder.common.entity.ApplicationEntity;
import com.nepxion.thunder.common.util.RandomUtil;

public class CollectionTest {
    private static final Logger LOG = LoggerFactory.getLogger(CollectionTest.class);

    @Test
    public void testIntersection() throws Exception {
        List<ApplicationEntity> localList = new ArrayList<ApplicationEntity>();
        for (int i = 1; i < 5; i++) {
            ApplicationEntity applicationEntity = new ApplicationEntity();
            applicationEntity.setApplication(i + "");
            applicationEntity.setGroup(i + "");

            localList.add(applicationEntity);
        }

        List<ApplicationEntity> remoteList = new ArrayList<ApplicationEntity>();
        for (int i = 3; i < 7; i++) {
            ApplicationEntity applicationEntity = new ApplicationEntity();
            applicationEntity.setApplication(i + "");
            applicationEntity.setGroup(i + "");

            remoteList.add(applicationEntity);
        }

        List<ApplicationEntity> intersectedList = (List<ApplicationEntity>) CollectionUtils.intersection(localList, remoteList);
        List<ApplicationEntity> onlineList = (List<ApplicationEntity>) CollectionUtils.subtract(remoteList, intersectedList);
        List<ApplicationEntity> offlineList = (List<ApplicationEntity>) CollectionUtils.subtract(localList, intersectedList);

        LOG.info("Online list:{}", onlineList);
        LOG.info("Offline list:{}", offlineList);
    }

    @Test
    public void testEquals() throws Exception {
        List<ApplicationEntity> localList = new ArrayList<ApplicationEntity>();
        for (int i = 0; i < 5; i++) {
            ApplicationEntity applicationEntity = new ApplicationEntity();
            applicationEntity.setApplication(i + "");
            applicationEntity.setGroup(i + "");
            applicationEntity.setId(RandomUtil.uuidRandom());

            localList.add(applicationEntity);
        }

        List<ApplicationEntity> remoteList = new ArrayList<ApplicationEntity>();
        for (int i = 4; i >= 0; i--) {
            ApplicationEntity applicationEntity = new ApplicationEntity();
            applicationEntity.setApplication(i + "");
            applicationEntity.setGroup(i + "");
            applicationEntity.setId(RandomUtil.uuidRandom());

            remoteList.add(applicationEntity);
        }

        boolean isEqual = CollectionUtils.isEqualCollection(localList, remoteList);
        LOG.info("Is equal:{}", isEqual);

        ApplicationEntity applicationEntity = localList.get(0);
        LOG.info("Remote list:{}", remoteList);
        if (remoteList.contains(applicationEntity)) {
            remoteList.remove(applicationEntity);
            LOG.info("Remote list:{}", remoteList);
        }
    }
}


text:
/**
 * \file
 * Implementation of the unbound WinSock2 API event notification handler
 * for the Windows port.
 */

#include "config.h"
#ifdef USE_WINSOCK
#include <signal.h>
#include <sys/time.h>
#include "winsock_event.h"
#include "fptr_wlist.h"
#include "log.h"

int mini_ev_cmp(const void* a, const void* b)
{
        const struct event *e = (const struct event*)a;
        const struct event *f = (const struct event*)b;
        if(e->ev_timeout.tv_sec < f->ev_timeout.tv_sec)
                return -1;
        if(e->ev_timeout.tv_sec > f->ev_timeout.tv_sec)
                return 1;
        if(e->ev_timeout.tv_usec < f->ev_timeout.tv_usec)
                return -1;
        if(e->ev_timeout.tv_usec > f->ev_timeout.tv_usec)
                return 1;
        if(e < f)
                return -1;
        if(e > f)
                return 1;
	return 0;
}

/** set time */
static int
settime(struct event_base* base)
{
        if(gettimeofday(base->time_tv, NULL) < 0) {
                return -1;
        }
#ifndef S_SPLINT_S
        *base->time_secs = (uint32_t)base->time_tv->tv_sec;
#endif
        return 0;
}

#ifdef UNBOUND_DEBUG
/**
 * Find a fd in the list of items.
 * Note that not all items have a fd associated (those are -1).
 * Signals are stored separately, and not searched.
 * @param base: event base to look in.
 * @param fd: what socket to look for.
 * @return the index in the array, or -1 on failure.
 */
static int
find_fd(struct event_base* base, int fd)
{
	int i;
	for(i=0; i<base->max; i++) {
		if(base->items[i]->ev_fd == fd)
			return i;
	}
	return -1;
}
#endif

/** Find ptr in base array */
static void
zero_waitfor(WSAEVENT waitfor[], WSAEVENT x)
{
	int i;
	for(i=0; i<WSK_MAX_ITEMS; i++) {
		if(waitfor[i] == x)
			waitfor[i] = 0;
	}
}

void *event_init(uint32_t* time_secs, struct timeval* time_tv)
{
        struct event_base* base = (struct event_base*)malloc(
		sizeof(struct event_base));
        if(!base)
                return NULL;
        memset(base, 0, sizeof(*base));
        base->time_secs = time_secs;
        base->time_tv = time_tv;
        if(settime(base) < 0) {
                event_base_free(base);
                return NULL;
        }
	base->items = (struct event**)calloc(WSK_MAX_ITEMS,
		sizeof(struct event*));
	if(!base->items) {
                event_base_free(base);
                return NULL;
	}
	base->cap = WSK_MAX_ITEMS;
	base->max = 0;
        base->times = rbtree_create(mini_ev_cmp);
        if(!base->times) {
                event_base_free(base);
                return NULL;
        }
        base->signals = (struct event**)calloc(MAX_SIG, sizeof(struct event*));
        if(!base->signals) {
                event_base_free(base);
                return NULL;
        }
	base->tcp_stickies = 0;
	base->tcp_reinvigorated = 0;
	verbose(VERB_CLIENT, "winsock_event inited");
        return base;
}

const char *event_get_version(void)
{
	return "winsock-event-"PACKAGE_VERSION;
}

const char *event_get_method(void)
{
	return "WSAWaitForMultipleEvents";
}

/** call timeouts handlers, and return how long to wait for next one or -1 */
static void handle_timeouts(struct event_base* base, struct timeval* now,
        struct timeval* wait)
{
        struct event* p;
#ifndef S_SPLINT_S
        wait->tv_sec = (time_t)-1;
#endif
	verbose(VERB_CLIENT, "winsock_event handle_timeouts");

        while((rbnode_t*)(p = (struct event*)rbtree_first(base->times))
                !=RBTREE_NULL) {
#ifndef S_SPLINT_S
                if(p->ev_timeout.tv_sec > now->tv_sec ||
                        (p->ev_timeout.tv_sec==now->tv_sec &&
                        p->ev_timeout.tv_usec > now->tv_usec)) {
                        /* there is a next larger timeout. wait for it */
                        wait->tv_sec = p->ev_timeout.tv_sec - now->tv_sec;
                        if(now->tv_usec > p->ev_timeout.tv_usec) {
                                wait->tv_sec--;
                                wait->tv_usec = 1000000 - (now->tv_usec -
                                        p->ev_timeout.tv_usec);
                        } else {
                                wait->tv_usec = p->ev_timeout.tv_usec
                                        - now->tv_usec;
                        }
			verbose(VERB_CLIENT, "winsock_event wait=%d.%6.6d",
				(int)wait->tv_sec, (int)wait->tv_usec);
                        return;
                }
#endif
                /* event times out, remove it */
                (void)rbtree_delete(base->times, p);
                p->ev_events &= ~EV_TIMEOUT;
                fptr_ok(fptr_whitelist_event(p->ev_callback));
                (*p->ev_callback)(p->ev_fd, EV_TIMEOUT, p->ev_arg);
        }
	verbose(VERB_CLIENT, "winsock_event wait=(-1)");
}

/** handle is_signal events and see if signalled */
static void handle_signal(struct event* ev)
{
	DWORD ret;
	log_assert(ev->is_signal && ev->hEvent);
	/* see if the event is signalled */
	ret = WSAWaitForMultipleEvents(1, &ev->hEvent, 0 /* any object */,
		0 /* return immediately */, 0 /* not alertable for IOcomple*/);
	if(ret == WSA_WAIT_IO_COMPLETION || ret == WSA_WAIT_FAILED) {
		log_err("WSAWaitForMultipleEvents(signal) failed: %s",
			wsa_strerror(WSAGetLastError()));
		return;
	}
	if(ret == WSA_WAIT_TIMEOUT) {
		/* not signalled */
		return;
	}

	/* reset the signal */
	if(!WSAResetEvent(ev->hEvent))
		log_err("WSAResetEvent failed: %s",
			wsa_strerror(WSAGetLastError()));
	/* do the callback (which may set the signal again) */
	fptr_ok(fptr_whitelist_event(ev->ev_callback));
	(*ev->ev_callback)(ev->ev_fd, ev->ev_events, ev->ev_arg);
}

/** call select and callbacks for that */
static int handle_select(struct event_base* base, struct timeval* wait)
{
	DWORD timeout = 0; /* in milliseconds */
	DWORD ret;
	struct event* eventlist[WSK_MAX_ITEMS];
	WSANETWORKEVENTS netev;
	int i, numwait = 0, startidx = 0, was_timeout = 0;
	int newstickies = 0;
	struct timeval nultm;

	verbose(VERB_CLIENT, "winsock_event handle_select");

#ifndef S_SPLINT_S
        if(wait->tv_sec==(time_t)-1)
                wait = NULL;
	if(wait)
		timeout = wait->tv_sec*1000 + wait->tv_usec/1000;
	if(base->tcp_stickies) {
		wait = &nultm;
		nultm.tv_sec = 0;
		nultm.tv_usec = 0;
		timeout = 0; /* no waiting, we have sticky events */
	}
#endif

	/* prepare event array */
	for(i=0; i<base->max; i++) {
		if(base->items[i]->ev_fd == -1 && !base->items[i]->is_signal)
			continue; /* skip timer only events */
		eventlist[numwait] = base->items[i];
		base->waitfor[numwait++] = base->items[i]->hEvent;
		if(numwait == WSK_MAX_ITEMS)
			break; /* sanity check */
	}
	log_assert(numwait <= WSA_MAXIMUM_WAIT_EVENTS);
	verbose(VERB_CLIENT, "winsock_event bmax=%d numwait=%d wait=%x "
		"timeout=%d", base->max, numwait, (int)wait, (int)timeout);

	/* do the wait */
	if(numwait == 0) {
		/* WSAWaitFor.. doesn't like 0 event objects */
		if(wait) {
			Sleep(timeout);
		}
		was_timeout = 1;
	} else {
		ret = WSAWaitForMultipleEvents(numwait, base->waitfor,
			0 /* do not wait for all, just one will do */,
			wait?timeout:WSA_INFINITE,
			0); /* we are not alertable (IO completion events) */
		if(ret == WSA_WAIT_IO_COMPLETION) {
			log_err("WSAWaitForMultipleEvents failed: WSA_WAIT_IO_COMPLETION");
			return -1;
		} else if(ret == WSA_WAIT_FAILED) {
			log_err("WSAWaitForMultipleEvents failed: %s",
				wsa_strerror(WSAGetLastError()));
			return -1;
		} else if(ret == WSA_WAIT_TIMEOUT) {
			was_timeout = 1;
		} else
			startidx = ret - WSA_WAIT_EVENT_0;
	}
	verbose(VERB_CLIENT, "winsock_event wake was_timeout=%d startidx=%d",
		was_timeout, startidx);

	/* get new time after wait */
        if(settime(base) < 0)
               return -1;

	/* callbacks */
	if(base->tcp_stickies)
		startidx = 0; /* process all events, some are sticky */
	for(i=startidx; i<numwait; i++)
		eventlist[i]->just_checked = 1;

	verbose(VERB_CLIENT, "winsock_event signals");
	for(i=startidx; i<numwait; i++) {
		if(!base->waitfor[i])
			continue; /* was deleted */
		if(eventlist[i]->is_signal) {
			eventlist[i]->just_checked = 0;
			handle_signal(eventlist[i]);
		}
	}
	/* early exit - do not process network, exit quickly */
	if(base->need_to_exit)
		return 0;

	verbose(VERB_CLIENT, "winsock_event net");
	for(i=startidx; i<numwait; i++) {
		short bits = 0;
		/* eventlist[i] fired */
		/* see if eventlist[i] is still valid and just checked from
		 * WSAWaitForEvents */
		if(!base->waitfor[i])
			continue; /* was deleted */
		if(!eventlist[i]->just_checked)
			continue; /* added by other callback */
		if(eventlist[i]->is_signal)
			continue; /* not a network event at all */
		eventlist[i]->just_checked = 0;

		if(WSAEnumNetworkEvents(eventlist[i]->ev_fd,
			base->waitfor[i], /* reset the event handle */
			/*NULL,*/ /* do not reset the event handle */
			&netev) != 0) {
			log_err("WSAEnumNetworkEvents failed: %s",
				wsa_strerror(WSAGetLastError()));
			return -1;
		}
		if((netev.lNetworkEvents & FD_READ)) {
			if(netev.iErrorCode[FD_READ_BIT] != 0)
				verbose(VERB_ALGO, "FD_READ_BIT error: %s",
				wsa_strerror(netev.iErrorCode[FD_READ_BIT]));
			bits |= EV_READ;
		}
		if((netev.lNetworkEvents & FD_WRITE)) {
			if(netev.iErrorCode[FD_WRITE_BIT] != 0)
				verbose(VERB_ALGO, "FD_WRITE_BIT error: %s",
				wsa_strerror(netev.iErrorCode[FD_WRITE_BIT]));
			bits |= EV_WRITE;
		}
		if((netev.lNetworkEvents & FD_CONNECT)) {
			if(netev.iErrorCode[FD_CONNECT_BIT] != 0)
				verbose(VERB_ALGO, "FD_CONNECT_BIT error: %s",
				wsa_strerror(netev.iErrorCode[FD_CONNECT_BIT]));
			bits |= EV_READ;
			bits |= EV_WRITE;
		}
		if((netev.lNetworkEvents & FD_ACCEPT)) {
			if(netev.iErrorCode[FD_ACCEPT_BIT] != 0)
				verbose(VERB_ALGO, "FD_ACCEPT_BIT error: %s",
				wsa_strerror(netev.iErrorCode[FD_ACCEPT_BIT]));
			bits |= EV_READ;
		}
		if((netev.lNetworkEvents & FD_CLOSE)) {
			if(netev.iErrorCode[FD_CLOSE_BIT] != 0)
				verbose(VERB_ALGO, "FD_CLOSE_BIT error: %s",
				wsa_strerror(netev.iErrorCode[FD_CLOSE_BIT]));
			bits |= EV_READ;
			bits |= EV_WRITE;
		}
		if(eventlist[i]->is_tcp && eventlist[i]->stick_events) {
			verbose(VERB_ALGO, "winsock %d pass sticky %s%s",
				eventlist[i]->ev_fd,
				(eventlist[i]->old_events&EV_READ)?"EV_READ":"",
				(eventlist[i]->old_events&EV_WRITE)?"EV_WRITE":"");
			bits |= eventlist[i]->old_events;
		}
		if(eventlist[i]->is_tcp && bits) {
			eventlist[i]->old_events = bits;
			eventlist[i]->stick_events = 1;
			if((eventlist[i]->ev_events & bits)) {
				newstickies = 1;
			}
			verbose(VERB_ALGO, "winsock %d store sticky %s%s",
				eventlist[i]->ev_fd,
				(eventlist[i]->old_events&EV_READ)?"EV_READ":"",
				(eventlist[i]->old_events&EV_WRITE)?"EV_WRITE":"");
		}
		if((bits & eventlist[i]->ev_events)) {
			verbose(VERB_ALGO, "winsock event callback %p fd=%d "
				"%s%s%s%s%s ; %s%s%s",
				eventlist[i], eventlist[i]->ev_fd,
				(netev.lNetworkEvents&FD_READ)?" FD_READ":"",
				(netev.lNetworkEvents&FD_WRITE)?" FD_WRITE":"",
				(netev.lNetworkEvents&FD_CONNECT)?
					" FD_CONNECT":"",
				(netev.lNetworkEvents&FD_ACCEPT)?
					" FD_ACCEPT":"",
				(netev.lNetworkEvents&FD_CLOSE)?" FD_CLOSE":"",
				(bits&EV_READ)?" EV_READ":"",
				(bits&EV_WRITE)?" EV_WRITE":"",
				(bits&EV_TIMEOUT)?" EV_TIMEOUT":"");

                        fptr_ok(fptr_whitelist_event(
                                eventlist[i]->ev_callback));
                        (*eventlist[i]->ev_callback)(eventlist[i]->ev_fd,
                                bits & eventlist[i]->ev_events,
				eventlist[i]->ev_arg);
		}
		if(eventlist[i]->is_tcp && bits)
			verbose(VERB_ALGO, "winsock %d got sticky %s%s",
				eventlist[i]->ev_fd,
				(eventlist[i]->old_events&EV_READ)?"EV_READ":"",
				(eventlist[i]->old_events&EV_WRITE)?"EV_WRITE":"");
	}
	verbose(VERB_CLIENT, "winsock_event net");
	if(base->tcp_reinvigorated) {
		verbose(VERB_CLIENT, "winsock_event reinvigorated");
		base->tcp_reinvigorated = 0;
		newstickies = 1;
	}
	base->tcp_stickies = newstickies;
	verbose(VERB_CLIENT, "winsock_event handle_select end");
        return 0;
}

int event_base_dispatch(struct event_base *base)
{
        struct timeval wait;
        if(settime(base) < 0)
                return -1;
        while(!base->need_to_exit)
        {
                /* see if timeouts need handling */
                handle_timeouts(base, base->time_tv, &wait);
                if(base->need_to_exit)
                        return 0;
                /* do select */
                if(handle_select(base, &wait) < 0) {
                        if(base->need_to_exit)
                                return 0;
                        return -1;
                }
        }
        return 0;
}

int event_base_loopexit(struct event_base *base,
	struct timeval * ATTR_UNUSED(tv))
{
	verbose(VERB_CLIENT, "winsock_event loopexit");
        base->need_to_exit = 1;
        return 0;
}

void event_base_free(struct event_base *base)
{
	verbose(VERB_CLIENT, "winsock_event event_base_free");
        if(!base)
                return;
	if(base->items)
		free(base->items);
        if(base->times)
                free(base->times);
        if(base->signals)
                free(base->signals);
        free(base);
}

void event_set(struct event *ev, int fd, short bits,
	void (*cb)(int, short, void *), void *arg)
{
        ev->node.key = ev;
        ev->ev_fd = fd;
        ev->ev_events = bits;
        ev->ev_callback = cb;
        fptr_ok(fptr_whitelist_event(ev->ev_callback));
        ev->ev_arg = arg;
	ev->just_checked = 0;
        ev->added = 0;
}

int event_base_set(struct event_base *base, struct event *ev)
{
        ev->ev_base = base;
	ev->old_events = 0;
	ev->stick_events = 0;
        ev->added = 0;
        return 0;
}

int event_add(struct event *ev, struct timeval *tv)
{
	verbose(VERB_ALGO, "event_add %p added=%d fd=%d tv=%d %s%s%s",
		ev, ev->added, ev->ev_fd,
		(tv?(int)tv->tv_sec*1000+(int)tv->tv_usec/1000:-1),
		(ev->ev_events&EV_READ)?" EV_READ":"",
		(ev->ev_events&EV_WRITE)?" EV_WRITE":"",
		(ev->ev_events&EV_TIMEOUT)?" EV_TIMEOUT":"");
        if(ev->added)
                event_del(ev);
	log_assert(ev->ev_fd==-1 || find_fd(ev->ev_base, ev->ev_fd) == -1);
	ev->is_tcp = 0;
	ev->is_signal = 0;
	ev->just_checked = 0;

        if((ev->ev_events&(EV_READ|EV_WRITE)) && ev->ev_fd != -1) {
		BOOL b=0;
		int t, l;
		long events = 0;

		if(ev->ev_base->max == ev->ev_base->cap)
			return -1;
		ev->idx = ev->ev_base->max++;
		ev->ev_base->items[ev->idx] = ev;

		if( (ev->ev_events&EV_READ) )
			events |= FD_READ;
		if( (ev->ev_events&EV_WRITE) )
			events |= FD_WRITE;
		l = sizeof(t);
		if(getsockopt(ev->ev_fd, SOL_SOCKET, SO_TYPE,
			(void*)&t, &l) != 0)
			log_err("getsockopt(SO_TYPE) failed: %s",
				wsa_strerror(WSAGetLastError()));
		if(t == SOCK_STREAM) {
			/* TCP socket */
			ev->is_tcp = 1;
			events |= FD_CLOSE;
			if( (ev->ev_events&EV_WRITE) )
				events |= FD_CONNECT;
			l = sizeof(b);
			if(getsockopt(ev->ev_fd, SOL_SOCKET, SO_ACCEPTCONN,
				(void*)&b, &l) != 0)
				log_err("getsockopt(SO_ACCEPTCONN) failed: %s",
					wsa_strerror(WSAGetLastError()));
			if(b) /* TCP accept socket */
				events |= FD_ACCEPT;
		}
		ev->hEvent = WSACreateEvent();
		if(ev->hEvent == WSA_INVALID_EVENT)
			log_err("WSACreateEvent failed: %s",
				wsa_strerror(WSAGetLastError()));
		/* automatically sets fd to nonblocking mode.
		 * nonblocking cannot be disabled, until wsaES(fd, NULL, 0) */
		if(WSAEventSelect(ev->ev_fd, ev->hEvent, events) != 0) {
			log_err("WSAEventSelect failed: %s",
				wsa_strerror(WSAGetLastError()));
		}
		if(ev->is_tcp && ev->stick_events &&
			(ev->ev_events & ev->old_events)) {
			/* go to processing the sticky event right away */
			ev->ev_base->tcp_reinvigorated = 1;
		}
	}

	if(tv && (ev->ev_events&EV_TIMEOUT)) {
#ifndef S_SPLINT_S
                struct timeval *now = ev->ev_base->time_tv;
                ev->ev_timeout.tv_sec = tv->tv_sec + now->tv_sec;
                ev->ev_timeout.tv_usec = tv->tv_usec + now->tv_usec;
                while(ev->ev_timeout.tv_usec > 1000000) {
                        ev->ev_timeout.tv_usec -= 1000000;
                        ev->ev_timeout.tv_sec++;
                }
#endif
                (void)rbtree_insert(ev->ev_base->times, &ev->node);
        }
        ev->added = 1;
	return 0;
}

int event_del(struct event *ev)
{
	verbose(VERB_ALGO, "event_del %p added=%d fd=%d tv=%d %s%s%s",
		ev, ev->added, ev->ev_fd,
		(ev->ev_events&EV_TIMEOUT)?(int)ev->ev_timeout.tv_sec*1000+
		(int)ev->ev_timeout.tv_usec/1000:-1,
		(ev->ev_events&EV_READ)?" EV_READ":"",
		(ev->ev_events&EV_WRITE)?" EV_WRITE":"",
		(ev->ev_events&EV_TIMEOUT)?" EV_TIMEOUT":"");
	if(!ev->added)
		return 0;
	log_assert(ev->added);
        if((ev->ev_events&EV_TIMEOUT))
                (void)rbtree_delete(ev->ev_base->times, &ev->node);
        if((ev->ev_events&(EV_READ|EV_WRITE)) && ev->ev_fd != -1) {
		log_assert(ev->ev_base->max > 0);
		/* remove item and compact the list */
		ev->ev_base->items[ev->idx] =
			ev->ev_base->items[ev->ev_base->max-1];
		ev->ev_base->items[ev->ev_base->max-1] = NULL;
		ev->ev_base->max--;
		if(ev->idx < ev->ev_base->max)
			ev->ev_base->items[ev->idx]->idx = ev->idx;
		zero_waitfor(ev->ev_base->waitfor, ev->hEvent);

		if(WSAEventSelect(ev->ev_fd, ev->hEvent, 0) != 0)
			log_err("WSAEventSelect(disable) failed: %s",
				wsa_strerror(WSAGetLastError()));
		if(!WSACloseEvent(ev->hEvent))
			log_err("WSACloseEvent failed: %s",
				wsa_strerror(WSAGetLastError()));
	}
	ev->just_checked = 0;
        ev->added = 0;
        return 0;
}

/** which base gets to handle signals */
static struct event_base* signal_base = NULL;
/** signal handler */
static RETSIGTYPE sigh(int sig)
{
        struct event* ev;
        if(!signal_base || sig < 0 || sig >= MAX_SIG)
                return;
        ev = signal_base->signals[sig];
        if(!ev)
                return;
        fptr_ok(fptr_whitelist_event(ev->ev_callback));
        (*ev->ev_callback)(sig, EV_SIGNAL, ev->ev_arg);
}

int signal_add(struct event *ev, struct timeval * ATTR_UNUSED(tv))
{
        if(ev->ev_fd == -1 || ev->ev_fd >= MAX_SIG)
                return -1;
        signal_base = ev->ev_base;
        ev->ev_base->signals[ev->ev_fd] = ev;
        ev->added = 1;
        if(signal(ev->ev_fd, sigh) == SIG_ERR) {
                return -1;
        }
        return 0;
}

int signal_del(struct event *ev)
{
        if(ev->ev_fd == -1 || ev->ev_fd >= MAX_SIG)
                return -1;
        ev->ev_base->signals[ev->ev_fd] = NULL;
        ev->added = 0;
        return 0;
}

void winsock_tcp_wouldblock(struct event* ev, int eventbits)
{
	verbose(VERB_ALGO, "winsock: tcp wouldblock %s",
		eventbits==EV_READ?"EV_READ":"EV_WRITE");
	ev->old_events &= (~eventbits);
	if(ev->old_events == 0)
		ev->stick_events = 0;
		/* in case this is the last sticky event, we could
		 * possibly run an empty handler loop to reset the base
		 * tcp_stickies variable
		 */
}

int winsock_register_wsaevent(struct event_base* base, struct event* ev,
	WSAEVENT wsaevent, void (*cb)(int, short, void*), void* arg)
{
	if(base->max == base->cap)
		return 0;
	memset(ev, 0, sizeof(*ev));
	ev->ev_fd = -1;
	ev->ev_events = EV_READ;
	ev->ev_callback = cb;
	ev->ev_arg = arg;
	ev->is_signal = 1;
	ev->hEvent = wsaevent;
	ev->added = 1;
	ev->ev_base = base;
	ev->idx = ev->ev_base->max++;
	ev->ev_base->items[ev->idx] = ev;
	return 1;
}

void winsock_unregister_wsaevent(struct event* ev)
{
	if(!ev || !ev->added) return;
	log_assert(ev->added && ev->ev_base->max > 0)
	zero_waitfor(ev->ev_base->waitfor, ev->hEvent);
	/* remove item and compact the list */
	ev->ev_base->items[ev->idx] = ev->ev_base->items[ev->ev_base->max-1];
	ev->ev_base->items[ev->ev_base->max-1] = NULL;
	ev->ev_base->max--;
	if(ev->idx < ev->ev_base->max)
		ev->ev_base->items[ev->idx]->idx = ev->idx;
	ev->added = 0;
}

#else /* USE_WINSOCK */
/** symbol so this codefile defines symbols. pleasing ranlib on OSX 10.5 */
int winsock_unused_symbol = 1;
#endif /* USE_WINSOCK */


text:
@implementation NSString (MMAdditions)

- (NSString *)mm_md5 {
    const char *cStr = [self UTF8String];
    unsigned char result[16];
    CC_MD5(cStr, (CC_LONG)strlen(cStr), result); // This is the md5 call
    return [NSString stringWithFormat:
            @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
            result[0], result[1], result[2], result[3],
            result[4], result[5], result[6], result[7],
            result[8], result[9], result[10], result[11],
            result[12], result[13], result[14], result[15]
            ];
}

- (NSString*)mm_sha1Str {
    const char *cstr = [self cStringUsingEncoding:NSUTF8StringEncoding];
    NSData *data = [NSData dataWithBytes:cstr length:self.length];

    uint8_t digest[CC_SHA1_DIGEST_LENGTH];

    CC_SHA1(data.bytes, (CC_LONG)data.length, digest);

    NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 2];

    for(int i = 0; i < CC_SHA1_DIGEST_LENGTH; i++)
        [output appendFormat:@"%02x", digest[i]];

    return output;
}

- (NSString *)mm_URLEncoding {
    NSString * result = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
                                                                                (CFStringRef)self,
                                                                                NULL,
                                                                                CFSTR("!*'();:@&=+$,/?%#[]"),
                                                                                kCFStringEncodingUTF8));
    return result;
}

- (NSString *)mm_URLDecoding {
    NSMutableString * string = [NSMutableString stringWithString:self];
    [string replaceOccurrencesOfString:@"+"
                            withString:@" "
                               options:NSLiteralSearch
                                 range:NSMakeRange(0, [string length])];
    return [string stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}

- (NSString *)mm_trimWhitespace {
    NSMutableString *str = [self mutableCopy];
    CFStringTrimWhitespace((__bridge CFMutableStringRef)str);
    return str;
}

- (BOOL)mm_isEmpty {
    return [[self mm_trimWhitespace] isEqualToString:@""];
}

- (BOOL)mm_isPureInt {
    NSScanner* scan = [NSScanner scannerWithString:self];
    int val;
    return[scan scanInt:&val] && [scan isAtEnd];
}

- (BOOL)mm_isPureFloat {
    NSScanner* scan = [NSScanner scannerWithString:self];
    float val;
    return[scan scanFloat:&val] && [scan isAtEnd];
}

- (BOOL)mm_isPhoneNo {
    NSString *phoneRegex = @"[0-9]{1,15}";
    NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
    return [phoneTest evaluateWithObject:self];
}

- (BOOL)mm_isEmail {
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
    return [emailTest evaluateWithObject:self];
}

- (BOOL)mm_containsEmoji {
    if (!self || self.length <= 0) {
        return NO;
    }
    __block BOOL returnValue = NO;
    [self enumerateSubstringsInRange:NSMakeRange(0, [self length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:
     ^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
         const unichar hs = [substring characterAtIndex:0];
         // surrogate pair
         if (0xd800 <= hs && hs <= 0xdbff) {
             if (substring.length > 1) {
                 const unichar ls = [substring characterAtIndex:1];
                 const int uc = ((hs - 0xd800) * 0x400) + (ls - 0xdc00) + 0x10000;
                 if (0x1d000 <= uc && uc <= 0x1f77f) {
                     returnValue = YES;
                 }
             }
         } else if (substring.length > 1) {
             const unichar ls = [substring characterAtIndex:1];
             if (ls == 0x20e3) {
                 returnValue = YES;
             }
         } else {
             // non surrogate
             if (0x2100 <= hs && hs <= 0x27ff) {
                 returnValue = YES;
             } else if (0x2B05 <= hs && hs <= 0x2b07) {
                 returnValue = YES;
             } else if (0x2934 <= hs && hs <= 0x2935) {
                 returnValue = YES;
             } else if (0x3297 <= hs && hs <= 0x3299) {
                 returnValue = YES;
             } else if (hs == 0xa9 || hs == 0xae || hs == 0x303d || hs == 0x3030 || hs == 0x2b55 || hs == 0x2b1c || hs == 0x2b1b || hs == 0x2b50) {
                 returnValue = YES;
             }
         }
     }];

    return returnValue;
}

- (NSString *)mm_transformToPinyin {
    if (self.length <= 0) {
        return self;
    }
    NSString *tempString = [self mutableCopy];
    CFStringTransform((CFMutableStringRef)tempString, NULL, kCFStringTransformToLatin, false);
    tempString = (NSMutableString *)[tempString stringByFoldingWithOptions:NSDiacriticInsensitiveSearch locale:[NSLocale currentLocale]];
    tempString = [tempString stringByReplacingOccurrencesOfString:@" " withString:@""];
    return [tempString uppercaseString];
}

- (NSRange)mm_rangeByTrimmingLeftCharactersInSet:(NSCharacterSet *)characterSet {
    NSUInteger location = 0;
    NSUInteger length = [self length];
    unichar charBuffer[length];
    [self getCharacters:charBuffer];
    for (location = 0; location < length; location++) {
        if (![characterSet characterIsMember:charBuffer[location]]) {
            break;
        }
    }
    return NSMakeRange(location, length - location);
}
- (NSRange)mm_rangeByTrimmingRightCharactersInSet:(NSCharacterSet *)characterSet  {
    NSUInteger location = 0;
    NSUInteger length = [self length];
    unichar charBuffer[length];
    [self getCharacters:charBuffer];
    for (length = [self length]; length > 0; length--) {
        if (![characterSet characterIsMember:charBuffer[length - 1]]) {
            break;
        }
    }
    return NSMakeRange(location, length - location);
}

- (NSString *)mm_stringByTrimmingLeftCharactersInSet:(NSCharacterSet *)characterSet {
    return [self substringWithRange:[self mm_rangeByTrimmingLeftCharactersInSet:characterSet]];
}

- (NSString *)mm_stringByTrimmingRightCharactersInSet:(NSCharacterSet *)characterSet {
    return [self substringWithRange:[self mm_rangeByTrimmingRightCharactersInSet:characterSet]];
}

- (CGSize)mm_getSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size {
    CGSize resultSize = CGSizeZero;
    if (self.length <= 0) {
        return resultSize;
    }
    resultSize = [self boundingRectWithSize:CGSizeMake(floor(size.width), floor(size.height)) // 用相对小的 width 去计算 height / 小 heigth 算 width
                                    options:(NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin)
                                 attributes:@{NSFontAttributeName: font}
                                    context:nil].size;
    resultSize = CGSizeMake(floor(resultSize.width + 1), floor(resultSize.height + 1)); // 上面用的小 width(height) 来计算了,这里要 +1
    return resultSize;
}

- (CGFloat)mm_getHeightWithFont:(UIFont *)font constrainedToSize:(CGSize)size {
    return [self mm_getSizeWithFont:font constrainedToSize:size].height;
}

- (CGFloat)mm_getWidthWithFont:(UIFont *)font constrainedToSize:(CGSize)size {
    return [self mm_getSizeWithFont:font constrainedToSize:size].width;
}

+ (NSString *)mm_sizeDisplayWithByte:(CGFloat)sizeOfByte {
    NSString *sizeDisplayStr;
    if (sizeOfByte < 1024) {
        sizeDisplayStr = [NSString stringWithFormat:@"%.2f bytes", sizeOfByte];
    } else {
        CGFloat sizeOfKB = sizeOfByte/1024;
        if (sizeOfKB < 1024) {
            sizeDisplayStr = [NSString stringWithFormat:@"%.2f KB", sizeOfKB];
        } else {
            CGFloat sizeOfM = sizeOfKB/1024;
            if (sizeOfM < 1024) {
                sizeDisplayStr = [NSString stringWithFormat:@"%.2f M", sizeOfM];
            } else {
                CGFloat sizeOfG = sizeOfKB/1024;
                sizeDisplayStr = [NSString stringWithFormat:@"%.2f G", sizeOfG];
            }
        }
    }
    return sizeDisplayStr;
}

@end


text:
<?xml version="1.0"?>
<Document>

	<Sentence>
		<value>Medical staples are made of special metal and are not the same as office staples.</value>
		<pattern_crowdsource> Medical staples are made of special [[metal|C0025552]] and are not the same as office [[staples|C0524724]].		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>Medical</surface-form>
				<RDF-ID>C0205476</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>staples</surface-form>
				<RDF-ID>C0524724</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>metal</surface-form>
				<RDF-ID>C0025552</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>not</surface-form>
				<RDF-ID>C1518422</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>same</surface-form>
				<RDF-ID>C0445247</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>office</surface-form>
				<RDF-ID>C0442603</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>staples</surface-form>
				<RDF-ID>C0524724</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0025552 compared_with C0524724</triple>
			<triple>C0025552 lower_than C0524724</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- If the laceration is on your scalp, it is OK to shampoo and wash.</value>
		<pattern_crowdsource> - If the [[laceration|C0043246]] is on your [[scalp|C1278997]], it is OK to shampoo and wash.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>laceration</surface-form>
				<RDF-ID>C0043246</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>scalp</surface-form>
				<RDF-ID>C1278997</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>shampoo</surface-form>
				<RDF-ID>C0150765</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C1278997 LOCATION_OF C0043246</triple>
		</triples>
	</Sentence>
	<Sentence>
		<value>- You can take pain medicine, such as ibuprofen, as directed for pain at the wound site.</value>
		<pattern_crowdsource> - You can take pain medicine, such as [[ibuprofen|C0020740]], as directed for [[pain|C0030193]] at the wound site.		</pattern_crowdsource>
		<annotations>
			<annotation>
				<surface-form>pain</surface-form>
				<RDF-ID>C0030193</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>medicine</surface-form>
				<RDF-ID>C0025118</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>ibuprofen</surface-form>
				<RDF-ID>C0020740</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>pain</surface-form>
				<RDF-ID>C0030193</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>wound</surface-form>
				<RDF-ID>C0043250</RDF-ID>
			</annotation>
			<annotation>
				<surface-form>site</surface-form>
				<RDF-ID>C0205145</RDF-ID>
			</annotation>
		</annotations>
		<triples>
			<triple>C0020740 TREATS C0030193</triple>
		</triples>
	</Sentence>

</Document>


text:
using System;
using Microsoft.OData.UriParser;

namespace Moon.OData
{
    /// <summary>
    /// Defines basic contract for OData query options.
    /// </summary>
    public interface IODataOptions
    {
        /// <summary>
        /// Gets the type of the entity you are building the query for.
        /// </summary>
        Type EntityType { get; }

        /// <summary>
        /// Gets or sets whether the parser is case sensitive when matching names of properties.
        /// </summary>
        bool IsCaseSensitive { get; set; }

        /// <summary>
        /// Gets a parsed $count query option.
        /// </summary>
        bool? Count { get; }

        /// <summary>
        /// Gets a parsed $deltatoken query option.
        /// </summary>
        string DeltaToken { get; }

        /// <summary>
        /// Gets a $filter clause parsed into semantic nodes.
        /// </summary>
        FilterClause Filter { get; }

        /// <summary>
        /// Gets a $oderby clause parsed into semantic nodes.
        /// </summary>
        OrderByClause OrderBy { get; }

        /// <summary>
        /// Gets a $search clause parsed into semantic nodes.
        /// </summary>
        SearchClause Search { get; }

        /// <summary>
        /// Gets a $select and $expand clauses parsed into semantic nodes.
        /// </summary>
        SelectExpandClause SelectAndExpand { get; }

        /// <summary>
        /// Gets a parsed $skip query option.
        /// </summary>
        long? Skip { get; }

        /// <summary>
        /// Gets a parsed $skiptoken query option.
        /// </summary>
        string SkipToken { get; }

        /// <summary>
        /// Gets a parsed $top query option.
        /// </summary>
        long? Top { get; }

        /// <summary>
        /// Gets raw OData query option values.
        /// </summary>
        ODataRawValues RawValues { get; }

        /// <summary>
        /// Validate all OData queries, including $skip, $top and $filter, based on the given settings.
        /// </summary>
        /// <param name="settings">The validation settings.</param>
        void Validate(ValidationSettings settings);
    }
}


text:
@class NSOperationQueue;

@interface GitTrackingBranchNameOperation : IDESourceControlOperation
{
    NSOperationQueue *_operationQueue;
}

@property(retain) NSOperationQueue *operationQueue; // @synthesize operationQueue=_operationQueue;
- (void).cxx_destruct;
- (void)main;

@end


text:
<?php

namespace Thruster\Component\Promise\Tests;

use Thruster\Component\Promise\RejectedPromise;
use Thruster\Component\Promise\Tests\Promise\PromiseRejectedTestTrait;
use Thruster\Component\Promise\Tests\Promise\PromiseSettledTestTrait;
use Thruster\Component\Promise\Tests\PromiseAdapter\CallbackPromiseAdapter;

/**
 * Class RejectedPromiseTest
 *
 * @package Thruster\Component\Promise\Tests
 * @author  Aurimas Niekis <aurimas@niekis.lt>
 */
class RejectedPromiseTest extends TestCase
{
    use PromiseSettledTestTrait,
        PromiseRejectedTestTrait;

    public function getPromiseTestAdapter(callable $canceller = null)
    {
        $promise = null;

        return new CallbackPromiseAdapter([
            'promise' => function () use (&$promise) {
                if (!$promise) {
                    throw new \LogicException('RejectedPromise must be rejected before obtaining the promise');
                }

                return $promise;
            },
            'resolve' => function () {
                throw new \LogicException('You cannot call resolve() for Thruster\Component\Promise\RejectedPromise');
            },
            'reject' => function ($reason = null) use (&$promise) {
                if (!$promise) {
                    $promise = new RejectedPromise($reason);
                }
            },
            'notify' => function () {
                // no-op
            },
            'settle' => function ($reason = null) use (&$promise) {
                if (!$promise) {
                    $promise = new RejectedPromise($reason);
                }
            },
        ]);
    }

    public function testShouldThrowExceptionIfConstructedWithAPromise()
    {
        $this->setExpectedException('\InvalidArgumentException');

        return new RejectedPromise(new RejectedPromise());
    }
}


text:
<?php

namespace frontend\packages;

use yii\web\AssetBundle;

class BootstrapTooltipAsset  extends AssetBundle
{

	public $basePath = '@webroot';
    public $baseUrl = '@web';
	public $css = [
	];
	public $js = [
		'js/app/bootstrap-tooltip.js'
	];
	public $depends =[
		'yii\web\YiiAsset',
		'common\packages\AppJsAsset',
	];

}


text:
package de.bwaldvogel.mongo.backend.h2;

import java.util.List;
import java.util.Map.Entry;

import org.h2.mvstore.MVMap;

import de.bwaldvogel.mongo.backend.AbstractUniqueIndex;
import de.bwaldvogel.mongo.backend.IndexKey;
import de.bwaldvogel.mongo.backend.KeyValue;
import de.bwaldvogel.mongo.backend.Missing;

public class H2UniqueIndex extends AbstractUniqueIndex<Object> {

    private final MVMap<KeyValue, Object> mvMap;

    H2UniqueIndex(MVMap<KeyValue, Object> mvMap, String name, List<IndexKey> keys, boolean sparse) {
        super(name, keys, sparse);
        this.mvMap = mvMap;
    }

    @Override
    protected Object removeDocument(KeyValue keyValue) {
        return mvMap.remove(keyValue);
    }

    @Override
    protected boolean putKeyPosition(KeyValue keyValue, Object position) {
        Object oldValue = mvMap.putIfAbsent(keyValue, Missing.ofNullable(position));
        return oldValue == null;
    }

    @Override
    protected Iterable<Entry<KeyValue, Object>> getIterable() {
        return mvMap.entrySet();
    }

    @Override
    protected Object getPosition(KeyValue keyValue) {
        return mvMap.get(keyValue);
    }

    @Override
    public long getCount() {
        return mvMap.sizeAsLong();
    }

    @Override
    public boolean isEmpty() {
        return mvMap.isEmpty();
    }

    @Override
    public long getDataSize() {
        return getCount();
    }

}


text:
package com.swfarm.biz.ebay.dao;

import com.swfarm.biz.ebay.bo.EbayReturnLog;
import com.swfarm.pub.framework.dao.GenericDao;

public interface EbayReturnLogDao extends GenericDao<EbayReturnLog, Long> {

}


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>PyQt4.QtGui.QDrag</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

        PyQt4 ::
        QtGui ::
        QDrag ::
        Class QDrag

[hide private]

[frames] | no frames]

Class QDrag

       object --+
                |
sip.simplewrapper --+
                    |
          sip.wrapper --+
                        |
           QtCore.QObject --+
                            |
                           QDrag

QDrag(QWidget)

        Instance Methods
        [hide private]

          actionChanged(...)

      QDrag.actionChanged[Qt.DropAction] [signal]

          exec(...)

          exec_(...)

          hotSpot(...)

          mimeData(...)

          pixmap(...)

          setDragCursor(...)

          setHotSpot(...)

          setMimeData(...)

          setPixmap(...)

          source(...)

          start(...)

          target(...)

          targetChanged(...)

      QDrag.targetChanged[QWidget] [signal]

Inherited from QtCore.QObject:
      __getattr__,
      blockSignals,
      childEvent,
      children,
      connect,
      connectNotify,
      customEvent,
      deleteLater,
      destroyed,
      disconnect,
      disconnectNotify,
      dumpObjectInfo,
      dumpObjectTree,
      dynamicPropertyNames,
      emit,
      event,
      eventFilter,
      findChild,
      findChildren,
      inherits,
      installEventFilter,
      isWidgetType,
      killTimer,
      metaObject,
      moveToThread,
      objectName,
      parent,
      property,
      pyqtConfigure,
      receivers,
      removeEventFilter,
      sender,
      senderSignalIndex,
      setObjectName,
      setParent,
      setProperty,
      signalsBlocked,
      startTimer,
      thread,
      timerEvent,
      tr,
      trUtf8

Inherited from sip.simplewrapper:
      __init__,
      __new__

Inherited from object:
      __delattr__,
      __format__,
      __getattribute__,
      __hash__,
      __reduce__,
      __reduce_ex__,
      __repr__,
      __setattr__,
      __sizeof__,
      __str__,
      __subclasshook__

        Class Variables
        [hide private]

Inherited from QtCore.QObject:
      staticMetaObject

        Properties
        [hide private]

Inherited from object:
      __class__

         Home

         Trees

         Indices

         Help

    Generated by Epydoc 3.0.1 on Tue Jun 14 13:29:14 2016

      http://epydoc.sourceforge.net


text:
"Draws a progress bar on an ANSI terminal, using Curses."

import sys
import curses

_CONTROLS = {
    'BOL':          'cr',
    'UP':           'cuu1',
    'CLEAR_EOL':    'el',
    'NORMAL':       'sgr0',
}

_VALUES = {
    'COLUMNS':      'cols',
    'LINES':        'lines',
    'MAX_COLORS':   'colors',
}

class ProgressBar(object):
    "Progress bar class."

    def __init__(self, width=None):
        "Constructor."

        self._progress = None
        self._lines = 0
        self._PADDING = 7

        curses.setupterm()

        fgColorSeq = curses.tigetstr('setaf') or curses.tigetstr('setf') or ''
        colorIndex = getattr(curses, 'COLOR_WHITE')
        self._fgcolour = curses.tparm(fgColorSeq, colorIndex)

        bgColorSeq = curses.tigetstr('setab') or curses.tigetstr('setb') or ''
        colorIndex = getattr(curses, 'COLOR_BLACK')
        self._bgcolour = curses.tparm(bgColorSeq, colorIndex)

        self._control = {}
        for control in _CONTROLS:
            # Set the control escape sequence
            self._control[control] = curses.tigetstr(_CONTROLS[control]) or ''

        self._value = {}
        for value in _VALUES:
            # Set terminal related values
            self._value[value] = curses.tigetnum(_VALUES[value])

        if width and width < self._value["COLUMNS"] - self._PADDING:
            self._width = width
        else:
            self._width = self._value["COLUMNS"] - self._PADDING

    def render(self, percent, msg=''):
        "Print the _progress bar."
        msglen = 0
        if msg:
            msglen = len(msg.splitlines()[0])
        if msglen + self._width + self._PADDING > self._value["COLUMNS"]:
            width = self._value["COLUMNS"] - msglen -self._PADDING
        else:
            width = self._width
        if self._progress != None:
            self.clear()
        self._progress = (width * percent) / 100
        data = "%s%s%s%s %3s%% %s\n" % (self._fgcolour, '#' * self._progress, self._control["NORMAL"], ' ' * (width - self._progress), percent, msg)
        sys.stdout.write(data)
        sys.stdout.flush()
        self._lines = len(data.splitlines())

    def clear(self):
        """Clear all printed _lines"""
        sys.stdout.write(self._lines * (self._control["UP"] + self._control["BOL"] + self._control["CLEAR_EOL"]))

if __name__ == "__main__":
    import time
    p = ProgressBar(width=80)
    for i in range(101):
        p.render(i, 'step %3s' % i)
        time.sleep(0.05)


text:
ruby-install
ruby-install ruby #install the latest version of Ruby.
printf "Don't forget to run chruby <version> when you need to change versions.\n"


text:
Git-subtree help you working with subtree commands.

Using a subtrees config file, you can clone a project and create all subtree remotes with one command. It also helps working with push/pull commands, adding prefix and branch from config.

## Requeriments

- [NodeJS](https://nodejs.org)
- [Git subtree](https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt)

## Install

```bash
$ npm install -g git-subtree
```

## Configuration file

The git-subtree configuration must be stored in subtrees.json file in the project root.

```json
{
	"mysubtree" : {
		"localFolder": "subtrees/mysubtree",
		"repository": "https://github.com/username/myrepo.git",
		"branch": "master"
	}
}
```

## Use

```bash
$ gitsbt <command>
```

### Init

```bash
$ gitsbt init [username]
```

This command creates all remotes from subtrees config and if it's a new project, where subtrees folders are still not created, will fetch from subtree remote and add the subtree.

### Add

```bash
$ gitsbt add <subtree> [username]
```

Adds git remote, fetch it and creates the local folder with subtree content.

### Pull

```bash
$ gitsbt pull <subtree>
```

Pulls subtree changes from subtree remote.

### Push

```bash
$ gitsbt push <subtree>
```

Pushes subtree changes.

### Commit

```bash
$ gitsbt commit <subtree> <message>
```

Commits subtree pending changes.


text:
//// [privateInstanceVisibility.ts]
module Test {

    export class Example {

        private someNumber: number;

        public doSomething() {

            var that = this;

            function innerFunction() {

                var num = that.someNumber;

            }

        }

    }

}

class C {

    private x: number;

    getX() { return this.x; }

    clone(other: C) {
        this.x = other.x;

    }
}

//// [privateInstanceVisibility.js]
var Test;
(function (Test) {
    var Example = /** @class */ (function () {
        function Example() {
        }
        Example.prototype.doSomething = function () {
            var that = this;
            function innerFunction() {
                var num = that.someNumber;
            }
        };
        return Example;
    }());
    Test.Example = Example;
})(Test || (Test = {}));
var C = /** @class */ (function () {
    function C() {
    }
    C.prototype.getX = function () { return this.x; };
    C.prototype.clone = function (other) {
        this.x = other.x;
    };
    return C;
}());