text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorNode3DGizmo" inherits="Node3DGizmo" version="4.0">
	<brief_description>
		Gizmo for editing Node3D objects.
	</brief_description>
	<description>
		Gizmo that is used for providing custom visualization and editing (handles and subgizmos) for Node3D objects. Can be overridden to create custom gizmos, but for simple gizmos creating a [EditorNode3DGizmoPlugin] is usually recommended.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="_commit_handle" qualifiers="virtual">
			<return type="void" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="secondary" type="bool" />
			<argument index="2" name="restore" type="Variant" />
			<argument index="3" name="cancel" type="bool" />
			<description>
				Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo".
				If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action.
				The [code]secondary[/code] argument is [code]true[/code] when the committed handle is secondary (see [method add_handles] for more information).
			</description>
		</method>
		<method name="_commit_subgizmos" qualifiers="virtual">
			<return type="void" />
			<argument index="0" name="ids" type="PackedInt32Array" />
			<argument index="1" name="restores" type="Transform3D[]" />
			<argument index="2" name="cancel" type="bool" />
			<description>
				Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo".
				If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action.
			</description>
		</method>
		<method name="_get_handle_name" qualifiers="virtual const">
			<return type="String" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="secondary" type="bool" />
			<description>
				Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]). Handles can be named for reference to the user when editing.
				The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
			</description>
		</method>
		<method name="_get_handle_value" qualifiers="virtual const">
			<return type="Variant" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="secondary" type="bool" />
			<description>
				Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle].
				The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
			</description>
		</method>
		<method name="_get_subgizmo_transform" qualifiers="virtual const">
			<return type="Transform3D" />
			<argument index="0" name="id" type="int" />
			<description>
				Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_subgizmos].
			</description>
		</method>
		<method name="_is_handle_highlighted" qualifiers="virtual const">
			<return type="bool" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="secondary" type="bool" />
			<description>
				Override this method to return [code]true[/code] whenever the given handle should be highlighted in the editor.
				The [code]secondary[/code] argument is [code]true[/code] when the requested handle is secondary (see [method add_handles] for more information).
			</description>
		</method>
		<method name="_redraw" qualifiers="virtual">
			<return type="void" />
			<description>
				Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call [method clear] at the beginning of this method and then add visual elements depending on the node's properties.
			</description>
		</method>
		<method name="_set_handle" qualifiers="virtual">
			<return type="void" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="secondary" type="bool" />
			<argument index="2" name="camera" type="Camera3D" />
			<argument index="3" name="point" type="Vector2" />
			<description>
				Override this method to update the node properties when the user drags a gizmo handle (previously added with [method add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts.
				The [code]secondary[/code] argument is [code]true[/code] when the edited handle is secondary (see [method add_handles] for more information).
			</description>
		</method>
		<method name="_set_subgizmo_transform" qualifiers="virtual">
			<return type="void" />
			<argument index="0" name="id" type="int" />
			<argument index="1" name="transform" type="Transform3D" />
			<description>
				Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system.
			</description>
		</method>
		<method name="_subgizmos_intersect_frustum" qualifiers="virtual const">
			<return type="PackedInt32Array" />
			<argument index="0" name="camera" type="Camera3D" />
			<argument index="1" name="frustum" type="Plane[]" />
			<description>
				Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos].
			</description>
		</method>
		<method name="_subgizmos_intersect_ray" qualifiers="virtual const">
			<return type="int" />
			<argument index="0" name="camera" type="Camera3D" />
			<argument index="1" name="point" type="Vector2" />
			<description>
				Override this method to allow selecting subgizmos using mouse clicks. Given a [code]camera[/code] and a [code]point[/code] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos].
			</description>
		</method>
		<method name="add_collision_segments">
			<return type="void" />
			<argument index="0" name="segments" type="PackedVector3Array" />
			<description>
				Adds the specified [code]segments[/code] to the gizmo's collision shape for picking. Call this method during [method _redraw].
			</description>
		</method>
		<method name="add_collision_triangles">
			<return type="void" />
			<argument index="0" name="triangles" type="TriangleMesh" />
			<description>
				Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this method during [method _redraw].
			</description>
		</method>
		<method name="add_handles">
			<return type="void" />
			<argument index="0" name="handles" type="PackedVector3Array" />
			<argument index="1" name="material" type="Material" />
			<argument index="2" name="ids" type="PackedInt32Array" />
			<argument index="3" name="billboard" type="bool" default="false" />
			<argument index="4" name="secondary" type="bool" default="false" />
			<description>
				Adds a list of handles (points) which can be used to edit the properties of the gizmo's Node3D. The [code]ids[/code] argument can be used to specify a custom identifier for each handle, if an empty [code]Array[/code] is passed, the ids will be assigned automatically from the [code]handles[/code] argument order.
				The [code]secondary[/code] argument marks the added handles as secondary, meaning they will normally have less selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection.
				There are virtual methods which will be called upon editing of these handles. Call this method during [method _redraw].
			</description>
		</method>
		<method name="add_lines">
			<return type="void" />
			<argument index="0" name="lines" type="PackedVector3Array" />
			<argument index="1" name="material" type="Material" />
			<argument index="2" name="billboard" type="bool" default="false" />
			<argument index="3" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
			<description>
				Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during [method _redraw].
			</description>
		</method>
		<method name="add_mesh">
			<return type="void" />
			<argument index="0" name="mesh" type="Mesh" />
			<argument index="1" name="material" type="Material" default="null" />
			<argument index="2" name="transform" type="Transform3D" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)" />
			<argument index="3" name="skeleton" type="SkinReference" default="null" />
			<description>
				Adds a mesh to the gizmo with the specified [code]material[/code], local [code]transform[/code] and [code]skeleton[/code]. Call this method during [method _redraw].
			</description>
		</method>
		<method name="add_unscaled_billboard">
			<return type="void" />
			<argument index="0" name="material" type="Material" />
			<argument index="1" name="default_scale" type="float" default="1" />
			<argument index="2" name="modulate" type="Color" default="Color(1, 1, 1, 1)" />
			<description>
				Adds an unscaled billboard for visualization and selection. Call this method during [method _redraw].
			</description>
		</method>
		<method name="clear">
			<return type="void" />
			<description>
				Removes everything in the gizmo including meshes, collisions and handles.
			</description>
		</method>
		<method name="get_plugin" qualifiers="const">
			<return type="EditorNode3DGizmoPlugin" />
			<description>
				Returns the [EditorNode3DGizmoPlugin] that owns this gizmo. It's useful to retrieve materials using [method EditorNode3DGizmoPlugin.get_material].
			</description>
		</method>
		<method name="get_spatial_node" qualifiers="const">
			<return type="Node3D" />
			<description>
				Returns the Node3D node associated with this gizmo.
			</description>
		</method>
		<method name="get_subgizmo_selection" qualifiers="const">
			<return type="PackedInt32Array" />
			<description>
				Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during [method _redraw].
			</description>
		</method>
		<method name="is_subgizmo_selected" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="id" type="int" />
			<description>
				Returns [code]true[/code] if the given subgizmo is currently selected. Can be used to highlight selected elements during [method _redraw].
			</description>
		</method>
		<method name="set_hidden">
			<return type="void" />
			<argument index="0" name="hidden" type="bool" />
			<description>
				Sets the gizmo's hidden state. If [code]true[/code], the gizmo will be hidden. If [code]false[/code], it will be shown.
			</description>
		</method>
		<method name="set_spatial_node">
			<return type="void" />
			<argument index="0" name="node" type="Node" />
			<description>
				Sets the reference [Node3D] node for the gizmo. [code]node[/code] must inherit from [Node3D].
			</description>
		</method>
	</methods>
</class>


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <actions>
      <actionByCounts>
        <senate>3</senate>
      </actionByCounts>
      <actionTypeCounts>
        <passedOrAgreedToInSenateDayOf>1</passedOrAgreedToInSenateDayOf>
        <passedAgreedToInSenate>1</passedAgreedToInSenate>
        <introducedInSenate>1</introducedInSenate>
      </actionTypeCounts>
      <item>
        <actionDate>2017-10-05</actionDate>
        <committee />
        <links>
          <link>
            <name>S6368</name>
            <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S6368</url>
          </link>
          <link>
            <name>S6375</name>
            <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S6375</url>
          </link>
        </links>
        <sourceSystem>
          <name>Senate</name>
          0
        </sourceSystem>
        <text>Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent. (consideration: CR S6375; text of measure as introduced: CR S6368)</text>
        <type>Floor</type>
      </item>
      <item>
        <links>
          <link>
            <name>S6368</name>
            <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S6368</url>
          </link>
          <link>
            <name>S6375</name>
            <url>https://www.congress.gov/congressional-record/volume-163/senate-section/page/S6375</url>
          </link>
        </links>
        <type>Floor</type>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Passed/agreed to in Senate: Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent.(consideration: CR S6375; text of measure as introduced: CR S6368)</text>
        <committee />
        <actionDate>2017-10-05</actionDate>
        <actionCode>17000</actionCode>
      </item>
      <item>
        <links />
        <type>IntroReferral</type>
        <sourceSystem>
          <name>Library of Congress</name>
          9
        </sourceSystem>
        <text>Introduced in Senate</text>
        <committee />
        <actionDate>2017-10-05</actionDate>
        <actionCode>10000</actionCode>
      </item>
    </actions>
    <updateDate>2017-10-13T04:33:17Z</updateDate>
    <latestAction>
      <actionDate>2017-10-05</actionDate>
      <text>Submitted in the Senate, considered, and agreed to without amendment and with a preamble by Unanimous Consent. (consideration: CR S6375; text of measure as introduced: CR S6368)</text>
      <links />
    </latestAction>
    <notes />
    <summaries>
      <billSummaries />
    </summaries>
    <laws />
    <titles>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>Official Title as Introduced</titleType>
        <title>A resolution designating the week of October 1 through 7, 2017, as "National Community Policing Week".</title>
        <parentTitleType />
      </item>
      <item>
        <chamberName />
        <chamberCode />
        <titleType>Display Title</titleType>
        <title>A resolution designating the week of October 1 through 7, 2017, as "National Community Policing Week".</title>
        <parentTitleType />
      </item>
    </titles>
    <committees>
      <billCommittees />
    </committees>
    <recordedVotes />
    <createDate>2017-10-06T00:41:17Z</createDate>
    <cosponsors>
      <item>
        <party>R</party>
        <firstName>John</firstName>
        <state>TX</state>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>C001056</bioguideId>
          <lisID>1692</lisID>
          <gpoId>8295</gpoId>
        </identifiers>
        <sponsorshipDate>2017-10-05</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <bioguideId>C001056</bioguideId>
        <middleName />
        <lastName>Cornyn</lastName>
        <fullName>Sen. Cornyn, John [R-TX]</fullName>
      </item>
      <item>
        <party>D</party>
        <firstName>Margaret</firstName>
        <state>NH</state>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <lisID>2302</lisID>
          <bioguideId>H001076</bioguideId>
          <gpoId />
        </identifiers>
        <sponsorshipDate>2017-10-05</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <bioguideId>H001076</bioguideId>
        <middleName>Wood</middleName>
        <lastName>Hassan</lastName>
        <fullName>Sen. Hassan, Margaret Wood [D-NH]</fullName>
      </item>
      <item>
        <party>R</party>
        <firstName>ORRIN</firstName>
        <state>UT</state>
        <sponsorshipWithdrawnDate />
        <identifiers>
          <bioguideId>H000338</bioguideId>
          <lisID>1351</lisID>
          <gpoId>8314</gpoId>
        </identifiers>
        <sponsorshipDate>2017-10-05</sponsorshipDate>
        <isOriginalCosponsor>True</isOriginalCosponsor>
        <bioguideId>H000338</bioguideId>
        <middleName>GRANT</middleName>
        <lastName>HATCH</lastName>
        <fullName>Sen. Hatch, Orrin G. [R-UT]</fullName>
      </item>
    </cosponsors>
    <amendments />
    <committeeReports />
    <introducedDate>2017-10-05</introducedDate>
    <billType>SRES</billType>
    <title>A resolution designating the week of October 1 through 7, 2017, as "National Community Policing Week".</title>
    <subjects>
      <billSubjects>
        <legislativeSubjects />
        <policyArea>
          <name>Crime and Law Enforcement</name>
        </policyArea>
      </billSubjects>
    </subjects>
    <cboCostEstimates />
    <policyArea>
      <name>Crime and Law Enforcement</name>
    </policyArea>
    <sponsors>
      <item>
        <firstName>Jeanne</firstName>
        <middleName />
        <bioguideId>S001181</bioguideId>
        <byRequestType />
        <lastName>Shaheen</lastName>
        <state>NH</state>
        <fullName>Sen. Shaheen, Jeanne [D-NH]</fullName>
        <identifiers>
          <bioguideId>S001181</bioguideId>
          <lisID>1901</lisID>
          <gpoId>8276</gpoId>
        </identifiers>
        <party>D</party>
      </item>
    </sponsors>
    <billNumber>288</billNumber>
    <originChamber>Senate</originChamber>
    <version>1.0.0</version>
    <congress>115</congress>
    <relatedBills />
    <calendarNumbers />
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>

redpajama_set_name: RedPajamaGithub


text:
using JustLogic.Core;
using System.Collections.Generic;
using UnityEngine;

[UnitMenu("Transform/Rotate")]
[UnitFriendlyName("Rotate")]
public class JLTransformRotate : JLAction
{
    [Parameter(ExpressionType = typeof(Transform))]
    public JLExpression OperandValue;

    [Parameter(ExpressionType = typeof(Vector3))]
    public JLExpression EulerAngles;

    protected override IEnumerator<YieldMode> OnExecute(IExecutionContext context)
    {
        Transform opValue = OperandValue.GetResult<Transform>(context);
        opValue.Rotate(EulerAngles.GetResult<Vector3>(context));
        return null;    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
           android:orientation="vertical"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:src="@drawable/header"
           android:adjustViewBounds="true"
           android:scaleType="fitCenter">
</ImageView>


text:
#include "guava_router/guava_router.h"
#include "guava_string.h"
#include "guava_request.h"
#include "guava_response.h"
#include "guava_handler.h"
#include "guava_session/guava_session.h"
#include "guava_memory.h"

guava_router_static_t *guava_router_static_new(void) {
  guava_router_static_t *router = (guava_router_static_t *)guava_malloc(sizeof(guava_router_static_t));
  if (!router) {
    return NULL;
  }

  router->route.mount_point = guava_string_new("/static");
  router->route.package = guava_string_new(".");
  router->route.type = GUAVA_ROUTER_STATIC;
  router->route.session_store = NULL;
  router->route.routes = NULL;
  router->directory = guava_string_new("./static");
  router->allow_index = GUAVA_FALSE;

  return router;
}

void guava_router_static_free(guava_router_static_t *router) {
  if (!router) {
    return;
  }

  if (router->route.mount_point) {
    guava_string_free(router->route.mount_point);
  }

  if (router->route.package) {
    guava_string_free(router->route.package);
  }

  if (router->route.session_store) {
    guava_session_store_free(router->route.session_store);
  }

  if (router->route.routes) {
    Py_DECREF(router->route.routes);
  }

  if (router->directory) {
    guava_string_free(router->directory);
  }

  guava_free(router);
}

void guava_router_static_set_directory(guava_router_static_t *router, const char *directory) {
  if (!router || !directory) {
    return;
  }

  if (router->directory) {
    guava_string_free(router->directory);
  }

  router->directory = guava_string_new(directory);
}

void guava_router_static_set_allow_index(guava_router_static_t *router, const guava_bool_t allow_index) {
  if (!router) {
    return;
  }

  router->allow_index = allow_index;
}

void guava_router_static_route(guava_router_static_t *router, guava_request_t *req, guava_handler_t *handler) {
  if (!router || !req) {
    return;
  }

  handler->flags |= GUAVA_HANDLER_VALID;
  handler->flags |= GUAVA_HANDLER_STATIC;
}


text:
/**
 * Created by syrel on 22.05.17.
 */

class LBNode {
    constructor(endpoint, node) {
        this.endpoint = endpoint;
        this.node = node;

        this.extensions = [

        ]
    }

    toString() {
        return this.node;
    }
}

export default LBNode;


text:
package io.horizondb.db.operations;

import io.horizondb.io.Buffer;
import io.horizondb.io.ByteWriter;
import io.horizondb.io.buffers.Buffers;
import io.horizondb.io.encoding.VarInts;
import io.horizondb.model.core.Record;
import io.horizondb.model.core.ResourceIterator;
import io.horizondb.model.core.records.TimeSeriesRecord;
import io.horizondb.model.protocol.DataChunkPayload;
import io.horizondb.model.protocol.Msg;
import io.horizondb.model.protocol.MsgHeader;
import io.horizondb.model.protocol.OpCode;
import io.horizondb.model.schema.FieldType;
import io.netty.channel.ChannelHandlerContext;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import org.easymock.EasyMock;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * @author Benjamin
 *
 */
public class ChunkedRecordStreamTest {

    @SuppressWarnings("boxing")
    @Test
    public void testEmptyStream() throws Exception {

        MsgHeader requestHeader = MsgHeader.newRequestHeader(OpCode.HQL_QUERY, 26);
        ResourceIterator<Record> iterator = EasyMock.createMock(ResourceIterator.class);
        EasyMock.expect(iterator.hasNext()).andReturn(false);

        ChannelHandlerContext context = EasyMock.createMock(ChannelHandlerContext.class);

        EasyMock.replay(iterator, context);

        final int bufferSize = 200;

        ChunkedRecordStream input = new ChunkedRecordStream(requestHeader, iterator, bufferSize);

        assertFalse(input.isEndOfInput());

        Msg<DataChunkPayload> msg = input.readChunk(context);

        Buffer heapBuffer = Buffers.allocate(bufferSize);
        heapBuffer.writeByte(Msg.END_OF_STREAM_MARKER);

        Msg<DataChunkPayload> expected = Msg.newResponseMsg(requestHeader,
                                                            OpCode.DATA_CHUNK,
                                                            new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertTrue(input.isEndOfInput());

        EasyMock.verify(iterator, context);
    }

    @SuppressWarnings("boxing")
    @Test
    public void testStreamWithOnlyOneRecord() throws Exception {

        MsgHeader requestHeader = MsgHeader.newRequestHeader(OpCode.HQL_QUERY, 26);
        ResourceIterator<Record> iterator = EasyMock.createMock(ResourceIterator.class);

        TimeSeriesRecord first = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        first.setTimestampInNanos(0, 12000700);
        first.setTimestampInMillis(1, 12);
        first.setByte(2, 3);

        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(first);
        EasyMock.expect(iterator.hasNext()).andReturn(false);

        ChannelHandlerContext context = EasyMock.createMock(ChannelHandlerContext.class);

        EasyMock.replay(iterator, context);

        final int bufferSize = 200;

        ChunkedRecordStream input = new ChunkedRecordStream(requestHeader, iterator, bufferSize);

        assertFalse(input.isEndOfInput());

        Msg<DataChunkPayload> msg = input.readChunk(context);

        Buffer heapBuffer = Buffers.allocate(bufferSize);

        writeRecord(heapBuffer, first);

        heapBuffer.writeByte(Msg.END_OF_STREAM_MARKER);

        Msg<DataChunkPayload> expected = Msg.newResponseMsg(requestHeader,
                                                            OpCode.DATA_CHUNK,
                                                            new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertTrue(input.isEndOfInput());

        EasyMock.verify(iterator, context);
    }

    @SuppressWarnings("boxing")
    @Test
    public void testStreamWithTreeRecords() throws Exception {

        MsgHeader requestHeader = MsgHeader.newRequestHeader(OpCode.HQL_QUERY, 26);
        ResourceIterator<Record> iterator = EasyMock.createMock(ResourceIterator.class);

        TimeSeriesRecord first = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        first.setTimestampInNanos(0, 12000700);
        first.setTimestampInMillis(1, 12);
        first.setByte(2, 3);

        TimeSeriesRecord second = new TimeSeriesRecord(0,
                                                       TimeUnit.NANOSECONDS,
                                                       FieldType.MILLISECONDS_TIMESTAMP,
                                                       FieldType.BYTE);
        second.setTimestampInNanos(0, 13000900);
        second.setTimestampInMillis(1, 13);
        second.setByte(2, 3);

        TimeSeriesRecord third = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        third.setTimestampInNanos(0, 13004400);
        third.setTimestampInMillis(1, 13);
        third.setByte(2, 1);

        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(first);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(second);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(third);
        EasyMock.expect(iterator.hasNext()).andReturn(false);

        ChannelHandlerContext context = EasyMock.createMock(ChannelHandlerContext.class);

        EasyMock.replay(iterator, context);

        final int bufferSize = 200;

        ChunkedRecordStream input = new ChunkedRecordStream(requestHeader, iterator, bufferSize);

        assertFalse(input.isEndOfInput());

        Msg<DataChunkPayload> msg = input.readChunk(context);

        Buffer heapBuffer = Buffers.allocate(bufferSize);
        writeRecord(heapBuffer, first);
        writeRecord(heapBuffer, second);
        writeRecord(heapBuffer, third);
        heapBuffer.writeByte(Msg.END_OF_STREAM_MARKER);

        Msg<DataChunkPayload> expected = Msg.newResponseMsg(requestHeader,
                                                            OpCode.DATA_CHUNK,
                                                            new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertTrue(input.isEndOfInput());

        EasyMock.verify(iterator, context);
    }

    @SuppressWarnings("boxing")
    @Test
    public void testStreamWithTwoChunk() throws Exception {

        MsgHeader requestHeader = MsgHeader.newRequestHeader(OpCode.HQL_QUERY, 26);
        ResourceIterator<Record> iterator = EasyMock.createMock(ResourceIterator.class);

        TimeSeriesRecord first = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        first.setTimestampInNanos(0, 12000700);
        first.setTimestampInMillis(1, 12);
        first.setByte(2, 3);

        TimeSeriesRecord second = new TimeSeriesRecord(0,
                                                       TimeUnit.NANOSECONDS,
                                                       FieldType.MILLISECONDS_TIMESTAMP,
                                                       FieldType.BYTE);
        second.setTimestampInNanos(0, 13000900);
        second.setTimestampInMillis(1, 13);
        second.setByte(2, 3);

        TimeSeriesRecord third = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        third.setTimestampInNanos(0, 13004400);
        third.setTimestampInMillis(1, 13);
        third.setByte(2, 1);

        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(first);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(second);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(third);
        EasyMock.expect(iterator.hasNext()).andReturn(false);

        ChannelHandlerContext context = EasyMock.createMock(ChannelHandlerContext.class);

        EasyMock.replay(iterator, context);

        final int bufferSize = 20;

        ChunkedRecordStream input = new ChunkedRecordStream(requestHeader, iterator, bufferSize);

        assertFalse(input.isEndOfInput());

        Msg<DataChunkPayload> msg = input.readChunk(context);

        Buffer heapBuffer = Buffers.allocate(bufferSize);
        writeRecord(heapBuffer, first);
        writeRecord(heapBuffer, second);

        Msg<DataChunkPayload> expected = Msg.newResponseMsg(requestHeader,
                                                            OpCode.DATA_CHUNK,
                                                            new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertFalse(input.isEndOfInput());

        msg = input.readChunk(context);

        heapBuffer.clear();
        writeRecord(heapBuffer, third);
        heapBuffer.writeByte(Msg.END_OF_STREAM_MARKER);

        expected = Msg.newResponseMsg(requestHeader,
                                      OpCode.DATA_CHUNK,
                                      new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertTrue(input.isEndOfInput());

        EasyMock.verify(iterator, context);
    }

    @SuppressWarnings("boxing")
    @Test
    public void testStreamWithOnlyEndOfStreamInSecondChunk() throws Exception {

        MsgHeader requestHeader = MsgHeader.newRequestHeader(OpCode.HQL_QUERY, 26);
        ResourceIterator<Record> iterator = EasyMock.createMock(ResourceIterator.class);

        TimeSeriesRecord first = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        first.setTimestampInNanos(0, 12000700);
        first.setTimestampInMillis(1, 12);
        first.setByte(2, 3);

        TimeSeriesRecord second = new TimeSeriesRecord(0,
                                                       TimeUnit.NANOSECONDS,
                                                       FieldType.MILLISECONDS_TIMESTAMP,
                                                       FieldType.BYTE);
        second.setTimestampInNanos(0, 13000900);
        second.setTimestampInMillis(1, 13);
        second.setByte(2, 3);

        TimeSeriesRecord third = new TimeSeriesRecord(0,
                                                      TimeUnit.NANOSECONDS,
                                                      FieldType.MILLISECONDS_TIMESTAMP,
                                                      FieldType.BYTE);
        third.setTimestampInNanos(0, 13004400);
        third.setTimestampInMillis(1, 13);
        third.setByte(2, 1);

        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(first);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(second);
        EasyMock.expect(iterator.hasNext()).andReturn(true);
        EasyMock.expect(iterator.next()).andReturn(third);
        EasyMock.expect(iterator.hasNext()).andReturn(false);

        ChannelHandlerContext context = EasyMock.createMock(ChannelHandlerContext.class);

        EasyMock.replay(iterator, context);

        final int bufferSize = 27;

        ChunkedRecordStream input = new ChunkedRecordStream(requestHeader, iterator, bufferSize);

        assertFalse(input.isEndOfInput());

        Msg<DataChunkPayload> msg = input.readChunk(context);

        Buffer heapBuffer = Buffers.allocate(bufferSize);
        writeRecord(heapBuffer, first);
        writeRecord(heapBuffer, second);
        writeRecord(heapBuffer, third);

        Msg<DataChunkPayload> expected = Msg.newResponseMsg(requestHeader,
                                                            OpCode.DATA_CHUNK,
                                                            new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertFalse(input.isEndOfInput());

        msg = input.readChunk(context);

        heapBuffer.clear();
        heapBuffer.writeByte(Msg.END_OF_STREAM_MARKER);

        expected = Msg.newResponseMsg(requestHeader,
                                      OpCode.DATA_CHUNK,
                                      new DataChunkPayload(heapBuffer));

        assertEquals(expected, msg);
        assertTrue(input.isEndOfInput());
        EasyMock.verify(iterator, context);
    }

    /**
     * Writes the specified record in the specified writer.
     *
     * @param writer the writer to write to
     * @param record the record to write
     * @throws IOException if a problem occurs while writing the record
     */
    private static void writeRecord(ByteWriter writer, TimeSeriesRecord record) throws IOException {

        writer.writeByte(record.getType());
        VarInts.writeUnsignedInt(writer, record.computeSerializedSize());
        record.writeTo(writer);
    }
}


text:
<readable><title>2986280913_13fb2d472e</title><content>
A boy and a dog running on grass
A boy dressed in green running with a brown and white dog in a green field .
A child and small dog running .
A white dog and green shirted child running in the grass .
Boy and white dog running in grassy field
</content></readable>


text:
package org.wikience.wrrs.server;

import org.wikience.wrrs.wrrsprotobuf.RProtocol;

import java.io.File;
import java.io.IOException;
import java.util.*;

public class GetRaster {

    private final static String ROOT_FOLDER = "netcdf/";

    private RProtocol.RasterRequest request;
    private RProtocol.RasterResponse.Builder rrB;

    private int hour = 0;

    public GetRaster(RProtocol.RasterRequest request, RProtocol.RasterResponse.Builder rrB) {
        this.request = request;
        this.rrB = rrB;
    }

    public void process() throws IOException {
        String layerId = request.getRequestParams().getDatasetId();
        String type = layerId.split("\\.")[2];
        long datems = request.getRequestParams().getTimeInterval().getTimeStartMillis();

        String folder = getFolder(layerId);
        String stringDate = getDate(datems);
        String filename = getFileName(folder, stringDate);

        System.out.println("Layer id: " + layerId + ", datetime: " + stringDate);

        filename = folder + filename;

        System.out.println(filename);

        NetCDFReader rdr = new NetCDFReader(rrB);

        rdr.getData(filename, hour, type);
  }

    private String getFolder(String layerId) {
        String folder = ROOT_FOLDER;
        String[] splitted = layerId.split("\\.");

        for (String part : splitted) {
            folder += part + "/";
        }

        return folder;
    }

    private String getDate(long datems) {
        Calendar date = GregorianCalendar.getInstance();
        date.clear();
        date.setTimeInMillis(datems);
        int year = date.get(Calendar.YEAR);
        int month = date.get(Calendar.MONTH) + 1;
        int day = date.get(Calendar.DAY_OF_MONTH);

        hour = date.get(Calendar.HOUR_OF_DAY);

        String folder = "" + year;

        if (month < 10) {
            folder += "0";
        }

        folder += "" + month;

        if (day < 10) {
            folder += "0";
        }

        folder += "" + day;

        return folder;
    }

    private String getFileName(String folder, String date) {
        List<String> results = new ArrayList<String>();

        File[] files = new File(folder).listFiles();

        for (File file : files) {
            if (file.isFile()) {
                results.add(file.getName());
            }
        }

        for (String filename : results) {
            if (filename.matches("(.*?)" + date + "(.*?)")) {
                return filename;
            }
        }

        return null;
    }

}


text:
package com.faber.servlet;

//<editor-fold defaultstate="collapsed" desc="IMPORT">
import com.faber.business.ReportCampaignBS;
import com.faber.utils.DownloadUtils;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
//</editor-fold>

/**
 *
 * @author Le Dinh Tuan
 */
public class ReportCampaignServlet extends HttpServlet {

    ReportCampaignBS reportCampaignBS = new ReportCampaignBS();
    SimpleDateFormat date_format = new SimpleDateFormat("yyyy-MM-dd");

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //<editor-fold defaultstate="collapsed" desc="HEADER">
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        request.setCharacterEncoding("UTF-8");
        String userPath = request.getServletPath();
        HttpSession session = request.getSession();
        Integer advertiserID = Integer.parseInt(session.getAttribute("advertiserID").toString());
        //</editor-fold>

        //<editor-fold defaultstate="collapsed" desc="LOAD REPORT DATA">
        if (userPath.equals("/getReportCampaign")) {
            PrintWriter out = response.getWriter();
            String fromDate = URLDecoder.decode(request.getParameter("fromdate"), "UTF-8");
            String toDate = URLDecoder.decode(request.getParameter("todate"), "UTF-8");
            String device = URLDecoder.decode(request.getParameter("device"), "UTF-8");
            String campaignType = URLDecoder.decode(request.getParameter("campaign_type"), "UTF-8");
            out.print(reportCampaignBS.getReportCampaignByDevice(advertiserID, campaignType, fromDate, toDate, device));
        }
        //</editor-fold>

        //<editor-fold defaultstate="collapsed" desc="GET DATA REPORT FOR CHART">
        if (userPath.equals("/getReportCampaignChart")) {
            PrintWriter out = response.getWriter();
            String fromDate = URLDecoder.decode(request.getParameter("fromdate"), "UTF-8");
            String toDate = URLDecoder.decode(request.getParameter("todate"), "UTF-8");
            String device = URLDecoder.decode(request.getParameter("device"), "UTF-8");
            out.print(reportCampaignBS.getReportCampaignChart(advertiserID, fromDate, toDate, device));
        }
        //</editor-fold>

        //<editor-fold defaultstate="collapsed" desc="CREATED CSV FILE">
        if (userPath.equals("/reportCampaignCSV")) {
            PrintWriter out = response.getWriter();
            String jsonSource = URLDecoder.decode(request.getParameter("jsonSource"), "UTF-8");
            String rootPath = getServletContext().getRealPath("/") + "WEB-INF/resources/file-download";
            String dateData = URLDecoder.decode(request.getParameter("fromdate"), "UTF-8") + " => " + URLDecoder.decode(request.getParameter("todate"), "UTF-8");
            out.print(reportCampaignBS.exportCSV(advertiserID, rootPath, jsonSource, dateData));
        }
        //</editor-fold>

        //<editor-fold defaultstate="collapsed" desc="DOWNLOAD FILE">
        if (userPath.equals("/reportCampaignCSVDownload")) {
            DownloadUtils downloadUtils = new DownloadUtils();
            String rootPath = getServletContext().getRealPath("/") + "WEB-INF/resources/file-download";
            String userAgent = request.getHeader("User-Agent");
            Date date = new Date();
            String filePath = rootPath + "/data_" + date_format.format(date) + "_" + advertiserID + ".csv";
            downloadUtils.downloadFile(response, filePath, userAgent, true);
        }
        //</editor-fold>

    }

}


text:
classdef WaveletData<Data
	properties
		%one data obj inside every level
		levelsAnalysis={}
		levelsDetail={}
		levelIdx=[]
		processor
	end

	methods
		function self=WaveletData(Y)
	                self=self@Data([],Y);
			self.foldCalculator=TrialFoldCalculator();
			self.meta.segs=SegmentDescriptor();
		end

		function self=delete(self)
			Logger.info('deleting wavelet data');
			self.levelsAnalysis=[];
			self.levelsDetail=[];

		end
		function toFile(self,path)
			Logger.info(sprintf('write wavelet data to file %s',path));
			data.Y=self.Y;
			data.levelsDetail=self.levelsDetail;
			data.levelsAnalysis=self.levelsAnalysis;
			data.levelIdx=self.levelIdx;
			data.foldCalculator=self.foldCalculator;%#ok
			save(FSUtils.checkPath( path ),'data');
		end
		function [data]=getLevelDetail(self,level)
			if level==1
				% 0,0 is equal
				data=self.levelsAnalysis{level};
			else
				data=self.levelsDetail{level};
			end
			data.Y=self.Y;
		end
		function [data]=getLevelAnalysis(self,level)
			data=self.levelsAnalysis{level};
			data.Y=self.Y;
		end

		function [self]=addLevelAnalysis(self,data,level)
			data.meta=struct(self.meta);
			data.meta.level=[1,level];
			self.levelsAnalysis{level}=data;
			self.levelIdx=[self.levelIdx level];
			%self.levelIdx=unique(self.levelIdx);
		end
		function [self]=addLevelDetail(self,data,level)
			if level~=1
				%data.Y=self.Y;
				data.meta=struct(self.meta);
				data.meta.level=[2,level];
				self.levelsDetail{level}=data;
				%self.levelIdx=[self.levelIdx level];
				%self.levelIdx=unique(self.levelIdx);
			end
		end
		function [levels]=getLevels(self)
			levels=self.levelIdx;
		end

%		function [train,test]=getFold(self,fold,outOf)
%			[train,test]=self.foldCalculator.getFold(self,fold,outOf);
%		end
		function [train,test]=calculateFold(self,fold,outOf)
			train=WaveletData([]);
			test=WaveletData([]);
			for l=self.levelIdx
				data=self.getLevelDetail(l);
				Logger.debug('size! data %i %i %i',size(data.X))
				Logger.debug('size! Y %i %i',size(data.Y))
				[t,ts]=data.getFold(fold,outOf);
				Logger.debug('tr! data %i %i %i',size(t.X))
				Logger.debug('ts! data %i %i %i',size(ts.X))
				train.Y=t.Y;
				train.addLevelDetail(t,l);
				test.Y=ts.Y;
				test.addLevelDetail(ts,l);
				data=self.getLevelAnalysis(l);
				[t,ts]=data.getFold(fold,outOf);
				train.Y=t.Y;
				train.addLevelAnalysis(t,l);
				test.Y=ts.Y;
				test.addLevelAnalysis(ts,l);
			end
		end
		function self=filterLevels(self,app,det)
			for l=self.levelIdx
				if sum(app==l)==0
					self.levelsAnalysis{l}=Data([],[]);
				end
				if sum(det==l)==0
					self.levelsDetail{l}=Data([],[]);
				end
			end
			if isa(self.foldCalculator,'TrialFoldCalculator')==0
				Logger.debug('Filtering levels')
				for f=1:self.foldCalculator.nFolds
					[tr,ts]=self.getFold(f,self.foldCalculator.nFolds);
					self.foldCalculator.addFold(tr.filterLevels(app,det),ts.filterLevels(app,det),f);
				end
			end
		end

		function self=merge(self,other)
			%TODO FIX THE Y PROBLEM, BETTER, REWRITE THE WHOLE DATA STUFF TO GET SOMETHING MORE EFFICIENT...
			if min(size(self.Y))==0
				self.Y=self.levelsAnalysis{2}.Y;
			end
			Logger.debug('Size before merge Y %i %i X %i %i %i',size(self.Y),size(self.levelsAnalysis{2}.X));
			self.Y=[self.Y;other.levelsAnalysis{2}.Y];
			for l=self.levelIdx
				if l~=1
					self.getLevelAnalysis(l).merge(other.getLevelAnalysis(l));
					self.getLevelDetail(l).merge(other.getLevelDetail(l));
				end

			end
			Logger.debug('Size after merge Y %i %i X %i %i %i',size(self.Y),size(self.levelsAnalysis{2}.X));
		end
	end

	 methods(Static)
		function [wData]= fromFile(path)
			wData=WaveletData([]);
			Logger.info(sprintf('reading wavelet data from file %s',path));
			%MARK DATA
			data=FSUtils.load(path);
			data=data.data;
			wData.Y=data.Y;
			wData.levelsDetail=data.levelsDetail;
			wData.levelsAnalysis=data.levelsAnalysis;
			wData.levelIdx=data.levelIdx;
			if ismember('foldCalculator',fieldnames(data))
				wData.foldCalculator=data.foldCalculator;
			else
				wData.foldCalculator=TrialFoldCalculator();
			end
		end
    	end

end


text:
Description [![Build Status](https://travis-ci.org/hipsnip-cookbooks/deploy_s3.png)](https://travis-ci.org/hipsnip-cookbooks/deploy_s3)
===========
Somewhat similar to the Opscode deploy resource, but rather than hooking up to a source code repository, it downloads complete build packages from a specific Amazon S3 bucket.
The cookbook itself doesn't do much, besides providing an "s3_deploy" resource that takes care of the above.

Requirements
============
Needs the "s3cmd" cookbook to work. Tested on Ubuntu 11.10 and 12.04, but it should work on any platform that supports symlinks.

Attributes
==========

    ['deploy_s3']['bucket'] = The name of the bucket containing the releases
    ['deploy_s3']['deploy_root'] = The location where the app will be deployed on disk - defaults to "/home/web"

Usage
=====

Best to explain by example:

Let's assume we have an application called "myapp", and we want to deploy the build "v1.2" on our server.
We set the "bucket" attribute to "app-releases", and leave "deploy_root" as the default.

First, we need to store the build in the "app-releases" S3 bucket. The build should be a single folder named after the release name ("v1.2" in our case), which is then compressed with Tar/Gz. So for our example, the package would be "v1.2.tar.gz" which contains the folder "v1.2".

This folder is then uploaded into S3, inside a folder named after the app: "myapp/v1.2.tar.gz"

Then we'd put the following in our recipe

	deploy_s3 "myapp" do
		build "v1.2"
		bucket "mybucket"
		action :create
	end

and the resource will do the following:

1. Create the folder "/home/web/myapp" if it's not already there
2. Create the folder "/home/web/myapp/releases" if it's not already there
3. Attempt to download the object "mybucket/myapp/v1.2.tar.gz" from the "app-releases" bucket, into "/home/web/myapp/releases"
4. Unzip the package
5. Symlink the package to "/home/web/latest"

Development
===========
Please refer to the Readme [here](https://github.com/hipsnip-cookbooks/cookbook-development/blob/master/README.md)

License and Author
==================

Author:: Adam Borocz ([on GitHub](https://github.com/motns))

Copyright:: 2013, HipSnip Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


text:
struct XFA_FONTINFO {
  FX_DWORD dwFontNameHash;
  const FX_WCHAR* pPsName;
  const FX_WCHAR* pReplaceFont;
  FX_WORD dwStyles;
  FX_WORD wCodePage;
};

class CXFA_DefFontMgr : public IXFA_FontMgr {
 public:
  CXFA_DefFontMgr() {}
  ~CXFA_DefFontMgr() override;

  // IXFA_FontMgr:
  IFX_Font* GetFont(IXFA_Doc* hDoc,
                    const CFX_WideStringC& wsFontFamily,
                    FX_DWORD dwFontStyles,
                    FX_WORD wCodePage = 0xFFFF) override;
  IFX_Font* GetDefaultFont(IXFA_Doc* hDoc,
                           const CFX_WideStringC& wsFontFamily,
                           FX_DWORD dwFontStyles,
                           FX_WORD wCodePage = 0xFFFF) override;

 protected:
  CFX_PtrArray m_CacheFonts;
};

class CXFA_PDFFontMgr : public IFX_FontProvider {
 public:
  CXFA_PDFFontMgr(CXFA_FFDoc* pDoc);
  ~CXFA_PDFFontMgr();
  IFX_Font* GetFont(const CFX_WideStringC& wsFontFamily,
                    FX_DWORD dwFontStyles,
                    CPDF_Font** pPDFFont,
                    FX_BOOL bStrictMatch = TRUE);
  FX_BOOL GetCharWidth(IFX_Font* pFont,
                       FX_WCHAR wUnicode,
                       int32_t& iWidth,
                       FX_BOOL bCharCode);
  CFX_MapPtrToPtr m_FDE2PDFFont;

 protected:
  IFX_Font* FindFont(CFX_ByteString strFamilyName,
                     FX_BOOL bBold,
                     FX_BOOL bItalic,
                     CPDF_Font** pPDFFont,
                     FX_BOOL bStrictMatch = TRUE);
  CFX_ByteString PsNameToFontName(const CFX_ByteString& strPsName,
                                  FX_BOOL bBold,
                                  FX_BOOL bItalic);
  FX_BOOL PsNameMatchDRFontName(const CFX_ByteStringC& bsPsName,
                                FX_BOOL bBold,
                                FX_BOOL bItalic,
                                const CFX_ByteString& bsDRFontName,
                                FX_BOOL bStrictMatch = TRUE);

  CXFA_FFDoc* m_pDoc;
  std::map<CFX_ByteString, IFX_Font*> m_FontMap;
};

class CXFA_FontMgr {
 public:
  CXFA_FontMgr();
  ~CXFA_FontMgr();
  IFX_Font* GetFont(IXFA_Doc* hDoc,
                    const CFX_WideStringC& wsFontFamily,
                    FX_DWORD dwFontStyles,
                    FX_WORD wCodePage = 0xFFFF);
  void LoadDocFonts(IXFA_Doc* hDoc);
  void ReleaseDocFonts(IXFA_Doc* hDoc);

  void SetDefFontMgr(IXFA_FontMgr* pFontMgr);

 protected:
  void DelAllMgrMap();

  CFX_MapPtrToPtr m_PDFFontMgrArray;
  IXFA_FontMgr* m_pDefFontMgr;
  std::map<CFX_ByteString, IFX_Font*> m_FontMap;
};

#endif  //  XFA_FONTMGR_H_


text:
import subprocess
import os
from django.core.validators import URLValidator
from nightmare_pdf.settings import pdf_settings
from django.http import (
	HttpResponse,
	Http404
)
from django.core.files.base import ContentFile
from .models import PdfDoc
from .utils import get_random_filename

validate_url = URLValidator(schemes=['https', 'http'])

class PDFGenerator(object):

	def __init__(self, url, timeout=1000, page_size='A4', landscape=0,
				 print_background=1, margins_type=1, script=pdf_settings.DEFAULT_RENDER_SCRIPT,
				 temp_dir=pdf_settings.DEFAULT_TEMP_DIR):
		validate_url(url)
		self.url = url
		self.filename = self.__get_random_filename()
		self.filepath = self.__get_filepath()
		self.timeout = timeout
		self.page_size = page_size
		self.landscape = landscape
		self.print_background = print_background
		self.margins_type = margins_type
		self.script = script
		self.temp_dir = temp_dir
		self.pdf_data = None
		self.__generate()
		self.__set_pdf_data()
		self.__remove_source_file()

	def __get_random_filename(self):
		name = get_random_filename(20)
		return "%s.pdf" % name

	def __get_filepath(self):
		return os.path.join(pdf_settings.DEFAULT_TEMP_DIR, self.filename)

	def __generate(self):
		"""
		call the following command:
			node render_pdf.js [url] [filepath]
				--timeout [timeout]
				--pageSize [page_size]
				--landscape [landscape]
				--printBackground [print_background]
				--marginsType [margins_type]
		"""
		command = [
			pdf_settings.NODE_PATH,
			self.script,
			self.url,
			self.filepath,
			'--timeout',
			str(self.timeout),
			'--pageSize',
			self.page_size,
			'--landscape',
			str(self.landscape),
			'--printBackground',
			str(self.print_background),
			'--marginsType',
			str(self.margins_type)
		]
		return subprocess.call(command)

	def __set_pdf_data(self):
		with open(self.filepath) as pdf:
			self.pdf_data = pdf.read()

	def get_content_file(self, filename):
		return ContentFile(self.pdf_data, name=filename)

	def get_data(self):
		return self.pdf_data

	def get_http_response(self, filename):
		response = HttpResponse(self.pdf_data, content_type='application/pdf')
		response['Content-Disposition'] = 'attachment; filename="%s.pdf"' % filename
		return response

	def __remove_source_file(self):
		return subprocess.call(['rm', self.filepath])

	def save(self, filename, title='', description=''):
		file = self.get_content_file(filename)
		document = PdfDoc(
			title=title,
			description=description,
			document=file)
		document.save()
		return document


text:
from flask import send_from_directory

from emonitor.socketserver import SocketHandler
from emonitor.extensions import babel, signal
from emonitor.utils import Module
from emonitor.modules.monitors.monitor import Monitor, PlaceholderWidget
from emonitor.modules.monitors.monitorlayout import MonitorLayout
from emonitor.modules.monitors.content_admin import getAdminContent, getAdminData
from emonitor.modules.monitors.content_frontend import getFrontendData

class MonitorsModule(Module):
    """
    Definition of monitor module with frontend, admin and widget area
    """
    info = dict(area=['admin', 'frontend', 'widget'], name='monitors', path='monitors', icon='fa-desktop', version='0.1')

    def __repr__(self):
        return "monitors"

    def __init__(self, app):
        Module.__init__(self, app)

        # add template path
        app.jinja_loader.searchpath.append("%s/emonitor/modules/monitors/templates" % app.config.get('PROJECT_ROOT'))

        # subnavigation
        self.adminsubnavigation = [('/admin/monitors', 'monitors.definition'), ('/admin/monitors/style', 'module.monitors.style'), ('/admin/monitors/current', 'module.monitors.current'), ('/admin/monitors/actions', 'module.monitors.actions')]
        self.widgets = [PlaceholderWidget('placeholder')]

        signal.connect('monitorserver', 'clientsearchdone', frontendMonitorHandler.handleClientSearch)
        signal.connect('monitorserver', 'clientanswer', frontendMonitorHandler.handleClientAnswer)

        # static folders
        @app.route('/monitors/inc/<path:filename>')
        def monitors_static(filename):
            return send_from_directory("%s/emonitor/modules/monitors/inc/" % app.config.get('PROJECT_ROOT'), filename)

        # translations
        babel.gettext(u'module.monitors')
        babel.gettext(u'monitors.definition')
        babel.gettext(u'module.monitors.style')
        babel.gettext(u'module.monitors.current')
        babel.gettext(u'module.monitors.actions')
        babel.gettext(u'monitors.landscape')
        babel.gettext(u'monitors.portrait')
        babel.gettext(u'monitors.orientation.0')
        babel.gettext(u'monitors.orientation.1')
        babel.gettext(u'placeholder')

    def checkDefinition(self):
        if Monitor.query.count() == 0:
            return Module.INITNEEDED
        return Module.CHECKOK

    def getAdminContent(self, **params):
        """
        Call *getAdminContent* of monitor class

        :param params: send given parameters to :py:class:`emonitor.modules.monitors.content_admin.getAdminContent`
        """
        return getAdminContent(self, **params)

    def getAdminData(self):
        """
        Call *getAdminData* method of monitors class and return values

        :return: return result of method
        """
        return getAdminData(self)

    def getFrontendData(self):
        """
        Call *getFrontendData* of monitors class
        """
        from emonitor.modules.monitors.content_frontend import getFrontendData
        return getFrontendData(self)

    @staticmethod
    def handleEvent(eventname, **kwargs):
        """DEPRECATED test method"""
        kwargs['monitors_ret'] = 'yyy'
        from time import sleep

        sleep(10)
        return kwargs

class frontendMonitorHandler(SocketHandler):
    """Event handler for frontend events of monitor class"""
    @staticmethod
    def handleClientSearch(sender, **extra):
        """Deliver result of client search"""
        SocketHandler.send_message(sender, **extra)

    @staticmethod
    def handleClientAnswer(sender, **extra):
        """Deliver data from client answer"""
        SocketHandler.send_message(sender, **extra)


text:
<Alloy>
	<View id="statusBar" class="customStatusBar" layout="composite">
		<View id="barLeftButton" class="customStatusBarLeftButton">
			<ImageView id="barBackIcon" class="customStatusBarLeftButtonArrow"></ImageView>
			<ImageView class="customStatusBarLeftButtonSymbol"></ImageView>
		</View>
		<Label id="barTitle" class="customStatusBarTitle"></Label>
		<View id="barRightButton" class="customStatusBarRightButton">
			<ImageView class="customStatusBarRightButtonSymbol"></ImageView>
		</View>
	</View>
</Alloy>


text:
using System;
using System.ComponentModel.Composition;
using System.Reactive.Linq;
using GitHub.ViewModels;
using Octokit;
using ReactiveUI;
using NullGuard;

namespace GitHub.Authentication
{
    [Export(typeof(ITwoFactorChallengeHandler))]
    [PartCreationPolicy(CreationPolicy.Shared)]
    public class TwoFactorChallengeHandler : ReactiveObject, ITwoFactorChallengeHandler
    {
        ITwoFactorDialogViewModel twoFactorDialog;
        [AllowNull]
        public IViewModel CurrentViewModel
        {
            [return:AllowNull]
            get { return twoFactorDialog; }
            private set { this.RaiseAndSetIfChanged(ref twoFactorDialog, (ITwoFactorDialogViewModel)value); }
        }

        public void SetViewModel([AllowNull]IViewModel vm)
        {
            CurrentViewModel = vm;
        }

        public IObservable<TwoFactorChallengeResult> HandleTwoFactorException(TwoFactorAuthorizationException exception)
        {
            var userError = new TwoFactorRequiredUserError(exception);
            return twoFactorDialog.Show(userError)
                .ObserveOn(RxApp.MainThreadScheduler)
                .SelectMany(x =>
                    x == RecoveryOptionResult.RetryOperation
                        ? Observable.Return(userError.ChallengeResult)
                        : Observable.Throw<TwoFactorChallengeResult>(exception));
        }
    }
}


text:
<?php
namespace Payum\Request;

interface SecuredRequestInterface
{
    /**
     * @return \Payum\Security\TokenInterface
     */
    function getToken();
}


text:
#include "header.h"

extern sig_atomic_t atomic_fggpid;

/*
 * sigchld_handler - The kernel sends a SIGCHLD to the shell
 *    whenever a child job terminates (becomes a zombie), or
 *    stops because it received a SIGSTOP or SIGTSTP signal.
 *    The handler reaps all available zombie children, but
 *    doesn't wait for any other currently running children
 *    to terminate.
 */
void sigchld_handler(int sig)
{
    int status, olderrno = errno;
    sigset_t mask_all, prev_all;
    pid_t pid;
    struct job_t *job;

    Log("REAP [0]\n", 9);

    Sigfillset(&mask_all);

    while (TRUE) {

        pid = waitpid(-1, &status, WNOHANG | WUNTRACED);

        /* `waitpid` returns 0 when no children are left
         * to be reaped, this accounts for stopped processes
         * when error checking at the bottom of
         * the function.
         */
        if (pid == 0) {
            errno = ECHILD;
            break;
        }
        /* `waitpid` returns -1 in the case when
         * there is some other possible error
         * associated when calling it.
         */
        else if (pid < 0) {
            break;
        }

        Sigprocmask(SIG_BLOCK, &mask_all, &prev_all);

        job = getjobpid(jobs, pid);

        /* If process terminated because of a signal
         *      that was not caught, print out a
         *      status message
         */
        if (WIFSIGNALED(status)) {
            printf("Job [%d] (%d) terminated by signal %d\n",
                job->jid, pid, WTERMSIG(status));
        }

        /*
         * If process was stopped we print out
         *      a message notifying this and continue
         *      before deleting the job.
         */
        if (WIFSTOPPED(status)) {
            printf("Job [%d] (%d) stopped by signal %d\n",
                job->jid, pid, WSTOPSIG(status));
            job->state = ST;
            atomic_fggpid = 0;
            /* Skips remaining portion of loop,
             * including unblocking blocked
             * signals so do it here
             */
            Sigprocmask(SIG_SETMASK, &prev_all, NULL);
            continue;
        }

        /* Closes foreground processes which
         * exit without interruption
         * from user sent signals
         */
        if (pid == atomic_fggpid) {
            atomic_fggpid = 0;
        }
        deletejob(jobs, pid);

        Log("REAP [1]\n", 9);

        Sigprocmask(SIG_SETMASK, &prev_all, NULL);
    }

    if (errno != ECHILD) {
        Sio_error("waitpid error\n", 14);
    }

    Log("REAP [2]\n", 9);

    errno = olderrno;
}

/*
 * sigquit_handler - The kernel sends a SIGINT to the shell
 *    whenever the user types ctrl-c at the keyboard. Catch it
 *    and send it along the foreground job.
 */
void sigint_handler(int sig)
{
    int olderrno = errno;
    sigset_t mask, prev;

    Log("TERM [0]\n", 9);

    Sigfillset(&mask);
    Sigprocmask(SIG_BLOCK, &mask, &prev);

    /* There a no currently running foreground jobs to terminate */
    if (!atomic_fggpid) {
        return;
    }

    Log("TERM [1]\n", 9);

    Kill(-atomic_fggpid, SIGINT);

    Log("TERM [2]\n", 9);

    Sigprocmask(SIG_SETMASK, &prev, NULL);

    errno = olderrno;
}

/*
 * sigtstp_handler - The kernel sends a SIGSTP to the shell
 *    whenever the user types ctrl-z at the keyboard. Catch
 *    it and suspend the foreground job by sending it a
 *    SIGSTP.
 */
void sigtstp_handler(int sig)
{
    int olderrno = errno;
    sigset_t mask, prev;

    Log("STOP [0]\n", 9);

    Sigfillset(&mask);
    Sigprocmask(SIG_BLOCK, &mask, &prev);

    /* There are no currently running foreground jobs to stop */
    if (!atomic_fggpid) {
        return;
    }

    Log("STOP [1]\n", 9);

    Kill(-atomic_fggpid, SIGTSTP);

    Log("STOP [2]\n", 9);

    Sigprocmask(SIG_SETMASK, &prev, NULL);

    errno = olderrno;
}

/*
 * sigquit_handler - The driver program can gracefully terminate
 *    the child shell by sending it a SIGQUIT signal
 */
void sigquit_handler(int sig)
{
    printf("Terminating after receipt of SIGQUIT signal\n");
    exit(1);
}


text:
import os
from setuptools import setup

exec(open(os.path.join(os.path.dirname(__file__), 'src', 'rosdep2', '_version.py')).read())

setup(
    name='rosdep',
    version=__version__,  # noqa:F821
    packages=['rosdep2', 'rosdep2.platforms'],
    package_dir={'': 'src'},
    install_requires=['catkin_pkg', 'rospkg >= 1.0.37', 'rosdistro >= 0.4.0', 'PyYAML >= 3.1'],
    test_suite='nose.collector',
    test_requires=['mock', 'nose >= 1.0'],
    scripts=['scripts/rosdep', 'scripts/rosdep-source'],
    author='Tully Foote, Ken Conley',
    author_email='tfoote@osrfoundation.org',
    url='http://wiki.ros.org/rosdep',
    download_url='http://download.ros.org/downloads/rosdep/',
    keywords=['ROS'],
    classifiers=[
        'Programming Language :: Python',
        'License :: OSI Approved :: BSD License'],
    description='rosdep package manager abstrction tool for ROS',
    long_description='Command-line tool for installing system '
                     'dependencies on a variety of platforms.',
    license='BSD'
)


text:
const cheerio = require('cheerio')
const request = require('request')

const base_url = 'https://github.com'

const api = (url, fn, cb) => {
  request.get(url, (err, res, body) => {
    const $ = cheerio.load(body)
    const $body = $('body')

    if (err) throw err

    fn($, $body, cb)
  })
}

const find = ($body, el) => {
  const $items = $body.find(el)

  return { items: $items, li: [] }
}

const parseRepos = ($, $body, cb) => {
  const { li, items } = find($body, 'li.repo-list-item')

  $(items).each((i, elem) => {
    let el = $(elem)
    let name = el.find('h3.repo-list-name')
    let link = el.find('h3.repo-list-name a').attr('href')
    let description = el.find('p.repo-list-description')
    let meta = el.find('p.repo-list-meta')
    let item = {
      name: parse(name),
      link: `${base_url}${link}`,
      description: parse(description),
      meta: parse(meta)
    }

    li.push(item)
  })

  cb(li)
}

const parseDevs = ($, $body, cb) => {
  const { items, li } = find($body, 'li.user-leaderboard-list-item')

  $(items).each((i, elem) => {
    let el = $(elem)
    let name = el.find('h2.user-leaderboard-list-name')
    let href = el.find('.user-leaderboard-list-name a').attr('href')
    let item = {
      name: parse(name),
      href: `${base_url}${href}`
    }

    li.push(item)
  })

  cb(li)
}

const constructUrl = (lang, time, cb) => {
  const options = {}

  if (typeof (lang) === 'boolean' && typeof (time) === 'string' && typeof (cb) === 'function') {
    options.url = `${base_url}/trending/developers?since=${time}`
    options.callback = cb
  } else if (typeof (lang) === 'boolean' && typeof (time) === 'function') {
    options.url = `${base_url}/trending/developers`
    options.callback = time
  } else if (typeof (lang) === 'string' && typeof (time) === 'string' && typeof (cb) === 'function') {
    options.url = `${base_url}/trending/${lang}?since=${time}`
    options.callback = cb
  } else if (typeof (lang) === 'string' && matchTime(lang) && typeof (time) === 'function') {
    options.url = `${base_url}/trending?since=${lang}`
    options.callback = time
  } else if (typeof (lang) === 'string' && !matchTime(lang) && typeof (time) === 'function') {
    options.url = `${base_url}/trending/${lang}`
    options.callback = time
  } else {
    options.url = `${base_url}/trending`
    options.callback = lang
  }

  return options
}

const parse = el =>
  el.text().split('\n').join('').replace(/ +/g, ' ').trim()

const matchTime = time =>
  /weekly|monthly|daily/i.test(time)

const findRepos = (lang, time, cb) =>
  util(lang, time, cb, parseRepos)

const findDevs = (time, cb) =>
  util(true, time, cb, parseDevs)

const util = (bool, time, cb, fn) => {
  const { url, callback } = constructUrl(bool, time, cb)

  api(url, fn, callback)
}

module.exports = {
  findDevs,
  findRepos,
  constructUrl,
  matchTime
}


text:
zoomLevel = 6;
function map_scatter_draw() {
	var latitude = modules['map_scatter']['variables']['latitude'],
		longitude = modules['map_scatter']['variables']['longitude'],
		size = modules['map_scatter']['variables']['size'],
		group = modules['map_scatter']['variables']['group'],
		text = modules['map_scatter']['variables']['text'];
	if (text == 'none'){
		var mdimension = flight.dimension(function(d){
			return [+d[latitude], +d[longitude], Math.abs(+d[size]), d[group]];
		});
	}
	else{
		var mdimension = flight.dimension(function(d){
			return [+d[latitude], +d[longitude],  Math.abs(+d[size]), d[group], d[text]];
		});
	}
	var	mgroup = mdimension.group(),
		entries = mgroup.all();

	modules['map_scatter']['crossfilter']={'dimension': mdimension, 'group': mgroup};

		$("#map_scatter").remove();
		$("#svg-box-map_scatter").append($('
'));

	    var clat = d3.median(entries, function(d){ return  d.key[0];}),
	    	clong = d3.median(entries, function(d){ return d.key[1];});

  		map_scatter = new google.maps.Map($('#map_scatter')[0], {
    		zoom: zoomLevel,
    		panControl: false,
			overviewMapControl:true,
			streetViewControl:false,
    		zoomControl: true,
    		zoomControlOptions: {
      			style: google.maps.ZoomControlStyle.SMALL,
      			position: google.maps.ControlPosition.RIGHT_TOP
    		},
    		center: new google.maps.LatLng(clat, clong),
    		mapTypeId: google.maps.MapTypeId.ROADMAP,
    		styles: [{'stylers': [{'saturation': -80},{'lightness': -10}]}]
		});
		google.maps.event.addListener(map_scatter, 'zoom_changed', function() {
			var newZoomLevel = map_scatter.getZoom();
			if (Math.abs(newZoomLevel - zoomLevel) > 1) {
				zoomLevel = newZoomLevel;
			}
		});

	map_scatter_update();
}
function map_scatter_update() {
	var r_normalization = 20000,
		colors = d3.scale.category10(),
		entries = modules['map_scatter']['crossfilter']['group'].all(),
		maxk = d3.max(entries, function(d){return d.value>0 ? d.key[2]: -Number.MAX_VALUE;});

  	for (i = 0; i< entries.length; i++) {
  		var entry = entries[i],
  			latlong = new google.maps.LatLng(entry.key[0], entry.key[1]);

		if (entry.value>0) {
			var name = (entry.key.length > 4) ? entry.key[4]: '',
				color =  (modules['map_scatter']['variables']['group'] == 'all') ?  '#00b9e7': colors(entry.key[3]);
			addCircle(map_scatter, entry.key[0], entry.key[1], entry.key[2]*r_normalization/(maxk), name, color );
		}
  	}

  	if (modules['map_scatter']['variables']['group'] != 'all') {

	  	$('#map_scatter').append('

')
	  	for (i = 0; i<colors.rangeExtent().length; i++){
	  		key = colors.domain()[i];
	  		$('#map_scatter-legend').append(
	  			'
'
	  			+ '

'
	  			+ '
'+ key + '
'
	  			+ '
');
	  	}
	  	map_scatter.controls[google.maps.ControlPosition.LEFT_TOP].push(document.getElementById('map_scatter-legend'));
  	}
}

function addCircle(map_scatter, lat, lon, r, name, color){
	// Add circle overlay and bind to marker
	var circle = new google.maps.Circle({
		map: map_scatter,
		center: new google.maps.LatLng(lat, lon),
	 	strokeColor: color,
    	strokeOpacity: 0.8,
    	strokeWeight: 2,
    	fillColor: color,
    	fillOpacity: 0.35,
    	radius: r
	});
 	// Create marker
	if (name && name.length>0){
		var marker = new google.maps.Marker({
			map: map_scatter,
			position: new google.maps.LatLng(lat, lon),
			title: name
		});
		circle.bindTo('center', marker, 'position');
	}
}


text:
package client

import (
	"math/big"

	"github.com/xlab-si/emmy/crypto/pseudsys"
	"github.com/xlab-si/emmy/crypto/schnorr"
	pb "github.com/xlab-si/emmy/proto"
	"google.golang.org/grpc"
)

type PseudonymsysCAClient struct {
	genericClient
	grpcClient pb.PseudonymSystemCAClient
	group      *schnorr.Group
	prover     *schnorr.Prover
}

func NewPseudonymsysCAClient(conn *grpc.ClientConn,
	group *schnorr.Group) (*PseudonymsysCAClient, error) {
	return &PseudonymsysCAClient{
		genericClient: newGenericClient(),
		grpcClient:    pb.NewPseudonymSystemCAClient(conn),
		group:         group,
	}, nil
}

// GenerateMasterNym generates a master pseudonym to be used with GenerateCertificate.
func (c *PseudonymsysCAClient) GenerateMasterNym(secret *big.Int) *pseudsys.Nym {
	p := c.group.Exp(c.group.G, secret)
	return pseudsys.NewNym(c.group.G, p)
}

// GenerateCertificate provides a certificate from trusted CA to the user. Note that CA
// needs to know the user. The certificate is then used for registering pseudonym (nym).
// The certificate contains blinded user's master key pair and a signature of it.
func (c *PseudonymsysCAClient) GenerateCertificate(userSecret *big.Int, nym *pseudsys.Nym) (
	*pseudsys.CACert, error) {

	if err := c.openStream(c.grpcClient, "GenerateCertificate"); err != nil {
		return nil, err
	}
	defer c.closeStream()

	prover, err := schnorr.NewProver(c.group, []*big.Int{userSecret}, []*big.Int{nym.A}, nym.B)
	if err != nil {
		return nil, err
	}
	c.prover = prover
	x := c.prover.GetProofRandomData()
	b := c.prover.Group.Exp(nym.A, userSecret)
	pRandomData := pb.SchnorrProofRandomData{
		X: x.Bytes(),
		A: nym.A.Bytes(),
		B: b.Bytes(),
	}

	initMsg := &pb.Message{
		ClientId: c.id,
		Content: &pb.Message_SchnorrProofRandomData{
			&pRandomData,
		},
	}
	resp, err := c.getResponseTo(initMsg)
	if err != nil {
		return nil, err
	}

	ch := resp.GetBigint()
	challenge := new(big.Int).SetBytes(ch.X1)

	z := c.prover.GetProofData(challenge)[0]
	msg := &pb.Message{
		Content: &pb.Message_SchnorrProofData{
			&pb.SchnorrProofData{
				Z: z.Bytes(),
			},
		},
	}

	resp, err = c.getResponseTo(msg)
	if err != nil {
		return nil, err
	}
	cert := resp.GetPseudonymsysCaCertificate()
	certificate := pseudsys.NewCACert(
		new(big.Int).SetBytes(cert.BlindedA), new(big.Int).SetBytes(cert.BlindedB),
		new(big.Int).SetBytes(cert.R), new(big.Int).SetBytes(cert.S))

	return certificate, nil
}


text:
<?php

namespace phpbb\console\command\cron;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class cron_list extends \phpbb\console\command\command
{
	/** @var \phpbb\cron\manager */
	protected $cron_manager;

	/**
	* Constructor
	*
	* @param \phpbb\user			$user			User instance
	* @param \phpbb\cron\manager	$cron_manager	Cron manager
	*/
	public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager)
	{
		$this->cron_manager = $cron_manager;
		parent::__construct($user);
	}

	/**
	* {@inheritdoc}
	*/
	protected function configure()
	{
		$this
			->setName('cron:list')
			->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_LIST'))
		;
	}

	/**
	* Executes the command cron:list.
	*
	* Prints a list of ready and unready cron jobs.
	*
	* @param InputInterface  $input  An InputInterface instance
	* @param OutputInterface $output An OutputInterface instance
	*
	* @return null
	*/
	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$tasks = $this->cron_manager->get_tasks();

		if (empty($tasks))
		{
			$output->writeln($this->user->lang('CRON_NO_TASKS'));
			return;
		}

		$ready_tasks = array();
		$not_ready_tasks = array();
		foreach ($tasks as $task)
		{
			if ($task->is_ready())
			{
				$ready_tasks[] = $task;
			}
			else
			{
				$not_ready_tasks[] = $task;
			}
		}

		if (!empty($ready_tasks))
		{
			$output->writeln('<info>' . $this->user->lang('TASKS_READY') . '</info>');
			$this->print_tasks_names($ready_tasks, $output);
		}

		if (!empty($ready_tasks) && !empty($not_ready_tasks))
		{
			$output->writeln('');
		}

		if (!empty($not_ready_tasks))
		{
			$output->writeln('<info>' . $this->user->lang('TASKS_NOT_READY') . '</info>');
			$this->print_tasks_names($not_ready_tasks, $output);
		}
	}

	/**
	* Print a list of cron jobs
	*
	* @param array				$tasks A list of task to display
	* @param OutputInterface	$output An OutputInterface instance
	*/
	protected function print_tasks_names(array $tasks, OutputInterface $output)
	{
		foreach ($tasks as $task)
		{
			$output->writeln($task->get_name());
		}
	}
}


text:
Computers::Computers()
{

}

Computers::Computers(string name, int year, string type, bool built)
{
    _name = name;
    _yearBuilt = year;
    _type = type;
    _built = built;
}

Computers::Computers(int id, string name, int year, string type, bool built)
{
    _id = id;
    _name = name;
    _yearBuilt = year;
    _type = type;
    _built = built;
}

string Computers::getName()
{
    return _name;
}

int Computers::getID()
{
    return _id;
}

int Computers::getYearBuilt()
{
    return _yearBuilt;
}

string Computers::getType()
{
    return _type;
}

bool Computers::getBuilt()
{
    return _built;
}


text:
using namespace ME3D;

Transform::Transform( GameObject* holder ) : I_Component(holder)
{
	_positionChanged = true;
	_rotationChanged = true;
	_scaleChanged = true;
	_worldChanged = true;
	_viewChanged = true;

	_positionWorld = Vector3(0, 0, 0);
	_rotationWorld = Quaternion();
	_scaleWorld =	Vector3(1, 1, 1);

	_positionLocal = Vector3(0, 0, 0);
	_rotationLocal = Quaternion();
	_scaleLocal =	Vector3(1, 1, 1);

	_localAxisX = Vector3(1, 0, 0);
	_localAxisY = Vector3(0, 1, 0);
	_localAxisZ = Vector3(0, 0, 1);

	_parentNode = NULL;
}

Vector3 Transform::GetEulerRotationWorld() const
{
	return MathUtility::ToDegrees( MathUtility::QuaternionToEulerAngles( _rotationWorld ) );
}

Vector3 Transform::GetEulerRotationLocal() const
{
	return MathUtility::ToDegrees( MathUtility::QuaternionToEulerAngles( _rotationLocal ) );
}

Matrix4 Transform::GetPositionMatrix()
{
	if (_positionChanged)
	{
		_positionMatrix = MathUtility::Translate( Matrix4::identity, _positionWorld );
		_positionChanged = false;
	}
	return _positionMatrix;
}

Matrix4 Transform::GetRotationMatrix()
{
	if (_rotationChanged)
	{
		_rotationMatrix =  MathUtility::QuaternionToMatrix4( _rotationWorld );
		_rotationChanged = false;
	}
	return _rotationMatrix;
}

Matrix4 Transform::GetScaleMatrix()
{
	if (_scaleChanged)
	{
		_scaleMatrix = MathUtility::Scale( Matrix4::identity, _scaleWorld );
		_scaleChanged = false;
	}
	return _scaleMatrix;
}

Matrix4 Transform::GetWorldMatrix()
{
	if (_worldChanged)
	{
		_worldMatrix = GetPositionMatrix() * GetRotationMatrix() * GetScaleMatrix();
		_worldChanged = false;
	}
	return _worldMatrix;
}

Matrix4 Transform::GetViewMatrix()
{
	if (_viewChanged)
	{
		_viewMatrix = Matrix4::Inverse( GetPositionMatrix() * GetRotationMatrix() );
		_viewChanged = false;
	}
	return _viewMatrix;
}

void Transform::_PositionChanged()
{
	_positionChanged = true;
	_worldChanged = true;
	_viewChanged = true;
}

void Transform::_RotationChanged()
{
	_rotationChanged = true;
	_worldChanged = true;
	_viewChanged = true;
}

void Transform::_ScaleChanged()
{
	_scaleChanged = true;
	_worldChanged = true;
}

void Transform::_UpdateLocalAxis()
{
	_localAxisX = MathUtility::ApplyRotation( _rotationWorld, Vector3(1, 0, 0) );
	_localAxisY = MathUtility::ApplyRotation( _rotationWorld, Vector3(0, 1, 0) );
	_localAxisZ = MathUtility::ApplyRotation( _rotationWorld, Vector3(0, 0, 1) );
}

void Transform::SetPositionWorld( Vector3& value )
{
	Vector3 diff = value - _positionWorld;
	_positionLocal += diff;

	_positionWorld = value;
	_PositionChanged();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculatePosition();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::SetPositionLocal( Vector3& value )
{
	_positionLocal = value;
	RecalculatePosition();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculatePosition();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::TranslateByWorld( Vector3& value )
{
	SetPositionWorld( _positionWorld + value );
}

void Transform::TranslateByLocal( Vector3& value )
{
	Vector3 worldValue = 	_localAxisX * value.x() +
							_localAxisY * value.y() +
							_localAxisZ * value.z();
	SetPositionWorld( _positionWorld + worldValue );
}

void Transform::Translate( Vector3& value, E_SpaceSystem spaceSystem )
{
	switch (spaceSystem)
	{
	case E_SpaceSystem::World:
		TranslateByWorld( value );
		return;
	case E_SpaceSystem::Local:
		TranslateByLocal( value );
		return;
	}
}

void Transform::SetRotationWorld( Quaternion& value )
{
	_rotationWorld = Quaternion::Normalize(value);

	if (_parentNode == NULL)
	{
		_rotationLocal = _rotationWorld;
	}
	else
	{
		_rotationLocal = Quaternion::Normalize( Quaternion::Inverse( _parentNode->GetRotationWorld() ) * value );
	}

	_RotationChanged();
	_UpdateLocalAxis();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateRotation();
		_childNodes[i]->RecalculatePosition();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::SetRotationLocal( Quaternion& value )
{
	_rotationLocal = Quaternion::Normalize(value);
	RecalculateRotation();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateRotation();
		_childNodes[i]->RecalculatePosition();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::SetEulerRotationWorld( Vector3& value )
{
	SetRotationWorld( MathUtility::Vector3ToQuaternion( MathUtility::ToRadians(value) ) );
}

void Transform::SetEulerRotationLocal( Vector3& value )
{
	SetRotationLocal( MathUtility::Vector3ToQuaternion( MathUtility::ToRadians(value) ) );
}

void Transform::RotateByWorld( Vector3& value )
{
	Quaternion rotate = MathUtility::Vector3ToQuaternion( MathUtility::ToRadians(value) );
	SetRotationWorld( rotate * _rotationWorld );
}

void Transform::RotateByLocal( Vector3& value )
{
	Vector3 valueWorld = 	_localAxisX * value.x() +
							_localAxisY * value.y() +
							_localAxisZ * value.z();
	Quaternion rotate = MathUtility::Vector3ToQuaternion( MathUtility::ToRadians(valueWorld) );
	SetRotationWorld( rotate * _rotationWorld );
}

void Transform::Rotate( Vector3& value, E_SpaceSystem spaceSystem )
{
	switch (spaceSystem)
	{
	case E_SpaceSystem::World:
		RotateByWorld( value );
		return;
	case E_SpaceSystem::Local:
		RotateByLocal( value );
		return;
	}
}

void Transform::SetScaleWorld( Vector3& value )
{
	Vector3 diff = value / _scaleWorld;
	_scaleLocal *= diff;

	_scaleWorld = value;
	_ScaleChanged();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateScale();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::SetScaleLocal( Vector3& value )
{
	_scaleLocal = value;
	RecalculateScale();

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateScale();
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::ScaleByConstant( Vector3& value )
{
	SetScaleLocal( _scaleLocal + value );
}

void Transform::RecalculatePosition()
{
	_PositionChanged();

	_positionWorld = _positionLocal;
	if (_parentNode != NULL)
	{
		_positionWorld = MathUtility::ApplyRotation( _parentNode->GetRotationWorld(), _positionWorld );
		_positionWorld += _parentNode->GetPositionWorld();
	}

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculatePosition();
	}
}

void Transform::RecalculateRotation()
{
	_RotationChanged();

	if (_parentNode != NULL)
	{
		_rotationWorld = Quaternion::Normalize( _parentNode->GetRotationWorld() * _rotationLocal );
	}
	else
	{
		_rotationWorld = _rotationLocal;
	}

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateRotation();
		_childNodes[i]->RecalculatePosition();
	}

	_UpdateLocalAxis();
}

void Transform::RecalculateScale()
{
	_ScaleChanged();

	_scaleWorld = _scaleLocal;
	if (_parentNode != NULL)
	{
		_scaleWorld *= _parentNode->GetScaleWorld();
	}

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		_childNodes[i]->RecalculateScale();
	}
}

void Transform::SetParentNode( Transform* parentNode )
{
	if (_parentNode != parentNode)
	{
		Transform* lastParent = _parentNode;
		_parentNode = parentNode;

		if (parentNode != NULL)
		{
			parentNode->AddChildNode(this);
			_positionLocal = _positionWorld - parentNode->GetPositionWorld();
			_rotationLocal = _rotationWorld * Quaternion::Inverse( parentNode->GetRotationWorld() );
			_scaleLocal = _scaleWorld / parentNode->GetScaleWorld();
		}
		else
		{
			_positionLocal = _positionWorld;
			_rotationLocal = _rotationWorld;
			_scaleLocal = _scaleWorld;
		}

		if (lastParent != NULL)
		{
			lastParent->_RemoveChildNode(this);
		}
	}

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::AddChildNode( Transform* childNode )
{
	if (childNode == NULL)		return;

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		if (_childNodes[i] == childNode)
		{
			return;
		}
	}
	_childNodes.push_back(childNode);
	childNode->SetParentNode(this);

	if (_emitEvents)
		Systems::Event()->EmitEvent( E_EventType::Component, E_EventName::Transform_Changed, this );
}

void Transform::_RemoveChildNode( Transform* childNode )
{
	if (childNode == NULL)	return;

	for (uint i = 0; i < _childNodes.size(); ++i)
	{
		if (_childNodes[i] == childNode)
		{
			_childNodes.erase( _childNodes.begin() + i );

			return;
		}
	}
}

void Transform::S_SetPositionWorld( Vector3& value )
{
	SetPositionWorld(value);
}

void Transform::S_SetPositionLocal( Vector3& value )
{
	SetPositionLocal(value);
}

void Transform::S_TranslateByWorld( Vector3& value )
{
	TranslateByWorld(value);
}

void Transform::S_TranslateByLocal( Vector3& value )
{
	TranslateByLocal(value);
}

void Transform::S_Translate( Vector3& value, const char* spaceSystem )
{
	Translate( value, EnumConvertor::s2e_SpaceSystem[spaceSystem] );
}

void Transform::S_SetRotationWorld( Quaternion& value )
{
	SetRotationWorld(value);
}

void Transform::S_SetRotationLocal( Quaternion& value )
{
	SetRotationLocal(value);
}

void Transform::S_SetEulerRotationWorld( Vector3& value )
{
	SetEulerRotationWorld(value);
}

void Transform::S_SetEulerRotationLocal( Vector3& value )
{
	SetEulerRotationLocal(value);
}

void Transform::S_RotateByWorld( Vector3& value )
{
	RotateByWorld(value);
}

void Transform::S_RotateByLocal( Vector3& value )
{
	RotateByLocal(value);
}

void Transform::S_Rotate( Vector3& value, const char* spaceSystem )
{
	Rotate( value, EnumConvertor::s2e_SpaceSystem[spaceSystem] );
}

void Transform::S_SetScaleWorld( Vector3& value )
{
	SetScaleWorld(value);
}

void Transform::S_SetScaleLocal( Vector3& value )
{
	SetScaleLocal(value);
}

void Transform::S_ScaleByConstant( Vector3& value )
{
	ScaleByConstant(value);
}

Vector3 Transform::S_GetPositionWorld() const
{
	return GetPositionWorld();
}

Quaternion Transform::S_GetRotationWorld() const
{
	return GetRotationWorld();
}

Vector3 Transform::S_GetEulerRotationWorld() const
{
	return GetEulerRotationWorld();
}

Vector3 Transform::S_GetScaleWorld() const
{
	return GetScaleWorld();
}

Vector3 Transform::S_GetPositionLocal() const
{
	return GetPositionLocal();
}

Quaternion Transform::S_GetRotationLocal() const
{
	return GetRotationLocal();
}

Vector3 Transform::S_GetEulerRotationLocal() const
{
	return GetEulerRotationLocal();
}

Vector3 Transform::S_GetScaleLocal() const
{
	return GetScaleLocal();
}

Vector3 Transform::S_GetLocalAxisX() const
{
	return GetLocalAxisX();
}

Vector3 Transform::S_GetLocalAxisY() const
{
	return GetLocalAxisY();
}

Vector3 Transform::S_GetLocalAxisZ() const
{
	return GetLocalAxisZ();
}

Vector3 Transform::S_GetLocalForward() const
{
	return GetLocalForward();
}

void Transform::S_SetParentNode( Transform* parent )
{
	SetParentNode(parent);
}

Transform* Transform::S_GetParentNode() const
{
	return GetParentNode();
}

void Transform::S_AddChildNode( Transform* child )
{
	AddChildNode(child);
}

uint Transform::S_GetChildNodeCount() const
{
	return GetChildNodeCount();
}

Transform* Transform::S_GetChildNodeAt( uint index )
{
	return GetChildNodeAt(index);
}

GameObject* Transform::S_GetHolder() const
{
	return GetHolder();
}