text:
using System;
using System.Linq;
using System.Drawing;

using CoreAnimation;
using Foundation;
using CoreGraphics;

namespace Common
{
	public class CheckBoxLayer : CALayer
	{
		static readonly string[] keys = new string[] {
			"tintColor",
			"checked",
			"strokeFactor",
			"insetFactor",
			"markInsetFactor"
		};

		static readonly nfloat[] components = new nfloat[] {
			0.5f, 0.5f, 0.5f
		};

		[Outlet("strokeFactor")]
		public float StrokeFactor { get; set; }

		[Outlet("insetFactor")]
		public float InsetFactor { get; set; }

		[Outlet("markInsetFactor")]
		public float MarkInsetFactor { get; set; }

		CGColor tintColor;
		[Outlet("tintColor")]
		public CGColor TintColor {
			get {
				return tintColor;
			}
			set {
				tintColor = value;
				SetNeedsDisplay ();
			}
		}

		bool isChecked;
		[Outlet("checked")]
		public bool Checked {
			get {
				return isChecked;
			}
			set {
				isChecked = value;
				SetNeedsDisplay ();
			}
		}

		public CheckBoxLayer ()
		{
			TintColor = new CGColor (CGColorSpace.CreateDeviceRGB (), components);

			StrokeFactor = 0.07f;
			InsetFactor = 0.17f;
			MarkInsetFactor = 0.34f;
		}

		public override void DrawInContext (CGContext context)
		{
			base.DrawInContext (context);
			nfloat size = NMath.Min (Bounds.Size.Width, Bounds.Size.Height);

			CGAffineTransform transform = AffineTransform;

			nfloat xTranslate = 0;
			nfloat yTranslate = 0;

			if (Bounds.Size.Width < Bounds.Size.Height)
				yTranslate = (Bounds.Size.Height - size) / 2f;
			else
				xTranslate = (Bounds.Size.Width - size) / 2f;

			transform.Translate (xTranslate, yTranslate);

			nfloat strokeWidth = StrokeFactor * size;
			nfloat checkBoxInset = InsetFactor * size;

			// Create the outer border for the check box.
			nfloat outerDimension = size - 2 * checkBoxInset;
			var checkBoxRect = new CGRect(checkBoxInset, checkBoxInset, outerDimension, outerDimension);
			checkBoxRect = transform.TransformRect (checkBoxRect);

			// Make the desired width of the outer box.
			context.SetLineWidth (strokeWidth);

			// Set the tint color of the outer box.
			context.SetStrokeColor (TintColor);

			// Draw the outer box.
			context.StrokeRect (checkBoxRect);

			// Draw the inner box if it's checked.
			if (Checked) {
				nfloat markInset = MarkInsetFactor * size;

				nfloat markDimension = size - 2 * markInset;
				var markRect = new CGRect(markInset, markInset, markDimension, markDimension);
				markRect = transform.TransformRect (markRect);

				context.SetFillColor (TintColor);
				context.FillRect (markRect);
			}
		}

		[Export ("needsDisplayForKey:")]
		public new static bool NeedsDisplayForKey(string key)
		{
			if (keys.Contains (key))
				return true;
			else
				return CALayer.NeedsDisplayForKey (key);
		}
	}
}


text:
module CXML
  class Document
    attr_accessor :version
    attr_accessor :payload_id
    attr_accessor :timestamp

    attr_accessor :header
    attr_accessor :request
    attr_accessor :response

    def initialize(data={})
      if data.kind_of?(Hash) && !data.empty?
        @version = data['version']
        @payload_id = data['payloadID']

        if data['timestamp']
          @timestamp = data['timestamp']
        end

        if data['Header']
          @header = CXML::Header.new(data['Header'])
        end

        if data['Request']
          @request = CXML::Request.new(data['Request'])
        end

        if data['Response']
          @response = CXML::Response.new(data['Response'])
        end
      end
    end

    # Check if document is request
    # @return [Boolean]
    def request?
      !request.nil?
    end

    # Check if document is a response
    # @return [Boolean]
    def response?
      !response.nil?
    end

    def render
      node = CXML.builder
      node.cXML('version' => version, 'payloadID' => payload_id, 'timestamp' => timestamp) do |doc|
        doc.Header { |n| @header.render(n) } if @header
        @request.render(node) if @request
        @response.render(node) if @response
      end
      node
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
start chrome.exe -incognito localhost
start chrome.exe -incognito localhost
start chrome.exe -incognito localhost


text:
FROM ubuntu:14.04
MAINTAINER István Koren <koren ÄT dbis.rwth-aachen.de>

# Let the container know that there is no tty
ENV DEBIAN_FRONTEND noninteractive

# Update base image
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get upgrade -y

# Install required tools
RUN apt-get install software-properties-common -y && \
    add-apt-repository ppa:jon-severinsson/ffmpeg -y && \
    apt-get update -y && \
    apt-get install -y ffmpeg \
                    nodejs \
                    npm && \
    ln -s /usr/bin/nodejs /usr/bin/node

RUN mkdir /transcode
WORKDIR /transcode
VOLUME ["/transcode"]

CMD node index.js


text:
var parent = require('../actual/set-timeout');

module.exports = parent;


text:
{% extends "base/base.html" %}

{% block head %}
	{{super()}}

	<link href="{{url_for('static', filename='css/editor.css')}}" rel="stylesheet">
{% endblock %}

{% block page_content %}

Welcome !

Login

								Username
								<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">

								Password
								<input type="password" class="form-control" placeholder="Password" aria-describedby="basic-addon1">

								<button class="btn btn-default" type="button">Login</button>

Regiser

								Username
								<input type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">

Password

								<input type="password" class="form-control" placeholder="Password" aria-describedby="basic-addon1">

Again

								<input type="password" class="form-control" placeholder="Password" aria-describedby="basic-addon1">

Email

								<input type="email" class="form-control" placeholder="Password" aria-describedby="basic-addon1">

								<button class="btn btn-default" type="button">Register</button>

{% endblock %}


text:
oauth2-avro-d2-example
=========

An example of Avro D2 web service with OAuth2, using [Avro D2 module](https://github.com/tfeng/play-mods/tree/master/avro-d2) and [OAuth2 module](https://github.com/tfeng/play-mods/tree/master/oauth2).

---

#### Overview

Avro D2 provides dynamic discovery and client-side load balancing. Similar to [Avro D2 example](../avro-d2-example), there is an endpoint in this example to accept Avro binary IPC requests, and there is also an endpoint to simulate a client calling the Avro binary IPC (Inter-Process Communication) endpoint with a generated Java proxy.

In addition to the two endpoints, this example exposes endpoints to authenticate a user with OAuth2. This is similar to [OAuth2 example](../oauth2-example). If an Avro IPC request is not properly authenticated, the service returns an error.

#### Manual testing

The first step to interact with the service is to get a client access code.

```bash
$ curl -X POST -H "Content-Type: application/json" -d '{"clientId": "trusted-client", "clientSecret": "trusted-client-password"}' http://localhost:9000/client/authenticate
{"accessToken":"02db69c8-8bbc-4649-a033-e49088f9f5ce","clientId":"trusted-client","expiration":1409713005828}
```

With the client access code, one may authenticate a user with username and password.

```bash
$ curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 02db69c8-8bbc-4649-a033-e49088f9f5ce" -d '{"username": "test", "password": "password"}' http://localhost:9000/user/authenticate
{"accessToken":"879fd16f-4b8a-4973-9f9d-27806f716fdc","username":"test","expiration":1409713028783,"refreshToken":"9c9ca53b-36c4-4677-adea-ebf518a21e86"}
```

Using the user access code, one may send a request to the /example endpoint and have a message echoed from the service.

```bash
$ curl -H "Authorization: Bearer 879fd16f-4b8a-4973-9f9d-27806f716fdc" "http://localhost:9000/proxy?message=hello"
hello
```

#### Error

If the user access token is not provided, the service returns status code ```401 Unauthorized```.

```bash
$ curl -i "http://localhost:9000/proxy?message=hello"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Tue, 22 Mar 2016 10:14:34 GMT
```

If a client access token is mistakenly used in place of a user access token, the service also returns status code ```401 Unauthorized```.

```bash
$ curl -i -H "Authorization: Bearer 02db69c8-8bbc-4649-a033-e49088f9f5ce" "http://localhost:9000/proxy?message=hello"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Tue, 22 Mar 2016 10:14:50 GMT
```

If Avro command-line tool ([avro-tools-1.8.0.jar](http://central.maven.org/maven2/org/apache/avro/avro-tools/1.8.0/avro-tools-1.8.0.jar)) is used to directly send a request to the service, an error is returned, because the command-line tool does not include the access token.

```bash
$ java -jar avro-tools-1.8.0.jar rpcsend http://localhost:9000/example codegen/example.avpr echo -data '{"message": "hello"}'
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:9000/example
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1840)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
	at org.apache.avro.ipc.HttpTransceiver.readBuffers(HttpTransceiver.java:54)
	at org.apache.avro.ipc.Transceiver.transceive(Transceiver.java:59)
	at org.apache.avro.ipc.Transceiver.transceive(Transceiver.java:72)
	at org.apache.avro.ipc.Requestor.request(Requestor.java:147)
	at org.apache.avro.ipc.Requestor.request(Requestor.java:101)
	at org.apache.avro.ipc.generic.GenericRequestor.request(GenericRequestor.java:58)
	at org.apache.avro.tool.RpcSendTool.run(RpcSendTool.java:101)
	at org.apache.avro.tool.Main.run(Main.java:87)
	at org.apache.avro.tool.Main.main(Main.java:76)
```

Currently, there is no way to send a request with the access token using the Avro command-line tool. [HttpTransceiver](http://avro.apache.org/docs/1.8.0/api/java/org/apache/avro/ipc/HttpTransceiver.html) in the Avro library does not set an authorization header. To see how this is done with a custom transceiver, refer to [AsyncHttpTransceiver](https://github.com/tfeng/play-mods/blob/master/avro/app/org/apache/avro/ipc/AsyncHttpTransceiver.java) and [AuthorizationPreservingRequestPreparer](https://github.com/tfeng/play-mods/blob/master/avro/app/me/tfeng/playmods/avro/AuthorizationPreservingRequestPreparer.java).


text:
package net.savantly.sprout.wiki;

import java.io.StringWriter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import info.bliki.wiki.model.WikiModel;
import net.savantly.sprout.content.contentItem.ContentItemRenderer;
import net.savantly.sprout.core.content.contentItem.ContentItem;

@Service
public class WikiContentRenderer implements ContentItemRenderer {
	private final Logger log = LoggerFactory.getLogger(WikiContentRenderer.class);

	private final WikiModel wikiModel = new WikiModel(
			"/plugins;id=wikiModule;path=${image}",
			"/plugins;id=wikiModule;path=${title}");

	@Override
	public int getPriority() {
		return 1;
	}

	@Override
	public boolean render(ContentItem item, StringWriter writer) {
		if (item.getContentType().getId().equals(WikiFixture.DEFAULT_CONTENT_TYPE_NAME)) {
			log.debug("rendering ContentItem: {}", item.getId());
			renderWikiContent(item, writer);
			return true;
		}
		log.debug("skipping ContentItem: {}", item.getId());
		return false;
	}

	private void renderWikiContent(ContentItem item, StringWriter writer) {
		try {
			item.getFieldValues().forEach((k, v) -> {
				if (k.getName().toLowerCase() == "title") {
					log.debug("writing title: {}", v);
					writer.write(String.format("<h1>%s</h1>", v));
				} else if (k.getName().toLowerCase() == "body") {
					try {
						log.debug("writing body: {}", v);
						writer.write(wikiModel.render(v));
					} catch (Exception ex) {
						log.error("{}", ex);
						writer.write(ex.getLocalizedMessage());
					}
				}
			});
		} catch (Exception ex) {
			log.error("{}", ex);
		}
	}

}


text:
class AdminAbility
  include CanCan::Ability
  def initialize(user)
    if user && user.admin?
      can :access, :rails_admin
      can :manage, :all
    end
  end
end


text:
package com.rdshoep.android.study.bean;
/*
 * @description
 *   Please write the User module's description
 * @author Zhang (rdshoep@126.com)
 *   http://www.rdshoep.com/
 * @version
 *   1.0.0(11/5/2015)
 */

public class User {
}


text:
package ardom.common.data.requests.get;

import ardom.common.configuration.Config;
import ardom.common.data.models.business.WorkerList;
import ardom.common.data.models.misc.Credentials;
import ardom.common.data.requests.base.RequestBase;
import ardom.jsoap.annotations.JSoapClass;

import static ardom.common.configuration.Config.SOAP_ACTION_PREFIX;

/**
 * Created by Joao Cruz on 07/01/15.
 */

@JSoapClass(namespace = Config.NAMESPACE, methodName = GetWorkerListRequest.METHOD_NAME, soapAction = SOAP_ACTION_PREFIX + GetWorkerListRequest.METHOD_NAME, rootElement = "OVD")
public class GetWorkerListRequest extends RequestBase<WorkerList> {

    static final String METHOD_NAME = "GETOVDS";

    public GetWorkerListRequest(Credentials credentials) {
        super(credentials);

        setClassOfT(WorkerList.class);
    }
}


text:
using JetBrains.Annotations;
using JsonApiDotNetCore.Resources;
using JsonApiDotNetCore.Resources.Annotations;

namespace JsonApiDotNetCoreTests.IntegrationTests.CustomRoutes;

[UsedImplicitly(ImplicitUseTargetFlags.Members)]
[Resource(ControllerNamespace = "JsonApiDotNetCoreTests.IntegrationTests.CustomRoutes")]
public sealed class Civilian : Identifiable<int>
{
    [Attr]
    public string Name { get; set; } = null!;
}


text:
package com.cobber.fta.dates;

import java.util.HashMap;
import java.util.Map;

/**
 * Capture the State of the DateTimeParser - this and the Configuration are all we need to serialize()/deserialize()/merge the DateTimeParser.
 */
public class DateTimeParserState {
	public int sampleCount;
	public int nullCount;
	public int blankCount;
	public int invalidCount;
	public final Map<String, Integer> results;

	DateTimeParserState() {
		results = new HashMap<>();
	}

	/**
	 * Merge a DateTimeParserState from another DateTimeParser with this one.
	 * Note: You cannot merge states unless the DateTimeParserConfigs are equal.
	 * @param other The other DateTimeParserState to be merged
	 * @return A merged DateTimeParserState.
	 */
	public DateTimeParserState merge(final DateTimeParserState other) {
		sampleCount += other.sampleCount;
		nullCount += other.nullCount;
		blankCount += other.blankCount;
		invalidCount += other.invalidCount;

		for (final Map.Entry<String, Integer> entry : other.results.entrySet()) {
			final Integer myCount = results.get(entry.getKey());
			if (myCount == null)
				results.put(entry.getKey(), entry.getValue());
			else
				results.put(entry.getKey(), entry.getValue() + myCount);
		}

		return this;
	}
}


text:
<?php

/**
 * Debug panel for Yii2Debug extension for fast access to XHProf results and list of previous runs with ability
 * to compare results between each others.
 *
 * @author Vadym Stepanov <vadim.stepanov.ua@gmail.com>
 */
class XHProfPanel extends Yii2DebugPanel
{
    public function getName()
    {
        return 'XHProf';
    }

    public function getDetail()
    {
        if (Yii::app()->getComponent('xhprof', false) === null) {
            return $this->render(__DIR__ . '/views/details_disabled_component.php');
        }

        $reports = Yii::app()->xhprof->loadReports();
        rsort($reports);

        $urlTemplates = array(
            'report' => Yii::app()->xhprof->getReportBaseUrl() . '/' . XHProf::$urlTemplates['report'],
            'callgraph' => Yii::app()->xhprof->getReportBaseUrl() . '/' . XHProf::$urlTemplates['callgraph'],
            'diff' => Yii::app()->xhprof->getReportBaseUrl() . '/' . XHProf::$urlTemplates['diff']
        );

        $js = <<<EOD
XHProf.urlReportTemplate = '{$urlTemplates['report']}';
XHProf.urlCallgraphTemplate = '{$urlTemplates['callgraph']}';
XHProf.urlDiffTemplate = '{$urlTemplates['diff']}';
EOD;

        $assetPath = Yii::app()->assetManager->publish(__DIR__ . '/assets');
        /** @var CClientScript $cs */
        $cs = Yii::app()->clientScript;
        $cs->registerScriptFile($assetPath . '/xhprof.js', CClientScript::POS_HEAD);
        $cs->registerScript('xhprof_init', $js, CClientScript::POS_END);

        $urls = array();
        $data = $this->getData();

        if ($data['enabled']) {
            $urls['report'] = XHProf::getInstance()->getReportUrl($data['runId'], $data['ns']);
            $urls['callgraph'] = XHProf::getInstance()->getCallgraphUrl($data['runId'], $data['ns']);
        }

        return $this->render(__DIR__ . '/views/details.php', array(
            'enabled' => $data['enabled'],
            'run' => array(
                'id' => $data['runId'],
                'ns' => $data['ns']
            ),
            'urls' => $urls,
            'reports' => $reports
        ));
    }

    public function getSummary()
    {
        if (Yii::app()->getComponent('xhprof', false) === null) {
            return null;
        }

        XHProf::getInstance()->setHtmlUrlPath(Yii::app()->xhprof->getReportBaseUrl());

        $urls = array();
        $data = $this->getData();
        if ($data['enabled']) {
            $urls['report'] = XHProf::getInstance()->getReportUrl($data['runId'], $data['ns']);
            $urls['callgraph'] = XHProf::getInstance()->getCallgraphUrl($data['runId'], $data['ns']);
        }
        return $this->render(__DIR__ . '/views/panel.php', array(
            'enabled' => $data['enabled'],
            'urls' => $urls
        ));
    }

    public function save()
    {
        if (Yii::app()->getComponent('xhprof', false) === null) {
            return null;
        }

        return Yii::app()->xhprof->getReportInfo();
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using IrcD.Commands.Arguments;
using IrcD.Core;
using IrcD.Core.Utils;

namespace IrcD.Commands
{
    public class Names : CommandBase
    {
        public Names(IrcDaemon ircDaemon)
            : base(ircDaemon, "NAMES", "E")
        { }

        [CheckRegistered]
        protected override void PrivateHandle(UserInfo info, List<string> args)
        {
            if (args.Count < 1)
            {
                // TODO: list all visible users
                return;
            }

            //TODO: taget parameter
            foreach (var ch in GetSubArgument(args[0]).Where(ch => IrcDaemon.Channels.ContainsKey(ch)))
            {
                IrcDaemon.Replies.SendNamesReply(info, IrcDaemon.Channels[ch]);
                IrcDaemon.Replies.SendEndOfNamesReply(info, IrcDaemon.Channels[ch]);
            }
        }

        protected override int PrivateSend(CommandArgument commandArgument)
        {
            throw new NotImplementedException();
        }
    }
}


text:
@import Foundation;

typedef NSString *NSMyAmazingStringAlias __attribute__((swift_bridged_typedef));

void acceptNSMyAmazingStringAlias(NSMyAmazingStringAlias _Nullable param);
void acceptNSMyAmazingStringAliasArray(NSArray<NSMyAmazingStringAlias> * _Nonnull param);
void acceptIndirectedAmazingAlias(NSMyAmazingStringAlias _Nonnull * _Nullable param);

#endif


text:
template '/etc/login.defs' do
  source 'login.defs.erb'
  mode '0444'
  owner 'root'
  group 'root'
  variables(
    additional_user_paths: node['os-hardening']['env']['extra_user_paths'].join(':'), # :/usr/local/games:/usr/games
    umask: node['os-hardening']['env']['umask'],
    password_max_age: node['os-hardening']['auth']['pw_max_age'],
    password_min_age: node['os-hardening']['auth']['pw_min_age'],
    login_retries: node['os-hardening']['auth']['retries'],
    login_timeout: node['os-hardening']['auth']['timeout'],
    chfn_restrict: '', # "rwh"
    allow_login_without_home: node['os-hardening']['auth']['allow_homeless'],
    uid_min: node['os-hardening']['auth']['uid_min'],
    gid_min: node['os-hardening']['auth']['gid_min'],
    sys_uid_min: node['os-hardening']['auth']['sys_uid_min'],
    sys_uid_max: node['os-hardening']['auth']['sys_uid_max'],
    sys_gid_min: node['os-hardening']['auth']['sys_gid_min'],
    sys_gid_max: node['os-hardening']['auth']['sys_gid_max']
  )
end


text:
(function() {
    'use strict';

    var mod = angular.module('ods-widgets');

    mod.directive('odsMapTooltip', ['$compile', '$templateCache', function($compile, $templateCache) {
        return {
            restrict: 'E',
            transclude: true,
            template: '' +
                '
' +
                '   <ods-spinner class="odswidget-map-tooltip__spinner" ng-hide="records.length > 0"></ods-spinner>' +
                '
(limited to the first {{RECORD_LIMIT}} records)
' +
                '
' +
                '

' +
                '

' +
                '
' +
                '    1" class="odswidget-map-tooltip__scroll-control ng-leaflet-tooltip-cloak">' +
                '       <button class="odswidget-map-tooltip__scroll-left" ng-click="moveIndex(-1)" aria-label="Previous" translate="aria-label">' +
                '           ' +
                '       </button>' +
                '

' +
                '       <button class="odswidget-map-tooltip__scroll-right" ng-click="moveIndex(1)" aria-label="Next" translate="aria-label">' +
                '          ' +
                '       </button>' +
                '   ' +
                '
',
            scope: {
                shape: '=',
                context: '=',
                recordid: '=',
                map: '=',
                template: '@',
                geoDigest: '@',
                tooltipSort: '@' // field or -field
            },
            replace: true,
            link: function(scope, element, attrs) {
                scope.ctx = scope.context;
                var destroyPopup = function(e) {
                    if (e.popup._content === element[0]) {
                        if (scope.selectedShapeLayer) {
                            // Remove the outline on the selected shape
                            scope.map.removeLayer(scope.selectedShapeLayer);
                        }
                        scope.map.off('popupclose', destroyPopup);
                        scope.$destroy();
                    }
                };
                scope.map.on('popupclose', destroyPopup);
                scope.unCloak = function() {
                    jQuery('.ng-leaflet-tooltip-cloak', element).removeClass('ng-leaflet-tooltip-cloak');
                };
                if (attrs.template && attrs.template !== '') {
                    $templateCache.put('custom-tooltip-' + scope.context.dataset.datasetid, attrs.template);
                } else {
                    $templateCache.put('default-tooltip', '
' +
                        '
' +
                        '    ' +
                        '
' +
                        '
' +
                        '
' +
                        '        {{ field.label }}' +
                        '
' +
                        '
' +
                        '        ' +
                        '            <ods-geotooltip width="300" height="300" coords="record.fields[field.name]">{{ record.fields|formatFieldValue:field:context }}</ods-geotooltip>' +
                        '        ' +
                        '        ' +
                        '            <ods-geotooltip width="300" height="300" geojson="record.fields[field.name]">{{ record.fields|formatFieldValue:field:context }}</ods-geotooltip>' +
                        '        ' +
                        '        ' +
                        '

' +
                        '

' +
                        '        ' +
                        '        ' +
                        '
' +
                        '
' +
                    '
');
                }

            },
            controller: ['$scope', '$filter', 'ODSAPI', 'ODSWidgetsConfig', function($scope, $filter, ODSAPI, ODSWidgetsConfig) {
                $scope.RECORD_LIMIT = 100;
                $scope.records = [];
                $scope.selectedIndex = 0;

                $scope.domain = {
                    current_language: ODSWidgetsConfig.language
                };

                var tooltipSort = $scope.tooltipSort;
                if (!tooltipSort && $scope.context.dataset.getExtraMeta('visualization', 'map_tooltip_sort_field')) {
                    tooltipSort = ($scope.context.dataset.getExtraMeta('visualization', 'map_tooltip_sort_direction') || '') + $scope.context.dataset.getExtraMeta('visualization', 'map_tooltip_sort_field');
                }

                $scope.moveIndex = function(amount) {
                    var newIndex = ($scope.selectedIndex + amount) % $scope.records.length;
                    if (newIndex < 0) {
                        newIndex = $scope.records.length + newIndex;
                    }
                    $scope.selectedIndex = newIndex;
                };

                var refresh = function() {
                    var options = {
                        format: 'json',
                        rows: $scope.RECORD_LIMIT
                    };
                    var shapeType = null;
                    if ($scope.shape) {
                        shapeType = $scope.shape.type;
                    }
                    if ($scope.recordid && shapeType !== 'Point') {
                        // When we click on a point, we rather want to match the location so that it fetches the other points
                        // stacked on the same place
                        options.q = "recordid:'"+$scope.recordid+"'";
                    } else if ($scope.geoDigest) {
                        options.geo_digest = $scope.geoDigest;
                    } else if ($scope.shape) {
                        ODS.GeoFilter.addGeoFilterFromSpatialObject(options, $scope.shape);
                    }

                    var queryOptions = {};
                    angular.extend(queryOptions, $scope.context.parameters, options);

                    if (tooltipSort) {
                        queryOptions.sort = tooltipSort;
                        ODSAPI.records.search($scope.context, queryOptions).then(function(response) {
                            var data = response.data;
                            handleResults(data.records);
                        });
                    } else {
                        ODSAPI.records.download($scope.context, queryOptions).then(function(response) {
                            var data = response.data;
                            handleResults(data);
                        });
                    }

                    function handleResults(data) {
                        if (data.length > 0) {
                            $scope.selectedIndex = 0;
                            $scope.records = data;
                            $scope.unCloak();
                        } else {
                            $scope.map.closePopup();
                        }
                    }
                };

                $scope.$watch('context.parameters', function() {
                    refresh();
                }, true);
                $scope.$apply();

                /* *** HELPER METHODS FOR THE TEMPLATES *** */
                $scope.getTitle = function(record) {
                    if ($scope.context.dataset.extra_metas && $scope.context.dataset.extra_metas.visualization && $scope.context.dataset.extra_metas.visualization.map_tooltip_title) {
                        var titleField = $scope.context.dataset.extra_metas.visualization.map_tooltip_title;
                        if (angular.isDefined(record.fields[titleField]) && record.fields[titleField] !== '') {
                            return record.fields[titleField];
                        }
                    }
                    return null;
                };
                $scope.fields = angular.copy($scope.context.dataset.fields);
            }]
        };
    }]);
}());


text:
/****************************************************************
 * $Id: StBTofRawHitCollection.h,v 1.1 2009/02/02 21:57:21 dongx Exp $
 *****************************************************************
 * Author: Xin Dong
 * Description: Local TOF raw hit collection
 *****************************************************************
 * $Log: StBTofRawHitCollection.h,v $
 * Revision 1.1  2009/02/02 21:57:21  dongx
 * first release
 *
 *
 ****************************************************************/
#ifndef ST_BTOF_RAWHIT_COLLECTION_H
#define ST_BTOF_RAWHIT_COLLECTION_H

#include <vector>
#ifndef ST_NO_NAMESPACES
using std::vector;
using std::copy;
#endif

//#include "StBTofRawHit.h"
class StBTofRawHit;

#ifndef ST_NO_DEF_TEMPLATE_ARGS
typedef vector<StBTofRawHit*> rawHitVector;
#else
typedef vector<StBTofRawHit*, allocator<StBTofRawHit*> > rawHitVector;
#endif

/**
   \class StBTofRawHitCollection
   Class used as a collection for BTofRawHit in StBTofCollection.
 */
class StBTofRawHitCollection {
public:
    /// Default constructor
    StBTofRawHitCollection();
    virtual ~StBTofRawHitCollection();

    /// Add a StBTofRawHit into the vector
    bool        push_back(StBTofRawHit* hit);
    /// Returns the size of the collection vector
    size_t      size()  const;
    /// Returns the first element of the vector
    StBTofRawHit*  front() const;
    /// Returns the last element of the vector
    StBTofRawHit*  back()  const;
    /// Returns a BTofRawHit at index in the vector
    StBTofRawHit*  getRawHit(size_t index) const;
    void clear();

private:
    /// StBTofRawHit vector
    rawHitVector         mHitVector;
};
#endif


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EggFarmSystem.Client.Commands;
using EggFarmSystem.Client.Core;
using EggFarmSystem.Client.Modules.Reports.Views;

namespace EggFarmSystem.Client.Modules.Reports.Commands
{
    public class ShowReportListCommand : CommandBase
    {
        private readonly IMessageBroker broker;

        public ShowReportListCommand(IMessageBroker broker)
        {
            this.broker = broker;
        }

        public override void Execute(object parameter)
        {
            broker.Publish(CommonMessages.ChangeMainView, typeof(IReportListView));
        }
    }
}