text:
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

class FakeTestContext
  include FakeObject
  def stub(*args)
  end
end

describe FakeObject do

  context "#fake" do
    before do
      @context = FakeTestContext.new
    end

    it "sets the context when setting expectations" do
      mock(FakeObject::Fake).new(:greeting => 'hi')
      @context.fake(:greeting => 'hi')
    end
  end

  describe Fake do
    context "#new with no expectations" do
      it "returns a fake object" do
        FakeObject::Fake.new.should be_instance_of(Fake)
      end

      it "has a string for a name" do
        f = FakeObject::Fake.new 'fake'
        f.__name__.should == 'fake'
      end

      it "has a symbol for a name" do
        f = FakeObject::Fake.new :fake
        f.__name__.should == :fake
      end
    end

    context "#new with expectations" do
      it "responds to fake method 'greeting'" do
        f = FakeObject::Fake.new :greeting => 'hi'
        f.greeting.should == 'hi'
      end

      it "responds to its name" do
        f = FakeObject::Fake.new 'Greeter', :greeting => 'hi'
        f.__name__.should == 'Greeter'
      end

      it "doesn't conflict with a stub for 'strategy'" do
        f = FakeObject::Fake.new({:strategy => :run}, :strategy => :mock)
        f.strategy.should == :run
      end

      it "uses the mock build strategy" do
        f = FakeObject::Fake.new({:greeting => 'hi'}, :strategy => :mock)
        f.greeting
        f.__strategy__.should == :mock
      end
    end

    context "Hash not provided" do
      it "raises ArgumentError for an array" do
        expect {
          FakeObject::Fake.new []
        }.to raise_error(ArgumentError)
      end

      it "raises ArgumentError for a name and array" do
        expect {
          FakeObject::Fake.new 'name', []
        }.to raise_error(ArgumentError)
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


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

    <meta name="keywords" content=""/>
    <meta name="description" content="Tischlerei Leskovsek GmbH, Qualitäts-Handwerk aus Rheda-Wiedenbrück"/>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>

    <link rel="SHORTCUT ICON" href="/layouts/LESKOVSEK/favicon.ico"/>
    <title>Tischlerei Leskovsek :: Start :: Willkommen</title>

Start

Willkommen

Tipp

Unser
                    Betrieb

Leistungen

Bildergalerie

Kontakt

Aktuelles

Auszeichnungen

Riefa-Leichtbauplatte

Impressum

        Website durchsuchen:

        <form accept-charset="ISO-8859-1" method="get" action="http://www.tischlerei-leskovsek.de/mcms/index.php"
              name="search" class="searchform"><input type="hidden" name="action" value="search"/><input type="text"
                                                                                name="query"
                                                                                value=""
                                                                                class="searchtextfield"
                                                                                accesskey="s"/><input
                type="image" name="action" value="search" src="layouts/LESKOVSEK/grafiken/searchicon.gif" alt="Suchen"
                class="searchbutton" title="Suchen"/></form>


text:
<?php

//require_once 'Hamcrest/Core/IsTypeOf.php';

/**
 * Tests whether the value is callable.
 */
class Hamcrest_Type_IsCallable extends Hamcrest_Core_IsTypeOf
{

  /**
   * Creates a new instance of IsCallable
   */
  public function __construct()
  {
    parent::__construct('callable');
  }

  public function matches($item)
  {
    return is_callable($item);
  }

  /**
   * Is the value callable?
   *
   * @factory
   */
  public static function callableValue()
  {
    return new self;
  }

}


text:
{% load staticfiles %}<!doctype html>

    <meta charset="utf-8">
    <title>Project</title>
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{% static 'project/project.css' %}" media="none" onload="if(media!='all')media='all'">


text:
var proxy = require("proxy-stream")

module.exports = reductions

function reductions(stream, iterator, initial) {
    return proxy(stream, transformation)

    function transformation (chunk, next) {
        initial = iterator(initial, chunk)
        next(initial)
    }
}


text:
package learn;

/**
 * Created by idea on 2017/3/4.
 */
public class Examole {
    public static void main (String arg[]){
        ChinaPeople zhang=new ChinaPeople();
        System.out.println("位继承的是这个值"+zhang.getAverHeight());

        zhang.setHeight(139);
        System.out.println("子代真实身高为多少"+zhang.getHeight());
    }
}


text:
using namespace std;

ANMICSimpleMover::ANMICSimpleMover(EnergyCalculator * enerCalc, AnmParameters * anmParameters) :
		ANMICMover(enerCalc, anmParameters){
}

ANMICSimpleMover::~ANMICSimpleMover(){
}

void ANMICSimpleMover::perform_one_movement_cycle(std::vector<Unit*>& units,
		std::vector<double>& targetCoords){
	RandomGenerator random_gen(time(NULL));
	MetropolisAcceptanceCriterion m_criterion(&random_gen);

	double initial_energy = this->enerCalc->calcEnergyWithOnlyShortRangeNonBonding();
	double new_energy;

	bool accepted = true;
	unsigned int m;
	for( m = 0; m < this->anmParameters->getICMaximumStepsPerCycle() && accepted; m++){

		// Apply the rotations
		ANMICMovement::apply_rotations_to_molecule_units( units,
				targetCoords,
				1./anmParameters->getICMaximumStepsPerCycle());

		// Do a metropolis test (only LJ and electrostatic)
		new_energy = enerCalc->calcEnergyWithOnlyShortRangeNonBonding();
		accepted = m_criterion.acceptsThisStep(new_energy,
									initial_energy,
									anmParameters->getICCycleCheckTemp());

		cout<<"DBG: ANM IC Metropolis "<<m_criterion.generateReport()<<endl;
	}

	cout<<"DBG: "<<m<<" of "<<this->anmParameters->getICMaximumStepsPerCycle() <<" iterations performed."<<endl;
	vector<double > tmp(1, anmParameters->getDisplacement()*(m/anmParameters->getICMaximumStepsPerCycle()));
	SystemVars::getModesWriterHandler()->logStepAndVector("max_displacement", tmp);
}


text:
import {EffectPass} from "./EffectPass";
import {ShaderLibrary} from "../shader/ShaderLibrary";
import {GaussianBlurPass} from "./GaussianBlurPass";
import {Texture2D} from "../texture/Texture2D";
import {capabilities, META, TextureFormat, TextureFilter, TextureWrapMode} from "../Helix";
import {FrameBuffer} from "../texture/FrameBuffer";
import {GL} from "../core/GL";
import {Effect} from "./Effect";

/**
 * @classdesc
 * Bloom is an {@linkcode Effect} added to the Camera that allows bright areas in the image to bleed into less bright areas.
 *
 * @property {number} strength The strength of the bloom effect.
 * @property {number} thresholdLuminance The threshold luminance for pixels that are allowed to bleed.
 *
 * @param radius The radius of the bloom effect.
 * @param strength The strength of the bloom effect.
 * @param [downScale] How many times smaller the bloom should be calculated relative to the render target.
 * @param [anisotropy] Defines the ratio between the horizontal and vertical bloom. For the JJ Abrams people among us.
 *
 * @constructor
 *
 * @extends Effect
 *
 * @author derschmale <http://www.derschmale.com>
 */
function Bloom(radius, strength, downScale, anisotropy)
{
    Effect.call(this);

    this._downScale = downScale || 4;

    this._targetWidth = -1;
    this._targetHeight = -1;

    radius = radius || 100;
    radius /= this._downScale;
    this._thresholdPass = new EffectPass(null, ShaderLibrary.get("bloom_threshold_fragment.glsl"));
    this._compositePass = new EffectPass(ShaderLibrary.get("bloom_composite_vertex.glsl"), ShaderLibrary.get("bloom_composite_fragment.glsl"));
    this._blurPass = new GaussianBlurPass(radius);
    this._blurSourceSlot = this._blurPass.getTextureIndex("sourceTexture");
    this._thresholdWidth = -1;
    this._thresholdHeight = -1;

    this._thresholdMaps = [];
    this._smallFBOs = [];

    for (var i = 0; i < 2; ++i) {
        this._thresholdMaps[i] = new Texture2D();
        this._thresholdMaps[i].filter = TextureFilter.BILINEAR_NOMIP;
        this._thresholdMaps[i].wrapMode = TextureWrapMode.CLAMP;
        this._smallFBOs[i] = new FrameBuffer([this._thresholdMaps[i]]);
    }

    this._anisotropy = anisotropy || 1;

    this._strength = strength === undefined ? 1.0 : strength;

    if (capabilities.EXT_HALF_FLOAT_TEXTURES_LINEAR && capabilities.EXT_HALF_FLOAT_TEXTURES)
        this.thresholdLuminance = META.OPTIONS.hdr;
    else
        this.thresholdLuminance = .9;

    this._compositePass.setTexture("bloomTexture", this._thresholdMaps[0]);

    this.strength = this._strength;
}

Bloom.prototype = Object.create(Effect.prototype,
    {
        strength: {
            get: function ()
            {
                return this._strength;
            },

            set: function (value)
            {
                this._strength = value;
                this._compositePass.setUniform("strength", this._strength);
            }
        },

        thresholdLuminance: {
            get: function ()
            {
                return this._thresholdLuminance;
            },

            set: function (value)
            {
                this._thresholdLuminance = value;
                this._thresholdPass.setUniform("threshold", value)
            }
        }
    }
);

/**
 * @ignore
 */
Bloom.prototype._initTextures = function ()
{
    for (var i = 0; i < 2; ++i) {
        this._thresholdWidth = Math.ceil(this._targetWidth / this._downScale);
        this._thresholdHeight = Math.ceil(this._targetHeight / this._downScale);
        this._thresholdMaps[i].initEmpty(this._thresholdWidth, this._thresholdHeight, TextureFormat.RGB, capabilities.HDR_DATA_TYPE);
        this._smallFBOs[i].init();
    }
};

/**
 * @ignore
 */
Bloom.prototype.draw = function (renderer, dt)
{
    if (this._renderer._width !== this._targetWidth || this._renderer._height !== this._targetHeight) {
        this._targetWidth = this._renderer._width;
        this._targetHeight = this._renderer._height;
        this._initTextures();
    }

    GL.setRenderTarget(this._smallFBOs[0]);
    GL.clear();
    this._thresholdPass.draw(renderer);

    GL.setRenderTarget(this._smallFBOs[1]);
    GL.clear();
    this._blurPass.setTextureByIndex(this._blurSourceSlot, this._thresholdMaps[0]);
    this._blurPass.setUniform("stepSize", {x: 1.0 / this._thresholdWidth, y: 0.0});
	this._blurPass.draw(renderer);

    GL.setRenderTarget(this._smallFBOs[0]);
    GL.clear();
	this._blurPass.setTextureByIndex(this._blurSourceSlot, this._thresholdMaps[1]);
    this._blurPass.setUniform("stepSize", {x: 0.0, y: this._anisotropy / this._thresholdHeight});
	this._blurPass.draw(renderer);

    GL.setRenderTarget(this.hdrTarget);
    GL.clear();
	this._compositePass.draw(renderer);
};

export { Bloom };


text:
#include "map/hdr_map.h"
#include <cds/container/michael_list_hp.h>
#include <cds/container/split_list_map.h>

namespace map {

    namespace {
        struct HP_cmp_traits: public cc::split_list::type_traits
        {
            typedef cc::michael_list_tag                ordered_list    ;
            typedef HashMapHdrTest::hash_int            hash            ;
            typedef HashMapHdrTest::simple_item_counter item_counter    ;
            typedef cc::opt::v::relaxed_ordering        memory_model    ;
            enum { dynamic_bucket_table = false };

            struct ordered_list_traits: public cc::michael_list::type_traits
            {
                typedef HashMapHdrTest::cmp   compare ;
            } ;
        };

        struct HP_less_traits: public cc::split_list::type_traits
        {
            typedef cc::michael_list_tag                ordered_list    ;
            typedef HashMapHdrTest::hash_int            hash            ;
            typedef HashMapHdrTest::simple_item_counter item_counter    ;
            typedef cc::opt::v::sequential_consistent                      memory_model    ;
            enum { dynamic_bucket_table = false };

            struct ordered_list_traits: public cc::michael_list::type_traits
            {
                typedef HashMapHdrTest::less   less ;
            };
        };

        struct HP_cmpmix_traits: public cc::split_list::type_traits
        {
            typedef cc::michael_list_tag                ordered_list    ;
            typedef HashMapHdrTest::hash_int            hash            ;
            typedef HashMapHdrTest::simple_item_counter item_counter    ;

            struct ordered_list_traits: public cc::michael_list::type_traits
            {
                typedef HashMapHdrTest::cmp   compare ;
                typedef std::less<HashMapHdrTest::key_type>     less ;
            };
        };
    }

    void HashMapHdrTest::Split_HP_cmp()
    {
        // traits-based version
        typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmp_traits > map_type     ;
        test_int< map_type >()  ;

        // option-based version
        typedef cc::SplitListMap< cds::gc::HP,
            key_type,
            value_type,
            cc::split_list::make_traits<
                cc::split_list::ordered_list<cc::michael_list_tag>
                ,cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
                ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
                ,cc::split_list::dynamic_bucket_table< true >
                ,cc::split_list::ordered_list_traits<
                    cc::michael_list::make_traits<
                        cc::opt::compare< cmp >
                    >::type
                >
            >::type
        > opt_map   ;
        test_int< opt_map >()  ;
    }

    void HashMapHdrTest::Split_HP_less()
    {
        // traits-based version
        typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_less_traits > map_type     ;
        test_int< map_type >()  ;

        // option-based version
        typedef cc::SplitListMap< cds::gc::HP,
            key_type,
            value_type,
            cc::split_list::make_traits<
                cc::split_list::ordered_list<cc::michael_list_tag>
                ,cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
                ,cc::opt::memory_model< cc::opt::v::relaxed_ordering >
                ,cc::split_list::dynamic_bucket_table< true >
                ,cc::split_list::ordered_list_traits<
                    cc::michael_list::make_traits<
                        cc::opt::less< less >
                    >::type
                >
            >::type
        > opt_map   ;
        test_int< opt_map >()  ;
    }

    void HashMapHdrTest::Split_HP_cmpmix()
    {
        // traits-based version
        typedef cc::SplitListMap< cds::gc::HP, key_type, value_type, HP_cmpmix_traits > map_type   ;
        test_int< map_type >()  ;

        // option-based version
        typedef cc::SplitListMap< cds::gc::HP,
            key_type,
            value_type,
            cc::split_list::make_traits<
                cc::split_list::ordered_list<cc::michael_list_tag>
                ,cc::opt::hash< hash_int >
                ,cc::opt::item_counter< simple_item_counter >
                ,cc::split_list::ordered_list_traits<
                    cc::michael_list::make_traits<
                    cc::opt::less< std::less<key_type> >
                        ,cc::opt::compare< cmp >
                    >::type
                >
            >::type
        > opt_map   ;
        test_int< opt_map >()  ;
    }

} // namespace map


text:
Talks & Presentations

I've presented at conferences and given talks to students.

Storytelling for Engineers [+]

Venue: University of Houston Cullen College of Engineering PROMES Maximizing Your Power Weekend 2012

Date: 7-8 September 2012

Slides:

  Storytelling for Engineers  from Steve Myles

University of Houston Engineering Summer Camp - Young Engineers Panel Discussion [+]

Description: Panel discussion for a UH Engineering Summer Camp for high school students.  The panel featured young engineers from across HP, sharing information about the transition from school to work and the different careers available to engineers.

Venue: Hewlett-Packard Company

Date: 21 June 2012

Projecting Outsourced Contact Center Agent Availability [+]

Presenters: Steven Myles, Viroj Buraparate, and Sunil Kumar G.

Venue: University of Pennsylvania Wharton Financial Institutions Center Contact Center Forum 2008

Date: 28-29 February 2008

Forecasting and Planning Diagnostic Techniques for Service Operations [+]

Presenters: Steven Myles, Viroj Buraparate, and Atul Dhawan

Venue: INFORMS 2007

Date: 4-7 November 2007

Inventory Control for Automated Drug Dispensing Machines: A Service Level Policy [+]

Presenters: John E. Kobza, Steven Myles, Sean Dunagan, Garrett Heath, Surya D. Liman

Venue: INFORMS 2007

Date: 4-7 November 2007

Slides:

  Inventory Control For Automated Drug Dispensing Machines  from Steve Myles

Optimization Strategies for Resolving Inventory Problems in Customer Service Repair Centers [+]

Presenters: Steven Myles, Viroj Buraparate, and Terrell Thruston

Venue: INFORMS 2005

Date: 13-16 November 2005

Optimal Call Center Capacity Allocation Model [+]

Presenters: Will Lin, Atul Dhawan, Steven Myles, and Saravanan Venkatachalam

Venue: INFORMS 2005

Date: 13-16 November 2005


text:
<ion-header no-border>
  <ion-navbar>
    <ion-buttons end *ngIf="showSkip">
      <button ion-button (click)="startApp()" color="primary">Skip</button>
    </ion-buttons>
  </ion-navbar>
</ion-header>

<ion-content no-bounce>
  <ion-slides #slides (ionSlideWillChange)="onSlideChangeStart($event)" pager>

    <ion-slide>

        Welcome to ICA

        The ionic conference app is a practical preview of the ionic framework in action, and a demonstration of proper code use.

    </ion-slide>

    <ion-slide>

What is Ionic?

Ionic Framework is an open source SDK that enables developers to build high quality mobile apps with web technologies like HTML, CSS, and JavaScript.

    </ion-slide>

    <ion-slide>

What is Ionic Platform?

The Ionic Platform is a cloud platform for managing and scaling Ionic apps with integrated services like push notifications, native builds, user auth, and live updating.

    </ion-slide>

    <ion-slide>

Ready to Play?

      <button ion-button icon-end large clear (click)="startApp()">
        Continue
        <ion-icon name="arrow-forward"></ion-icon>
      </button>
    </ion-slide>

  </ion-slides>
</ion-content>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Octokit.Tests.Conventions
{
    public class EnumMissingParameterAttributeException : Exception
    {
        public EnumMissingParameterAttributeException(Type enumType, IEnumerable<FieldInfo> enumMembers)
            : base(CreateMessage(enumType, enumMembers))
        { }

        static string CreateMessage(Type enumType, IEnumerable<FieldInfo> enumMembers)
        {
            return string.Format("Enum type '{0}' contains the following members that are missing the Parameter attribute: {1}{2}",
                enumType.FullName,
                Environment.NewLine,
                string.Join(Environment.NewLine, enumMembers.Select(x => x.Name)));
        }
    }
}


text:
#ifndef TEST_CHECK_ARGV
#define TEST_CHECK_ARGV

TCase *argv_tcase(void);

#endif /* TEST_CHECK_ARGV */


text:
package org.anddev.andengine.audio;

/**
 * (c) 2010 Nicolas Gramlich
 * (c) 2011 Zynga Inc.
 *
 * @author Nicolas Gramlich
 * @since 16:35:37 - 13.06.2010
 */
public abstract class BaseAudioEntity implements IAudioEntity {
	// ===========================================================
	// Constants
	// ===========================================================

	// ===========================================================
	// Fields
	// ===========================================================

	private final IAudioManager<? extends IAudioEntity> mAudioManager;

	protected float mLeftVolume = 1.0f;
	protected float mRightVolume = 1.0f;

	// ===========================================================
	// Constructors
	// ===========================================================

	public BaseAudioEntity(final IAudioManager<? extends IAudioEntity> pAudioManager) {
		this.mAudioManager = pAudioManager;
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	protected IAudioManager<? extends IAudioEntity> getAudioManager() {
		return this.mAudioManager;
	}

	public float getActualLeftVolume() {
		return this.mLeftVolume * this.getMasterVolume();
	}

	public float getActualRightVolume() {
		return this.mRightVolume * this.getMasterVolume();
	}

	protected float getMasterVolume() {
		return this.mAudioManager.getMasterVolume();
	}

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	@Override
	public float getVolume() {
		return (this.mLeftVolume + this.mRightVolume) * 0.5f;
	}

	@Override
	public float getLeftVolume() {
		return this.mLeftVolume;
	}

	@Override
	public float getRightVolume() {
		return this.mRightVolume;
	}

	@Override
	public final void setVolume(final float pVolume) {
		this.setVolume(pVolume, pVolume);
	}

	@Override
	public void setVolume(final float pLeftVolume, final float pRightVolume) {
		this.mLeftVolume = pLeftVolume;
		this.mRightVolume = pRightVolume;
	}

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package caillou.company.clonemanager.gui.customComponent.excludeTree;

import caillou.company.clonemanager.gui.customComponent.common.Controller;
import caillou.company.clonemanager.gui.customComponent.common.contract.DialogWrapper;
import caillou.company.clonemanager.gui.customComponent.common.contract.DirectoryLazyCheckableTreeItem;
import caillou.company.clonemanager.gui.customComponent.excludeTree.impl.FactoryDirectoryCheckableTreeItem;
import java.io.File;
import java.io.FileFilter;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBoxTreeItem;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.control.cell.CheckBoxTreeCell;
import javafx.scene.layout.VBox;
import org.controlsfx.dialog.Dialog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

/**
 *
 * @author pierre
 */
@org.springframework.stereotype.Controller
@Scope(value = "prototype")
public class ExcludeTreeController extends Controller<ExcludeModel> implements DialogWrapper{

    @FXML
    private VBox rootId;

    @FXML
    private TreeView<DirectoryLazyCheckableTreeItem> treeView;

    private TreeItem<DirectoryLazyCheckableTreeItem> root;

    private FactoryDirectoryCheckableTreeItem factoryDirectoryCheckableTreeItem;

    private Dialog wrappingDialog;

    FileFilter directoryFilter = new FileFilter() {

        @Override
        public boolean accept(File pathname) {
            if (pathname.isDirectory()) {
                return true;
            } else {
                return false;
            }
        }
    };

    public void buildTreeLazily(final TreeItem<DirectoryLazyCheckableTreeItem> currentItem, int nbPass) {
        if (nbPass == 0) {
            return;
        }

        boolean lazyChilds = nbPass > 2;
        DirectoryLazyCheckableTreeItem currentItemValue = currentItem.getValue();
        final ExcludeTreeController excludeControllerInstance = this;

        File currentDirectory = new File(currentItemValue.getAbsolutePath());
        if (!currentDirectory.canRead()) {
            return;
        }

        currentItemValue.setLoaded(lazyChilds);
        currentItem.getChildren().clear();

        for (File subFile : currentDirectory.listFiles(directoryFilter)) {
            TreeItem<DirectoryLazyCheckableTreeItem> children = new CheckBoxTreeItem<>(this.factoryDirectoryCheckableTreeItem.createItem(subFile.getAbsolutePath()));
            this.buildTreeLazily(children, nbPass - 1);
            currentItem.getChildren().add(children);
        }

        if (nbPass == 2) {
            currentItem.expandedProperty().addListener(new ChangeListener<Boolean>() {
                @Override
                public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
                    excludeControllerInstance.buildTreeLazily(currentItem, 3);
                    currentItem.expandedProperty().removeListener(this);
                }
            });
        }

    }

       public void buildTreeLazily(final CheckBoxTreeItem<DirectoryLazyCheckableTreeItem> currentItem, int nbPass) {
        if (nbPass == 0) {
            return;
        }

        boolean lazyChilds = nbPass > 2;
        DirectoryLazyCheckableTreeItem currentItemValue = currentItem.getValue();
        final ExcludeTreeController excludeControllerInstance = this;

        File currentDirectory = new File(currentItemValue.getAbsolutePath());
        if (!currentDirectory.canRead()) {
            return;
        }

        currentItemValue.setLoaded(lazyChilds);
        currentItem.getChildren().clear();

        for (File subFile : currentDirectory.listFiles(directoryFilter)) {
            DirectoryLazyCheckableTreeItem childrenDirectoryLazyCheckableTreeItem = this.factoryDirectoryCheckableTreeItem.createItem(subFile.getAbsolutePath());
            CheckBoxTreeItem<DirectoryLazyCheckableTreeItem> children = new CheckBoxTreeItem<>(childrenDirectoryLazyCheckableTreeItem);
            children.setSelected(!this.getModel().isExcludedByUser(subFile.toPath()));
            final ExcludeModel excludeModel = this.getModel();
            final File tmpFile = subFile;
            children.selectedProperty().addListener(new ChangeListener<Boolean>(){
                @Override
                public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
                    if(newValue){
                       excludeModel.removeExclusionByUser(tmpFile.toPath());
                    }else{
                        excludeModel.addExclusionByUser(tmpFile.toPath());
                    }
                }
            });

            this.buildTreeLazily(children, nbPass - 1);
            currentItem.getChildren().add(children);
        }

        if (nbPass == 2) {
            currentItem.expandedProperty().addListener(new ChangeListener<Boolean>() {
                @Override
                public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
                    excludeControllerInstance.buildTreeLazily(currentItem, 3);
                    currentItem.expandedProperty().removeListener(this);
                }
            });
        }

    }

    public void initialiseRootDirectory() {
        DirectoryLazyCheckableTreeItem rootValue = this.factoryDirectoryCheckableTreeItem.createItem(this.getModel().getPath());
        final CheckBoxTreeItem<DirectoryLazyCheckableTreeItem> rootItem = new CheckBoxTreeItem<>(rootValue);
        rootItem.setSelected(true);

        this.buildTreeLazily(rootItem, 3);
        treeView.setRoot(rootItem);

        treeView.prefWidthProperty().bind(this.rootId.widthProperty().subtract(10));
        treeView.prefHeightProperty().bind(this.rootId.heightProperty().subtract(10));
        treeView.setCellFactory(CheckBoxTreeCell.<DirectoryLazyCheckableTreeItem>forTreeView());
    }

    @Autowired
    public void setFactoryDirectoryCheckableTreeItem(FactoryDirectoryCheckableTreeItem factoryDirectoryCheckableTreeItem) {
        this.factoryDirectoryCheckableTreeItem = factoryDirectoryCheckableTreeItem;
    }

    @FXML
    private void closeAction(ActionEvent event) {
        this.wrappingDialog.hide();
    }

    @Override
    public void setWrappingDialog(Dialog wrappingDialog) {
        this.wrappingDialog = wrappingDialog;
    }

    @Override
    public Dialog getWrappingDialog() {
        return this.wrappingDialog;
    }
}