text:
#ifndef HK_VEHICLE_MANAGER_H
#define HK_VEHICLE_MANAGER_H

#include <Physics2012/Dynamics/World/Listener/hkpWorldPostSimulationListener.h>

extern const class hkClass hkpVehicleManagerClass;

class hkpVehicleInstance;

/// A VehicleManager offers a way to simulate a set of vehicles together, and provides an alternative
/// to using actions.
/// It is intended that subclasses will multithread parts of the vehicle simulation, particularly wheel
/// collision detection.
///
/// The following property is assumed to be true of the vehicles in the manager:
/// EITHER ( all the vehicles' chassis and phantoms are added to the world )
/// OR ( none of the vehicles' chassis and phantoms are added to the world ).
class hkpVehicleManager : public hkReferencedObject
{
	public:
		HK_DECLARE_CLASS_ALLOCATOR( HK_MEMORY_CLASS_VEHICLE );
		HK_DECLARE_REFLECTION();

		hkpVehicleManager() { }

		virtual ~hkpVehicleManager();

			/// Register a vehicle with the manager.
			/// \param vehicle the vehicle to be added.
		virtual void addVehicle( hkpVehicleInstance* vehicle );

			/// Remove a vehicle which has been registered with the manager.
			/// \param vehicle the vehicle to be removed.
		virtual void removeVehicle( hkpVehicleInstance* vehicle );

			/// Build array of active vehicles from vehicles registered with the manager.
			/// Inactive vehicles should not be stepped.
		void getActiveVehicles( hkArray< hkpVehicleInstance* >& activeVehicles ) const;

		//
		// Singlethreaded simulation.
		//

			/// Update and simulate all registered vehicles.
			/// The stepInfo must be updated for the current step in order to correctly
			/// calculate vehicles' centers of mass
		virtual void stepVehicles( const hkStepInfo& updatedStepInfo );

		static void stepVehicleArray( hkArray<hkpVehicleInstance*>& activeVehicles, const hkStepInfo& updatedStepInfo );

		//
		// Simple accessors to the array.
		//

			/// Returns the number of registered vehicles.
		inline int getNumVehicles() const;

			/// Read/write access to the vehicle at the specified index.
		inline hkpVehicleInstance& getVehicle( int index );

			/// Read-only access to the vehicle at the specified index.
		inline const hkpVehicleInstance& getVehicle( int index ) const;

		//
		// Adding and removing vehicles to and from the world.
		//

			/// Add the chassis and phantoms of all registered vehicles to the world.
		void addToWorld( hkpWorld* world );

			/// Remove the chassis and phantoms of all registered vehicles from the world.
		void removeFromWorld();

	public:
			/// The array of currently registered vehicles.
		hkArray<hkpVehicleInstance*> m_registeredVehicles;

		hkpVehicleManager( hkFinishLoadedObjectFlag f ) : hkReferencedObject(f), m_registeredVehicles(f) { }
};

#include<Physics2012/Vehicle/Manager/hkpVehicleManager.inl>

#endif // HK_VEHICLE_MANAGER_H

/*
 * Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
 *
 * Confidential Information of Havok.  (C) Copyright 1999-2014
 * Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
 * Logo, and the Havok buzzsaw logo are trademarks of Havok.  Title, ownership
 * rights, and intellectual property rights in the Havok software remain in
 * Havok and/or its suppliers.
 *
 * Use of this software for evaluation purposes is subject to and indicates
 * acceptance of the End User licence Agreement for this product. A copy of
 * the license is included with this software and is also available at www.havok.com/tryhavok.
 *
 */


text:
package org.camunda.bpm.engine.rest.dto.history;

import java.util.Date;
import org.camunda.bpm.engine.history.HistoricProcessInstance;

public class HistoricProcessInstanceDto {

  private String id;
  private String businessKey;
  private String processDefinitionId;
  private String processDefinitionKey;
  private String processDefinitionName;
  private Integer processDefinitionVersion;
  private Date startTime;
  private Date endTime;
  private Date removalTime;
  private Long durationInMillis;
  private String startUserId;
  private String startActivityId;
  private String deleteReason;
  private String rootProcessInstanceId;
  private String superProcessInstanceId;
  private String superCaseInstanceId;
  private String caseInstanceId;
  private String tenantId;
  private String state;

  public String getId() {
    return id;
  }

  public String getBusinessKey() {
    return businessKey;
  }

  public String getProcessDefinitionId() {
    return processDefinitionId;
  }

  public String getProcessDefinitionKey() {
    return processDefinitionKey;
  }

  public String getProcessDefinitionName() {
    return processDefinitionName;
  }

  public Integer getProcessDefinitionVersion() {
    return processDefinitionVersion;
  }

  public Date getStartTime() {
    return startTime;
  }

  public Date getEndTime() {
    return endTime;
  }

  public Long getDurationInMillis() {
    return durationInMillis;
  }

  public String getStartUserId() {
    return startUserId;
  }

  public String getStartActivityId() {
    return startActivityId;
  }

  public String getDeleteReason() {
    return deleteReason;
  }

  public String getSuperProcessInstanceId() {
    return superProcessInstanceId;
  }

  public String getSuperCaseInstanceId() {
    return superCaseInstanceId;
  }

  public String getCaseInstanceId() {
    return caseInstanceId;
  }

  public String getTenantId() {
    return tenantId;
  }

  public String getState() {
    return state;
  }

  public void setState(String state) {
    this.state = state;
  }

  public Date getRemovalTime() {
    return removalTime;
  }

  public void setRemovalTime(Date removalTime) {
    this.removalTime = removalTime;
  }

  public String getRootProcessInstanceId() {
    return rootProcessInstanceId;
  }

  public void setRootProcessInstanceId(String rootProcessInstanceId) {
    this.rootProcessInstanceId = rootProcessInstanceId;
  }

  public static HistoricProcessInstanceDto fromHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {

    HistoricProcessInstanceDto dto = new HistoricProcessInstanceDto();

    dto.id = historicProcessInstance.getId();
    dto.businessKey = historicProcessInstance.getBusinessKey();
    dto.processDefinitionId = historicProcessInstance.getProcessDefinitionId();
    dto.processDefinitionKey = historicProcessInstance.getProcessDefinitionKey();
    dto.processDefinitionName = historicProcessInstance.getProcessDefinitionName();
    dto.processDefinitionVersion = historicProcessInstance.getProcessDefinitionVersion();
    dto.startTime = historicProcessInstance.getStartTime();
    dto.endTime = historicProcessInstance.getEndTime();
    dto.removalTime = historicProcessInstance.getRemovalTime();
    dto.durationInMillis = historicProcessInstance.getDurationInMillis();
    dto.startUserId = historicProcessInstance.getStartUserId();
    dto.startActivityId = historicProcessInstance.getStartActivityId();
    dto.deleteReason = historicProcessInstance.getDeleteReason();
    dto.rootProcessInstanceId = historicProcessInstance.getRootProcessInstanceId();
    dto.superProcessInstanceId = historicProcessInstance.getSuperProcessInstanceId();
    dto.superCaseInstanceId = historicProcessInstance.getSuperCaseInstanceId();
    dto.caseInstanceId = historicProcessInstance.getCaseInstanceId();
    dto.tenantId = historicProcessInstance.getTenantId();
    dto.state = historicProcessInstance.getState();

    return dto;
  }

}

redpajama_set_name: RedPajamaGithub


text:
package com.wy.tool;

import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.RequestProcessor;

public class SelfRequestProcessor extends RequestProcessor {
	public SelfRequestProcessor() {
	}

	protected boolean processPreprocess(HttpServletRequest request,
			HttpServletResponse response) {
		super.processPreprocess(request, response);
		try {
			request.setCharacterEncoding("gb2312");
		} catch (UnsupportedEncodingException ex) {
			ex.printStackTrace();
		}
		return true;
	}
}


text:
@interface XMASAlert : NSObject

- (void)flashMessage:(NSString *)message;
- (void)flashMessage:(NSString *)message withLogging:(BOOL)shouldLogMessage;
- (void)flashComfortingMessageForException:(NSException *)exception;

@end


text:
'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactAddonsPureRenderMixin = require('react-addons-pure-render-mixin');

var _reactAddonsPureRenderMixin2 = _interopRequireDefault(_reactAddonsPureRenderMixin);

var _svgIcon = require('../../svg-icon');

var _svgIcon2 = _interopRequireDefault(_svgIcon);

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

var DeviceLocationSearching = _react2.default.createClass({
  displayName: 'DeviceLocationSearching',

  mixins: [_reactAddonsPureRenderMixin2.default],

  render: function render() {
    return _react2.default.createElement(
      _svgIcon2.default,
      this.props,
      _react2.default.createElement('path', { d: 'M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z' })
    );
  }
});

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


text:
module Parsers
  module Device

    def identify_device
      if @user_agent.os == :adr

        if @user_agent_string =~ /Mobile/
          @user_agent.device = :m
        elsif @user_agent_string =~ /Tablet/
          @user_agent.device = :t
        else
          @user_agent.device = :t #Google Nexus. Ver link acima.
        end

      else
        @user_agent.device = :oth
      end
    end

  end
end


text:
<?php
use DreamFactory\Library\Utility\Enums\Verbs;
use DreamFactory\Core\Enums\ApiOptions;
use DreamFactory\Core\Enums\DataFormats;
use DreamFactory\Core\MongoDb\Services\MongoDb;
use DreamFactory\Core\MongoDb\Resources\Schema;
use DreamFactory\Core\MongoDb\Resources\Table;
use DreamFactory\Core\Testing\TestServiceRequest;

class MongoDbTest extends \DreamFactory\Core\Testing\DbServiceTestCase
{
    /**
     * @const string
     */
    const SERVICE_NAME = 'mongo';
    /**
     * @const string
     */
    const TABLE_NAME = 'todo';
    /**
     * @const string
     */
    const TABLE_ID = Table::DEFAULT_ID_FIELD;

    /**
     * @var MongoDb
     */
    protected $service = null;

    public function setup()
    {
        parent::setup();

        $options =
            ['username' => env('MONGODB_USER'), 'password' => env('MONGODB_PASSWORD'), 'db' => env('MONGODB_DB')];
        $this->service = new MongoDb(
            [
                'name'        => static::SERVICE_NAME,
                'label'       => 'MongoDB Database',
                'description' => 'MongoDB database for testing',
                'is_active'   => true,
                'type'        => 'mongodb',
                'config'      => ['dsn' => env('MONGODB_DSN'), 'options' => $options]
            ]
        );
    }

    public function tearDown()
    {
        parent::tearDown();
    }

    protected function buildPath($path = '')
    {
        return $this->prefix . '/' . static::SERVICE_NAME . '/' . $path;
    }

    /************************************************
     * Testing GET
     ************************************************/

    public function testDefaultResources()
    {
        $request = new TestServiceRequest();
        $rs = $this->service->handleRequest($request);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertCount(2, $data[static::$wrapper]);
//        $this->assert( '_schema', $data[static::$wrapper] );
//        $this->assertCount( 3, $data[static::$wrapper] );
//        $this->assertArrayHasKey( '_table', $data[static::$wrapper] );
//        $this->assertCount( 3, $data[static::$wrapper] );
    }

    public function testSchemaEmpty()
    {
        $request = new TestServiceRequest();
        $rs = $this->service->handleRequest($request, Schema::RESOURCE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertEmpty($data[static::$wrapper]);
    }

    public function testCreateTable()
    {
        $request = new TestServiceRequest(Verbs::POST);
        $rs = $this->service->handleRequest($request, Schema::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey('name', $data);
        $this->assertSame(static::TABLE_NAME, $data['name']);
    }

    public function testGetRecordsEmpty()
    {
        $request = new TestServiceRequest();
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertEmpty($data[static::$wrapper]);
    }

    public function testCreateRecords()
    {
        $payload = '[
            {
                "_id": 1,
                "name": "test1",
                "complete": false
            },
            {
                "_id": 2,
                "name": "test2",
                "complete": true
            },
            {
                "_id": 3,
                "name": "test3"
            }
	    ]';

        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }
        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertCount(3, $data[static::$wrapper]);
    }

    public function testGetRecordById()
    {
        $request = new TestServiceRequest();
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/1');
        $data = $rs->getContent();
        $this->assertTrue($data[Table::DEFAULT_ID_FIELD] == 1);
    }

    public function testGetRecordsByIds()
    {
        $request = new TestServiceRequest(Verbs::GET, [ApiOptions::IDS => '1,2,3']);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $ids = implode(",", array_column($data[static::$wrapper], Table::DEFAULT_ID_FIELD));
        $this->assertTrue($ids == "1,2,3");
    }

    public function testResourceNotFound()
    {
        $request = new TestServiceRequest(Verbs::GET);
        try {
            $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/5');
            $this->assertTrue(false);
        } catch (\Exception $ex) {
            $this->assertInstanceOf('\DreamFactory\Core\Common\Exceptions\RestException', $ex);
            $this->assertEquals(404, $ex->getCode());
        }
    }

    /************************************************
     * Testing POST
     ************************************************/

    public function testCreateRecord()
    {
        $payload = '[{"name":"test4","complete":false}]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }
        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertCount(1, $data[static::$wrapper]);
    }

    public function testCreateRecordsNoWrap()
    {
        $payload = '[
		{
			"name": "test5",
			"complete": false
		},
		{
			"name": "test6",
			"complete": true
		}
	]';

        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $expected = '[{"id":5},{"id":6}]';
        if (static::$wrapper) {
            $expected = '{' . static::$wrapper . ': ' . $payload . '}';
        }
        $this->assertTrue($rs->getContent() == $expected);
    }

    public function testCreateRecordReturnFields()
    {
        $payload = '[{"name":"test7","complete":true}]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }

        $request = new TestServiceRequest(Verbs::POST, [ApiOptions::FIELDS => 'name,complete']);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $data = $rs->getContent();
        $this->assertArrayHasKey(static::$wrapper, $data);
        $this->assertCount(1, $data[static::$wrapper]);
        $this->assertArrayHasKey('name', $data[static::$wrapper][0]);
        $this->assertArrayHasKey('complete', $data[static::$wrapper][0]);
    }

    public function testCreateRecordsWithContinue()
    {
        $payload = '[
            {
                "name": "test8",
                "complete": false
            },
            {
                "name": "test5",
                "complete": true
            },
            {
                "name": "test9",
                "complete": null
            }
        ]';

        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }
        $request = new TestServiceRequest(Verbs::POST, [ApiOptions::CONTINUES => true]);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $err = '{"error":{"context":{"error":[1],' . static::$wrapper . ':[{"id":8},"SQLSTATE[23000]: ';
        $this->assertContains($err, $rs->getContent());
        $this->assertContains("Duplicate entry 'test5'", $rs->getContent());
    }

    public function testCreateRecordsWithRollback()
    {
        $payload = '[
            {
                "name": "testRollback",
                "complete": false
            },
            {
                "name": "test5",
                "complete": true
            },
            {
                "name": "testAfter"
            }
        ]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }

        $request = new TestServiceRequest(Verbs::POST, [ApiOptions::ROLLBACK => true]);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $err =
            '{"error":{"context":{"error":[1],' .
            static::$wrapper .
            ':[{"id":11},"SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry \'test5\'';
        $this->assertContains($err, $rs->getContent());
    }

    public function testCreateRecordBadRequest()
    {
        $payload = '[{"name":"test1", "complete":true}]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }

        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
    }

    public function testCreateRecordFailNotNullField()
    {
        $payload = '[{"name":null, "complete":true}]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }

        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $this->assertContains('{"error":{"context":null,"message":"Field \'name\' can not be NULL.","code":400}}',
            $rs->getContent());
    }

    public function testCreateRecordFailMissingRequiredField()
    {
        $payload = '[{"complete":true}]';
        if (static::$wrapper) {
            $payload = '{' . static::$wrapper . ': ' . $payload . '}';
        }

        $request = new TestServiceRequest(Verbs::POST);
        $request->setContent($payload, DataFormats::JSON);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME);
        $this->assertContains('{"error":{"context":null,"message":"Required field \'name\' can not be NULL.","code":400}}',
            $rs->getContent());
    }

//    /************************************************
//     * Testing PUT
//     ************************************************/
//
//    public function testPUTRecordById()
//    {
//        $this->testPATCHRecordById( Verbs::PUT );
//    }
//
//    public function testPUTRecordByIds()
//    {
//        $this->testPATCHRecordByIds( Verbs::PUT );
//    }
//
//    public function testPUTRecordBulk()
//    {
//        $this->testPATCHRecordBulk( Verbs::PUT );
//    }
//
//    /************************************************
//     * Testing PATCH
//     ************************************************/
//
//    public function testPATCHRecordBulkWithRollback( $verb = Verbs::PATCH )
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{
//                        "id":1,
//                        "description":"unit-test-d1",
//                        "label":"unit-test-l1"
//                    },
//                    {
//                        "id":2,
//                        "name":"db",
//                        "description":"unit-test-d2",
//                        "label":"unit-test-l2"
//                    },
//                    {
//                        "id":3,
//                        "description":"unit-test-d3",
//                        "label":"unit-test-l3"
//                    }]';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo?rollback=true'), $payload );
//        $this->assertContains(
//            '{"error":{"context":null,"message":"Failed to update resource: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry \'db\' ',
//            $rs->getContent()
//        );
//        $this->assertResponseStatus( 500 );
//
//        $result = $this->call( Verbs::GET, $this->buildPath( '_table/todo?ids=1,2,3') );
//        $ra = json_decode( $result->getContent(), true );
//        $dColumn = implode( ",", array_column( $ra[static::$wrapper], 'description' ) );
//        $lColumn = implode( ",", array_column( $ra[static::$wrapper], 'label' ) );
//
//        $this->assertEquals( "Local Database,Local Database 2,Local Database 3", $dColumn );
//        $this->assertEquals( "Database,Database 2,Database 3", $lColumn );
//    }
//
//    public function testPATCHRecordById( $verb = Verbs::PATCH )
//    {
//        $payload = '{
//                        "description":"unit-test-string"
//                    }';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo/1'), $payload );
//        $this->assertContains( '{"id":1}', $rs->getContent() );
//
//        $result = $this->call( Verbs::GET, $this->buildPath( '_table/todo/1') );
//        $resultArray = json_decode( $result->getContent(), true );
//
//        $this->assertEquals( "unit-test-string", $resultArray['description'] );
//    }
//
//    public function testPATCHRecordByIds( $verb = Verbs::PATCH )
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{
//                        "description":"unit-test-description",
//                        "label":"unit-test-label"
//                    }]';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo?ids=1,2,3'), $payload );
//        $this->assertContains( '{"record":[{"id":1},{"id":2},{"id":3}]}', $rs->getContent() );
//
//        $result = $this->call( Verbs::GET, $this->buildPath( '_table/todo?ids=1,2,3') );
//        $ra = json_decode( $result->getContent(), true );
//        $dColumn = implode( ",", array_column( $ra[static::$wrapper], 'description' ) );
//        $lColumn = implode( ",", array_column( $ra[static::$wrapper], 'label' ) );
//
//        $this->assertEquals( "unit-test-description,unit-test-description,unit-test-description", $dColumn );
//        $this->assertEquals( "unit-test-label,unit-test-label,unit-test-label", $lColumn );
//    }
//
//    public function testPATCHRecordBulk( $verb = Verbs::PATCH )
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{
//                        "id":1,
//                        "description":"unit-test-d1",
//                        "label":"unit-test-l1"
//                    },
//                    {
//                        "id":2,
//                        "description":"unit-test-d2",
//                        "label":"unit-test-l2"
//                    },
//                    {
//                        "id":3,
//                        "description":"unit-test-d3",
//                        "label":"unit-test-l3"
//                    }]';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo'), $payload );
//        $this->assertContains( '{"record":[{"id":1},{"id":2},{"id":3}]}', $rs->getContent() );
//
//        $result = $this->call( Verbs::GET, $this->buildPath( '_table/todo?ids=1,2,3') );
//        $ra = json_decode( $result->getContent(), true );
//        $dColumn = implode( ",", array_column( $ra[static::$wrapper], 'description' ) );
//        $lColumn = implode( ",", array_column( $ra[static::$wrapper], 'label' ) );
//
//        $this->assertEquals( "unit-test-d1,unit-test-d2,unit-test-d3", $dColumn );
//        $this->assertEquals( "unit-test-l1,unit-test-l2,unit-test-l3", $lColumn );
//    }
//
//    public function testPATCHRecordBulkWithFields( $verb = Verbs::PATCH )
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{
//                        "id":1,
//                        "description":"unit-test-d1",
//                        "label":"unit-test-l1"
//                    },
//                    {
//                        "id":2,
//                        "description":"unit-test-d2",
//                        "label":"unit-test-l2"
//                    },
//                    {
//                        "id":3,
//                        "description":"unit-test-d3",
//                        "label":"unit-test-l3"
//                    }]';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo?fields=label'), $payload );
//        $this->assertContains( '{"record":[{"label":"unit-test-l1"},{"label":"unit-test-l2"},{"label":"unit-test-l3"}]}', $rs->getContent() );
//    }
//
//    public function testPATCHRecordBulkWithContinue( $verb = Verbs::PATCH )
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{
//                        "id":1,
//                        "description":"unit-test-d1",
//                        "label":"unit-test-l1"
//                    },
//                    {
//                        "id":2,
//                        "name":"db",
//                        "description":"unit-test-d2",
//                        "label":"unit-test-l2"
//                    },
//                    {
//                        "id":3,
//                        "description":"unit-test-d3",
//                        "label":"unit-test-l3"
//                    }]';
//
//        $rs = $this->callWithPayload( $verb, $this->buildPath( '_table/todo?continue=1'), $payload );
//        $this->assertContains( '{"error":{"context":{"errors":[1],"record":[{"id":1},', $rs->getContent() );
//        $this->assertContains( ',{"id":3}]}', $rs->getContent() );
//        $this->assertResponseStatus( 400 );
//
//        $result = $this->call( Verbs::GET, $this->buildPath( '_table/todo?ids=1,2,3') );
//        $ra = json_decode( $result->getContent(), true );
//        $dColumn = implode( ",", array_column( $ra[static::$wrapper], 'description' ) );
//        $lColumn = implode( ",", array_column( $ra[static::$wrapper], 'label' ) );
//
//        $this->assertEquals( "unit-test-d1,Local Database 2,unit-test-d3", $dColumn );
//        $this->assertEquals( "unit-test-l1,Database 2,unit-test-l3", $lColumn );
//    }

    /************************************************
     * Testing DELETE
     ************************************************/

    public function testDeleteRecordById()
    {
        $request = new TestServiceRequest(Verbs::DELETE);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/1');
//        $this->assertEquals( '{"id":1}', $rs->getContent() );

        $request->setMethod(Verbs::GET);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/1');
//        $this->assertEquals( '{"id":1}', $rs->getContent() );
    }

    public function testDeleteRecordByIds()
    {
        $request = new TestServiceRequest(Verbs::DELETE, [ApiOptions::IDS => '2,3']);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/1');
//        $this->assertEquals( '{"record":[{"id":2},{"id":3}]}', $rs->getContent() );

        $request->setMethod(Verbs::GET);
        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/2');

        $rs = $this->service->handleRequest($request, Table::RESOURCE_NAME . '/' . static::TABLE_NAME . '/3');
    }

//    public function testDELETERecordBulk()
//    {
//        $this->testCreateRecords();
//
//        $payload = '[{"id":2},{"id":3}]';
//
//        $rs = $this->callWithPayload( Verbs::DELETE, $this->buildPath( '_table/todo'), $payload );
//        $this->assertEquals( '{"record":[{"id":2},{"id":3}]}', $rs->getContent() );
//
//        $rs = $this->call( Verbs::GET, $this->buildPath( '_table/todo/1') );
//        $data = json_decode( $rs->getContent(), true );
//        $this->assertEquals( "Database", $data['label'] );
//
//        $this->call( Verbs::GET, $this->buildPath( '_table/todo/3') );
//        $this->assertResponseStatus( 404 );
//    }
//
//    public function testDELETERecordBulkWithFields()
//    {
//        DB::table( "services" )->insert(
//            array(
//                [ "name" => "db2", "label" => "Database 2", "description" => "Local Database 2", "is_active" => 1, "type" => "mongodb" ],
//                [ "name" => "db3", "label" => "Database 3", "description" => "Local Database 3", "is_active" => 1, "type" => "mongodb" ]
//            )
//        );
//
//        $payload = '[{"id":2},{"id":3}]';
//
//        $rs = $this->callWithPayload( Verbs::DELETE, $this->buildPath( '_table/todo?fields=name,type'), $payload );
//        $this->assertEquals( '{"record":[{"name":"db2","type":"mongodb"},{"name":"db3","type":"mongodb"}]}', $rs->getContent() );
//    }
//
    public function testDropTable()
    {
        $request = new TestServiceRequest(Verbs::DELETE);
        $rs = $this->service->handleRequest($request, Schema::RESOURCE_NAME . '/' . static::TABLE_NAME);

        $request->setMethod(Verbs::GET);
        $rs = $this->service->handleRequest($request, Schema::RESOURCE_NAME . '/' . static::TABLE_NAME);
    }
}


text:
import java.util.ArrayList;
import java.util.Arrays;

/**
 * The Class Concept.In our case its animals
 */
public class Concept {

	String name="";
	ArrayList<Double> path=new ArrayList<Double>() ; // input path for that concept
	ArrayList<Double> outpath = new ArrayList<Double>(); // output path for that concept

	/**
	 * Instantiates a new concept.
	 */
	public Concept() {
		super();
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Concept [name=" + name + ", path=" + path.toString()
				+ "]";
	}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title> - One Tap Death Finger, DevLog #02</title>
  <meta name="author" content="" />
  <meta name="description" content="The blog of " />
  <link rel="canonical" href="http://celebes.github.io/blog/otdf-devlog-02/" />

  <link href="//fonts.googleapis.com/css?family=Open+Sans:600,800" rel="stylesheet" type="text/css">
  <link rel="shortcut icon" href="/favicon.png">
  <link rel="alternate" type="application/rss+xml" title="" href="http://celebes.github.io/atom.xml" />

  <link rel="stylesheet" href="/assets/css/all.css">
  <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">

I am Krzysztof Gurniak.

    I do all sorts of things related to programming, video games, art and other cool stuff.

    BLOG

    GAMES

    ABOUT ME

  12 October 2014

One Tap Death Finger, DevLog #02

Little update, I just wanted to show that I implemented something called POWER SMASH. Player has a 20% chance to activate it and when he does it extends his attack range to reach nearby enemies. Watch video below if you don't know what I am talking about.

	<video controls="">
		<source src="/assets/movies/otdf/otdf-power-smash.mp4" type="video/mp4" />
		Your browser does not support the HTML5 video tag. Ditch your IE and join the Firefox or Chrome master race!
	</video>

Next I will focus on adding weapons, which extend player's range a little bit until they break and different types of enemies that are harder to beat, meaning they can take more than one hit and can switch sides.

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

    © Krzysztof Gurniak, 2014-2016 — built with Jekyll using Lagom theme


text:
describe('Chicago.core', function() {

	var _c,
		should,
		globals = {
			version : '1.1.0'
		};

	if( typeof require === 'function' ) {
		require('mocha-jsdom')();
		var should = require('should');
	}

	before(function() {
		if( typeof require !== 'undefined' ) {
			global.window.jQuery = require('jquery');
			_c = require('../../../dist/Chicago.js');
		} else {
			_c = window.Chicago;
		}
	});

	describe('#properties', function() {

		it('Property `version` exists', function() {
			_c.should.have.property( 'version' );
		});

		it('Version is correct (' + globals.version + ')', function() {
			_c.version.should.equal( globals.version );
		});

		it('Property `$` exists', function() {
			_c.should.have.property( '$' );
		});

		it('Property `$doc` exists', function() {
			_c.should.have.property( '$doc' );
		});

		it('Property `$win` exists', function() {
			_c.should.have.property( '$win' );
		});

		it('Property `$html` exists', function() {
			_c.should.have.property( '$html' );
		});

		it('Property `$body` exists', function() {
			_c.should.have.property( '$body' );
		});

		it('Property `utils` exists', function() {
			_c.should.have.property( 'utils' );
		});

		it('Property `support` exists', function() {
			_c.should.have.property( 'support' );
		});

		it('Property `modules` exists', function() {
			_c.should.have.property( 'modules' );
		});

	});

	describe('#methods', function() {

		it('Method `noConflict` exists', function() {
			(typeof _c.noConflict === 'undefined').should.not.be.true;
		});

		it('Method `noConflict` is function', function() {
			(typeof _c.noConflict === 'function').should.be.true;
		});

		it('Method `noConflict` returns object', function() {
			var obj = _c.noConflict();
			(typeof obj === 'undefined').should.not.be.true;
			(typeof obj === 'object').should.be.true;
		});

		it('Method `fn` exists', function() {
			(typeof _c.fn === 'undefined').should.not.be.true;
		});

		it('Method `fn` is function', function() {
			(typeof _c.fn === 'function').should.be.true;
		});

		it('Method `module` exists', function() {
			(typeof _c.module === 'undefined').should.not.be.true;
		});

		it('Method `module` binds method to global object', function() {
			_c.module('test', {});
			(typeof _c.test === 'undefined').should.not.be.true;
		});
	});
});


text:
using BugsnagUnity;

public class ManualSession : Scenario
{
    public override void PrepareConfig(string apiKey, string host)
    {
        base.PrepareConfig(apiKey, host);
        Configuration.AutoTrackSessions = false;
    }

    public override void Run()
    {
        Bugsnag.StartSession();
    }
}


text:
using System;
using System.Runtime.CompilerServices;
public class BringUpTest
{
    const int Pass = 100;
    const int Fail = -1;

    [MethodImplAttribute(MethodImplOptions.NoInlining)]
    public static int Args4(int a, int b, int c, int d)
    {
        return a+b+c+d;
    }

    public static int Main()
    {
        int y = Args4(1,2,3,4);
        if (y == 10) return Pass;
        else return Fail;
    }
}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use common\vendor\AppLabels;
use backend\models\Codeset;
use common\vendor\AppConstants;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\Plb3ChecklistDetailSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
/* @var $plb3c_model backend\models\Plb3BalanceSheet */
/* @var $pct string */

$this->title = sprintf('%s %s %s', AppLabels::CHECKLIST, AppLabels::WASTE, Codeset::getCodesetValue(AppConstants::CODESET_PLB3_CHECKLIST_FORM_TYPE_CODE, $pct) );
$this->params['breadcrumbs'][] = ['label' => sprintf("Form %s %s", AppLabels::CHECKLIST, AppLabels::WASTE), 'url' => ['/plb3-checklist/index', '_ppId' => $plb3c_model->power_plant_id]];
$this->params['breadcrumbs'][] = ['label' => sprintf('%s - %s', $plb3c_model->sector->sector_name, $plb3c_model->powerPlant->pp_name), 'url' => ['/plb3-checklist/view', 'id' => $plb3c_model->id]];
$this->params['breadcrumbs'][] = ['label' => AppLabels::BTN_UPDATE, 'url' => ["/plb3-checklist/update", 'id' => $plb3c_model->id]];
$this->params['breadcrumbs'][] = $this->title;
$actionColumn = Yii::$container->get('yii\grid\ActionColumn');
$buttons = array_merge($actionColumn->buttons, [
    'update' => function ($url, $model) {
        return Html::a(' ' . AppLabels::BTN_UPDATE, ['plb3-checklist-detail/update', 'plb3cId' => $model->plb3Checklist->id, 'pct' => $model->plb3cd_form_type_code, 'id' => $model->id], ['class' => 'btn btn-xs btn-info']);
    },
    'update_xs' => function ($url, $model) {
        return Html::a('', ['plb3-checklist-detail/update', 'plb3cId' => $model->plb3Checklist->id, 'pct' => $model->plb3cd_form_type_code, 'id' => $model->id], ['class' => 'tooltip-success', 'data-rel' => 'tooltip', 'data-original-title' => AppLabels::BTN_UPDATE]);
    },
    'view' => function ($url, $model) {
        return Html::a(' ' . AppLabels::BTN_VIEW, ['view', 'pct' => $model->plb3cd_form_type_code, 'plb3cId' => $model->plb3Checklist->id, 'id' => $model->id], ['class' => 'btn btn-xs btn-success']);
    },
    'view_xs' => function ($url, $model) {
        return Html::a('', ['view', 'pct' => $model->plb3cd_form_type_code, 'plb3cId' => $model->plb3Checklist->id, 'id' => $model->id], ['class' => 'tooltip-info', 'data-rel' => 'tooltip', 'data-original-title' => AppLabels::BTN_VIEW]);
    },
    'export' => function ($url, $model) {
        return Html::a(' ' . AppLabels::BTN_EXPORT, ['export', 'id' => $model->id], ['class' => 'btn btn-xs btn-purple']);
    },
    'export_xs' => function ($url, $model) {
        return Html::a('', ['export', 'id' => $model->id], ['class' => 'tooltip-purple', 'data-rel' => 'tooltip', 'data-original-title' => AppLabels::BTN_EXPORT]);
    },
]);
$template = Yii::t('app', AppConstants::GRID_TEMPLATE_DEFAULT_EXTRA, ['additional_buttons' => '{export}', 'additional_buttons_xs' => '
{export_xs}
']);
?>

<?= Html::encode($this->title) ?>

            <?= Html::a(AppLabels::BTN_ADD, ['create', 'plb3cId' => $plb3c_model->id, 'pct' => $pct], ['class' => 'btn btn-sm btn-success']) ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'plb3cd_company_name',
            'plb3cd_industrial_sector',

            [
                'class' => 'yii\grid\ActionColumn',
                'buttons' => $buttons,
                'template' => $template,
            ],
        ],
    ]); ?>


text:
package org.kurento.commons.testing;

/**
 * Category for system tests that test stability.
 *
 * @author Boni Garcia (bgarcia@gsyc.es)
 * @since 5.0.5
 *
 */
public interface SystemStabilityTests extends SystemTests {

}


text:
sent('fetch my laptop').
sent('it \'s on the desk near the window in my office').
sent('enter my office').
sent('sit behind the desk').
sent('there is a bottom drawer').
sent('open it').
sent('my wallet is in it').
sent('bring it to me').
sent('fetch my phone').
sent('it is in my office on the desk to the right').
sent('get my notebook from the top drawer of the cabinet').
sent('the notebook is green').
sent('the notebook is in the front of the drawer in a folder').
sent('get my mug').
sent('it should be on my desk').
sent('go to my office').
sent('get my diary').
sent('it is in my desk').
sent('it is red').
sent('bring my diary').
sent('it is in the top drawer of my desk').
sent('bring the book from my suitcase on the floor beneath the desk').
sent('get me my laptop').
sent('it is near my desk').
sent('bring to me my diary').
sent('the door to the office is unlocked').
sent('the handle is a meter from the floor on the left of the door').
sent('push the handle down').
sent('at the same time push the handle away from you').
sent('the door opens inwards into the office').
sent('the diary is near my desk near the door').
sent('bring the big diary').
sent('the diary is black').
sent('get the records').
sent('they should be on the desk').
sent('they are probably under something').
sent('bring my calendar').
sent('it is in my office near the telephone').
sent('bring the binder on my bookshelf').
sent('it \'s red').
sent('it is thick').
sent('fetch the leftmost papers on the leftmost table in my office').
sent('go to my office').
sent('locate my phone on my desk').
sent('bring it to me').
sent('fetch my pen in my office').
sent('the pen is on the desk near the folder').
sent('fetch my phone from my desk').
sent('it is near the keyboard').
sent('unplug it from the red cable first').
sent('there is a document on the printer on the side of the desk').
sent('bring it to me').
sent('go to my room').
sent('get the phone on the desk').
sent('bring me my coffee in my office').
sent('it \'s on the windowsill').
sent('go to my desk').
sent('click on the link on my monitor').
sent('then enter commands').
sent('print a copy of the commands').
sent('bring me the printouts').
sent('go to my office').
sent('get me my diary').
sent('it is on my desk near the phone').
sent('fetch my mug').
sent('it is in my office on the desk near the phone').
sent('go to office').
sent('open door').
sent('enter office').
sent('turn left').
sent('proceed to the bookcase').
sent('take black folder from bookcase').
sent('hold black folder').
sent('bring black folder to meeting-room').
sent('go to my office').
sent('find a red book on the bottom of my bookshelf').
sent('get the picture on the notice board on the wall in my office').
sent('my mug is in my office').
sent('go into my office').
sent('get my mug').
sent('it is on top of the cabinet on the left of my desk').
sent('go to my office').
sent('open the door').
sent('go to the front of my desk').
sent('open the top drawer on the left of the front of the desk').
sent('take out the small red address-book').
sent('bring the book to me here').
sent('get my keys for me').
sent('they are in my bag under my desk').
sent('take a left turn at the second desk from the office door').
sent('return my laptop on my desk').
sent('get my book from my office').
sent('it \'s green').
sent('it \'s in my drawer on the right of my desk').
sent('fetch my notebook for me').
sent('it is in my office on my desk').
sent('stand in the door of my office').
sent('my notebook is on the left of the desk').
sent('get my book in my office').
sent('it is on the right of my desk').
sent('get my mug for me').
sent('it is on my desk near my computer').
sent('bring me my pen').
sent('it is in the cup on the right of the desk').
sent('the pen is red').
sent('fetch my laptop from my office').
sent('bring it here').
sent('bring me my mug').
sent('it \'s a yellow mug').
sent('it should be near my screen').
sent('get my mug').
sent('it is red').
sent('it is on my davenport in my office').
sent('get my bottle of scotch from the top shelf of the glass cabinet at the rear of my office').
sent('fetch my laptop from my office').
sent('bring it here').
sent('it is on my desk to the right of the grey bookshelf').
sent('i also need the grey adapter').
sent('go to my office').
sent('open the door').
sent('go to my desk').
sent('pick up my diary').
sent('give the diary to me').
sent('i forgot my pen').
sent('grab one from my office').
sent('there should be a pen on my desk').
sent('grab a pen from my office').
sent('there should be one on my desk').
sent('fetch my laptop').
sent('it \'s on my desk near my monitor').
sent('go to my office').
sent('open the door').
sent('walk to my desk').
sent('pick up the black folder near the telephone on the right of my desk').
sent('bring it back to me').
sent('fetch my diary from my office').
sent('the diary is green').
sent('the diary is on the desk to the right').
sent('fetch me anna \'s red cup on her table in the left of my office').
sent('get my phone').
sent('it \'s in my office on the main desk').
sent('get my keys from my office').
sent('they are on top of my desk to the right of the lamp').
sent('go to my office').
sent('fetch my diary').
sent('open the door').
sent('it is on the table directly near you').
sent('it is a blue small book').
sent('bring me my glasses from my office').
sent('they are on my desk').
sent('open the door').
sent('turn left').
sent('there is a bookcase near you').
sent('look at the shelf from the top').
sent('find a blue book').
sent('bring it to me').
sent('go to my office').
sent('go inside').
sent('move to the table in the centre of the room').
sent('pick up the red book on the table near the phone').
sent('bring the red book to the room').
sent('give it to me').
sent('go to my room').
sent('pick up my phone on my desk').
sent('the phone is black').
sent('it is near the mouse on the desk').
sent('my bowl of soup is on the desk in my office').
sent('fetch my bowl for me').
sent('go to my office').
sent('fetch a memo for today \'s meeting').
sent('enter the door').
sent('just move straight').
sent('come to the desk').
sent('look right').
sent('the memo should be in the printer on the left of the desk in the pickup tray').
sent('just grab all the papers').
sent('give them to me').
sent('get the glass-pewter chicken on the windowsill').
sent('bring my keys from the office').
sent('they are in the drawer').
sent('fetch my glasses from my office').
sent('they are on the desk').
sent('pick up my notebook').
sent('it \'s on the desk in my office').
sent('there is a pile of papers in my tray').
sent('bring the green document from the pile').
sent('my important disc is in my office').
sent('quickly bring me the disc in the computer').
sent('eject it from the computer on my desk').
sent('get my diary from my office').
sent('it \'s on the windowsill').
sent('enter my office').
sent('go to my desk on the side of the seat').
sent('open the second drawer on the right side').
sent('take the beige folder').
sent('it should be the bottom folder in the drawer').
sent('take the contents of the folder').
sent('bring it to me').
sent('go to my office').
sent('look on the desk').
sent('bring me the green folder').
sent('get the file from my personal directory').
sent('display for my eyes only').
sent('get the blue pen on top of my desk').
sent('it is large').
sent('fetch the adapter for my computer').
sent('it is on my desk in my office').
sent('disconnect it from the outlet first').
sent('get my telephone in my office').
sent('it \'s on the desk by the window').
sent('get my car keys from the pocket of the jacket on the back of the chair near my desk').
sent('enter my room').
sent('go to my table').
sent('get the laptop on the table').
sent('open the door').
sent('go to the desk near the window').
sent('the cup will be on the desk near the terminal').
sent('pick up the cup').
sent('bring it to me').
sent('get the oven from my office').
sent('it \'s under the desk on the left').
sent('get my item from the cupboard inside my office opposite the door').
sent('go to my office').
sent('get my cup on my desk').
sent('fetch my diary').
sent('it is on my desk near the keyboard').
sent('get my mug').
sent('the blue one').
sent('it \'s in my office on the desk to the left of the computer').
sent('bring me my phone from my office').
sent('the phone is in my jacket').
sent('the jacket is on a hook behind the door').
sent('get the gun').
sent('it \'s inside a book').
sent('fetch my diary from my room').
sent('it is on my desk').
sent('it is a small black diary').
sent('fetch mug from desk on left of my office').
sent('mug in right corner of desk').
sent('go to my office').
sent('fetch my mug').
sent('it is on the desk to the left of the keyboard').
sent('get the book').
sent('it should be in the bookshelf').
sent('go into my office').
sent('get my diary').
sent('it is near the window').
sent('it is on the shelf').
sent('bring my organizer from my desk near my computer on the left').
sent('go into my office').
sent('get my coat').
sent('it should be behind the door').
sent('go to my office').
sent('enter the office').
sent('find my phone').
sent('bring it back to me').
sent('grab my mug on the desk along the wall of my office').
sent('enter the office').
sent('go to the smallest cabinet').
sent('there is a briefcase in the drawer').
sent('bring it to me').
sent('get the black diary on my desk').
sent('there is a telephone on my desk').
sent('go to my office').
sent('open the door').
sent('enter the room').
sent('go to the desk to the right of the door').
sent('pick up the bottle on the desk').
sent('carry the bottle to the room').
sent('go to my office').
sent('open the door').
sent('there is a red cardigan on my chair').
sent('gently bring it to me').
sent('get my phone in my office').
sent('it is on my desk on the left near the computer').
sent('bring me my diary').
sent('it \'s a brown small book on my desk').
sent('bring my cup').
sent('the cup is near my monitor').
sent('it is on the small table').
sent('go to my office').
sent('go to my drawer').
sent('bring me my diary').
sent('the small one').
sent('hurry back').
sent('bring me my yellow notepad from my office').
sent('it is in a pile of books near computer').
sent('go inside the office').
sent('turn left').
sent('there is a cupboard').
sent('open the door of the cupboard').
sent('retrieve the book').
sent('return it to me').
sent('go to my office').
sent('get a crossword from the drawer of my desk').
sent('go to my office').
sent('open the door by depressing the handle').
sent('move into the office').
sent('there is a desk near you').
sent('there is a big red book on top of the desk').
sent('bring the book to me').
sent('get the briefings from my office').
sent('they should be on the table').
sent('i forgot my diary').
sent('fetch it from my office').
sent('it \'s on the top drawer of my desk').
sent('fetch my diary from my office').
sent('it \'s on the top drawer of my desk').
sent('get my pen').
sent('it \'s on my desk to the left of the computer').
sent('it \'s near the keyboard').
sent('go inside my office').
sent('collect from my desk my white mug near my computer').
sent('my desk is on the right of the office').
sent('bring me a book from my office').
sent('the book is in a shelf on my desk').
sent('enter my office').
sent('the cabinet is on top of my desk').
sent('the book is in the cabinet').
sent('it is black').
sent('fetch my mug from my office').
sent('it is on the table').
sent('go into my study').
sent('find my blue book').
sent('go to the desk').
sent('there is a diary in the drawer on the right of the desk').
sent('open the drawer').
sent('take out the diary').
sent('close the drawer').
sent('bring me the diary').
sent('fetch my phone from my office').
sent('open the door to my office').
sent('my desk is against the wall opposite the door').
sent('my phone is on the desk near the white phone on the left of the desk').
sent('bring the phone back to me').
sent('find my folder in my office').
sent('bring the folder now').
sent('go into my office').
sent('find my diary').
sent('go into my office').
sent('turn left').
sent('walk towards the desk').
sent('pick up black folder on the desk').
sent('return it to me in the meeting-room').
sent('bring me my laptop in my case in the bottom drawer of the cabinet').
sent('get the gun').
sent('it \'s inside the desk').


text:
module MarkdownUI
  module Element
    ['../../components/elements/**/*.rb'].each do |dir|
      Dir[File.join(File.dirname(__FILE__), dir)].sort.each { |f| require_relative f }
    end
  end
end


text:
package com.haarman.pebblenotifier.notifications.strategies;

import android.service.notification.StatusBarNotification;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface NotificationTextStrategy {

    @Nullable
    String createTitle(@NotNull StatusBarNotification statusBarNotification);

    @Nullable
    String createText(@NotNull StatusBarNotification statusBarNotification);

}


text:
package org.auraframework.impl.expression;

import java.io.IOException;
import java.util.Set;

import org.auraframework.def.DefDescriptor;
import org.auraframework.def.TypeDef;
import org.auraframework.expression.ExpressionType;
import org.auraframework.expression.Literal;
import org.auraframework.expression.PropertyReference;
import org.auraframework.instance.ValueProvider;
import org.auraframework.system.Location;
import org.auraframework.throwable.AuraRuntimeException;
import org.auraframework.util.AuraTextUtil;
import org.auraframework.util.json.Json;
import org.auraframework.util.json.JsonSerializers.NoneSerializer;

/**
 * a literal number, string, boolean, or null
 */
public class LiteralImpl implements Literal {

    /**
     */
    private static final long serialVersionUID = 2255827488061408651L;
    private final Object value;
    private final Location l;

    public LiteralImpl(Object value, Location l) {
        this.value = value;
        // TODO: get typedef from value
        this.l = l;
    }

    @Override
    public final Location getLocation() {
        return l;
    }

    @Override
    public Object evaluate(ValueProvider vp) {
        return getValue();
    }

    @Override
    public void compile(Appendable out) throws IOException {
        if (value == null) {
            out.append("null");
        } else if (value instanceof String) {
        	out.append('"').append(AuraTextUtil.escapeForJSONString(value.toString())).append('"');
        } else if (value instanceof Number) {
        	out.append(value.toString());
        } else if (value instanceof Boolean) {
        	out.append(value.toString());
        } else {
            throw new AuraRuntimeException("Unexpected literal type in function expression.");
        }
    }

    @Override
    public Object getValue() {
        return value;
    }

    @Override
    public ExpressionType getExpressionType() {
        return ExpressionType.LITERAL;
    }

    @Override
    public DefDescriptor<TypeDef> getReturnTypeDef() {
        return null;
    }

    @Override
    public void gatherPropertyReferences(Set<PropertyReference> propRefs) {
        // none here.
    }

    @Override
    public void setByValue(boolean byValue){
        // literals are always by value
    }

    public static final Serializer SERIALIZER = new Serializer();

    private static class Serializer extends NoneSerializer<LiteralImpl> {
        @Override
        public void serialize(Json json, LiteralImpl value) throws IOException {
            json.writeValue(value.getValue());
        }
    }
}


text:
import React from 'react'
import renderer from 'react-test-renderer'

import disclaimers from '../src/disclaimers'

const MyComponent = ({ title, content }) => Disclaimers[`zebrafish`].content

describe(`Disclaimer`, () => {
  test.each(Object.keys(disclaimers))(`%s matches snapshot`, (disclaimerKey) => {
    const Disclaimer = disclaimers[disclaimerKey]
    const tree = renderer.create(<Disclaimer />).toJSON()
    expect(tree).toMatchSnapshot()
  })
})


text:
'use strict';
angular.module( 'webEmployees' )
	.directive( 'webEmployees', ($q, $stateParams, $state, webEmployees, webEmployeesFactory) => new class extends BaseWebsiteModuleDirective {
		constructor() {
			super( $q, $stateParams, $state, webEmployees, webEmployeesFactory );
			this.object = 'employee';
		}
	} );


text:
#pragma once
#include "aNode.h"
#include <iostream>

/*
dLinkedList definition. implementation is below because it needs to reside within the h file

template <typename Type>
class dLinkedList
{
  dNode<Type> *head;
  dNode<Type> *tail;
  unsigned int length;
  bool direction;   //run direction for ostream&

  dNode<Type> *current;
  unsigned int current_position;
public:
  dLinkedList();
  dLinkedList(const dLinkedList<Type>& rhs);
  ~dLinkedList();

  dLinkedList<Type>& operator=(const dLinkedList<Type>& rhs);

  void Add_List_To_Tail(const dLinkedList<Type>& list);                                       //copyies list to the tail of current list

  //element add/remove/search
  void Add_To_Head(const Type& element);                                                      //adds *new* element to the head of current list. very efficient
  void Add_To_Tail(const Type& element);                                                      //adds *new* element to the tail of current list. very efficient
  void Add_To_Position(const Type& element, const unsigned int pos);                          //adds *new* element to a certain position of current list. pretty efficient. if pos is greater than length, it will be added to the tail

  dLinkedList<Type> operator+(const Type& element);                                           //returns *new* list which has element added to the tail. not recommended, as inefficient
  friend dLinkedList<Type> operator+(const Type& element, const dLinkedList<Type>& list);     //returns *new* list which has element added to the head. not recommended, as inefficient
  dLinkedList<Type> operator+(const dLinkedList<Type>& list);                                 //returns *new* list which has list copied to the tail. not recommended, as inefficient

  dLinkedList<Type>& operator+=(const Type& rhs);                                             //adds *new* element to the tail of current list. efficient
  dLinkedList<Type>& operator+=(const dLinkedList<Type>& rhs);                                //copies *new* list to the tail of current list. efficient

  bool Remove_Head();                                                                         //removes first element if exists and returns true. returns false if list had no elements. very efficient
  bool Remove_Tail();                                                                         //removes last element if exists and returns true. returns false if list had no elements. very efficient
  bool Remove_All();                                                                          //removes all elements from list if exists and returns true. returns false if list had no elements. very efficient
  bool Remove_From_Position(const unsigned int pos);                                          //removes element from position pos if exists and returns true. returns false if list had less than pos elements. improved efficiency

  unsigned int Length() const;                                                                //returns the total number of elements
  Type& operator[](const unsigned int index) const;                                           //returns list as a vector, with its respective element. throws error if index is larger than the list size

  bool Exists(const Type& element) const;                                                     //returns the true if element exists, false if not
  aListSearchResult Search_From_Head(const Type& element) const;                              //searches for element starting from head. if no element is found, will update the return structure accordingly
  aListSearchResult Search_From_Tail(const Type& element) const;                              //searches for element starting from tail. if no element is found, will update the return structure accordingly

  bool Set_Current_Element_Position(unsigned int pos);                                        //sets current element position, and if successful, returns true. if list is empty or pos is larger than size, it will return false
  unsigned int Get_Current_Element_Position();                                                //gets current element position. if list is empty, will throw error
  Type& Current_Element();                                                                    //returns bidirectional access to current element data. if current element is not set, will throw error

  dLinkedList<Type>& operator++();                                                            //advances current element forward (next)
  dLinkedList<Type>& operator--();                                                            //advances current element backward (prev)

  void Set_Run_Direction(bool tail_to_head);                                                  //by default, when outputting with << it will go from head to tail. with this function you can change it otherwise
  friend std::ostream& operator<<(std::ostream& out, const dLinkedList<Type>& rhs);
};
*/

template <typename Type>
class dLinkedList
{
  dNode<Type> *head;
  dNode<Type> *tail;
  unsigned int length;
  bool direction;

  dNode<Type> *current;
  unsigned int current_position;
public:
  unsigned int Length() const
  {
    return length;
  }

  //element add/remove/search
  void Add_To_Head(const Type& element)
  {
    dNode<Type> *p = new dNode<Type>(element);
    if(!p)
      throw "allocation problem";
    p->next = head->next;
    p->prev = head;
    head->next->prev = p;
    head->next = p;
    if(head == tail)
    {
      tail = p;
      current = p;
      current_position = 0;
    }
    length++;
  }

  void Add_To_Tail(const Type& element)
  {
    dNode<Type> *p = new dNode<Type>(element);
    if(!p)
      throw "allocation problem";
    tail->next = p;
    p->prev = tail;
    tail = p;
    length++;
    if(length == 1)
    {
      current = p;
      current_position = 0;
    }
  }

  void Add_To_Position(const Type& element, const unsigned int pos)
  {
    if((pos == 0) || (length == 0))
      Add_To_Head(element); //current is automatically updated here
    else
    if(pos >= length)
      Add_To_Tail(element);
    else
    {
      if(pos < length/2)
      {
        //go head->tail
        unsigned int i = 0;
        dNode<Type> *crt = head;
        dNode<Type> *p = new dNode<Type>(element);

        while(i < pos)
        {
          crt = crt->next;
          i++;
        }

        p->next = crt->next;
        crt->next->prev = p;
        crt->next = p;
        p->prev = crt;
        length++;
      }
      else
      {
        //go tail->head
        unsigned int i = length - 1;
        dNode<Type> *crt = tail;
        dNode<Type> *p = new dNode<Type>(element);

        while(i > pos)
        {
          crt = crt->prev;
          i--;
        }

        p->prev = crt->prev;
        crt->prev->next = p;
        crt->prev = p;
        p->next = crt;
        length++;
      }
    }
  }

  bool Remove_Head()
  {
    if(!head->next)
      return false;

    dNode<Type> *p = head->next;
    head->next = p->next;
    head->next->prev = head;

    if(p == tail)
      tail = head;

    delete p;
    length--;
    if(current == p)
    {
      if(length)
      {
        current = head->next;
        current_position = 0;
      }
      else
        current = head;
    }

    return true;
  }

  bool Remove_Tail()
  {
    if(!head->next)
      return false;

    dNode<Type> *p = tail;
    tail->prev->next = NULL;
    tail = tail->prev;

    delete p;
    length--;
    if(current == p)
    {
      if(length)
      {
        current = head->next;
        current_position = 0;
      }
      else
        current = head;
    }

    return true;
  }

  bool Remove_All()
  {
    if(!head->next)
      return false;

    dNode<Type> *p = head->next;
    while(p)
    {
      dNode<Type> *s = p;
      p = p->next;
      delete s;
    }

    length = 0;
    head->next = NULL;
    tail = head;
    current = head;

    return true;
  }

  bool Remove_From_Position(const unsigned int pos)
  {
    if(pos >= length)
      return false;

    if(pos == 0)
      return Remove_Head();
    else
    {
      if(pos < length/2)
      {
        //go head->tail
        unsigned int i = 0;
        dNode<Type> *crt = head;

        while(i < pos)
        {
          crt = crt->next;
          i++;
        }

        dNode<Type> *p = crt->next;
        crt->next = p->next;
        crt->next->prev = crt;
        delete p;
        if(p == tail)
          tail = crt;
        length--;
        if(current == p)
        {
          if(length)
          {
            current = head->next;
            current_position = 0;
          }
          else
            current = head;
        }
      }
      else
      {
        //go tail->head
        unsigned int i = length - 1;
        dNode<Type> *crt = tail;

        while(i > pos)
        {
          crt = crt->prev;
          i--;
        }

        dNode<Type> *p = crt->prev;
        crt->prev = p->prev;
        crt->prev->next = crt;
        delete p;
        if(p == tail)
          tail = crt;
        length--;
        if(current == p)
        {
          if(length)
          {
            current = head->next;
            current_position = 0;
          }
          else
            current = head;
        }
      }
    }

    return true;
  }

  void Add_List_To_Tail(const dLinkedList<Type>& list)
  {
    dNode<Type> *crt = list.head->next;
    while(crt)
    {
      Add_To_Tail(crt->data);
      crt = crt->next;
    }
  }

  dLinkedList()
  {
    length = 0;
    head = new dNode<Type>;
    if(!head)
      throw "allocation problem";
    tail = head;
    direction = false;
    current = head;
  }

  dLinkedList(const dLinkedList<Type>& rhs)
  {
    length = 0;
    head = new dNode<Type>;
    if(!head)
      throw "allocation problem";
    tail = head;
    direction = false;
    current = head;

    Add_List_To_Tail(rhs);
  }

  ~dLinkedList()
  {
    Remove_All();
    delete head;
  }

  dLinkedList<Type>& operator=(const dLinkedList<Type>& rhs)
  {
    if(this != &rhs)
    {
      Remove_All();
      direction = rhs.direction;
      current = head;
      Add_List_To_Tail(rhs);
    }
    return *this;
  }

  dLinkedList<Type> operator+(const Type& element)
  {
    dLinkedList<Type> result = *this;
    result.Add_To_Tail(element);
    return result;
  }

  friend dLinkedList<Type> operator+(const Type& element, const dLinkedList<Type>& list)
  {
    dLinkedList<Type> result = list;
    result.Add_To_Head(element);
    return result;
  }

  dLinkedList<Type> operator+(const dLinkedList<Type>& list)
  {
    dLinkedList<Type> result = *this;
    result.Add_List_To_Tail(list);
    return result;
  }

  dLinkedList<Type>& operator+=(const Type& rhs)
  {
    Add_To_Tail(rhs);
    return *this;
  }

  dLinkedList<Type>& operator+=(const dLinkedList<Type>& rhs)
  {
    Add_List_To_Tail(rhs);
    return *this;
  }

  Type& operator[](const unsigned int index)
  {
    if(index >= length)
      throw "index is out of bounds";

    if(index < length/2)
    {
      unsigned int i = 0;
      dNode<Type> *p = head->next;

      while(i < index)
      {
        p = p->next;
        i++;
      }
      return p->data;
    }
    else
    {
      unsigned int i = length - 1;
      dNode<Type> *p = tail;

      while(i > index)
      {
        p = p->prev;
        i--;
      }
      return p->data;
    }
  }

  aListSearchResult Search_From_Head(const Type& element) const
  {
    aListSearchResult result;
    unsigned int i = 0;

    result.found = false;

    dNode<Type> *p = head->next;
    while(p)
    {
      if(p->data == element)
      {
        result.position = i;
        result.found = true;
        return result;
      }

      p = p->next;
      i++;
    }

    return result;
  }

  aListSearchResult Search_From_Tail(const Type& element) const
  {
    aListSearchResult result;
    unsigned int i = length - 1;

    result.found = false;

    dNode<Type> *p = tail;
    while((p != head) && p)
    {
      if(p->data == element)
      {
        result.position = i;
        result.found = true;
        return result;
      }

      p = p->prev;
      i--;
    }

    return result;
  }

  bool Set_Current_Element_Position(unsigned int pos)
  {
    if(pos >= length)
      return false;

    while(pos < current_position)
    {
      current = current->prev;
      current_position--;
    }

    while(pos > current_position)
    {
      current = current->next;
      current_position++;
    }

    return true;
  }

  unsigned int Get_Current_Element_Position()
  {
    if(current == head)
      throw "current element not set correctly";

    return current_position;
  }

  Type& Current_Element()
  {
    if(current == head)
      throw "current element not set correctly";

    return current->data;
  }

  dLinkedList<Type>& operator++()
  {
    if(current->next)
    {
      current_position++;
      current = current->next;
    }
    return *this;
  }

  dLinkedList<Type>& operator--()
  {
    if(current->prev != head)
    {
      current = current->prev;
      current_position--;
    }
    return *this;
  }

  void Set_Run_Direction(bool tail_to_head)
  {
    direction = tail_to_head;
  }

  friend std::ostream& operator<<(std::ostream& out, const dLinkedList<Type>& rhs)
  {
    bool direction = rhs.direction;
    if(direction == false)
    {
      dNode<Type> *crt = rhs.head->next;
      if(crt)
      {
        while(crt->next)
        {
          out << crt->data << ", ";
          crt = crt->next;
        }
        out << crt->data;
      }
    }
    else
    {
      dNode<Type> *crt = rhs.tail;
      if(crt != rhs.head)
      {
        while(crt->prev != rhs.head)
        {
          out << crt->data << ", ";
          crt = crt->prev;
        }
        out << crt->data;
      }
    }
    return out;
  }
};


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using LatinDictionaryNoAuth.Data;

namespace LatinDictionaryNoAuth
{
    public class Startup
    {
        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
                .SetBasePath(env.ContentRootPath)
                .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
                .AddEnvironmentVariables();
            Configuration = builder.Build();
        }

        public IConfigurationRoot Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add framework services.
            services.AddMvc();
            // string path = System.Environment.GetEnvironmentVariable("LatinDictionaryNoAuth_Db_Path");
            string path = "/Users/dwendling/workspace/LatinDictionaryNoAuth/Data/latinDictionaryNoAuth.db";
            var connection = $"Filename={path}";
            Console.WriteLine($"connection = {connection}");
            services.AddDbContext<LatinDictionaryWebContext>(options => options.UseSqlite(connection));
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }

        // protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        // {
        //     if (!optionsBuilder.IsConfigured)
        //     {
        //         string sqliteConnectionString = null;

        //         try
        //         {
        //             var connectionString = new SqliteConnectionStringBuilder()
        //             {
        //                 DataSource = Path.Combine(ApplicationData.Current.LocalFolder.Path, "LatinDictionaryNoAuth.db")
        //             };
        //             sqliteConnectionString = connectionString.ToString();
        //         }
        //         catch (InvalidOperationException)
        //         {
        //             var connectionString = new SqliteConnectionStringBuilder()
        //             {
        //                 DataSource = "LatinDictionaryNoAuth.db"
        //             };
        //             sqliteConnectionString = connectionString.ToString();
        //         }

        //         optionsBuilder.UseSqlite(sqliteConnectionString);
        //     }
        // }
    }
}


text:
..
  Normally, there are no heading levels assigned to certain characters as the structure is
  determined from the succession of headings. However, this convention is used in Python's
  Style Guide for documenting which you may follow:

  # with overline, for parts
  * for chapters
  = for sections
  - for subsections
  ^ for subsubsections
  " for paragraphs

#####
Talks
#####

The following talks will be or have been given about restic:

-  2016-01-31: Lightning Talk at the Go Devroom at FOSDEM 2016,
   Brussels, Belgium
-  2016-01-29: `restic - Backups mal
   richtig <https://media.ccc.de/v/c4.openchaos.2016.01.restic>`__:
   Public lecture in German at `CCC Cologne
   e.V. <https://koeln.ccc.de>`__ in Cologne, Germany
-  2015-08-23: `A Solution to the Backup
   Inconvenience <https://programm.froscon.de/2015/events/1515.html>`__:
   Lecture at `FROSCON 2015 <https://www.froscon.de>`__ in Bonn, Germany
-  2015-02-01: `Lightning Talk at FOSDEM
   2015 <https://www.youtube.com/watch?v=oM-MfeflUZ8&t=11m40s>`__: A
   short introduction (with slightly outdated command line)
-  2015-01-27: `Talk about restic at CCC
   Aachen <https://videoag.fsmpi.rwth-aachen.de/?view=player&lectureid=4442#content>`__
   (in German)


text:
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import './Sidebar.css';
import SelectMessage from './SelectMessage';
import SidebarContent from './SidebarContent';

export const SidebarComponent = ({ selectedEvent }) => (
	<div className="sidebar">
		{!selectedEvent ?
			<SelectMessage /> : <SidebarContent {...selectedEvent} />}
	</div>
);

SidebarComponent.defaultProps = {
	selectedEvent: null,
};

SidebarComponent.propTypes = {
	selectedEvent: PropTypes.oneOfType([
		PropTypes.oneOf([null]),
		PropTypes.shape({
			id: PropTypes.string.isRequired,
			data: PropTypes.shape({
				title: PropTypes.string.isRequired,
				text: PropTypes.string.isRequired,
			}).isRequired,
		}),
	]),
};

const mapStateToProps = ({ events }) => ({
	selectedEvent: events.find(({ state }) => state.selected),
});

export default connect(mapStateToProps)(SidebarComponent);


text:
package org.sagebionetworks.table.cluster;

import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;

import org.sagebionetworks.repo.model.entity.IdAndVersion;
import org.sagebionetworks.repo.model.table.ColumnModel;
import org.sagebionetworks.table.cluster.SQLUtils.TableIndexType;
import org.sagebionetworks.table.cluster.columntranslation.ColumnTranslationReference;
import org.sagebionetworks.table.cluster.columntranslation.RowMetadataColumnTranslationReference;
import org.sagebionetworks.table.cluster.columntranslation.SchemaColumnTranslationReference;
import org.sagebionetworks.table.query.model.ColumnName;
import org.sagebionetworks.table.query.model.ColumnReference;
import org.sagebionetworks.table.query.model.TableNameCorrelation;
import org.sagebionetworks.util.ValidateArgument;

/**
 * An immutable representation of table information from a SQL query.
 *
 */
public class TableInfo implements ColumnLookup {

	private final String originalTableName;
	private final IdAndVersion tableIdAndVersion;
	private final String tableAlias;
	private final String translatedTableName;
	private final List<ColumnModel> tableSchema;
	private final List<ColumnTranslationReference> translationReferences;
	private final int tableIndex;
	private final String translatedTableAlias;

	public TableInfo(TableNameCorrelation tableNameCorrelation, int tableIndex, List<ColumnModel> schema) {
		ValidateArgument.required(tableNameCorrelation, "TableNameCorrelation");
		originalTableName = tableNameCorrelation.getTableName().toSql();
		tableIdAndVersion = IdAndVersion.parse(originalTableName);
		tableAlias = tableNameCorrelation.getTableAlias().orElse(null);
		translatedTableName = SQLUtils.getTableNameForId(tableIdAndVersion, TableIndexType.INDEX);
		this.translatedTableAlias = SQLUtils.getTableAliasForIndex(tableIndex);
		this.tableSchema = schema;
		this.tableIndex = tableIndex;
		this.translationReferences = schema.stream().map(c-> new SchemaColumnTranslationReference(c)).collect(Collectors.toList());
	}

	/**
	 * The table name as it appears in the original query.
	 *
	 * @return the originalTableName
	 */
	public String getOriginalTableName() {
		return originalTableName;
	}

	/**
	 * The IdAndVersion of the original table.
	 */
	public IdAndVersion getTableIdAndVersion() {
		return tableIdAndVersion;
	}

	/**
	 * Table alias will only exist if the original SQL included a table alias.
	 *
	 * @return the tableAlias
	 */
	public Optional<String> getTableAlias() {
		return Optional.ofNullable(tableAlias);
	}

	/**
	 * The translated name of this table. For example: syn123.3 -> T123_3
	 *
	 * @return the translatedTableName
	 */
	public String getTranslatedTableName() {
		return translatedTableName;
	}

	/**
	 * Get the schema associated with this table.
	 * @return the tableSchema
	 */
	public List<ColumnModel> getTableSchema() {
		return tableSchema;
	}

	/**
	 * The index of the table as listed in the from clause.  The first table in the from clause will be
	 * index = 0 while the last table will be index = n-1.
	 * @return the tableIndex
	 */
	public int getTableIndex() {
		return tableIndex;
	}

	/**
	 * @return the translatedTableAlias
	 */
	public String getTranslatedTableAlias() {
		return translatedTableAlias;
	}

	/**
	 * Attempt to match the given ColumnReference to a column of this table.
	 * @param columnReference
	 * @return
	 */
	@Override
	public Optional<ColumnTranslationReference> lookupColumnReference(ColumnReference columnReference) {
		if (columnReference == null) {
			return Optional.empty();
		}
		Optional<ColumnName> lhsOptional = columnReference.getNameLHS();
		if (lhsOptional.isPresent()) {
			String unquotedLHS = lhsOptional.get().toSqlWithoutQuotes();
			// if we have a LHS it must match either the table name or table alias.
			if (!unquotedLHS.equals(originalTableName) && !unquotedLHS.equals(tableAlias)
					&& !unquotedLHS.equals(translatedTableAlias) && !unquotedLHS.equals(translatedTableName)) {
				return Optional.empty();
			}
		}
		String rhs = columnReference.getNameRHS().toSqlWithoutQuotes();
		Optional<ColumnTranslationReference> optional = translationReferences.stream()
				.filter(t -> rhs.equals(t.getTranslatedColumnName()) || rhs.equals(t.getUserQueryColumnName()))
				.findFirst();
		if (optional.isPresent()) {
			return optional;
		} else {
			// attempt to match to row metadata
			return RowMetadataColumnTranslationReference.lookupColumnReference(rhs);
		}
	}

	/**
	 * Does the passed TableNameCorrelation match this TableInfo?
	 *
	 * @param tableNameCorrelation
	 * @return
	 */
	public boolean isMatch(TableNameCorrelation tableNameCorrelation) {
		String tableNameSql = tableNameCorrelation.getTableName().toSql();
		if (originalTableName.equals(tableNameSql) || translatedTableName.equals(tableNameSql)) {
			if (getTableAlias().equals(tableNameCorrelation.getTableAlias())
					|| translatedTableAlias.equals(tableNameCorrelation.getTableAlias().orElse(null))) {
				return true;
			}
		}
		return false;
	}

	@Override
	public int hashCode() {
		return Objects.hash(originalTableName, tableAlias, tableIdAndVersion, tableIndex, tableSchema,
				translatedTableName, translationReferences);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (!(obj instanceof TableInfo)) {
			return false;
		}
		TableInfo other = (TableInfo) obj;
		return Objects.equals(originalTableName, other.originalTableName)
				&& Objects.equals(tableAlias, other.tableAlias)
				&& Objects.equals(tableIdAndVersion, other.tableIdAndVersion) && tableIndex == other.tableIndex
				&& Objects.equals(tableSchema, other.tableSchema)
				&& Objects.equals(translatedTableName, other.translatedTableName)
				&& Objects.equals(translationReferences, other.translationReferences);
	}

	@Override
	public String toString() {
		return "TableInfo [originalTableName=" + originalTableName + ", tableIdAndVersion=" + tableIdAndVersion
				+ ", tableAlias=" + tableAlias + ", translatedTableName=" + translatedTableName + ", tableSchema="
				+ tableSchema + ", translationReferences=" + translationReferences + ", tableIndex=" + tableIndex + "]";
	}

}