text:
function [h, missL, missM, missR] = roadDetection(FILENAME, method)
% ROADDETECTION display road detection result of the image file
% specified by the string FILENAME.
% Based on the static road scene image, the algorithm extract two road
% boundaries and middle lane-marking using straight line model.
%
% This code is the implementation of the approach proposed in the paper
% An Illumination-Robust Approach for Feature-Based Road Detection
% (Zhenqiang Ying, Ge Li, Guozhen Tan) in
% 2015 IEEE International Symposium on Multimedia (ISM).
%
%  h - handle of figure
%  missL - left road boundary not found
%  missM - middle lane making not found
%  missR - right road bouddary not found
%
%  method - string, specify the road feature extractor
%
%
%   Example
%   -------
%   Test on Roma dataset.
%      roma_BDXD54 = 'F:\Documents\MATLAB\dataset\roma\BDXD54\*.jpg';
%      figs = foreach_file_do(roma_BDXD54, @roadDetection);
%
%   Project website: https://github.com/baidut/openvehiclevision
%   Copyright 2015-2016 Zhenqiang Ying.

	[~,name,~] = fileparts(FILENAME);
    h = figure('NumberTitle', 'off', 'Name', name);

    %disp(['Processing: ' name]);

    RawImg = imread(FILENAME);
    %BlurImg = imgaussfilt(RawImg, 2);

    % Resize image to improve speed.
    ResizedImg = imresize(RawImg, [150, 200]);

    imshow(ResizedImg);

    % Proposed approach can be divided to 2 steps, road detection and lane
    % marking detection.
    % rHorizon is the index of row where horizontal line locates.
    % cBoundaryL/R specify the boundary points of rows below horizon line.
    % thetaSet is the set of possible thetas of lane marking line.

    [rHorizon,cBoundaryL,cBoundaryR,thetaSet,missL,missR] = dtRoadBoundary(ResizedImg, method);
    missM = dtLaneMarking(ResizedImg,rHorizon,cBoundaryL,cBoundaryR,thetaSet);
end

function [rHorizon, cBoundaryL, cBoundaryR, thetaSet, missL, missR] = dtRoadBoundary(RGB, method)
%% init params
    [nRow, nCol, nChannel] = size(RGB);
    rSplit = ceil(nRow/3);
    cSplit = ceil(nCol/2);

    thetaRange = 15:75;

    if nChannel ~= 3
        disp('Color image is needed for road boundary detection.');
        return;
    end
%% image preprocessing

    % Region of interest determination - lower 3/4
    ROI = RGB(rSplit:end,:,:);
    nRowRoi = size(ROI, 1);

    % Image gray value conversion - S2 feature extraction
    switch lower(method)
        case {'ours','s2','s-prime'}
            B = ROI(:,:,3);
            V = max(ROI,[],3);
            feature = double(V - B) ./ double(V + 1); % S2
        case 'y'
            feature = 1-rgb2gray(im2double(ROI));
            % so that the road face is darker than vegetation
        case 'h'
            hsv = rgb2hsv(ROI);
            feature = hsv(:,:,1);
        case 's'
            hsv = rgb2hsv(ROI);
            feature = hsv(:,:,2);
        otherwise
            error('unknown feature extractor.');
    end

    %% Image segmentation
    % Filter out lane markings and objects
    Filtered = medfilt2(feature, [1, 10]);
    S2_BW = im2bw(Filtered, graythresh(Filtered(Filtered>mean(Filtered(:)))));

    Boundaries = S2_BW; %S2_BW&(~LaneMarking);

%% Boundary points extraction

    Candidate = zeros(nRowRoi, nCol);
    BoundaryL = zeros(nRowRoi, cSplit);
    BoundaryR = zeros(nRowRoi, nCol - cSplit);

    % bottom-up scan
    for c = 1 : nCol % for each column
        r = find(Boundaries(:,c),1,'last');
        Candidate(r, c) = 1;
    end

    % middle-side scan
    for r = 1 : nRowRoi
        c1 = find(Candidate(r,1:cSplit),1,'last');
        c2 = find(Candidate(r,cSplit+1:end),1,'first');
        BoundaryL(r, c1) = 1;
        BoundaryR(r, c2) = 1;
    end

    imdump(3, feature, S2_BW, Boundaries, Candidate, BoundaryL, BoundaryR);

%% Road boundary model fitting
    houghL = figure;
    lineL = bwFitLine(BoundaryL, thetaRange);
    houghR = figure;
    lineR = bwFitLine(BoundaryR, -thetaRange);

    imdump(3,houghL,houghR);
    close(houghL,houghR);

    thetaRight = thetaRange(2);
    thetaLeft = -thetaRange(2);

    missL = isempty(lineL);
    if missL
       disp('Fail in left boundary line fitting.');
    else
       thetaRight = floor(lineL.theta - 20);
       thetaRight = max(thetaRight, thetaRange(1));
       lineL.move([0, rSplit]);
       hold on, lineL.plot('LineWidth',3,'Color','yellow');
    end

    missR = isempty(lineR);
    if missR
       disp('Fail in right boundary line fitting.');
    else
       thetaLeft = floor(lineR.theta + 20);
       thetaLeft = min(thetaLeft, -thetaRange(1));
       lineR.move([cSplit, rSplit]);
       hold on, lineR.plot('LineWidth',3,'Color','green');
    end

    thetaSet = thetaLeft:thetaRight;

    if ~isempty(lineL) && ~isempty(lineR)
        PointO = lineL.cross(lineR);
        PointL = [lineL.row(nRow), nRow];
        PointR = [lineR.row(nRow), nRow];

        rHorizon = max(1,floor(PointO(2)));
        cBoundaryL = lineL.row(rHorizon:nRow);
        cBoundaryR = lineR.row(rHorizon:nRow);

        % Plot results
        hold on;

        % lines
        lineH = LineObj([1, rHorizon], [nCol, rHorizon]);
        lineH.plot('LineWidth',3,'Color','blue');
        % extend lines
        lineExL = LineObj(PointO, PointL);
        lineExL.plot('LineWidth',1,'Color','yellow');
        lineExR = LineObj(PointO, PointR);
        lineExR.plot('LineWidth',1,'Color','green');

        % points
        plot(PointO(1), PointO(2), 'ro', 'markersize', 10);
        plot(PointL(1), PointL(2), 'r*');
        plot(PointR(1), PointR(2), 'r*');

        [X, Y] = find(BoundaryL == 1);
        plot(Y, X+rSplit, 'y+');
        [X, Y] = find(BoundaryR == 1);
        plot(Y+cSplit, X+rSplit, 'g+');
    else
        rHorizon = rSplit;
        sz = [nRow - rHorizon + 1, 1];
        cBoundaryL = repmat(10, sz);
        cBoundaryR = repmat(nCol - 10, sz);
        % +/- 10 for avoiding mistaking boudaries as lane markings
    end

end

function line = bwFitLine(BW, Theta)
% fit line using non-zero pixels in a binary image by Hough Transform

	[H,theta,rho] = hough(BW, 'Theta', Theta);

    %% Show Hough Transform Result.
    imshow(H,[],'XData',theta,'YData',rho,'InitialMagnification','fit');
    xlabel('\theta'), ylabel('\rho');
    axis on, axis normal;

	P = houghpeaks(H, 1);

	lines = houghlines(BW,theta,rho,P, 'MinLength',10, 'FillGap',570);

	if length(lines) > 1, lines = lines(1); end

    if isempty(lines), line = []; return; end

	line = LineObj(lines.point1, lines.point2);

    % Plot peak points
    hold on;
    plot(theta(P(:,2)),rho(P(:,1)),'s','color','white');
end

function missM = dtLaneMarking(Img,rHorizon,cBoundaryL,cBoundaryR,thetaSet)

%%  Region of interest adjustment
    %ROI = Img(rHorizon:end,:,1);
    ROI = Img(rHorizon:end,:,:);
    V_ROI = im2double(max(ROI, [], 3)); % Note!

%%  Lane-marking feature extraction
    [nRow, nCol, ~] = size(ROI);
    I2 = zeros(nRow, nCol);

    for r = 1 : nRow
        mw = ceil(5 * r / nRow); % marking width
        for c =   ceil(max(cBoundaryL(r),   1) + 5*mw):1 ...
                :floor(min(cBoundaryR(r),nCol) - 5*mw)
            I2(r, c) = 2*V_ROI(r,c) - (V_ROI(r,c-mw) + V_ROI(r,c+mw)) ...
                                 - abs(V_ROI(r,c-mw) - V_ROI(r,c+mw));
        end
    end

    Marking = im2bw(I2, graythresh(I2(I2 ~= 0)));

    imdump(3, ROI, I2, Marking);

%% Lane model fitting
    houghM = figure;
    line = bwFitLine(Marking, thetaSet);

    imdump(3, houghM);
    close(houghM);

    missM = isempty(line);
    if missM
        disp('Fail in lane markings detection.');
    else
        PointS = [line.row(1), rHorizon]; % start point
        PointE = [line.row(nRow), nRow+rHorizon]; % end point
        lineMarking = LineObj(PointS, PointE);

        % Plot
        lineMarking.plot('LineWidth',3,'Color','red');
    end
end


text:
exports.show = function(indicatorText) {
	$.indicator.show();
	$.container.visible = true;

	switch(indicatorText) {
		case 'REFRESH' :
			$.message.text = "Refreshing";
			break;

		case 'LOGOUT':
			$.message.text = "Logging Out";
			break;

		case 'AUTHORIZE':
			$.message.text = "Authorizing";
			break;

		case 'PROCESSING':
			$.message.text = "Processing";
			break;
		default:
			$.message.text = indicatorText;
	}

	if (indicatorText.length >= 9) {
		$.message.setWidth = Ti.Platform.osname==='android'?'200dp':200;
	} else {
		$.message.width = Ti.Platform.osname==='android'?'140dp':140;
	}
};

// Update the activityIndicator
exports.updateText = function(value){
	$.message.setText(value);
};

//hide activityIndicator
exports.hide = function() {
	$.container.visible = false;
	$.indicator.hide();
};

redpajama_set_name: RedPajamaGithub


text:
from setmagic import settings

def load_setmagic(request):
    return {'setmagic': settings}


text:
<!--
FrozenIsBool False
-->

#Transmitter

##Doc
----

>
> A Transmitter
>
>

----

<small>
View the Transmitter notebook on [NbViewer](http://nbviewer.ipython.org/url/shareyoursystem.ouvaton.org/Transmitter.ipynb)
</small>


text:
#!/usr/bin/make
# WARN: gmake syntax
########################################################
# Makefile for Ansible
#
# useful targets:
#   make sdist ---------------- produce a tarball
#   make srpm ----------------- produce a SRPM
#   make rpm  ----------------- produce RPMs
#   make deb-src -------------- produce a DEB source
#   make deb ------------------ produce a DEB
#   make docs ----------------- rebuild the manpages (results are checked in)
#   make tests ---------------- run the tests (see test/README.md for requirements)
#   make pyflakes, make pep8 -- source code checks

########################################################
# variable section

NAME = ansible
OS = $(shell uname -s)

# Manpages are currently built with asciidoc -- would like to move to markdown
# This doesn't evaluate until it's called. The -D argument is the
# directory of the target file ($@), kinda like `dirname`.
MANPAGES := docs/man/man1/ansible.1 docs/man/man1/ansible-playbook.1 docs/man/man1/ansible-pull.1 docs/man/man1/ansible-doc.1 docs/man/man1/ansible-galaxy.1 docs/man/man1/ansible-vault.1
ifneq ($(shell which a2x 2>/dev/null),)
ASCII2MAN = a2x -L -D $(dir $@) -d manpage -f manpage $<
ASCII2HTMLMAN = a2x -L -D docs/html/man/ -d manpage -f xhtml
else
ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1
endif

PYTHON=python
SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")

# VERSION file provides one place to update the software version
VERSION := $(shell cat VERSION | cut -f1 -d' ')
RELEASE := $(shell cat VERSION | cut -f2 -d' ')

# Get the branch information from git
ifneq ($(shell which git),)
GIT_DATE := $(shell git log -n 1 --format="%ai")
GIT_HASH := $(shell git log -n 1 --format="%h")
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/[-_.\/]//g')
GITINFO = .$(GIT_HASH).$(GIT_BRANCH)
else
GITINFO = ""
endif

ifeq ($(shell echo $(OS) | egrep -c 'Darwin|FreeBSD|OpenBSD|DragonFly'),1)
DATE := $(shell date -j -r $(shell git log -n 1 --format="%at") +%Y%m%d%H%M)
else
DATE := $(shell date --utc --date="$(GIT_DATE)" +%Y%m%d%H%M)
endif

# DEB build parameters
DEBUILD_BIN ?= debuild
DEBUILD_OPTS = --source-option="-I"
DPUT_BIN ?= dput
DPUT_OPTS ?=
DEB_DATE := $(shell LC_TIME=C date +"%a, %d %b %Y %T %z")
ifeq ($(OFFICIAL),yes)
    DEB_RELEASE = $(RELEASE)ppa
    # Sign OFFICIAL builds using 'DEBSIGN_KEYID'
    # DEBSIGN_KEYID is required when signing
    ifneq ($(DEBSIGN_KEYID),)
        DEBUILD_OPTS += -k$(DEBSIGN_KEYID)
    endif
else
    DEB_RELEASE = 100.git$(DATE)$(GITINFO)
    # Do not sign unofficial builds
    DEBUILD_OPTS += -uc -us
    DPUT_OPTS += -u
endif
DEBUILD = $(DEBUILD_BIN) $(DEBUILD_OPTS)
DEB_PPA ?= ppa
# Choose the desired Ubuntu release: lucid precise saucy trusty
DEB_DIST ?= unstable

# pbuilder parameters
PBUILDER_ARCH ?= amd64
PBUILDER_CACHE_DIR = /var/cache/pbuilder
PBUILDER_BIN ?= pbuilder
PBUILDER_OPTS ?= --debootstrapopts --variant=buildd --architecture $(PBUILDER_ARCH) --debbuildopts -b

# RPM build parameters
RPMSPECDIR= packaging/rpm
RPMSPEC = $(RPMSPECDIR)/ansible.spec
RPMDIST = $(shell rpm --eval '%{?dist}')
RPMRELEASE = $(RELEASE)
ifneq ($(OFFICIAL),yes)
    RPMRELEASE = 100.git$(DATE)$(GITINFO)
endif
RPMNVR = "$(NAME)-$(VERSION)-$(RPMRELEASE)$(RPMDIST)"

# MOCK build parameters
MOCK_BIN ?= mock
MOCK_CFG ?=

NOSETESTS ?= nosetests

NOSETESTS3 ?= nosetests-3.5

########################################################

all: clean python

tests:
	PYTHONPATH=./lib $(NOSETESTS) -d -w test/units -v --with-coverage --cover-package=ansible --cover-branches --cover-erase

tests-py3:
	PYTHONPATH=./lib $(NOSETESTS3) -d -w test/units -v --with-coverage --cover-package=ansible --cover-branches --cover-erase

integration:
	test/utils/shippable/integration.sh

authors:
	sh hacking/authors.sh

# Regenerate %.1.asciidoc if %.1.asciidoc.in has been modified more
# recently than %.1.asciidoc.
%.1.asciidoc: %.1.asciidoc.in
	sed "s/%VERSION%/$(VERSION)/" $< > $@

# Regenerate %.1 if %.1.asciidoc or VERSION has been modified more
# recently than %.1. (Implicitly runs the %.1.asciidoc recipe)
%.1: %.1.asciidoc VERSION
	$(ASCII2MAN)

loc:
	sloccount lib library bin

pep8:
	@echo "#############################################"
	@echo "# Running PEP8 Compliance Tests"
	@echo "#############################################"
	-pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 lib/ bin/
	# -pep8 -r --ignore=E501,E221,W291,W391,E302,E251,E203,W293,E231,E303,E201,E225,E261,E241 --filename "*" library/

pyflakes:
	pyflakes lib/ansible/*.py lib/ansible/*/*.py bin/*

clean:
	@echo "Cleaning up distutils stuff"
	rm -rf build
	rm -rf dist
	rm -rf lib/ansible.egg-info/
	@echo "Cleaning up byte compiled python stuff"
	find . -type f -regex ".*\.py[co]$$" -delete
	@echo "Cleaning up editor backup files"
	find . -type f -not -path ./test/units/inventory_test_data/group_vars/noparse/all.yml~ \( -name "*~" -or -name "#*" \) -delete
	find . -type f \( -name "*.swp" \) -delete
	@echo "Cleaning up manpage stuff"
	find ./docs/man -type f -name "*.xml" -delete
	find ./docs/man -type f -name "*.asciidoc" -delete
	find ./docs/man/man3 -type f -name "*.3" -delete
	@echo "Cleaning up output from test runs"
	rm -rf test/test_data
	@echo "Cleaning up RPM building stuff"
	rm -rf MANIFEST rpm-build
	@echo "Cleaning up Debian building stuff"
	rm -rf debian
	rm -rf deb-build
	rm -rf docs/json
	rm -rf docs/js
	@echo "Cleaning up authors file"
	rm -f AUTHORS.TXT
	find . -type f -name '*.pyc' -delete

python:
	$(PYTHON) setup.py build

install:
	$(PYTHON) setup.py install

sdist: clean docs
	$(PYTHON) setup.py sdist

sdist_upload: clean docs
	$(PYTHON) setup.py sdist upload 2>&1 |tee upload.log

rpmcommon: $(MANPAGES) sdist
	@mkdir -p rpm-build
	@cp dist/*.gz rpm-build/
	@sed -e 's#^Version:.*#Version: $(VERSION)#' -e 's#^Release:.*#Release: $(RPMRELEASE)%{?dist}#' $(RPMSPEC) >rpm-build/$(NAME).spec

mock-srpm: /etc/mock/$(MOCK_CFG).cfg rpmcommon
	$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/  --buildsrpm --spec rpm-build/$(NAME).spec --sources rpm-build/
	@echo "#############################################"
	@echo "Ansible SRPM is built:"
	@echo rpm-build/*.src.rpm
	@echo "#############################################"

mock-rpm: /etc/mock/$(MOCK_CFG).cfg mock-srpm
	$(MOCK_BIN) -r $(MOCK_CFG) --resultdir rpm-build/ --rebuild rpm-build/$(NAME)-*.src.rpm
	@echo "#############################################"
	@echo "Ansible RPM is built:"
	@echo rpm-build/*.noarch.rpm
	@echo "#############################################"

srpm: rpmcommon
	@rpmbuild --define "_topdir %(pwd)/rpm-build" \
	--define "_builddir %{_topdir}" \
	--define "_rpmdir %{_topdir}" \
	--define "_srcrpmdir %{_topdir}" \
	--define "_specdir $(RPMSPECDIR)" \
	--define "_sourcedir %{_topdir}" \
	-bs rpm-build/$(NAME).spec
	@rm -f rpm-build/$(NAME).spec
	@echo "#############################################"
	@echo "Ansible SRPM is built:"
	@echo "    rpm-build/$(RPMNVR).src.rpm"
	@echo "#############################################"

rpm: rpmcommon
	@rpmbuild --define "_topdir %(pwd)/rpm-build" \
	--define "_builddir %{_topdir}" \
	--define "_rpmdir %{_topdir}" \
	--define "_srcrpmdir %{_topdir}" \
	--define "_specdir $(RPMSPECDIR)" \
	--define "_sourcedir %{_topdir}" \
	--define "_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm" \
	--define "__python `which $(PYTHON)`" \
	-ba rpm-build/$(NAME).spec
	@rm -f rpm-build/$(NAME).spec
	@echo "#############################################"
	@echo "Ansible RPM is built:"
	@echo "    rpm-build/$(RPMNVR).noarch.rpm"
	@echo "#############################################"

debian: sdist
	@for DIST in $(DEB_DIST) ; do \
	    mkdir -p deb-build/$${DIST} ; \
	    tar -C deb-build/$${DIST} -xvf dist/$(NAME)-$(VERSION).tar.gz ; \
	    cp -a packaging/debian deb-build/$${DIST}/$(NAME)-$(VERSION)/ ; \
        sed -ie "s|%VERSION%|$(VERSION)|g;s|%RELEASE%|$(DEB_RELEASE)|;s|%DIST%|$${DIST}|g;s|%DATE%|$(DEB_DATE)|g" deb-build/$${DIST}/$(NAME)-$(VERSION)/debian/changelog ; \
	done

deb: deb-src
	@for DIST in $(DEB_DIST) ; do \
	    PBUILDER_OPTS="$(PBUILDER_OPTS) --distribution $${DIST} --basetgz $(PBUILDER_CACHE_DIR)/$${DIST}-$(PBUILDER_ARCH)-base.tgz --buildresult $(CURDIR)/deb-build/$${DIST}" ; \
	    $(PBUILDER_BIN) create $${PBUILDER_OPTS} --othermirror "deb http://archive.ubuntu.com/ubuntu $${DIST} universe" ; \
	    $(PBUILDER_BIN) update $${PBUILDER_OPTS} ; \
	    $(PBUILDER_BIN) build $${PBUILDER_OPTS} deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}.dsc ; \
	done
	@echo "#############################################"
	@echo "Ansible DEB artifacts:"
	@for DIST in $(DEB_DIST) ; do \
	    echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
	done
	@echo "#############################################"

# Build package outside of pbuilder, with locally installed dependencies.
# Install BuildRequires as noted in packaging/debian/control.
local_deb: debian
	@for DIST in $(DEB_DIST) ; do \
	    (cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -b) ; \
	done
	@echo "#############################################"
	@echo "Ansible DEB artifacts:"
	@for DIST in $(DEB_DIST) ; do \
	    echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
	done
	@echo "#############################################"

deb-src: debian
	@for DIST in $(DEB_DIST) ; do \
	    (cd deb-build/$${DIST}/$(NAME)-$(VERSION)/ && $(DEBUILD) -S) ; \
	done
	@echo "#############################################"
	@echo "Ansible DEB artifacts:"
	@for DIST in $(DEB_DIST) ; do \
	    echo deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
	done
	@echo "#############################################"

deb-upload: deb
	@for DIST in $(DEB_DIST) ; do \
	    $(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_amd64.changes ; \
	done

deb-src-upload: deb-src
	@for DIST in $(DEB_DIST) ; do \
	    $(DPUT_BIN) $(DPUT_OPTS) $(DEB_PPA) deb-build/$${DIST}/$(NAME)_$(VERSION)-$(DEB_RELEASE)~$${DIST}_source.changes ; \
	done

# for arch or gentoo, read instructions in the appropriate 'packaging' subdirectory directory

webdocs:
	(cd docsite/; make docs)

docs: $(MANPAGES)

alldocs: docs webdocs


text:
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Twig_' => array($vendorDir . '/twig/twig/lib'),
    'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
    'Symfony\\Component\\Validator\\' => array($vendorDir . '/symfony/validator'),
    'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'),
    'Symfony\\Component\\Stopwatch\\' => array($vendorDir . '/symfony/stopwatch'),
    'Symfony\\Component\\Security\\' => array($vendorDir . '/symfony/security'),
    'Symfony\\Component\\Routing\\' => array($vendorDir . '/symfony/routing'),
    'Symfony\\Component\\PropertyAccess\\' => array($vendorDir . '/symfony/property-access'),
    'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'),
    'Symfony\\Component\\Intl\\' => array($vendorDir . '/symfony/intl'),
    'Symfony\\Component\\Icu\\' => array($vendorDir . '/symfony/icu'),
    'Symfony\\Component\\HttpKernel\\' => array($vendorDir . '/symfony/http-kernel'),
    'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'),
    'Symfony\\Component\\Form\\' => array($vendorDir . '/symfony/form'),
    'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'),
    'Symfony\\Component\\Filesystem\\' => array($vendorDir . '/symfony/filesystem'),
    'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
    'Symfony\\Component\\DomCrawler\\' => array($vendorDir . '/symfony/dom-crawler'),
    'Symfony\\Component\\Debug\\' => array($vendorDir . '/symfony/debug'),
    'Symfony\\Component\\CssSelector\\' => array($vendorDir . '/symfony/css-selector'),
    'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'),
    'Symfony\\Component\\Config\\' => array($vendorDir . '/symfony/config'),
    'Symfony\\Component\\BrowserKit\\' => array($vendorDir . '/symfony/browser-kit'),
    'Symfony\\Bundle\\WebProfilerBundle\\' => array($vendorDir . '/symfony/web-profiler-bundle'),
    'Symfony\\Bridge\\Twig\\' => array($vendorDir . '/symfony/twig-bridge'),
    'Symfony\\Bridge\\Doctrine\\' => array($vendorDir . '/symfony/doctrine-bridge'),
    'Smart' => array($baseDir . '/src'),
    'Silex\\Provider\\' => array($vendorDir . '/silex/web-profiler'),
    'SilexAssetic' => array($vendorDir . '/mheap/silex-assetic/src'),
    'Silex' => array($vendorDir . '/silex/silex/src'),
    'Psr\\Log\\' => array($vendorDir . '/psr/log'),
    'Pimple' => array($vendorDir . '/pimple/pimple/lib'),
    'PayPal\\Service' => array($vendorDir . '/paypal/merchant-sdk-php/lib'),
    'PayPal\\PayPalAPI' => array($vendorDir . '/paypal/merchant-sdk-php/lib'),
    'PayPal\\EnhancedDataTypes' => array($vendorDir . '/paypal/merchant-sdk-php/lib'),
    'PayPal\\EBLBaseComponents' => array($vendorDir . '/paypal/merchant-sdk-php/lib'),
    'PayPal\\CoreComponentTypes' => array($vendorDir . '/paypal/merchant-sdk-php/lib'),
    'PayPal' => array($vendorDir . '/paypal/sdk-core-php/lib'),
    'Monolog' => array($vendorDir . '/monolog/monolog/src'),
    'Entities\\' => array($baseDir . '/src'),
    'Doctrine\\ORM\\' => array($vendorDir . '/doctrine/orm/lib'),
    'Doctrine\\DBAL\\' => array($vendorDir . '/doctrine/dbal/lib'),
    'Doctrine\\Common\\Lexer\\' => array($vendorDir . '/doctrine/lexer/lib'),
    'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib'),
    'Doctrine\\Common\\Collections\\' => array($vendorDir . '/doctrine/collections/lib'),
    'Doctrine\\Common\\Cache\\' => array($vendorDir . '/doctrine/cache/lib'),
    'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'),
    'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'),
    'Dflydev\\Silex\\Provider\\DoctrineOrm' => array($vendorDir . '/dflydev/doctrine-orm-service-provider/src'),
    'Dflydev\\Pimple\\Provider\\DoctrineOrm' => array($vendorDir . '/dflydev/doctrine-orm-service-provider/src'),
    'Dflydev\\Cilex\\Provider\\DoctrineOrm' => array($vendorDir . '/dflydev/doctrine-orm-service-provider/src'),
    'Assetic' => array($vendorDir . '/kriswallsmith/assetic/src'),
);


text:
require 'test_helper'

describe 'Directives' do
  describe '#directives' do
    describe 'non value directives' do
      it 'accepts public symbol' do
        subject = Lotus::Action::Cache::Directives.new(:public)
        subject.values.size.must_equal(1)
      end

      it 'accepts private symbol' do
        subject = Lotus::Action::Cache::Directives.new(:private)
        subject.values.size.must_equal(1)
      end

      it 'accepts no_cache symbol' do
        subject = Lotus::Action::Cache::Directives.new(:no_cache)
        subject.values.size.must_equal(1)
      end

      it 'accepts no_store symbol' do
        subject = Lotus::Action::Cache::Directives.new(:no_store)
        subject.values.size.must_equal(1)
      end

      it 'accepts no_transform symbol' do
        subject = Lotus::Action::Cache::Directives.new(:no_transform)
        subject.values.size.must_equal(1)
      end

      it 'accepts must_revalidate symbol' do
        subject = Lotus::Action::Cache::Directives.new(:must_revalidate)
        subject.values.size.must_equal(1)
      end

      it 'accepts proxy_revalidate symbol' do
        subject = Lotus::Action::Cache::Directives.new(:proxy_revalidate)
        subject.values.size.must_equal(1)
      end

      it 'does not accept weird symbol' do
        subject = Lotus::Action::Cache::Directives.new(:weird)
        subject.values.size.must_equal(0)
      end

      describe 'multiple symbols' do
        it 'creates one directive for each valid symbol' do
          subject = Lotus::Action::Cache::Directives.new(:private, :proxy_revalidate)
          subject.values.size.must_equal(2)
        end
      end

      describe 'private and public at the same time' do
        it 'ignores public directive' do
          subject = Lotus::Action::Cache::Directives.new(:private, :public)
          subject.values.size.must_equal(1)
        end

        it 'creates one private directive' do
          subject = Lotus::Action::Cache::Directives.new(:private, :public)
          subject.values.first.name.must_equal(:private)
        end
      end
    end

    describe 'value directives' do
      it 'accepts max_age symbol' do
        subject = Lotus::Action::Cache::Directives.new(max_age: 600)
        subject.values.size.must_equal(1)
      end

      it 'accepts s_maxage symbol' do
        subject = Lotus::Action::Cache::Directives.new(s_maxage: 600)
        subject.values.size.must_equal(1)
      end

      it 'accepts min_fresh symbol' do
        subject = Lotus::Action::Cache::Directives.new(min_fresh: 600)
        subject.values.size.must_equal(1)
      end

      it 'accepts max_stale symbol' do
        subject = Lotus::Action::Cache::Directives.new(max_stale: 600)
        subject.values.size.must_equal(1)
      end

      it 'does not accept weird symbol' do
        subject = Lotus::Action::Cache::Directives.new(weird: 600)
        subject.values.size.must_equal(0)
      end

      describe 'multiple symbols' do
        it 'creates one directive for each valid symbol' do
          subject = Lotus::Action::Cache::Directives.new(max_age: 600, max_stale: 600)
          subject.values.size.must_equal(2)
        end
      end
    end

    describe 'value and non value directives' do
      it 'creates one directive for each valid symbol' do
        subject = Lotus::Action::Cache::Directives.new(:public, max_age: 600, max_stale: 600)
        subject.values.size.must_equal(3)
      end
    end
  end
end

describe 'ValueDirective' do
  describe '#to_str' do
    it 'returns as http cache format' do
      subject = Lotus::Action::Cache::ValueDirective.new(:max_age, 600)
      subject.to_str.must_equal('max-age=600')
    end
  end
end

describe 'NonValueDirective' do
  describe '#to_str' do
    it 'returns as http cache format' do
      subject = Lotus::Action::Cache::NonValueDirective.new(:no_cache)
      subject.to_str.must_equal('no-cache')
    end
  end
end


text:
require 'watir-webdriver/extensions/select_text'

module PageObject
  module Platforms
    #
    # Watir implementation of the common functionality found across all elements
    #
    module WatirWebDriver
      module Element

        #
        # return true if an element is visible
        #
        def visible?
          element.present?
        end

        #
        # return true if an element exists
        #
        def exists?
          element.exists?
        end

        #
        # flash the element by temporarily changing the background color
        #
        def flash
          element.flash
        end

        #
        # Get the text for the element
        #
        # @return [String]
        #
        def text
          element.text
        end

        #
        # Get the html for the element
        #
        # @return [String]
        #
        def html
          element.html
        end

        #
        # Get the value of this element
        #
        # @return [String]
        #
        def value
          element.value
        end

        #
        # compare this element to another to determine if they are equal
        #
        def ==(other)
          other.is_a? self.class and element == other.element
        end

        #
        # Get the tag name of this element
        #
        # @return [String]
        #
        def tag_name
          element.tag_name
        end

        #
        # Get the value of a the given attribute of the element.  Will
        # return the current value, even if this has been modified
        # after the page has been loaded. More exactly, this method
        # will  return the value of the given attribute, unless that
        # attribute is not present, in which case the value of the
        # property with the same name is returned. If neither value is
        # set, nil is returned. The "style" attribute is converted as
        # best can be to a text representation with a trailing
        # semi-colon. The following are deemed to be "boolean"
        # attributes, and will return either "true" or "false":
        #
        # async, autofocus, autoplay, checked, compact, complete,
        # controls, declare, defaultchecked, defaultselected, defer,
        # disabled, draggable, ended, formnovalidate, hidden, indeterminate,
        # iscontenteditable, ismap, itemscope, loop, multiple, muted,
        # nohref, noresize, noshade, novalidate, nowrap, open, paused,
        # pubdate, readonly, required, reversed, scoped, seamless, seeking,
        # selected, spellcheck, truespeed, willvalidate
        #
        # Finally, the following commonly mis-capitalized
        # attribute/property names are evaluated as expected:
        #
        # class, readonly
        #
        # @param [String]
        #   attribute name
        # @return [String,nil]
        #   attribute value
        #
        def attribute(attribute_name)
          element.attribute_value attribute_name
        end

        #
        # Fire the provided event on the current element
        #
        def fire_event(event_name)
          element.fire_event(event_name)
        end

        #
        # hover over the element
        #
        def hover
          element.hover
        end

        #
        # double click the element
        #
        def double_click
          element.double_click
        end

        #
        # find the parent element
        #
        def parent
          parent = element.parent
          type = element.type if parent.tag_name.to_sym == :input
          cls = ::PageObject::Elements.element_class_for(parent.tag_name, type)
          cls.new(parent, :platform => @platform.class::PLATFORM_NAME)
        end

        #
        # Set the focus to the current element
        #
        def focus
          element.focus
        end

        #
        # Select the provided text
        #
        def select_text(text)
          element.select_text text
        end

        #
        # Right click on an element
        #
        def right_click
          element.right_click
        end

        #
        # Waits until the element is present
        #
        # @param [Integer] (defaults to: 5) seconds to wait before timing out
        #
        def when_present(timeout=::PageObject.default_element_wait)
          element.wait_until_present(timeout)
          self
        end

        #
        # Waits until the element is not present
        #
        # @param [Integer] (defaults to: 5) seconds to wait before
        # timing out
        #
        def when_not_present(timeout=::PageObject.default_element_wait)
          element.wait_while_present(timeout)
        end

        #
        # Waits until the element is visible
        #
        # @param [Integer] (defaults to: 5) seconds to wait before timing out
        #
        def when_visible(timeout=::PageObject.default_element_wait)
          Object::Watir::Wait.until(timeout, "Element was not visible in #{timeout} seconds") do
            visible?
          end
          self
        end

        #
        # Waits until the element is not visible
        #
        # @param [Integer] (defaults to: 5) seconds to wait before timing out
        #
        def when_not_visible(timeout=::PageObject.default_element_wait)
          Object::Watir::Wait.while(timeout, "Element still visible after #{timeout} seconds") do
            visible?
          end
          self
        end

        #
        # Waits until the block returns true
        #
        # @param [Integer] (defaults to: 5) seconds to wait before timing out
        # @param [String] the message to display if the event timeouts
        # @param the block to execute when the event occurs
        #
        def wait_until(timeout=::PageObject.default_element_wait, message=nil, &block)
          Object::Watir::Wait.until(timeout, message, &block)
        end

        #
        # Send keystrokes to this element
        #
        # @param [String, Symbol, Array]
        #
        # Examples:
        #
        #     element.send_keys "foo"                     #=> value: 'foo'
        #     element.send_keys "tet", :arrow_left, "s"   #=> value: 'test'
        #     element.send_keys [:control, 'a'], :space   #=> value: ' '
        #
        # @see Selenium::WebDriver::Keys::KEYS
        #
        def send_keys(*args)
          element.send_keys(*args)
        end

        #
        # clear the contents of the element
        #
        def clear
          element.clear
        end

        #
        # get the id of the element
        #
        def id
          element.id
        end

        #
        # Scroll until the element is viewable
        #
        def scroll_into_view
          element.wd.location_once_scrolled_into_view
        end

        #
        # location of element (x, y)
        #
        def location
          element.wd.location
        end

        #
        # size of element (width, height)
        #
        def size
          element.wd.size
        end

        #
        # Get height of element
        #
        def height
          element.wd.size['height']
        end

        #
        # Get width of element
        #
        def width
          element.wd.size['width']
        end

        #
        # Get centre coordinates of element
        #
        def centre
          location = element.wd.location
          size = element.wd.size
          {'y' => (location['y'] + (size['height']/2)), 'x' => (location['x'] + (size['width']/2))}
        end
      end
    end
  end
end


text:
package pw.koj.jetstreem.parser;

import pw.koj.jetstreem.compiler.*;
import pw.koj.jetstreem.compiler.ir.*;

public class ImportNode extends Node {
    protected String identifier;

    public ImportNode() {}

    public ImportNode(String identifier) {
        super();
        this.identifier = identifier;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String id) {
        this.identifier = id;
    }

    public Location location() {
        return null;
    }

    public void _dump(Dumper d) {
      //TBD
    }

    public IrNode accept(Visitor visitor) throws CompileError {
        return visitor.visit(this);
    }

}


text:
/* global game, Phaser */
global.smithy = {
    GAME_HEIGHT: 1920,
    GAME_WIDTH: 1080
};
global.game = new Phaser.Game(1080, 1920);
global.print = console.log.bind(console);
game.state.add('Load', require('./State/Load'));
game.state.add('Title', require('./State/Title'));
game.state.add('Main', require('./State/Main'));
game.state.add('Crafting', require('./State/Crafting'));
game.state.start('Load');


text:
<?php

namespace Oro\Bundle\EmailBundle\Form\DataTransformer;

use Doctrine\Common\Util\ClassUtils;
use Doctrine\ORM\EntityManager;

use Symfony\Component\Form\DataTransformerInterface;

class ContextsToViewTransformer implements DataTransformerInterface
{
    /**
     * @var EntityManager
     */
    protected $entityManager;

    public function __construct(EntityManager $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    /**
     * {@inheritdoc}
     */
    public function transform($value)
    {
        if (!$value) {
            return '';
        }

        if (is_array($value)) {
            foreach ($value as $target) {
                $result[] = json_encode([
                    'entityClass' => ClassUtils::getClass($target),
                    'entityId'    => $target->getId(),
                ]);
            }

            $value = implode(';', $result);
        }

        return $value;
    }

    /**
     * {@inheritdoc}
     */
    public function reverseTransform($value)
    {
        return $value;
    }
}


text:
package org.intellij.plugins.xpathView.ui;

import com.intellij.openapi.Disposable;

import javax.swing.*;

public interface InputForm extends Disposable {
    JComponent getComponent();

    JLabel getIcon();

    JButton getEditContextButton();

    JPanel getEditorPanel();
}


text:
/* this comes from the `reuse' library. copy any changes back to the source */

#ifndef _ODE_MEMORY_H_
#define _ODE_MEMORY_H_

#include <ode/odeconfig.h>

#ifdef __cplusplus
extern "C" {
#endif

/* function types to allocate and free memory */
typedef void * dAllocFunction (size_t size);
typedef void * dReallocFunction (void *ptr, size_t oldsize, size_t newsize);
typedef void dFreeFunction (void *ptr, size_t size);

/* set new memory management functions. if fn is 0, the default handlers are
 * used. */
ODE_API void dSetAllocHandler (dAllocFunction *fn);
ODE_API void dSetReallocHandler (dReallocFunction *fn);
ODE_API void dSetFreeHandler (dFreeFunction *fn);

/* get current memory management functions */
ODE_API dAllocFunction *dGetAllocHandler (void);
ODE_API dReallocFunction *dGetReallocHandler (void);
ODE_API dFreeFunction *dGetFreeHandler (void);

/* allocate and free memory. */
ODE_API void * dAlloc (size_t size);
ODE_API void * dRealloc (void *ptr, size_t oldsize, size_t newsize);
ODE_API void dFree (void *ptr, size_t size);

#ifdef __cplusplus
}
#endif

#endif


text:
{% extends "site_base.html" %}

{# This simply allows some older templates within the symposion #}
{# module to fall back and will eventually be phased out.       #}


text:
require 'spec_helper'

module Alchemy
  describe EssencePicture do
    it_behaves_like "an essence" do
      let(:essence)          { EssencePicture.new }
      let(:ingredient_value) { Picture.new }
    end

    it_behaves_like "has image transformations" do
      let(:picture) { build_stubbed(:essence_picture) }
    end

    it "should not store negative values for crop values" do
      essence = EssencePicture.new(:crop_from => '-1x100', :crop_size => '-20x30')
      essence.save!
      expect(essence.crop_from).to eq("0x100")
      expect(essence.crop_size).to eq("0x30")
    end

    it "should not store float values for crop values" do
      essence = EssencePicture.new(:crop_from => '0.05x104.5', :crop_size => '99.5x203.4')
      essence.save!
      expect(essence.crop_from).to eq("0x105")
      expect(essence.crop_size).to eq("100x203")
    end

    it "should convert newlines in caption into
s" do
      essence = EssencePicture.new(:caption => "hello\nkitty")
      essence.save!
      expect(essence.caption).to eq("hello
kitty")
    end

    describe '#picture_url' do
      subject { essence.picture_url(options) }

      let(:options) { {} }
      let(:picture) { build_stubbed(:picture) }
      let(:essence) { build_stubbed(:essence_picture, picture: picture) }

      it "returns the show picture url." do
        is_expected.to match(/\/pictures\/#{picture.id}\/show\/#{picture.urlname}\.#{Config.get(:image_output_format)}/)
      end

      it "includes the secure hash." do
        is_expected.to match(/\?sh=\S+\z/)
      end

      context 'with size in the options' do
        let(:options) { {size: '200x300'} }

        it "includes the size in the url." do
          is_expected.to match(/200x300/)
        end
      end

      context 'with no format in the options' do
        it "includes the default image output format." do
          is_expected.to match(/#{Config.get(:image_output_format)}/)
        end
      end

      context 'with format in the options' do
        let(:options) { {format: 'png'} }

        it "takes this as format." do
          is_expected.to match(/png/)
        end
      end

      context 'with crop sizes set' do
        before do
          expect(essence).to receive(:crop_size).at_least(:once).and_return('200x200')
          expect(essence).to receive(:crop_from).at_least(:once).and_return('10x10')
        end

        it "includes the crop sizes in the url." do
          is_expected.to match(/200x200/)
          is_expected.to match(/10x10/)
        end

        context 'but with crop sizes in the options' do
          let(:options) { {crop_from: '30x30', crop_size: '75x75'} }

          it "includes these crop sizes instead." do
            is_expected.to match(/30x30/)
            is_expected.to match(/75x75/)
          end
        end
      end

      context 'with crop true in the options' do
        let(:options) { {crop: true} }

        it 'converts the value into `crop`' do
          is_expected.to match /crop/
          is_expected.not_to match /true/
        end
      end

      context 'with `image_size` in the options' do
        let(:options) { {image_size: '100x100'} }

        it 'converts the key into `size`' do
          is_expected.to match /100x100/
        end
      end

      context 'with other options' do
        let(:options) { {foo: 'baz'} }

        it 'it removes them from params' do
          is_expected.not_to match /foo/
        end
      end

      context 'without picture assigned' do
        let(:picture) { nil }

        it { is_expected.to be_nil }
      end
    end

    describe '#cropping_mask' do
      subject { essence.cropping_mask }

      context 'with crop values given' do
        let(:essence) { build_stubbed(:essence_picture, crop_from: '0x0', crop_size: '100x100') }

        it "returns a hash containing cropping coordinates" do
          is_expected.to eq({x1: 0, y1: 0, x2: 100, y2: 100})
        end
      end

      context 'with no crop values given' do
        let(:essence) { build_stubbed(:essence_picture) }

        it { is_expected.to be_nil }
      end
    end

    describe '#preview_text' do
      let(:picture) { mock_model(Picture, name: 'Cute Cat Kittens')}
      let(:essence) { EssencePicture.new }

      it "should return the pictures name as preview text" do
        allow(essence).to receive(:picture).and_return(picture)
        expect(essence.preview_text).to eq('Cute Cat Kittens')
      end

      context "with no picture assigned" do
        it "returns empty string" do
          expect(essence.preview_text).to eq('')
        end
      end
    end

    describe '#serialized_ingredient' do
      let(:content) { Content.new }
      let(:picture) { mock_model(Picture, name: 'Cute Cat Kittens', urlname: 'cute-cat-kittens', security_token: 'kljhgfd')}
      let(:essence) { EssencePicture.new(content: content, picture: picture) }

      it "returns the url to render the picture" do
        expect(essence.serialized_ingredient).to eq("/pictures/#{picture.id}/show/#{picture.urlname}.jpg?sh=#{picture.security_token}")
      end

      context 'with image settings given at content' do
        before do
          expect(content).to receive(:settings).and_return({size: '150x150', format: 'png', select_values: [1,2,3]})
        end

        it "returns the url with cropping and resizing options" do
          expect(essence.serialized_ingredient).to eq("/pictures/#{picture.id}/show/150x150/#{picture.urlname}.png?sh=#{picture.security_token}")
        end

        it "rejects options that are not cropping and resizing options" do
          expect(essence.serialized_ingredient).to_not match("select_values")
        end
      end
    end

  end
end


text:
<?php
namespace app\services;

class ParserWriter
{
	const RESULT_CSV_PATH = '/../web/csv/parsed.csv';

	public function resetFile()
	{
		$handle = fopen(__DIR__ . self::RESULT_CSV_PATH, "w+");
		fclose($handle);
	}

	public function write($data)
	{
		$handle = fopen(__DIR__ . self::RESULT_CSV_PATH, "a+");
		fputcsv($handle, $data);
		fclose($handle);
	}
}


text:
package com.intenum.dbBackup.conf;

/**
 * Created by ismail on 29.06.2015.
 */
public class LoggingConfiguration
{
	private int maxFiles;

	public int getMaxFiles()
	{
		return maxFiles;
	}

	public void setMaxFiles( int maxFiles )
	{
		this.maxFiles = maxFiles;
	}
}


text:
<?php

namespace EasyCorp\Bundle\EasyAdminBundle\Configuration;

/**
 * Processes the main menu configuration defined in the "design.menu"
 * option or creates the default config for the menu if none is defined.
 *
 * @author Javier Eguiluz <javier.eguiluz@gmail.com>
 */
class MenuConfigPass implements ConfigPassInterface
{
    public function process(array $backendConfig)
    {
        // process 1st level menu items
        $menuConfig = $backendConfig['design']['menu'];
        $menuConfig = $this->normalizeMenuConfig($menuConfig, $backendConfig);
        $menuConfig = $this->processMenuConfig($menuConfig, $backendConfig);

        $backendConfig['design']['menu'] = $menuConfig;

        // process 2nd level menu items (i.e. submenus)
        foreach ($backendConfig['design']['menu'] as $i => $itemConfig) {
            if (empty($itemConfig['children'])) {
                continue;
            }

            $submenuConfig = $itemConfig['children'];
            $submenuConfig = $this->normalizeMenuConfig($submenuConfig, $backendConfig, $i);
            $submenuConfig = $this->processMenuConfig($submenuConfig, $backendConfig, $i);

            $backendConfig['design']['menu'][$i]['children'] = $submenuConfig;
        }

        return $backendConfig;
    }

    /**
     * Normalizes the different shortcut notations of the menu config to simplify
     * further processing.
     *
     * @param array $menuConfig
     * @param array $backendConfig
     * @param int   $parentItemIndex The index of the parent item for this menu item (allows to treat submenus differently)
     *
     * @return array
     */
    private function normalizeMenuConfig(array $menuConfig, array $backendConfig, $parentItemIndex = -1)
    {
        // if the backend doesn't define the menu configuration: create a default
        // menu configuration to display all its entities
        if (empty($menuConfig)) {
            foreach ($backendConfig['entities'] as $entityName => $entityConfig) {
                $menuConfig[] = ['entity' => $entityName, 'label' => $entityConfig['label']];
            }
        }

        // replaces the short config syntax:
        //   design.menu: ['Product', 'User']
        // by the expanded config syntax:
        //   design.menu: [{ entity: 'Product' }, { entity: 'User' }]
        foreach ($menuConfig as $i => $itemConfig) {
            if (\is_string($itemConfig)) {
                $itemConfig = ['entity' => $itemConfig];
            }

            $menuConfig[$i] = $itemConfig;
        }

        foreach ($menuConfig as $i => $itemConfig) {
            // normalize icon configuration
            if (!\array_key_exists('icon', $itemConfig)) {
                $itemConfig['icon'] = ($parentItemIndex > -1) ? '' : 'fa-folder-open';
            } elseif (empty($itemConfig['icon'])) {
                $itemConfig['icon'] = null;
            } else {
                $itemConfig['icon'] = 'fa-'.$itemConfig['icon'];
            }

            // normalize css_class configuration
            if (!\array_key_exists('css_class', $itemConfig)) {
                $itemConfig['css_class'] = '';
            }

            // normalize submenu configuration (only for main menu items)
            if (-1 === $parentItemIndex && !isset($itemConfig['children'])) {
                $itemConfig['children'] = [];
            }

            // normalize 'default' option, which sets the menu item used as the backend index
            if (!\array_key_exists('default', $itemConfig)) {
                $itemConfig['default'] = false;
            } else {
                $itemConfig['default'] = (bool) $itemConfig['default'];
            }

            // normalize 'target' option, which allows to open menu items in different windows or tabs
            if (!\array_key_exists('target', $itemConfig)) {
                $itemConfig['target'] = false;
            } else {
                $itemConfig['target'] = (string) $itemConfig['target'];
            }

            // normalize 'rel' option, which adds html5 rel attribute (https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types)
            if (!\array_key_exists('rel', $itemConfig)) {
                $itemConfig['rel'] = \array_key_exists('url', $itemConfig) ? 'noreferrer' : false;
            } else {
                $itemConfig['rel'] = (string) $itemConfig['rel'];
            }

            // normalize 'permission' option, which allows to set the security permission needed to see the menu item
            $itemConfig['permission'] = $itemConfig['permission'] ?? null;

            $menuConfig[$i] = $itemConfig;
        }

        return $menuConfig;
    }

    private function processMenuConfig(array $menuConfig, array $backendConfig, $parentItemIndex = -1)
    {
        foreach ($menuConfig as $i => $itemConfig) {
            // these options are needed to find the active menu/submenu item in the template
            $itemConfig['menu_index'] = (-1 === $parentItemIndex) ? $i : $parentItemIndex;
            $itemConfig['submenu_index'] = (-1 === $parentItemIndex) ? -1 : $i;

            // 1st level priority: if 'entity' is defined, link to the given entity
            if (isset($itemConfig['entity'])) {
                $itemConfig['type'] = 'entity';
                $entityName = $itemConfig['entity'];

                if (!\array_key_exists($entityName, $backendConfig['entities'])) {
                    throw new \RuntimeException(sprintf('The "%s" entity included in the "menu" option is not managed by EasyAdmin. The menu can only include any of these entities: %s.', $entityName, implode(', ', array_keys($backendConfig['entities']))));
                }

                if (!isset($itemConfig['label'])) {
                    $itemConfig['label'] = $backendConfig['entities'][$entityName]['label'];
                }

                if (!isset($itemConfig['params'])) {
                    $itemConfig['params'] = [];
                }
            }

            // 2nd level priority: if 'url' is defined, link to the given absolute/relative URL
            elseif (isset($itemConfig['url'])) {
                $itemConfig['type'] = 'link';

                if (!isset($itemConfig['label'])) {
                    throw new \RuntimeException(sprintf('The configuration of the menu item with "url = %s" must define the "label" option.', $itemConfig['url']));
                }
            }

            // 3rd level priority: if 'route' is defined, link to the path generated with the given route
            elseif (isset($itemConfig['route'])) {
                $itemConfig['type'] = 'route';

                if (!isset($itemConfig['label'])) {
                    throw new \RuntimeException(sprintf('The configuration of the menu item with "route = %s" must define the "label" option.', $itemConfig['route']));
                }

                if (!isset($itemConfig['params'])) {
                    $itemConfig['params'] = [];
                }
            }

            // 4th level priority: if 'label' is defined (and not the previous options),
            // this is a menu divider of a submenu title
            elseif (isset($itemConfig['label'])) {
                if (empty($itemConfig['children'])) {
                    // if the item doesn't define a submenu, this is a menu divider
                    $itemConfig['type'] = 'divider';
                } else {
                    // if the item defines a submenu, this is the title of that submenu
                    $itemConfig['type'] = 'empty';
                }
            } else {
                throw new \RuntimeException(sprintf('The configuration of the menu item in the position %d (being 0 the first item) must define at least one of these options: entity, url, route, label.', $i));
            }

            $menuConfig[$i] = $itemConfig;
        }

        return $menuConfig;
    }
}


text: /*# sourceMappingURL=navbar.component.css.map */


text:
<!DOCTYPE html>

{% load static %}

    <meta name="viewport" content="width=device-width, initial-scale=1.0" charset="UTF-8">
    <link href="{% static 'css/bootstrap-responsive.css' %}" rel="stylesheet">
    <link href="{% static 'css/bootstrap-fluid-adj.css' %}" rel="stylesheet">
    <link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" media="screen">

    <title>Rango - {% block title %}How to Tango with Django!{% endblock %}</title>

           <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

           </button>
           Rango

                   {% if user.is_authenticated %}

Welcome, {{ user.username }}!

Logout

                   {% else %}

Register

Login

                   {% endif %}

                   {% if user.is_authenticated %}

Add Category

                   {% endif %}

About

                {% block sidebar %}
                {% endblock %}

        {% block body_block %}
        {% endblock %}

                © Copyright 2048, Your Mom LLC


text:
#include "query/simple_query_executor.h"

#include "core/reader/reader_utils.h"
#include "data/interm_query.h"
#include "data/query_request.h"
#include "data/query_result.h"
#include "index/document_index_manager.h"
#include "utils/logger.h"

namespace redgiant {

DECLARE_LOGGER(logger, __FILE__);

std::unique_ptr<QueryResult> SimpleQueryExecutor::execute(const QueryRequest& request) {
  std::unique_ptr<QueryResult> result = request.create_result();
  // tracking latency of each steps of a query request.
  result->track_latency(QueryResult::kStart);

  std::unique_ptr<IntermQuery> interm_query = model_->process(request);
  if (!interm_query) {
    // query empty, which means some error happens to the ranking model.
    if (request.is_debug()) {
       LOG_INFO(logger, "[query:%s] ranking model not found!", request.get_request_id().c_str());
    }
    result->set_error_status(true);
    result->track_latency(QueryResult::kFinalize);
    return result;
  }

  if (request.is_debug()) {
    LOG_INFO(logger, "[query:%s] searching %zu features built by ranking model.",
        request.get_request_id().c_str(), interm_query->get_features().size());
  }
  result->track_latency(QueryResult::kLoadModel);

  DocumentQuery query(request, *interm_query);
  result->track_latency(QueryResult::kBuildQuery);
  result->track_latency(QueryResult::kQueryStart);

  // execute document query
  std::unique_ptr<DocumentIndexManager::Reader> results_reader = index_->query(request, query);
  size_t query_count = request.get_query_count();
  result->track_latency(QueryResult::kQueryExecute);

  if (!results_reader) {
    if (request.is_debug()) {
      LOG_INFO(logger, "[query:%s] received empty document result.", request.get_request_id().c_str());
    }
    result->track_latency(QueryResult::kFinalize);
    return result;
  }

  auto topn_results = read_topn(*results_reader, query_count);
  if (request.is_debug()) {
    size_t n = 0;
    for (const auto& r: topn_results) {
      LOG_INFO(logger, "[query:%s] result %zu: id:%s, score:%lf.",
          request.get_request_id().c_str(), n++, r.first.to_string().c_str(), r.second);
    }
  }
  result->track_latency(QueryResult::kQueryRead);

  for (const auto& r: topn_results) {
    result->get_results().emplace_back(r.first.to_string(), r.second);
  }
  result->track_latency(QueryResult::kResultConvert);
  result->track_latency(QueryResult::kFinalize);

  return result;
}

} /* namespace redgiant */


text:
title: "Building the SLATE Platform"
overview: SLATE publication
published: true
permalink: blog/building-slate.html
attribution: The SLATE Team
layout: post
type: markdown
---

We describe progress on building the SLATE (Services Layer at the Edge) platform.

 The high level goal of SLATE is to facilitate creation of multi-institutional science computing systems by augmenting the canonical Science DMZ pattern with a generic, "programmable", secure and trusted underlayment platform. This platform permits hosting of advanced container-centric services needed for higher-level capabilities such as data transfer nodes, software and data caches, workflow services and science gateway components. SLATE uses best-of-breed data center virtualization and containerization components, and where available, software defined networking, to enable distributed automation of deployment and service lifecycle management tasks by domain experts. As such it will simplify creation of scalable platforms that connect research teams, institutions and resources to accelerate science while reducing operational costs and development cycle times.

Breen, J., McKee, S., Riedel, B., Stidd, J., Truong, L., Vukotic, I., Bryant, L., Carcassi, G., Chen, J., Gardner, R.W., Harden, R., Izdimirski, M., Killen, R., & Kulbertis, B. (2018). Building the SLATE Platform. Proceedings of the Practice and Experience on Advanced Research Computing. 1 to 7. doi: 10.1145/3219104.3219144.


text:
<?php

class Ess_M2ePro_Model_Resource_Ebay_Account_PickupStore_Log
    extends Ess_M2ePro_Model_Resource_Log_Abstract
{
    //########################################

    public function _construct()
    {
        $this->_init('M2ePro/Ebay_Account_PickupStore_Log', 'id');
    }

    public function getLastActionIdConfigKey()
    {
        return 'ebay_pickup_store';
    }

    //########################################
}


text:
type Listener = (msg: ArrayBuffer[]) => void;
const listeners: Listener[] = [];

window.knAddMessageListener = (cb: Listener) => {
  listeners.push(cb);
};

window.knRemoveMessageListener = (cb: Listener) => {
  const idx = listeners.indexOf(cb);
  if (idx > -1) {
    listeners.splice(idx, 1);
  }
};

function openWS() {
  const ws = new WebSocket('ws://localhost:8100/ws');
  ws.addEventListener('message', (ev) => {
    if (ev.data instanceof Blob) {
      void (async () => {
        const content = await (ev.data as Blob).arrayBuffer();

        for (const listener of listeners) {
          listener([content]);
        }
      })();
    }
  });

  ws.addEventListener('open', () => {
    console.info('Connected to libknossos');
  });
  ws.addEventListener('close', (e) => {
    if (e instanceof CloseEvent) {
      console.info('libknossos WS closed, reconnecting');
    } else {
      console.error(e);
    }
    openWS();
  });
}
openWS();

export {};


text:
#ifndef GROUNDROBOT_GROUNDROBOT_H_
#define GROUNDROBOT_GROUNDROBOT_H_

// 1: Includes
// ----------------------------------------------------------------------------

#include "types.h"

// 2:  Source Specific #defines and types  (typedef, enum, struct)
// ----------------------------------------------------------------------------

// 3: Used namespaces
// ----------------------------------------------------------------------------

// 4: Global Data (Only if absolutely necessary)
// ----------------------------------------------------------------------------

// 5: Class / Functions declarations
// ----------------------------------------------------------------------------

/**
 * Declare the possible directions of the robot
 */
typedef enum
{
    STOP, FORWARD, BACKWARD, TANK_TURN,

} groundrobot_direction_t;

/**
 * Create a container for the robot actions
 */
typedef struct
{
        void (*forward)(sint32 angle, uint32 speed);
        void (*backward)(sint32 angle, uint32 speed);
        void (*tankturn)(sint32 angle, uint32 speed);
        void (*stop)(void);
}groundrobot_actions_t;

#endif /* GROUNDROBOT_GROUNDROBOT_H_ */

/**
 * @}
 */


text:
import React from 'react';
import { connect } from 'react-redux';
import { addCategory } from '../actions';
import CategoryInput from '../components/categories/CategoryInput';
import CategoryForm from '../components/categories/CategoryForm';

type Props = {
	categories: String[],
	onInputChange: () => void,
	onAddCategory: () => void,
};

class Categories extends React.Component {

	state = {
	    showForm: false
	};

	props: Props;

	showForm(e) {
		e.preventDefault();
		this.setState({ showForm: true });
	}

	render() {
		const { categories, onInputChange, onAddCategory } = this.props;

		return (
			<div>
				<CategoryInput
					categories={categories}
					onInputChange={onInputChange} />
			{ this.state.showForm ?
				<CategoryForm onAddCategory={onAddCategory} />
				:
				<button
					onClick={this.showForm.bind(this)}>
					add more categories
				</button>
			}
			</div>
		);
	}
}

const mapStateToProps = (state) => {
    return {
        categories: state.categories
    };
};

const mapDispatchToProps = (dispatch) => {
	return {
		onAddCategory: c => dispatch(addCategory(c))
	};
};

const CategoryContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(Categories);

export default CategoryContainer;


text:
<component name="libraryTable">
  <library name="kinvey-android-lib-2.10.4-">
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/build/intermediates/exploded-aar/kinvey-android-lib-2.10.4/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/build/intermediates/exploded-aar/kinvey-android-lib-2.10.4/res" />
    </CLASSES>
    <JAVADOC />
    <SOURCES />
  </library>
</component>


text:
package vn.cybersoft.summerms.controllers;
/**
 * @author Phạm Văn Năm
 */

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;

import vn.cybersoft.summerms.R;
import vn.cybersoft.summerms.database.DataMonitorHelper;
import vn.cybersoft.summerms.model.App;
import vn.cybersoft.summerms.model.AppAdapter;
import vn.cybersoft.summerms.model.TrafficRecord;
import vn.cybersoft.summerms.model.TrafficSnapshot;
import vn.cybersoft.summerms.tasks.TimeConsumeTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

public class FragmentAllAppUserData extends Fragment {
	private TrafficSnapshot current=null;
	private DataMonitorHelper dataHelper;
	private ListView lsv;
	private List<App> dataset;
	public FragmentAllAppUserData()  {
		// TODO Auto-generated constructor stub
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView=inflater.inflate(R.layout.layout_usage_app_data, container,
				false);
		dataHelper=new DataMonitorHelper(getActivity());
		lsv=(ListView) rootView.findViewById(R.id.lsv_use_app_data);
		getData();
		return rootView;
	}
	private void getData() {

		TimeConsumeTask task = new TimeConsumeTask(getActivity()) {
			@Override
			protected Boolean doInBackground(Void... params) {
				super.doInBackground();
				current=new TrafficSnapshot(getActivity());
				HashSet<Integer> intersection=new HashSet<Integer>(current.getApps().keySet());
				HashMap<String, App> apps=dataHelper.getallAPP();
				dataset=new ArrayList<App>();
				for (Integer uid : intersection) {
					TrafficRecord latest_rec=current.getApps().get(uid);
					if(apps.containsKey(latest_rec.getTag())){
						long rx=Math.abs(latest_rec.getRx()-apps.get(latest_rec.getTag()).getStartdownLoad());
						long tx=Math.abs(latest_rec.getTx()-apps.get(latest_rec.getTag()).getStartupLoad());
						long rm=0,tm=0;
						//update data app
						App app=apps.get(latest_rec.getTag());
						app.setLaststartdownLoad(app.getLaststartdownLoad()+rx);
						app.setLaststartupLoad(app.getLaststartupLoad()+tx);
						app.setStartdownLoad(latest_rec.getRx());
						app.setStartupLoad(latest_rec.getTx());
						//
						rm=(long) ((app.getLaststartdownLoad()/1024)*1.0d);
						tm=(long) ((app.getLaststartupLoad()/1024)*1.0d);
						dataHelper.updateApp(app);
						if((rm+tm)>1) dataset.add(app);
					}
				}
				return true;
			}
			@Override
			protected void onPostExecute(Boolean result) {
				super.onPostExecute(result);
				if (result&&dataset.size()!=0) {
					Collections.sort(dataset, new CustomComparator());
					lsv.setAdapter(new AppAdapter(getActivity(), R.layout.layout_item_app_monitor,(ArrayList<App>) dataset));
				}
			}
		};
		task.execute();
	}
	public class CustomComparator implements Comparator<App> {
	    @Override
	    public int compare(App o1, App o2) {
	        return (int) ((int)((o2.getLaststartupLoad()+o2.getLaststartdownLoad())-o1.getLaststartdownLoad()+o1.getLaststartupLoad()));
	    }
	}
}


text:
class ImageUploader < CarrierWave::Uploader::Base
  include CarrierWave::MiniMagick

  storage :file

  def filename
    "#{mounted_as}.png" if original_filename
  end

  def store_dir
    "#{model.class.to_s.pluralize.underscore}/#{model.id}"
  end

  process convert: :png

  version :small do
    process resize_to_fill: [200, 200]
  end

  version :large do
    process resize_to_fill: [500, 500]
  end
end


text:
/*! Copyright (c) 2011 by Margaret Calvert & Henrik Kubel. All rights reserved. The font has been customised for exclusive use on gov.uk. This cut is not commercially available. */

@font-face {
  font-family: 'nta';
  src: url(/assets/fonts/GDSTransportWebsite-1a1bd902f82aaab4185bc1995206ccdead57a5b0adc91ff8403468fe7047c1b4.eot#) format('embedded-opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'nta';
  src: url(/assets/fonts/GDSTransportWebsite-Bold-a49a59a7c9fc3873b9b864f9185ba79d7848db4b4e0f248ce87a819ee48fff93.eot#) format('embedded-opentype');
  font-weight: bold;
}

@font-face {
  font-family: 'ntatabularnumbers';
  src: url(/assets/fonts/GDSTransportTabular-Light-c45387d8b19c716ac713adceddbbfaafc62bc7f94ee1745cc3497b1afbe7eb58.eot#) format('embedded-opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'ntatabularnumbers';
  src: url(/assets/fonts/GDSTransportTabular-Bold-0cff7dfafbfd65a765046861e6967892b25a903675cb8900b85d2fa4f4554f95.eot#) format('embedded-opentype');
  font-weight: bold;
}


text:
package xworker.ide.worldexplorer.swt.actions;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Button;
import org.xmeta.ActionContext;
import org.xmeta.Bindings;
import org.xmeta.Thing;
import org.xmeta.World;
import org.xmeta.util.UtilString;

import xworker.lang.actions.ActionContainer;
import xworker.lang.executor.Executor;
import xworker.lang.executor.ExecutorService;

public class ActionExecuteViewerThread implements Runnable{
	ActionContext actionContext;
	ActionContext actionThingContext;
	boolean running;
	Button startStopButton;
	Button nextButton;
	private Object lockObj = new Object();
	ActionContainer actions;
	Thing startActionThing;
	Thread thread;
	ExecutorService executorService;

	public ActionExecuteViewerThread(ActionContext actionContext){
		this.actionContext = actionContext;
		startStopButton = actionContext.getObject("startStopButton");
		nextButton = actionContext.getObject("nextButton");
		nextButton.addDisposeListener(new DisposeListener(){
			@Override
			public void widgetDisposed(DisposeEvent event) {
				stop();
			}

		});
		actions = actionContext.getObject("actions");
	}

	public ExecutorService getExecutorService() {
		return executorService;
	}

	public void setExecutorService(ExecutorService executorService) {
		this.executorService = executorService;
	}

	public void checkStatus(){
		Thing actionThing = actionContext.getObject("actionThing");

		if(!running){
			startStopButton.setText(UtilString.getString("lang:d=启动&en=Start", null));
			if(actionThing != null){
				startStopButton.setEnabled(true);
			}else{
				startStopButton.setEnabled(false);
			}
			nextButton.setEnabled(false);
		}else{
			nextButton.setEnabled(true);

			startStopButton.setText(UtilString.getString("lang:d=停止&en=Stop", null));
		}
	}

	public static void next(ActionContext actionContext){
		ActionExecuteViewerThread executeThread = actionContext.getObject("executeThread");
		executeThread.next();
	}

	public void next(){
		synchronized(lockObj){
			lockObj.notify();
		}
	}

	public boolean isActionThing(Thing thing){
		Thing actionThing = actionContext.getObject("actionThing");
		return actionThing.getRoot() == thing.getRoot();
	}

	public void showContext(Thing thing){
		if(!isActionThing(thing)){
			return;
		}

		actions.doAction("showInfo", actionContext, "thing", thing);
		try {
			synchronized(lockObj){
				lockObj.wait();
			}
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	public void start(Thing startActionThing){
		if(!running){
			this.startActionThing = startActionThing;

			thread = new Thread(this);
			thread.start();
		}
	}

	public void stop(){
		synchronized(lockObj){
			running = false;
			lockObj.notify();
		}
	}

	public void run(){
		running = true;
		actionThingContext = actionContext.getObject("actionThingContext");
		try{
			if(executorService != null) {
				Executor.push(executorService);
			}
			Bindings bindings = actionThingContext.push();
			bindings.put("actionExecutor", this);
			bindings.setContextThing(World.getInstance().getThing("xworker.ide.worldexplorer.swt.actions.ActionExecuteViewerContext"));
			if(startActionThing != null){
				Object r = null;
				if(startActionThing.isThingByName("Action")) {
					r = startActionThing.getAction().run(actionThingContext);
				}else {
					r = startActionThing.doAction("run", actionContext);
				}
				final Object result = r;
				nextButton.getDisplay().asyncExec(new Runnable(){
					public void run(){
						actions.doAction("setResult", actionContext, "result", result);
					}
				});

			}
		}catch(final Exception e){
			if(nextButton.isDisposed() == false) {
				nextButton.getDisplay().asyncExec(new Runnable(){
					public void run(){
						actions.doAction("setResult", actionContext, "result", e);
					}
				});
			}
		}finally{
			if(executorService != null) {
				Executor.pop();
			}

			running = false;
			actionThingContext.pop();
			if(nextButton.isDisposed() == false){
				nextButton.getDisplay().asyncExec(new Runnable(){
					public void run(){
						checkStatus();
					}
				});
			}

		}
	}
}


text:
@interface PodsDummy_Pods_DragController : NSObject
@end
@implementation PodsDummy_Pods_DragController
@end


text:
package com.brandwatch.robots.cli;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.validators.PositiveInteger;
import com.brandwatch.robots.RobotsConfig;
import com.brandwatch.robots.cli.converters.CharsetConverter;
import com.brandwatch.robots.cli.converters.URIConverter;
import com.brandwatch.robots.cli.validators.AbsoluteURIValidator;
import com.brandwatch.robots.cli.validators.NonEmptyStringValidator;
import com.google.common.base.Charsets;
import com.google.common.collect.Sets;

import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import java.net.URI;
import java.nio.charset.Charset;
import java.util.List;

import static com.google.common.collect.Lists.newArrayList;

public class Arguments {

    @Parameter(
            names = {"--help", "-h"},
            description = "Display this helpful message.",
            help = true
    )
    private boolean helpRequested = false;

    @Nonnegative
    @Parameter(
            names = {"--maxFileSizeBytes", "-s"},
            description = "Download size limit. robots.txt retrieval will give up beyond this point.",
            validateWith = PositiveInteger.class
    )
    private int maxFileSizeBytes = 192 * 1024;

    @Nonnegative
    @Parameter(
            names = {"--maxRedirectHops", "-r"},
            description = "Number of HTTP 3XX (redirection) responses to follow before giving up.",
            validateWith = PositiveInteger.class
    )
    private int maxRedirectHops = 5;

    @Nonnull
    @Parameter(
            names = {"--excludedDomains", "-x"},
            description = "Set of domains to always consider denied. Will consider, for each domain supplied, both exact matches of and any subdomain thereof to be excluded. Values are comma separated."
    )
    private List<String> excludedDomains = newArrayList();

    @Nonnull
    @Parameter(
            names = {"--defaultCharset", "--charset", "-c"},
            description = "Preferred character encoding for reading robots.txt. Used when server doesn't specify encoding.",
            converter = CharsetConverter.class
    )
    private Charset defaultCharset = Charsets.UTF_8;

    @Nonnull
    @Parameter(
            names = {"--agent", "-a"},
            description = "User agent identifier. Sent to the host on retrieval of robots.txt, and also used for directive group matching.",
            validateWith = NonEmptyStringValidator.class
    )
    private String agent = "<unnamed-agent>";

    @Nonnull
    @Parameter(
            required = true,
            description = "RESOURCES",
            converter = URIConverter.class,
            validateWith = AbsoluteURIValidator.class
    )
    private List<URI> resources = newArrayList();

    @Nonnegative
    @Parameter(
            names = {"--readTimeout", "-t"},
            description = "Time in millis before the client times out while downloading a response payload.",
            validateWith = PositiveInteger.class
    )
    private int readTimeoutMillis = 30000;

    @Nonnegative
    public int getMaxFileSizeBytes() {
        return maxFileSizeBytes;
    }

    @Nonnegative
    public int getMaxRedirectHops() {
        return maxRedirectHops;
    }

    @Nonnull
    public Charset getDefaultCharset() {
        return defaultCharset;
    }

    @Nonnull
    public List<URI> getResources() {
        return resources;
    }

    @Nonnull
    public String getAgent() {
        return agent;
    }

    public boolean isHelpRequested() {
        return helpRequested;
    }

    @Nonnegative
    public int getReadTimeoutMillis() {
        return readTimeoutMillis;
    }

    @Nonnull
    public RobotsConfig buildRobotsConfig() {
        final RobotsConfig config = new RobotsConfig();
        config.setMaxFileSizeBytes(getMaxFileSizeBytes());
        config.setMaxRedirectHops(getMaxRedirectHops());
        config.setDefaultCharset(getDefaultCharset());
        config.setReadTimeoutMillis(getReadTimeoutMillis());
        config.setExcludedDomains(Sets.newHashSet(excludedDomains));
        config.setUserAgent(agent);
        return config;
    }

}


text:
from ztag.annotation import *

class BrotherPrinter(Annotation):

    protocol = protocols.HTTP
    subprotocol = protocols.HTTP.GET
    port = None

    tests = {
      "brother_mfc_8950dtw":{
        "global_metadata":{
          "manufacturer":Manufacturer.BROTHER,
          "device_type":Type.PRINTER,
          "product":"MFC-8950DW",
        },
        "tags":["embedded",]
      },
      "brother_hl_6180dw":{
        "global_metadata":{
          "manufacturer":Manufacturer.BROTHER,
          "device_type":Type.PRINTER,
          "product":"HL-6180DW",
        },
        "tags":["embedded",]
      }

    }

    def process(self, obj, meta):
        title = obj["title"].strip()
        if title.startswith("Brother "):
            meta.global_metadata.manufacturer = Manufacturer.BROTHER
            meta.global_metadata.device_type = Type.PRINTER
            product = title.split(" ", 1)[1]
            product = product.replace("series", "")
            product = product.strip()
            meta.global_metadata.product = product
            meta.tags.add("embedded")
            return meta


text:
(function (window) {
    window.opspark = window.opspark || {};

    window.opspark.makeApp = function (updateable) {
        var
            _stage,
            _canvas,
            _updateable,
            _app;

        _stage  = new createjs.Stage(canvas);
        _canvas = document.getElementById('canvas');
        _updateable = (updateable) ? [].concat(updateable) : [];

        _app = {
            canvas: _canvas,
            stage: _stage,
            view: new createjs.Container(),

            addUpdateable: function(updateable) {
                _updateable.push(updateable);
                return _app;
            },

            removeUpdateable: function(updateable) {
                var index = _updateable.indexOf(updateable);
                if (index !== -1) {
                    _updateable.splice(index, 1);
                }
                return _app;
            },

            update: function(e) {
                for (var i = 0; i < _updateable.length; i++) {
                    _updateable[i].update();
                }
                // always update the stage last //
                _stage.update();
            }
        };

        window.addEventListener('resize', resizeCanvas, false);
        function resizeCanvas(e) {
            _canvas.width = window.innerWidth;
            _canvas.height = window.innerHeight;
            if (e) { _app.update(e) }
        }
        resizeCanvas();

        //_app.stage.addChild(draw.rect(canvas.width, canvas.height, null, '#4F5661', 1));
        _app.stage.addChild(_app.view);
        createjs.Ticker.setFPS(60);
        createjs.Ticker.on('tick', _app.update);

        return _app;
    };
}(window));


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFattureClienti extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('anagrafiche', function($table)
		{
			$table->engine = 'MyISAM';
			$table->increments('id');
			$table->timestamps();
			$table->softDeletes();
			$table->integer('user_id');
			$table->string('cognome', 60);
			$table->string('nome', 60);
			$table->string('indirizzo', 200);
			$table->string('cap', 10);
			$table->string('citta', 50);
			$table->string('provincia', 50);
			$table->string('telefono', 50);
			$table->string('fax', 50);
			$table->string('cellulare', 50);
			$table->string('email', 50);
			$table->string('piva', 60);
			$table->string('cfiscale', 50);
		});

		Schema::create('fattureClienti', function($table)
		{
            $table->engine = 'MyISAM';
			$table->increments('id')->unsigned();
			$table->timestamps();
			$table->softDeletes();
			$table->integer('user_id')->unsigned();
			$table->integer('anagrafica_id')->unsigned();
			$table->integer('tipoFattura_id')->unsigned();
			$table->string('numero', 50);
			$table->date('data');
			$table->integer('tipoPagamento_id')->unsigned();
			$table->string('notePagamento', 50);
			$table->string('riferimento', 200);
			$table->string('note', 200);
			$table->float('totaleParziale');
			$table->float('totaleImponibile');
			$table->float('ritenutaInps');
			$table->float('ritenutaAcconto');
			$table->float('iva');
			$table->float('totaleFattura');
		});

		Schema::create('tipoFatture', function($table)
		{
            $table->engine = 'MyISAM';
			$table->increments('id')->unsigned();
			$table->string('tipo', 50);
		});

		Schema::create('tipoPagamenti', function($table)
		{
            $table->engine = 'MyISAM';
			$table->increments('id')->unsigned();
			$table->string('tipo', 50);
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('fattureClienti', function(Blueprint $table)
		{
			//
		});
	}

}


text:
module BetweenTheSheets
  class Game
    module Rules
      module Bust
        class Joker < StandardError
        end
      end
    end
  end
end


text:
@interface WXZLouPanYongJinSectionHeadView_1 : UIView

@end


text:
include $(TOPDIR)/rules.mk

APP_NAME:=gws-abb
PKG_NAME:=gws-abb
PKG_VERSION:=1.0
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/$(PKG_NAME)
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=GWS Analog Baseband Manager
  MAINTAINER:=Qige Zhao <qige@6harmonics.com>
  DEPENDS:=+libiwinfo
endef

define Package/$(PKG_NAME)/description
  Analog Baseband Manager, share data via shm/files;
  Depends on libiwinfo.
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)
endef

define Build/Configure
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_DIR) $(1)/usr/sbin

	$(INSTALL_CONF) $(PKG_BUILD_DIR)/$(APP_NAME).conf 	$(1)/etc/config/$(APP_NAME)
	$(INSTALL_BIN) 	$(PKG_BUILD_DIR)/$(APP_NAME).init 	$(1)/etc/init.d/$(APP_NAME)
	$(INSTALL_BIN) 	$(PKG_BUILD_DIR)/$(APP_NAME) 		$(1)/usr/sbin/$(APP_NAME)
endef

$(eval $(call BuildPackage,$(PKG_NAME)))


text:
package com.zimbra.cs.service.account;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;

import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import com.zimbra.common.account.Key;
import com.zimbra.common.account.Key.AccountBy;
import com.zimbra.common.account.ProvisioningConstants;
import com.zimbra.common.service.ServiceException;
import com.zimbra.common.soap.AccountConstants;
import com.zimbra.common.soap.Element;
import com.zimbra.common.util.ZimbraLog;
import com.zimbra.cs.account.Account;
import com.zimbra.cs.account.AttributeClass;
import com.zimbra.cs.account.AttributeFlag;
import com.zimbra.cs.account.AttributeManager;
import com.zimbra.cs.account.AuthToken;
import com.zimbra.cs.account.AuthTokenException;
import com.zimbra.cs.account.Config;
import com.zimbra.cs.account.Cos;
import com.zimbra.cs.account.DataSource;
import com.zimbra.cs.account.Domain;
import com.zimbra.cs.account.Identity;
import com.zimbra.cs.account.Provisioning;
import com.zimbra.cs.account.Server;
import com.zimbra.cs.account.Signature;
import com.zimbra.cs.account.Zimlet;
import com.zimbra.cs.account.accesscontrol.Right;
import com.zimbra.cs.account.accesscontrol.RightManager;
import com.zimbra.cs.mailbox.Mailbox;
import com.zimbra.cs.service.UserServlet;
import com.zimbra.cs.service.admin.AdminAccessControl;
import com.zimbra.cs.session.Session;
import com.zimbra.cs.session.SoapSession;
import com.zimbra.cs.util.BuildInfo;
import com.zimbra.cs.zimlet.ZimletPresence;
import com.zimbra.cs.zimlet.ZimletUserProperties;
import com.zimbra.cs.zimlet.ZimletUtil;
import com.zimbra.soap.SoapEngine;
import com.zimbra.soap.ZimbraSoapContext;
import com.zimbra.soap.account.type.Prop;

/**
 * @since May 26, 2004
 * @author schemers
 */
public class GetInfo extends AccountDocumentHandler  {

    public interface GetInfoExt {
        public void handle(ZimbraSoapContext zsc, Element getInfoResponse);
    }

    private static ArrayList<GetInfoExt> extensions = new ArrayList<GetInfoExt>();

    public static void addExtension(GetInfoExt extension) {
        synchronized (extensions) {
            extensions.add(extension);
        }
    }

    private enum Section {
        MBOX, PREFS, ATTRS, ZIMLETS, PROPS, IDENTS, SIGS, DSRCS, CHILDREN;

        static Section lookup(String value) throws ServiceException {
            try {
                return Section.valueOf(value.toUpperCase().trim());
            } catch (IllegalArgumentException iae) {
                throw ServiceException.INVALID_REQUEST("unknown GetInfo section: " + value.trim(), null);
            }
        }
    }

    @Override
    public Element handle(Element request, Map<String, Object> context) throws ServiceException {
        ZimbraSoapContext zsc = getZimbraSoapContext(context);
        Account account = getRequestedAccount(zsc);

        if (!canAccessAccount(zsc, account)) {
            throw ServiceException.PERM_DENIED("can not access account");
        }

        // figure out the subset of data the caller wants (default to all data)
        String secstr = request.getAttribute(AccountConstants.A_SECTIONS, null);
        Set<Section> sections;
        if (secstr != null) {
            sections = EnumSet.noneOf(Section.class);
            for (String sec : Splitter.on(',').omitEmptyStrings().trimResults().split(secstr)) {
                sections.add(Section.lookup(sec));
            }
        } else {
            sections = EnumSet.allOf(Section.class);
        }

        String rightsStr = request.getAttribute(AccountConstants.A_RIGHTS, null);
        Set<Right> rights = null;
        if (rightsStr != null) {
            RightManager rightMgr = RightManager.getInstance();
            rights = Sets.newHashSet();
            for (String right : Splitter.on(',').omitEmptyStrings().trimResults().split(rightsStr)) {
                rights.add(rightMgr.getUserRight(right));
            }
        }

        Element response = zsc.createElement(AccountConstants.GET_INFO_RESPONSE);
        response.addAttribute(AccountConstants.E_VERSION, BuildInfo.FULL_VERSION, Element.Disposition.CONTENT);
        response.addAttribute(AccountConstants.E_ID, account.getId(), Element.Disposition.CONTENT);
        response.addAttribute(AccountConstants.E_NAME, account.getUnicodeName(), Element.Disposition.CONTENT);
        try {
            response.addAttribute(AccountConstants.E_CRUMB, zsc.getAuthToken().getCrumb(), Element.Disposition.CONTENT);
        } catch (AuthTokenException e) {
            // shouldn't happen
            ZimbraLog.account.warn("can't generate crumb", e);
        }
        long lifetime = zsc.getAuthToken().getExpires() - System.currentTimeMillis();
        response.addAttribute(AccountConstants.E_LIFETIME, lifetime, Element.Disposition.CONTENT);

        Provisioning prov = Provisioning.getInstance();

        // bug 53770, return if the request is using a delegated authtoken issued to an admin account
        AuthToken authToken = zsc.getAuthToken();
        if (authToken.isDelegatedAuth()) {
            Account admin = prov.get(AccountBy.id, authToken.getAdminAccountId());
            if (admin != null) {
                boolean isAdmin = AdminAccessControl.isAdequateAdminAccount(admin);
                if (isAdmin) {
                    response.addAttribute(AccountConstants.E_ADMIN_DELEGATED, true, Element.Disposition.CONTENT);
                }
            }
        }

        try {
            Server server = prov.getLocalServer();
            if (server != null) {
                response.addAttribute(AccountConstants.A_DOCUMENT_SIZE_LIMIT, server.getFileUploadMaxSize());
            }
            Config config = prov.getConfig();
            if (config != null) {
                response.addAttribute(AccountConstants.A_ATTACHMENT_SIZE_LIMIT, config.getMtaMaxMessageSize());
            }
        } catch (ServiceException e) {
        }

        if (sections.contains(Section.MBOX) && Provisioning.onLocalServer(account)) {
            response.addAttribute(AccountConstants.E_REST, UserServlet.getRestUrl(account), Element.Disposition.CONTENT);
            try {
                Mailbox mbox = getRequestedMailbox(zsc);
                response.addAttribute(AccountConstants.E_QUOTA_USED, mbox.getSize(), Element.Disposition.CONTENT);

                Session s = (Session) context.get(SoapEngine.ZIMBRA_SESSION);
                if (s instanceof SoapSession) {
                    // we have a valid session; get the stats on this session
                    response.addAttribute(AccountConstants.E_PREVIOUS_SESSION,
                            ((SoapSession) s).getPreviousSessionTime(), Element.Disposition.CONTENT);
                    response.addAttribute(AccountConstants.E_LAST_ACCESS,
                            ((SoapSession) s).getLastWriteAccessTime(), Element.Disposition.CONTENT);
                    response.addAttribute(AccountConstants.E_RECENT_MSGS,
                            ((SoapSession) s).getRecentMessageCount(), Element.Disposition.CONTENT);
                } else {
                    // we have no session; calculate the stats from the mailbox and the other SOAP sessions
                    long lastAccess = mbox.getLastSoapAccessTime();
                    response.addAttribute(AccountConstants.E_PREVIOUS_SESSION, lastAccess, Element.Disposition.CONTENT);
                    response.addAttribute(AccountConstants.E_LAST_ACCESS, lastAccess, Element.Disposition.CONTENT);
                    response.addAttribute(AccountConstants.E_RECENT_MSGS,
                            mbox.getRecentMessageCount(), Element.Disposition.CONTENT);
                }
            } catch (ServiceException e) {
            }
        }

        doCos(account, response);

        Map<String, Object> attrMap = account.getUnicodeAttrs();
        Locale locale = Provisioning.getInstance().getLocale(account);

        if (sections.contains(Section.PREFS)) {
            Element prefs = response.addUniqueElement(AccountConstants.E_PREFS);
            GetPrefs.doPrefs(account, prefs, attrMap, null);
        }
        if (sections.contains(Section.ATTRS)) {
            Element attrs = response.addUniqueElement(AccountConstants.E_ATTRS);
            doAttrs(account, locale.toString(), attrs, attrMap);
        }
        if (sections.contains(Section.ZIMLETS)) {
            Element zimlets = response.addUniqueElement(AccountConstants.E_ZIMLETS);
            doZimlets(zimlets, account);
        }
        if (sections.contains(Section.PROPS)) {
            Element props = response.addUniqueElement(AccountConstants.E_PROPERTIES);
            doProperties(props, account);
        }
        if (sections.contains(Section.IDENTS)) {
            Element ids = response.addUniqueElement(AccountConstants.E_IDENTITIES);
            doIdentities(ids, account);
        }
        if (sections.contains(Section.SIGS)) {
            Element sigs = response.addUniqueElement(AccountConstants.E_SIGNATURES);
            doSignatures(sigs, account);
        }
        if (sections.contains(Section.DSRCS)) {
            Element ds = response.addUniqueElement(AccountConstants.E_DATA_SOURCES);
            doDataSources(ds, account);
        }
        if (sections.contains(Section.CHILDREN)) {
            Element ca = response.addUniqueElement(AccountConstants.E_CHILD_ACCOUNTS);
            doChildAccounts(ca, account, zsc.getAuthToken());
        }

        if (rights != null && !rights.isEmpty()) {
            Element eRights = response.addUniqueElement(AccountConstants.E_RIGHTS);
            doDiscoverRights(eRights, account, rights);
        }

        GetAccountInfo.addUrls(response, account);

        for (GetInfoExt extension : extensions) {
            extension.handle(zsc, response);
        }
        return response;
    }

    static void doCos(Account acct, Element response) throws ServiceException {
        Cos cos = Provisioning.getInstance().getCOS(acct);
        if (cos != null) {
            Element eCos = response.addUniqueElement(AccountConstants.E_COS);
            eCos.addAttribute(AccountConstants.A_ID, cos.getId());
            eCos.addAttribute(AccountConstants.A_NAME, cos.getName());
        }
    }

    static void doAttrs(Account acct, String locale, Element response, Map<String,Object> attrsMap)
            throws ServiceException {
        AttributeManager attrMgr = AttributeManager.getInstance();

        Set<String> attrList = attrMgr.getAttrsWithFlag(AttributeFlag.accountInfo);

        Set<String> acctAttrs = attrMgr.getAllAttrsInClass(AttributeClass.account);
        Set<String> domainAttrs = attrMgr.getAllAttrsInClass(AttributeClass.domain);
        Set<String> serverAttrs = attrMgr.getAllAttrsInClass(AttributeClass.server);
        Set<String> configAttrs = attrMgr.getAllAttrsInClass(AttributeClass.globalConfig);

        Provisioning prov = Provisioning.getInstance();
        Domain domain = prov.getDomain(acct);
        Server server = acct.getServer();
        Config config = prov.getConfig();

        for (String key : attrList) {
            Object value = null;
            if (Provisioning.A_zimbraLocale.equals(key)) {
                value = locale;
            } else if (Provisioning.A_zimbraAttachmentsBlocked.equals(key)) {
                // leave this a special case for now, until we have enough incidences to make it a pattern
                value = config.isAttachmentsBlocked() || acct.isAttachmentsBlocked() ?
                        ProvisioningConstants.TRUE : ProvisioningConstants.FALSE;
            } else {
                value = attrsMap.get(key);

                if (value == null) { // no value on account/cos
                    if (!acctAttrs.contains(key)) { // not an account attr
                        // see if it is on domain, server, or globalconfig
                        if (domainAttrs.contains(key)) {
                            if (domain != null) {
                                value = domain.getMultiAttr(key); // value on domain/global config (domainInherited)
                            }
                        } else if (serverAttrs.contains(key)) {
                            value = server.getMultiAttr(key); // value on server/global config (serverInherited)
                        } else if (configAttrs.contains(key)) {
                            value = config.getMultiAttr(key); // value on global config
                        }
                    }
                }
            }

            ToXML.encodeAttr(response, key, value);
        }
    }

    private static void doZimlets(Element response, Account acct) {
        try {
            // bug 34517
            ZimletUtil.migrateUserPrefIfNecessary(acct);

            ZimletPresence userZimlets = ZimletUtil.getUserZimlets(acct);
            List<Zimlet> zimletList = ZimletUtil.orderZimletsByPriority(userZimlets.getZimletNamesAsArray());
            int priority = 0;
            for (Zimlet z : zimletList) {
                if (z.isEnabled() && !z.isExtension()) {
                    ZimletUtil.listZimlet(response, z, priority, userZimlets.getPresence(z.getName()));
                }
                priority++;
            }

            // load the zimlets in the dev directory and list them
            ZimletUtil.listDevZimlets(response);
        } catch (ServiceException se) {
            ZimbraLog.account.error("can't get zimlets", se);
        }
    }

    private static void doProperties(Element response, Account acct) {
        ZimletUserProperties zp = ZimletUserProperties.getProperties(acct);
        Set<? extends Prop> props = zp.getAllProperties();
        for (Prop prop : props) {
            Element elem = response.addElement(AccountConstants.E_PROPERTY);
            elem.addAttribute(AccountConstants.A_ZIMLET, prop.getZimlet());
            elem.addAttribute(AccountConstants.A_NAME, prop.getName());
            elem.setText(prop.getValue());
        }
    }

    private static void doIdentities(Element response, Account acct) {
        try {
            for (Identity i : Provisioning.getInstance().getAllIdentities(acct)) {
                ToXML.encodeIdentity(response, i);
            }
        } catch (ServiceException e) {
            ZimbraLog.account.error("can't get identities", e);
        }
    }

    private static void doSignatures(Element response, Account acct) {
        try {
            List<Signature> signatures = Provisioning.getInstance().getAllSignatures(acct);
            for (Signature s : signatures) {
                ToXML.encodeSignature(response, s);
            }
        } catch (ServiceException e) {
            ZimbraLog.account.error("can't get signatures", e);
        }
    }

    private static void doDataSources(Element response, Account acct) {
        try {
            List<DataSource> dataSources = Provisioning.getInstance().getAllDataSources(acct);
            for (DataSource ds : dataSources) {
                if (!ds.isInternal()) {
                    com.zimbra.cs.service.mail.ToXML.encodeDataSource(response, ds);
                }
            }
        } catch (ServiceException e) {
            ZimbraLog.mailbox.error("Unable to get data sources", e);
        }
    }

    protected void doChildAccounts(Element response, Account acct, AuthToken authToken) throws ServiceException {
        String[] childAccounts = acct.getMultiAttr(Provisioning.A_zimbraChildAccount);
        String[] visibleChildAccounts = acct.getMultiAttr(Provisioning.A_zimbraPrefChildVisibleAccount);

        if (childAccounts.length == 0 && visibleChildAccounts.length == 0) {
            return;
        }
        Provisioning prov = Provisioning.getInstance();
        Set<String> children = new HashSet<String>(childAccounts.length);

        for (String childId : visibleChildAccounts) {
            if (children.contains(childId)) {
                continue;
            }
            Account child = prov.get(Key.AccountBy.id, childId, authToken);
            if (child != null) {
                encodeChildAccount(response, child, true);
            }
            children.add(childId);
        }

        for (String childId : childAccounts) {
            if (children.contains(childId)) {
                continue;
            }
            Account child = prov.get(Key.AccountBy.id, childId, authToken);
            if (child != null) {
                encodeChildAccount(response, child, false);
            }
            children.add(childId);
        }
    }

    protected Element encodeChildAccount(Element parent, Account child, boolean isVisible) {
        Element elem = parent.addElement(AccountConstants.E_CHILD_ACCOUNT);
        elem.addAttribute(AccountConstants.A_ID, child.getId());
        elem.addAttribute(AccountConstants.A_NAME, child.getUnicodeName());
        elem.addAttribute(AccountConstants.A_VISIBLE, isVisible);
        elem.addAttribute(AccountConstants.A_ACTIVE, child.isAccountStatusActive());

        String displayName = child.getAttr(Provisioning.A_displayName);
        if (displayName != null) {
            Element attrsElem = elem.addUniqueElement(AccountConstants.E_ATTRS);
            attrsElem.addKeyValuePair(Provisioning.A_displayName, displayName,
                    AccountConstants.E_ATTR, AccountConstants.A_NAME);
        }
        return elem;
    }

    private void doDiscoverRights(Element eRights, Account account, Set<Right> rights) throws ServiceException {
        DiscoverRights.discoverRights(account, rights, eRights, false);
    }
}