text:
<?php

namespace FSi\Component\DataSource\Tests\Driver\Doctrine;

use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
use FSi\Component\DataSource\DataSourceFactory;
use FSi\Component\DataSource\DataSourceInterface;
use FSi\Component\DataSource\Driver\Collection\CollectionFactory;
use FSi\Component\DataSource\Driver\Collection\Extension\Core\CoreExtension;
use FSi\Component\DataSource\Driver\DriverFactoryManager;
use FSi\Component\DataSource\Extension\Core;
use FSi\Component\DataSource\Extension\Core\Ordering\OrderingExtension;
use FSi\Component\DataSource\Extension\Core\Pagination\PaginationExtension;
use FSi\Component\DataSource\Extension\Symfony;
use FSi\Component\DataSource\Tests\Fixtures\Category;
use FSi\Component\DataSource\Tests\Fixtures\Group;
use FSi\Component\DataSource\Tests\Fixtures\News;
use FSi\Component\DataSource\Tests\Fixtures\TestManagerRegistry;
use Symfony\Component\Form;

/**
 * Tests for Doctrine driver.
 */
class CollectionDriverTest extends \PHPUnit_Framework_TestCase
{
    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        if (!class_exists('Doctrine\ORM\EntityManager')) {
            $this->markTestSkipped('Doctrine needed!');
        }

        // the connection configuration
        $dbParams = array(
            'driver' => 'pdo_sqlite',
            'memory' => true,
        );

        $config = Setup::createAnnotationMetadataConfiguration(array(FIXTURES_PATH), true, null, null, false);
        $em = EntityManager::create($dbParams, $config);
        $tool = new \Doctrine\ORM\Tools\SchemaTool($em);
        $classes = array(
            $em->getClassMetadata('FSi\Component\DataSource\Tests\Fixtures\News'),
            $em->getClassMetadata('FSi\Component\DataSource\Tests\Fixtures\Category'),
            $em->getClassMetadata('FSi\Component\DataSource\Tests\Fixtures\Group'),
        );
        $tool->createSchema($classes);
        $this->load($em);
        $this->em = $em;
    }

    /**
     * General test for DataSource wtih DoctrineDriver in basic configuration.
     */
    public function testGeneral()
    {
        $datasourceFactory = $this->getDataSourceFactory();

        $driverFactory = $this->getCollectionFactory();
        $driver = $driverFactory->createDriver();

        $datasources = array();

        $driverOptions = array(
            'collection' => $this->em->getRepository('FSi\Component\DataSource\Tests\Fixtures\News')->findAll(),
        );

        $datasources[] = $datasourceFactory->createDataSource('collection', $driverOptions, 'datasource');

        $qb = $this->em
            ->createQueryBuilder()
            ->select('n')
            ->from('FSi\Component\DataSource\Tests\Fixtures\News', 'n')
        ;

        $driverOptions = array(
            'collection' => $qb->getQuery()->execute()
        );

        $datasources[] = $datasourceFactory->createDataSource('collection', $driverOptions, 'datasource2');

        foreach ($datasources as $datasource) {
            $datasource
                ->addField('title', 'text', 'contains')
                ->addField('author', 'text', 'contains')
                ->addField('created', 'datetime', 'between', array(
                    'field' => 'create_date',
                ))
            ;

            $result1 = $datasource->getResult();
            $this->assertEquals(100, count($result1));
            $view1 = $datasource->createView();

            //Checking if result cache works.
            $this->assertSame($result1, $datasource->getResult());

            $parameters = array(
                $datasource->getName() => array(
                    DataSourceInterface::PARAMETER_FIELDS => array(
                        'author' => 'domain1.com',
                    ),
                ),
            );
            $datasource->bindParameters($parameters);
            $result2 = $datasource->getResult();

            //Checking cache.
            $this->assertSame($result2, $datasource->getResult());

            $this->assertEquals(50, count($result2));
            $this->assertNotSame($result1, $result2);
            unset($result1);
            unset($result2);

            $this->assertEquals($parameters, $datasource->getParameters());

            $datasource->setMaxResults(20);
            $parameters = array(
                $datasource->getName() => array(
                    PaginationExtension::PARAMETER_PAGE => 1,
                ),
            );

            $datasource->bindParameters($parameters);
            $result = $datasource->getResult();
            $this->assertEquals(100, count($result));
            $i = 0;
            foreach ($result as $item) {
                $i++;
            }
            $this->assertEquals(20, $i);

            $parameters = array(
                $datasource->getName() => array(
                    DataSourceInterface::PARAMETER_FIELDS => array(
                        'author' => 'domain1.com',
                        'title' => 'title3',
                        'created' => array(
                            'from' => new \DateTime(date("Y:m:d H:i:s", 35 * 24 * 60 * 60)),
                        ),
                    ),
                ),
            );
            $datasource->bindParameters($parameters);
            $view = $datasource->createView();
            $result = $datasource->getResult();
            $this->assertEquals(2, count($result));

            $parameters = array(
                $datasource->getName() => array(
                    DataSourceInterface::PARAMETER_FIELDS => array(
                        'author' => 'author3@domain2.com',
                    ),
                )
            );
            $datasource->bindParameters($parameters);
            $view = $datasource->createView();
            $result = $datasource->getResult();
            $this->assertEquals(1, count($result));

            //Checking sorting.
            $parameters = array(
                $datasource->getName() => array(
                    OrderingExtension::PARAMETER_SORT => array(
                        'title' => 'desc'
                    ),
                ),
            );

            $datasource->bindParameters($parameters);
            foreach ($datasource->getResult() as $news) {
                $this->assertEquals('title99', $news->getTitle());
                break;
            }

            //Checking sorting.
            $parameters = array(
                $datasource->getName() => array(
                    OrderingExtension::PARAMETER_SORT => array(
                        'author' => 'asc',
                        'title' => 'desc',
                    ),
                ),
            );

            $datasource->bindParameters($parameters);
            foreach ($datasource->getResult() as $news) {
                $this->assertEquals('author0@domain1.com', $news->getAuthor());
                break;
            }

            //Test for clearing fields.
            $datasource->clearFields();
            $datasource->setMaxResults(null);
            $parameters = array(
                $datasource->getName() => array(
                    DataSourceInterface::PARAMETER_FIELDS => array(
                        'author' => 'domain1.com',
                    ),
                ),
            );

            //Since there are no fields now, we should have all of entities.
            $datasource->bindParameters($parameters);
            $result = $datasource->getResult();
            $this->assertEquals(100, count($result));
        }
    }

    /**
     * {@inheritdoc}
     */
    public function tearDown()
    {
        unset($this->em);
    }

    /**
     * Return configured DoctrinFactory.
     *
     * @return DoctrineFactory.
     */
    private function getCollectionFactory()
    {
        $extensions = array(
            new CoreExtension(),
        );

        return new CollectionFactory($extensions);
    }

    /**
     * Return configured DataSourceFactory.
     *
     * @return \FSi\Component\DataSource\DataSourceFactory
     */
    private function getDataSourceFactory()
    {
        $driverFactoryManager = new DriverFactoryManager(array(
            $this->getCollectionFactory()
        ));

        $extensions = array(
            new Symfony\Core\CoreExtension(),
            new Core\Pagination\PaginationExtension(),
            new OrderingExtension(),
        );

        return new DataSourceFactory($driverFactoryManager, $extensions);
    }

    /**
     * @param EntityManager $em
     */
    private function load(EntityManager $em)
    {
        //Injects 5 categories.
        $categories = array();
        for ($i = 0; $i < 5; $i++) {
            $category = new Category();
            $category->setName('category'.$i);
            $em->persist($category);
            $categories[] = $category;
        }

        //Injects 4 groups.
        $groups = array();
        for ($i = 0; $i < 4; $i++) {
            $group = new Group();
            $group->setName('group'.$i);
            $em->persist($group);
            $groups[] = $group;
        }

        //Injects 100 newses.
        for ($i = 0; $i < 100; $i++) {
            $news = new News();
            $news->setTitle('title'.$i);

            //Half of entities will have different author and content.
            if ($i % 2 == 0) {
                $news->setAuthor('author'.$i.'@domain1.com');
                $news->setShortContent('Lorem ipsum.');
                $news->setContent('Content lorem ipsum.');
            } else {
                $news->setAuthor('author'.$i.'@domain2.com');
                $news->setShortContent('Dolor sit amet.');
                $news->setContent('Content dolor sit amet.');
            }

            //Each entity has different date of creation and one of four hours of creation.
            $createDate = new \DateTime(date("Y:m:d H:i:s", $i * 24 * 60 * 60));
            $createTime = new \DateTime(date("H:i:s", (($i % 4) + 1 ) * 60 * 60));

            $news->setCreateDate($createDate);
            $news->setCreateTime($createTime);

            $news->setCategory($categories[$i % 5]);
            $news->getGroups()->add($groups[$i % 4]);

            $em->persist($news);
        }

        $em->flush();
    }
}


text:
App.ListsNewRoute = Ember.Route.extend({
  model: function() {
    return {'title': 'new title', 'description': ''};
  }
});

redpajama_set_name: RedPajamaGithub


text:
define([
    'bluebird',
    'common/html',
    'common/events',
    'common/ui',
    'common/runtime',
    'widgets/appWidgets2/validation',
    'widgets/appWidgets2/validators/constants',

    'bootstrap',
], (Promise, html, Events, UI, Runtime, Validation, Constants) => {
    'use strict';

    // Constants
    const t = html.tag,
        div = t('div'),
        span = t('span'),
        strong = t('strong'),
        button = t('button'),
        iTag = t('i'),
        input = t('input'),
        cssBaseClass = 'kb-appInput__checkbox',
        cssErrorClass = `${cssBaseClass}_error_container`;

    function factory(config) {
        const spec = config.parameterSpec,
            runtime = Runtime.make(),
            busConnection = runtime.bus().connect(),
            channel = busConnection.channel(config.channelName),
            model = {
                value: undefined,
                hasInitialValueError: false,
            };
        let parent, container, ui;

        // MODEL

        function setModelValue(value) {
            if (model.value !== value) {
                model.value = value;
                channel.emit('changed', {
                    newValue: model.value,
                });
            }
        }

        function resetModelValue() {
            setModelValue(spec.data.defaultValue);
        }

        // CONTROL

        function getControlValue() {
            const checkbox = ui.getElement('input-container.input');
            if (checkbox.checked) {
                return 1;
            }
            return 0;
        }

        function syncModelToControl() {
            const control = ui.getElement('input-container.input');
            if (model.value === 1) {
                control.checked = true;
            } else {
                control.checked = false;
            }
        }

        // VALIDATION

        function validate() {
            return Promise.try(() => {
                if (model.hasInitialValueError) {
                    return {
                        isValid: false,
                        messageId: Constants.MESSAGE_IDS.INVALID,
                        diagnosis: Constants.DIAGNOSIS.INVALID,
                    };
                }
                const rawValue = getControlValue(),
                    validationOptions = {
                        required: spec.data.constraints.required,
                        values: [0, 1],
                    };
                return Validation.validateSet(rawValue, validationOptions);
            });
        }

        function autoValidate() {
            return validate().then((result) => {
                channel.emit('validation', result);
            });
        }

        // RENDERING

        function clearInitialValueError(useDefaultValue) {
            const inputContainer = container.querySelector(`.${cssBaseClass}_container`);
            inputContainer.classList.remove(cssErrorClass);
            inputContainer.querySelector(`.${cssBaseClass}_error`).remove();
            model.hasInitialValueError = false;
            if (useDefaultValue) {
                setModelValue(spec.data.defaultValue);
                return autoValidate();
            }
        }

        function renderInitialValueError(events) {
            const defaultVal = spec.data.defaultValue === 1 ? 'checked' : 'unchecked';
            return div(
                {
                    class: `${cssBaseClass}_error`,
                },
                [
                    div(
                        {
                            class: `${cssBaseClass}_error_container__title`,
                        },
                        [
                            iTag({
                                class: 'fa fa-exclamation-triangle',
                            }),
                            strong(' Error: '),
                        ]
                    ),
                    `Invalid value of "${config.initialValue}" for parameter ${spec.ui.label}. Default value of ${defaultVal} used.`,
                    button(
                        {
                            class: `${cssBaseClass}_error__close_button btn btn-default btn-xs`,
                            type: 'button',
                            title: 'close',
                            id: events.addEvents({
                                events: [
                                    {
                                        type: 'click',
                                        handler: () => clearInitialValueError(true),
                                    },
                                ],
                            }),
                        },
                        span({
                            class: 'fa fa-times',
                        })
                    ),
                ]
            );
        }

        function makeInputControl(events) {
            // CONTROL
            const cssBaseClass = 'kb-appInput__checkbox';
            let checked = false;
            if (model.hasInitialValueError) {
                checked = spec.data.defaultValue === 1;
            } else if (model.value === 1) {
                checked = true;
            }

            return div(
                {
                    class: `${cssBaseClass}_container ${
                        model.hasInitialValueError ? cssErrorClass : ''
                    }`,
                },
                [
                    input({
                        id: events.addEvents({
                            events: [
                                {
                                    type: 'change',
                                    handler: function () {
                                        if (model.hasInitialValueError) {
                                            clearInitialValueError();
                                        }
                                        validate().then((result) => {
                                            setModelValue(result.parsedValue);
                                            channel.emit('validation', result);
                                        });
                                    },
                                },
                            ],
                        }),
                        type: 'checkbox',
                        dataElement: 'input',
                        checked,
                        value: 1,
                    }),
                    model.hasInitialValueError ? renderInitialValueError(events) : '',
                ]
            );
        }

        function render(events) {
            return div(
                {
                    dataElement: 'main-panel',
                },
                [div({ dataElement: 'input-container' }, makeInputControl(events))]
            );
        }

        // LIFECYCLE API

        function start(arg) {
            return Promise.try(() => {
                parent = arg.node;
                container = parent.appendChild(document.createElement('div'));

                ui = UI.make({
                    node: container,
                });

                const events = Events.make({
                    node: container,
                });

                // initialize based on config.initialValue. If it's not 0 or 1, then
                // note that we have an initial value error, and set to the default.
                const initValue = config.initialValue || spec.data.defaultValue;
                if (initValue !== 0 && initValue !== 1) {
                    model.hasInitialValueError = true;
                }

                setModelValue(initValue);
                container.innerHTML = render(events);
                events.attachEvents();

                // Listen for events from the containing environment.

                channel.on('reset-to-defaults', () => {
                    resetModelValue();
                    syncModelToControl();
                });

                channel.on('update', (message) => {
                    setModelValue(message.value);
                    syncModelToControl();
                });

                return autoValidate();
            });
        }

        function stop() {
            return Promise.try(() => {
                if (container) {
                    parent.removeChild(container);
                }
                busConnection.stop();
            });
        }

        // INIT

        return {
            start,
            stop,
        };
    }

    return {
        make: function (config) {
            return factory(config);
        },
    };
});


text:
<?php

namespace Kint\Parser;

use Kint\Zval\Value;
use SplObjectStorage;

class SplObjectStoragePlugin extends Plugin
{
    public function getTypes()
    {
        return ['object'];
    }

    public function getTriggers()
    {
        return Parser::TRIGGER_COMPLETE;
    }

    public function parse(&$var, Value &$o, $trigger)
    {
        if (!$var instanceof SplObjectStorage || !($r = $o->getRepresentation('iterator'))) {
            return;
        }

        $r = $o->getRepresentation('iterator');
        if ($r) {
            $o->size = !\is_array($r->contents) ? null : \count($r->contents);
        }
    }
}


text:
cask 'qmind' do
  version '0.3.4'
  sha256 '498dc5b753804d25cbf15afbdb8641af1ddcf53b65ab04d3188c7a8b669f6695'

  # github.com/qvacua/qmind was verified as official when first introduced to the cask
  url "https://github.com/qvacua/qmind/releases/download/v#{version}-22/Qmind-#{version}.zip"
  appcast 'https://github.com/qvacua/qmind/releases.atom'
  name 'Qmind'
  homepage 'http://qvacua.com/'

  app 'Qmind.app'
end


text:
/*****************************************************************************
 *                                  _   _ ____  _
 *  Project                     ___| | | |  _ \| |
 *                             / __| | | | |_) | |
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 *
 * Upload to FTP, resuming failed transfers
 *
 * Compile for MinGW like this:
 *  gcc -Wall -pedantic -std=c99 ftpuploadwithresume.c -o ftpuploadresume.exe
 *  -lcurl -lmsvcr70
 *
 * Written by Philip Bock
 */

#include <stdlib.h>
#include <stdio.h>

#include <curl/curl.h>

#if defined(_MSC_VER) && (_MSC_VER < 1300)
#  error _snscanf requires MSVC 7.0 or later.
#endif

/* The MinGW headers are missing a few Win32 function definitions,
   you shouldn't need this if you use VC++ */
#ifdef __MINGW32__
int __cdecl _snscanf(const char * input, size_t length, const char * format, ...);
#endif

/* parse headers for Content-Length */
size_t getcontentlengthfunc(void *ptr, size_t size, size_t nmemb, void *stream)
{
  int r;
  long len = 0;

  /* _snscanf() is Win32 specific */
  r = _snscanf(ptr, size * nmemb, "Content-Length: %ld\n", &len);

  if (r) /* Microsoft: we don't read the specs */
    *((long *) stream) = len;

  return size * nmemb;
}

/* discard downloaded data */
size_t discardfunc(void *ptr, size_t size, size_t nmemb, void *stream)
{
  return size * nmemb;
}

/* read data to upload */
size_t readfunc(void *ptr, size_t size, size_t nmemb, void *stream)
{
  FILE *f = stream;
  size_t n;

  if (ferror(f))
    return CURL_READFUNC_ABORT;

  n = fread(ptr, size, nmemb, f) * size;

  return n;
}

int upload(CURL *curlhandle, const char * remotepath, const char * localpath,
           long timeout, long tries)
{
  FILE *f;
  long uploaded_len = 0;
  CURLcode r = CURLE_GOT_NOTHING;
  int c;

  f = fopen(localpath, "rb");
  if (f == NULL) {
    perror(NULL);
    return 0;
  }

  curl_easy_setopt(curlhandle, CURLOPT_UPLOAD, 1L);

  curl_easy_setopt(curlhandle, CURLOPT_URL, remotepath);

  if (timeout)
    curl_easy_setopt(curlhandle, CURLOPT_FTP_RESPONSE_TIMEOUT, timeout);

  curl_easy_setopt(curlhandle, CURLOPT_HEADERFUNCTION, getcontentlengthfunc);
  curl_easy_setopt(curlhandle, CURLOPT_HEADERDATA, &uploaded_len);

  curl_easy_setopt(curlhandle, CURLOPT_WRITEFUNCTION, discardfunc);

  curl_easy_setopt(curlhandle, CURLOPT_READFUNCTION, readfunc);
  curl_easy_setopt(curlhandle, CURLOPT_READDATA, f);

  curl_easy_setopt(curlhandle, CURLOPT_FTPPORT, "-"); /* disable passive mode */
  curl_easy_setopt(curlhandle, CURLOPT_FTP_CREATE_MISSING_DIRS, 1L);

  curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, 1L);

  for (c = 0; (r != CURLE_OK) && (c < tries); c++) {
    /* are we resuming? */
    if (c) { /* yes */
      /* determine the length of the file already written */

      /*
       * With NOBODY and NOHEADER, libcurl will issue a SIZE
       * command, but the only way to retrieve the result is
       * to parse the returned Content-Length header. Thus,
       * getcontentlengthfunc(). We need discardfunc() above
       * because HEADER will dump the headers to stdout
       * without it.
       */
      curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 1L);
      curl_easy_setopt(curlhandle, CURLOPT_HEADER, 1L);

      r = curl_easy_perform(curlhandle);
      if (r != CURLE_OK)
        continue;

      curl_easy_setopt(curlhandle, CURLOPT_NOBODY, 0L);
      curl_easy_setopt(curlhandle, CURLOPT_HEADER, 0L);

      fseek(f, uploaded_len, SEEK_SET);

      curl_easy_setopt(curlhandle, CURLOPT_APPEND, 1L);
    }
    else { /* no */
      curl_easy_setopt(curlhandle, CURLOPT_APPEND, 0L);
    }

    r = curl_easy_perform(curlhandle);
  }

  fclose(f);

  if (r == CURLE_OK)
    return 1;
  else {
    fprintf(stderr, "%s\n", curl_easy_strerror(r));
    return 0;
  }
}

int main(int c, char **argv)
{
  CURL *curlhandle = NULL;

  curl_global_init(CURL_GLOBAL_ALL);
  curlhandle = curl_easy_init();

  upload(curlhandle, "ftp://user:pass@example.com/path/file", "C:\\file", 0, 3);

  curl_easy_cleanup(curlhandle);
  curl_global_cleanup();

  return 0;
}


text:
package com.intellij.openapi.vcs.changes.actions;

import com.intellij.CommonBundle;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.vcs.*;
import com.intellij.openapi.vcs.actions.VcsContextFactory;
import com.intellij.openapi.vcs.changes.committed.CommittedChangesFilterDialog;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
import com.intellij.openapi.vfs.VirtualFile;

/**
 * @author yole
 */
public class BrowseChangesAction extends AnAction implements DumbAware {
  public void actionPerformed(AnActionEvent e) {
    final Project project = e.getData(CommonDataKeys.PROJECT);
    VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    assert vFile != null;
    AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(vFile);
    assert vcs != null;
    final CommittedChangesProvider provider = vcs.getCommittedChangesProvider();
    assert provider != null;
    ChangeBrowserSettings settings = provider.createDefaultSettings();
    CommittedChangesFilterDialog dlg = new CommittedChangesFilterDialog(project, provider.createFilterUI(true), settings);
    dlg.show();
    if (!dlg.isOK()) return;

    int maxCount = 0;
    if (!settings.isAnyFilterSpecified()) {
      int rc = Messages.showYesNoCancelDialog(project, VcsBundle.message("browse.changes.no.filter.prompt"), VcsBundle.message("browse.changes.title"),
                                     VcsBundle.message("browse.changes.show.recent.button"),
                                     VcsBundle.message("browse.changes.show.all.button"),
                                     CommonBundle.getCancelButtonText(),
                                    Messages.getQuestionIcon());
      if (rc == 2) {
        return;
      }
      if (rc == 0) {
        maxCount = 50;
      }
    }

    AbstractVcsHelper.getInstance(project).openCommittedChangesTab(vcs, vFile, settings, maxCount, null);
  }

  public void update(AnActionEvent e) {
    e.getPresentation().setEnabled(isActionEnabled(e));
  }

  private static boolean isActionEnabled(final AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null) return false;
    VirtualFile vFile = e.getData(PlatformDataKeys.VIRTUAL_FILE);
    if (vFile == null) return false;
    AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(vFile);
    if (vcs == null || vcs.getCommittedChangesProvider() == null || !vcs.allowsRemoteCalls(vFile)) {
      return false;
    }
    FilePath filePath = VcsContextFactory.SERVICE.getInstance().createFilePathOn(vFile);
    return AbstractVcs.fileInVcsByFileStatus(project, filePath);
  }
}


text:
import { Component } from 'react'
import { findDOMNode } from 'react-dom'
import ActionList from './elements/action-list'
import JsonDebugger from './json-debugger'
import factory from './elements/factory'

function getHref(resource) {
  return resource && resource.links.self && resource.links.self.href
}

export default class Document extends Component {
  componentDidUpdate(previousProps, previousState) {
    const previous = getHref(previousProps.resource)
    const current = getHref(this.props.resource)

    if (previous !== current) {
      if (this.props.config.scrollToTop) {
        findDOMNode(this).scrollIntoView()
      }

      if (this.props.config.onUrlChange) {
        const formName = this.props.resource.name
        this.props.config.onUrlChange(current, formName)
      }
    }
  }

  render() {
    const { api, config, resource, requests } = this.props

    if (!resource) {
      return

    }

    const Element = factory(resource)
    const actions = <ActionList api={api} config={config} links={resource.links} requests={requests} />

    const footer = config.actionListPosition !== 'top' && (

        {actions}

    )

    return (

            {resource.title}

          {config.actionListPosition !== 'bottom' && actions}

        <Element api={api} config={config} property={resource} topLevel />
        {footer}
        {config.debug ? <JsonDebugger resource={resource} /> : null}

    )
  }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `EncodeUtf8Error` struct in crate `odds`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, EncodeUtf8Error">

    <title>odds::char::EncodeUtf8Error - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../normalize.css">
    <link rel="stylesheet" type="text/css" href="../../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../../main.css">

odds::<wbr>char

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Struct odds::<wbr>char::<wbr>EncodeUtf8Error

                       [−]

               [src]

pub struct EncodeUtf8Error(_);

Placeholder

Trait Implementations

impl Debug for EncodeUtf8Error

[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for EncodeUtf8Error

[src]

impl Clone for EncodeUtf8Error

[src]

fn clone(&self) -> EncodeUtf8Error

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)


text:
function tc = argterr_tcase
% verify_data_tcase -- munit test case to test argterr.
%
%****f*  wmtsa.Tests.utils/argterr_tcase
%
% NAME
%   argterr_tcase -- munit test case to test argterr.
%
% USAGE
%   run_tcase(@argterr_tcase)
%
% INPUTS
%
%
% OUTPUTS
%   tc            = tcase structure for argterr testcase.
%
% SIDE EFFECTS
%
%
% DESCRIPTION
%
%

% AUTHOR
%   Charlie Cornish
%
% CREATION DATE
%   2005-07-18
%
% COPYRIGHT
%   (c) 2005 Charles R. Cornish
%
% CREDITS
%
%
% REVISION
%   $Revision: 612 $
%
%***

%   $Id: argterr_tcase.m 612 2005-10-28 21:42:24Z ccornish $

tc = MU_tcase_new(mfilename);
tc = MU_tcase_add_test(tc, @test_normal);
tc = MU_tcase_add_test(tc, @test_insufficient_num_arguments);
tc = MU_tcase_add_test(tc, @test_datatypes);
tc = MU_tcase_add_test(tc, @test_struct_opt);

return

function test_normal(varargin)
  % Test Description:  Normal execution.
  %

  a = 1;
  errmsg = argterr(mfilename, a, 'int');
  MU_assert_isempty(errmsg);

return

function test_insufficient_num_arguments(varargin)
  % Test Description:
  %    Expected error: Insufficient number of Arguments
  try
    err = argterr;
  catch
    [errmsg, msg_id] = lasterr
    MU_assert_error('MATLAB:nargchk:notEnoughInputs', msg_id);
  end
return

function test_datatypes(varargin)
  % Test Description:
  %    Exercise the various datatypes.

  var_name = 'a';
  %%%
  %%% Integers
  %%%

  %%% int

  a = 1;
  errmsg = argterr(mfilename, a, 'int');
  MU_assert_isempty(errmsg);

  a = 'abc';
  exp_errmsg = ['Expected ''', var_name, ''' to be an integer.'];
  errmsg = argterr(mfilename, a, 'int');
  MU_assert_isequal(exp_errmsg, errmsg);

  %%% int0

  a = 1;
  errmsg = argterr(mfilename, a, 'int0');
  MU_assert_isempty(errmsg);

  a = -1;
  exp_errmsg = ['Expected ''', var_name, ''' to be an integer with value(s) >= 0.'];
  errmsg = argterr(mfilename, a, 'int0');
  MU_assert_isequal(exp_errmsg, errmsg);

return

function test_struct_opt(varargin)
  % Test Description:  Test struct option
  %

  var_name = 'a';
  a = 'abc';
  exp_errmsg = ['Expected ''', var_name, ''' to be an integer.'];

  err = argterr(mfilename, a, 'int', [], 1, '' , 'struct');
  MU_assert_isequal('WMTSA:argterr:invalidArgumentDataType', err.identifier);
  MU_assert_isequal(exp_errmsg, err.message);

return


text:
Pattern: Inconsistent hex color notation

Issue: -

## Description

Specify short or long notation for hex colors.

## Examples

### `"short"`

The following patterns are considered violations:

```css
a { color: #ffffff; }
```

```css
a { color: #ffffffaa; }
```

The following patterns are *not* considered violations:

```css
a { color: #fff; }
```

```css
a { color: #fffa; }
```

```css
a { color: #a4a4a4; }
```

### `"long"`

The following patterns are considered violations:

```css
a { color: #fff; }
```

```css
a { color: #fffa; }
```

The following patterns are *not* considered violations:

```css
a { color: #ffffff; }
```

```css
a { color: #ffffffaa; }
```

## Further Reading

* [stylelint - color-hex-length](https://stylelint.io/user-guide/rules/color-hex-length)


text:
/**
 * @private
 */
Ext.define('Ext.mixin.Sortable', {
    extend: 'Ext.mixin.Mixin',

    requires: [
        'Ext.util.Sorter'
    ],

    mixinConfig: {
        id: 'sortable'
    },

    config: {
        /**
         * @cfg {Array} sorters
         * An array with sorters. A sorter can be an instance of {@link Ext.util.Sorter}, a string
         * indicating a property name, an object representing an Ext.util.Sorter configuration,
         * or a sort function.
         */
        sorters: null,

        /**
         * @cfg {String} defaultSortDirection
         * The default sort direction to use if one is not specified.
         */
        defaultSortDirection: "ASC",

        /**
         * @cfg {String} sortRoot
         * The root inside each item in which the properties exist that we want to sort on.
         * This is useful for sorting records in which the data exists inside a `data` property.
         */
        sortRoot: null
    },

    /**
     * @property {Boolean} dirtySortFn
     * A flag indicating whether the currently cashed sort function is still valid.
     * @readonly
     */
    dirtySortFn: false,

    /**
     * @property currentSortFn
     * This is the cached sorting function which is a generated function that calls all the
     * configured sorters in the correct order.
     * @readonly
     */
    sortFn: null,

    /**
     * @property {Boolean} sorted
     * A read-only flag indicating if this object is sorted.
     * @readonly
     */
    sorted: false,

    applySorters: function(sorters, collection) {
        if (!collection) {
            collection = this.createSortersCollection();
        }

        collection.clear();
        this.sorted = false;

        if (sorters) {
            this.addSorters(sorters);
        }

        return collection;
    },

    createSortersCollection: function() {
        this._sorters = Ext.create('Ext.util.Collection', function(sorter) {
            return sorter.getId();
        });
        return this._sorters;
    },

    /**
     * This method adds a sorter.
     * @param {Ext.util.Sorter/String/Function/Object} sorter Can be an instance of
     * Ext.util.Sorter, a string indicating a property name, an object representing an Ext.util.Sorter
     * configuration, or a sort function.
     * @param {String} defaultDirection The default direction for each sorter in the array. Defaults
     * to the value of {@link #defaultSortDirection}. Can be either 'ASC' or 'DESC'.
     */
    addSorter: function(sorter, defaultDirection) {
        this.addSorters([sorter], defaultDirection);
    },

    /**
     * This method adds all the sorters in a passed array.
     * @param {Array} sorters An array with sorters. A sorter can be an instance of Ext.util.Sorter, a string
     * indicating a property name, an object representing an Ext.util.Sorter configuration,
     * or a sort function.
     * @param {String} defaultDirection The default direction for each sorter in the array. Defaults
     * to the value of {@link #defaultSortDirection}. Can be either 'ASC' or 'DESC'.
     */
    addSorters: function(sorters, defaultDirection) {
        var currentSorters = this.getSorters();
        return this.insertSorters(currentSorters ? currentSorters.length : 0, sorters, defaultDirection);
    },

    /**
     * This method adds a sorter at a given index.
     * @param {Number} index The index at which to insert the sorter.
     * @param {Ext.util.Sorter/String/Function/Object} sorter Can be an instance of Ext.util.Sorter,
     * a string indicating a property name, an object representing an Ext.util.Sorter configuration,
     * or a sort function.
     * @param {String} defaultDirection The default direction for each sorter in the array. Defaults
     * to the value of {@link #defaultSortDirection}. Can be either 'ASC' or 'DESC'.
     */
    insertSorter: function(index, sorter, defaultDirection) {
        return this.insertSorters(index, [sorter], defaultDirection);
    },

    /**
     * This method inserts all the sorters in the passed array at the given index.
     * @param {Number} index The index at which to insert the sorters.
     * @param {Array} sorters Can be an instance of Ext.util.Sorter, a string indicating a property name,
     * an object representing an Ext.util.Sorter configuration, or a sort function.
     * @param {String} defaultDirection The default direction for each sorter in the array. Defaults
     * to the value of {@link #defaultSortDirection}. Can be either 'ASC' or 'DESC'.
     */
    insertSorters: function(index, sorters, defaultDirection) {
        // We begin by making sure we are dealing with an array of sorters
        if (!Ext.isArray(sorters)) {
            sorters = [sorters];
        }

        var ln = sorters.length,
            direction = defaultDirection || this.getDefaultSortDirection(),
            sortRoot = this.getSortRoot(),
            currentSorters = this.getSorters(),
            newSorters = [],
            sorterConfig, i, sorter, currentSorter;

        if (!currentSorters) {
            // This will guarantee that we get the collection
            currentSorters = this.createSortersCollection();
        }

        // We first have to convert every sorter into a proper Sorter instance
        for (i = 0; i < ln; i++) {
            sorter = sorters[i];
            sorterConfig = {
                direction: direction,
                root: sortRoot
            };

            // If we are dealing with a string we assume it is a property they want to sort on.
            if (typeof sorter === 'string') {
                currentSorter = currentSorters.get(sorter);

                if (!currentSorter) {
                    sorterConfig.property = sorter;
                } else {
                    if (defaultDirection) {
                        currentSorter.setDirection(defaultDirection);
                    } else {
                        // If we already have a sorter for this property we just toggle its direction.
                        currentSorter.toggle();
                    }
                    continue;
                }
            }
            // If it is a function, we assume its a sorting function.
            else if (Ext.isFunction(sorter)) {
                sorterConfig.sorterFn = sorter;
            }
            // If we are dealing with an object, we assume its a Sorter configuration. In this case
            // we create an instance of Sorter passing this configuration.
            else if (Ext.isObject(sorter)) {
                if (!sorter.isSorter) {
                    if (sorter.fn) {
                        sorter.sorterFn = sorter.fn;
                        delete sorter.fn;
                    }

                    sorterConfig = Ext.apply(sorterConfig, sorter);
                }
                else {
                    newSorters.push(sorter);
                    if (!sorter.getRoot()) {
                        sorter.setRoot(sortRoot);
                    }
                    continue;
                }
            }
            // Finally we get to the point where it has to be invalid
            // <debug>
            else {
                Ext.Logger.warn('Invalid sorter specified:', sorter);
            }
            // </debug>

            // If a sorter config was created, make it an instance
            sorter = Ext.create('Ext.util.Sorter', sorterConfig);
            newSorters.push(sorter);
        }

        // Now lets add the newly created sorters.
        for (i = 0, ln = newSorters.length; i < ln; i++) {
            currentSorters.insert(index + i, newSorters[i]);
        }

        this.dirtySortFn = true;

        if (currentSorters.length) {
            this.sorted = true;
        }
        return currentSorters;
    },

    /**
     * This method removes a sorter.
     * @param {Ext.util.Sorter/String/Function/Object} sorter Can be an instance of Ext.util.Sorter,
     * a string indicating a property name, an object representing an Ext.util.Sorter configuration,
     * or a sort function.
     */
    removeSorter: function(sorter) {
        return this.removeSorters([sorter]);
    },

    /**
     * This method removes all the sorters in a passed array.
     * @param {Array} sorters Each value in the array can be a string (property name),
     * function (sorterFn) or {@link Ext.util.Sorter Sorter} instance.
     */
    removeSorters: function(sorters) {
        // We begin by making sure we are dealing with an array of sorters
        if (!Ext.isArray(sorters)) {
            sorters = [sorters];
        }

        var ln = sorters.length,
            currentSorters = this.getSorters(),
            i, sorter;

        for (i = 0; i < ln; i++) {
            sorter = sorters[i];

            if (typeof sorter === 'string') {
                currentSorters.removeAtKey(sorter);
            }
            else if (typeof sorter === 'function') {
                currentSorters.each(function(item) {
                    if (item.getSorterFn() === sorter) {
                        currentSorters.remove(item);
                    }
                });
            }
            else if (sorter.isSorter) {
                currentSorters.remove(sorter);
            }
        }

        if (!currentSorters.length) {
            this.sorted = false;
        }
    },

    /**
     * This updates the cached sortFn based on the current sorters.
     * @return {Function} The generated sort function.
     * @private
     */
    updateSortFn: function() {
        var sorters = this.getSorters().items;

        this.sortFn = function(r1, r2) {
            var ln = sorters.length,
                result, i;

            // We loop over each sorter and check if r1 should be before or after r2
            for (i = 0; i < ln; i++) {
                result = sorters[i].sort.call(this, r1, r2);

                // If the result is -1 or 1 at this point it means that the sort is done.
                // Only if they are equal (0) we continue to see if a next sort function
                // actually might find a winner.
                if (result !== 0) {
                    break;
                }
            }

            return result;
        };

        this.dirtySortFn = false;
        return this.sortFn;
    },

    /**
     * Returns an up to date sort function.
     * @return {Function} The sort function.
     */
    getSortFn: function() {
        if (this.dirtySortFn) {
            return this.updateSortFn();
        }
        return this.sortFn;
    },

    /**
     * This method will sort an array based on the currently configured {@link #sorters}.
     * @param {Array} data The array you want to have sorted.
     * @return {Array} The array you passed after it is sorted.
     */
    sort: function(data) {
        Ext.Array.sort(data, this.getSortFn());
        return data;
    },

    /**
     * This method returns the index that a given item would be inserted into a
     * given array based on the current sorters.
     * @param {Array} items The array that you want to insert the item into.
     * @param {Mixed} item The item that you want to insert into the items array.
     * @return {Number} The index for the given item in the given array based on
     * the current sorters.
     */
    findInsertionIndex: function(items, item, sortFn) {
        var start = 0,
            end   = items.length - 1,
            sorterFn = sortFn || this.getSortFn(),
            middle,
            comparison;

        while (start <= end) {
            middle = (start + end) >> 1;
            comparison = sorterFn(item, items[middle]);
            if (comparison >= 0) {
                start = middle + 1;
            } else if (comparison < 0) {
                end = middle - 1;
            }
        }

        return start;
    }
});


text:
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
         bootstrap="./vendor/autoload.php"
         colors="true"
         verbose="true">
    <coverage includeUncoveredFiles="true">
        <include>
            <directory suffix=".php">./src</directory>
        </include>
        <report>
            <html outputDirectory="./test-reports/report" lowUpperBound="35" highLowerBound="70"/>
        </report>
    </coverage>
    <testsuite name="SoapPlus">
        <directory>./tests/SoapPlus</directory>
        <exclude>./tests/misc</exclude>
    </testsuite>
    <logging/>
</phpunit>


text:
import os
from unittest.mock import patch

import pytest

from azure.ai.ml import Input, Output, command, dsl, load_component, load_job
from azure.ai.ml.constants._common import AZUREML_PRIVATE_FEATURES_ENV_VAR
from azure.ai.ml.entities import CommandComponent, CommandJob, CommandJobLimits, JobResourceConfiguration

from .._util import _UTILS_TIMEOUT_SECOND

@pytest.mark.timeout(_UTILS_TIMEOUT_SECOND)
@pytest.mark.unittest
@pytest.mark.core_sdk_test
class TestTelemetryValue:
    def test_component_node_telemetry_value(self):
        # From yaml
        component_func = load_component("./tests/test_configs/components/helloworld_component.yml")
        v = component_func._get_telemetry_values()
        assert v["type"] == "command"
        assert v["source"] == "YAML.COMPONENT"
        assert v["is_anonymous"] is False
        component = component_func()
        v = component._get_telemetry_values()
        assert v["type"] == "command"
        assert v["source"] == "YAML.COMPONENT"

        # From class
        code = (
            "/subscriptions/4faaaf21-663f-4391-96fd-47197c630979/resourceGroups/"
            "test-rg-centraluseuap-v2-2021W10/providers/Microsoft.MachineLearningServices/"
            "workspaces/sdk_vnext_cli/codes/e736692c-8542-11eb-b746-6c2b59f8af4d/versions/1"
        )
        component = CommandComponent(
            name="sample_command_component_basic",
            display_name="CommandComponentBasic",
            description="This is the basic command component",
            tags={"tag": "tagvalue", "owner": "sdkteam"},
            version="1",
            outputs={"component_out_path": {"type": "uri_folder"}},
            command="echo Hello World",
            code=code,
            environment="AzureML-sklearn-0.24-ubuntu18.04-py37-cpu:1",
        )
        v = component._get_telemetry_values()
        assert v["type"] == "command"
        assert v["source"] == "CLASS"
        assert v["is_anonymous"] is False

        # From builder
        test_command = command(
            name="my-job",
            display_name="my-fancy-job",
            description="This is a fancy job",
            tags=dict(),
            command="python train.py --input-data ${{inputs.input_data}} --lr ${{inputs.learning_rate}}",
            code="./src",
            compute="cpu-cluster",
            environment="my-env:1",
            environment_variables=dict(foo="bar"),
            # Customers can still do this:
            resources=JobResourceConfiguration(instance_count=2, instance_type="STANDARD_D2"),
            limits=CommandJobLimits(timeout=300),
            inputs={
                "float": 0.01,
                "integer": 1,
                "string": "str",
                "boolean": False,
                "uri_folder": Input(type="uri_folder", path="https://my-blob/path/to/data", mode="ro_mount"),
                "uri_file": dict(type="uri_file", path="https://my-blob/path/to/data", mode="download"),
            },
            outputs={"my_model": Output(type="mlflow_model", mode="rw_mount")},
        )
        v = test_command._get_telemetry_values()
        assert v["type"] == "command"
        assert v["source"] == "BUILDER"

    def test_pipeline_telemetry_value(self):
        # standalone command job
        basic_job = CommandJob(
            display_name="hello-world-job",
            command='echo "hello world"',
            environment="AzureML-Minimal:1",
            compute="cpu-cluster",
        )
        v = basic_job._get_telemetry_values()
        assert v["type"] == "command"

        # pipeline job
        test_path = "./tests/test_configs/pipeline_jobs/jobs_with_automl_nodes/onejob_automl_classification.yml"
        job = load_job(test_path)
        v = job._get_telemetry_values()
        assert v["type"] == "pipeline"
        assert v["source"] == "YAML.JOB"
        assert v["node_count"] == 1
        assert v["node_type"] == '{"automl": 1}'
        assert v["node_source"] == '{"BUILDER": 1}'

    def test_dsl_pipeline_telemetry_value(self):
        path = "./tests/test_configs/components/helloworld_component.yml"

        @dsl.pipeline()
        def pipeline_no_arg():
            component_func = load_component(path)
            component_func(component_in_path=Input(path="/a/path/on/ds"), component_in_number=1)

        pipeline1 = pipeline_no_arg()
        v = pipeline1._get_telemetry_values()
        assert v["type"] == "pipeline"
        assert v["source"] == "DSL"
        assert v["node_count"] == 1
        assert v["node_type"] == '{"command": 1}'
        assert v["node_source"] == '{"YAML.COMPONENT": 1}'

    @patch.dict(os.environ, {AZUREML_PRIVATE_FEATURES_ENV_VAR: "True"})
    def test_dsl_subpipeline_telemetry_value(self):
        path = "./tests/test_configs/components/helloworld_component.yml"
        component_func1 = load_component(path)

        @dsl.pipeline(name="sub_pipeline")
        def sub_pipeline(component_in_number: int, component_in_path: str):
            node1 = component_func1(component_in_number=component_in_number, component_in_path=component_in_path)
            node2 = component_func1(
                component_in_number=component_in_number, component_in_path=node1.outputs.component_out_path
            )
            return {"sub_pipeline_out": node2.outputs.component_out_path}

        @dsl.pipeline(name="root_pipeline")
        def root_pipeline(component_in_number: int, component_in_path: str):
            node1 = sub_pipeline(component_in_number=component_in_number, component_in_path=component_in_path)
            node1.compute = "will be ignored"
            node2 = sub_pipeline(
                component_in_number=component_in_number, component_in_path=node1.outputs.sub_pipeline_out
            )
            return node2.outputs

        pipeline1 = root_pipeline(1, "test")
        v = pipeline1._get_telemetry_values()
        assert v["type"] == "pipeline"
        assert v["source"] == "DSL"
        assert v["node_count"] == 2
        assert v["node_type"] == '{"pipeline": 2}'
        assert v["node_source"] == '{"DSL": 2}'


text:
package org.apache.cassandra.io.util;

import java.io.BufferedWriter;
import java.io.Closeable;
import java.io.DataOutput;
import java.io.File;
import java.io.IOError;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.util.zip.Adler32;
import java.util.zip.Checksum;

import com.google.common.base.Charsets;

import org.apache.cassandra.io.FSWriteError;
import org.apache.cassandra.io.sstable.Component;
import org.apache.cassandra.io.sstable.Descriptor;
import org.apache.cassandra.utils.CRC32Factory;
import org.apache.cassandra.utils.FBUtilities;

public class DataIntegrityMetadata
{
    public static ChecksumValidator checksumValidator(Descriptor desc) throws IOException
    {
        return new ChecksumValidator(desc);
    }

    public static class ChecksumValidator implements Closeable
    {
        private final Checksum checksum;
        private final RandomAccessReader reader;
        private final Descriptor descriptor;
        public final int chunkSize;

        public ChecksumValidator(Descriptor descriptor) throws IOException
        {
            this.descriptor = descriptor;
            checksum = descriptor.version.hasAllAdlerChecksums() ? new Adler32() : CRC32Factory.instance.create();
            reader = RandomAccessReader.open(new File(descriptor.filenameFor(Component.CRC)));
            chunkSize = reader.readInt();
        }

        public void seek(long offset)
        {
            long start = chunkStart(offset);
            reader.seek(((start / chunkSize) * 4L) + 4); // 8 byte checksum per chunk + 4 byte header/chunkLength
        }

        public long chunkStart(long offset)
        {
            long startChunk = offset / chunkSize;
            return startChunk * chunkSize;
        }

        public void validate(byte[] bytes, int start, int end) throws IOException
        {
            checksum.update(bytes, start, end);
            int current = (int) checksum.getValue();
            checksum.reset();
            int actual = reader.readInt();
            if (current != actual)
                throw new IOException("Corrupted SSTable : " + descriptor.filenameFor(Component.DATA));
        }

        public void close()
        {
            reader.close();
        }
    }

    public static class ChecksumWriter
    {
        private final Adler32 incrementalChecksum = new Adler32();
        private final DataOutput incrementalOut;
        private final Adler32 fullChecksum = new Adler32();

        public ChecksumWriter(DataOutput incrementalOut)
        {
            this.incrementalOut = incrementalOut;
        }

        public void writeChunkSize(int length)
        {
            try
            {
                incrementalOut.writeInt(length);
            }
            catch (IOException e)
            {
                throw new IOError(e);
            }
        }

        // checksumIncrementalResult indicates if the checksum we compute for this buffer should itself be
        // included in the full checksum, translating to if the partial checksum is serialized along with the
        // data it checksums (in which case the file checksum as calculated by external tools would mismatch if
        // we did not include it), or independently.

        // CompressedSequentialWriters serialize the partial checksums inline with the compressed data chunks they
        // corroborate, whereas ChecksummedSequentialWriters serialize them to a different file.
        public void append(byte[] buffer, int start, int end, boolean checksumIncrementalResult)
        {
            try
            {
                int incrementalChecksumValue;

                incrementalChecksum.update(buffer, start, end);
                incrementalChecksumValue = (int) incrementalChecksum.getValue();
                incrementalOut.writeInt(incrementalChecksumValue);
                incrementalChecksum.reset();

                fullChecksum.update(buffer, start, end);

                if (checksumIncrementalResult)
                {
                    ByteBuffer byteBuffer = ByteBuffer.allocate(4);
                    byteBuffer.putInt(incrementalChecksumValue);
                    fullChecksum.update(byteBuffer.array(), 0, byteBuffer.array().length);
                }
            }
            catch (IOException e)
            {
                throw new IOError(e);
            }
        }

        public void appendDirect(ByteBuffer bb)
        {
            try
            {
                ByteBuffer toAppend = bb.duplicate();
                toAppend.mark();
                FBUtilities.directCheckSum(incrementalChecksum, toAppend);
                toAppend.reset();

                incrementalOut.writeInt((int) incrementalChecksum.getValue());
                incrementalChecksum.reset();

                FBUtilities.directCheckSum(fullChecksum, toAppend);
            }
            catch (IOException e)
            {
                throw new IOError(e);
            }
        }

        public void writeFullChecksum(Descriptor descriptor)
        {
            File outFile = new File(descriptor.filenameFor(Component.DIGEST));
            BufferedWriter out = null;
            try
            {
                out = Files.newBufferedWriter(outFile.toPath(), Charsets.UTF_8);
                out.write(String.valueOf(fullChecksum.getValue()));
            }
            catch (IOException e)
            {
                throw new FSWriteError(e, outFile);
            }
            finally
            {
                FileUtils.closeQuietly(out);
            }
        }
    }
}


text:
.book-summary {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    position: absolute;
    top: 0;
    left: -300px;
    bottom: 0;
    z-index: 1;
    overflow-y: auto;
    width: 300px;
    color: #364149;
    background: #fafafa;
    border-right: 1px solid rgba(0, 0, 0, .07);
    -webkit-transition: left 250ms ease;
    -moz-transition: left 250ms ease;
    -o-transition: left 250ms ease;
    transition: left 250ms ease
}
.book-summary ul.summary {
    list-style: none;
    margin: 0;
    padding: 0;
    -webkit-transition: top .5s ease;
    -moz-transition: top .5s ease;
    -o-transition: top .5s ease;
    transition: top .5s ease
}
.book-summary ul.summary li {
    list-style: none
}
.book-summary ul.summary li.header {
    padding: 10px 15px;
    padding-top: 20px;
    text-transform: uppercase;
    color: #939da3
}
.book-summary ul.summary li.divider {
    height: 1px;
    margin: 7px 0;
    overflow: hidden;
    background: rgba(0, 0, 0, .07)
}
.book-summary ul.summary li i.fa-check {
    display: none;
    position: absolute;
    right: 9px;
    top: 16px;
    font-size: 9px;
    color: #3c3
}
.book-summary ul.summary li.done>a {
    color: #364149;
    font-weight: 400
}
.book-summary ul.summary li.done>a i {
    display: inline
}
.book-summary ul.summary li a,
.book-summary ul.summary li span {
    display: block;
    padding: 10px 15px;
    border-bottom: none;
    color: #364149;
    background: 0 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    position: relative
}
.book-summary ul.summary li a:hover {
    text-decoration: underline
}
.book-summary ul.summary li a:focus {
    outline: 0
}
.book-summary ul.summary li.active>a {
    color: #008cff;
    background: 0 0;
    text-decoration: none
}
.book-summary ul.summary li ul {
    padding-left: 20px
}
@media (max-width: 600px) {
    .book-summary {
        width: calc(100% - 60px);
        bottom: 0;
        left: -100%
    }
}
.book.with-summary .book-summary {
    left: 0
}
.book.without-animation .book-summary {
    -webkit-transition: none!important;
    -moz-transition: none!important;
    -o-transition: none!important;
    transition: none!important
}
.book {
    position: relative;
    width: 100%;
    height: 100%
}
@media (min-width: 600px) {
    .book.with-summary .book-body {
        left: 300px
    }
}
@media (max-width: 600px) {
    .book.with-summary {
        overflow: hidden
    }
    .book.with-summary .book-summary {
        width: 0;
    }
}
.book.without-animation .book-body {
    -webkit-transition: none!important;
    -moz-transition: none!important;
    -o-transition: none!important;
    transition: none!important
}
.book-body {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    color: #000;
    background: #fff;
    -webkit-transition: left 250ms ease;
    -moz-transition: left 250ms ease;
    -o-transition: left 250ms ease;
    transition: left 250ms ease
}
.book-body .body-inner {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto
}
@media (max-width: 1240px) {
    .book-body {
        -webkit-transition: -webkit-transform 250ms ease;
        -moz-transition: -moz-transform 250ms ease;
        -o-transition: -o-transform 250ms ease;
        transition: transform 250ms ease;
        padding-bottom: 20px
    }
    .book-body .body-inner {
        position: static;
        min-height: calc(100% - 50px)
    }
}
.page-wrapper {
    position: relative;
    outline: 0
}
.page-inner {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 15px 40px 15px
}
.page-inner .btn-group .btn {
    border-radius: 0;
    background: #eee;
    border: 0
}
.buttons:after,
.buttons:before {
    content: " ";
    display: table;
    line-height: 0
}
.buttons:after {
    clear: both
}
.button {
    border: 0;
    background-color: transparent;
    background: #eee;
    color: #666;
    width: 100%;
    text-align: center;
    float: left;
    line-height: 1.42857143;
    padding: 8px 4px
}
.button:hover {
    color: #444
}
.button:focus,
.button:hover {
    outline: 0
}
.button.size-2 {
    width: 50%
}
.button.size-3 {
    width: 33%
}
.markdown-section {
    display: block;
    word-wrap: break-word;
    overflow: hidden;
    color: #333;
    line-height: 1.7;
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%
}
.markdown-section * {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    font-size: inherit
}
.markdown-section>:first-child {
    margin-top: 0!important
}
.markdown-section>:last-child {
    margin-bottom: 0!important
}
.markdown-section blockquote,
.markdown-section code,
.markdown-section figure,
.markdown-section img,
.markdown-section pre,
.markdown-section table,
.markdown-section tr {
    page-break-inside: avoid
}
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section p {
    orphans: 3;
    widows: 3
}
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5 {
    page-break-after: avoid
}
.markdown-section b,
.markdown-section strong {
    font-weight: 700
}
.markdown-section em {
    font-style: italic
}
.markdown-section blockquote,
.markdown-section dl,
.markdown-section ol,
.markdown-section p,
.markdown-section table,
.markdown-section ul {
    margin-top: 0;
    margin-bottom: .85em
}
.markdown-section a {
    color: #4183c4;
    text-decoration: none;
    background: 0 0
}
.markdown-section a:active,
.markdown-section a:focus,
.markdown-section a:hover {
    outline: 0;
    text-decoration: underline
}
.markdown-section img {
    max-width: 90%;
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    border-radius: 2px;
    margin: 2rem;
}
.markdown-section hr {
    height: 4px;
    padding: 0;
    margin: 1.7em 0;
    overflow: hidden;
    background-color: #e7e7e7;
    border: none
}
.markdown-section hr:after,
.markdown-section hr:before {
    display: table;
    content: " "
}
.markdown-section hr:after {
    clear: both
}
.markdown-section h1,
.markdown-section h2,
.markdown-section h3 {
    margin-top: 1.275em;
    margin-bottom: .85em;
    font-weight: 700
}
.markdown-section h1 {
    font-size: 2em
}
.markdown-section h2 {
    font-size: 1.75em
}
.markdown-section h3 {
    margin-top: .85em;
    font-size: 1em
}
.markdown-section code,
.markdown-section pre {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    direction: ltr;
    margin: 0;
    padding: 0;
    border: none;
    color: inherit
}
.markdown-section pre {
    overflow: auto;
    word-wrap: normal;
    margin: 0;
    padding: .85em 1em;
    margin-bottom: 1.275em;
    background: #f7f7f7
}
.markdown-section pre>code {
    display: inline;
    max-width: initial;
    padding: 0;
    margin: 0;
    overflow: initial;
    line-height: inherit;
    font-size: .85em;
    white-space: pre;
    background: 0 0
}
.markdown-section pre>code:after,
.markdown-section pre>code:before {
    content: normal
}
.markdown-section code {
    padding: .2em;
    margin: 0;
    font-size: .85em;
    background-color: #f7f7f7
}
.markdown-section code:after,
.markdown-section code:before {
    letter-spacing: -.2em;
    content: "\00a0"
}
.markdown-section table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    overflow: auto
}
.markdown-section table td,
.markdown-section table th {
    padding: 6px 13px;
    border: 1px solid #ddd
}
.markdown-section table tr {
    background-color: #fff;
    border-top: 1px solid #ccc
}
.markdown-section table tr:nth-child(2n) {
    background-color: #f8f8f8
}
.markdown-section table th {
    font-weight: 700
}
.markdown-section ol,
.markdown-section ul {
    padding: 0;
    margin: 0;
    margin-bottom: .85em;
    padding-left: 2em
}
.markdown-section ol ol,
.markdown-section ol ul,
.markdown-section ul ol,
.markdown-section ul ul {
    margin-top: 0;
    margin-bottom: 0
}
.markdown-section ol ol {
    list-style-type: lower-roman
}
.markdown-section blockquote {
    margin: 0;
    margin-bottom: .85em;
    padding: 0 15px;
    color: #858585;
    border-left: 4px solid #e5e5e5
}
.markdown-section blockquote:first-child {
    margin-top: 0
}
.markdown-section blockquote:last-child {
    margin-bottom: 0
}
.markdown-section dl {
    padding: 0
}
.markdown-section dl dt {
    padding: 0;
    margin-top: .85em;
    font-style: italic;
    font-weight: 700
}
.markdown-section dl dd {
    padding: 0 .85em;
    margin-bottom: .85em
}
.markdown-section dd {
    margin-left: 0
}
.markdown-section .glossary-term {
    cursor: help;
    text-decoration: underline
}
.navigation {
    position: absolute;
    top: 50px;
    bottom: 0;
    margin: 0;
    max-width: 150px;
    min-width: 90px;
    display: flex;
    justify-content: center;
    align-content: center;
    flex-direction: column;
    font-size: 40px;
    color: #ccc;
    text-align: center;
    -webkit-transition: all 350ms ease;
    -moz-transition: all 350ms ease;
    -o-transition: all 350ms ease;
    transition: all 350ms ease
}
.navigation:hover {
    text-decoration: none;
    color: #444
}
.navigation.navigation-next {
    right: 0
}
.navigation.navigation-prev {
    left: 0
}
@media (max-width: 1240px) {
    .navigation {
        position: static;
        top: auto;
        max-width: 50%;
        width: 50%;
        display: inline-block;
        float: left
    }
    .navigation.navigation-unique {
        max-width: 100%;
        width: 100%
    }
}
.book .book-header .font-settings .font-enlarge {
  line-height: 30px;
  font-size: 1.4em;
}
.book .book-header .font-settings .font-reduce {
  line-height: 30px;
  font-size: 1em;
}
.book.font-size-2 .book-body .page-inner section {
  font-size: 1.6rem;
}
.book.font-family-1 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: none;
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased
}
a {
    text-decoration: none
}
body,
html {
    height: 100%
}
html {
    font-size: 62.5%
}
body {
    text-rendering: optimizeLegibility;
    font-smoothing: antialiased;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    letter-spacing: .2px;
    text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%
}


text:
/* $Id: natpmp.h,v 1.6 2007/12/13 14:55:16 nanard Exp $ */
/* libnatpmp
 * Copyright (c) 2007, Thomas BERNARD <miniupnp@free.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
#ifndef __NATPMP_H__
#define __NATPMP_H__

/* NAT-PMP Port as defined by the NAT-PMP draft */
#define NATPMP_PORT (5351)

#include <time.h>
#include <sys/time.h>
#include <netinet/in.h>

typedef struct {
	int s;	/* socket */
	in_addr_t gateway;	/* default gateway (IPv4) */
	int has_pending_request;
	unsigned char pending_request[12];
	int pending_request_len;
	int try_number;
	struct timeval retry_time;
} natpmp_t;

typedef struct {
	uint16_t type;	/* NATPMP_RESPTYPE_* */
	uint16_t resultcode;	/* NAT-PMP response code */
	uint32_t epoch;	/* Seconds since start of epoch */
	union {
		struct {
			//in_addr_t addr;
			struct in_addr addr;
		} publicaddress;
		struct {
			uint16_t privateport;
			uint16_t mappedpublicport;
			uint32_t lifetime;
		} newportmapping;
	};
} natpmpresp_t;

/* possible values for type field of natpmpresp_t */
#define NATPMP_RESPTYPE_PUBLICADDRESS (0)
#define NATPMP_RESPTYPE_UDPPORTMAPPING (1)
#define NATPMP_RESPTYPE_TCPPORTMAPPING (2)

/* Values to pass to sendnewportmappingrequest() */
#define NATPMP_PROTOCOL_UDP (1)
#define NATPMP_PROTOCOL_TCP (2)

/* return values */
/* NATPMP_ERR_INVALIDARGS : invalid arguments passed to the function */
#define NATPMP_ERR_INVALIDARGS (-1)
/* NATPMP_ERR_SOCKETERROR : socket() failed. check errno for details */
#define NATPMP_ERR_SOCKETERROR (-2)
/* NATPMP_ERR_CANNOTGETGATEWAY : can't get default gateway IP */
#define NATPMP_ERR_CANNOTGETGATEWAY (-3)
/* NATPMP_ERR_CLOSEERR : close() failed. check errno for details */
#define NATPMP_ERR_CLOSEERR (-4)
/* NATPMP_ERR_RECVFROM : recvfrom() failed. check errno for details */
#define NATPMP_ERR_RECVFROM (-5)
/* NATPMP_ERR_NOPENDINGREQ : readnatpmpresponseorretry() called while
 * no NAT-PMP request was pending */
#define NATPMP_ERR_NOPENDINGREQ (-6)
/* NATPMP_ERR_NOGATEWAYSUPPORT : the gateway does not support NAT-PMP */
#define NATPMP_ERR_NOGATEWAYSUPPORT (-7)
/* NATPMP_ERR_CONNECTERR : connect() failed. check errno for details */
#define NATPMP_ERR_CONNECTERR (-8)
/* NATPMP_ERR_WRONGPACKETSOURCE : packet not received from the network gateway */
#define NATPMP_ERR_WRONGPACKETSOURCE (-9)
/* NATPMP_ERR_SENDERR : send() failed. check errno for details */
#define NATPMP_ERR_SENDERR (-10)
/* NATPMP_ERR_FCNTLERROR : fcntl() failed. check errno for details */
#define NATPMP_ERR_FCNTLERROR (-11)
/* NATPMP_ERR_GETTIMEOFDAYERR : gettimeofday() failed. check errno for details */
#define NATPMP_ERR_GETTIMEOFDAYERR (-12)

/* */
#define NATPMP_ERR_UNSUPPORTEDVERSION (-14)
#define NATPMP_ERR_UNSUPPORTEDOPCODE (-15)

/* Errors from the server : */
#define NATPMP_ERR_UNDEFINEDERROR (-49)
#define NATPMP_ERR_NOTAUTHORIZED (-51)
#define NATPMP_ERR_NETWORKFAILURE (-52)
#define NATPMP_ERR_OUTOFRESOURCES (-53)

/* NATPMP_TRYAGAIN : no data available for the moment. try again later */
#define NATPMP_TRYAGAIN (-100)

/* initnatpmp()
 * initialize a natpmp_t object
 * Return values :
 * 0 = OK
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_SOCKETERROR
 * NATPMP_ERR_FCNTLERROR
 * NATPMP_ERR_CANNOTGETGATEWAY
 * NATPMP_ERR_CONNECTERR */
int initnatpmp(natpmp_t * p);

/* closenatpmp()
 * close resources associated with a natpmp_t object
 * Return values :
 * 0 = OK
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_CLOSEERR */
int closenatpmp(natpmp_t * p);

/* sendpublicaddressrequest()
 * send a public address NAT-PMP request to the network gateway
 * Return values :
 * 2 = OK (size of the request)
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_SENDERR */
int sendpublicaddressrequest(natpmp_t * p);

/* sendnewportmappingrequest()
 * send a new port mapping NAT-PMP request to the network gateway
 * Arguments :
 * protocol is either NATPMP_PROTOCOL_TCP or NATPMP_PROTOCOL_UDP,
 * lifetime is in seconds.
 * To remove a port mapping, set lifetime to zero.
 * To remove all port mappings to the host, set lifetime and both ports
 * to zero.
 * Return values :
 * 12 = OK (size of the request)
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_SENDERR */
int sendnewportmappingrequest(natpmp_t * p, int protocol,
                              uint16_t privateport, uint16_t publicport,
							  uint32_t lifetime);

/* getnatpmprequesttimeout()
 * fills the timeval structure with the timeout duration of the
 * currently pending NAT-PMP request.
 * Return values :
 * 0 = OK
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_GETTIMEOFDAYERR
 * NATPMP_ERR_NOPENDINGREQ */
int getnatpmprequesttimeout(natpmp_t * p, struct timeval * timeout);

/* readnatpmpresponseorretry()
 * fills the natpmpresp_t structure if possible
 * Return values :
 * 0 = OK
 * NATPMP_TRYAGAIN
 * NATPMP_ERR_INVALIDARGS
 * NATPMP_ERR_NOPENDINGREQ
 * NATPMP_ERR_NOGATEWAYSUPPORT
 * NATPMP_ERR_RECVFROM
 * NATPMP_ERR_WRONGPACKETSOURCE
 * NATPMP_ERR_UNSUPPORTEDVERSION
 * NATPMP_ERR_UNSUPPORTEDOPCODE
 * NATPMP_ERR_NOTAUTHORIZED
 * NATPMP_ERR_NETWORKFAILURE
 * NATPMP_ERR_OUTOFRESOURCES
 * NATPMP_ERR_UNSUPPORTEDOPCODE
 * NATPMP_ERR_UNDEFINEDERROR */
int readnatpmpresponseorretry(natpmp_t * p, natpmpresp_t * response);

#endif


text:
package net.cpollet.jixture.fixtures.transformers;

import net.cpollet.jixture.fixtures.ExcelFileFixture;
import net.cpollet.jixture.helper.MappingBuilder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

import java.io.InputStream;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

/**
 * Transforms Excel fixtures into Object fixtures.
 *
 * @see net.cpollet.jixture.fixtures.ExcelFileFixture
 * @see net.cpollet.jixture.fixtures.ObjectFixture
 *
 * @author Christophe Pollet
 */
public abstract class ExcelFileFixtureTransformer<From extends ExcelFileFixture> extends FileFixtureTransformer<From> {

	private static final String DEFAULT_MODE_COLUMN_NAME = "mode";
	private static final String DEFAULT_ESCAPE_CHAR = "!";

	private String modeColumnName = DEFAULT_MODE_COLUMN_NAME;
	private String escapeChar = DEFAULT_ESCAPE_CHAR;

	public void setModeColumnName(String modeColumnName) {
		this.modeColumnName = modeColumnName;
	}

	public void setEscapeChar(String escapeChar) {
		this.escapeChar = escapeChar;
	}

	@Override
	protected List<Object> parse(From fixture) {
		InputStream inputStream = fixture.getInputStream();
		Workbook workbook = createWorkbook(inputStream);

		DataFormatter dataFormatter = new DataFormatter();
		FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();

		List<Object> mappings = new LinkedList<Object>();
		Helpers helpers = new Helpers();
		helpers.dataFormatter = dataFormatter;
		helpers.evaluator = evaluator;

		Parameters parameters = new Parameters();
		parameters.mode = fixture.getMode();

		for (int sheetIndex = 0; sheetIndex < workbook.getNumberOfSheets(); sheetIndex++) {
			Sheet sheet = workbook.getSheetAt(sheetIndex);

			mappings.addAll(parseSheet(sheet, helpers, parameters));
		}

		return mappings;
	}

	private List<Object> parseSheet(Sheet sheet, Helpers helpers, Parameters parameters) {
		parameters.tableName = sheet.getSheetName();

		if (parameters.tableName.startsWith(escapeChar)) {
			return Collections.emptyList();
		}

		List<Object> mappings = new LinkedList<Object>();

		Iterator<Row> rowIterator = sheet.iterator();

		if (rowIterator.hasNext()) {
			Row rowColumnNames = rowIterator.next();

			while (rowIterator.hasNext()) {
				Object mapping = buildMappingForRow(helpers, parameters, rowIterator.next(), rowColumnNames);

				if (null != mapping) {
					mappings.add(mapping);
				}
			}
		}

		return mappings;
	}

	@SuppressWarnings("MethodWithTooManyParameters")
	private Object buildMappingForRow(Helpers helpers, Parameters parameters, Row rowColumnValues, Row rowColumnNames) {
		MappingBuilder mappingBuilder = mappingBuilderFactory.create(parameters.tableName);

		Iterator<Cell> valuesIterator = rowColumnValues.cellIterator();
		Iterator<Cell> columnsIterator = rowColumnNames.cellIterator();

		while (valuesIterator.hasNext() && columnsIterator.hasNext()) {
			Cell columnNameCell = columnsIterator.next();
			Cell columnValueCell = valuesIterator.next();

			helpers.evaluator.evaluateFormulaCell(columnValueCell);

			String columnName = columnNameCell.getStringCellValue();
			String columnValue = helpers.dataFormatter.formatCellValue(columnValueCell, helpers.evaluator);

			if ((escapeChar + modeColumnName).equals(columnName)) {
				if (!parameters.mode.getMarkers().contains(columnValue)) {
					return null;
				}
			}
			else {
				mappingBuilder.withValue(columnName, columnValue);
			}
		}

		return mappingBuilder.build();
	}

	protected abstract Workbook createWorkbook(InputStream inputStream);

	private class Helpers {
		DataFormatter dataFormatter;
		FormulaEvaluator evaluator;
	}

	private class Parameters {
		String tableName;
		ExcelFileFixture.Mode mode;
	}
}


text:
class AcDMMEPlotProperties
{
public:
    /// <summary>
    /// Default constructor
    /// </summary>
    ///
    /// <remarks>
    /// Constructs an empty AcDMMEPlotProperties object.
    /// </remarks>
    ///
  AcDMMEPlotProperties()
    : m_id(NULL)
  {
  }
    /// <summary>
    /// Copy constructor
    /// </summary>
    ///
    /// <param name="src">
    /// the object to be copied
    /// </param>
    ///
  AcDMMEPlotProperties(const AcDMMEPlotProperties& src)
    : m_id(NULL)
  {
    *this = src;
  }
    /// <summary>
    /// Destructor
    /// </summary>
    ///
  ~AcDMMEPlotProperties()
  {
    m_properties.removeAll();
    m_refs.removeAll();
    if (NULL != m_id)
    {
      delete m_id;
    }
  }
    /// <summary>
    /// Adds a new AcDMMEPlotProperty object to the internal vector of
    /// properties
    /// </summary>
    ///
    /// <param name="property">
    /// the property to be added to this Properties list
    /// </param>
    ///
  void AddProperty(const AcDMMEPlotProperty* property)
  {
    if (NULL == property)
    {
      return ;
    }
    m_properties.append(*property);
  }
    /// <summary>
    /// Creates and adds a new AcDMMEPlotProperty object to the internal
    /// vector of properties.
    /// </summary>
    ///
    /// <param name="name">
    /// the new property's name
    /// </param>
    ///
    /// <param name="value">
    /// the new property's value
    /// </param>
    ///
  void AddProperty(wchar_t* name, wchar_t* value)
  {
    AcDMMEPlotProperty newProp(name, value);
    m_properties.append(newProp);
  }
    /// <summary>
    /// accessor for the internal vector of AcDMMEPlotProperty objects
    /// contained by this object
    /// </summary>
    ///
    /// <returns>
    /// Returns a const reference to the internal Vector of
    /// AcDMMEPlotProperty objects contained by this object
    /// </returns>
  const AcDMMEPlotPropertyVec& GetProperties() const
  {
    return m_properties;
  }
    /// <summary>
    /// accessor for individual properties in the internal vector of
    /// AcDMMEPlotProperties contained in this object
    /// </summary>
    ///
    /// <param name="index">
    /// the zero based index of the desired property
    /// </param>
    ///
    /// <returns>
    /// Returns a const pointer to the EPlotProperty object at the given
    /// 0-based index.
    /// </returns>
    ///
    /// <remarks>
    /// warning - May overflow the internal Vector array.  Clients should
    /// check GetProperties().size() before calling this method.
    /// </remarks>
    ///
  const AcDMMEPlotProperty* GetProperty(unsigned long index) const
  {
    if (m_properties.length() <= (int) index)
    {
      return NULL;
    }
    return &m_properties[index];
  }
    /// <summary>
    /// mutator for the Id attribute of this object
    /// </summary>
    ///
    /// <param name="id">
    /// the Unicode unique identifier the client assigns to this object.
    /// </param>
    ///
    /// <remarks>
    /// The unique identifier for this EPlotProperties element (can be
    /// a name, a GUID, etc.). It is preferred for this string to be
    /// prefixed with the client application name to distinguish its
    /// properties from those of other clients
    /// The EPlotProperties element, when used in an ObjectDefinition resource,
    /// can be referenced by other "child" EPlotProperties elements, thereby
    /// creating an efficient hierarchy of properties.
    /// WARNING - these Ids are processed in a space delimited list. Your
    /// properties will not behave as expected if the Id contains spaces.
    /// </remarks>
  void SetId(const wchar_t* id)
  {
    if (NULL != m_id)
    {
      delete m_id;
    }
    if (NULL != id)
    {
      size_t nSize = ::wcslen(id) + 1;
      m_id = new wchar_t[nSize];
      errno_t err = ::wcscpy_s(m_id, nSize, id);
      assert(err == 0);
    }
    else
    {
      m_id = NULL;
    }
  }
    /// <summary>
    /// accessor for the Id attribute.
    /// </summary>
    ///
    /// <returns>
    /// returns a const pointer to the Unicode string which is the unique
    /// identifier assigned by the client to this object.
    /// </returns>
    ///
    /// <remarks>
    /// Returns the unique identifier for this AcDMMEPlotProperties element.
    /// </remarks>
  const wchar_t* GetId() const
  {
    return m_id;
  }
    /// <summary>
    /// Sets the vector of the unique identifiers of the EPlotProperties
    /// objects referenced (inherited) by this object.
    /// </summary>
    ///
    /// <param name="refs">
    /// a const reference to a vector of Unicode string identifications
    /// of additional AcDMMEPlotProperties objects
    /// </param>
    ///
    /// <remarks>
    /// The properties in the referenced EPlotProperties objects should be
    /// considered part of this EPlotProperties instance as if they were
    /// contained directly by this instance.
    /// </remarks>
  void SetRefs(const AcDMMStringVec& refs)
  {
    m_refs.removeAll();
    for (int i = 0; i < refs.length(); i++)
    {
      m_refs.append(refs.at(i));
    }
  }
    /// <summary>
    /// accessor for the vector of Unicode string identifications of
    /// referenced AcDMMEPlotProperties objects
    /// </summary>
    ///
    /// <returns>
    /// a const pointer to the vector of Unicode string identifications of
    /// referenced AcDMMEPlotProperties objects
    /// </returns>
  const AcDMMStringVec* GetRefs() const
  {
    return &m_refs;
  }
    /// <summary>
    /// operator= also used by copy constructor
    /// </summary>
    ///
    /// <param name="src">
    /// the object whose values will be copied to this object
    /// </param>
    ///
    /// <returns>
    /// returns this object
    /// </returns>
  AcDMMEPlotProperties& operator=(const AcDMMEPlotProperties& src)
  {
    if (this == &src)
    {
      return *this;
    }
    m_properties.removeAll();
    for (int i = 0; i < src.m_properties.length(); i++)
    {
      m_properties.append(src.m_properties.at(i));
    }
    SetId(src.m_id);
    SetRefs(src.m_refs);
    return *this;
  }
private:
  AcDMMEPlotPropertyVec m_properties;
  wchar_t* m_id;
  AcDMMStringVec m_refs;
};
#endif


text:
'use strict';

Object.defineProperty(exports, '__esModule', {
  value: true
});

var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

var _utils = require('./utils');

var utils = _interopRequireWildcard(_utils);

var _logger = require('./logger');

var _logger2 = _interopRequireDefault(_logger);

var Interpolator = (function () {
  function Interpolator() {
    var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

    _classCallCheck(this, Interpolator);

    this.logger = _logger2['default'].create('interpolator');

    this.init(options, true);
  }

  _createClass(Interpolator, [{
    key: 'init',
    value: function init(options, reset) {
      if (options === undefined) options = {};

      if (reset) this.options = options;
      if (!options.interpolation) options.interpolation = { escapeValue: true };

      var iOpts = options.interpolation;

      this.escapeValue = iOpts.escapeValue;

      this.prefix = iOpts.prefix ? utils.regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
      this.suffix = iOpts.suffix ? utils.regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';

      this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';
      this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';

      this.nestingPrefix = iOpts.nestingPrefix ? utils.regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || utils.regexEscape('$t(');
      this.nestingSuffix = iOpts.nestingSuffix ? utils.regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || utils.regexEscape(')');

      // the regexp
      var regexpStr = this.prefix + '(.+?)' + this.suffix;
      this.regexp = new RegExp(regexpStr, 'g');

      var regexpUnescapeStr = this.prefix + this.unescapePrefix + '(.+?)' + this.unescapeSuffix + this.suffix;
      this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');

      var nestingRegexpStr = this.nestingPrefix + '(.+?)' + this.nestingSuffix;
      this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');
    }
  }, {
    key: 'reset',
    value: function reset() {
      if (this.options) this.init(this.options);
    }
  }, {
    key: 'interpolate',
    value: function interpolate(str, data) {
      var match = undefined,
          value = undefined;

      function regexSafe(val) {
        return val.replace(/\$/g, '$$$$');
      }

      // unescape if has unescapePrefix/Suffix
      while (match = this.regexpUnescape.exec(str)) {
        var _value = utils.getPath(data, match[1].trim());
        str = str.replace(match[0], _value);
      }

      // regular escape on demand
      while (match = this.regexp.exec(str)) {
        value = utils.getPath(data, match[1].trim());
        if (typeof value !== 'string') value = utils.makeString(value);
        if (!value) {
          this.logger.warn('missed to pass in variable ' + match[1] + ' for interpolating ' + str);
          value = '';
        }
        value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value);
        str = str.replace(match[0], value);
        this.regexp.lastIndex = 0;
      }
      return str;
    }
  }, {
    key: 'nest',
    value: function nest(str, fc) {
      var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];

      var match = undefined,
          value = undefined;

      var clonedOptions = JSON.parse(JSON.stringify(options));
      clonedOptions.applyPostProcessor = false; // avoid post processing on nested lookup

      function regexSafe(val) {
        return val.replace(/\$/g, '$$$$');
      }

      // if value is something like "myKey": "lorem $(anotherKey, { "count": {{aValueInOptions}} })"
      function handleHasOptions(key) {
        if (key.indexOf(',') < 0) return key;

        var p = key.split(',');
        key = p.shift();
        var optionsString = p.join(',');
        optionsString = this.interpolate(optionsString, clonedOptions);

        try {
          clonedOptions = JSON.parse(optionsString);
        } catch (e) {
          this.logger.error('failed parsing options string in nesting for key ' + key, e);
        }

        return key;
      }

      // regular escape on demand
      while (match = this.nestingRegexp.exec(str)) {
        value = fc(handleHasOptions.call(this, match[1].trim()), clonedOptions);
        if (typeof value !== 'string') value = utils.makeString(value);
        if (!value) {
          this.logger.warn('missed to pass in variable ' + match[1] + ' for interpolating ' + str);
          value = '';
        }
        value = this.escapeValue ? regexSafe(utils.escape(value)) : regexSafe(value);
        str = str.replace(match[0], value);
        this.regexp.lastIndex = 0;
      }
      return str;
    }
  }]);

  return Interpolator;
})();

exports['default'] = Interpolator;
module.exports = exports['default'];


text:
module Ebay # :nodoc:
  module Types # :nodoc:
    class TaxIdentifierAttributeCode
      extend Enumerable
      extend Enumeration
      IssuingCountry = 'IssuingCountry'
    end
  end
end


text:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
  [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
  >

<hibernate-mapping>
  <class name="org.hisp.dhis.predictor.Predictor" table="predictor">

    <id name="id" column="predictorid">
      <generator class="native" />
    </id>
    &identifiableProperties;

    <property name="name" column="name" not-null="true" unique="true" length="230" />

    <property name="shortName" column="shortname" not-null="true" unique="true" length="50" />

    <property name="description" type="text" />

    <many-to-one name="generator" column="generatorexpressionid" class="org.hisp.dhis.expression.Expression"
                 cascade="all-delete-orphan" foreign-key="fk_predictor_generatorexpressionid" not-null="false"
                 unique="true"/>

    <many-to-one name="output" column="generatoroutput" class="org.hisp.dhis.dataelement.DataElement"
      foreign-key="fk_predictor_outputdataelementid" not-null="true" />

    <many-to-one name="outputCombo" column="generatoroutputcombo" class="org.hisp.dhis.category.CategoryOptionCombo"
      foreign-key="fk_predictor_outputcomboid" />

    <many-to-one name="sampleSkipTest" column="skiptestexpressionid" class="org.hisp.dhis.expression.Expression"
                 cascade="all-delete-orphan" foreign-key="fk_validationrule_skiptestexpressionid" unique="true"/>

    <many-to-one name="periodType" class="org.hisp.dhis.period.PeriodType" column="periodtypeid"
      foreign-key="fk_validationrule_periodtypeid" not-null="true" />

    <set name="organisationUnitLevels" table="predictororgunitlevels">
      <key column="predictorid" foreign-key="fk_predictororgunitlevels_predictorid" />
      <many-to-many class="org.hisp.dhis.organisationunit.OrganisationUnitLevel" column="orgunitlevelid"
        foreign-key="fk_predictororgunitlevels_orgunitlevelid" />
    </set>

    <property name="organisationUnitDescendants" column="organisationunitdescendants" length="100" not-null="true">
      <type name="org.hibernate.type.EnumType">
        <param name="enumClass">org.hisp.dhis.common.OrganisationUnitDescendants</param>
        <param name="useNamed">true</param>
        <param name="type">12</param>
      </type>
    </property>

    <property name="sequentialSampleCount" column="sequentialsamplecount" not-null="true" />

    <property name="annualSampleCount" column="annualsamplecount" not-null="true" />

    <property name="sequentialSkipCount" column="sequentialskipcount" />

    <property name="translations" type="jblTranslations"/>

    <set name="groups" table="predictorgroupmembers" inverse="true">
      <key column="predictorid" />
      <many-to-many class="org.hisp.dhis.predictor.PredictorGroup" column="predictorgroupid" />
    </set>

  </class>

</hibernate-mapping>