text:
<?php

/**
 * Zend_Measure_Cooking_Volume
 */
// require_once 'Zend/Measure/Cooking/Volume.php';

/**
 * @category   Zend
 * @package    Zend_Measure
 * @subpackage UnitTests
 * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @group      Zend_Measure
 */
class Zend_Measure_Cooking_VolumeTest extends PHPUnit_Framework_TestCase
{
    /**
     * test for Mass initialisation
     * expected instance
     */
    public function testMassInit()
    {
        $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertTrue($value instanceof Zend_Measure_Cooking_Volume,'Zend_Measure_Cooking_Volume Object not returned');
    }

    /**
     * test for exception unknown type
     * expected exception
     */
    public function testCooking_VolumeUnknownType()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('100','Cooking_Volume::UNKNOWN','de');
            $this->fail('Exception expected because of unknown type');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test for exception unknown value
     * expected exception
     */
    public function testCooking_VolumeUnknownValue()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('novalue',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $this->fail('Exception expected because of empty value');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test for exception unknown locale
     * expected root value
     */
    public function testCooking_VolumeUnknownLocale()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'nolocale');
            $this->fail('Exception expected because of unknown locale');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test for standard locale
     * expected integer
     */
    public function testCooking_VolumeNoLocale()
    {
        $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD);
        $this->assertEquals(100, $value->getValue(),'Zend_Measure_Cooking_Volume value expected');
    }

    /**
     * test for positive value
     * expected integer
     */
    public function testCooking_VolumeValuePositive()
    {
        $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(100, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a positive integer');
    }

    /**
     * test for negative value
     * expected integer
     */
    public function testCooking_VolumeValueNegative()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-100, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a negative integer');
    }

    /**
     * test for decimal value
     * expected float
     */
    public function testCooking_VolumeValueDecimal()
    {
        $value = new Zend_Measure_Cooking_Volume('-100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-100.200, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a decimal value');
    }

    /**
     * test for decimal seperated value
     * expected float
     */
    public function testCooking_VolumeValueDecimalSeperated()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-100100.200, $value->getValue(),'Zend_Measure_Cooking_Volume Object not returned');
    }

    /**
     * test for string with integrated value
     * expected float
     */
    public function testCooking_VolumeValueString()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-100100.200, $value->getValue(),'Zend_Measure_Cooking_Volume Object not returned');
    }

    /**
     * test for equality
     * expected true
     */
    public function testCooking_VolumeEquality()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $newvalue = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertTrue($value->equals($newvalue),'Zend_Measure_Cooking_Volume Object should be equal');
    }

    /**
     * test for no equality
     * expected false
     */
    public function testCooking_VolumeNoEquality()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $newvalue = new Zend_Measure_Cooking_Volume('-100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertFalse($value->equals($newvalue),'Zend_Measure_Cooking_Volume Object should be not equal');
    }

    /**
     * test for set positive value
     * expected integer
     */
    public function testCooking_VolumeSetPositive()
    {
        $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setValue('200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(200, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a positive integer');
    }

    /**
     * test for set negative value
     * expected integer
     */
    public function testCooking_VolumeSetNegative()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setValue('-200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-200, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a negative integer');
    }

    /**
     * test for set decimal value
     * expected float
     */
    public function testCooking_VolumeSetDecimal()
    {
        $value = new Zend_Measure_Cooking_Volume('-100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setValue('-200,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-200.200, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a decimal value');
    }

    /**
     * test for set decimal seperated value
     * expected float
     */
    public function testCooking_VolumeSetDecimalSeperated()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setValue('-200.200,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-200200.200, $value->getValue(),'Zend_Measure_Cooking_Volume Object not returned');
    }

    /**
     * test for set string with integrated value
     * expected float
     */
    public function testCooking_VolumeSetString()
    {
        $value = new Zend_Measure_Cooking_Volume('-100.100,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setValue('-200.200,200',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals(-200200.200, $value->getValue(),'Zend_Measure_Cooking_Volume Object not returned');
    }

    /**
     * test for exception unknown type
     * expected exception
     */
    public function testCooking_VolumeSetUnknownType()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $value->setValue('-200.200,200','Cooking_Volume::UNKNOWN','de');
            $this->fail('Exception expected because of unknown type');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test for exception unknown value
     * expected exception
     */
    public function testCooking_VolumeSetUnknownValue()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $value->setValue('novalue',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $this->fail('Exception expected because of empty value');
        } catch (\Throwable $e) {
            // success
        }
    }

    /**
     * test for exception unknown locale
     * expected exception
     */
    public function testCooking_VolumeSetUnknownLocale()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('100',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $value->setValue('200',Zend_Measure_Cooking_Volume::STANDARD,'nolocale');
            $this->fail('Exception expected because of unknown locale');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test for exception unknown locale
     * expected exception
     */
    public function testCooking_VolumeSetWithNoLocale()
    {
        $value = new Zend_Measure_Cooking_Volume('100', Zend_Measure_Cooking_Volume::STANDARD, 'de');
        $value->setValue('200', Zend_Measure_Cooking_Volume::STANDARD);
        $this->assertEquals(200, $value->getValue(), 'Zend_Measure_Cooking_Volume value expected to be a positive integer');
    }

    /**
     * test setting type
     * expected new type
     */
    public function testCooking_VolumeSetType()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setType(Zend_Measure_Cooking_Volume::DRAM);
        $this->assertEquals(Zend_Measure_Cooking_Volume::DRAM, $value->getType(), 'Zend_Measure_Cooking_Volume type expected');    }

    /**
     * test setting computed type
     * expected new type
     */
    public function testCooking_VolumeSetComputedType1()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $value->setType(Zend_Measure_Cooking_Volume::DRAM);
        $this->assertEquals(Zend_Measure_Cooking_Volume::DRAM, $value->getType(), 'Zend_Measure_Cooking_Volume type expected');
    }

    /**
     * test setting computed type
     * expected new type
     */
    public function testCooking_VolumeSetComputedType2()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::DRAM,'de');
        $value->setType(Zend_Measure_Cooking_Volume::STANDARD);
        $this->assertEquals(Zend_Measure_Cooking_Volume::STANDARD, $value->getType(), 'Zend_Measure_Cooking_Volume type expected');
    }

    /**
     * test setting unknown type
     * expected new type
     */
    public function testCooking_VolumeSetTypeFailed()
    {
        try {
            $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
            $value->setType('Cooking_Volume::UNKNOWN');
            $this->fail('Exception expected because of unknown type');
        } catch (Zend_Measure_Exception $e) {
            // success
        }
    }

    /**
     * test toString
     * expected string
     */
    public function testCooking_VolumeToString()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals('-100 m³', $value->toString(), 'Value -100 m³ expected');
    }

    /**
     * test __toString
     * expected string
     */
    public function testCooking_Volume_ToString()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $this->assertEquals('-100 m³', $value->__toString(), 'Value -100 m³ expected');
    }

    /**
     * test getConversionList
     * expected array
     */
    public function testCooking_VolumeConversionList()
    {
        $value = new Zend_Measure_Cooking_Volume('-100',Zend_Measure_Cooking_Volume::STANDARD,'de');
        $unit  = $value->getConversionList();
        $this->assertTrue(is_array($unit), 'Array expected');
    }
}


text:
import fresh_tomatoes
import media
'''
Below are the instances of the movie class.
Parameters of the movie class:
  Name
  Year
  Movie title
  Poster Image
  Youtube Url
  Parental Rating
'''
# creating Movie object for The Hobbit: The Battle of the Five Armies.
hobbit_3 = media.Movie(
    "The Hobbit: The Battle of the Five Armies",
    "(2014)",
    "http://upload.wikimedia.org/wikipedia/en/0/0e/The_Hobbit_-_The_Battle_of_the_Five_Armies.jpg",
    "https://www.youtube.com/watch?v=iVAgTiBrrDA",
    "PG-13")

# creating Movie object for Amadeus.
amadeus = media.Movie(
    "Amadeus",
    "(1984)",
    "http://upload.wikimedia.org/wikipedia/en/2/2f/Amadeusmov.jpg",
    "https://www.youtube.com/watch?v=yIzhAKtEzY0",
    "R")

# creating Movie object for Django Unchained.
django_unchained = media.Movie(
    "Django Unchained",
    "(2012)",
    "http://upload.wikimedia.org/wikipedia/en/8/8b/Django_Unchained_Poster.jpg",
    "https://www.youtube.com/watch?v=eUdM9vrCbow",
    "R")

# creating Movie object for
jiro_sushi = media.Movie(
    "Jiro Dreams of Sushi",
    "(2011)",
    "http://upload.wikimedia.org/wikipedia/en/4/47/Jiro_sushi_poster.jpg",
    "https://www.youtube.com/watch?v=buF540VBwAE",
    "PG")

# creating Movie object for
star_trek_into_darkness = media.Movie(
    "Star Trek Into Darkness",
    "(2013)",
    "http://upload.wikimedia.org/wikipedia/en/5/50/StarTrekIntoDarkness_FinalUSPoster.jpg",
    "https://www.youtube.com/watch?v=r5gdbUC9mWU",
    "PG-13")

# creating Movie object for War of Arrows.
war_of_arrows = media.Movie(
    "War of Arrows",
    "(2011)",
    "http://upload.wikimedia.org/wikipedia/en/4/4f/War_of_the_Arrows_film_poster.jpg",
    "https://www.youtube.com/watch?v=XDyIjb272kU",
    "R")

# creating Movie object for The Beat That My Heart Skipped.
beat_that_my_heart_skipped = media.Movie(
    "The Beat That My Heart Skipped",
    "(2005)",
    "http://upload.wikimedia.org/wikipedia/en/f/fd/The_Beat_That_My_Heart_Skipped_poster.jpg",
    "https://www.youtube.com/watch?v=af4SirQ6ip4",
    "Unrated")

# creating Movie object for American Psycho.
american_psycho = media.Movie(
    "American Psycho",
    "(2000)",
    "http://upload.wikimedia.org/wikipedia/en/6/63/Americanpsychoposter.jpg",
    "https://www.youtube.com/watch?v=2GIsExb5jJU",
    "R")

# creating Movie object for The Big Lebowski.
big_lebowski = media.Movie(
    "The Big Lebowski",
    "(1998)",
    "http://upload.wikimedia.org/wikipedia/en/3/35/Biglebowskiposter.jpg",
    "https://www.youtube.com/watch?v=cd-go0oBF4Y",
    "R")

# creating Movie object for Ferris Bueller's Day Off.
ferris_bueller = media.Movie(
    "Ferris Bueller's Day Off",
    "(1986)",
    "http://upload.wikimedia.org/wikipedia/en/9/9b/Ferris_Bueller%27s_Day_Off.jpg",
    "https://www.youtube.com/watch?v=R-P6p86px6U",
    "PG-13")

# creating Movie object for The Good, The Bad, and The Ugly.
good_bad_ugly = media.Movie(
    "The Good, The Bad, and The Ugly",
    "(1966)",
    "http://upload.wikimedia.org/wikipedia/en/4/45/Good_the_bad_and_the_ugly_poster.jpg",
    "https://www.youtube.com/watch?v=WCN5JJY_wiA",
    "Unrated")

# creating Movie object for Snatch
snatch = media.Movie(
    "Snatch",
    "(2000)",
    "http://upload.wikimedia.org/wikipedia/en/a/a7/Snatch_ver4.jpg",
    "https://www.youtube.com/watch?v=lUloT3Dh3-E",
    "R")

# creating Movie object for Kiss Kiss Bang Bang.
kiss_kiss_bang_bang = media.Movie(
    "Kiss Kiss Bang Bang",
    "(2005)",
    "http://upload.wikimedia.org/wikipedia/en/6/61/Kiss_kiss_bang_bang_poster.jpg",
    "https://www.youtube.com/watch?v=__PnD1HWXSo",
    "R")

# creating Movie object for Old Boy.
old_boy = media.Movie(
    "Old Boy",
    "(2000)",
    "http://cdn8.nflximg.net/webp/5968/2435968.webp",
    "https://www.youtube.com/watch?v=tphnn5EPj2w",
    "R")

# creating Movie object for Perfume.
perfume = media.Movie(
    "Perfume: The Story of a Murderer",
    "(2006)",
    "http://upload.wikimedia.org/wikipedia/en/6/69/Perfume_poster.jpg",
    "https://www.youtube.com/watch?v=zutiIw_2e2g",
    "R")

# Python data structure containing the list of movies.
movies = [
          hobbit_3,
          django_unchained,
          amadeus,
          beat_that_my_heart_skipped,
          good_bad_ugly,
          big_lebowski,
          jiro_sushi,
          star_trek_into_darkness,
          war_of_arrows,
          american_psycho,
          snatch,
          kiss_kiss_bang_bang,
          ferris_bueller,
          old_boy,
          perfume
          ]

fresh_tomatoes.open_movies_page(movies)

redpajama_set_name: RedPajamaGithub


text:
Given /^there is a Help page$/ do
end

When /^I visit the page for Help$/ do
  visit("/help")
end

Then /^I should see "(.*?)" title$/ do |title|
  page.should have_content(title)
end

Then /^I should see "(.*?)" link$/ do |name|
  page.has_link?(name, href: root_path)
end


text:
from iptest.assert_util import *

import module

add_clr_assemblies("loadorder_7c")

# namespace module {
#     public class C {
#     }
# }

AreEqual(module.flag, "python")

import module

AreEqual(module.flag, "python")


text:
This kicks off the heroku scheduler. For historical reasons it's called
*StackWhoSync* on heroku.


text:
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2006-2008 Benoit Jacob <jacob.benoit.1@gmail.com>
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

#ifndef EIGEN_IO_H
#define EIGEN_IO_H

namespace Eigen {

enum { DontAlignCols = 1 };
enum { StreamPrecision = -1,
       FullPrecision = -2 };

namespace internal {
template<typename Derived>
std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt);
}

/** \class IOFormat
  * \ingroup Core_Module
  *
  * \brief Stores a set of parameters controlling the way matrices are printed
  *
  * List of available parameters:
  *  - \b precision number of digits for floating point values, or one of the special constants \c StreamPrecision and \c FullPrecision.
  *                 The default is the special value \c StreamPrecision which means to use the
  *                 stream's own precision setting, as set for instance using \c cout.precision(3). The other special value
  *                 \c FullPrecision means that the number of digits will be computed to match the full precision of each floating-point
  *                 type.
  *  - \b flags an OR-ed combination of flags, the default value is 0, the only currently available flag is \c DontAlignCols which
  *             allows to disable the alignment of columns, resulting in faster code.
  *  - \b coeffSeparator string printed between two coefficients of the same row
  *  - \b rowSeparator string printed between two rows
  *  - \b rowPrefix string printed at the beginning of each row
  *  - \b rowSuffix string printed at the end of each row
  *  - \b matPrefix string printed at the beginning of the matrix
  *  - \b matSuffix string printed at the end of the matrix
  *
  * Example: \include IOFormat.cpp
  * Output: \verbinclude IOFormat.out
  *
  * \sa DenseBase::format(), class WithFormat
  */
struct IOFormat
{
  /** Default constructor, see class IOFormat for the meaning of the parameters */
  IOFormat(int _precision = StreamPrecision, int _flags = 0,
    const std::string& _coeffSeparator = " ",
    const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="",
    const std::string& _matPrefix="", const std::string& _matSuffix="")
  : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator),
    rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags)
  {
    // TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
    // don't add rowSpacer if columns are not to be aligned
    if((flags & DontAlignCols))
      return;
    int i = int(matSuffix.length())-1;
    while (i>=0 && matSuffix[i]!='\n')
    {
      rowSpacer += ' ';
      i--;
    }
  }
  std::string matPrefix, matSuffix;
  std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer;
  std::string coeffSeparator;
  int precision;
  int flags;
};

/** \class WithFormat
  * \ingroup Core_Module
  *
  * \brief Pseudo expression providing matrix output with given format
  *
  * \tparam ExpressionType the type of the object on which IO stream operations are performed
  *
  * This class represents an expression with stream operators controlled by a given IOFormat.
  * It is the return type of DenseBase::format()
  * and most of the time this is the only way it is used.
  *
  * See class IOFormat for some examples.
  *
  * \sa DenseBase::format(), class IOFormat
  */
template<typename ExpressionType>
class WithFormat
{
  public:

    WithFormat(const ExpressionType& matrix, const IOFormat& format)
      : m_matrix(matrix), m_format(format)
    {}

    friend std::ostream & operator << (std::ostream & s, const WithFormat& wf)
    {
      return internal::print_matrix(s, wf.m_matrix.eval(), wf.m_format);
    }

  protected:
    typename ExpressionType::Nested m_matrix;
    IOFormat m_format;
};

namespace internal {

// NOTE: This helper is kept for backward compatibility with previous code specializing
//       this internal::significant_decimals_impl structure. In the future we should directly
//       call digits10() which has been introduced in July 2016 in 3.3.
template<typename Scalar>
struct significant_decimals_impl
{
  static inline int run()
  {
    return NumTraits<Scalar>::digits10();
  }
};

/** \internal
  * print the matrix \a _m to the output stream \a s using the output format \a fmt */
template<typename Derived>
std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt)
{
  if(_m.size() == 0)
  {
    s << fmt.matPrefix << fmt.matSuffix;
    return s;
  }

  typename Derived::Nested m = _m;
  typedef typename Derived::Scalar Scalar;

  Index width = 0;

  std::streamsize explicit_precision;
  if(fmt.precision == StreamPrecision)
  {
    explicit_precision = 0;
  }
  else if(fmt.precision == FullPrecision)
  {
    if (NumTraits<Scalar>::IsInteger)
    {
      explicit_precision = 0;
    }
    else
    {
      explicit_precision = significant_decimals_impl<Scalar>::run();
    }
  }
  else
  {
    explicit_precision = fmt.precision;
  }

  std::streamsize old_precision = 0;
  if(explicit_precision) old_precision = s.precision(explicit_precision);

  bool align_cols = !(fmt.flags & DontAlignCols);
  if(align_cols)
  {
    // compute the largest width
    for(Index j = 0; j < m.cols(); ++j)
      for(Index i = 0; i < m.rows(); ++i)
      {
        std::stringstream sstr;
        sstr.copyfmt(s);
        sstr << m.coeff(i,j);
        width = std::max<Index>(width, Index(sstr.str().length()));
      }
  }
  s << fmt.matPrefix;
  for(Index i = 0; i < m.rows(); ++i)
  {
    if (i)
      s << fmt.rowSpacer;
    s << fmt.rowPrefix;
    if(width) s.width(width);
    s << m.coeff(i, 0);
    for(Index j = 1; j < m.cols(); ++j)
    {
      s << fmt.coeffSeparator;
      if (width) s.width(width);
      s << m.coeff(i, j);
    }
    s << fmt.rowSuffix;
    if( i < m.rows() - 1)
      s << fmt.rowSeparator;
  }
  s << fmt.matSuffix;
  if(explicit_precision) s.precision(old_precision);
  return s;
}

} // end namespace internal

/** \relates DenseBase
  *
  * Outputs the matrix, to the given stream.
  *
  * If you wish to print the matrix with a format different than the default, use DenseBase::format().
  *
  * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers.
  * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.
  *
  * \sa DenseBase::format()
  */
template<typename Derived>
std::ostream & operator <<
(std::ostream & s,
 const DenseBase<Derived> & m)
{
  return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT);
}

} // end namespace Eigen

#endif // EIGEN_IO_H


text:
<?php declare(strict_types = 1);

namespace Link0\Bunq\Middleware;

use GuzzleHttp\Middleware;
use GuzzleHttp\Promise\FulfilledPromise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * Be able to debug request and responses
 *
 * Usage:
 *   $handlerStack->push(DebugMiddleware::tap(), 'debug_tap');
 *
 * All requests and responses will now be printed to STDOUT
 *
 */
final class DebugMiddleware
{
    /**
     * @return \Closure
     */
    public static function request()
    {
        return function (RequestInterface $request) {
            echo chr(27) . '[33m' . "REQUEST: " . $request->getMethod() . ' ' . $request->getRequestTarget() . chr(27) . "[0m\n";

            foreach ($request->getHeaders() as $key => $headers) {
                foreach ($headers as $header) {
                    echo "${key}: ${header}\n";
                }
            }

            $body = (string) $request->getBody();
            echo $body;
            $json = @json_decode($body, true);
            if ($json === null) {
                $json = [];
            }
            print_r($json);
        };
    }

    /**
     * @return \Closure
     */
    public static function response()
    {
        return function (RequestInterface $request, $options, FulfilledPromise $responsePromise) {
            $responsePromise->then(function (ResponseInterface $response) {
                echo chr(27) . '[33m' . "RESPONSE: HTTP/" . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase() . chr(27) . "[0m\n";

                foreach ($response->getHeaders() as $key => $headers) {
                    foreach ($headers as $header) {
                        echo "${key}: ${header}\n";
                    }
                }

                $body = (string) $response->getBody();
                $json = @json_decode($body, true);
                if ($json === null) {
                    $json = [];
                }
                print_r($json);
            });
        };
    }

    /**
     * @return callable
     */
    public static function tap(): callable
    {
        return Middleware::tap(
            self::request(),
            self::response()
        );
    }
}


text:
const _ = require('lodash');

module.exports = (function(){

	let bot,
		redis,
		karma = [],
		karmaBans = [];

	function giveKarma (channel, giver, receiver) {
		karma.push({channel: channel.name, giver: giver.name, receiver: receiver.name, ts: _.now()});
		persistKarma();
	}

	function getUserKarma (username) {
		return karma.filter(k => k.receiver === username);
	}

	function getUserKarmaGiving (username) {
		return karma.filter(k => k.giver === username);
	}

	function persistKarma () {
		redis.set(bot.botName + '.karma', JSON.stringify(karma));
	}

	function loadKarma (callback) {
		redis.get(bot.botName + '.karma', callback);
	}

	function banKarma (channel, giver, receiver) {
		if (!isUserKarmaBanned(receiver)) {
			karmaBans.push({channel: channel.name, giver: giver.name, receiver: receiver.name, ts: _.now()});
			persistKarmaBans();
		}
	}

	function unbanKarma (userName) {
		karmaBans = karmaBans.filter(o => o.receiver !== userName);
		persistKarma();
	}

	function isUserKarmaBanned (userName) {
		return !_.isUndefined(karmaBans.find(o => o.receiver === userName));
	}

	function persistKarmaBans () {
		redis.set(bot.botName + '.karma_bans', JSON.stringify(karmaBans));
	}

	function loadKarmaBans (callback) {
		redis.get(bot.botName + '.karma_bans', callback);
	}

	function getLeaderboard () {
		let receivers = _.uniq(_.pluck(karma, 'receiver'));
		//let sumByReceiver = _.map(_.map(receivers, getUserKarma), karmaList => karmaList.length);
		let sumByReceiver = receivers.map(r => {
			return {handle: r, value: getUserKarma(r).length, valueStr: getUserKarma(r).length};
		});

		sumByReceiver = _.sortBy(sumByReceiver, 'value').reverse();
		let uniqueScores = _.uniq(_.pluck(sumByReceiver, 'value'));

		sumByReceiver = sumByReceiver.map((o, index) => {
			o.place = uniqueScores.findIndex(x => x === o.value) + 1;
			return o;
		});

		return sumByReceiver;
	}

	function getGiverLeaderboard () {
		let givers = _.uniq(_.pluck(karma, 'giver'));

		let sumByGiver = givers.map(r => {
			return {handle: r, value: getUserKarmaGiving(r).length, valueStr: getUserKarmaGiving(r).length};
		});

		sumByGiver = _.sortBy(sumByGiver, 'value').reverse();
		let uniqueScores = _.uniq(_.pluck(sumByGiver, 'value'));

		sumByGiver = sumByGiver.map((o, index) => {
			o.place = uniqueScores.findIndex(x => x === o.value) + 1;
			return o;
		});

		return sumByGiver;
	}

	function addKarma (message, channel, user, receiverUsername) {

		let slackUser = bot.getUserForMention(receiverUsername);
		if (_.isUndefined(slackUser)) {
			slackUser = bot.getUserByName(receiverUsername);
		}

		if (_.isUndefined(slackUser)) {
			//removing for now, might put back if the user used an @
			//return channel.send('I`m not sure who ' + receiverUsername + ' is...');
			return;
		}

		if (slackUser.name === user.name) {
			return channel.send('You can\'t give karma to yourself ಠ_ಠ');
		}

		if (isUserKarmaBanned(slackUser.name)) {
			return channel.send(bot.makeMention(slackUser) + ' is banned from receiving karma.');
		}

		giveKarma(channel, user, slackUser);

		let userKarma = getLeaderboard().find(o => o.handle === slackUser.name);

		return channel.send(bot.makeMention(user) + ' gives karma to ' + bot.makeMention(slackUser.name) +
			'. They now have ' + userKarma.value + ' karma. #' + userKarma.place + ' overall.');
	}

	function addKarmaSucceeding (message, channel, user) {
		let username = _.first(message.parts).replace(/[:,\s+]/g, '').trim();

		channel.is_im = channel.is_im || false;
		if (channel.is_im) {
			return channel.send('You can not give karma in Direct Messages');
		}

		addKarma(message, channel, user, username);
	}

	function addKarmaPreceding (message, channel, user) {
		let username = _.first(message.text.replace(/\+1[:,]*/g, '').trim().split(' '));

		channel.is_im = channel.is_im || false;
		if (channel.is_im) {
			return channel.send('You can not give karma in Direct Messages');
		}

		addKarma(message, channel, user, username);
	}

	function addKarmaPlusPlus (message, channel, user) {
		let username = _.first(message.text.replace(/[:,]?\s*\+\+/g, '').trim().split(' '));

		channel.is_im = channel.is_im || false;
		if (channel.is_im) {
			return channel.send('You can not give karma in Direct Messages');
		}

		addKarma(message, channel, user, username);
	}

	function displayLeaderboard (message, channel, user) {
		let leaderboard = getLeaderboard();
		let board = calculateLeaderboard( leaderboard );
		channel.send( `ƙarma leaderboard:\`\`\`${board}\nTotal karma holders: ${leaderboard.length}\`\`\`` );
	}

	function displayGiverLeaderboard (message, channel, user) {
		let leaderboard = getGiverLeaderboard();
		let board = calculateLeaderboard( leaderboard );
		channel.send( `ƙarma-givers leaderboard:\`\`\`${board}\nTotal karma givers: ${leaderboard.length}\`\`\`` );
	}

	function calculateLeaderboard(data){
		let top10 = data.reduce((agg, o) => {
			agg[ o.place ] = agg[ o.place ] || []; //I think there is a _. method to make this cleaner, defaults or something, I need to look it up
			agg[ o.place ].push( o );
			return agg;
		}, {});

		let board = '';
		for (let place of [1,2,3,4,5,6,7,8,9,10]){
			if (_.has(top10, place)){
				board += `\n[ #${place} @ ${_.first(top10[ place ]).valueStr}ƙ ]: ${_.pluck(top10[ place ], 'handle').join(', ')}`;
			}
		}

		return board;
	}

	function displayUserKarma (message, channel, user) {
		let [command, receiverUsername] = message.parts;

		let slackUser = bot.getUserForMention(receiverUsername);
		if (_.isUndefined(slackUser)) {
			slackUser = bot.getUserByName(receiverUsername);
		}

		if (_.isUndefined(slackUser)) {
			return channel.send('I`m not sure who ' + receiverUsername + ' is...');
		}

		if (isUserKarmaBanned(slackUser.name)) {
			return channel.send(bot.makeMention(slackUser) + ' is banned from receiving karma.');
		}

		let userKarma = getLeaderboard().find(o => o.handle === slackUser.name);

		if (_.isUndefined(userKarma)) {
			return channel.send(bot.makeMention(slackUser) + ' doesn`t have any karma yet!');
		}

		channel.send(bot.makeMention(slackUser) + ' has ' + userKarma.value + ' karma. #' + userKarma.place + ' overall.');
	}

	function displayUserKarmaGiving (message, channel, user) {
		let [command, receiverUsername] = message.parts;

		let slackUser = bot.getUserForMention(receiverUsername);
		if (_.isUndefined(slackUser)) {
			slackUser = bot.getUserByName(receiverUsername);
		}

		if (_.isUndefined(slackUser)) {
			return channel.send('I`m not sure who ' + receiverUsername + ' is...');
		}

		let userKarma = getGiverLeaderboard().find(o => o.giver === slackUser.name);

		if (_.isUndefined(userKarma)) {
			return channel.send(bot.makeMention(slackUser) + ' hasn`t given any karma yet!');
		}

		channel.send(bot.makeMention(slackUser) + ' has given ' + userKarma.value + ' karma. #' +
			userKarma.place + ' overall.');
	}

	function banUser (message, channel, user) {
		let [command, subcommand, receiverUsername] = message.parts;

		let slackUser = bot.getUserForMention(receiverUsername);
		if (_.isUndefined(slackUser)) {
			slackUser = bot.getUserByName(receiverUsername);
		}

		if (_.isUndefined(slackUser)) {
			return channel.send('I`m not sure who ' + receiverUsername + ' is...');
		}

		bot.ops.isOp(user.name, (err, data) => {
			if (err) return channel.send('error! ' + err);
			if (data === 0) return channel.send('You must be an op to do that.');
			banKarma(channel, user, slackUser);

			channel.send(bot.makeMention(slackUser) + ' has been banned from receiving karma.');
		});
	}

	function unbanUser (message, channel, user) {
		let [command, subcommand, receiverUsername] = message.parts;

		let slackUser = bot.getUserForMention(receiverUsername);
		if (_.isUndefined(slackUser)) {
			slackUser = bot.getUserByName(receiverUsername);
		}

		if (_.isUndefined(slackUser)) {
			return channel.send('I`m not sure who ' + receiverUsername + ' is...');
		}

		bot.ops.isOp(user.name, (err, data) => {
			if (err) return channel.send('error! ' + err);
			if (data === 0) return channel.send('You must be an op to do that.');
			unbanKarma(slackUser.name);

			channel.send(bot.makeMention(slackUser) + ' has had karma privileges restored.');
		});
	}

	function displayBans (message, channel, user) {

		if (!karmaBans.length) return channel.send('Nobody is banned from receiving karma!');

		channel.send('The following users are banned from receiving karma: ' +
			karmaBans.map(o => bot.makeMention(bot.getUserByName(o.receiver))).join(', '));
	}

	return function init(_bot) {

		bot = _bot;
		redis = bot.redis;

		loadKarma((err, data) => {
			//console.log('loadKarma', err, data);
			if (err) return console.error(err);
			if (data === null) {
				karma = [];
				persistKarma();
			} else {
				karma = JSON.parse(data);
			}
		});

		loadKarmaBans((err, data) => {
			//console.log('loadKarmaBans', err, data);
			if (err) return console.error(err);
			if (data === null) {
				karmaBans = [];
				persistKarmaBans();
			} else {
				karmaBans = JSON.parse(data);
			}
		});

		bot.register({
			pattern: {regex: /^[A-Za-z0-9<>@]{2,21}[:,]?\s*\+1[^:]*\s*.*/g},
			f: addKarmaSucceeding,
			type: 'OUT'
		});

		bot.register({
			pattern: {regex: /^\+1[:,\s]+.+/g},
			f: addKarmaPreceding,
			type: 'OUT'
		});

		bot.register({
			pattern: {regex: /^.{3,21}[:,]?\s*\+\+/g},
			f: addKarmaPlusPlus,
			type: 'OUT'
		});

		bot.register({
			pattern: {regex: /^!karma$/g},
			f: displayLeaderboard,
			type: 'OUT'
		});

		bot.register({
			pattern: {regex: /!karma [^-]+$/g},
			f: displayUserKarma,
			type: 'OUT'});

		bot.register({
			pattern: {regex: /^!karmagiver[s]?$/g},
			f: displayGiverLeaderboard,
			type: 'OUT'
		});

		bot.register({
			pattern: {regex: /!karmagiver[s]? [^-]+$/g},
			f: displayUserKarmaGiving,
			type: 'OUT'});

		bot.register({
			pattern: {regex: /!karma -ban [^-]+$/g},
			f: banUser,
			type: 'OUT'});

		bot.register({
			pattern: {regex: /!karma -unban [^-]+$/g},
			f: unbanUser,
			type: 'OUT'});

		bot.register({
			pattern: {regex: /!karma -bans$/g},
			f: displayBans,
			type: 'OUT'});

	};

})();


text:
package eu.rdev.entlite;

import java.util.List;

import eu.rdev.entlite.dao.EntLiteDao;
import eu.rdev.entlite.exceptions.EntLiteException;
import eu.rdev.entlite.support.Updateable;

public class Resource implements Updateable {

	private long id = -1;
	private String name;
	private String treename;
	private Integer version;
	private String path;
	private Resource parent = null;
	private long parentId = -2;

	//private List<Long> childIds = new ArrayList<Long>();
	private List<Resource> children = null;

	private List<Attribute> attribs;

	private EntLiteDao dao;

	public Resource(EntLiteDao dao, String treeName, long resourceId, String resourceName, long parentResource, int version,String path){
		this.dao = dao;
		this.treename = treeName;
		this.id = resourceId;
		this.name = resourceName;
		this.parentId = parentResource;
		this.path = path;
		this.version = version;
	}

	public long getId() {
		return id;
	}

	public long getParentId() {
		return parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String value){
		this.dao.updateResource(treename, id, value, parentId);
		this.update();
	}

	public Integer getVersion() {
		return version;
	}

	public String getPath() {
		return path;
	}

	public long [] getPathArray(){
		String path [] = this.getPath().split(",");
		if(path.length > 0){
			long [] output = new long[path.length];
			for(int x=0; x<path.length; x++){
				output[x] = Long.valueOf(path[x]);
			}
			return output;
		} else {
			return null;
		}
	}

	public Resource getParent() {
		if(parent == null){
			parent = this.dao.getResource(treename, parentId);
		}

		return parent;
	}

	protected List<Resource> getChildResources() {
		if(this.children == null){
			this.updateChildren();
		}

		return children;
	}

	public Resource [] getChildren(){
		List<Resource> data = this.getChildResources();

		return data.toArray(new Resource [this.getChildResources().size()]);
	}

	public Resource createChild(String resourceName){
		Resource r = this.dao.createResource(treename, resourceName, id);
		this.updateChildren();
		return r;
	}

	@Override
	public boolean equals(Object obj){
        return (obj != null && obj instanceof Resource) && this.getId() == ((Resource) obj).getId();
	}

	@Override
	public int hashCode(){
		return (this.getId() + this.getName()).hashCode();
	}

	public void update(){
		Resource r = this.dao.getResource(this.treename, this.id);
		if(r != null){
			this.name = r.getName();
			this.parentId = r.getParentId();
			this.updateAttribs();
			this.updateChildren();
		}
	}

	public void updateChildren(){
		this.children = this.dao.getResources(this.treename, this.id);

		for(Resource r : this.children){
			r.parent = this;
		}
	}

	public void updateAttribs(){
		this.attribs = this.dao.getAttributes(this.treename, this.getId());
	}

	private List<Attribute> getAttribs() {
		if(this.attribs == null){
			this.updateAttribs();
		}
		return attribs;
	}

	public Attribute get(int index){
		return this.getAttribs().get(index);
	}

	public String get(String attributeName){
		for(Attribute a : this.getAttribs()){
			if(a.getAttributeName().equals(attributeName)){
				return a.getAttributeValue();
			}
		}
		return null;
	}

	public Attribute getAttribute(String attributeName){
		for(Attribute a : this.getAttribs()){
			if(a.getAttributeName().equals(attributeName)){
				return a;
			}
		}
		return null;
	}

	public String [] getAttributeNames(){
		String [] output = new String [this.getAttribs().size()];

		for(int x=0;x<this.getAttribs().size();x++){
			output[x] = this.getAttribs().get(x).getAttributeName();
		}
		return output;
	}

	public Attribute set(String attributeName, String attributeValue){

		Attribute a = this.getAttribute(attributeName);

		if(a == null){
			this.dao.createAttribute(this.treename,attributeName,attributeValue,this.id);
			this.updateAttribs();
			a = this.getAttribute(attributeName);
		} else {
			a.setAttributeValue(attributeValue);
		}

		return a;
	}

	public void deleteAttribute(String attributeName) throws EntLiteException{
		Attribute a = this.getAttribute(attributeName);

		if(a != null){
			this.dao.deleteAttribute(this.treename, a.getAttributeId());
			updateAttribs();
		} else {
			throw new EntLiteException("Cannot delete attribute \"" + attributeName + "\" from resource \"" + this.name + " (" + this.id + ")\", the attribute does not exist.");
		}

	}

}


text:
#pragma once
#include <aws/acm-pca/ACMPCA_EXPORTS.h>
#include <aws/acm-pca/ACMPCARequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace ACMPCA
{
namespace Model
{

  /**
   */
  class AWS_ACMPCA_API DescribeCertificateAuthorityAuditReportRequest : public ACMPCARequest
  {
  public:
    DescribeCertificateAuthorityAuditReportRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "DescribeCertificateAuthorityAuditReport"; }

    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline const Aws::String& GetCertificateAuthorityArn() const{ return m_certificateAuthorityArn; }

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline bool CertificateAuthorityArnHasBeenSet() const { return m_certificateAuthorityArnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline void SetCertificateAuthorityArn(const Aws::String& value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline void SetCertificateAuthorityArn(Aws::String&& value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline void SetCertificateAuthorityArn(const char* value) { m_certificateAuthorityArnHasBeenSet = true; m_certificateAuthorityArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithCertificateAuthorityArn(const Aws::String& value) { SetCertificateAuthorityArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithCertificateAuthorityArn(Aws::String&& value) { SetCertificateAuthorityArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the private CA. This must be of the
     * form:

     * arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012
     * .

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithCertificateAuthorityArn(const char* value) { SetCertificateAuthorityArn(value); return *this;}

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline const Aws::String& GetAuditReportId() const{ return m_auditReportId; }

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline bool AuditReportIdHasBeenSet() const { return m_auditReportIdHasBeenSet; }

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline void SetAuditReportId(const Aws::String& value) { m_auditReportIdHasBeenSet = true; m_auditReportId = value; }

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline void SetAuditReportId(Aws::String&& value) { m_auditReportIdHasBeenSet = true; m_auditReportId = std::move(value); }

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline void SetAuditReportId(const char* value) { m_auditReportIdHasBeenSet = true; m_auditReportId.assign(value); }

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithAuditReportId(const Aws::String& value) { SetAuditReportId(value); return *this;}

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithAuditReportId(Aws::String&& value) { SetAuditReportId(std::move(value)); return *this;}

    /**
     *
The report ID returned by calling the CreateCertificateAuthorityAuditReport
     * action.

     */
    inline DescribeCertificateAuthorityAuditReportRequest& WithAuditReportId(const char* value) { SetAuditReportId(value); return *this;}

  private:

    Aws::String m_certificateAuthorityArn;
    bool m_certificateAuthorityArnHasBeenSet = false;

    Aws::String m_auditReportId;
    bool m_auditReportIdHasBeenSet = false;
  };

} // namespace Model
} // namespace ACMPCA
} // namespace Aws


text:
package com.luna.anytime.adapter;

import java.util.List;

import com.avos.avoscloud.AVObject;
import com.luna.anytime.R;

import android.content.Context;
import android.database.DataSetObserver;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListAdapter;
import android.widget.TextView;

public class AnytimeUserResponseListAdapter implements ListAdapter {

	private List<AVObject> mResponseList;
	private LayoutInflater mInflater;
	private Context mContext;

	public AnytimeUserResponseListAdapter(List<AVObject> responseList,
			Context context) {
		this.mResponseList = responseList;
		this.mContext = context;
		this.mInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return mResponseList.size();
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public int getItemViewType(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		convertView = mInflater.inflate(R.layout.view_user_response, null);
		TextView response = (TextView) convertView
				.findViewById(R.id.textView_user_response);
		TextView responseTime = (TextView) convertView
				.findViewById(R.id.textView_user_response_time);

		response.setText(mResponseList.get(position)
				.getString("UserSuggestion"));
		responseTime.setText(DateFormat.format("yyyy-MM-dd HH:mm",
				mResponseList.get(position).getCreatedAt()).toString());

		if (mResponseList.get(position).getBoolean("IsResponseToUser")) {
			response.setTextColor(this.mContext.getResources().getColor(
					R.color.BlueColor));
			responseTime.setTextColor(this.mContext.getResources()
					.getColor(R.color.BlueColor));
		}

		return convertView;
	}

	@Override
	public int getViewTypeCount() {
		return getCount();
	}

	@Override
	public boolean hasStableIds() {
		// TODO Auto-generated method stub
		return false;
	}

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

	@Override
	public void registerDataSetObserver(DataSetObserver observer) {

	}

	@Override
	public void unregisterDataSetObserver(DataSetObserver observer) {

	}

	@Override
	public boolean areAllItemsEnabled() {
		return false;
	}

	@Override
	public boolean isEnabled(int position) {
		return false;
	}

}


text:
package sys

import (
	"fmt"
	"os"
	"os/user"
	"path/filepath"
	"strings"

	"strconv"

	"github.com/google/uuid"
	"github.com/rook/rook/pkg/util/exec"
)

const (
	DiskType = "disk"
	SSDType  = "ssd"
	PartType = "part"
	sgdisk   = "sgdisk"
	mountCmd = "mount"
)

type Partition struct {
	Name  string
	Size  uint64
	Label string
}

// request the current user once and stash it in this global variable
var currentUser *user.User

func ListDevices(executor exec.Executor) ([]string, error) {
	cmd := "lsblk all"
	devices, err := executor.ExecuteCommandWithOutput(cmd, "lsblk", "--all", "--noheadings", "--list", "--output", "KNAME")
	if err != nil {
		return nil, fmt.Errorf("failed to list all devices: %+v", err)
	}

	return strings.Split(devices, "\n"), nil
}

func GetDevicePartitions(device string, executor exec.Executor) (partitions []*Partition, unusedSpace uint64, err error) {
	cmd := fmt.Sprintf("lsblk /dev/%s", device)
	output, err := executor.ExecuteCommandWithOutput(cmd, "lsblk", fmt.Sprintf("/dev/%s", device),
		"--bytes", "--pairs", "--output", "NAME,SIZE,TYPE,PKNAME,PARTLABEL")
	if err != nil {
		return nil, 0, fmt.Errorf("failed to get device %s partitions. %+v", device, err)
	}

	partInfo := strings.Split(output, "\n")
	var deviceSize uint64
	var totalPartitionSize uint64
	for _, info := range partInfo {
		props := parseKeyValuePairString(info)
		name := props["NAME"]
		if name == device {
			// found the main device
			deviceSize, err = strconv.ParseUint(props["SIZE"], 10, 64)
			if err != nil {
				return nil, 0, fmt.Errorf("failed to get device %s size. %+v", device, err)
			}
		} else if props["PKNAME"] == device && props["TYPE"] == PartType {
			// found a partition
			p := &Partition{Name: name}
			p.Label = props["PARTLABEL"]
			p.Size, err = strconv.ParseUint(props["SIZE"], 10, 64)
			if err != nil {
				return nil, 0, fmt.Errorf("failed to get partition %s size. %+v", name, err)
			}
			totalPartitionSize += p.Size
			partitions = append(partitions, p)
		}
	}

	if deviceSize > 0 {
		unusedSpace = deviceSize - totalPartitionSize
	}
	return partitions, unusedSpace, nil
}

func GetDeviceProperties(device string, executor exec.Executor) (map[string]string, error) {
	return GetDevicePropertiesFromPath(fmt.Sprintf("/dev/%s", device), executor)
}

func GetDevicePropertiesFromPath(devicePath string, executor exec.Executor) (map[string]string, error) {
	cmd := fmt.Sprintf("lsblk %s", devicePath)
	output, err := executor.ExecuteCommandWithOutput(cmd, "lsblk", devicePath,
		"--bytes", "--nodeps", "--pairs", "--output", "SIZE,ROTA,RO,TYPE,PKNAME")
	if err != nil {
		// try to get more information about the command error
		cmdErr, ok := err.(*exec.CommandError)
		if ok && cmdErr.ExitStatus() == 32 {
			// certain device types (such as loop) return exit status 32 when probed further,
			// ignore and continue without logging
			return map[string]string{}, nil
		}

		return nil, err
	}

	return parseKeyValuePairString(output), nil
}

// get the file systems availab
func GetDeviceFilesystems(device string, executor exec.Executor) (string, error) {
	cmd := fmt.Sprintf("get filesystem type for %s", device)
	output, err := executor.ExecuteCommandWithOutput(cmd, "df", "--output=source,fstype")
	if err != nil {
		return "", fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	return parseDFOutput(device, output), nil
}

func RemovePartitions(device string, executor exec.Executor) error {
	cmd := fmt.Sprintf("zap %s", device)
	err := executor.ExecuteCommand(cmd, sgdisk, "--zap-all", "/dev/"+device)
	if err != nil {
		return fmt.Errorf("failed to zap partitions on /dev/%s: %+v", device, err)
	}

	cmd = fmt.Sprintf("clear %s", device)
	err = executor.ExecuteCommand(cmd, sgdisk, "--clear", "--mbrtogpt", "/dev/"+device)
	if err != nil {
		return fmt.Errorf("failed to clear partitions on /dev/%s: %+v", device, err)
	}

	return nil
}

func CreatePartitions(device string, args []string, executor exec.Executor) error {
	cmd := fmt.Sprintf("partition %s", device)
	return executor.ExecuteCommand(cmd, sgdisk, args...)
}

func FormatDevice(devicePath string, executor exec.Executor) error {
	cmd := fmt.Sprintf("mkfs.ext4 %s", devicePath)
	if err := executor.ExecuteCommand(cmd, "mkfs.ext4", devicePath); err != nil {
		return fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	return nil
}

// look up the UUID for a disk.
func GetDiskUUID(device string, executor exec.Executor) (string, error) {
	cmd := fmt.Sprintf("get disk %s uuid", device)
	output, err := executor.ExecuteCommandWithOutput(cmd,
		sgdisk, "--print", fmt.Sprintf("/dev/%s", device))
	if err != nil {
		return "", err
	}

	return parseUUID(device, output)
}

// look up the mount point of the given device.  empty string returned if device is not mounted.
func GetDeviceMountPoint(deviceName string, executor exec.Executor) (string, error) {
	cmd := fmt.Sprintf("get mount point for %s", deviceName)
	output, err := executor.ExecuteCommandWithOutput(cmd, mountCmd)
	if err != nil {
		return "", fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	searchFor := fmt.Sprintf("^/dev/%s on", deviceName)
	mountPoint := awk(grep(output, searchFor), 3)
	return mountPoint, nil
}

func GetDeviceFromMountPoint(mountPoint string, executor exec.Executor) (string, error) {
	mountPoint = filepath.Clean(mountPoint)
	cmd := fmt.Sprintf("get device from mount point %s", mountPoint)
	output, err := executor.ExecuteCommandWithOutput(cmd, mountCmd)
	if err != nil {
		return "", fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	searchFor := fmt.Sprintf("on %s ", mountPoint)
	device := awk(grep(output, searchFor), 1)
	return device, nil
}

func MountDevice(devicePath, mountPath string, executor exec.Executor) error {
	return MountDeviceWithOptions(devicePath, mountPath, "", "", executor)
}

// comma-separated list of mount options passed directly to mount command
func MountDeviceWithOptions(devicePath, mountPath, fstype, options string, executor exec.Executor) error {
	args := []string{}

	if fstype != "" {
		args = append(args, "-t", fstype)
	}

	if options != "" {
		args = append(args, "-o", options)
	}

	// device path and mount path are always the last 2 args
	args = append(args, devicePath, mountPath)

	os.MkdirAll(mountPath, 0755)
	cmd := fmt.Sprintf("mount %s", devicePath)
	if err := executor.ExecuteCommand(cmd, mountCmd, args...); err != nil {
		return fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	return nil
}

func UnmountDevice(devicePath string, executor exec.Executor) error {
	cmd := fmt.Sprintf("umount %s", devicePath)
	if err := executor.ExecuteCommand(cmd, "umount", devicePath); err != nil {
		cmdErr, ok := err.(*exec.CommandError)
		if ok && cmdErr.ExitStatus() == 32 {
			logger.Infof("ignoring exit status 32 from unmount of device %s, err:%+v", devicePath, cmdErr)
		} else {
			return fmt.Errorf("command %s failed: %+v", cmd, err)
		}
	}

	return nil
}

func DoesDeviceHaveChildren(device string, executor exec.Executor) (bool, error) {
	cmd := fmt.Sprintf("check children for device %s", device)
	output, err := executor.ExecuteCommandWithOutput(cmd, "lsblk --all -n -l --output PKNAME")
	if err != nil {
		return false, fmt.Errorf("command %s failed: %+v", cmd, err)
	}

	searchFor := fmt.Sprintf("^%s$", device)
	children := grep(output, searchFor)

	return children != "", nil
}

// finds the file system(s) for the device in the output of 'df'
func parseDFOutput(device, output string) string {
	var fs []string
	lines := strings.Split(output, "\n")
	for _, line := range lines {
		if strings.HasPrefix(line, fmt.Sprintf("/dev/%s", device)) {
			words := strings.Split(line, " ")
			fs = append(fs, words[len(words)-1])
		}
	}

	return strings.Join(fs, ",")
}

// finds the disk uuid in the output of sgdisk
func parseUUID(device, output string) (string, error) {

	// find the line with the uuid
	lines := strings.Split(output, "\n")
	for _, line := range lines {
		if strings.Index(line, "Disk identifier (GUID)") != -1 {
			words := strings.Split(line, " ")
			for _, word := range words {
				// we expect most words in the line not to be a uuid, but will return the first one that is
				result, err := uuid.Parse(word)
				if err == nil {
					return result.String(), nil
				}
			}
		}
	}

	return "", fmt.Errorf("uuid not found for device %s. output=%s", device, output)
}

// converts a raw key value pair string into a map of key value pairs
// example raw string of `foo="0" bar="1" baz="biz"` is returned as:
// map[string]string{"foo":"0", "bar":"1", "baz":"biz"}
func parseKeyValuePairString(propsRaw string) map[string]string {
	// first split the single raw string on spaces and initialize a map of
	// a length equal to the number of pairs
	props := strings.Split(propsRaw, " ")
	propMap := make(map[string]string, len(props))

	for _, kvpRaw := range props {
		// split each individual key value pair on the equals sign
		kvp := strings.Split(kvpRaw, "=")
		if len(kvp) == 2 {
			// first element is the final key, second element is the final value
			// (don't forget to remove surrounding quotes from the value)
			propMap[kvp[0]] = strings.Replace(kvp[1], `"`, "", -1)
		}
	}

	return propMap
}


text:
include $(TOPDIR)/rules.mk

PKG_NAME:=eth-one-port
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define Package/eth-one-port
	SECTION:=eth-one-port
	CATEGORY:=DG-Common-Packages
	TITLE:= WAN/LAN Share one Ethernet port
	#DEPENDS :=+luci
endef

define Package/eth-one-port/description
	This package provides  WAN/LAN Share one Ethernet port
endef

define Build/Prepare
        echo
endef

define Build/Compile
        echo
endef

define Package/eth-one-port/install
	$(INSTALL_DIR) $(1)/etc/rc.local.d
	$(INSTALL_DIR) $(1)/etc/config
	$(CP) ./files/etc/rc.local.d/000-config-macvlan $(1)/etc/rc.local.d/000-config-macvlan
	$(CP) ./files/etc/rc.local $(1)/etc/rc.local
	#$(INSTALL_BIN) ./files/usr/bin/set_default_page_to_wrtnode_portal.sh $(1)/usr/bin/
endef

$(eval $(call BuildPackage,eth-one-port))


text:
/**
 * window.c.ProjectSuccessfulOnboard component
 * render first interaction of successful project onboarding
 * used when project is successful and wants to confirm bank data and request transfer
 *
 * Example:
 * m.component(c.ProjectSuccessfulOnboard, {project: project})
 **/
import m from 'mithril';
import postgrest from 'mithril-postgrest';
import I18n from 'i18n-js';
import h from '../h';
import models from '../models';
import dashboardInfo from './dashboard-info';
import projectSuccessfulOnboardConfirmAccount from './project-successful-onboard-confirm-account';
import modalBox from './modal-box';
import successfulProjectTaxModal from './successful-project-tax-modal';
import insightVM from '../vms/insight-vm';

const I18nScope = _.partial(h.i18nScope, 'projects.successful_onboard');

const projectSuccessfulOnboard = {
    controller(args) {
        const projectIdVM = postgrest.filtersVM({project_id: 'eq'}),
              projectAccounts = m.prop([]),
              projectTransfers = m.prop([]),
              showTaxModal = h.toggleProp(false, true),
              onboardComponents = {
                  'start': dashboardInfo,
                  'confirm_account': projectSuccessfulOnboardConfirmAccount,
                  'error_account': dashboardInfo,
                  'pending_transfer': dashboardInfo,
                  'finished': dashboardInfo
              },
              currentState = m.prop('start'),
              currentComponent = () => onboardComponents[currentState()],
              content = () => insightVM.content(currentState(), {
                  account: projectAccounts,
                  transfer: projectTransfers,
                  showTaxModal: showTaxModal
              }),
              loader = postgrest.loaderWithToken,
              declineAccountLoader = (errorMsg) => {
                  const pa = _.first(projectAccounts());

                  return postgrest.loaderWithToken(
                      models.projectAccountError.postOptions({
                          project_id: args.project().project_id,
                          reason: errorMsg
                      }));
              },
              acceptAccountLoader = postgrest.loaderWithToken(
                  models.projectAccount.postOptions({
                      project_id: args.project().project_id
                  })
              );

        projectIdVM.project_id(args.project().project_id);

        const lProjectAccount = loader(models.projectAccount.getRowOptions(projectIdVM.parameters()));
        lProjectAccount.load().then((data) => {
            projectAccounts(data);

            loadCurrentStage();
        });

        const lProjectTransfer = loader(models.projectTransfer.getRowOptions(projectIdVM.parameters()));
        lProjectTransfer.load().then(projectTransfers);

        const setStage = (state) => {
            currentState(state);

            return currentComponent;
        },
              nextStage = () => {
                  const keys = _.keys(onboardComponents),
                    nextKey = keys[_.indexOf(keys, currentState()) + 1];

                  currentState(nextKey);

                  return currentComponent;
              },
              loadCurrentStage = () => {
                  if (!lProjectAccount()) {
                      const pa = _.first(projectAccounts());

                      if (_.isNull(pa)) {
                          return setStage('finished')();
                      }

                      if (_.isNull(pa.error_reason) && _.isNull(pa.transfer_state)) {
                          return setStage('start')();
                      } else if (!_.isNull(pa.error_reason)) {
                          return setStage('error_account')();
                      } else if (!_.isNull(pa.transfer_state)) {
                          if (pa.transfer_state == 'transferred') {
                              return setStage('finished')();
                          } else {
                              return setStage('pending_transfer')();
                          }
                      }
                  }

                  return false;
              },

              // TODO: need to add an error validation to not null
              addErrorReason = (errorProp) => {
                  return () => {
                      const fn = declineAccountLoader(errorProp());
                      fn.load().then(() => {
                          setStage('error_account')();
                      });

                      return false;
                  };
              },

              acceptAccount = () => {
                  acceptAccountLoader.load().then(() => {
                      setStage('pending_transfer')();
                  });

                  return false;
              };

        return {
            projectAccounts: projectAccounts,
            projectTransfers: projectTransfers,
            lProjectAccount: lProjectAccount,
            lProjectTransfer: lProjectTransfer,
            setStage: setStage,
            nextStage: nextStage,
            currentComponent: currentComponent,
            addErrorReason: addErrorReason,
            acceptAccount: acceptAccount,
            acceptAccountLoader: acceptAccountLoader,
            content: content,
            declineAccountLoader: declineAccountLoader,
            loadCurrentStage: loadCurrentStage,
            showTaxModal: showTaxModal
        };
    },
    view(ctrl, args) {
        const projectAccount = _.first(ctrl.projectAccounts()),
              projectTransfer = _.first(ctrl.projectTransfers()),
              lpa = ctrl.lProjectAccount,
              lpt = ctrl.lProjectTransfer;

        return m('.w-section.section', [
            (ctrl.showTaxModal() ? m.component(modalBox, {
                displayModal: ctrl.showTaxModal,
                content: [successfulProjectTaxModal, {
                    projectTransfer: projectTransfer
                }]
            }) : ''),
            (!lpa() && !lpt() ?
             m.component(ctrl.currentComponent(), {
                 projectTransfer: projectTransfer,
                 projectAccount: projectAccount,
                 setStage: ctrl.setStage,
                 addErrorReason: ctrl.addErrorReason,
                 acceptAccount: ctrl.acceptAccount,
                 acceptAccountLoader: ctrl.acceptAccountLoader,
                 nextStage: ctrl.nextStage,
                 content: ctrl.content(),
                 dataToRedraw: {
                     'tax_link': {
                         action: 'onclick',
                         actionSource: () => {
                             ctrl.showTaxModal.toggle();
                             m.redraw();
                         }
                     }
                 }
             }) : h.loader())

        ]);
    }
};

export default projectSuccessfulOnboard;


text:
#import "RDDItunesEntry.h"

@implementation RDDItunesEntry
@synthesize description = _description;

- (NSString*) description {
    return [NSString stringWithFormat:@"%@, %@, %@", [super description], self.artistName, self.trackName];
}

@end


text:
<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Doozr - Loader - Serviceloader.
 *
 * Serviceloader.php - The Serviceloader loads services within the Doozr
 * world. No matter which namespace and no matter if singleton or multiple.
 *
 * PHP versions 5.5
 *
 * LICENSE:
 * Doozr - The lightweight PHP-Framework for high-performance websites
 *
 * Copyright (c) 2005 - 2016, Benjamin Carl - All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 * - All advertising materials mentioning features or use of this software
 *   must display the following acknowledgment: This product includes software
 *   developed by Benjamin Carl and other contributors.
 * - Neither the name Benjamin Carl nor the names of other contributors
 *   may be used to endorse or promote products derived from this
 *   software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * Please feel free to contact us via e-mail: opensource@clickalicious.de
 *
 * @category   Doozr
 *
 * @author     Benjamin Carl <opensource@clickalicious.de>
 * @copyright  2005 - 2016 Benjamin Carl
 * @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
 *
 * @version    Git: $Id$
 *
 * @link       http://clickalicious.github.com/Doozr/
 */
require_once DOOZR_DOCUMENT_ROOT.'Doozr/Base/Class/Singleton.php';
require_once DOOZR_DOCUMENT_ROOT.'Doozr/Factory/Singleton.php';
require_once DOOZR_DOCUMENT_ROOT.'Doozr/Factory/Multiple.php';
require_once DOOZR_DOCUMENT_ROOT.'Doozr/Loader/Interface.php';

/**
 * Doozr - Loader - Serviceloader.
 *
 * The Serviceloader loads services within the Doozr world. No matter which
 * namespace and no matter if singleton or multiple.
 *
 * @category   Doozr
 *
 * @author     Benjamin Carl <opensource@clickalicious.de>
 * @copyright  2005 - 2016 Benjamin Carl
 * @license    http://www.opensource.org/licenses/bsd-license.php The BSD License
 *
 * @version    Git: $Id$
 *
 * @link       http://clickalicious.github.com/Doozr/
 */
class Doozr_Loader_Serviceloader extends Doozr_Base_Class_Singleton
{
    /**
     * The Doozr registry containing important references.
     *
     * @var Doozr_Registry
     * @static
     */
    protected static $registry;

    /**
     * Runtime cache for loaded services status/history.
     *
     * @var array
     * @static
     */
    private static $loaded = [];

    /**
     * The dependency map.
     *
     * @var Doozr_Di_Map_Annotation
     * @static
     */
    protected static $map;

    /**
     * The dependency-injection container.
     *
     * @var Doozr_Di_Container
     * @static
     */
    protected static $container;

    /**
     * The default Namespace to load from.
     *
     * @var string
     */
    const DEFAULT_NAMESPACE = DOOZR_NAMESPACE;

    /**
     * The default alias for skeleton.
     *
     * @var null
     */
    const DEFAULT_ALIAS = null;

    /**
     * The default name.
     *
     * @var string
     */
    const DEFAULT_NAME = null;

    /**
     * The default info text for the service.
     *
     * @var string
     */
    const DEFAULT_INFO = null;

    /**
     * Loads a service from any namespace.
     *
     * This method is intend to load services. Its possible to pass a string with just a name of a service
     * to this method or you pass an array with namespace like this -> array('namespace', 'service').
     *
     * @param string|array $service Just the name of the service if a Doozr default service or
     *                              as an array with additional namespace like: array('namespace', 'service')
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return Doozr_Base_Service_Interface An/the instance of the requested service
     * @static
     */
    public static function load($service)
    {
        // Get arguments generic way rip off 1st this is the service name
        $arguments            = array_slice(func_get_args(), 1);
        $fullQualifiedService = self::getFullQualifiedService($service);
        $className            = $fullQualifiedService['namespace'].
                                '_'.ucfirst($fullQualifiedService['name']).'_Service';

        // Instantiated?
        (self::$instance === null) ? self::init() : null;

        // Load file
        self::getService($fullQualifiedService['name'], $fullQualifiedService['namespace']);

        // Generate map from annotations in source of current service main entry
        self::$map
            ->reset()
            ->generate($className);

        // Store map
        self::$registry->getContainer()->addToMap(self::$map);

        // Create instance ...
        /* @var $instance Doozr_Base_Service_Interface */
        $instance = self::$registry->getContainer()->build($className, $arguments);

        // Decide which identifier to use
        $identifier = strtolower(
            ($fullQualifiedService['alias'] !== null) ? $fullQualifiedService['alias'] : $fullQualifiedService['name']
        );

        // Register service and put the UUID as reference into response
        $instance->setUuid(
            self::registerService($identifier, $instance)
        );

        return $instance;
    }

    /**
     * Registers a service in Doozr's registry.
     *
     * @param string                       $name    The name of the service.
     * @param Doozr_Base_Service_Interface $service The service instance.
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return string Uuid handler generated by registry
     */
    protected static function registerService($name, Doozr_Base_Service_Interface $service)
    {
        // Check how to store service in registry
        $uuid = (true === $service->isSingleton()) ?
            self::getRegistry()->set($service, $name) :
            self::getRegistry()->add($service, $name);

        return $uuid;
    }

    /**
     * Initialize the instance, registry and DI.
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     * @static
     */
    public static function init()
    {
        // create instance like we would by calling getInstance()
        self::getInstance();
        self::$registry = Doozr_Registry::getInstance();
        self::initDependencyInjection();
    }

    /**
     * Initializes the dependency injection path' parser, map, ...
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     * @static
     */
    protected static function initDependencyInjection()
    {
        // Get required dependency container for annotations!
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Map/Annotation.php';
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Parser/Annotation.php';
        include_once DOOZR_DOCUMENT_ROOT.'Doozr/Di/Dependency.php';

        $collection = new Doozr_Di_Collection();
        $parser     = new Doozr_Di_Parser_Annotation();
        $dependency = new Doozr_Di_Dependency();

        self::$map = new Doozr_Di_Map_Annotation($collection, $parser, $dependency);

        #self::$container = Doozr_Di_Container::getInstance();
        #self::$container->setFactory(new Doozr_Di_Factory(self::$registry));
    }

    /**
     * Completes Doozr's default services with namespace (Doozr).
     *
     * This method is intend to format a passed service configuration to a named index array.
     * It will automatic inject "Doozr" as namespace for default services.
     *
     * @param array|string $service The service as full qualified entry array otherwise string name (Doozr default ns)
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return array Full qualified and namespaced service
     *
     * @throws Doozr_Loader_Serviceloader_Exception
     * @static
     */
    protected static function getFullQualifiedService($service)
    {
        // Get skeleton with defaults for all minimum required fields
        $fullQualifiedService = self::getFullQualifiedServiceSkeleton();

        // Check for array mode
        if (is_array($service) === true) {

            // If an array is found we need at least namespace and service
            if (isset($service['name']) === false) {
                throw new Doozr_Loader_Serviceloader_Exception(
                    'Serviceloader requires at least a "service" name when passing an []!'
                );
            }

            // Extract the data from array
            $fullQualifiedService['name']      = ucfirst(strtolower($service['name']));
            $fullQualifiedService['namespace'] = (isset($service['namespace']) === true) ?
                $service['namespace'] :
                $fullQualifiedService['namespace'];
            $fullQualifiedService['alias'] = (isset($service['alias']) === true) ?
                $service['alias'] :
                $fullQualifiedService['alias'];
        } else {
            $fullQualifiedService['name'] = ucfirst(strtolower($service));
        }

        return $fullQualifiedService;
    }

    /**
     * Returns a skeleton for a service configuration array.
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return string Full qualified service skeleton
     * @static
     */
    protected static function getFullQualifiedServiceSkeleton()
    {
        return [
            'namespace' => self::DEFAULT_NAMESPACE,
            'name'      => self::DEFAULT_NAME,
            'alias'     => self::DEFAULT_ALIAS,
            'info'      => self::DEFAULT_INFO,
        ];
    }

    /**
     * This method is intend to conditional includes the service main classfile.
     *
     * @param string $service   The service to include
     * @param string $namespace The namespace to load service from
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return bool TRUE on success, otherwise FALSE
     * @static
     */
    protected static function getService($service, $namespace = self::DEFAULT_NAMESPACE)
    {
        $key = $service.$namespace;

        if (!isset(self::$loaded[$key]) || self::$loaded[$key] !== true) {
            include_once self::getServiceFile($service, $namespace);
            self::$loaded[$key] = true;
        }

        return true;
    }

    /**
     * Comnbines the passed service name and namespace with the path to the services.
     *
     * This method is intend ...
     *
     * @param string $service   The name of the service to return the path for
     * @param string $namespace The (optional) namespace to use. Default is namespace "Doozr"
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return string The full path to the service library file.
     * @static
     */
    protected static function getServiceFile($service, $namespace = self::DEFAULT_NAMESPACE)
    {
        return self::getServicePath($service, $namespace).DIRECTORY_SEPARATOR.'Service.php';
    }

    /**
     * Returns the path to a service.
     *
     * This method is intend to return the path to a passed service and (optional) namespace.
     *
     * @param string $service   Name of the service to return path for
     * @param string $namespace The (optional) namespace (default "Doozr")
     *
     * @author Benjamin Carl <opensource@clickalicious.de>
     *
     * @return string The full path to the service library file.
     * @static
     */
    public static function getServicePath($service, $namespace = self::DEFAULT_NAMESPACE)
    {
        return DOOZR_DOCUMENT_ROOT.'Service'.DIRECTORY_SEPARATOR.$namespace.DIRECTORY_SEPARATOR.
               ucfirst($service);
    }
}


text:
package org.sagebionetworks.web.client.widget.header;

import org.sagebionetworks.schema.adapter.JSONObjectAdapter;

import com.google.gwt.user.client.ui.IsWidget;
import com.google.web.bindery.event.shared.binder.EventBinder;

public interface HeaderView extends IsWidget {
	/**
	 * Set the presenter.
	 *
	 * @param presenter
	 */
	public void setPresenter(Presenter presenter);

	public void refresh();

	/**
	 * Presenter interface
	 */
	public interface Presenter {
		void onCookieNotificationDismissed();
	}

	void setStagingAlertVisible(boolean visible);

	void openNewWindow(String url);

	void clear();

	EventBinder<Header> getEventBinder();

	void setCookieNotificationVisible(boolean visible);

	void setPortalAlertVisible(boolean visible, JSONObjectAdapter portalJson);
}


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <title>Brainscrape - main</title>
        <link rel="stylesheet" href="http://brainscrape.github.io/theme/css/main.css" />

Brainscrape

Multiple Dispatch for the Masses

State Pattern

Some other thing

main

Brainscrape

                Published: Tue 21 April 2015

        <address class="vcard author">
                By                         Douglas Thompson
        </address>

In main.

Prog with a blog

    Page 1 / 1

blogroll

Pelican

Python.org

Jinja2

                <address id="about" class="vcard body">
                Proudly powered by Pelican, which takes great advantage of Python.
                </address>

The theme is by Smashing Magazine, thanks!


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ACoordinator</title>
<meta name="date" content="2014-01-30">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.quickstart.rcp.coordinator

Class ACoordinator

java.lang.Object

java.lang.Thread

org.quickstart.rcp.coordinator.ACoordinator

All Implemented Interfaces:

java.lang.Runnable, org.quickstart.api.coordinator.Coordinator<javafx.event.EventHandler<javafx.event.Event>,javafx.event.Event,java.lang.Object>

Direct Known Subclasses:

MessageCoordinator

public abstract class ACoordinator
extends java.lang.Thread
implements org.jacpfx.api.coordinator.Coordinator<javafx.event.EventHandler<javafx.event.Event>,javafx.event.Event,java.lang.Object>

Observer handles messages and notifies correct components, the observer is
 running in an own thread so that message handling can be done in background

Author:

Andy Moncsek

Nested Class Summary

Nested classes/interfaces inherited from class java.lang.Thread

java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler

Field Summary

Fields inherited from class java.lang.Thread

MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

java.util.concurrent.BlockingQueue<org.quickstart.api.message.Message<javafx.event.Event,java.lang.Object>>
getMessageQueue()

Returns the message queue of coordinator.

void
run()

Methods inherited from class java.lang.Thread

activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield

Methods inherited from class java.lang.Object

equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface org.quickstart.api.coordinator.Coordinator

handleMessage, setComponentHandler, setDelegateQueue, setPerspectiveHandler

Method Detail

run

public final void run()

Specified by:

run in interface java.lang.Runnable

Overrides:

run in class java.lang.Thread

getMessageQueue

public java.util.concurrent.BlockingQueue<org.quickstart.api.message.Message<javafx.event.Event,java.lang.Object>> getMessageQueue()

Description copied from interface: org.quickstart.api.coordinator.Coordinator

Returns the message queue of coordinator.

Specified by:

getMessageQueue in interface org.quickstart.api.coordinator.Coordinator<javafx.event.EventHandler<javafx.event.Event>,javafx.event.Event,java.lang.Object>

Returns:

the message queue

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
if(!dojo._hasResource["com.copacabana.PlateOrderWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["com.copacabana.PlateOrderWidget"] = true;
dojo.provide("com.copacabana.PlateOrderWidget");
dojo.require("dijit._Widget");
dojo.require("dijit._Templated");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.DateTextBox");
dojo.require("dijit.form.CheckBox");
dojo.require("com.copacabana.util");

//I18N
dojo.require("dojo.string");
dojo.require("dojo.i18n");

dojo.requireLocalization("com.copacabana", "PlateOrderWidgetStrings", null, "ROOT,pt");

dojo.declare("com.copacabana.PlateOrderWidget", [
		dijit._Widget, dijit._Templated ], {
	i18nStrings: null,
	templateString:"
\r\n\t

\t\r\n\t${plate.title}
 ${plate.description}	\r\n\t${plate.priceFormatted}	\r\n\t-  <input style=\"width:15px;\" width=\"25\" dojoType=\"dijit.form.TextBox\"\r\n\t\tclass=\"quantidadeValue\" height=\"15\" />  +	\t\r\n\t	\r\n
\r\n",
	orderDisabled:false,
	constructor : function(plate,disable) {
		this.plate=plate;
		this.id="plate_order_"+plate.id;
		this.plate.priceFormatted = com.copacabana.util.moneyFormatter(this.plate.price);
		if(disable || plate.status=='UNAVAILABLE'){
			this.templateString="
\r\n\t

${plate.title}
${plate.description}	\r\n\t${plate.priceFormatted}	\r\n\t${statusStr}	\t\t\r\n
\r\n";
			this.orderDisabled=true;
			if(plate.status=='UNAVAILABLE'){
				this.statusStr='* Temporariamente indisponivel.';
			}
		}else if(this.plate.availableTurn!='ANY'){
			if(this.plate.currentTurn!=this.plate.availableTurn){
				this.templateString="
\r\n\t

${plate.title}
${plate.description}	\r\n\t${plate.priceFormatted}	\r\n\t	\t\t\r\n
\r\n";
				this.orderDisabled=true;

			}
		}

	},
	statusStr:'',
	 destroyRecursive: function(){
        dojo.forEach(this.getDescendants(), function(widget){
        	widget.destroyRecursive();
        });
        this.inherited(arguments);
    },
	plate:null,
	postMixInProperties : function() {
		this.inherited(arguments);
	},

	postCreate : function() {
		this.inherited(arguments);
		this.i18nStrings=dojo.i18n.getLocalization("com.copacabana", "PlateOrderWidgetStrings");
	},
	largeSection:null,
	showImage:function(evt){

		this.largeImgDiv.src=this.plate.imageUrl;

		dojo.style(this.largeSection,'display','block');

	},
	hideImage:function(evt){

		dojo.style(this.largeSection,'display','none');

	},
	largeImgDiv:null,
	startup : function() {
		try {
			dojo.parser.parse(this.domNode);
			if(this.plate.availableTurn!='ANY'){
				if(this.plate.currentTurn!=this.plate.availableTurn){
					this.statusSection.innerHTML=this.i18nStrings['onlyFor_'+this.plate.availableTurn];
				}
			}
			//

			if(this.plate.imageUrl!=null && this.plate.imageUrl!=''){
				var fct = dojo.hitch(this,this.showImage);
				var fct2 = dojo.hitch(this,this.hideImage);
				var largerStyle={position:'absolute',display:'none',padding:'5px',border:'1px solid gray','MozBorderRadius':"5px 5px 5px 5px",backgroundColor:'white'};
				this.largeSection=dojo.create('div',{style:largerStyle,onmouseout:fct2},this.imgPlace);
				console.log('is IE !! ',dojo.isIE);
				if(!dojo.isIE){
					this.largeImgDiv= dojo.create('img',{style:{},src:'/resources/img/loader.gif'},this.largeSection);
				}else{
					this.largeImgDiv= dojo.create('img',{style:{minWidth:'300px',minHeight:'300px'},src:this.plate.imageUrl},this.largeSection);

				}
				dojo.create('div',{style:{textAlign:'center'},innerHTML:this.plate.title},this.largeSection);
				dojo.create('img',{src:this.plate.imageUrl+'.small',onmouseover:fct},this.imgPlace);
				dojo.style(this.titleSection,'fontSize','large');
				dojo.style(this.titleSection,'paddingLeft','5px');

			}
			if (this.orderDisabled == false) {

				dijit.byNode(dojo.query(".quantidadeValue", this.domNode)[0])
						.attr("value", 1);
			}

		} catch (e) {
			console.error("plateOrder start", e);
		}
	},
	onClick:function(evt){
		var qtyNode = dijit.byNode(dojo.query(".quantidadeValue", this.domNode)[0]);
		var qty = parseFloat(qtyNode.attr("value"));
		var pedidoHandler = dijit.byId("pedidoWrapper");
		if(qty>0){
			pedidoHandler.addPlate(this.plate,qty);
		}
	},
	increase:function(){
		var qtyNode = dijit.byNode(dojo.query(".quantidadeValue", this.domNode)[0]);
		qtyNode.attr("value",parseFloat(qtyNode.attr("value"))+1);
	},
	decrease:function(){
		var qtyNode = dijit.byNode(dojo.query(".quantidadeValue", this.domNode)[0]);
		if(parseFloat(qtyNode.attr("value"))>0){
			qtyNode.attr("value",parseFloat(qtyNode.attr("value"))-1);
		}
	}

});

}


text:
@extends('layouts.app')
@section('title')
<?php echo $single_post->title?>
@endsection
@section('content')

<?php echo $single_post->title ?>

             <a href="<?php echo $single_post->slug ?>">Visit Link

 Posted on <?php echo date("d M Y", strtotime( $single_post->created_at )); ?> at <?php echo date("g:iA", strtotime($single_post->created_at)); ?>

<?php echo $single_post->content ?>

    @if (Auth::guest())

Please Login

        @else

Comments :

            @foreach($single_comment as $single)

<?php echo $single->comments_content ?>

                            @if ($single->comments_user_id == Auth::user()->id)

By: <?php echo $single->comments_user ?>

                            @else

By: <?php echo $single->comments_user ?>

                            @endif
                            @if ($single->comments_user_id == Auth::user()->id)

                                    posted in : <?php echo date("d M Y", strtotime( $single->comment_date )); ?>  at  <?php echo date("g:iA", strtotime($single->comment_date)); ?>
                                    comments_id)}}" class="btn btn-primary btn-xs edit-btn">edit

                            @else

                                    posted in : <?php echo date("d M Y", strtotime( $single->comment_date )); ?>  at  <?php echo date("g:iA", strtotime($single->comment_date)); ?>

                            @endif

            @endforeach

Leave a comment

        <form method="post" action="{{URL('/post/comment/publish')}}">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <input type="hidden" name="post_id" value="<?php echo $single_post->id ?>">

                <textarea required="required" placeholder="Enter comment here" name = "content" class="form-control"></textarea>

            <input type="submit" name='post_comment' class="btn btn-success" value = "Post"/>
        </form>

    @endif

@endsection


text:
layout: post
title: Hello, world!
---

Welcome to [Hyde](http://andhyde.com), the perfect companion to [Jekyll](http://jekyllrb.com), the popular static site generator. Hyde is an elegant, open source, mobile first theme for Jekyll. It includes lightweight styles and placeholder content to get you up and running with a simple blog in no time.

### Features

* Complete Jekyll setup included (layouts, config, 404, RSS feed, posts, and page)
* [Eight optional color schemes](https://github.com/mdo/hyde#themes), available via `<body>` classes
* Two orientations for content and sidebar, default (left sidebar) and [reverse](https://github.com/mdo/hyde#reverse-layout) (right sidebar), available via `<body>` classes
* Mobile first design and development, so it works great on all devices
* Support for a wide gamut of HTML elements
* Related posts (time-based, because Jekyll) below each post
* Syntax highlighting, courtesy Pygments (the Python-based code snippet highlighter)

### Browser support

Hyde is a rather forward-thinking project. In addition to the latest versions of Chrome, Safari (mobile and desktop), and Firefox, it is only compatible with Internet Explorer 9 and above.

### Documentation

Docs for setting up and customizing Hyde can be found in the [project readme on GitHub](https://github.com/mdo/hyde#readme).

### Download

Find out more and [download a copy](https://github.com/mdo/hyde) today from GitHub.


text:
package com.cilogi.geometry;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.vecmath.Matrix3d;
import java.awt.geom.AffineTransform;

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

    private MxUtil() {

    }

    public static AffineTransform mx2affine(Matrix3d mx) {
        return new AffineTransform(mx.m00, mx.m10, mx.m01, mx.m11, mx.m02, mx.m12);
    }

    public static Matrix3d affine2mx3d(AffineTransform a) {
        return new Matrix3d(a.getScaleX(), a.getShearX(), a.getTranslateX(),
                            a.getShearY(), a.getScaleY(), a.getTranslateY(),
                            0, 0, 1.0);
    }
}


text:
/**
 * Definition for undirected graph.
 * class UndirectedGraphNode {
 *     int label;
 *     List<UndirectedGraphNode> neighbors;
 *     UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<UndirectedGraphNode>(); }
 * };
 */
public class Solution {
    Map<Integer, UndirectedGraphNode> map;
    public UndirectedGraphNode cloneGraph(UndirectedGraphNode node) {
        if (null == node) {
            return null;
        }
        map = new HashMap<>();
        return clone(node);
    }

    private UndirectedGraphNode clone(UndirectedGraphNode node) {
        if (null == node) {
            return null;
        }

        if (map.containsKey(node.label)) {
            return map.get(node.label);
        }

        map.put(node.label, new UndirectedGraphNode(node.label));
        for (UndirectedGraphNode u : node.neighbors) {
            map.get(node.label).neighbors.add(clone(u));
        }

        return map.get(node.label);
    }
}


text:
// Copyright 2011 Google Inc. All Rights Reserved.
package com.google.appengine.tools.mapreduce.inputs;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreInputStream;
import com.google.appengine.tools.mapreduce.InputReader;
import com.google.appengine.tools.mapreduce.inputs.InputStreamIterator.OffsetRecordPair;
import com.google.common.io.CountingInputStream;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Iterator;

/**
 */
class BlobstoreInputReader extends InputReader<BlobstoreRecordKey, byte[]> {
// --------------------------- STATIC FIELDS ---------------------------

  private static final long serialVersionUID = -1869136825803030034L;
  private static final int DEFAULT_BUFFER_SIZE = 10000;

// ------------------------------ FIELDS ------------------------------

  long startOffset;
  long endOffset;
  private String blobKey;
  private byte terminator;
  private long offset = 0L;
  private transient CountingInputStream input;
  private transient Iterator<OffsetRecordPair> recordIterator;

// --------------------------- CONSTRUCTORS ---------------------------

  BlobstoreInputReader(String blobKey, long startOffset, long endOffset, byte terminator)
      throws IOException {
    this.blobKey = blobKey;
    this.startOffset = startOffset;
    this.endOffset = endOffset;
    this.terminator = terminator;

    createStreams();
  }

// ------------------------ INTERFACE METHODS ------------------------

// --------------------- Interface Iterator ---------------------

  @Override
  public boolean hasNext() {
    return recordIterator.hasNext();
  }

  @Override
  public KeyValue<BlobstoreRecordKey, byte[]> next() {
    OffsetRecordPair next = recordIterator.next();

    BlobstoreRecordKey key = new BlobstoreRecordKey(
        new BlobKey(blobKey), startOffset + offset + next.getOffset());
    byte[] value = next.getRecord();

    return KeyValue.of(key, value);
  }

// ------------------------ IMPLEMENTING METHODS ------------------------

  @Override
  public double getProgress() {
    double currentOffset = (double) (offset + input.getCount());
    return currentOffset / (double) (endOffset - startOffset);
  }

// -------------------------- INSTANCE METHODS --------------------------

  private void createStreams() throws IOException {
    input = new CountingInputStream(
        new BufferedInputStream(
            new BlobstoreInputStream(new BlobKey(blobKey), startOffset + offset),
            DEFAULT_BUFFER_SIZE));

    recordIterator = new InputStreamIterator(input, endOffset - startOffset - offset,
        startOffset != 0L && offset == 0L,
        terminator);
  }

  private void readObject(ObjectInputStream stream)
      throws IOException, ClassNotFoundException {
    blobKey = (String) stream.readObject();
    startOffset = stream.readLong();
    endOffset = stream.readLong();
    terminator = stream.readByte();
    offset = stream.readLong();

    createStreams();
  }

  private void writeObject(ObjectOutputStream stream) throws IOException {
    stream.writeObject(blobKey);
    stream.writeLong(startOffset);
    stream.writeLong(endOffset);
    stream.writeByte(terminator);
    long newOffset = offset + (input == null ? 0 : input.getCount());
    stream.writeLong(newOffset);
  }
}


text:
package com.loadburn.heron.transport;

import com.google.inject.ImplementedBy;

@ImplementedBy(UrlEncodedFormTransport.class)
public abstract class Form implements Transport {

    public String contentType() {
        return "application/x-www-form-urlencoded";
    }

}