text:
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
console.log('[Debug] Preparing ready.js');
exports.default = (client) =>
  client.on("ready", ()=>{
    client.user.setGame(`with ${client.users.size} users! | >help for help`);
    console.log(`Client ready, logged in as ${client.user.tag}:${client.user.id}`);
  })
;


text:
import asyncio
import inspect
import sys
from datetime import datetime, timezone
from pathlib import Path
from typing import List

import pytest
from typing_extensions import Annotated, TypedDict

from pydantic import BaseModel, Extra, Field, ValidationError, validate_arguments
from pydantic.decorator import ValidatedFunction
from pydantic.errors import ConfigError

skip_pre_38 = pytest.mark.skipif(sys.version_info < (3, 8), reason='testing >= 3.8 behaviour only')

def test_args():
    @validate_arguments
    def foo(a: int, b: int):
        return f'{a}, {b}'

    assert foo(1, 2) == '1, 2'
    assert foo(*[1, 2]) == '1, 2'
    assert foo(*(1, 2)) == '1, 2'
    assert foo(*[1], 2) == '1, 2'

    with pytest.raises(ValidationError) as exc_info:
        foo()

    assert exc_info.value.errors() == [
        {'loc': ('a',), 'msg': 'field required', 'type': 'value_error.missing'},
        {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 'x')

    assert exc_info.value.errors() == [
        {'loc': ('b',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, 3)

    assert exc_info.value.errors() == [
        {'loc': ('args',), 'msg': '2 positional arguments expected but 3 given', 'type': 'type_error'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, apple=3)

    assert exc_info.value.errors() == [
        {'loc': ('kwargs',), 'msg': "unexpected keyword argument: 'apple'", 'type': 'type_error'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, a=3)

    assert exc_info.value.errors() == [
        {'loc': ('v__duplicate_kwargs',), 'msg': "multiple values for argument: 'a'", 'type': 'type_error'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, a=3, b=4)

    assert exc_info.value.errors() == [
        {'loc': ('v__duplicate_kwargs',), 'msg': "multiple values for arguments: 'a', 'b'", 'type': 'type_error'}
    ]

def test_wrap():
    @validate_arguments
    def foo_bar(a: int, b: int):
        """This is the foo_bar method."""
        return f'{a}, {b}'

    assert foo_bar.__doc__ == 'This is the foo_bar method.'
    assert foo_bar.__name__ == 'foo_bar'
    assert foo_bar.__module__ == 'tests.test_decorator'
    assert foo_bar.__qualname__ == 'test_wrap.<locals>.foo_bar'
    assert isinstance(foo_bar.vd, ValidatedFunction)
    assert callable(foo_bar.raw_function)
    assert foo_bar.vd.arg_mapping == {0: 'a', 1: 'b'}
    assert foo_bar.vd.positional_only_args == set()
    assert issubclass(foo_bar.model, BaseModel)
    assert foo_bar.model.__fields__.keys() == {'a', 'b', 'args', 'kwargs', 'v__duplicate_kwargs'}
    assert foo_bar.model.__name__ == 'FooBar'
    assert foo_bar.model.schema()['title'] == 'FooBar'
    assert repr(inspect.signature(foo_bar)) == '<Signature (a: int, b: int)>'

def test_kwargs():
    @validate_arguments
    def foo(*, a: int, b: int):
        return a + b

    assert foo.model.__fields__.keys() == {'a', 'b', 'args', 'kwargs'}
    assert foo(a=1, b=3) == 4

    with pytest.raises(ValidationError) as exc_info:
        foo(a=1, b='x')

    assert exc_info.value.errors() == [
        {'loc': ('b',), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 'x')

    assert exc_info.value.errors() == [
        {'loc': ('a',), 'msg': 'field required', 'type': 'value_error.missing'},
        {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},
        {'loc': ('args',), 'msg': '0 positional arguments expected but 2 given', 'type': 'type_error'},
    ]

def test_untyped():
    @validate_arguments
    def foo(a, b, c='x', *, d='y'):
        return ', '.join(str(arg) for arg in [a, b, c, d])

    assert foo(1, 2) == '1, 2, x, y'
    assert foo(1, {'x': 2}, c='3', d='4') == "1, {'x': 2}, 3, 4"

@pytest.mark.parametrize('validated', (True, False))
def test_var_args_kwargs(validated):
    def foo(a, b, *args, d=3, **kwargs):
        return f'a={a!r}, b={b!r}, args={args!r}, d={d!r}, kwargs={kwargs!r}'

    if validated:
        foo = validate_arguments(foo)

    assert foo(1, 2) == 'a=1, b=2, args=(), d=3, kwargs={}'
    assert foo(1, 2, 3, d=4) == 'a=1, b=2, args=(3,), d=4, kwargs={}'
    assert foo(*[1, 2, 3], d=4) == 'a=1, b=2, args=(3,), d=4, kwargs={}'
    assert foo(1, 2, args=(10, 11)) == "a=1, b=2, args=(), d=3, kwargs={'args': (10, 11)}"
    assert foo(1, 2, 3, args=(10, 11)) == "a=1, b=2, args=(3,), d=3, kwargs={'args': (10, 11)}"
    assert foo(1, 2, 3, e=10) == "a=1, b=2, args=(3,), d=3, kwargs={'e': 10}"
    assert foo(1, 2, kwargs=4) == "a=1, b=2, args=(), d=3, kwargs={'kwargs': 4}"
    assert foo(1, 2, kwargs=4, e=5) == "a=1, b=2, args=(), d=3, kwargs={'kwargs': 4, 'e': 5}"

def test_field_can_provide_factory() -> None:
    @validate_arguments
    def foo(a: int, b: int = Field(default_factory=lambda: 99), *args: int) -> int:
        """mypy is happy with this"""
        return a + b + sum(args)

    assert foo(3) == 102
    assert foo(1, 2, 3) == 6

def test_annotated_field_can_provide_factory() -> None:
    @validate_arguments
    def foo2(a: int, b: Annotated[int, Field(default_factory=lambda: 99)], *args: int) -> int:
        """mypy reports Incompatible default for argument "b" if we don't supply ANY as default"""
        return a + b + sum(args)

    assert foo2(1) == 100

@skip_pre_38
def test_positional_only(create_module):
    module = create_module(
        # language=Python
        """
from pydantic import validate_arguments

@validate_arguments
def foo(a, b, /, c=None):
    return f'{a}, {b}, {c}'
"""
    )
    assert module.foo(1, 2) == '1, 2, None'
    assert module.foo(1, 2, 44) == '1, 2, 44'
    assert module.foo(1, 2, c=44) == '1, 2, 44'
    with pytest.raises(ValidationError) as exc_info:
        module.foo(1, b=2)
    assert exc_info.value.errors() == [
        {
            'loc': ('v__positional_only',),
            'msg': "positional-only argument passed as keyword argument: 'b'",
            'type': 'type_error',
        }
    ]
    with pytest.raises(ValidationError) as exc_info:
        module.foo(a=1, b=2)
    assert exc_info.value.errors() == [
        {
            'loc': ('v__positional_only',),
            'msg': "positional-only arguments passed as keyword arguments: 'a', 'b'",
            'type': 'type_error',
        }
    ]

def test_args_name():
    @validate_arguments
    def foo(args: int, kwargs: int):
        return f'args={args!r}, kwargs={kwargs!r}'

    assert foo.model.__fields__.keys() == {'args', 'kwargs', 'v__args', 'v__kwargs', 'v__duplicate_kwargs'}
    assert foo(1, 2) == 'args=1, kwargs=2'

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, apple=4)
    assert exc_info.value.errors() == [
        {'loc': ('v__kwargs',), 'msg': "unexpected keyword argument: 'apple'", 'type': 'type_error'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, apple=4, banana=5)
    assert exc_info.value.errors() == [
        {'loc': ('v__kwargs',), 'msg': "unexpected keyword arguments: 'apple', 'banana'", 'type': 'type_error'}
    ]

    with pytest.raises(ValidationError) as exc_info:
        foo(1, 2, 3)
    assert exc_info.value.errors() == [
        {'loc': ('v__args',), 'msg': '2 positional arguments expected but 3 given', 'type': 'type_error'}
    ]

def test_v_args():
    with pytest.raises(
        ConfigError, match='"v__args", "v__kwargs", "v__positional_only" and "v__duplicate_kwargs" are not permitted'
    ):

        @validate_arguments
        def foo1(v__args: int):
            pass

    with pytest.raises(
        ConfigError, match='"v__args", "v__kwargs", "v__positional_only" and "v__duplicate_kwargs" are not permitted'
    ):

        @validate_arguments
        def foo2(v__kwargs: int):
            pass

    with pytest.raises(
        ConfigError, match='"v__args", "v__kwargs", "v__positional_only" and "v__duplicate_kwargs" are not permitted'
    ):

        @validate_arguments
        def foo3(v__positional_only: int):
            pass

    with pytest.raises(
        ConfigError, match='"v__args", "v__kwargs", "v__positional_only" and "v__duplicate_kwargs" are not permitted'
    ):

        @validate_arguments
        def foo4(v__duplicate_kwargs: int):
            pass

def test_async():
    @validate_arguments
    async def foo(a, b):
        return f'a={a} b={b}'

    async def run():
        v = await foo(1, 2)
        assert v == 'a=1 b=2'

    loop = asyncio.get_event_loop_policy().get_event_loop()
    loop.run_until_complete(run())
    with pytest.raises(ValidationError) as exc_info:
        loop.run_until_complete(foo('x'))
    assert exc_info.value.errors() == [{'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'}]

def test_string_annotation():
    @validate_arguments
    def foo(a: 'List[int]', b: 'Path'):
        return f'a={a!r} b={b!r}'

    assert foo([1, 2, 3], '/')

    with pytest.raises(ValidationError) as exc_info:
        foo(['x'])
    assert exc_info.value.errors() == [
        {'loc': ('a', 0), 'msg': 'value is not a valid integer', 'type': 'type_error.integer'},
        {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},
    ]

def test_item_method():
    class X:
        def __init__(self, v):
            self.v = v

        @validate_arguments
        def foo(self, a: int, b: int):
            assert self.v == a
            return f'{a}, {b}'

    x = X(4)
    assert x.foo(4, 2) == '4, 2'
    assert x.foo(*[4, 2]) == '4, 2'

    with pytest.raises(ValidationError) as exc_info:
        x.foo()

    assert exc_info.value.errors() == [
        {'loc': ('a',), 'msg': 'field required', 'type': 'value_error.missing'},
        {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},
    ]

def test_class_method():
    class X:
        @classmethod
        @validate_arguments
        def foo(cls, a: int, b: int):
            assert cls == X
            return f'{a}, {b}'

    x = X()
    assert x.foo(4, 2) == '4, 2'
    assert x.foo(*[4, 2]) == '4, 2'

    with pytest.raises(ValidationError) as exc_info:
        x.foo()

    assert exc_info.value.errors() == [
        {'loc': ('a',), 'msg': 'field required', 'type': 'value_error.missing'},
        {'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'},
    ]

def test_config_title():
    @validate_arguments(config=dict(title='Testing'))
    def foo(a: int, b: int):
        return f'{a}, {b}'

    assert foo(1, 2) == '1, 2'
    assert foo(1, b=2) == '1, 2'
    assert foo.model.schema()['title'] == 'Testing'

def test_config_title_cls():
    class Config:
        title = 'Testing'

    @validate_arguments(config=Config)
    def foo(a: int, b: int):
        return f'{a}, {b}'

    assert foo(1, 2) == '1, 2'
    assert foo(1, b=2) == '1, 2'
    assert foo.model.schema()['title'] == 'Testing'

def test_config_fields():
    with pytest.raises(ConfigError, match='Setting the "fields" and "alias_generator" property on custom Config for @'):

        @validate_arguments(config=dict(fields={'b': 'bang'}))
        def foo(a: int, b: int):
            return f'{a}, {b}'

def test_config_arbitrary_types_allowed():
    class EggBox:
        def __str__(self) -> str:
            return 'EggBox()'

    @validate_arguments(config=dict(arbitrary_types_allowed=True))
    def foo(a: int, b: EggBox):
        return f'{a}, {b}'

    assert foo(1, EggBox()) == '1, EggBox()'
    with pytest.raises(ValidationError) as exc_info:
        assert foo(1, 2) == '1, 2'

    assert exc_info.value.errors() == [
        {
            'loc': ('b',),
            'msg': 'instance of EggBox expected',
            'type': 'type_error.arbitrary_type',
            'ctx': {'expected_arbitrary_type': 'EggBox'},
        },
    ]

def test_validate(mocker):
    stub = mocker.stub(name='on_something_stub')

    @validate_arguments
    def func(s: str, count: int, *, separator: bytes = b''):
        stub(s, count, separator)

    func.validate('qwe', 2)
    with pytest.raises(ValidationError):
        func.validate(['qwe'], 2)

    stub.assert_not_called()

def test_validate_all():
    @validate_arguments(config=dict(validate_all=True))
    def foo(dt: datetime = Field(default_factory=lambda: 946684800)):
        return dt

    assert foo() == datetime(2000, 1, 1, tzinfo=timezone.utc)
    assert foo(0) == datetime(1970, 1, 1, tzinfo=timezone.utc)

@skip_pre_38
def test_validate_all_positional(create_module):
    module = create_module(
        # language=Python
        """
from datetime import datetime

from pydantic import Field, validate_arguments

@validate_arguments(config=dict(validate_all=True))
def foo(dt: datetime = Field(default_factory=lambda: 946684800), /):
    return dt
"""
    )
    assert module.foo() == datetime(2000, 1, 1, tzinfo=timezone.utc)
    assert module.foo(0) == datetime(1970, 1, 1, tzinfo=timezone.utc)

def test_validate_extra():
    class TypedTest(TypedDict):
        y: str

    @validate_arguments(config={'extra': Extra.allow})
    def test(other: TypedTest):
        return other

    assert test(other={'y': 'b', 'z': 'a'}) == {'y': 'b', 'z': 'a'}

    @validate_arguments(config={'extra': Extra.ignore})
    def test(other: TypedTest):
        return other

    assert test(other={'y': 'b', 'z': 'a'}) == {'y': 'b'}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.directory.api.util.exception;

/**
 * This exception is thrown when a Backend operation is either temporarily
 * unsupported or perminantly unsupported as part of its implementation. Write
 * operations on a backend set to readonly throw a type of unsupported exception
 * called ReadOnlyException.
 *
 * @author Apache Directory Project
 */
public class NotImplementedException extends RuntimeException
{
    /** The serialVersionUID. */
    static final long serialVersionUID = -5899307402675964298L;

    /**
     * Constructs an Exception with a detailed message.
     */
    public NotImplementedException()
    {
        super( "N O T   I M P L E M E N T E D   Y E T !" );
    }

    /**
     * Constructs an Exception with a detailed message.
     *
     * @param msg
     *            The message associated with the exception.
     */
    public NotImplementedException( String msg )
    {
        super( "N O T   I M P L E M E N T E D   Y E T !\n" + msg );
    }
}


text:
package org.xsystem.sql2.http;

import java.sql.Connection;

/**
 *
 * @author Andrey Timofeev
 */
public interface AfterCreateConnectionEventListener {
    public void onCreateConnection(Connection  connection);
}


text:
package dst3.ws;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for findJobsResponse complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="findJobsResponse">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="return" type="{http://ejb.dst3/}jobDTO" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "findJobsResponse", propOrder = {
    "_return"
})
public class FindJobsResponse {

    @XmlElement(name = "return")
    protected List<JobDTO> _return;

    /**
     * Gets the value of the return property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the return property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getReturn().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link JobDTO }
     *
     *
     */
    public List<JobDTO> getReturn() {
        if (_return == null) {
            _return = new ArrayList<JobDTO>();
        }
        return this._return;
    }

}


text:
<?php

namespace BackBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use MainBundle\Entity\Category;
use BackBundle\Form\CategoryType;

/**
 * Category controller.
 *
 */
class CategoryController extends BaseController
{
    /**
     * Lists all Category entities.
     *
     */
    public function indexAction(Request $request, $page)
    {
        $this->grantAccessUserSecurity();

        $em = $this->getDoctrine()->getManager();

        $allCategories = $em->getRepository('MainBundle:Category')
            ->findAll();

        if (null === $allCategories) {
            throw new NotFoundHttpException("Aucunes categories.");
        }

        if(empty($page)){
            $page = $request->query->getInt('page', 1);
        }

        $paginator = $this->get('knp_paginator');
        $categories = $paginator->paginate(
            $allCategories,
            $page,
            5
        );

        return $this->render('BackBundle:Category:index.html.twig', array(
            'categories' => $categories
        ));
    }

    /**
     * Creates a new Category entity.
     *
     */
    public function newAction(Request $request)
    {
        $this->grantAccessUserSecurity();

        $category = new Category();
        $form = $this->createForm('BackBundle\Form\CategoryType', $category);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($category);
            $em->flush();

            return $this->redirectToRoute('back_category_show', array('id' => $category->getId()));
        }

        return $this->render('BackBundle:Category:new.html.twig', array(
            'category' => $category,
            'form' => $form->createView(),
        ));
    }

    /**
     * Finds and displays a Category entity.
     *
     */
    public function showAction(Category $category)
    {
        $this->grantAccessUserSecurity();

        $deleteForm = $this->createDeleteForm($category);

        return $this->render('BackBundle:Category:show.html.twig', array(
            'category' => $category,
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Displays a form to edit an existing Category entity.
     *
     */
    public function editAction(Request $request, Category $category)
    {
        $this->grantAccessUserSecurity();

        $deleteForm = $this->createDeleteForm($category);
        $editForm = $this->createForm('BackBundle\Form\CategoryType', $category);
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($category);
            $em->flush();

            return $this->redirectToRoute('back_category_edit', array('id' => $category->getId()));
        }

        return $this->render('BackBundle:Category:edit.html.twig', array(
            'category' => $category,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }

    /**
     * Deletes a Category entity.
     *
     */
    public function deleteAction(Request $request, Category $category)
    {
        $this->grantAccessUserSecurity();

        $form = $this->createDeleteForm($category);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->remove($category);
            $em->flush();
        }

        return $this->redirectToRoute('back_category_index');
    }

    /**
     * Creates a form to delete a Category entity.
     *
     * @param Category $category The Category entity
     *
     * @return \Symfony\Component\Form\Form The form
     */
    private function createDeleteForm(Category $category)
    {
        return $this->createFormBuilder()
            ->setAction($this->generateUrl('back_category_delete', array('id' => $category->getId())))
            ->setMethod('DELETE')
            ->getForm()
        ;
    }
}


text:
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/login/user_controller.h"

#include "views/widget/widget_gtk.h"

using views::WidgetGtk;

namespace chromeos {

namespace {

class ControlsWidget : public WidgetGtk {
 public:
  ControlsWidget() {
  }

 private:
  // WidgetGtk overrides:
  virtual void OnMap(GtkWidget* widget) OVERRIDE {
    // For some reason, Controls window never gets first expose event,
    // which makes WM believe that the login screen is not ready.
    // This is a workaround to let WM show the login screen. While
    // this may allow WM to show unpainted window, we haven't seen any
    // issue (yet). We will not investigate this further because we're
    // migrating to different implemention (WebUI).
    UpdateFreezeUpdatesProperty(GTK_WINDOW(GetNativeView()),
                                false /* remove */);
  }

  DISALLOW_COPY_AND_ASSIGN(ControlsWidget);
};

// Widget that notifies window manager about clicking on itself.
// Doesn't send anything if user is selected.
class ClickNotifyingWidget : public WidgetGtk {
 public:
  explicit ClickNotifyingWidget(UserController* controller)
      : controller_(controller) {
  }

 private:
  gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event) {
    if (!controller_->IsUserSelected())
      controller_->SelectUserRelative(0);

    return WidgetGtk::OnButtonPress(widget, event);
  }

  UserController* controller_;

  DISALLOW_COPY_AND_ASSIGN(ClickNotifyingWidget);
};

views::Widget* InitWidget(views::Widget* widget, const gfx::Rect& bounds) {
  views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
  params.transparent = true;
  params.bounds = bounds;
  widget->Init(params);
  GdkWindow* gdk_window = widget->GetNativeView()->window;
  gdk_window_set_back_pixmap(gdk_window, NULL, false);
  return widget;
}

}  // namespace

// static
views::Widget* UserController::CreateControlsWidget(const gfx::Rect& bounds) {
  return InitWidget(new ControlsWidget(), bounds);
}

// static
views::Widget* UserController::CreateClickNotifyingWidget(
    UserController* controller,
    const gfx::Rect& bounds) {
  return InitWidget(new ClickNotifyingWidget(controller), bounds);
}

}  // namespace


text:
namespace remoting {

// Get the host Operating System Name, removing the need to check for OS
// definitions and keeps the keys used consistent.
std::string GetHostOperatingSystemName() {
#if BUILDFLAG(IS_WIN)
  return "Windows";
#elif BUILDFLAG(IS_APPLE)
  return "Mac";
#elif BUILDFLAG(IS_CHROMEOS_ASH)
  return "ChromeOS";
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
  return "Linux";
#elif BUILDFLAG(IS_ANDROID)
  return "Android";
#else
#error "Unsupported host OS"
#endif
}

// Get the host Operating System Version, removing the need to check for OS
// definitions and keeps the format used consistent.
std::string GetHostOperatingSystemVersion() {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
  return base::GetLinuxDistro();
#else
  return base::SysInfo::OperatingSystemVersion();
#endif
}

}  // namespace remoting


text:
An elegant universal react-redux starter kit.

![techs](https://raw.githubusercontent.com/nRewik/react-railgun/master/static/techs.png)

# Features

 * Universal React, Redux
 * Universal Hot Reloading
 * Development & Production Environment
 * No testing library ( pick yours )
 * No magic, KISS.

# Tech

* [Webpack](https://webpack.github.io) Bundle our scripts into a single 'bundle.js' enabling hot reload via hmr
* [Babel](https://babeljs.io) Use ES6, ES7 now
* [Express](http://expressjs.com) HTTP server for server side rendering
* [React](https://facebook.github.io/react/) Fast, composable library for building UI
* [Redux](https://github.com/reactjs/redux) Solid software architecture
* [React Router](https://github.com/reactjs/react-router) Routing library for React
* [ESlint](http://eslint.org) with [Javascript Standard Style](http://standardjs.com/rules.html) Enforce consistent code style

# Structure

```
.
├── LICENSE
├── app-home.js
├── build/
├── package.json
├── source/
│   ├── client/
│   │   └── index.js
│   ├── server/
│   │   ├── app.js
│   │   ├── render-layout.js
│   │   ├── render.js
│   │   ├── routes/
│   │   ├── server.dev.js
│   │   ├── server.js
│   │   └── settings/
│   └── shared/
│       ├── components/
│       ├── configure-store.js
│       ├── redux/
│       └── routes/
├── static/
├── webpack.config.dev.js
└── webpack.config.prod.js
```

# Getting started
```
git clone https://github.com/nRewik/react-railgun.git MyApp
cd MyApp
npm install
npm start

# Open localhost:3000
# For development use `npm run start:dev`
```

---------
Crafted with ❤ by Nutchaphon Rewik.


text:
Running experiments
===================

This section outlines the steps in running experiments with our platform.

Sandbox experiments
-------------------

Before spending any money, you should veriy that everything works in the MTurk
sandbox.

make sure you are in production mode
    See :doc:`../setup` for instructions on how to set up the server and run in
    production mode.

switch to sandbox mode
    Set ``MTURK_SANDBOX = True`` in ``server/config/settings_local.py``.

    This will use https://workersandbox.mturk.com instead of
    https://www.mturk.com/.

configure the experiments
    For the experiments that you want to run, edit the ``experiments.py`` file
    in those apps (e.g. ``intrinsic/experiments.py``).  The most important
    parameter is ``auto_add_hits``.  Set this to ``True`` if you want to run
    this experiment.

start the experiments
    The following commands will dispatch tasks to MTurk:

    .. code-block:: bash

        ./manage.py mtconfigure
        ./manage.py mtconsume

    See :ref:`mturk-commands` for documentation of these commands.

verify that it works
    Navigate to http://workersandbox.mturk.com and find your task on the
    sandbox marketplace.

    Try submitting some results and check that they show up in the admin
    submission view (http://YOUR_HOSTNAME/mturk/admin/submission/)

expire experiments
    To expire all experiments, run:

    .. code-block:: bash

        ./manage.py mtexpire '.*'

Paid experiments
----------------

This section outlines the step in running paid experiments with our platform.

make sure you are in production mode
    See :doc:`../setup` for instructions on how to set up the server and run in
    production mode.

disable sandbox mode
    Set ``MTURK_SANDBOX = False`` in ``server/config/settings_local.py``.  This
    will switch to the main https://www.mturk.com/ server.

configure the experiments
    For the experiments that you want to run, edit the ``experiments.py`` file
    in those apps (e.g. ``intrinsic/experiments.py``).  The most important
    parameter is ``auto_add_hits``.  Set this to ``True`` if you want to run
    this experiment.

start the experiments
    The following commands will dispatch tasks to MTurk:

    .. code-block:: bash

        ./manage.py mtconfigure
        ./manage.py mtconsume

    Note that if all input objects have received the specified number of
    labels, then no work will be dispatched.  See :ref:`mturk-commands` for
    documentation of these commands.

monitor workers
    Watch users by either setting up Google Analytics or viewing the server log:

    .. code-block:: bash

        tail -f run/gunicorn.log

    It will take ~10min before you see the first submissions.

review submissions
    There are two methods to reviewing submissions:

    1. Automatically approve all submissions.  When using both tutorials and
       sentinels, I find that the proportion of high quality submissions is
       high enough to approve all workers.  While some bad work sneaks by I
       find that it is not worth rejecting, since workers get upset and don't
       like the uncertainty.

       To approve all submissions, set ``MTURK_AUTO_APPROVE = True`` in
       ``server/config/settings_local.py``.  This will approve with celery,
       which could have a long delay.  Workers like seeing instant approvals (I
       found that my submission rate increased by 50-100%), so it is worth
       running

       .. code-block:: bash

           ./manage.py mtapprove_loop '.*'

       while the experiment is running to automatically approve everything as
       quickly as possible.  The argument is a regular expression on the
       Experiment ``slug`` (human-readable ID).

    2. Manual review.
       Unfortunately I haven't had time to update the admin interface to have
       approve/reject buttons (since I always approve all submissions).  You
       can manually approve/reject by opening a Python shell on the server
       (``./scripts/django_shell.sh``) and running the command:

       .. code-block:: py

           MtAssignment.objects.get(id='ID').approve(feedback='Thank you!')

       or

       .. code-block:: py

           MtAssignment.objects.get(id='ID').reject(feedback='You made too many mistakes.')

       where ``ID`` is the assignment ID.

       I find that quality tends to be consistent within a worker, so you could
       write a loop to iterate over known good workers and approve those:

       .. code-block:: py

           GOOD_WORKER_MTURK_IDS = [ ... ]

           asst_qset = MtAssignment.objects.filter(
               status='S', worker__mturk_worker_id__in=GOOD_WORKER_MTURK_IDS)
           for asst in asst_qset:
               try:
                   asst.approve(feedback='Thank you!')
               except:
                   pass

       See :class:`mturk.models.MtAssignment` for more assignment-related methods.

    Note that approve/reject commands have a high chance of failing.  The
    Amazon MTurk server takes a while to recognize that a certain assignment is
    ready for approval.  The above scripts take this into account, so don't
    worry about lots of errors in the celery logs regarding approvals.

grant bonuses
    You can grant bonuses to assignments in the Python shell
    (``./scripts/django_shell.sh``) with the command:

    .. code-block:: py

           MtAssignment.objects.get(id='ID').grant_bonus(price=0.10, reason='You did a great job')

    where ``ID`` is the assignment ID.

    Note that users are promised small bonuses for completing feedback.  This
    is automatically handled by the :meth:`mturk.models.MtAssignment.approve`
    method.

stop experiments
    To expire all experiments, run:

    .. code-block:: bash

        ./manage.py mtexpire '.*'

sync status
    OpenSurfaces stores a local copy of the status of each HIT and Assignment.
    To make sure that local data is synchronized, run:

    .. code-block:: bash

        ./manage.py mtsync

check account balance
    To print your Amazon account balance to the console, run:

    .. code-block:: bash

        ./manage.py mtbalance

CUBAM
    If an experiment uses CUBAM to aggregate binary answers, run this to update
    all labels:

    .. code-block:: py

        ./manage.py mtcubam

    *Warning*: this will take several hours to run if you have millions of
    labels.

To add your own experiment, see :doc:`../extending`.


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android = "http://schemas.android.com/apk/res/android"
     android:interpolator = "@android:anim/linear_interpolator"
        >
    <rotate
            android:duration = "300"
            android:fromDegrees = "270"
            android:pivotX = "50%"
            android:pivotY = "50%"
            android:fillAfter = "true"
            android:toDegrees = "360"
            />
</set>


text:
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

ERROR - 2016-06-27 10:28:18 --> Severity: Error --> Call to undefined method Customer_model::customer_list_datasource() /Applications/XAMPP/xamppfiles/htdocs/dudu/application/controllers/adminpanel/Order.php 37
ERROR - 2016-06-27 10:36:36 --> 404 Page Not Found: Upload/1212
ERROR - 2016-06-27 11:13:09 --> 404 Page Not Found: Upload/1212
ERROR - 2016-06-27 11:27:19 --> 404 Page Not Found: api//index


text:
#if!defined __SUBSCRIPTIONDATA_H__
#define __SUBSCRIPTIONDATA_H__

#include <string>
#include <set>

class SubscriptionData
{
public:
	SubscriptionData();
	SubscriptionData(const std::string& topic, const std::string& subString);

	std::string getTopic()const;
	void setTopic(const std::string& topic);

	std::string getSubString();
	void setSubString(const std::string& subString);

	std::set<std::string>& getTagsSet();
	void setTagsSet(const std::set<std::string>& tagsSet);

	long long getSubVersion();
	void setSubVersion(long long subVersion);

	std::set<int>& getCodeSet();
	void setCodeSet(const std::set<int>& codeSet);

	int hashCode();

	bool operator==(const SubscriptionData& other);
	bool operator<(const SubscriptionData& other)const;

public:
	static std::string SUB_ALL;

private:
	std::string m_topic;
	std::string m_subString;
	std::set<std::string> m_tagsSet;
	std::set<int> m_codeSet;
	long long m_subVersion ;
};

#endif


text:
import datetime
import logging

import dateutil.parser
import pytz
from flask import Blueprint, render_template, request, abort, redirect, url_for, jsonify, json
from sqlalchemy.sql import func, or_

from . import db
from .db import session_scope

logger = logging.getLogger(__name__)

todobp = Blueprint('todo', __name__)

def update_calendar_events():
    old_events = db.Session.query(db.Todo).\
        filter(
            db.Todo.active == True,
            db.Todo.status_id == 5,
            db.Todo.repeat_type_id != None,
            db.Todo.start < func.now(),
            db.Todo.due < func.now())
    for o in old_events:
        update_due_date(o)

@todobp.route('/todo/')
def index():
    with session_scope() as session:
        todos = session.query(db.Todo).\
            filter(db.Todo.status_id != 5).\
            order_by(
                db.Todo.due.asc(),
                db.Todo.start.asc(),
                db.Todo.summary.asc())

        calendar_events = session.query(db.Todo).\
            filter(db.Todo.status_id == 5).\
            order_by(
                db.Todo.start.asc(),
                db.Todo.due.asc(),
                db.Todo.summary.asc())

        vue_data = {
            'todos' : todos.all(),
            'calendar_events' : calendar_events.all(),
            'future' : 'future' in request.args,
            'status' : request.args.get('status', 'ongoing'),
            'inactive' : 'inactive' in request.args,
        }

        return render_template('todo/index.html', vue_data=vue_data)

@todobp.route('/todo/<int:todo_id>/')
def view(todo_id):
    with session_scope() as session:
        todo = session.query(db.Todo).get(todo_id)
        if not todo:
            abort(404)

        return render_template('todo/view.html', vue_data={'todo' : todo, 'events' : todo.events})

@todobp.route('/todo/add/')
@todobp.route('/todo/<int:todo_id>/edit/')
def edit(todo_id=None):
    with session_scope() as session:
        if todo_id:
            todo = session.query(db.Todo).get(todo_id)
            if not todo:
                abort(404)
        else:
            todo = db.Todo(active=True)

        statuses = session.query(db.TodoStatus).order_by(db.TodoStatus.id.asc())
        repeat_types = session.query(db.RepeatType).order_by(db.RepeatType.id.asc())
        tags = session.query(db.Tag).order_by(db.Tag.name.asc())

        vue_data = {
            'todo' : todo,
            'statuses' : statuses.all(),
            'repeat_types' : repeat_types.all(),
            'tags' : tags.all(),
        }

        return render_template('todo/edit.html', vue_data=vue_data)

@todobp.route('/todo/edit/', methods=['POST'])
def edit_post():
    with session_scope() as session:
        data = request.get_json()

        if data.get('id'):
            todo = session.query(db.Todo).get(data.get('id'))
            if not todo:
                abort(404)
        else:
            todo = db.Todo()

        todo.active = data.get('active')
        todo.status_id = data.get('status').get('id')
        todo.parent_id = data.get('parent_id')
        todo.summary = data.get('summary').strip()
        if data.get('repeat_type'):
            todo.repeat_type_id = data['repeat_type']['id']
            rd = data.get('repeat_detail_formval')
            if not rd:
                abort(400)
            if todo.repeat_type_id in (1, 2):
                try:
                    rd = int(rd)
                except (ValueError, TypeError):
                    abort(400)
                todo.repeat_detail = {'days' : rd}
            elif todo.repeat_type_id == 3:
                weekdays = [
                    'Monday',
                    'Tuesday',
                    'Wednesday',
                    'Thursday',
                    'Friday',
                    'Saturday',
                    'Sunday',
                ]
                todo.repeat_detail = {'days' : [weekdays.index(d) for d in rd]}
            elif todo.repeat_type_id == 5:
                date = dateutil.parser.parse(rd)
                todo.repeat_detail = {'month' : date.month, 'day' : date.day}
        else:
            todo.repeat_type_id = None
            todo.repeat_detail_col = None

        tz = db.get_timezone()

        if data.get('start'):
            todo.start = tz.localize(dateutil.parser.parse(data.get('start'))).astimezone(pytz.utc)
        else:
            todo.start = None

        if data.get('due'):
            todo.due = tz.localize(dateutil.parser.parse(data.get('due'))).astimezone(pytz.utc)
        else:
            todo.due = None

        todo.tags = [db.get_tag(t['name'].strip(), create=True) for t in data.get('tags', [])]

        notes = data.get('notes')
        if notes is not None:
            notes = notes.replace("\r\n", "\n")
        todo.notes = notes or None

        session.add(todo)
        session.flush()

        return jsonify({
            'status' : 'ok',
            'action' : 'redirect',
            'next' : url_for('.view', todo_id=todo.id),
        })

def update_due_date(todo):
    tz = db.get_timezone()
    end_of_day = tz.localize(datetime.datetime.now().replace(hour=23, minute=59, second=59, microsecond=999999)).astimezone(pytz.utc).replace(tzinfo=None)
    if todo.repeat_type_id == 1:
        if not isinstance(todo.repeat_detail.get('days'), int):
            raise ValueError("Invalid repeat information.")
        if todo.repeat_detail.get('days') == 0:
            # Immediately repeating habits should have no due or start dates.
            todo.due = None
            todo.start = None
        elif todo.due:
            cutoff = max(todo.due, end_of_day)
            new_due = todo.due
            if new_due <= cutoff:
                days = todo.repeat_detail.get('days', 1)
                delta = ((cutoff - todo.due).days // days) + 1
                new_due += datetime.timedelta(days=delta*days)
            if todo.start:
                todo.start = new_due - (todo.due - todo.start)
            todo.due = new_due
        elif todo.start:
            cutoff = max(todo.start, end_of_day)
            if todo.start <= cutoff:
                days = todo.repeat_detail.get('days', 1)
                delta = ((cutoff - todo.start).days // days) + 1
                todo.start += datetime.timedelta(days=delta)
        else:
            raise ValueError("Repeating tasks with no due/start dates must repeat immediately.")
    elif todo.repeat_type_id == 2:
        if not isinstance(todo.repeat_detail.get('days'), int):
            raise ValueError("Invalid repeat information.")
        if todo.repeat_detail.get('days') == 0:
            # Immediately repeating habits should have no due or start dates.
            todo.due = None
            todo.start = None
        elif todo.due:
            new_due = datetime.datetime.now().replace(hour=todo.due.hour, minute=todo.due.minute, second=todo.due.second) + datetime.timedelta(days=todo.repeat_detail.get('days', 1))
            if todo.start:
                todo.start = new_due - (todo.due - todo.start)
            todo.due = new_due
        elif todo.start:
            todo.start = datetime.datetime.now().replace(hour=todo.start.hour, minute=todo.start.minute, second=todo.start.second) + datetime.timedelta(days=todo.repeat_detail.get('days', 1))
        else:
            raise ValueError("Repeating tasks with no due/start dates must repeat immediately.")
    elif todo.repeat_type_id == 3 or todo.repeat_type_id == 4:
        MAX_DAYS = 7 if todo.repeat_type_id == 3 else 31
        days = todo.repeat_detail.get('days')
        if not isinstance(days, list):
            raise ValueError("Invalid repeat information.")
        if len(days) < 1 or len(days) > MAX_DAYS:
            raise ValueError("Invalid repeat information.")
        if todo.due:
            cutoff = max(todo.due, end_of_day)
            for i in range(1, MAX_DAYS + 1):
                new_due = cutoff + datetime.timedelta(days=i)
                if new_due.weekday() in days:
                    if todo.start:
                        todo.start = new_due - (todo.due - todo.start)
                    todo.due = new_due
                    break
            else:
                raise ValueError("Invalid repeat information.")
        elif todo.start:
            cutoff = max(todo.start, end_of_day)
            for i in range(1, MAX_DAYS):
                new_start = cutoff + datetime.timedelta(days=i)
                if new_start.weekday() in days:
                    todo.start = new_start
                    break
            else:
                raise ValueError("Invalid repeat information.")
    elif todo.repeat_type_id == 5:
        month = todo.repeat_detail.get('month')
        day = todo.repeat_detail.get('day')
        if todo.due:
            cutoff = max(todo.due, end_of_day)
            for i in range(4):
                try:
                    new_due = cutoff.replace(year=cutoff.year + 1, month=month, day=day-i)
                    if todo.start:
                        todo.start = new_due - (todo.due - todo.start)
                    todo.due = new_due
                    break
                except ValueError:
                    # We tried to select February 29th, on a non-leap year.
                    # Try the previous day.
                    continue
        elif todo.start:
            cutoff = max(todo.start, end_of_day)
            for i in range(4):
                try:
                    todo.start = cutoff.replace(year=cutoff.year + 1, month=month, day=day-i)
                    break
                except ValueError:
                    # We tried to select February 29th, on a non-leap year.
                    # Try the previous day.
                    continue
        else:
            raise ValueError("Invalid repeat information.")
    else:
        raise ValueError("Unknown repeat type.")

@todobp.route('/todo/mark_complete/', methods=['POST'])
def mark_complete():
    with session_scope() as session:
        data = request.get_json()

        if data.get('id'):
            todo = session.query(db.Todo).get(data.get('id'))
            if not todo:
                abort(404)
        else:
            abort(400)

        try:
            if todo.status_id == 2:
                raise ValueError("Tried to complete an already-complete task.")

            todo.events.append(db.Event(
                event_type_id=1,
                details=json.dumps({'due' : todo.due.isoformat()}) if todo.due else None))

            if not todo.repeat_type:
                todo.status_id = 2
            else:
                update_due_date(todo)
        except ValueError:
            abort(400)

        session.flush()

        return jsonify({
            'status' : 'ok',
            'action' : 'replace',
            'object' : todo})


text:
using Screener.Portfolio.Model.Brokerage.CommisionTerms;

namespace Screener.Portfolio.Model.Trade
{
    public abstract class TradeStepBase
    {
        protected TradeStepBase(TradeBase parent, TradeActionRequest actionRequest, TradeCommision comission, TradeActionBalanceChange change)
        {
            _parent = parent;

            ActionRequest = actionRequest;
            Comission = comission;
            Change = change;
            Id = RuntimeIdRepository.Generate();
        }

        public int Id { get; }

        public TradeActionRequest ActionRequest { get; }
        public TradeCommision Comission { get; }
        public TradeActionBalanceChange Change { get; }

        private TradeBase _parent;

        public override string ToString()
        {
            return "Step. Id: " + Id + ". Type: " + ActionRequest.Volume.OrderType + ". Comission: " + Comission.Value.ToString() + ". Change: " + Change.Value.ToString();
        }
    }
}


text:
<!-- frame.html -->
<!DOCTYPE html>
<html>
 <head>
   <title>Evalbox's Frame</title>
   <script>
     window.addEventListener('message', function (e) {
       var mainWindow = e.source;
       var result = '';
       try {
         result = eval(e.data);
       } catch (e) {
         result = 'eval() threw an exception.';
       }
       mainWindow.postMessage(result, event.origin);
     });
   </script>
 </head>
</html>


text:
using namespace std;

class D3DFrameWork
{
public:
	void InitBase(HINSTANCE hInstance, string winCaption, D3DDEVTYPE devType, DWORD requestedVP);
	virtual ~D3DFrameWork();

	HINSTANCE					GetAppInst(void) { return m_hAppInst; }
	HWND						GetMainWnd(void) { return m_hMainWnd; }

	// Framework methods.  Derived client class overrides these methods to
	// implement specific application requirements.
	virtual bool				CheckDeviceCaps()		{ return true; }
	virtual void				OnLostDevice()			{}
	virtual void				OnResetDevice()			{}
	virtual void				UpdateFrame(float dt)		{}
	virtual void				RenderFrame()				{}

	void						TouchFullScreenMode(bool enable);
	bool						IsDeviceLost();

	static void					SetD3DFrameWork(D3DFrameWork* p) { m_pD3DFrameWork = p; }
	static D3DFrameWork*		GetD3DFrameWork(void) { return m_pD3DFrameWork; }
	static IDirect3DDevice9*	GetD3DDevice(void) { return m_pD3DDevice; }

	// Override these methods only if you do not like the default window creation,
	// direct3D device creation, window procedure, or message loop.  In general,
	// for the sample programs of this book, we will not need to modify these.
	virtual void				InitMainWindow();
	virtual void				InitDirect3D();
	virtual int					Run();
	virtual LRESULT				MsgProc(UINT msg, WPARAM wParam, LPARAM lParam);

protected:
	D3DFrameWork() {}
protected:
	// Derived client class can modify these data members in the constructor to
	// customize the application.
	string						m_sMainWndCaption;
	D3DDEVTYPE					m_eDevType;
	DWORD						m_dRequestedVP;

	int							m_iWidth;	//window width
	int							m_iHeight;	//window height
	// Application, Windows, and Direct3D data members.
	HINSTANCE					m_hAppInst;
	HWND						m_hMainWnd;
	IDirect3D9*					m_pD3D;
	bool						m_bAppPaused;
	D3DPRESENT_PARAMETERS		m_D3DPrams;

	static IDirect3DDevice9*	m_pD3DDevice;
	static D3DFrameWork*		m_pD3DFrameWork;

	string						m_sGPU;
	string						m_sCPU;
	unsigned int				m_uMem;
};


text:
#import "NSMutableOrderedSet.h"

@class NSManagedObject;

// Not exported
@interface _NSFaultingMutableOrderedSet : NSMutableOrderedSet
{
    int _cd_rc;
    struct _NSFaultingMutableOrderedSetFlags _flags;
    id _realSet;
    NSManagedObject *_source;
    unsigned int *_orderKeys;
    id _grottyHack;
}

+ (id)allocWithZone:(struct _NSZone *)arg1;
+ (id)alloc;
+ (_Bool)accessInstanceVariablesDirectly;
- (id)allObjects;
- (void)sortRange:(struct _NSRange)arg1 options:(unsigned long long)arg2 usingComparator:(id)arg3;
- (void)sortWithOptions:(unsigned long long)arg1 usingComparator:(id)arg2;
- (void)sortUsingComparator:(id)arg1;
- (void)unionSet:(id)arg1;
- (void)minusSet:(id)arg1;
- (void)unionOrderedSet:(id)arg1;
- (void)minusOrderedSet:(id)arg1;
- (void)removeObjectsInArray:(id)arg1;
- (void)removeAllObjects;
- (void)removeObjectsInRange:(struct _NSRange)arg1;
- (void)insertObjects:(id)arg1 atIndexes:(id)arg2;
- (void)insertObjects:(const id *)arg1 count:(unsigned long long)arg2 atIndex:(unsigned long long)arg3;
- (void)addObjectsFromArray:(id)arg1;
- (void)addObjects:(const id *)arg1 count:(unsigned long long)arg2;
- (void)addObject:(id)arg1;
- (_Bool)containsObject:(id)arg1;
- (_Bool)_isIdenticalFault:(id)arg1;
- (_Bool)isEqual:(id)arg1;
- (_Bool)isEqualToOrderedSet:(id)arg1;
- (Class)classForArchiver;
- (id)replacementObjectForCoder:(id)arg1;
- (Class)classForCoder;
- (id)valueForKeyPath:(id)arg1;
- (id)valueForKey:(id)arg1;
- (void)setValue:(id)arg1 forKey:(id)arg2;
- (void)replaceObjectAtIndex:(unsigned long long)arg1 withObject:(id)arg2;
- (void)removeObjectAtIndex:(unsigned long long)arg1;
- (void)getObjects:(id *)arg1;
- (void)getObjects:(id *)arg1 range:(struct _NSRange)arg2;
- (id)objectEnumerator;
- (id)indexesOfObjectsAtIndexes:(id)arg1 options:(unsigned long long)arg2 passingTest:(id)arg3;
- (id)indexesOfObjectsWithOptions:(unsigned long long)arg1 passingTest:(id)arg2;
- (unsigned long long)indexOfObjectAtIndexes:(id)arg1 options:(unsigned long long)arg2 passingTest:(id)arg3;
- (unsigned long long)indexOfObjectWithOptions:(unsigned long long)arg1 passingTest:(id)arg2;
- (void)enumerateObjectsAtIndexes:(id)arg1 options:(unsigned long long)arg2 usingBlock:(id)arg3;
- (void)enumerateObjectsWithOptions:(unsigned long long)arg1 usingBlock:(id)arg2;
- (unsigned long long)countByEnumeratingWithState:(CDStruct_70511ce9 *)arg1 objects:(id *)arg2 count:(unsigned long long)arg3;
- (void)insertObject:(id)arg1 atIndex:(unsigned long long)arg2;
- (unsigned long long)indexOfObject:(id)arg1;
- (id)objectAtIndex:(unsigned long long)arg1;
- (unsigned long long)count;
- (id)mutableCopyWithZone:(struct _NSZone *)arg1;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)relationship;
- (id)source;
- (void)turnIntoFault;
- (_Bool)_hasOrderKeys;
- (id)_newOrderKeys;
- (unsigned int)_orderKeyForObject:(id)arg1;
- (void)_batchFulfillOrderKeysForObjectsIntoIndexes:(unsigned long long **)arg1;
- (void)_populateOrderKeysUsingSnapshot:(id)arg1 orderKeys:(id)arg2 newIndexes:(unsigned long long **)arg3 reorderedIndexes:(char **)arg4;
- (void)_updateOrderKeysFromOrderOfObjectIDs:(id)arg1;
- (void)_assignOrderKeysUsingCount:(unsigned int)arg1;
- (void)_setProcessingIdempotentKVO:(_Bool)arg1;
- (_Bool)_shouldProcessKVOChange;
- (void)willChange;
- (void)willRead;
- (id)descriptionWithLocale:(id)arg1;
- (id)description;
- (_Bool)isFault;
- (void)dealloc;
- (_Bool)_isDeallocating;
- (_Bool)_tryRetain;
- (unsigned long long)retainCount;
- (oneway void)release;
- (id)retain;
- (id)initWithSource:(id)arg1 destinations:(id)arg2 forRelationship:(id)arg3 inContext:(id)arg4;
- (id)initWithSource:(id)arg1 forRelationship:(id)arg2 asFault:(_Bool)arg3;
- (id)initWithOrderedSet:(id)arg1;

@end


text:
<img src="https://raw.githubusercontent.com/fahlout/Resources/master/FilterView/FilterViewHeader2.png" alt="FilterViewHeader">
========

## Description ##

This library is designed to let you easily present a controller for the user to select filters based on an array of objects and the given properties to be filtered on.

## Installation

**CocoaPods**

Coming soon.

**Carthage**

Coming soon.

**Manual Installation**

The class files required for FilterView are located in the Classes folder in the root of this repository as listed below:

* *.swift

## How to use PageMenu

Coming soon.

## Customization

Coming soon.

## Apps using FilterView

Please let me know if your app in the AppStore uses this library so I can add your app to the list of apps featuring FilterView.

## Credits

[Niklas Fahl (fahlout)](http://bit.ly/fahlout) - iOS Developer ([LinkedIn](http://bit.ly/linked-in-niklas-fahl))

## License ##

The MIT License (MIT)

Copyright (c) 2016 Niklas Fahl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


text:
<?php

declare(strict_types=1);

namespace Sylius\Component\Core\Payment;

use Sylius\Component\Order\Model\OrderInterface;
use Sylius\Component\Payment\Model\PaymentInterface;

final class RandomInvoiceNumberGenerator implements InvoiceNumberGeneratorInterface
{
    /**
     * {@inheritdoc}
     */
    public function generate(OrderInterface $order, PaymentInterface $payment): string
    {
        return random_int(1, 100000) . '-' . random_int(1, 100000);
    }
}


text:
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/io.h>

#include "bttvp.h"

EXPORT_SYMBOL(bttv_get_pcidev);
EXPORT_SYMBOL(bttv_gpio_enable);
EXPORT_SYMBOL(bttv_read_gpio);
EXPORT_SYMBOL(bttv_write_gpio);

/* ----------------------------------------------------------------------- */
/* Exported functions - for other modules which want to access the         */
/*                      gpio ports (IR for example)                        */
/*                      see bttv.h for comments                            */

struct pci_dev* bttv_get_pcidev(unsigned int card)
{
	if (card >= bttv_num)
		return NULL;
	return bttvs[card].c.pci;
}

int bttv_gpio_enable(unsigned int card, unsigned long mask, unsigned long data)
{
	struct bttv *btv;

	if (card >= bttv_num) {
		return -EINVAL;
	}

	btv = &bttvs[card];
	gpio_inout(mask,data);
	if (bttv_gpio)
		bttv_gpio_tracking(btv,"extern enable");
	return 0;
}

int bttv_read_gpio(unsigned int card, unsigned long *data)
{
	struct bttv *btv;

	if (card >= bttv_num) {
		return -EINVAL;
	}

	btv = &bttvs[card];

	if(btv->shutdown) {
		return -ENODEV;
	}

/* prior setting BT848_GPIO_REG_INP is (probably) not needed
   because we set direct input on init */
	*data = gpio_read();
	return 0;
}

int bttv_write_gpio(unsigned int card, unsigned long mask, unsigned long data)
{
	struct bttv *btv;

	if (card >= bttv_num) {
		return -EINVAL;
	}

	btv = &bttvs[card];

/* prior setting BT848_GPIO_REG_INP is (probably) not needed
   because direct input is set on init */
	gpio_bits(mask,data);
	if (bttv_gpio)
		bttv_gpio_tracking(btv,"extern write");
	return 0;
}

/*
 * Local variables:
 * c-basic-offset: 8
 * End:
 */


text:
external help file: Microsoft.Azure.Commands.ServiceBus.dll-Help.xml
online version:
schema: 2.0.0
---

# Remove-AzureRmServiceBusAuthorizationRule

## SYNOPSIS
Removes the authorization rule of a Service Bus namespace or queue or topic from the specified resource group.

## SYNTAX

### NamespaceAuthorizationRuleSet (Default)
```
Remove-AzureRmServiceBusAuthorizationRule [-ResourceGroupName] <String> [-Namespace] <String> [-Name] <String>
 [-Force] [-PassThru] [-WhatIf] [-Confirm]
```

### QueueAuthorizationRuleSet
```
Remove-AzureRmServiceBusAuthorizationRule [-ResourceGroupName] <String> [[-Namespace] <String>]
 [-Queue] <String> [-Name] <String> [-Force] [-PassThru] [-WhatIf] [-Confirm]
```

### TopicAuthorizationRuleSet
```
Remove-AzureRmServiceBusAuthorizationRule [-ResourceGroupName] <String> [[-Namespace] <String>]
 [-Topic] <String> [-Name] <String> [-Force] [-PassThru] [-WhatIf] [-Confirm]
```

## DESCRIPTION
The **Remove-AzureRmServiceBusAuthorizationRule** cmdlet removes the authorization rule of a Service Bus namespace or queue or topic for the specified resource group.

## EXAMPLES

### Example 1
```
PS C:\> Remove-AzureRmServiceBusAuthorizationRule -ResourceGroup Default-ServiceBus-WestUS -Namespace SB-Example1 -Name AuthoRule1
```
Removes the authorization rule `SBAuthoRule1` of namespace `SB-Example1` from the specified resource group.

### Example 2
```
PS C:\> Remove-AzureRmServiceBusAuthorizationRule -ResourceGroup Default-ServiceBus-WestUS -Namespace SB-Example1 -Queue SBQueue -Name AuthoRule1
```
Removes the authorization rule `SBAuthoRule1` of queue `SBQueue` from the specified resource group.

### Example 3
```
PS C:\> Remove-AzureRmServiceBusAuthorizationRule -ResourceGroup Default-ServiceBus-WestUS -Namespace SB-Example1 -Topic SBTopic -Name AuthoRule1
```
Removes the authorization rule `SBAuthoRule1` of topic `SBTopic` from the specified resource group.

## PARAMETERS

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Force
Do not ask for confirmation.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name
AuthorizationRule Name.

```yaml
Type: String
Parameter Sets: (All)
Aliases: AuthorizationRuleName

Required: True
Position: 3
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Namespace
Namespace Name.

```yaml
Type: String
Parameter Sets: NamespaceAuthorizationRuleSet
Aliases: NamespaceName

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

```yaml
Type: String
Parameter Sets: QueueAuthorizationRuleSet, TopicAuthorizationRuleSet
Aliases: NamespaceName

Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -PassThru
{{Fill PassThru Description}}

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Queue
Queue Name.

```yaml
Type: String
Parameter Sets: QueueAuthorizationRuleSet
Aliases: QueueName

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -ResourceGroupName
Resource Group Name.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -Topic
Topic Name.

```yaml
Type: String
Parameter Sets: TopicAuthorizationRuleSet
Aliases: TopicName

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

## INPUTS

### System.String

## OUTPUTS

### System.Boolean

## NOTES

## RELATED LINKS


text:
import copy
import heapq
import math
import operator
import numpy as np
import scipy
from matplotlib.patches import FancyArrowPatch
from mpl_toolkits.mplot3d import proj3d

class Arrow3D(FancyArrowPatch):
    def __init__(self, xs, ys, zs, *args, **kwargs):
        FancyArrowPatch.__init__(self, (0, 0), (0, 0), *args, **kwargs)
        self._verts3d = xs, ys, zs

    def draw(self, renderer):
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
        FancyArrowPatch.draw(self, renderer)

def kernel_linear(x, y):
    return scipy.dot(x, y)

def kernel_poly(x, y, a=1.0, b=1.0, p=2.0):
    return (a * scipy.dot(x, y) + b) ** p

#bigger sigma closer to Euclidian
def kernel_gauss(x, y, sigma= 0.1):
    v = x - y
    l = math.sqrt(scipy.square(v).sum())
    return math.exp(-sigma * (l ** 2))

def kernel_normalise(k):
    return lambda x, y: k(x, y) / math.sqrt(k(x, x) + k(y, y))

def kernel_dist(x, y):
    # if gaussian kernel:
    return 2 - 2 * kernel(x, y)
    # if not
    # return kernel(x,x)-2*kernel(x,y)+kernel(y,y)

kernel = kernel_normalise(kernel_gauss)

# the time past which you cannot add an instance to the cluster
deltaT = 5 #bigger number bigger clusters, tends to combine small clusters with big ones

# if the cluster is older than memoryDelta, then remove it from the currentClusters and put it in the allClsuters list
memoryDelta = deltaT + 1  #bigger number smaler clusters, lots of empty space... only sure clusters

#the number of current clusters... pool of clusters
num_clusterss = 3 #bigger number scattered clusters, lots of empty space... if you increase this, also increase the memory parameters
threshold_cluster_size = 10

class OnlineVariance(object):
    """
    Welford's algorithm computes the sample variance incrementally.
    """

    def __init__(self, iterable=None, ddof=1):
        self.ddof, self.n, self.mean, self.M2, self.std = ddof, 0, 0.0, 0.0, 0.0

    def std_calc(self, datum):
        self.n += 1
        self.delta = datum - self.mean
        self.mean += self.delta / self.n
        self.M2 += self.delta * (datum - self.mean)
        self.variance = self.M2 / (self.n - self.ddof)
        self.std = np.sqrt(self.variance)

    def merge_std(self, new):
        n_mean = (self.n * self.mean + new.n * new.mean) / (self.n + new.n)
        self.variance = (self.n * self.std * self.std + new.n * new.std * new.std + self.n * (self.mean - n_mean) * (
        self.mean - n_mean) + new.n * (new.mean - n_mean) * (new.mean - n_mean)) / (self.n + new.n)
        self.std = np.sqrt(self.variance)
        self.M2 = self.variance * (self.n + new.n - self.ddof)
        self.n += new.n
        self.mean = n_mean

class Cluster(object):
    def __init__(self, a, timestamp):
        self.center = a
        self.size = kernel(a, a)
        self.timestampEnd = timestamp
        self.timestampStart = timestamp
        self.firstPoint = a
        self.endPoint = a
        self.num_points = 1
        self.STD = OnlineVariance(ddof=0)
        self.STD.std_calc(kernel(a, a))

    def add(self, e, timestampNew):
        self.size += kernel(self.center, e)
        self.center += (e - self.center) / self.size
        self.timestampEnd = timestampNew
        self.endPoint = e
        self.num_points += 1
        self.STD.std_calc(kernel(self.center, e))

    def merge(self, c):
        self.center = (self.center * self.size + c.center * c.size) / (self.size + c.size)
        self.size += c.size
        self.num_points += c.num_points
        self.num_points -= 1
        self.STD.merge_std(c.STD)

        if self.timestampEnd < c.timestampEnd:
            self.timestampEnd = c.timestampEnd
            self.endPoint = c.endPoint

        if self.timestampStart > c.timestampStart:
            self.timestampStart = c.timestampStart
            self.firstPoint = c.firstPoint

    def resize(self, dim):
        extra = scipy.zeros(dim - len(self.center))
        self.center = scipy.append(self.center, extra)

    def __str__(self):
        return "Cluster( %s, %f, %f , %f )" % (self.center, self.size, self.timestampStart, self.timestampEnd)

class Dist(object):
    """this is just a tuple,
    but we need an object so we can define cmp for heapq"""

    def __init__(self, x, y, d):
        self.x = x
        self.y = y
        self.d = d

    def __cmp__(self, o):
        return cmp(self.d, o.d)

    def __str__(self):
        return "Dist(%f)" % (self.d)

p = 0
class OnlineCluster(object):
    def __init__(self, N):
        """N-1 is the largest number of clusters I can find Higher N makes me slower"""
        self.n = 0
        self.N = N
        self.allClusters = []
        self.currentClusters = []
        # max number of dimensions we've seen so far
        self.dim = 0

        # cache inter-cluster distances
        self.dist = []

    def resize(self, dim):
        for c in self.currentClusters:
            c.resize(dim)
        self.dim = dim

    def cluster(self, e, timestamp):
        #check if there are old clusters and move them to memory
        possibleMerge = []
        for clusterI in self.currentClusters:
            # if the cluster is older than memoryDelta, then remove it from the currentClusters and put it in the allClsuters list
            if timestamp - clusterI.timestampEnd >= memoryDelta:
                self.currentClusters.remove(clusterI)
                self.removedist(clusterI)

                #merging clusters... TODO
                if len(self.allClusters) > 0:
                    min_distance = kernel(clusterI.center, self.allClusters[-1].center)
                    closest_cluster = copy.deepcopy(self.allClusters[-1])
                    for clusterR in reversed(self.allClusters):
                        if clusterI.timestampEnd - clusterR.timestampEnd < memoryDelta:
                            possibleMerge.append (clusterR)
                            distance = kernel(clusterI.center, clusterR.center)
                            if min_distance > distance:
                                min_distance = distance
                                closest_cluster = clusterR
                        else:
                            break

                    if (abs(min_distance-closest_cluster.STD.mean) < p*closest_cluster.STD.std) or (abs(min_distance-clusterI.STD.mean) < p*clusterI.STD.std):
                        for i in reversed(self.allClusters):
                            if i.STD.std == closest_cluster.STD.std:
                                self.allClusters.remove(i)
                                break
                        closest_cluster.merge(clusterI)
                        self.allClusters.append(closest_cluster)
                    else:
                        self.allClusters.append(clusterI)
                else:
                    self.allClusters.append(clusterI)

        if len(e) > self.dim:
            self.resize(len(e))

        if len(self.currentClusters) > 0:
            # compare new points to each existing cluster
            c = [(i, kernel_dist(x.center, e)) for i, x in enumerate(self.currentClusters)]
            closest = self.currentClusters[min(c, key=operator.itemgetter(1))[0]]
            #if the point is older than deltaT, do not add it
            if (timestamp - closest.timestampEnd) < deltaT:
                closest.add(e, timestamp)
                # invalidate dist-cache for this cluster
                self.updatedist(closest)
            else:
                aaa = 5

        if len(self.currentClusters) >= self.N and len(self.currentClusters) > 1:
            # merge closest two clusters
            m = heapq.heappop(self.dist)
            try:
                self.currentClusters.remove(m.y)
                self.removedist(m.y)
                m.x.merge(m.y)
                self.updatedist(m.x)
            except:
                print m.y

        # make a new cluster for this point
        newc = Cluster(e, timestamp)
        self.currentClusters.append(newc)
        self.updatedist(newc)
        self.n += 1

    def removedist(self, c):
        """invalidate intercluster distance cache for c"""
        r = []
        for x in self.dist:
            if x.x == c or x.y == c:
                r.append(x)
        for x in r: self.dist.remove(x)
        heapq.heapify(self.dist)

    def updatedist(self, c):
        """Cluster c has changed, re-compute all intercluster distances"""
        self.removedist(c)

        for x in self.currentClusters:
            if x == c: continue
            d = kernel_dist(x.center, c.center)
            t = Dist(x, c, d)
            heapq.heappush(self.dist, t)

    def trimclusters(self):
        """Return only clusters over threshold"""
        clusters = self.allClusters + self.currentClusters
        #t = scipy.mean([x.size for x in filter(lambda x: x.size > 0, clusters)]) * 0.5
        t = threshold_cluster_size
        #print "Threshold: " + str(t)

        return filter(lambda x: x.num_points >= t, clusters)
        #return filter(lambda x: x.num_points >= t and x.num_points / x.size < 0.73, clusters)

activity_means = [[3.0, 5.0], [7.0, 7.0], [5.0, 5.0]]


text:
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# include/Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

pkgdatadir = $(datadir)/libevent
pkgincludedir = $(includedir)/libevent
pkglibdir = $(libdir)/libevent
pkglibexecdir = $(libexecdir)/libevent
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-unknown-linux-gnu
host_triplet = x86_64-unknown-linux-gnu
subdir = include
DIST_COMMON = $(am__nobase_include_HEADERS_DIST) \
	$(am__noinst_HEADERS_DIST) $(srcdir)/Makefile.am \
	$(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
	$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__nobase_include_HEADERS_DIST = event2/buffer.h \
	event2/buffer_compat.h event2/bufferevent.h \
	event2/bufferevent_compat.h event2/bufferevent_ssl.h \
	event2/bufferevent_struct.h event2/dns.h event2/dns_compat.h \
	event2/dns_struct.h event2/event.h event2/event_compat.h \
	event2/event_struct.h event2/http.h event2/http_compat.h \
	event2/http_struct.h event2/keyvalq_struct.h event2/listener.h \
	event2/rpc.h event2/rpc_compat.h event2/rpc_struct.h \
	event2/tag.h event2/tag_compat.h event2/thread.h event2/util.h
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    *) f=$$p;; \
  esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
  for p in $$list; do echo "$$p $$p"; done | \
  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
    if (++n[$$2] == $(am__install_max)) \
      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
    END { for (dir in files) print dir, files[dir] }'
am__base_list = \
  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"
am__noinst_HEADERS_DIST = event2/buffer.h event2/buffer_compat.h \
	event2/bufferevent.h event2/bufferevent_compat.h \
	event2/bufferevent_ssl.h event2/bufferevent_struct.h \
	event2/dns.h event2/dns_compat.h event2/dns_struct.h \
	event2/event.h event2/event_compat.h event2/event_struct.h \
	event2/http.h event2/http_compat.h event2/http_struct.h \
	event2/keyvalq_struct.h event2/listener.h event2/rpc.h \
	event2/rpc_compat.h event2/rpc_struct.h event2/tag.h \
	event2/tag_compat.h event2/thread.h event2/util.h
HEADERS = $(nobase_include_HEADERS) $(nobase_nodist_include_HEADERS) \
	$(nodist_noinst_HEADERS) $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run aclocal-1.11
AMTAR = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run tar
AR = ar
AUTOCONF = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run autoconf
AUTOHEADER = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run autoheader
AUTOMAKE = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2 -Wall -fno-strict-aliasing
CPP = gcc -E
CPPFLAGS =
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = false
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /bin/grep -E
EV_LIB_GDI =
EV_LIB_WS32 =
EXEEXT =
FGREP = /bin/grep -F
GREP = /bin/grep
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/ld -m elf_x86_64
LDFLAGS =
LIBEVENT_GC_SECTIONS =
LIBOBJS =
LIBS = -lrt
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBTOOL_DEPS = ./ltmain.sh
LIPO =
LN_S = cp -p
LTLIBOBJS =
MAKEINFO = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/missing --run makeinfo
MANIFEST_TOOL = :
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OPENSSL_LIBS = -lssl  -lcrypto
OTOOL =
OTOOL64 =
PACKAGE = libevent
PACKAGE_BUGREPORT =
PACKAGE_NAME =
PACKAGE_STRING =
PACKAGE_TARNAME =
PACKAGE_URL =
PACKAGE_VERSION =
PATH_SEPARATOR = :
PTHREAD_CC = gcc
PTHREAD_CFLAGS =
PTHREAD_LIBS =
RANLIB = ranlib
SED = /bin/sed
SET_MAKE =
SHELL = /bin/bash
STRIP = strip
VERSION = 2.0.15-stable
ZLIB_LIBS = -lz
abs_builddir = /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/include
abs_srcdir = /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/include
abs_top_builddir = /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15
abs_top_srcdir = /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_DUMPBIN =
acx_pthread_config =
am__include = include
am__leading_dot = .
am__quote =
am__tar = ${AMTAR} chof - "$$tardir"
am__untar = ${AMTAR} xf -
bindir = ${exec_prefix}/bin
build = x86_64-unknown-linux-gnu
build_alias =
build_cpu = x86_64
build_os = linux-gnu
build_vendor = unknown
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = x86_64-unknown-linux-gnu
host_alias =
host_cpu = x86_64
host_os = linux-gnu
host_vendor = unknown
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /mnt/hgfs/VMShare/redis/redis-2.4.2-plus/deps/libevent-2.0.15/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias =
top_build_prefix = ../
top_builddir = ..
top_srcdir = ..
AUTOMAKE_OPTIONS = foreign
EVENT2_EXPORT = \
	event2/buffer.h \
	event2/buffer_compat.h \
	event2/bufferevent.h \
	event2/bufferevent_compat.h \
	event2/bufferevent_ssl.h \
	event2/bufferevent_struct.h \
	event2/dns.h \
	event2/dns_compat.h \
	event2/dns_struct.h \
	event2/event.h \
	event2/event_compat.h \
	event2/event_struct.h \
	event2/http.h \
	event2/http_compat.h \
	event2/http_struct.h \
	event2/keyvalq_struct.h \
	event2/listener.h \
	event2/rpc.h \
	event2/rpc_compat.h \
	event2/rpc_struct.h \
	event2/tag.h \
	event2/tag_compat.h \
	event2/thread.h \
	event2/util.h

EXTRA_SRC = $(EVENT2_EXPORT)
nobase_include_HEADERS = $(EVENT2_EXPORT)
nobase_nodist_include_HEADERS = ./event2/event-config.h
#noinst_HEADERS = $(EVENT2_EXPORT)
#nodist_noinst_HEADERS = ./event2/event-config.h
all: all-am

.SUFFIXES:
$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
	@for dep in $?; do \
	  case '$(am__configure_deps)' in \
	    *$$dep*) \
	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
	        && { if test -f $@; then exit 0; else break; fi; }; \
	      exit 1;; \
	  esac; \
	done; \
	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
	$(am__cd) $(top_srcdir) && \
	  $(AUTOMAKE) --foreign include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
	esac;

$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh

$(top_srcdir)/configure:  $(am__configure_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):

mostlyclean-libtool:
	-rm -f *.lo

clean-libtool:
	-rm -rf .libs _libs
install-nobase_includeHEADERS: $(nobase_include_HEADERS)
	@$(NORMAL_INSTALL)
	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
	@list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
	$(am__nobase_list) | while read dir files; do \
	  xfiles=; for file in $$files; do \
	    if test -f "$$file"; then xfiles="$$xfiles $$file"; \
	    else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
	  test -z "$$xfiles" || { \
	    test "x$$dir" = x. || { \
	      echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \
	      $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \
	    echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \
	    $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \
	done

uninstall-nobase_includeHEADERS:
	@$(NORMAL_UNINSTALL)
	@list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \
	$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
	test -n "$$files" || exit 0; \
	echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
	cd "$(DESTDIR)$(includedir)" && rm -f $$files
install-nobase_nodist_includeHEADERS: $(nobase_nodist_include_HEADERS)
	@$(NORMAL_INSTALL)
	test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)"
	@list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
	$(am__nobase_list) | while read dir files; do \
	  xfiles=; for file in $$files; do \
	    if test -f "$$file"; then xfiles="$$xfiles $$file"; \
	    else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
	  test -z "$$xfiles" || { \
	    test "x$$dir" = x. || { \
	      echo "$(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \
	      $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \
	    echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \
	    $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \
	done

uninstall-nobase_nodist_includeHEADERS:
	@$(NORMAL_UNINSTALL)
	@list='$(nobase_nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \
	$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
	test -n "$$files" || exit 0; \
	echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \
	cd "$(DESTDIR)$(includedir)" && rm -f $$files

ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	mkid -fID $$unique
tags: TAGS

TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	set x; \
	here=`pwd`; \
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: CTAGS
CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
		$(TAGS_FILES) $(LISP)
	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
	unique=`for i in $$list; do \
	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
	  done | \
	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
	      END { if (nonempty) { for (i in files) print i; }; }'`; \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags

distdir: $(DISTFILES)
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
check-am: all-am
check: check-am
all-am: Makefile $(HEADERS)
installdirs:
	for dir in "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \
	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
	done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-am
install-strip:
	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	  `test -z '$(STRIP)' || \
	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
clean: clean-am

clean-am: clean-generic clean-libtool mostlyclean-am

distclean: distclean-am
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags

dvi: dvi-am

dvi-am:

html: html-am

html-am:

info: info-am

info-am:

install-data-am: install-nobase_includeHEADERS \
	install-nobase_nodist_includeHEADERS

install-dvi: install-dvi-am

install-dvi-am:

install-exec-am:

install-html: install-html-am

install-html-am:

install-info: install-info-am

install-info-am:

install-man:

install-pdf: install-pdf-am

install-pdf-am:

install-ps: install-ps-am

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-am
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

mostlyclean: mostlyclean-am

mostlyclean-am: mostlyclean-generic mostlyclean-libtool

pdf: pdf-am

pdf-am:

ps: ps-am

ps-am:

uninstall-am: uninstall-nobase_includeHEADERS \
	uninstall-nobase_nodist_includeHEADERS

.MAKE: install-am install-strip

.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
	clean-libtool ctags distclean distclean-generic \
	distclean-libtool distclean-tags distdir dvi dvi-am html \
	html-am info info-am install install-am install-data \
	install-data-am install-dvi install-dvi-am install-exec \
	install-exec-am install-html install-html-am install-info \
	install-info-am install-man install-nobase_includeHEADERS \
	install-nobase_nodist_includeHEADERS install-pdf \
	install-pdf-am install-ps install-ps-am install-strip \
	installcheck installcheck-am installdirs maintainer-clean \
	maintainer-clean-generic mostlyclean mostlyclean-generic \
	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
	uninstall-am uninstall-nobase_includeHEADERS \
	uninstall-nobase_nodist_includeHEADERS

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
/**
 * String.prototype.concat([,[...]])
 *
 * @path ch15/15.5/15.5.4/15.5.4.6/S15.5.4.6_A1_T2.js
 * @description Arguments are equation with false and true, and instance is Boolean object
 */

var __instance = new Boolean;

__instance.concat = String.prototype.concat;

//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__instance.concat("\u0041",true,true+1) !== "falseAtrue2") {
  $ERROR('#1: __instance = new Boolean; __instance.concat = String.prototype.concat;  __instance.concat("\\u0041",true,true+1) === "falseAtrue2". Actual: '+__instance.concat("\u0041",true,true+1) );
}
//
//////////////////////////////////////////////////////////////////////////////


text:
<?php
// $Header: /cvsroot/html2ps/box.block.php,v 1.35 2005/10/13 03:47:07 Konstantin Exp $

class BlockBoxPDF extends GenericContainerBoxPDF {
  function &create(&$viewport, &$root) {
    $box = new BlockBoxPDF($viewport);
    $box->create_content($viewport, $root);
    return $box;
  }

  function &create_from_text(&$viewport, $content) {
    $box = new BlockBoxPDF($viewport);
    $box->add_child(InlineBoxPDF::create_from_text($viewport, $content));
    return $box;
  }

  function BlockBoxPDF($pdf) {
    // Call parent constructor
    $this->GenericContainerBoxPDF();

    $this->_current_x = 0;
    $this->_current_y = 0;
  }

  function _get_hor_extra() {
    return GenericBoxPDF::_get_hor_extra();
  }

  // Flow-control

  function reflow(&$parent, &$context) {
    switch ($this->position) {
    case POSITION_STATIC:
      return $this->reflow_static($parent, $context);
    case POSITION_RELATIVE:
      // CSS 2.1:
      // Once a box has been laid out according to the normal flow or floated, it may be shifted relative
      // to this position. This is called relative positioning. Offsetting a box (B1) in this way has no
      // effect on the box (B2) that follows: B2 is given a position as if B1 were not offset and B2 is
      // not re-positioned after B1's offset is applied. This implies that relative positioning may cause boxes
      // to overlap. However, if relative positioning causes an 'overflow:auto' box to have overflow, the UA must
      // allow the user to access this content, which, through the creation of scrollbars, may affect layout.

      $this->reflow_static($parent, $context);

      // Note that percentage positioning values are ignored for relative positioning

      // Check if 'top' value is percentage
      if ($this->top[1]) {
        $top = 0;
      } else {
        $top = $this->top[0];
      }

      $this->offset($this->left,-$top);
      return;

    case POSITION_ABSOLUTE:
      return $context->add_absolute_positioned($this);
    case POSITION_FIXED:
      return $context->add_fixed_positioned($this);
    }
  }

  function reflow_absolute(&$context) {
    GenericBoxPDF::reflow($this->parent, $context);

    // Calculate actual box position relative to the containing block
    $containing_block = $this->_get_containing_block();

    $this->put_left($this->left + $containing_block['left']);

    // TODO: percentage values of 'top'
    $this->_top  = $containing_block['top'] - $this->top[0] - $this->get_extra_top();

    // As sometimes left/right values may not be set, we need to use the "fit" width here
    // if no width constraints been set, it will not be modified by the code below
    //
    $this->put_full_width($this->get_max_width($context));

    // Update the width, as it should be calculated based upon containing block width, not real parent
    //
    $this->put_full_width($this->_width_constraint->apply($this->get_width(),
                                                          $containing_block['right'] - $containing_block['left']));

    // And remove any width constraint after this, as they could refer to parent widths
    $this->put_width_constraint(new WCNone());

    // Reflow contents
    $this->reflow_content($context);
  }

  function reflow_fixed(&$context) {
    GenericBoxPDF::reflow($this->parent, $context);

    $this->put_left(0);
    $this->put_top(0);

    // As sometimes left/right values may not be set, we need to use the "fit" width here
    // if no width constraints been set, it will not be modified by the code below
    //
    $this->put_full_width($this->get_max_width($context));

    // Update the width, as it should be calculated based upon containing block width, not real parent
    //
    $this->put_full_width($this->_width_constraint->apply($this->get_width(), $this->get_width()));

    // And remove any width constraint after this, as they could refer to parent widths
    $this->put_width_constraint(new WCNone());

    // Reflow contents
    $this->reflow_content($context);
  }

  function reflow_static(&$parent, &$context) {
    if ($this->float === FLOAT_NONE) {
      $this->reflow_static_normal($parent, $context);
    } else {
      $this->reflow_static_float($parent, $context);
    }
  }

  function reflow_static_normal(&$parent, &$context) {
    GenericBoxPDF::reflow($parent, $context);

    if ($parent) {
      // By default, child block box will fill all available parent width;
      // note that actual width will be smaller because of non-zero padding, border and margins
      $this->put_full_width($parent->get_width());

      // Calculate margin values if they have been set as a percentage
      $this->_calc_percentage_margins($parent);
      // Calculate width value if it had been set as a percentage
      $this->_calc_percentage_width($parent, $context);

      // Calculate 'auto' values of width and margins
      // Unlike tables, DIV width is either constrained by some CSS rules or
      // expanded to the parent width; thus, we can calculate 'auto' margin
      // values immediately
      $this->_calc_auto_width_margins($parent);

      $y = $this->collapse_margin($parent, $context);

      // At this moment we have top parent/child collapsed margin at the top of context object
      // margin stack

      // Apply 'clear' property
      $y = $this->apply_clear($y, $context);

      // Store calculated Y coordinate as current Y in the parent box
      $parent->_current_y = $y;
      // Terminate current parent line-box
      $parent->close_line($context);
      // And add current box to the parent's line-box (alone)
      $parent->append_line($this);

      // Note that top margin already used above during margin collapsing
      $this->moveto( $parent->get_left() + $this->get_extra_left(),
                     $parent->_current_y - $this->border->top->get_width()  - $this->padding->top->value );
    }

//     print("IN:".count($context->collapsed_margins)."
");
//     print($context->get_collapsed_margin()."
");

    // Reflow contents
    $this->reflow_content($context);

//     print("OUT:".count($context->collapsed_margins)."
");
//     print($context->get_collapsed_margin()."
");

    // After reflow_content we should have the top stack value replaced by the value
    // of last child bottom collapsed margin; if no children contained, then this value should be reset to 0
    if ($this->get_first() === null) {
      $cm = 0;
    } else {
      $cm = $context->get_collapsed_margin();
    };

    // Update the value, collapsing this with current box bottom margin

    $context->pop_collapsed_margin();

    $context->pop_collapsed_margin();
    $context->push_collapsed_margin( max($cm, $this->margin->bottom->value) );
    // $context->push_collapsed_margin( $this->margin->bottom->value );

    if ($parent) {
      // Extend parent's height to fit current box
      if ($parent->uid == $context->container_uid()) {
        $parent->extend_height($this->get_bottom_margin());
      } else {
        $parent->extend_height($this->get_bottom_border());
      }

      // Terminate parent's line box
      $parent->close_line($context);

      // Then shift current flow position to the current box margin edge
      // UNLESS parent is a table cell; in this case margin->bottom have been reset
      // to 0 at the beginning of this function
      $parent->_current_y = $this->get_bottom_border() - $context->get_collapsed_margin();
    };

    $this->check_page_break_after($parent, $context);
  }

  function show_fixed(&$viewport) {
    $this->moveto($viewport->left + $this->left,
                  $viewport->bottom + $viewport->height + $viewport->offset - $this->top[0]);

    // draw generic box
    GenericContainerBoxPDF::show($viewport);
  }

  function to_ps(&$psdata) {
    $psdata->write("box-block-create\n");
    $this->to_ps_common($psdata);
    $this->to_ps_css($psdata);
    $this->to_ps_content($psdata);
    $psdata->write("add-child\n");
  }
}
?>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="140dp"
    android:background="@drawable/marker2" >

    <TextView
        android:id="@+id/markerContent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="7dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:text=""
        android:textSize="12dp"
        android:textColor="@android:color/white"
        android:ellipsize="end"
        android:maxLines="1"
        android:textAppearance="?android:attr/textAppearanceSmall" />

    <ImageView
        android:id="@+id/markerImage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/markerContent"
        android:layout_alignParentRight="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true" />

</RelativeLayout>