text:
package org.http4s
package server

import cats.data.Kleisli
import cats.data.OptionT
import cats.effect._
import cats.syntax.all._
import org.http4s.dsl.io._
import org.http4s.syntax.all._

import scala.util.Try

class ContextRouterSuite extends Http4sSuite {
  private val numbers = ContextRoutes.of[Unit, IO] { case GET -> Root / "1" as _ =>
    Ok("one")
  }
  private val numbers2 = ContextRoutes.of[Unit, IO] { case GET -> Root / "1" as _ =>
    Ok("two")
  }

  private val letters = ContextRoutes.of[Unit, IO] { case GET -> Root / "/b" as _ =>
    Ok("bee")
  }
  private val shadow = ContextRoutes.of[Unit, IO] { case GET -> Root / "shadowed" as _ =>
    Ok("visible")
  }
  private val root = ContextRoutes.of[Unit, IO] {
    case GET -> Root / "about" as _ =>
      Ok("about")
    case GET -> Root / "shadow" / "shadowed" as _ =>
      Ok("invisible")
  }

  private val numElem =
    ContextRouter.Segment[Unit]((_, s) => OptionT.fromOption[IO](Try(s.decoded().toInt).toOption))
  private val element = ContextRouter.Segment[Unit]((_, s) => OptionT.pure[IO](s.decoded()))
  private val routable = ContextRouter.of(
    "/" -> ContextRoutes.of[Unit, IO] { case GET -> Root as _ => Ok("static") },
    "/2" -> ContextRouter.of[IO, Unit](
      element -> ContextRoutes.of { case GET -> Root as x => Ok(x) }
    ),
    numElem -> ContextRoutes.of { case GET -> Root as x => Ok(s"${x * 2}") },
    element -> ContextRoutes.of { case GET -> Root as x =>
      Ok(x)
    },
  )

  private val notFound = ContextRoutes.of[Unit, IO] { case _ as _ =>
    NotFound("Custom NotFound")
  }

  def middleware(routes: ContextRoutes[Unit, IO]): ContextRoutes[Unit, IO] =
    Kleisli((r: ContextRequest[IO, Unit]) =>
      if (r.req.uri.query.containsQueryParam("block"))
        OptionT.liftF(Ok(r.req.uri.path.renderString))
      else routes(r)
    )

  private val service = ContextRouter[IO, Unit](
    "/numbers" -> numbers,
    "/numb" -> middleware(numbers2),
    "/" -> root,
    "/shadow" -> shadow,
    "/letters" -> letters,
    "/routable" -> routable,
  )

  test("routable") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/routable")))
      .flatMap(_.as[String])
      .assertEquals("static") *>
      service
        .orNotFound(ContextRequest((), Request[IO](GET, uri"/routable/2")))
        .flatMap(_.as[String])
        .assertEquals("4") *>
      service
        .orNotFound(ContextRequest((), Request[IO](GET, uri"/routable/2/3")))
        .flatMap(_.as[String])
        .assertEquals("3") *>
      service
        .orNotFound(ContextRequest((), Request[IO](GET, uri"/routable/foo")))
        .flatMap(_.as[String])
        .assertEquals("foo")
  }

  test("translate mount prefixes") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/numbers/1")))
      .flatMap(_.as[String])
      .assertEquals("one") *>
      service
        .orNotFound(ContextRequest((), Request[IO](GET, uri"/numb/1")))
        .flatMap(_.as[String])
        .assertEquals("two") *>
      service
        .orNotFound(ContextRequest((), Request[IO](GET, uri"/numbe?block")))
        .map(_.status)
        .assertEquals(NotFound)
  }

  test("require the correct prefix") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/letters/1")))
      .flatMap { resp =>
        resp.as[String].map { b =>
          b =!= "bee" && b =!= "one" && resp.status === NotFound
        }
      }
      .assert
  }

  test("support root mappings") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/about")))
      .flatMap(_.as[String])
      .assertEquals("about")
  }

  test("match longer prefixes first") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/shadow/shadowed")))
      .flatMap(_.as[String])
      .assertEquals("visible")
  }

  test("404 on unknown prefixes") {
    service
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/symbols/~")))
      .map(_.status)
      .assertEquals(NotFound)
  }

  test("Allow passing through of routes with identical prefixes") {
    ContextRouter[IO, Unit]("" -> letters, "" -> numbers)
      .orNotFound(ContextRequest((), Request[IO](GET, uri"/1")))
      .flatMap(_.as[String])
      .assertEquals("one")
  }

  test("Serve custom NotFound responses") {
    ContextRouter[IO, Unit]("/foo" -> notFound)
      .orNotFound(ContextRequest((), Request[IO](uri = uri"/foo/bar")))
      .flatMap(_.as[String])
      .assertEquals("Custom NotFound")
  }

  test("Return the fallthrough response if no route is found") {
    val router = ContextRouter[IO, Unit]("/foo" -> notFound)
    router(ContextRequest((), Request[IO](uri = uri"/bar"))).value
      .map(_ == Option.empty[Response[IO]])
      .assert
  }
}


text:
Calculate the date of meetups.

Typically meetups happen on the same day of the week.  In this exercise, you
will take a description of a meetup date, and return the actual meetup date.

Examples of general descriptions are:

- The first Monday of January 2017
- The third Tuesday of January 2017
- The wednesteenth of January 2017
- The last Thursday of January 2017

The descriptors you are expected to parse are:
first, second, third, fourth, fifth, last, monteenth, tuesteenth, wednesteenth,
thursteenth, friteenth, saturteenth, sunteenth

Note that "monteenth", "tuesteenth", etc are all made up words. There was a
meetup whose members realized that there are exactly 7 numbered days in a month
that end in '-teenth'. Therefore, one is guaranteed that each day of the week
(Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
in every month.

Given examples of a meetup dates, each containing a month, day, year, and
descriptor calculate the date of the actual meetup.  For example, if given
"The first Monday of January 2017", the correct meetup date is 2017/1/2.

## Resources

Remember to check out the Raku [documentation](https://docs.raku.org/) and
[resources](https://raku.org/resources/) pages for information, tips, and
examples if you get stuck.

## Running the tests

There is a test suite and module included with the exercise.
The test suite (a file with the extension `.t6`) will attempt to run routines
from the module (a file with the extension `.pm6`).
Add/modify routines in the module so that the tests will pass! You can view the
test data by executing the command `perl6 --doc *.t6` (\* being the name of the
test suite), and run the test suite for the exercise by executing the command
`prove6 .` in the exercise directory.

## Source

Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month [https://twitter.com/copiousfreetime](https://twitter.com/copiousfreetime)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

redpajama_set_name: RedPajamaGithub


text:
<?php
    include(__DIR__ . '/../../../../inc/pre_config.php');
    include(__DIR__ . '/../../../../../config/config.php');
    include(PERCH_CORE . '/inc/loader.php');

    if (!PERCH_RUNWAY) PerchUtil::redirect(PERCH_LOGINPATH.'/core/settings/');

    $Perch  = PerchAdmin::fetch();
    include(PERCH_CORE . '/inc/auth.php');

    if (!$CurrentUser->has_priv('perch.settings')) {
        PerchUtil::redirect(PERCH_LOGINPATH);
    }

    $Perch->page_title = PerchLang::get('Restore Backup');
    $Alert = new PerchAlert;

    $app_path = __DIR__.'/../../..';

    include(PERCH_CORE .'/runway/settings/inc/backup.php');

    include(PERCH_CORE . '/runway/settings/modes/backup.general.restore.pre.php');
    include($app_path.'/modes/_subnav.php');
    include(PERCH_CORE . '/inc/top.php');

    include(PERCH_CORE . '/runway/settings/modes/backup.general.restore.post.php');
    include(PERCH_CORE . '/inc/btm.php');


text:
namespace Boxed.Mapping.Test
{
    using System;

    public class Mapper : IMapper<MapFrom, MapTo>
    {
        public void Map(MapFrom from, MapTo to)
        {
            if (from is null)
            {
                throw new ArgumentNullException(nameof(from));
            }

            if (to is null)
            {
                throw new ArgumentNullException(nameof(to));
            }

            to.Property = from.Property;
        }
    }
}


text:
'use strict';

const cleanPositionalOperators = require('../schema/cleanPositionalOperators');
const get = require('../get');

/*!
 * Like `schema.path()`, except with a document, because impossible to
 * determine path type without knowing the embedded discriminator key.
 */

module.exports = function getEmbeddedDiscriminatorPath(schema, update, filter, path) {
  const parts = path.split('.');
  let schematype = null;
  let type = 'adhocOrUndefined';

  filter = filter || {};
  update = update || {};

  for (let i = 0; i < parts.length; ++i) {
    const subpath = cleanPositionalOperators(parts.slice(0, i + 1).join('.'));
    schematype = schema.path(subpath);
    if (schematype == null) {
      continue;
    }
    type = schema.pathType(subpath);
    if ((schematype.$isSingleNested || schematype.$isMongooseDocumentArrayElement) &&
        schematype.schema.discriminators != null) {
      const discriminators = schematype.schema.discriminators;
      const discriminatorValuePath = subpath + '.' +
        get(schematype, 'schema.options.discriminatorKey');
      const discriminatorFilterPath =
        discriminatorValuePath.replace(/\.\d+\./, '.');
      let discriminatorKey = null;
      if (discriminatorValuePath in filter) {
        discriminatorKey = filter[discriminatorValuePath];
      }
      if (discriminatorFilterPath in filter) {
        discriminatorKey = filter[discriminatorFilterPath];
      }
      if (discriminatorKey == null || discriminators[discriminatorKey] == null) {
        continue;
      }
      const rest = parts.slice(i + 1).join('.');
      schematype = discriminators[discriminatorKey].path(rest);
      if (schematype != null) {
        type = discriminators[discriminatorKey]._getPathType(rest);
        break;
      }
    }
  }

  return { type: type, schematype: schematype };
};


text:
namespace ash::quick_start {

// TODO impl

TargetDeviceConnectionBroker::TargetDeviceConnectionBroker() = default;
TargetDeviceConnectionBroker::~TargetDeviceConnectionBroker() = default;

void TargetDeviceConnectionBroker::GetFeatureSupportStatusAsync(
    FeatureSupportStatusCallback callback) {
  feature_status_callbacks_.push_back(std::move(callback));
  MaybeNotifyFeatureStatus();
}

void TargetDeviceConnectionBroker::MaybeNotifyFeatureStatus() {
  FeatureSupportStatus status = GetFeatureSupportStatus();
  if (status == FeatureSupportStatus::kUndetermined)
    return;

  auto callbacks = std::exchange(feature_status_callbacks_, {});

  for (auto& callback : callbacks) {
    std::move(callback).Run(status);
  }
}

}  // namespace ash::quick_start


text:
An ultra-simple Flask application to display a user's top 10 albums using the LastFM API

## Requirements

To run this application, a working Python install, with virtualenv is required.

To set this up on Mac OS X, follow [these instructions](http://docs.python-guide.org/en/latest/starting/install/osx/).

## Running Locally

To run the application locally:

- Navigate to the top-albums base directory
- Install a virtualenv instance: `virtualenv venv`
- Activate the virtualenv instance: `source venv/bin/activate`

Now create a file called `app_private.py` and add to it the following lines:

```
LASTFM_API_KEY = "xxxxxxxxx"
LASTFM_SECRET = "xxxxxxxxx"
HEROKU_SECRET = "xxxxxxxxx"
```

Replacing `xxxxxxxxx` with the relevant key.

Then:

- Start the server: `python app.py`
- Navigate to [http://0.0.0.0:5000](http://0.0.0.0:5000)

To terminate the web server and exit the virtualenv:

- ctrl-C
- `deactivate`

## To deploy to Heroku

- It should be sufficient to type: `git push heroku master`


text:
function kern = lfmvKernParamInit(kern)

% LFMVKERNPARAMINIT LFMV kernel parameter initialisation.
% The kernel is designed to interoperate with the multiple output block
% kernel so that f(t) can be inferred given several different
% instantiations of x(t).
%
% The parameters (m, c, delta and k) are constrained positive.
%
% FORMAT
% DESC initialises the latent force model kernel structure with some
% default parameters.
% RETURN kern : the kernel structure with the default parameters placed in.
% ARG kern : the kernel structure which requires initialisation.
%
% SEEALSO : kernCreate, kernParamInit, lfmKernCompute
%
% COPYRIGHT : Mauricio A. Alvarez, 2010

% KERN

% A wrapper that calls lfmKernParamInit to initialize the parameters of the
% model.

kern = lfmKernParamInit(kern);


text:
import { SharedModule } from '@shared/shared.module';
/* tslint:disable:no-unused-variable */

import { TestBed, async, inject } from '@angular/core/testing';
import { ThemesService } from './themes.service';
import { SettingsService } from "./settings.service";

describe('Service: Themes', () => {
    beforeEach(() => {
        TestBed.configureTestingModule({
            imports: [SharedModule],
            providers: [ThemesService, SettingsService]
        });
    });

    it('should create an instance', inject([ThemesService, SettingsService], (themes: ThemesService, settings: SettingsService) => {
        expect(themes).toBeTruthy();
    }));
});


text:
module Dragon
  module Scenes
    class Welcome < Scene
      def describe(*)
        "entering the Realms"
      end

      def permit_delays?
        false
      end

      def default_narration
        "Thanks for playing Dragon! To start playing, you'll need to create a character."
      end

      def actions(*)
        [ new_pc, generate_pc ]
      end
    end
  end
end


text:
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **string** | Conditional and has only one value: "SC". "SC" has special meaning – it means this is the top of the "tree" and the input is the whole school. | [optional]
**group_local_id** | **string** |  | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
Название урока: Похищение сессии

Тема для изучения:

Разработчики приложений, создающие свои механизмы работы с сессиями, иногда
забывают о том что идентификаторы сессий должны генерироваться случайным образом
и иметь достаточную длинну. Иначе они могут быть банально подобраны злоумышленником
методом грубой силы (brute force).

Основные цели:

Попробуйте подобрать идентификатор рабочей сессии принадлежащей другому пользователю.


text:
package fr.openwide.core.showcase.core.business.task.model;

import java.util.Date;

import fr.openwide.core.commons.util.report.BatchReport;
import fr.openwide.core.jpa.more.business.task.model.AbstractTask;
import fr.openwide.core.jpa.more.business.task.model.BatchReportBean;
import fr.openwide.core.jpa.more.business.task.model.IQueueId;
import fr.openwide.core.jpa.more.business.task.model.TaskExecutionResult;

public class SuccessTask extends AbstractTask {

	private static final long serialVersionUID = -4459628313973063902L;

	private ShowcaseTaskQueueId queueId;

	protected SuccessTask() { }

	public SuccessTask(ShowcaseTaskQueueId queueId) {
		super(SuccessTask.class.getSimpleName(), TaskTypeEnum.SUCCESS.getTaskType(), new Date());
		this.queueId = queueId;
	}

	@Override
	public IQueueId selectQueue() {
		return queueId;
	}

	@Override
	protected TaskExecutionResult doTask() throws Exception {
		BatchReport batchReport = new BatchReport();

		batchReport.info("Task execution info.");

		return TaskExecutionResult.completed(new BatchReportBean(batchReport));
	}

}


text:
package ca.uhn.fhir.jpa.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.ColumnDefault;

//@formatter:off
@Entity()
@Table(name = "HFJ_FORCED_ID", uniqueConstraints = {
	@UniqueConstraint(name = "IDX_FORCEDID_RESID", columnNames = {"RESOURCE_PID"}),
	@UniqueConstraint(name = "IDX_FORCEDID_TYPE_RESID", columnNames = {"RESOURCE_TYPE", "RESOURCE_PID"})
}, indexes= {
	@Index(name = "IDX_FORCEDID_TYPE_FORCEDID", columnList = "RESOURCE_TYPE,FORCED_ID"),
})
//@formatter:on
public class ForcedId {

	public static final int MAX_FORCED_ID_LENGTH = 100;

	@Column(name = "FORCED_ID", nullable = false, length = MAX_FORCED_ID_LENGTH, updatable = false)
	private String myForcedId;

	@SequenceGenerator(name = "SEQ_FORCEDID_ID", sequenceName = "SEQ_FORCEDID_ID")
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_FORCEDID_ID")
	@Id
	@Column(name = "PID")
	private Long myId;

	@JoinColumn(name = "RESOURCE_PID", nullable = false, updatable = false, foreignKey=@ForeignKey(name="FK_FORCEDID_RESOURCE"))
	@OneToOne()
	private ResourceTable myResource;

	@Column(name = "RESOURCE_PID", nullable = false, updatable = false, insertable=false)
	private Long myResourcePid;

	// This is updatable=true because it was added in 1.6 and needs to be set.. At some
	// point we should remove the default and make it not updatable
	@ColumnDefault("''")
	@Column(name = "RESOURCE_TYPE", nullable = true, length = 100, updatable = true)
	private String myResourceType;

	/**
	 * Constructor
	 */
	public ForcedId() {
		super();
	}

	public String getForcedId() {
		return myForcedId;
	}

	public ResourceTable getResource() {
		return myResource;
	}

	public Long getResourcePid() {
		if (myResourcePid==null) {
			return myResource.getId();
		}
		return myResourcePid;
	}

	public String getResourceType() {
		return myResourceType;
	}

	public void setForcedId(String theForcedId) {
		myForcedId = theForcedId;
	}

	public void setResource(ResourceTable theResource) {
		myResource = theResource;
	}

	public void setResourcePid(Long theResourcePid) {
		myResourcePid = theResourcePid;
	}

	public void setResourcePid(ResourceTable theResourcePid) {
		myResource = theResourcePid;
	}

	public void setResourceType(String theResourceType) {
		myResourceType = theResourceType;
	}

}


text:
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { VideoService } from './video.service';

@Component({
    templateUrl: './app/videogallery/videoinsert.component.html'
})
export class VideoInsertComponent implements OnInit {
    pageTitle: string = 'Publish Video';
    vidForm: FormGroup;
    Message: string;

    errorMessage: string;

    public videocate:any;

    public pvisible = false;
    constructor(

        private route: ActivatedRoute, private fb: FormBuilder,
        private vdService: VideoService, private router: Router
    ) { }

    ngOnInit(): void {

        console.log('answer');

        this.vdService.videocategoriesList().subscribe(
            answer => {
                if (answer.length > 0) {
                    this.videocate = answer;
                    console.log(answer);
                }
            },
            error => this.errorMessage = <any>error
        );

        this.vidForm = this.fb.group({
            VideoTitle: ['', [Validators.required, Validators.minLength(3)]],
            VideoDescription: ['', Validators.required],
            VideoEmbedcode: ['', Validators.required],
            VideoCategoryId: ['', Validators.required]
        });
    }

    save() {

        //let Form = this.vidForm.value;
        //let body = Form.Name + '~' + 1 + '|' + Form.Age + '~' + 2 + '|' + Form.Gender + '~' + 3 + '|' + Form.Sonof + '~' + 4;

        let body = this.vidForm.value;

        console.log(body);

        this.vdService.insertVideos(body).subscribe(
            data => {
              //  return this.router.navigate(['/courses', 'courseregistred']);

                this.vidForm.reset();

                return this.Message = "Video Published Successfully";

            },
            error => {
                return this.Message = "Error While Inserting Data";
            }
        );

    }
}


text:
Module Module1

    Sub Main()
        System.Console.WriteLine("Teclee el primer numero")
        Dim x1 As Integer = System.Console.ReadLine
        Dim x2 As Integer = Comprobacion(x1)
        Dim sum As Integer = Calculo(x1, x2)

        System.Console.WriteLine(sum)
        System.Console.ReadKey()
    End Sub

    Function Comprobacion(ByVal x1 As Integer)
        Dim x2 As Integer
        Do
            System.Console.WriteLine("Teclee el segundo numero, debe ser mayor que el primero")
            x2 = System.Console.ReadLine
        Loop Until x1 < x2

        Return x2
    End Function

    Function Calculo(ByVal x1 As Integer, ByVal x2 As Integer)
        Dim sum As Integer
        Do
            sum = sum + x2
            x2 = x2 - 1
        Loop Until x2 < x1

        Return sum
    End Function

End Module


text:
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as ScenarioActions from '../actions/ScenarioActions';
import * as SubscriptionActions from '../actions/SubscriptionActions';
import Header from '../components/Header';

/**
 * Keep in mind that 'state' isn't the state of local object, but your single
 * state in this Redux application. 'counter' is a property within our store/state
 * object. By mapping it to props, we can pass it to the child component Counter.
 */
function mapStateToProps(state) {
  return {
    scenario:        state.scenario.scenario,
    generator:       state.scenario.generator,
    isFetching:      state.generators.isFetching || state.scenario.isFetching || state.subscription.isCreating,
    subscribed:      state.subscription.subscribed,
    subscribedEmail: state.subscription.subscribedEmail,
    errors:          state.subscription.errors,
  };
}

/**
 * Turns an object whose values are 'action creators' into an object with the same
 * keys but with every action creator wrapped into a 'dispatch' call that we can invoke
 * directly later on. Here we imported the actions specified in 'CounterActions.js' and
 * used the bindActionCreators function Redux provides us.
 *
 * More info: http://redux.js.org/docs/api/bindActionCreators.html
 */
function mapDispatchToProps(dispatch) {
  return {
    actions: bindActionCreators(ScenarioActions, dispatch),
    subscribeActions: bindActionCreators(SubscriptionActions, dispatch)
  };
}

/**
 * 'connect' is provided to us by the bindings offered by 'react-redux'. It simply
 * connects a React component to a Redux store. It never modifies the component class
 * that is passed into it, it actually returns a new connected componet class for use.
 *
 * More info: https://github.com/rackt/react-redux
 */

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Header);


text:
// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2019 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Asher Elmquist
// =============================================================================
//
// utility functions used for optix convenience
//
// =============================================================================

#ifndef CHOPTIXUTILS_H
#define CHOPTIXUTILS_H

#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#endif

#include <optix.h>
#include <cuda_runtime_api.h>
#include <nvrtc.h>

#include "chrono/assets/ChVisualMaterial.h"
#include "chrono/assets/ChBoxShape.h"
#include "chrono/core/ChMatrix33.h"

#include "chrono_thirdparty/stb/stb_image.h"

#include <string>

#include "chrono_sensor/ChApiSensor.h"

namespace chrono {
namespace sensor {

/// @addtogroup sensor_optix
/// @{

/// Checks the output of an optix call for any error, will throw a runtime error if not success
#define OPTIX_ERROR_CHECK(result) { \
    if (result != OPTIX_SUCCESS) { \
        std::string error_name = std::string(optixGetErrorName(result)); \
        std::string error_string = std::string(optixGetErrorString(result)); \
        std::string file = std::string(__FILE__); \
        std::string line = std::to_string(__LINE__); \
        throw std::runtime_error(error_name + ": " + error_string + " at " + file + ":" + line); \
    } \
} \

/// Checks the output of a cuda call for any error, will throw a runtime error if not success
#define CUDA_ERROR_CHECK(result) { \
    if (result != cudaSuccess) { \
        std::string error_name = std::string(cudaGetErrorName(result));\
        std::string error_string = std::string(cudaGetErrorString(result));\
        std::string file = std::string(__FILE__);\
        std::string line = std::to_string(__LINE__);\
        throw std::runtime_error(error_name + ": " + error_string + " at " + file + ":" + line);\
    }\
}

#ifdef USE_CUDA_NVRTC
/// Checks the output of a cuda call for any error, will throw a runtime error if not success
#define NVRTC_ERROR_CHECK(result) { \
    if (result != NVRTC_SUCCESS) { \
        std::string error_name = "NVRTC ERROR"; \
        std::string error_string = std::string(nvrtcGetErrorString(result)); \
        std::string file = std::string(__FILE__); \
        std::string line = std::to_string(__LINE__); \
        throw std::runtime_error(error_name + ": " + error_string + " at " + file + ":" + line); \
    } \
}
#endif

/// holds string values for ptx file and ray generation program
struct ProgramString {
    std::string file_name;
    std::string program_name;
};

/// stores image data
struct ByteImageData {
    /// image width
    int w;
    /// image height
    int h;
    ///
    int c;
    /// image pixel valules
    std::vector<unsigned char> data;
};

/// launches ray generation program
/// @param context optix device context
/// @param module optix module that will be created
/// @param file_name the file where the shader program is implemented
/// @param module_compile_options compile options for the module
/// @param pipeline_compile_options compile options for the pipeline
CH_SENSOR_API void GetShaderFromFile(OptixDeviceContext context,
                                     OptixModule& module,
                                     const std::string& file_name,
                                     OptixModuleCompileOptions& module_compile_options,
                                     OptixPipelineCompileOptions& pipeline_compile_options);

CH_SENSOR_API void optix_log_callback(unsigned int level, const char* tag, const char* message, void*);

// #ifdef USE_CUDA_NVRTC
// /// launches ray generation program
// /// @param context optix device context
// /// @param module optix module that will be created
// /// @param file_name the file where the shader program is implemented
// /// @param module_compile_options compile options for the module
// /// @param pipeline_compile_options compile options for the pipeline
// CH_SENSOR_API void GetShaderFromPtx(OptixDeviceContext context,
//                                     OptixModule& module,
//                                     std::string file_name,
//                                     OptixModuleCompileOptions& module_compile_options,
//                                     OptixPipelineCompileOptions& pipeline_compile_options);
// #endif

/// loads image to struct ByteImageData, returns an empty struct with 0 values if loading failed
/// @param filename
CH_SENSOR_API ByteImageData LoadByteImage(const std::string& filename);

/*
/// creates an empty optix transform::node
/// @param context the optix context
optix::Transform CreateEmptyTransform(optix::Context context);

/// creates an opti::transform node
/// @param context optix context
/// @param a projection matrix
/// @param b
optix::Transform CreateTransform(optix::Context context, ChMatrix33<double> a, ChVector<double> b);

/// creates an optix::transform node
/// @param context optix context
/// @param a  projection matrix
/// @param b
/// @param s
/// @return an optix::transform
optix::Transform CreateTransform(optix::Context context, ChMatrix33<double> a, ChVector<double> b, ChVector<double> s);

/// creatse an optix::transform node based on end points
/// @param context optix context
/// @param a projection matrix
/// @param b
/// @param from
/// @return an optix::transform
optix::Transform CreateTransformFromEndPoints(optix::Context context, ChVector<> a, ChVector<> b, ChVector<> from);

/// creates an optix::transform node based on end points
/// @param context optix context
/// @param a projection matrix
/// @param b
/// @param from
/// @param s
/// @return an optix::transform
optix::Transform CreateTransformFromEndPoints(optix::Context context,
                                              ChVector<> a,
                                              ChVector<> b,
                                              ChVector<> from,
                                              ChVector<double> s);

/// updates the projection matrix in the optix::transform object
/// @param t optix transform object
/// @param a projection matrix
/// @param b
void UpdateTransform(optix::Transform t, ChMatrix33<double> a, ChVector<double> b);

/// updates the projection matrix in the optix::transform object
/// @param t optix tranform object
/// @param a projection matrix
/// @param b
/// @param s
void UpdateTransform(optix::Transform t, ChMatrix33<double> a, ChVector<double> b, ChVector<double> s);
*/

CH_SENSOR_API void SetSensorShaderDir(const std::string& path);

/*
/// prefix for ptx file
const std::string ptx_pre = "ChronoEngine_sensor_generated_";
/// suffix for ptx file
const std::string ptx_suff = ".cu.ptx";

extern std::string SENSOR_SHADER_DIR;// = "test"; //std::string(CMAKE_SHADER_OUTPUT_PATH);
*/

/// @} sensor_optix

}  // namespace sensor
}  // namespace chrono

#endif


text:
/**
 * Created by PC on 03.05.2016 г..
 */
angular.module('issueTrackingSystem.common.createIssueRequestBodyService', [])
    .factory('createIssueRequestBodyService', function createIssueRequestBodyService() {
        function createIssueRequestBody(issue) {
            var requestBody = {
                Title: issue.Title,
                Description: issue.Description,
                DueDate: issue.DueDate,
                ProjectId: issue.ProjectId,
                AssigneeId: issue.AssigneeId,
                PriorityId: issue.PriorityId
            };

            console.log(requestBody);

            return requestBody;
        }

        return {
            createIssueRequestBody: createIssueRequestBody
        }
    });


text:
package eu.chargetime.ocpp.test;

import eu.chargetime.ocpp.*;
import eu.chargetime.ocpp.feature.profile.*;
import eu.chargetime.ocpp.feature.profile.securityext.ClientSecurityExtEventHandler;
import eu.chargetime.ocpp.feature.profile.securityext.ClientSecurityExtProfile;
import eu.chargetime.ocpp.model.Confirmation;
import eu.chargetime.ocpp.model.Request;
import eu.chargetime.ocpp.model.core.*;
import eu.chargetime.ocpp.model.firmware.*;
import eu.chargetime.ocpp.model.localauthlist.*;
import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageConfirmation;
import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageRequest;
import eu.chargetime.ocpp.model.remotetrigger.TriggerMessageStatus;
import eu.chargetime.ocpp.model.reservation.*;
import eu.chargetime.ocpp.model.securityext.*;
import eu.chargetime.ocpp.model.securityext.types.*;
import eu.chargetime.ocpp.model.smartcharging.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.ZonedDateTime;

public class FakeChargePoint {
  private final ClientCoreProfile core;
  private final ClientSmartChargingProfile smartCharging;
  private final ClientRemoteTriggerProfile remoteTrigger;
  private final ClientFirmwareManagementProfile firmware;
  private final ClientLocalAuthListProfile localAuthList;
  private final ClientReservationProfile reservation;
  private final ClientSecurityExtProfile securityExt;
  private IClientAPI client;
  private Confirmation receivedConfirmation;
  private Request receivedRequest;
  private Throwable receivedException;
  private String url;

  public FakeChargePoint() throws MalformedURLException {
    this(clientType.JSON);
  }

  public FakeChargePoint(clientType type) throws MalformedURLException {
    core =
        new ClientCoreProfile(
            new ClientCoreEventHandler() {
              @Override
              public ChangeAvailabilityConfirmation handleChangeAvailabilityRequest(
                  ChangeAvailabilityRequest request) {
                receivedRequest = request;
                return new ChangeAvailabilityConfirmation(AvailabilityStatus.Accepted);
              }

              @Override
              public GetConfigurationConfirmation handleGetConfigurationRequest(
                  GetConfigurationRequest request) {
                receivedRequest = request;
                return new GetConfigurationConfirmation();
              }

              @Override
              public ChangeConfigurationConfirmation handleChangeConfigurationRequest(
                  ChangeConfigurationRequest request) {
                receivedRequest = request;
                ChangeConfigurationConfirmation confirmation =
                    new ChangeConfigurationConfirmation();
                confirmation.setStatus(ConfigurationStatus.Accepted);
                return confirmation;
              }

              @Override
              public ClearCacheConfirmation handleClearCacheRequest(ClearCacheRequest request) {
                receivedRequest = request;
                ClearCacheConfirmation confirmation = new ClearCacheConfirmation();
                confirmation.setStatus(ClearCacheStatus.Accepted);
                return confirmation;
              }

              @Override
              public DataTransferConfirmation handleDataTransferRequest(
                  DataTransferRequest request) {
                receivedRequest = request;
                DataTransferConfirmation confirmation = new DataTransferConfirmation();
                confirmation.setStatus(DataTransferStatus.Accepted);
                return confirmation;
              }

              @Override
              public RemoteStartTransactionConfirmation handleRemoteStartTransactionRequest(
                  RemoteStartTransactionRequest request) {
                receivedRequest = request;
                return new RemoteStartTransactionConfirmation(RemoteStartStopStatus.Accepted);
              }

              @Override
              public RemoteStopTransactionConfirmation handleRemoteStopTransactionRequest(
                  RemoteStopTransactionRequest request) {
                receivedRequest = request;
                return new RemoteStopTransactionConfirmation(RemoteStartStopStatus.Accepted);
              }

              @Override
              public ResetConfirmation handleResetRequest(ResetRequest request) {
                receivedRequest = request;
                return new ResetConfirmation(ResetStatus.Accepted);
              }

              @Override
              public UnlockConnectorConfirmation handleUnlockConnectorRequest(
                  UnlockConnectorRequest request) {
                receivedRequest = request;
                return new UnlockConnectorConfirmation(UnlockStatus.Unlocked);
              }
            });

    smartCharging =
        new ClientSmartChargingProfile(
            new ClientSmartChargingEventHandler() {
              @Override
              public SetChargingProfileConfirmation handleSetChargingProfileRequest(
                  SetChargingProfileRequest request) {
                receivedRequest = request;
                return new SetChargingProfileConfirmation(ChargingProfileStatus.Accepted);
              }

              @Override
              public ClearChargingProfileConfirmation handleClearChargingProfileRequest(
                  ClearChargingProfileRequest request) {
                receivedRequest = request;
                return new ClearChargingProfileConfirmation(ClearChargingProfileStatus.Accepted);
              }

              @Override
              public GetCompositeScheduleConfirmation handleGetCompositeScheduleRequest(
                  GetCompositeScheduleRequest request) {
                receivedRequest = request;
                return new GetCompositeScheduleConfirmation(GetCompositeScheduleStatus.Accepted);
              }
            });

    remoteTrigger =
        new ClientRemoteTriggerProfile(
            new ClientRemoteTriggerEventHandler() {
              @Override
              public TriggerMessageConfirmation handleTriggerMessageRequest(
                  TriggerMessageRequest request) {
                receivedRequest = request;
                return new TriggerMessageConfirmation(TriggerMessageStatus.Accepted);
              }
            });

    firmware =
        new ClientFirmwareManagementProfile(
            new ClientFirmwareManagementEventHandler() {
              @Override
              public GetDiagnosticsConfirmation handleGetDiagnosticsRequest(
                  GetDiagnosticsRequest request) {
                receivedRequest = request;
                return new GetDiagnosticsConfirmation();
              }

              @Override
              public UpdateFirmwareConfirmation handleUpdateFirmwareRequest(
                  UpdateFirmwareRequest request) {
                receivedRequest = request;
                return new UpdateFirmwareConfirmation();
              }
            });

    localAuthList =
        new ClientLocalAuthListProfile(
            new ClientLocalAuthListEventHandler() {
              @Override
              public SendLocalListConfirmation handleSendLocalListRequest(
                  SendLocalListRequest request) {
                receivedRequest = request;
                return new SendLocalListConfirmation(UpdateStatus.VersionMismatch);
              }

              @Override
              public GetLocalListVersionConfirmation handleGetLocalListVersionRequest(
                  GetLocalListVersionRequest request) {
                receivedRequest = request;
                return new GetLocalListVersionConfirmation(2);
              }
            });

    reservation =
        new ClientReservationProfile(
            new ClientReservationEventHandler() {
              @Override
              public ReserveNowConfirmation handleReserveNowRequest(ReserveNowRequest request) {
                receivedRequest = request;
                return new ReserveNowConfirmation(ReservationStatus.Accepted);
              }

              @Override
              public CancelReservationConfirmation handleCancelReservationRequest(
                  CancelReservationRequest request) {
                receivedRequest = request;
                return new CancelReservationConfirmation(CancelReservationStatus.Accepted);
              }
            });

    securityExt =
      new ClientSecurityExtProfile(new ClientSecurityExtEventHandler() {
        @Override
        public CertificateSignedConfirmation handleCertificateSignedRequest(CertificateSignedRequest request) {
          receivedRequest = request;
          return new CertificateSignedConfirmation(CertificateSignedStatusEnumType.Accepted);
        }

        @Override
        public DeleteCertificateConfirmation handleDeleteCertificateRequest(DeleteCertificateRequest request) {
          receivedRequest = request;
          return new DeleteCertificateConfirmation(DeleteCertificateStatusEnumType.Accepted);
        }

        @Override
        public ExtendedTriggerMessageConfirmation handleExtendedTriggerMessageRequest(ExtendedTriggerMessageRequest request) {
          receivedRequest = request;
          return new ExtendedTriggerMessageConfirmation(TriggerMessageStatusEnumType.Accepted);
        }

        @Override
        public GetInstalledCertificateIdsConfirmation handleGetInstalledCertificateIdsRequest(GetInstalledCertificateIdsRequest request) {
          receivedRequest = request;
          return new GetInstalledCertificateIdsConfirmation(GetInstalledCertificateStatusEnumType.Accepted);
        }

        @Override
        public GetLogConfirmation handleGetLogRequest(GetLogRequest request) {
          receivedRequest = request;
          return new GetLogConfirmation(LogStatusEnumType.Accepted);
        }

        @Override
        public InstallCertificateConfirmation handleInstallCertificateRequest(InstallCertificateRequest request) {
          receivedRequest = request;
          return new InstallCertificateConfirmation(CertificateStatusEnumType.Accepted);
        }

        @Override
        public SignedUpdateFirmwareConfirmation handleSignedUpdateFirmwareRequest(SignedUpdateFirmwareRequest request) {
          receivedRequest = request;
          return new SignedUpdateFirmwareConfirmation(UpdateFirmwareStatusEnumType.Accepted);
        }
      });

    switch (type) {
      case JSON:
        client = new JSONTestClient(core);
        url = "ws://127.0.0.1:8887";
        break;
      case SOAP:
        client = new SOAPTestClient(new URL("http://127.0.0.1:8889"), core);
        url = "http://127.0.0.1:8890";
        break;
    }

    client.addFeatureProfile(smartCharging);
    client.addFeatureProfile(remoteTrigger);
    client.addFeatureProfile(firmware);
    client.addFeatureProfile(localAuthList);
    client.addFeatureProfile(reservation);
    client.addFeatureProfile(securityExt);
  }

  public enum clientType {
    JSON,
    SOAP
  }

  public void connect() {
    try {
      client.connect(
          url,
          new ClientEvents() {
            @Override
            public void connectionOpened() {}

            @Override
            public void connectionClosed() {}
          });
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }

  public void sendBootNotification(String vendor, String model) throws Exception {
    Request request = core.createBootNotificationRequest(vendor, model);
    send(request);
  }

  public void sendAuthorizeRequest(String idToken) throws Exception {
    Request request = core.createAuthorizeRequest(idToken);
    send(request);
  }

  public void sendIncompleteAuthorizeRequest() throws Exception {
    Request request = new AuthorizeRequest();
    send(request);
  }

  public void sendHeartbeatRequest() throws Exception {
    Request request = core.createHeartbeatRequest();
    send(request);
  }

  public void sendMeterValuesRequest() throws Exception {
    try {
      Request request = core.createMeterValuesRequest(42, ZonedDateTime.now(), "42");
      send(request);
    } catch (PropertyConstraintException ex) {
      ex.printStackTrace();
    }
  }

  public void sendStartTransactionRequest() throws Exception {
    try {
      Request request = core.createStartTransactionRequest(41, "some id", 42, ZonedDateTime.now());
      send(request);
    } catch (PropertyConstraintException ex) {
      ex.printStackTrace();
    }
  }

  public void sendStopTransactionRequest() throws Exception {
    StopTransactionRequest request = core.createStopTransactionRequest(42, ZonedDateTime.now(), 42);
    send(request);
  }

  public void sendDataTransferRequest(String vendorId, String messageId, String data) {
    try {
      DataTransferRequest request = core.createDataTransferRequest(vendorId);
      request.setMessageId(messageId);
      request.setData(data);

      send(request);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }

  public void sendStatusNotificationRequest() {
    try {
      StatusNotificationRequest request =
          core.createStatusNotificationRequest(
              42, ChargePointErrorCode.NoError, ChargePointStatus.Available);
      send(request);
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }

  public void sendDiagnosticsStatusNotificationRequest(DiagnosticsStatus status) throws Exception {
    DiagnosticsStatusNotificationRequest request = new DiagnosticsStatusNotificationRequest(status);
    send(request);
  }

  public void sendFirmwareStatusNotificationRequest(FirmwareStatus status) throws Exception {
    FirmwareStatusNotificationRequest request = new FirmwareStatusNotificationRequest(status);
    send(request);
  }

  public void sendLogStatusNotificationRequest(UploadLogStatusEnumType uploadLogStatusEnumType) throws Exception {
    LogStatusNotificationRequest request = securityExt.createLogStatusNotificationRequest(uploadLogStatusEnumType);
    send(request);
  }

  public void sendSecurityEventNotificationRequest(String type, ZonedDateTime timestamp) throws Exception {
    SecurityEventNotificationRequest request = securityExt.createSecurityEventNotificationRequest(type, timestamp);
    send(request);
  }

  public void sendSignCertificateRequest(String csr) throws Exception {
    SignCertificateRequest request = securityExt.createSignCertificateRequest(csr);
    send(request);
  }

  public void sendSignedFirmwareStatusNotificationRequest(FirmwareStatusEnumType status) throws Exception {
    SignedFirmwareStatusNotificationRequest request = securityExt.createSignedFirmwareStatusNotificationRequest(status);
    send(request);
  }

  public void clearMemory() {
    receivedConfirmation = null;
    receivedException = null;
    receivedRequest = null;
  }

  private void send(Request request) throws Exception {
    try {
      client
          .send(request)
          .whenComplete(
              (s, ex) -> {
                receivedConfirmation = s;
                receivedException = ex;
              });
    } catch (UnsupportedFeatureException ex) {
      ex.printStackTrace();
    }
  }

  public boolean hasReceivedBootConfirmation(String status) {
    if (receivedConfirmation instanceof BootNotificationConfirmation)
      return ((BootNotificationConfirmation) receivedConfirmation)
          .getStatus()
          .toString()
          .equals(status);
    return false;
  }

  public boolean hasReceivedAuthorizeConfirmation(String status) {
    if (receivedConfirmation instanceof AuthorizeConfirmation)
      return ((AuthorizeConfirmation) receivedConfirmation)
          .getIdTagInfo()
          .getStatus()
          .toString()
          .equals(status);
    return false;
  }

  public boolean hasReceivedDiagnosticsStatusNotificationConfirmation() {
    return (receivedConfirmation instanceof DiagnosticsStatusNotificationConfirmation);
  }

  public boolean hasReceivedFirmwareStatusNotificationConfirmation() {
    return (receivedConfirmation instanceof FirmwareStatusNotificationConfirmation);
  }

  public boolean hasReceivedDataTransferConfirmation(String status) {
    if (receivedConfirmation instanceof DataTransferConfirmation)
      return ((DataTransferConfirmation) receivedConfirmation)
          .getStatus()
          .toString()
          .equals(status);
    return false;
  }

  public boolean hasReceivedHeartbeatConfirmation() {
    return (receivedConfirmation instanceof HeartbeatConfirmation);
  }

  public boolean hasReceivedMeterValuesConfirmation() {
    return (receivedConfirmation instanceof MeterValuesConfirmation);
  }

  public boolean hasReceivedStartTransactionConfirmation() {
    return (receivedConfirmation instanceof StartTransactionConfirmation);
  }

  public boolean hasReceivedStatusNotificationConfirmation() {
    return (receivedConfirmation instanceof StatusNotificationConfirmation);
  }

  public boolean hasReceivedStopTransactionConfirmation() {
    return (receivedConfirmation instanceof StopTransactionConfirmation);
  }

  public boolean hasReceivedLogStatusNotificationConfirmation() {
    return receivedConfirmation instanceof LogStatusNotificationConfirmation;
  }

  public boolean hasReceivedSecurityEventNotificationConfirmation() {
    return receivedConfirmation instanceof SecurityEventNotificationConfirmation;
  }

  public boolean hasReceivedSignCertificateConfirmation() {
    return receivedConfirmation instanceof SignCertificateConfirmation;
  }

  public boolean hasReceivedSignedFirmwareStatusNotificationConfirmation() {
    return receivedConfirmation instanceof SignedFirmwareStatusNotificationConfirmation;
  }

  public void disconnect() {
    client.disconnect();
  }

  public boolean hasHandledGetDiagnosticsRequest() {
    return receivedRequest instanceof GetDiagnosticsRequest;
  }

  public boolean hasHandledUpdateFirmwareRequest() {
    return receivedRequest instanceof UpdateFirmwareRequest;
  }

  public boolean hasHandledChangeAvailabilityRequest() {
    return receivedRequest instanceof ChangeAvailabilityRequest;
  }

  public boolean hasHandledGetConfigurationRequest() {
    return receivedRequest instanceof GetConfigurationRequest;
  }

  public boolean hasHandledReserveNowRequest() {
    return receivedRequest instanceof ReserveNowRequest;
  }

  public boolean hasHandledCancelReservationRequest() {
    return receivedRequest instanceof CancelReservationRequest;
  }

  public boolean hasHandledSendLocalListRequest() {
    return receivedRequest instanceof SendLocalListRequest;
  }

  public boolean hasHandledGetLocalListVersionRequest() {
    return receivedRequest instanceof GetLocalListVersionRequest;
  }

  public boolean hasHandledSetChargingProfileRequest() {
    return receivedRequest instanceof SetChargingProfileRequest;
  }

  public boolean hasHandledChangeConfigurationRequest() {
    return receivedRequest instanceof ChangeConfigurationRequest;
  }

  public boolean hasHandledClearCacheRequest() {
    return receivedRequest instanceof ClearCacheRequest;
  }

  public boolean hasHandledDataTransferRequest() {
    return receivedRequest instanceof DataTransferRequest;
  }

  public boolean hasHandledRemoteStartTransactionRequest() {
    return receivedRequest instanceof RemoteStartTransactionRequest;
  }

  public boolean hasHandledRemoteStopTransactionRequest() {
    return receivedRequest instanceof RemoteStopTransactionRequest;
  }

  public boolean hasHandledResetRequest() {
    return receivedRequest instanceof ResetRequest;
  }

  public boolean hasHandledUnlockConnectorRequest() {
    return receivedRequest instanceof UnlockConnectorRequest;
  }

  public boolean hasHandledCertificateSignedRequest() {
    return receivedRequest instanceof CertificateSignedRequest;
  }

  public boolean hasHandledDeleteCertificateRequest() {
    return receivedRequest instanceof DeleteCertificateRequest;
  }

  public boolean hasHandledExtendedTriggerMessageRequest() {
    return receivedRequest instanceof ExtendedTriggerMessageRequest;
  }

  public boolean hasHandledGetInstalledCertificateIdsRequest() {
    return receivedRequest instanceof GetInstalledCertificateIdsRequest;
  }

  public boolean hasHandledGetLogRequest() {
    return receivedRequest instanceof GetLogRequest;
  }

  public boolean hasHandledInstallCertificateRequest() {
    return receivedRequest instanceof InstallCertificateRequest;
  }

  public boolean hasHandledSignedUpdateFirmwareRequest() {
    return receivedRequest instanceof SignedUpdateFirmwareRequest;
  }

  public boolean hasReceivedError() {
    return receivedException != null;
  }

  public boolean hasReceivedNotConnectedError() {
    if (receivedException instanceof CallErrorException)
      return ((CallErrorException) receivedException).getErrorCode().equals("Not connected");
    return false;
  }
}


text:
<?php
try {
    require_once __DIR__ . '/../bootstrap.php';
    $app->getEventDispatcher()->dispatchGeneralEvent('pantono.application.start');
    $app->run();
    $app->getEventDispatcher()->dispatchGeneralEvent('pantono.application.shutdown');
} catch (\Exception $e) {
    echo $e->getMessage();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical" android:layout_width="fill_parent"
	android:layout_height="fill_parent">
	<TextView android:id="@+id/displayheader"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/checkpoints_timed"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/checkpoints_req"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/buffers_checkpoint"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/buffers_clean"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/maxwritten_clean"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/buffers_backend"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
	<TextView android:id="@+id/buffers_alloc"
		android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
</LinearLayout>


text:
SelfSelectingFixture::SelfSelectingFixture(void) :
  magic(10010)
{
}

bool SelfSelectingFixture::IsMagicCorrect(void) const {
  return magic == 10010;
}


text:
class Profile;

namespace content {
class WebContents;
}

// This model provides data for the ManagePasswordsBubble and controls the
// password management actions.
class ManagePasswordsBubbleModel : public content::WebContentsObserver {
 public:
  enum PasswordAction { REMOVE_PASSWORD, ADD_PASSWORD };
  enum DisplayReason { AUTOMATIC, USER_ACTION };

  // Creates a ManagePasswordsBubbleModel, which holds a raw pointer to the
  // WebContents in which it lives. Construction implies that the bubble
  // is shown. The bubble's state is updated from the
  // ManagePasswordsUIController associated with |web_contents|.
  ManagePasswordsBubbleModel(content::WebContents* web_contents,
                             DisplayReason reason);
  ~ManagePasswordsBubbleModel() override;

  // Called by the view code when the "Nope" button in clicked by the user in
  // update bubble.
  void OnNopeUpdateClicked();

  // Called by the view code when the "Never for this site." button in clicked
  // by the user.
  void OnNeverForThisSiteClicked();

  // Called by the view code when the save button is clicked by the user.
  void OnSaveClicked();

  // Called by the view code when the update link is clicked by the user.
  void OnUpdateClicked(const autofill::PasswordForm& password_form);

  // Called by the view code when the "Done" button is clicked by the user.
  void OnDoneClicked();

  // Called by the view code when the "OK" button is clicked by the user.
  void OnOKClicked();

  // Called by the view code when the manage link is clicked by the user.
  void OnManageLinkClicked();

  // Called by the view code when the brand name link is clicked by the user.
  void OnBrandLinkClicked();

  // Called by the view code when the auto-signin toast is about to close due to
  // timeout.
  void OnAutoSignInToastTimeout();

  // Called by the view code to delete or add a password form to the
  // PasswordStore.
  void OnPasswordAction(const autofill::PasswordForm& password_form,
                        PasswordAction action);

  password_manager::ui::State state() const { return state_; }

  const base::string16& title() const { return title_; }
  const autofill::PasswordForm& pending_password() const {
    return pending_password_;
  }
  // Returns the available credentials which match the current site.
  const ScopedVector<const autofill::PasswordForm>& local_credentials() const {
    return local_credentials_;
  }
  const base::string16& manage_link() const { return manage_link_; }
  const base::string16& save_confirmation_text() const {
    return save_confirmation_text_;
  }
  const gfx::Range& save_confirmation_link_range() const {
    return save_confirmation_link_range_;
  }

  const gfx::Range& title_brand_link_range() const {
    return title_brand_link_range_;
  }

  Profile* GetProfile() const;

  // Returns true iff the multiple account selection prompt for account update
  // should be presented.
  bool ShouldShowMultipleAccountUpdateUI() const;

  // True if the save bubble should display the warm welcome for Google Smart
  // Lock.
  bool ShouldShowGoogleSmartLockWelcome() const;

#if defined(UNIT_TEST)
  // Gets the reason the bubble was dismissed.
  password_manager::metrics_util::UIDismissalReason dismissal_reason() const {
    return dismissal_reason_;
  }

  void set_clock(std::unique_ptr<base::Clock> clock) {
    clock_ = std::move(clock);
  }
#endif

 private:
  enum UserBehaviorOnUpdateBubble {
    UPDATE_CLICKED,
    NOPE_CLICKED,
    NO_INTERACTION
  };
  // Updates |title_| and |title_brand_link_range_| for the
  // PENDING_PASSWORD_STATE.
  void UpdatePendingStateTitle();
  // Updates |title_| for the MANAGE_STATE.
  void UpdateManageStateTitle();
  password_manager::metrics_util::UpdatePasswordSubmissionEvent
  GetUpdateDismissalReason(UserBehaviorOnUpdateBubble behavior) const;
  // URL of the page from where this bubble was triggered.
  GURL origin_;
  password_manager::ui::State state_;
  base::string16 title_;
  // Range of characters in the title that contains the Smart Lock Brand and
  // should point to an article. For the default title the range is empty.
  gfx::Range title_brand_link_range_;
  autofill::PasswordForm pending_password_;
  bool password_overridden_;
  ScopedVector<const autofill::PasswordForm> local_credentials_;
  base::string16 manage_link_;
  base::string16 save_confirmation_text_;
  gfx::Range save_confirmation_link_range_;
  password_manager::metrics_util::UIDisplayDisposition display_disposition_;
  password_manager::metrics_util::UIDismissalReason dismissal_reason_;
  password_manager::metrics_util::UpdatePasswordSubmissionEvent
      update_password_submission_event_;

  // Current statistics for the save password bubble;
  password_manager::InteractionsStats interaction_stats_;

  // Used to retrieve the current time, in base::Time units.
  std::unique_ptr<base::Clock> clock_;

  DISALLOW_COPY_AND_ASSIGN(ManagePasswordsBubbleModel);
};

#endif  // CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_


text:
package io.aeron.logbuffer;

import io.aeron.protocol.DataHeaderFlyweight;
import org.agrona.ErrorHandler;
import org.agrona.concurrent.UnsafeBuffer;
import org.agrona.concurrent.status.Position;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InOrder;

import static io.aeron.logbuffer.FrameDescriptor.*;
import static io.aeron.protocol.HeaderFlyweight.HDR_TYPE_DATA;
import static org.agrona.BitUtil.align;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;

public class TermReaderTest
{
    private static final int TERM_BUFFER_CAPACITY = LogBufferDescriptor.TERM_MIN_LENGTH;
    private static final int HEADER_LENGTH = DataHeaderFlyweight.HEADER_LENGTH;
    private static final int INITIAL_TERM_ID = 7;
    private static final int POSITION_BITS_TO_SHIFT = LogBufferDescriptor.positionBitsToShift(TERM_BUFFER_CAPACITY);

    private final Header header = new Header(INITIAL_TERM_ID, TERM_BUFFER_CAPACITY);
    private final UnsafeBuffer termBuffer = mock(UnsafeBuffer.class);
    private final ErrorHandler errorHandler = mock(ErrorHandler.class);
    private final FragmentHandler handler = mock(FragmentHandler.class);
    private final Position subscriberPosition = mock(Position.class);

    @BeforeEach
    public void setUp()
    {
        when(termBuffer.capacity()).thenReturn(TERM_BUFFER_CAPACITY);
    }

    @Test
    public void shouldReadFirstMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(0)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(0))).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertEquals(1, readOutcome);

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
    }

    @Test
    public void shouldNotReadPastTail()
    {
        final int termOffset = 0;

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertEquals(0, readOutcome);
        verify(subscriberPosition, never()).setOrdered(anyLong());

        verify(termBuffer).getIntVolatile(0);
        verify(handler, never()).onFragment(any(), anyInt(), anyInt(), any());
    }

    @Test
    public void shouldReadOneLimitedMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(anyInt())).thenReturn(frameLength);
        when(termBuffer.getShort(anyInt())).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, 1, header, errorHandler, 0, subscriberPosition);
        assertEquals(1, readOutcome);

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength);
        inOrder.verifyNoMoreInteractions();
    }

    @Test
    public void shouldReadMultipleMessages()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int termOffset = 0;

        when(termBuffer.getIntVolatile(0)).thenReturn(frameLength);
        when(termBuffer.getIntVolatile(alignedFrameLength)).thenReturn(frameLength);
        when(termBuffer.getShort(anyInt())).thenReturn((short)HDR_TYPE_DATA);

        final int readOutcome = TermReader.read(
            termBuffer, termOffset, handler, Integer.MAX_VALUE, header, errorHandler, 0, subscriberPosition);
        assertEquals(2, readOutcome);

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(0);
        inOrder.verify(handler).onFragment(eq(termBuffer), eq(HEADER_LENGTH), eq(msgLength), any(Header.class));

        inOrder.verify(termBuffer).getIntVolatile(alignedFrameLength);
        inOrder
            .verify(handler)
            .onFragment(eq(termBuffer), eq(alignedFrameLength + HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(alignedFrameLength * 2);
    }

    @Test
    public void shouldReadLastMessage()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int frameOffset = TERM_BUFFER_CAPACITY - alignedFrameLength;
        final long startingPosition = LogBufferDescriptor.computePosition(
            INITIAL_TERM_ID, frameOffset, POSITION_BITS_TO_SHIFT, INITIAL_TERM_ID);

        when(termBuffer.getIntVolatile(frameOffset)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(frameOffset))).thenReturn((short)HDR_TYPE_DATA);
        when(subscriberPosition.getVolatile()).thenReturn(startingPosition);

        final int readOutcome = TermReader.read(
            termBuffer,
            frameOffset,
            handler,
            Integer.MAX_VALUE,
            header,
            errorHandler,
            startingPosition,
            subscriberPosition);
        assertEquals(1, readOutcome);

        final InOrder inOrder = inOrder(termBuffer, handler, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(frameOffset);
        inOrder.verify(handler).onFragment(
            eq(termBuffer), eq(frameOffset + HEADER_LENGTH), eq(msgLength), any(Header.class));
        inOrder.verify(subscriberPosition).setOrdered(TERM_BUFFER_CAPACITY);
    }

    @Test
    public void shouldNotReadLastMessageWhenPadding()
    {
        final int msgLength = 1;
        final int frameLength = HEADER_LENGTH + msgLength;
        final int alignedFrameLength = align(frameLength, FRAME_ALIGNMENT);
        final int frameOffset = TERM_BUFFER_CAPACITY - alignedFrameLength;
        final long currentPosition = LogBufferDescriptor.computePosition(
            INITIAL_TERM_ID, frameOffset, POSITION_BITS_TO_SHIFT, INITIAL_TERM_ID);

        when(termBuffer.getIntVolatile(frameOffset)).thenReturn(frameLength);
        when(termBuffer.getShort(typeOffset(frameOffset))).thenReturn((short)PADDING_FRAME_TYPE);
        when(subscriberPosition.getVolatile()).thenReturn(currentPosition);

        final int readOutcome = TermReader.read(
            termBuffer,
            frameOffset,
            handler,
            Integer.MAX_VALUE,
            header,
            errorHandler,
            currentPosition,
            subscriberPosition);
        assertEquals(0, readOutcome);

        final InOrder inOrder = inOrder(termBuffer, subscriberPosition);
        inOrder.verify(termBuffer).getIntVolatile(frameOffset);
        verify(handler, never()).onFragment(any(), anyInt(), anyInt(), any());
        inOrder.verify(subscriberPosition).setOrdered(TERM_BUFFER_CAPACITY);
    }
}


text:
'''
Extract the pillar data for this minion
'''

# Import python libs
import collections

# Import third party libs
import yaml

# Import salt libs
import salt.pillar
import salt.utils
from salt._compat import string_types

__proxyenabled__ = ['*']

def get(key, default='', merge=False, delim=':'):
    '''
    .. versionadded:: 0.14

    Attempt to retrieve the named value from pillar, if the named value is not
    available return the passed default. The default return is an empty string.

    If the merge parameter is set to ``True``, the default will be recursively
    merged into the returned pillar data.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict in pillar looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    merge
        Specify whether or not the retrieved values should be recursively
        merged into the passed default.

        .. versionadded:: Helium

    delim
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: Helium

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.get pkg:apache
    '''
    if merge:
        ret = salt.utils.traverse_dict_and_list(__pillar__, key, {}, delim)
        if isinstance(ret, collections.Mapping) and \
                isinstance(default, collections.Mapping):
            return salt.utils.dictupdate.update(default, ret)

    return salt.utils.traverse_dict_and_list(__pillar__, key, default, delim)

def items(*args):
    '''
    Calls the master for a fresh pillar and generates the pillar data on the
    fly

    Contrast with :py:func:`raw` which returns the pillar data that is
    currently loaded into the minion.

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.items
    '''
    # Preserve backwards compatibility
    if args:
        return item(*args)

    pillar = salt.pillar.get_pillar(
        __opts__,
        __grains__,
        __opts__['id'],
        __opts__['environment'])

    return pillar.compile_pillar()

# Allow pillar.data to also be used to return pillar data
data = items

def item(*args):
    '''
    .. versionadded:: 0.16.2

    Return one ore more pillar entries

    CLI Examples:

    .. code-block:: bash

        salt '*' pillar.item foo
        salt '*' pillar.item foo bar baz
    '''
    ret = {}
    pillar = items()
    for arg in args:
        try:
            ret[arg] = pillar[arg]
        except KeyError:
            pass
    return ret

def raw(key=None):
    '''
    Return the raw pillar data that is currently loaded into the minion.

    Contrast with :py:func:`items` which calls the master to fetch the most
    up-to-date Pillar.

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.raw

    With the optional key argument, you can select a subtree of the
    pillar raw data.::

        salt '*' pillar.raw key='roles'
    '''
    if key:
        ret = __pillar__.get(key, {})
    else:
        ret = __pillar__

    return ret

def ext(external):
    '''
    Generate the pillar and apply an explicit external pillar

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.ext '{libvirt: _}'
    '''
    if isinstance(external, string_types):
        external = yaml.safe_load(external)
    pillar = salt.pillar.get_pillar(
        __opts__,
        __grains__,
        __opts__['id'],
        __opts__['environment'],
        external)

    ret = pillar.compile_pillar()

    return ret


text:
import { $async, $await } from '../generate/async.macro'

import { $iterableCurry } from './internal/$iterable'

$async; function $find (func, iterable) {
  let c = 0
  $await; for (const item of iterable) {
    if ($await(func(item, c++))) {
      return item
    }
  }
  return undefined
}

export default $iterableCurry($find, { reduces: true })


text:
layout: posts_by_category
categories: yarn
title: yarn
permalink: /category/yarn
---


text:
var dirname	= ".";
var filenames	= require('fs').readdirSync(dirname);
filenames	= filenames.filter(function(filename){
	return filename.match(/\-original\.png$/);
});

filenames.forEach(function(filename){
	var newname	= filename.replace(/-original\./, '.');
	var cmdline	= "convert '"+filename+"' -resize 260x180 '"+newname+"'"
	console.log("running $ "+cmdline)
	require('child_process').exec(cmdline);
});


text:
/*
 * This library is dual-licensed: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation. For the terms of this
 * license, see licenses/gpl_v3.txt or <http://www.gnu.org/licenses/>.
 *
 * You are free to use this library under the terms of the GNU General
 * Public License, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * Alternatively, you can license this library under a commercial
 * license, as set out in licenses/commercial.txt.
 */

package ch.swingfx.twinkle.style.theme;

import ch.swingfx.color.ColorUtil;
import ch.swingfx.twinkle.style.AbstractNotificationStyle;
import ch.swingfx.twinkle.style.background.ColorBackground;
import ch.swingfx.twinkle.style.closebutton.RectangleCloseButton;
import ch.swingfx.twinkle.style.closebutton.RoundCloseButton;
import ch.swingfx.twinkle.style.overlay.BorderOverlay;
import ch.swingfx.twinkle.style.overlay.GradientOverlay;
import ch.swingfx.twinkle.style.overlay.OverlayPaintMode;
import ch.swingfx.twinkle.window.NotificationWindowTypes;

import java.awt.*;

/**
 * Light theme for the default window
 * @author Heinrich Spreiter
 * @see ch.swingfx.twinkle.window.NotificationWindowTypes
 */
public class LightDefaultNotification extends AbstractNotificationStyle {
	public LightDefaultNotification() {
		super();
		withNotificationWindowCreator(NotificationWindowTypes.DEFAULT);
		withTitleFontColor(Color.BLACK);
		withMessageFontColor(Color.BLACK);
		withAlpha(0.85f);
		withWidth(320);
		withBackground(new ColorBackground(new Color(0xfd, 0xfd, 0xfd)));
		withWindowCornerRadius(8);
		withOverlay(new BorderOverlay(1, Color.BLACK, OverlayPaintMode.ALWAYS,
					new GradientOverlay(ColorUtil.withAlpha(Color.BLACK, 0f), ColorUtil.withAlpha(Color.BLACK, 0.1f), OverlayPaintMode.MOUSE_OVER)));
		withCloseButton(new RectangleCloseButton(ColorUtil.withAlpha(Color.WHITE, 0.8f), Color.BLACK).withPosition(9, 9));
	}
}


text:
.CodeMirror-dialog {
	position: relative;

}

.CodeMirror-dialog > div {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;

	background: white;
	border-bottom: 1px solid #eee;
	color: #333;
	overflow: hidden;
	padding: .1em .8em;
	z-index: 15;
}

.CodeMirror-dialog input {
	width: 20em;

	background: transparent;
	border: none;
	color: inherit;
	font-family: monospace;
	outline: none;
}


text:
package org.ovirt.engine.core.common.businessentities;

import java.io.Serializable;

import org.ovirt.engine.core.common.utils.ObjectUtils;
import org.ovirt.engine.core.compat.Guid;

public class VmPoolMap implements Serializable {
    private static final long serialVersionUID = 5876397644156138863L;

    public VmPoolMap() {
        this (Guid.Empty, null);
    }

    public VmPoolMap(Guid vm_guid, Guid vm_pool_id) {
        this.vmId = vm_guid;
        this.vmPoolId = vm_pool_id;
    }

    private Guid vmId;

    public Guid getvm_guid() {
        return this.vmId;
    }

    public void setvm_guid(Guid value) {
        this.vmId = value;
    }

    private Guid vmPoolId;

    public Guid getvm_pool_id() {
        return this.vmPoolId;
    }

    public void setvm_pool_id(Guid value) {
        this.vmPoolId = value;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((vmId == null) ? 0 : vmId.hashCode());
        result = prime * result + ((vmPoolId == null) ? 0 : vmPoolId.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        VmPoolMap other = (VmPoolMap) obj;
        return (ObjectUtils.objectsEqual(vmId, other.vmId)
                && ObjectUtils.objectsEqual(vmPoolId, other.vmPoolId));
    }
}


text:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Information about MPEG Video files
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

//---------------------------------------------------------------------------
#ifndef MediaInfo_Vc1H
#define MediaInfo_Vc1H
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
//---------------------------------------------------------------------------

namespace MediaInfoLib
{

//***************************************************************************
// Class File_Vc1
//***************************************************************************

class File_Vc1 : public File__Analyze
{
public :
    //In
    int64u Frame_Count_Valid;
    bool   FrameIsAlwaysComplete;
    bool   From_WMV3;
    bool   Only_0D;

    //Constructor/Destructor
    File_Vc1();
    ~File_Vc1();

private :
    //Streams management
    void Streams_Accept();
    void Streams_Fill();
    void Streams_Finish();

    //Buffer - File header
    bool FileHeader_Begin();

    //Buffer - Synchro
    bool Synchronize() {return Synchronize_0x000001();}
    bool Synched_Test();
    void Synched_Init();

    //Buffer - Demux
    #if MEDIAINFO_DEMUX
    bool Demux_UnpacketizeContainer_Test();
    #endif //MEDIAINFO_DEMUX

    //Buffer - Global
    void Read_Buffer_Unsynched();

    //Buffer - Per element
    void Header_Parse();
    bool Header_Parser_QuickSearch();
    bool Header_Parser_Fill_Size();
    void Data_Parse();

    //Elements
    void EndOfSequence();
    void Slice();
    void Field();
    void FrameHeader();
    void EntryPointHeader();
    void SequenceHeader();
    void UserDefinedSlice();
    void UserDefinedField();
    void UserDefinedFrameHeader();
    void UserDefinedEntryPointHeader();
    void UserDefinedSequenceHeader();

    //Count
    size_t Interlaced_Top;
    size_t Interlaced_Bottom;
    std::vector<size_t> PictureFormat_Count;

    //From SequenceHeader
    std::vector<int32u> hrd_buffers;
    int16u coded_width;
    int16u coded_height;
    int16u framerateexp;
    int8u  frameratecode_enr;
    int8u  frameratecode_dr;
    int8u  profile;
    int8u  level;
    int8u  colordiff_format;
    int8u  AspectRatio;
    int8u  AspectRatioX;
    int8u  AspectRatioY;
    int8u  hrd_num_leaky_buckets;
    int8u  max_b_frames;
    bool   interlace;
    bool   tfcntrflag;
    bool   framerate_present;
    bool   framerate_form;
    bool   hrd_param_flag;
    bool   finterpflag;
    bool   rangered;
    bool   psf;
    bool   pulldown;
    bool   panscan_flag;

    //Stream
    struct stream
    {
        bool   Searching_Payload;
        bool   Searching_TimeStamp_Start;
        bool   Searching_TimeStamp_End;

        stream()
        {
            Searching_Payload=false;
            Searching_TimeStamp_Start=false;
            Searching_TimeStamp_End=false;
        }
    };
    std::vector<stream> Streams;

    //Temporal reference
    struct temporalreference
    {
        bool   top_field_first;
        bool   repeat_first_field;
    };
    std::map<int16u, temporalreference> TemporalReference; //int32u is the reference
    std::vector<temporalreference>      TemporalReference_Waiting; //First must be I and P-frames, other B-frames
    int16u TemporalReference_Offset;

    //Temp
    size_t Width;
    size_t Height;
    size_t RatioValue;
    size_t BitRate;
    int8u  start_code;
    bool   EntryPoint_Parsed;
    float32 FrameRate;
    size_t RefFramesCount;

    //Error controls
    std::vector<int8u> Frame_ShouldBe;

    #if MEDIAINFO_DEMUX
        int8u* InitData_Buffer;
        size_t InitData_Buffer_Size;
    #endif //MEDIAINFO_DEMUX

};

} //NameSpace

#endif


text:
layout: page
title: Bolt Trade Party
date: 2016-05-24
author: Russell Pollard
tags: weekly links, java
status: published
summary: Vivamus id interdum orci. Suspendisse vel.
banner: images/banner/office-01.jpg
booking:
  startDate: 03/01/2018
  endDate: 03/02/2018
  ctyhocn: RICGLHX
  groupCode: BTP
published: true
---
Fusce gravida imperdiet augue dapibus sodales. Nunc sollicitudin nibh dui, sit amet egestas nisi pulvinar eu. Pellentesque mauris massa, consequat quis mauris vel, accumsan bibendum urna. Vestibulum tempus luctus orci, a rutrum sapien tempor eu. Praesent auctor ultrices euismod. Cras fermentum eget leo sed pulvinar. Morbi sodales massa sem, eu vehicula risus dictum non. Duis ultrices risus urna, ut ornare ipsum gravida et. Cras porttitor molestie neque, vitae eleifend purus semper nec. Cras rhoncus sollicitudin ligula nec vehicula. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris eget eros nibh.

* Mauris ut odio pellentesque, tincidunt dolor in, ornare eros
* Suspendisse sit amet leo vehicula, laoreet erat ut, ornare ipsum
* Pellentesque vitae diam aliquam, scelerisque ex non, suscipit est.

Suspendisse id purus et turpis ullamcorper luctus ut sit amet ex. Sed a congue tellus. Quisque at augue ut est vestibulum fringilla vehicula eu nulla. Integer eleifend nec sapien ut egestas. Donec in tortor sit amet mi euismod pharetra et sit amet ex. Morbi tincidunt condimentum leo ultricies sollicitudin. Morbi vestibulum sapien in condimentum semper. Aenean eget lorem sed nunc elementum tempus. Ut egestas pretium molestie. Aenean dignissim molestie quam at egestas. Cras rhoncus interdum dui, eget pulvinar sapien dignissim nec. Fusce nec bibendum mi.


text:
'use strict';

class Build {
  constructor(data) {
    /**
     * @type {string}
     */
    this.platform = data.platform;

    /**
     * @type {string}
     */
    this.arch = data.arch;

    /**
     * @type {string}
     */
    this.version = data.version;

    /**
     * @type {string}
     */
    this.channel = data.channel;

    /**
     * @type {{ install: string, update: string, metaFile: string }}
     */
    this.assets = data.assets || {
      install: null,
      update: null,
      metaFile: null,
    };
  }

  get id() {
    return [this.platform, this.arch, this.channel]
      .filter(Boolean)
      .join('-');
  }

  get idWithVersion() {
    return [this.platform, this.arch, this.channel, this.version]
      .filter(Boolean)
      .join('-');
  }

  get type() {
    return `${this.platform}-${this.arch}`;
  }

  hasCompleteSpecification() {
    if (!this.platform || !this.arch || !this.channel || !this.version) {
      return false;
    }

    const isValid = this.platform.match(/\w+/)
      && this.arch.match(/\w+/)
      && this.channel.match(/\w+/)
      && this.version.match(/\d+\.\d+\.\d+/);

    return isValid;
  }

  toString() {
    return this.idWithVersion;
  }

  /**
   * @param {string | Partial<Build>} build
   * @param {Partial<Build>} defaults
   * @return {Build}
   */
  static normalize(build, defaults = {}) {
    if (typeof build === 'string') {
      const [platform, arch, channel, ...version] = build.split('-');
      build = { platform, arch, channel, version: version.join('-') };
    }

    ['platform', 'arch', 'channel', 'version'].forEach((field) => {
      if (!build[field] && defaults[field]) {
        build[field] = defaults[field];
      }
    });

    if (build.version && build.version.indexOf('v') === 0) {
      build.version = build.version.substring(1);
    }

    return new Build(build);
  }

  /**
   * @param {Array<string | Partial<Build>>} builds
   * @param {Partial<Build>} defaults
   * @return {Build[]}
   */
  static normalizeMany(builds, defaults = {}) {
    return builds.map(build => Build.normalize(build, defaults));
  }
}

module.exports = Build;


text:
package com.example.textmate;

import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
//
import android.app.LoaderManager;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.database.SQLException;
import android.provider.ContactsContract;
import android.content.Intent;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import com.example.textmate.sqlitehelper.DatabaseHelper;
import com.example.textmate.sqlite.models.textMateData;
import com.example.textmate.sqlite.models.textMateScores;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.util.List;

import android.view.View;
import android.widget.Button;

import java.util.Vector;

public class contacts extends ActionBarActivity //implements View.OnClickListener
{
    private ProgressDialog progressDialogInbox;
    DatabaseHelper dbHelper;
    textMateData dbData;
    alg scoreData;
    Calendar c = Calendar.getInstance();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contacts);
        dbHelper = new DatabaseHelper(this);
        progressDialogInbox = new ProgressDialog(this);
        fetchInboxMessages();
        ListView listView = (ListView) findViewById(R.id.list);

       /* String[] contacts = new String[]{"Mike Wazowski",
                "Joe Kickass",
                "Teemo",
                "Mom"}; */
        //Intent intent = getIntent();
        ArrayList<Long> contacts = dbHelper.getThreadID();
        ArrayList<String> contacts2 = new ArrayList<String>();
        final ArrayList<ArrayList<Integer>> smsTimeList = new ArrayList<ArrayList<Integer>>();
        final ArrayList<String> avgScores = new ArrayList<String>();
        final ArrayList<String> todayScores = new ArrayList<String>();
        final ArrayList<String> yesScores = new ArrayList<String>();
        final ArrayList<String> timeStamp = new ArrayList<String>();
        int i = 0;
        while (i< contacts.size()){
            contacts2.add(dbHelper.queriesForPhoneNumber(contacts.get(i)));
            smsTimeList.add(dbHelper.querySMSListOfTimeReceived(contacts.get(i)));
            avgScores.add(String.valueOf(dbHelper.queryThreadIDScores(contacts.get(i), "average_score")));
            todayScores.add(String.valueOf(dbHelper.queryThreadIDScores(contacts.get(i), "today_score")));
            yesScores.add(String.valueOf(dbHelper.queryThreadIDScores(contacts.get(i), "yesterday_score")));
            timeStamp.add(String.valueOf(dbHelper.queryForRelationshipMessage(contacts.get(i))));
            i++;
        }
        //Arrays.sort(contacts);

        //Assigning an adapter
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, android.R.id.text1, contacts2);
        listView.setAdapter(adapter);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                        String name = (String) parent.getItemAtPosition(position);
                        ArrayList<Integer> timeList = smsTimeList.get(position);
                        String avg = (String) avgScores.get(position);
                        String today = (String) todayScores.get(position);
                        String yes = (String) yesScores.get(position);
                        String timestamp = (String) timeStamp.get(position);
                        Intent newActivity = new Intent(contacts.this, contactInfo.class);
                        newActivity.putExtra("name", name);
                        newActivity.putExtra("avgscore", avg);
                        newActivity.putExtra("todayScore", today);
                        newActivity.putExtra("yesScore", yes);
                        newActivity.putExtra("time", timestamp);
                        newActivity.putExtra("timeList2", timeList);
                        startActivity(newActivity);
            }
        });
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
     //   getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

 /*   @Override
    public void onClick(View v) {

    }*/
 private void showProgressDialog(String message) {
     //
     progressDialogInbox.setMessage(message);
     progressDialogInbox.setIndeterminate(true);
     progressDialogInbox.setCancelable(true);
     progressDialogInbox.setButton(ProgressDialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() {
         @Override
         public void onClick(DialogInterface dialog, int which) {
             stopThread();
         }
     });
     progressDialogInbox.show();
 }

    private void fetchInboxMessages() {
        showProgressDialog("TextMate is Fetching Inbox Messages...");
        startThread();
    }

    private FetchMessageThread fetchMessageThread;
    private int currentCount = 0;

    // FetchMessageThread to create a parallel thread in order for
    // the application to fetch the sms data and populate thread data.
    public class FetchMessageThread extends Thread {
        //
        public int tag = -1;

        public FetchMessageThread(int tag) {
            this.tag = tag;
        }

        @Override
        public void run() {
            fetchSms();
            populateData(dbHelper);
            populateScores(dbHelper);
            progressDialogInbox.dismiss();
        }
    }

    public synchronized void startThread() {
        if (fetchMessageThread == null) {
            fetchMessageThread = new FetchMessageThread(currentCount);
            fetchMessageThread.start();
        }
    }

    public synchronized void stopThread() {
        if (fetchMessageThread != null) {
            Log.i("Cancel thread", "stop thread");
            FetchMessageThread moribund = fetchMessageThread;
            currentCount = fetchMessageThread.tag == 0 ? 1 : 0;
            fetchMessageThread = null;
            moribund.interrupt();
        }
    }

    public void fetchSms() {
        ContentResolver contentResolver = getContentResolver();

        Cursor cursor = contentResolver.query(
                Uri.parse("content://sms"),
                new String[]{"thread_id", "address", "person", "date", "body", "type"},
                null,
                null,
                null);

        try {
            if (cursor.moveToLast()) {
                do {
                    // to grab the data
                    long t_id = cursor.getLong(cursor.getColumnIndex("thread_id"));
                    String address = cursor.getString(cursor.getColumnIndex("address"));
                    int person = cursor.getInt(cursor.getColumnIndex("person"));
                    long date = cursor.getLong(cursor.getColumnIndex("date"));
                    String body = cursor.getString(cursor.getColumnIndex("body"));
                    int type = cursor.getInt(cursor.getColumnIndex("type"));
                    //long dateSent = cursor.getLong(cursor.getColumnIndex("date_sent"));
                    //
                    try {
                        switch (type) {
                            case 1:
                                String flag = "INCOMING";
                                dbHelper.insert_sms(t_id, address, person, date, body, type, flag);
                                break;
                            case 2:
                                flag = "OUTGOING";
                                dbHelper.insert_sms(t_id, address, person, date, body, type, flag);
                                break;
                        }
                    } catch (SQLException e) {
                        Log.d("fetchSMS -> ", "INSERTION Failed!");
                    }
                } while (cursor.moveToPrevious());
                cursor.close();
            }
        } catch (SQLException e) {
            Log.d("fetchSms->", "INSERTION Failed!");
        }

        /* After fetchSMS is done, the dbHelper object will invoke the
        * populateThread function to correctly populate the Thread table.
        */
        try {
            dbHelper.populateThread();
        } catch (SQLException e) {
            Log.d("fetchSMS(pThread) -> ", "INSERTION Failed!");
        }
    }

    //Use the textMateData Class to find the averages needed for the Algorithm.
    //Then put the data into the sms data table.
    public void populateData(DatabaseHelper dbHelper){
        ArrayList<Long> threadIDs = dbHelper.getThreadID();
        for(int pos=0;pos<threadIDs.size();pos++) {
            dbData = new textMateData(threadIDs.get(pos),dbHelper);
            dbData = null;
        }
    }

    //Use the Algorithm Class to Find the scores based on the data found in
    // populate data. Then takes the scores and populate the thread table.
    public void populateScores(DatabaseHelper dbHelper){
        // Pass the values into the Constructor
        ArrayList<Long> threadIDs = dbHelper.getThreadID();
        for(int pos=0;pos<threadIDs.size();pos++) {
            scoreData = new alg(threadIDs.get(pos),dbHelper);
            scoreData=null;
        }
    }
}


text:
package jp.itnav.tomigie.recyclerviewsample;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.view.View;

import java.util.ArrayList;

/**
 * 各Activityに継承させるためのクラス
 * (各Activityで共通する処理をこのクラスのメソッドでまとめているだけ)
 */
public abstract class BaseActivity extends ActionBarActivity implements View.OnClickListener {

    /**
     * 仮データ生成メソッド
     * @param dataSize
     * @return Stringデータ
     */
    protected ArrayList<String> getDataList(int dataSize) {
        ArrayList<String> dataList = new ArrayList<>();
        for (int i = 1; i <= dataSize; i++) {
            dataList.add("card" + i);
        }
        return dataList;
    }

    protected void startNewActivity(Class<Activity> activity) {
        Intent intent = new Intent(this, activity);
        startActivity(intent);
    }
}


text:
string DYNAMIC_TYPES_MESSAGE_JSON = "[{"
    "\"id\": \"" + DATA_VALUES_MESSAGE_TYPE_NAME + "\","
    "\"type\": \"object\","
    "\"classification\": \"dynamic\","
    "\"properties\": {"
        "\"Time\": {"
            "\"format\": \"date-time\","
            "\"type\": \"string\","
            "\"isindex\": true"
        "},"
        // If you are NOT using a K64f, comment out the below lines
        "\"X-acceleration\": {\"type\": \"number\",\"description\": \"In Gs\"},"
        "\"Y-acceleration\": {\"type\": \"number\",\"description\": \"In Gs\"},"
        "\"Z-acceleration\": {\"type\": \"number\",\"description\": \"In Gs\"},"
        "\"X-orientation\": {\"type\": \"number\",\"description\": \"In degrees\"},"
        "\"Y-orientation\": {\"type\": \"number\",\"description\": \"In degrees\"},"
        "\"Z-orientation\": {\"type\": \"number\",\"description\": \"In degrees\"}"
        // Send two random heartbeats
        //"\"Raw Sensor Reading 1\": {\"type\": \"number\"},"
        //"\"Raw Sensor Reading 2\": {\"type\": \"number\"}"
        // For example, to allow you to send a string-type live data value," +
        // such as \"Status\", you would add
        //\"Status\": {
        //   \"type\": \"string\"
        //}
"}}]";

// ************************************************************************
// Create JSON to define the type that will be used to send AF assets
// ************************************************************************

string STATIC_TYPES_MESSAGE_JSON = "[{"
    "\"id\": \"" + ASSETS_MESSAGE_TYPE_NAME + "\","
    "\"type\": \"object\","
    "\"classification\": \"static\","
    "\"properties\": {"
        "\"Name\": {"
            "\"type\": \"string\","
            "\"isindex\": true"
        "},"
        "\"Device Type\": {"
            "\"type\": \"string\""
        "},"
        "\"Location\": {"
            "\"type\": \"string\""
        "},"
        "\"Data Ingress Method\": {"
            "\"type\": \"string\""
        "}"
        // For example, to add a number-type static
        // attribute for the device model, you would add
        // \"Model\": {
        //   \"type\": \"number\"
        //}
    "}"
"}]";

// ************************************************************************
// Create a JSON packet to containing the asset data for the PI AF asset that will be made
// ************************************************************************

// Here is where you can specify values for the static PI AF attributes;
// in this case, we are auto-populating the Device Type, but you can manually hard-code in values if you wish
// we also add the LINKS to be made, which will both position the new PI AF
// Element, so it will show up in AF, and will associate the PI Points that will be created with that Element
string ASSETS_MESSAGE_JSON = "["
    "{"
        // This will end up creating a new PI AF Element with this specific name and static attribute values
        "\"typeid\":\"" + ASSETS_MESSAGE_TYPE_NAME + "\","
        "\"values\": ["
            "{" ""
                "\"Name\": \"" + DEVICE_NAME + "\","
                "\"Device Type\": \"" + "ARM dev board" + "\","
                "\"Location\": \"" + DEVICE_LOCATION + "\","
                "\"Data Ingress Method\": \"OMF\""
            "}"
        "]"
    "}"
"]";

// The containers message JSON requires both of the above constants; it is also a constant
const string CONTAINERS_MESSAGE_JSON = "["
    "{"
        "\"id\": \"" + DATA_VALUES_CONTAINER_ID + "\","
        "\"typeid\": \"" + DATA_VALUES_MESSAGE_TYPE_NAME + "\""
    "}"
"]";

// A JSON packet to containing linking data for the PI AF asset that will be made
const string LINKS_MESSAGE_JSON = "["
    "{"
        "\"typeid\": \"__Link\"" ","
        "\"values\": ["
            // This first link will locate such a newly created AF Element under the root PI element targeted by the PI Connector in your target AF database
            // This was specfied in the Connector Relay Admin page; note that a new parent element, with the same name as the producer_token, will also be made
            "{"
                "\"Source\": {"
                    "\"typeid\": \"" + ASSETS_MESSAGE_TYPE_NAME + "\","
                    "\"index\": \"_ROOT\""
                "},"
                "\"Target\": {"
                    "\"typeid\": \"" + ASSETS_MESSAGE_TYPE_NAME + "\","
                    "\"index\": \"" +  DEVICE_NAME + "\""
                "}"
            "},"
            // This second link will map new PI Points (created by messages sent to the data values container) to a newly create element
            "{"
            "\"Source\": {"
                "\"typeid\": \"" + ASSETS_MESSAGE_TYPE_NAME + "\","
                    "\"index\": \"" + DEVICE_NAME + + "\""
                "},"
                "\"Target\": {"
                    "\"containerid\": \"" + DATA_VALUES_CONTAINER_ID + "\""
                "}"
            "}"
        "]"
    "}"
"]";

#endif