text:
/**
 * @name Fusion Tips
 * @author: Nianwei Liu [nianwei at gmail dot com]
 * @fileoverview This library allows MapTip and fires mouseover/mouseout event for FusionTableLayers.
 * It uses mouse cursor tracking and pause delay to trigger FusionTableQuery.
 * It is not true mouseover event, but should suit most use cases.
 *
 */
(function() {
  /*jslint browser:true */
  /*global google */
  function FusionTipOverlay(opts) {
    opts = opts || {};
    this.latlng_ = null;
    this.text_ = null;
    this.div_ = null;
    this.cursorNode = null;
    this.style_ = opts.style || {};
  }
  FusionTipOverlay.prototype = new google.maps.OverlayView();
  FusionTipOverlay.prototype.onAdd = function() {
    var div = document.createElement('DIV');
    div.style.border = "1px solid #999999";
	div.style.opacity = ".85";
    div.style.position = "absolute";
    div.style.whiteSpace = "nowrap";
    div.style.backgroundColor = "#ffffff";
    div.style.fontSize = '13px';
    div.style.padding = '10px';
    div.style.fontWeight = 'bold';
    div.style.margin = '10px';
    div.style.lineHeight = '1.3em';
    div.style.visibility = "hidden";
    if (this.style_) {
      for (var x in this.style_) {
        if (this.style_.hasOwnProperty(x)) {
          div.style[x] = this.style_[x]
        }
      }
    }
    this.div_ = div;
    var panes = this.getPanes();
    this.cursorNode = panes.overlayLayer.parentNode;
    panes.floatPane.appendChild(div);
    google.maps.event.trigger(this, 'ready');
  };
  FusionTipOverlay.prototype.draw = function() {
    var overlayProjection = this.getProjection();
    if (this.latlng_) {
      var sw = overlayProjection.fromLatLngToDivPixel(this.latlng_);
      var div = this.div_;
      div.style.left = sw.x + 'px';
      div.style.top = (sw.y - 20) + 'px';
      div.innerHTML = this.text_;
    }

  };
  FusionTipOverlay.prototype.onRemove = function() {
    this.div_.parentNode.removeChild(this.div_);
    this.div_ = null;
  };
  FusionTipOverlay.prototype.hide = function() {
    if (this.div_) {
      this.div_.style.visibility = "hidden";
    }
  };
  FusionTipOverlay.prototype.show = function(latlng, text) {
    if (this.div_) {
      this.div_.style.visibility = "visible";
    }
    if (latlng || text) {
      this.latlng_ = latlng || this.latlng_;
      this.text_ = text;
      this.draw();
    }
  };

  //http://www.quirksmode.org/js/findpos.html
  function findElPos(obj) {
    var curleft = 0;
    var curtop = 0;
    if (obj.offsetParent) {
      do {
        curleft += obj.offsetLeft;
        curtop += obj.offsetTop;
        obj = obj.offsetParent;
      } while (obj != null);
    }
    return {
      x: curleft,
      y: curtop
    };
  }
  function findMousePos(e) {
    var posx = 0;
    var posy = 0;
    if (!e)
      var e = window.event;
    if (e.pageX || e.pageY) {
      posx = e.pageX;
      posy = e.pageY;
    } else if (e.clientX || e.clientY) {
      posx = e.clientX + document.body.scrollLeft +
      document.documentElement.scrollLeft;
      posy = e.clientY + document.body.scrollTop +
      document.documentElement.scrollTop;
    }
    // posx and posy contain the mouse position relative to the document
    // Do something with this information
    return {
      x: posx,
      y: posy
    };
  }
  //http://www.quirksmode.org/dom/getstyles.html
  function getStyle(el, styleProp) {
    if (el.style[styleProp]) {
      return el.style[styleProp];
    } else if (el.getComputedStyle) {
      return el.getComputedStyle()[styleProp];
    } else if (el.currentStyle) {
      return el.currentStyle[styleProp];
    } else if (window.getComputedStyle) {
      return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
    }
    return null;
  }

  function isSameRow(row1, row2) {
    if (row2 == null)
      return false;
    for (var x in row1) {
      if (row1.hasOwnProperty(x)) {
        if (!row2[x] || row2[x].value != row1[x].value)
          return false;
      }
    }
    return true;
  }
  var scriptid = 0;
  /**
   * @name MapTipOptions
   * @class This class represents the optional parameter passed into google.maps.FusionTablesLayer.enableMapTips.
   * @property {String} [select] required. list of columns (by comma) to query, typically need only one column. e.g "'Store Name','Address'"
   * @property {String} [from] required. fusion table id.
   * @property {String} [geometryColumn] required. fusion table's geometry column name.
   * @property {bool} [suppressMapTips] optional, whether to show map tips. default false
   * @property {number} [delay] optional. milliseconds mouse pause before send a server query. default 500.
   * @property {number} [tolerance] required. tolerance in pixel around mouse. default is 6.
   * @property {Object} [style] optional. the css style of map tip.
   * @property {String} [where] optional. "where" filter for select.
   */
  /**
   * @name google.maps.FusionTablesLayer
   * @class These are new methods added to the Google Maps API's
   * FusionTablesLayer
   * class.
   */
  /**
   * Enable map tips for the fusion layer. The user can hover over a fusion feature, pause for a small time, then get a map tip.
   * @param {MapTipOptions} opts
   */
  google.maps.FusionTablesLayer.prototype.enableMapTips = function(opts) {
    opts = opts || {};

    var maptip = new FusionTipOverlay(null, null);
    var me = this;
    var currentLatLng = null;
    var currentCursor = null;
    var currentRow = null;
    var delayTimeout = null;
    var queryPending = false;
    var containerPos = findElPos(me.getMap().getDiv());
    var tol = opts.tolerance || 6;
    google.maps.event.addListenerOnce(maptip, 'ready', function() {
      // map.mousemove may not fire consistently, so we calc latlng from DOM events
      me.mousemoveListener_ = google.maps.event.addDomListener(me.getMap().getDiv(), 'mousemove', function(evt) {
        if (delayTimeout) {
          window.clearTimeout(delayTimeout);
          delayTimeout = null;
        }
        var c = getStyle(maptip.cursorNode, 'cursor');
        if (c != currentCursor && currentCursor == 'pointer') {
          google.maps.event.trigger(me, 'mouseout', {
            row: currentRow
          });
          //console.debug('set currentrow null, currentCusor:' + currentCursor + 'new ' + c);
          currentRow = null;
          maptip.hide();
        } else if (c == 'pointer' && !queryPending && !delayTimeout) {
          // for polygons, features may change while cursor not.
          var mousePos = findMousePos(evt);
          var containerPx = new google.maps.Point(mousePos.x - containerPos.x, mousePos.y - containerPos.y);
          currentLatLng = maptip.getProjection().fromContainerPixelToLatLng(containerPx);
          delayTimeout = window.setTimeout(queryFusion, opts.delay || 400);
        }
        currentCursor = c;
      });
    });
    maptip.setMap(this.getMap());
    this.maptipOverlay_ = maptip;

    function queryFusion() {
      if (queryPending)
        return;
      var latlng = currentLatLng;
      var prj = maptip.getProjection();
      var px = prj.fromLatLngToDivPixel(latlng);
      px.x -= tol;
      px.y += tol;
      var sw = prj.fromDivPixelToLatLng(px);
      px.x += tol * 2;
      px.y -= tol * 2;
      var ne = prj.fromDivPixelToLatLng(px);
      var bounds = new google.maps.LatLngBounds(sw, ne);
      var swhere = "ST_INTERSECTS(" + opts.geometryColumn + ",RECTANGLE(LATLNG(" + bounds.getSouthWest().lat() + "," + bounds.getSouthWest().lng() + "),LATLNG(" + bounds.getNorthEast().lat() + "," + bounds.getNorthEast().lng() + ")))";
      if (opts.where) {
        swhere += " AND " + opts.where;
      }
      var queryText = encodeURIComponent("SELECT " + opts.select + " FROM " + opts.from + " WHERE " + swhere);
      queryPending = true;
      queryFusionJson(latlng, queryText);
    }

    // IE does not like delete window[sid], so create a name space here.
    window.fusiontips = window.fusiontips||{};

    //copied from http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/mouseover.html
    // undocumented unsupported method;
    function queryFusionJson(latlng, queryText) {
      var script = document.createElement('script');
      // Note that a simplified geometry and the NAME column are being requested
      var sid = 'query_' + scriptid++;
      script.setAttribute('src', 'https://www.googleapis.com/fusiontables/v1/query?sql=' + queryText + '&callback=fusiontips.' + sid + '&key=' + opts.googleApiKey + "&typed=false");
      //script.setAttribute('src', 'http://fusiontables.googleusercontent.com/fusiontables/api/query?sql=' + queryText + '&jsonCallback=fusiontips.' + sid);
      window.fusiontips[sid] = function(json) {
        delete window.fusiontips[sid];
        queryPending = false;
        processFusionJson(json, latlng);
      };
      document.getElementsByTagName('head')[0].appendChild(script);
    }

    function processFusionJson(json, latlng) {
      //console.log(json);
      //{table:{cols:[col1,col2], rows:[[val11,val12],[val21,val22]]}};
      var data = json;
      html = "";
      var row = null;
      if (data) {
        var numRows = data.rows.length;
        var numCols = data.columns.length;
        if (numRows > 0) {
          row = {};

          for (i = 0; i < numCols; i++) {
            html += data.rows[0][i] + "
";
            var cell = {
              columnName: data.columns[i],
              value: data.rows[0][i]
            };
            row[data.columns[i]] = cell;
          }
          if (opts && opts.htmlTemplate) {
          	html = opts.htmlTemplate(data.rows);
          }
        }

      } else {
        if (console)
          console.log('no data');
      }
      fireEvents(html, latlng, row);

    }
    function fireEvents(html, latlng, row) {
      if (!opts.suppressMapTips && maptip && latlng && html) {
        maptip.show(latlng, html);
      }
      if (row && !isSameRow(row, currentRow)) {
        // this would apply to polys where there is no mouse cursor change between adj polys
        if (currentRow) {
          /**
           * This event is fired when the mouse out of a fusion feature.
           * @name google.maps.FusionTablesLayer#mouseout
           * @event
           */
          google.maps.event.trigger(me, 'mouseout', {
            row: currentRow
          });
        }
        /**
         * This event is fired when the mouse over a fusion feature. Contains: infoWindowHtml, latLng, row.
         * @name google.maps.FusionTablesLayer#mouseover
         * @param {FusionTablesMouseEvent} mouseevent
         * @event
         */
        google.maps.event.trigger(me, 'mouseover', {
          infoWindowHtml: html,
          latLng: latlng,
          row: row
        });
      }
      currentRow = row;
    }

  };
  /**
   * Disable map tips for the fusion layer.
   */
  google.maps.FusionTablesLayer.prototype.disableMapTips = function() {
    this.maptipOverlay_.setMap(null);
    this.maptipOverlay_ = null;
    google.maps.event.removeListener(this.mousemoveListener_);
    this.mousemoveListener_ = null;
  };
  // cleanup
  var _setMap_ = google.maps.FusionTablesLayer.prototype.setMap;
  /**
   * @private
   * @param {Object} map
   */
  google.maps.FusionTablesLayer.prototype.setMap = function(map) {
    if (map == null) {
      this.disableMapTips();
    }
    _setMap_.call(this,map);
  };

})();


text:
package net.authorize.sample.PaymentTransactions;

import java.math.BigDecimal;
import java.math.RoundingMode;

import net.authorize.Environment;
import net.authorize.api.contract.v1.*;
import net.authorize.api.controller.base.ApiOperationBase;
import net.authorize.api.controller.GetHostedPaymentPageController;
import net.authorize.api.controller.base.ApiOperationBase;

public class GetAnAcceptPaymentPage {

	public static ANetApiResponse run(String apiLoginId, String transactionKey, Double amount) {

        ApiOperationBase.setEnvironment(Environment.SANDBOX);

        MerchantAuthenticationType merchantAuthenticationType  = new MerchantAuthenticationType() ;
        merchantAuthenticationType.setName(apiLoginId);
        merchantAuthenticationType.setTransactionKey(transactionKey);
        ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);

        // Create the payment transaction request
        TransactionRequestType txnRequest = new TransactionRequestType();
        txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());
        txnRequest.setAmount(new BigDecimal(amount).setScale(2, RoundingMode.CEILING));

        SettingType setting1 = new SettingType();
        setting1.setSettingName("hostedPaymentButtonOptions");
        setting1.setSettingValue("{\"text\": \"Pay\"}");

        SettingType setting2 = new SettingType();
        setting2.setSettingName("hostedPaymentOrderOptions");
        setting2.setSettingValue("{\"show\": false}");

        ArrayOfSetting alist = new ArrayOfSetting();
        alist.getSetting().add(setting1);
        alist.getSetting().add(setting2);

        GetHostedPaymentPageRequest apiRequest = new GetHostedPaymentPageRequest();
        apiRequest.setTransactionRequest(txnRequest);
        apiRequest.setHostedPaymentSettings(alist);

        GetHostedPaymentPageController controller = new GetHostedPaymentPageController(apiRequest);
        controller.execute();

        GetHostedPaymentPageResponse response = new GetHostedPaymentPageResponse();
		response = controller.getApiResponse();

		if (response!=null) {

             if (response.getMessages().getResultCode() == MessageTypeEnum.OK) {

 				System.out.println(response.getMessages().getMessage().get(0).getCode());
                System.out.println(response.getMessages().getMessage().get(0).getText());

                System.out.println(response.getToken());
            }
            else
            {
                System.out.println("Failed to get hosted payment page:  " + response.getMessages().getResultCode());
            }
        }
		return response;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using CoreMessageBus.ServiceBus.Internal;

namespace CoreMessageBus.ServiceBus
{
    public class ServiceBus : IServiceBus
    {
        private readonly IServiceBusQueue _serviceBusQueue;
        private readonly IQueueItemFactory _queueItemFactory;

        public ServiceBus(IServiceBusQueue serviceBusQueue, IQueueItemFactory queueItemFactory)
        {
            if (serviceBusQueue == null) throw new ArgumentNullException(nameof(serviceBusQueue));
            if (queueItemFactory == null) throw new ArgumentNullException(nameof(queueItemFactory));
            _serviceBusQueue = serviceBusQueue;
            _queueItemFactory = queueItemFactory;
        }

        public void Send<TMessage>(TMessage message)
        {
            if (message == null) throw new ArgumentNullException(nameof(message));
            var item = _queueItemFactory.Create(message);
            _serviceBusQueue.Queue(item);
        }

        public void Defer<TMessage>(TMessage message, TimeSpan timespan)
        {
            if (message == null) throw new ArgumentNullException(nameof(message));
            throw new NotImplementedException();
        }

        public void Defer<TMessage>(TMessage message, DateTime until)
        {
            if (message == null) throw new ArgumentNullException(nameof(message));
            throw new NotImplementedException();
        }
    }
}


text:
A simple proxy that takes the target of a graphite link and returns the data in a format that Geckoboard can understand.

## Install

First you need to grab the bits.

        git clone https://github.com/involver/gekkonidae.git

Then install the gems via bundler.

        cd gekkonidae
        bundle install

Setup the configuration file.  You will want to specify the host for you graphite server, and set an API key.  The API key should be some random string, 20+ characters long.

        cp config/gekkonidae.yml.example config/gekkonidae.yml
        vi config/gekkonidae.yml

Then start thin.

        thin start -p 3000

## Usage

Gekkonidae creates a proxy that takes requests from Geckoboard, pulls the data from graphite, and then returns the data in a format that Geckoboard understands.

To create a URL for Geckoboard you need to take the "target=" value from a graphite graph (usually retrieved by looking at the URL of the graph).  Then create an URL for Geckoboard of the form below.

        http://gekkonidae.example.com:3000/number?target=default.broker_example_local.boottime&api_key=EXAMPLEKEY123

Currently implemented targets are number, linechart, and textstate.

## Development

Pull requests are welcome.

## Links

[[ Geckoboard API Documentation | http://docs.geckoboard.com/api/ ]]

## Notes

This project is not complete and does not implement all of Geckoboard's widgets.

## License

Please see the included license file.


text:
// Copyright (c) 2014-2015 Eberhard Beilharz
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BuildDependency.Artifacts;
using BuildDependency.Manager.Tools;
using BuildDependency.TeamCity;
using BuildDependency.TeamCity.RestClasses;
using Eto.Drawing;
using Eto.Forms;

namespace BuildDependency.Manager.Dialogs
{
	public class ImportDialog: Dialog<bool>
	{
		private ImportDialogModel _model;
		private readonly ComboBox _serversCombo;
		private readonly ComboBox _projectCombo;
		private readonly ComboBox _configCombo;
		private readonly GridView _gridView;
		private readonly CheckBox _win32;
		private readonly CheckBox _win64;
		private readonly CheckBox _linux32;
		private readonly CheckBox _linux64;
		private readonly SelectableFilterCollection<ArtifactTemplate> _dataStore;
		private readonly Spinner _spinner;

		public ImportDialog(List<Server> servers)
		{
			_serversCombo = new ComboBox();
			_projectCombo = new ComboBox();
			_configCombo = new ComboBox();
			_win32 = new CheckBox {
				Text = "Win 32-bit",
				Checked = true
			};
			_win64 = new CheckBox
			{
				Text = "Win 64-bit",
				Checked = true
			};
			_linux32 = new CheckBox {
				Text = "Linux 32-bit",
				Checked = true
			};
			_linux64 = new CheckBox {
				Text = "Linux 64-bit",
				Checked = true
			};
			_spinner = new Spinner {
				Size = new Size(30, 30),
				Visible = false
			};
			_gridView = new GridView();
			_dataStore = new SelectableFilterCollection<ArtifactTemplate>(_gridView);
			Init(servers);
		}

		private async void Init(List<Server> servers)
		{
			_model = new ImportDialogModel();
			_serversCombo.SelectedIndexChanged += OnServerChanged;
			_serversCombo.DataStore = servers;
			_projectCombo.SelectedIndexChanged += OnProjectChanged;
			_projectCombo.DataStore = await _model.GetProjects();
			_configCombo.SelectedIndexChanged += OnConfigChanged;
			var importButton = new Button {
				Text = "Import"
			};
			importButton.Click += (sender, e) =>
			{
				Result = true;
				Close();
			};
			var cancelButton = new Button {
				Text = "Cancel"
			};
			cancelButton.Click += (sender, e) => Close();
			_gridView.DataStore = _dataStore;
			_gridView.Columns.Add(new GridColumn {
				HeaderText = "Artifacts source",
				DataCell = new TextBoxCell("Source"),
				Sortable = true,
				Resizable = true,
				AutoSize = true,
			});
			_gridView.Columns.Add(new GridColumn {
				HeaderText = "Artifacts path",
				DataCell = new TextBoxCell("PathRules"),
				Sortable = true,
				Resizable = true,
				AutoSize = true,
				Editable = true
			});
			_gridView.GridLines = GridLines.Both;
			_gridView.ShowHeader = true;
			_gridView.Height = 300;
			Title = "Import dependencies from TeamCity";
			Width = 600;
			Height = 600;
			Resizable = true;
			var content = new TableLayout {
				ClientSize = new Size(600, 600),
				Padding = new Padding(10, 10, 10, 5),
				Spacing = new Size(5, 5),
				Rows =  {
					new TableRow(new StackLayout {
						Spacing = 5,
						Orientation = Orientation.Horizontal,
						Items =  {
							new Label {
								Text = "Server:"
							},
							_serversCombo
						}
					}),
					new TableRow(new Label {
						Text = "Condition to apply to all dependencies:"
					}),
					new TableRow(new StackLayout {
						Spacing = 5,
						Orientation = Orientation.Horizontal,
						Items =  {
							_win32,
							_win64,
							_linux32,
							_linux64
						}
					}),
					new TableRow(new Label {
						Text = "Project"
					}),
					new TableRow(_projectCombo),
					new TableRow(new Label {
						Text = "Build Configurations"
					}),
					new TableRow(_configCombo),
					new TableRow(new Label {
						Text = "Dependencies"
					}),
					new TableRow(_gridView) {
						ScaleHeight = true
					},
					new TableRow(new Label {
						Text = "Click Import to import the dependencies of the selected configuration."
					}),
					new TableRow(new StackLayout {
						Orientation = Orientation.Horizontal,
						Spacing = 5,
						Items = {
							_spinner,
							null,
							importButton,
							cancelButton
						}
					})
				}
			};
			Content = content;
			DefaultButton = importButton;
			AbortButton = cancelButton;
			_serversCombo.SelectedIndex = 0;
			_projectCombo.SelectedIndex = 0;
		}

		private async void OnServerChanged(object sender, EventArgs e)
		{
			using (new WaitSpinner(_spinner))
			{
				_model.TeamCity = _serversCombo.SelectedValue as TeamCityApi;
				var projects = await _model.GetProjects();
				if (projects == null)
					return;

				_projectCombo.DataStore = projects;
				_projectCombo.SelectedIndex = 0;
			}
		}

		private async void OnProjectChanged(object sender, EventArgs e)
		{
			using (new WaitSpinner(_spinner))
			{
				var project = _projectCombo.SelectedValue as Project;
				if (project == null)
					return;

				_configCombo.DataStore = await _model.GetConfigurationsForProjectTask(project.Id);
				_configCombo.SelectedIndex = 0;
			}
		}

		private async void OnConfigChanged(object sender, EventArgs e)
		{
			using (new WaitSpinner(_spinner))
			{
				var config = _configCombo.SelectedValue as BuildType;
				if (config == null)
					return;

				SelectedBuildConfig = config.Id;

				await Task.Run(async () =>
					{
						_dataStore.Clear();
						var artifactsTask = _model.LoadArtifacts(config.Id);
						var depTask = _model.TeamCity.GetArtifactDependenciesAsync(config.Id);
						await artifactsTask;
						var dependencies = await depTask;
						if (dependencies == null)
							return;

						foreach (var dep in dependencies)
						{
							if (dep == null || dep.Properties == null || dep.BuildType == null)
								continue;
							var artifact = new ArtifactTemplate(_model.TeamCity, new ArtifactProperties(dep.Properties), dep.BuildType);
							_dataStore.Add(artifact);
						}
					});
			}
		}

		public string SelectedBuildConfig { get; private set; }

		public Conditions Condition
		{
			get
			{
				return AddOrEditArtifactDependencyDialog.GetConditionFromCheckBox(_win32, _win64, _linux32, _linux64);
			}
		}

		public Server Server
		{
			get
			{
				return _serversCombo.SelectedValue as Server;
			}
		}
	}
}


text:
/* Object.prototype.isPrototypeOf() */
(function () {
    // consider the following prototype chain
    function Fee() {
        // ...
    }

    function Fi() {
        // ...
    }
    Fi.prototype = new Fee();

    function Fo() {
        // ...
    }
    Fo.prototype = new Fi();

    function Fum() {
        // ...
    }
    Fum.prototype = new Fo();

    var fum = new Fum();

    if (Fi.prototype.isPrototypeOf(fum)) {
        console.log('do something safe');
    }
}());


text:
namespace sharp.Serene.BasicSamples {

    /**
     * This is our category editor that will show only categories of Produce and
     * Seafood. We are subclassing LookupEditorBase which also LookupEditor
     * derives from.
     *
     * After compiling and transforming templates, this editor type will be
     * available in server side to use in our LookupFilterByMultipleForm,
     * which is a version of ProductForm that uses our custom editor.
     */
    @Serenity.Decorators.registerEditor()
    export class ProduceSeafoodCategoryEditor extends
        Serenity.LookupEditorBase<Serenity.LookupEditorOptions, Northwind.CategoryRow> {

        constructor(container: JQuery, opt: Serenity.LookupEditorOptions) {
            super(container, opt);
        }

        /**
         * Normally LookupEditor requires a lookup key to determine which set of
         * lookup data to show in editor. As our editor will only show category
         * data, we lock it to category lookup key.
         */
        protected getLookupKey() {
            return Northwind.CategoryRow.lookupKey;
        }

        /**
         * Here we are filtering by category name but you could filter by any field.
         * Just make sure the fields you filter on has [LookupInclude] attribute on them,
         * otherwise their value will be null in client side as they are not sent back
         * from server in lookup script.
         */
        protected getItems(lookup: Q.Lookup<Northwind.CategoryRow>) {
            return super.getItems(lookup).filter(x =>
                x.CategoryName === 'Produce' || x.CategoryName === 'Seafood');
        }
    }
}


text:
package org.usfirst.frc.team2084.CMonster2015;

import org.usfirst.frc.team2084.CMonster2015.commands.ClearFaultsCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.CloseToteGateCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.DriveHeadingCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.DriveToLocationCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.ExtendToteEjectorCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.FallbackDriveCommandGroup;
import org.usfirst.frc.team2084.CMonster2015.commands.LowPowerRaiseToteLifterCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.LowerContainerHookCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.LowerToteLifterCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.NormalDriveCommandGroup;
import org.usfirst.frc.team2084.CMonster2015.commands.OpenToteGateCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.RaiseContainerHookCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.RaiseToteLifterCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.ResetGyroCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.ResetHeadingSetpointCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.RetractToteEjectorCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.RotateToCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.SetEncodersEnabledCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.SetGyroEnabledCommand;
import org.usfirst.frc.team2084.CMonster2015.commands.SetHeadingCommand;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

/**
 * This class is the glue that binds the controls on the physical operator
 * interface to the commands and command groups that allow control of the robot.
 */
public class OI {

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    public JoystickButton normalDriveButton;
    public JoystickButton fallbackDriveButton;
    public JoystickButton resetGyroButton;
    public JoystickButton extendToteEjectorButton;
    public JoystickButton retractToteEjectorButton;
    public Joystick driveJoystick;
    public JoystickButton raiseToteLifterButton;
    public JoystickButton lowerToteLifterButton;
    public JoystickButton raiseContainerHookButton;
    public JoystickButton lowerContainerHookButton;
    public JoystickButton closeToteGateButton;
    public JoystickButton openToteGateButton;
    public Joystick secondaryJoystick;

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

    public OI() {
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS

        secondaryJoystick = new Joystick(1);

        openToteGateButton = new JoystickButton(secondaryJoystick, 2);
        openToteGateButton.whenPressed(new OpenToteGateCommand());
        closeToteGateButton = new JoystickButton(secondaryJoystick, 4);
        closeToteGateButton.whenPressed(new CloseToteGateCommand());
        lowerContainerHookButton = new JoystickButton(secondaryJoystick, 8);
        lowerContainerHookButton.whileHeld(new LowerContainerHookCommand());
        raiseContainerHookButton = new JoystickButton(secondaryJoystick, 6);
        raiseContainerHookButton.whileHeld(new RaiseContainerHookCommand());
        lowerToteLifterButton = new JoystickButton(secondaryJoystick, 7);
        lowerToteLifterButton.whenPressed(new LowerToteLifterCommand());
        raiseToteLifterButton = new JoystickButton(secondaryJoystick, 5);
        raiseToteLifterButton.whenPressed(new RaiseToteLifterCommand());
        driveJoystick = new Joystick(0);

        retractToteEjectorButton = new JoystickButton(driveJoystick, 5);
        retractToteEjectorButton.whileHeld(new RetractToteEjectorCommand());
        extendToteEjectorButton = new JoystickButton(driveJoystick, 6);
        extendToteEjectorButton.whileHeld(new ExtendToteEjectorCommand());
        resetGyroButton = new JoystickButton(driveJoystick, 12);
        resetGyroButton.whenPressed(new ResetGyroCommand());
        fallbackDriveButton = new JoystickButton(driveJoystick, 10);
        fallbackDriveButton.whenPressed(new FallbackDriveCommandGroup());
        normalDriveButton = new JoystickButton(driveJoystick, 9);
        normalDriveButton.whenPressed(new NormalDriveCommandGroup());

        // SmartDashboard Buttons
        SmartDashboard.putData("Rotate To Command", new RotateToCommand());

        SmartDashboard.putData("Drive Heading Command", new DriveHeadingCommand());

        SmartDashboard.putData("Drive To Location Command", new DriveToLocationCommand());

        SmartDashboard.putData("Low Power Raise Tote Lifter Command",
                new LowPowerRaiseToteLifterCommand());

        SmartDashboard.putData("Clear Faults Command", new ClearFaultsCommand());

        SmartDashboard.putData("Set Gyro Enabled Command", new SetGyroEnabledCommand());

        SmartDashboard.putData("Set Encoders Enabled Command", new SetEncodersEnabledCommand());

        SmartDashboard.putData("Reset Gyro Command", new ResetGyroCommand());

        SmartDashboard.putData("Set Heading Command", new SetHeadingCommand());

        SmartDashboard.putData("Reset Heading Setpoint Command", new ResetHeadingSetpointCommand());

        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
    }

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=FUNCTIONS
    public Joystick getDriveJoystick() {
        return driveJoystick;
    }

    public Joystick getSecondaryJoystick() {
        return secondaryJoystick;
    }

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=FUNCTIONS
}


text:
using AFrame.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AFrame.Desktop.Controls.Win
{
    public class WinClient : WinControl
    {
        #region Properties

        #endregion

        public WinClient()
        {
            this.SearchProperties.Add(WinControl.PropertyNames.ControlType, "Client");
        }

        public WinClient(DesktopContext context)
            : base(context)
        {
            this.SearchProperties.Add(WinControl.PropertyNames.ControlType, "Client");
        }

        public new class PropertyNames : WinControl.PropertyNames
        {
        }
    }
}


text:
import {Sequence, Parallel} from './primitives'

function getFunctionName (fn) {
  let ret = fn.toString()
  ret = ret.substr('function '.length)
  ret = ret.substr(0, ret.indexOf('('))

  return ret
}

function isPaths (item) {
  return (
    item &&
    !Array.isArray(item) &&
    typeof item === 'object' &&
    !(item instanceof Sequence) &&
    !(item instanceof Parallel)
  )
}

function analyze (functions, item, isParallel) {
  if (item instanceof Parallel || item instanceof Sequence) {
    const instance = item.toJSON()

    return Object.assign(instance, {
      items: analyze(functions, instance.items, item instanceof Parallel).items
    })
  } else if (Array.isArray(item)) {
    return new Sequence(item.reduce((allItems, subItem, index) => {
      if (subItem instanceof Parallel || subItem instanceof Sequence) {
        const instance = subItem.toJSON()

        return allItems.concat(Object.assign(instance, {
          items: analyze(functions, instance.items, subItem instanceof Parallel).items
        }))
      } else if (typeof subItem === 'function') {
        const funcDetails = {
          name: subItem.displayName || getFunctionName(subItem),
          functionIndex: functions.push(subItem) - 1,
          function: subItem
        }
        const nextItem = item[index + 1]

        if (isPaths(nextItem)) {
          funcDetails.outputs = {}
          Object.keys(nextItem).forEach((key) => {
            if (subItem.outputs && !~subItem.outputs.indexOf(key)) {
              throw new Error(`function-tree - Outputs object doesn't match list of possible outputs defined for function.`)
            }
            funcDetails.outputs[key] = analyze(functions, typeof nextItem[key] === 'function' ? [nextItem[key]] : nextItem[key])
          })
        }

        return allItems.concat(funcDetails)
      } else if (isPaths(subItem)) {
        return allItems
      } else if (Array.isArray(subItem)) {
        const items = analyze(functions, subItem)

        return allItems.concat(items)
      } else {
        throw new Error('function-tree - Unexpected entry in tree')
      }
    }, [])).toJSON()
  } else {
    throw new Error('function-tree - Unexpected entry in tree')
  }
}

export default (tree) => {
  const functions = []

  return analyze(functions, typeof tree === 'function' ? [tree] : tree)
}


text:
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
require 'cucumber/formatter/unicode'

$:.unshift(File.dirname(__FILE__) + '/../support')
require 'calculate'

Before do
  @calc = Calculator.new
end

After do
end

Given /I have entered (.*) into the calculator/ do |n|
	@calc.push n.to_i
end

When /I push (\w+)/ do |op|
	@result = @calc.send op
end

Then /the result should be (.*) on the screen/ do |result|
	expect(@result).to be result.to_i
end


text:
#ifndef LUAGLUE_STACKTEMPLATES_LUAVALUE_H_GUARD
#define LUAGLUE_STACKTEMPLATES_LUAVALUE_H_GUARD

#include "LuaGlue/LuaGlueLuaValue.h"
	inline LuaGlueLuaValue stack<LuaGlueLuaValue>::get(LuaGlueBase *b, lua_State *s, int idx)
	{
		LuaGlueLuaValue object;
		object.load(b, s, idx);
		return object;
	}

	inline void stack<LuaGlueLuaValue>::put(LuaGlueBase *b, lua_State *s, LuaGlueLuaValue& v)
	{
		v.put(b, s);
	}

	inline const LuaGlueLuaValue stack<const LuaGlueLuaValue &>::get(LuaGlueBase *b, lua_State *s, int idx)
	{
		LuaGlueLuaValue object;
		object.load(b, s, idx);
		return object;
	}

	inline void stack<const LuaGlueLuaValue &>::put(LuaGlueBase *b, lua_State *s, LuaGlueLuaValue& v)
	{
		v.put(b, s);
	}

#endif /* LUAGLUE_STACKTEMPLATES_LUAVALUE_H_GUARD */


text:
'use strict';

var payments = require('../controllers/payments');

// Article authorization helpers

var hasAuthorization = function(req, res, next) {
  if (!req.user.isAdmin && req.member.user.id !== req.user.id) {
    return res.send(401, 'User is not authorized');
  }
  next();
};

module.exports = function(Payments, app, auth) {

  app.route('/payments')
    .get(auth.requiresLogin, payments.all, hasAuthorization)
    .post(auth.requiresLogin, payments.create);

  app.route('/payments/:payId')
    .get(auth.requiresLogin, payments.getPayment, hasAuthorization);

  app.route('/paymentdb')
    .get(auth.requiresLogin, payments.grabAll, hasAuthorization)
    .post(auth.requiresLogin, payments.save, hasAuthorization);

  app.route('/paymentdb/:payId')
    .delete(auth.requiresLogin, payments.destroy, hasAuthorization)
    .put(auth.requiresLogin, hasAuthorization, payments.update);

  app.route('/paymentHook')
    .get(payments.hookValidate)
    .post(payments.hook);

// Finish with setting up the paymentId param
  app.param('payId', payments.payment);
};


text:
**This project is no longer maintained and will not function with newer versions of Sendy.**

This repo is for archival purposes only. Newer forks of this project may function on newer versions of Sendy.

# Sendy-DisableLists

Per-brand list management permission removal for [Sendy](http://sendy.co) email server

![sendy-disablelists](https://cloud.githubusercontent.com/assets/5970137/8307848/92b5cc5a-1986-11e5-823a-422d65024cc2.png)

If some of your brands should not be allowed to view or edit the mailing lists they can send to, this add-on provides a method by which to lock that access. An administrator who is not tied to a particular brand can still edit the email lists for a brand; however, users tied to the brand will not be able to see the "View all lists" button and will not be able to manually navigate to any page on which subscriber information is shown or could be modified.

## Compatibility and Due Caution

This add-on is tested with Sendy version 2.0.2 and 2.0.3. If you are running an older or newer version of Sendy, please test first on a non-production server. The install script attempts to insert four blocks of code within Sendy's files, and there is no guarantee that the target locations will remain the same across versions. Some correction is done automatically with broad regular expressions, but any substantial change to the insertion points will cause the add-on to fail to install.

Unfortunately, updating your Sendy server may also break this add-on. If Sendy's sidebar.php or edit-brand.php are overwritten in the update, the Sendy Disable Lists add-on will no longer function. You can try re-running install_disableLists.sh to attempt reinsertion of the required code, but again, there is no guarantee the target locations have stayed the same. If you rely on the Sendy Disable Lists add-on and need to update Sendy, please check this repository again to see if an update has been issued, or be familiar enough with Sendy and the Sendy Disable Lists add-on to make (and if you're feeling nice, merge!) the necessary modifications.

## Installation

Installing this add-on is as easy as cloning this repository into the right place and running a shell script. Simply do the following:

1. cd into your sendy/includes directory (this may be a different path on your server)

    ```
    cd /var/www/html/sendy/includes/
    ```

2. clone this repository

    ```
    git clone https://github.com/userexec/Sendy-DisableLists.git
    ```

3. cd into the new directory

    ```
    cd Sendy-DisableLists
    ```

4. make install_invoicing.sh executable

    ```
    chmod +x install_disableLists.sh
    ```

5. run the install script

    ```
    ./install_disableLists.sh
    ```

## Usage

### Disabling Lists

Once the Sendy Disable Lists add-on is in place, a "Disable management of lists" checkbox will appear under the campaign fee settings on each brand. Check the box to disable list management for that brand.

As an admin, you'll still be able to exercise full control over that brand's lists.

## Removal

Removing the Sendy Disable Lists add-on is as simple as deleting the Sendy-DisableLists folder from your sendy/includes directory and removing the four blocks of code it placed in sendy/sidebar.php, sendy/new-brand.php, and sendy/edit-brand.php. The blocks of code that were inserted can be found, in full, in sidebar-addition-1.html, sidebar-addition-2.html, new-brand-addition.html, and edit-brand-addition.html.

To remove any trace of the Sendy Invoicing add-on from your database, drop the 'disableLists' column in the 'apps' table.


text:
<?php

class Fansoro
{
    /**
     * An instance of the Fansoro class
     *
     * @var object
     * @access protected
     */
    protected static $instance = null;

    /**
     * The version of Fansoro
     *
     * @var string
     */
    const VERSION = '2.0.4';

    /**
     * Protected clone method to enforce singleton behavior.
     *
     * @access protected
     */
    protected function __clone()
    {
        // Nothing here.
    }

    /**
     * Constructor.
     *
     * @access protected
     */
    protected function __construct()
    {
        // Init Config
        Config::init();

        // Turn on output buffering
        ob_start();

        // Display Errors
        Config::get('system.errors.display') and error_reporting(-1);

        // Set internal encoding
        function_exists('mb_language') and mb_language('uni');
        function_exists('mb_regex_encoding') and mb_regex_encoding(Config::get('system.charset'));
        function_exists('mb_internal_encoding') and mb_internal_encoding(Config::get('system.charset'));

        // Set default timezone
        date_default_timezone_set(Config::get('system.timezone'));

        // Start the session
        Session::start();

        // Init Cache
        Cache::init();

        // Init Plugins
        Plugins::init();

        // Init Blocks
        Blocks::init();

        // Init Pages
        Pages::init();

        // Flush (send) the output buffer and turn off output buffering
        ob_end_flush();
    }

    /**
     * Initialize Fansoro Application
     *
     *  <code>
     *      Fansoro::init();
     *  </code>
     *
     * @access public
     * @return object
     */
    public static function init()
    {
        return !isset(self::$instance) and self::$instance = new Fansoro();
    }
}


text:
class DropPitcherRunColumns < ActiveRecord::Migration
  def change
    remove_column :events, :pitcher_career_earned_run
    remove_column :events, :pitcher_season_earned_run
    remove_column :events, :pitcher_game_earned_run
    remove_column :events, :pitcher_career_allowed_run
    remove_column :events, :pitcher_season_allowed_run
    remove_column :events, :pitcher_game_allowed_run
  end
end


text:
gun-permits
===========

What is this?
-------------

Graph of FBI gun permit background checks nationally and by state. This accompanied a story written by Mary O'Leary of the New Haven Register in May of 2014. Live demo: http://data.digitalfirstmedia.com/gun-permits/

![Background checks for firearm purchases](screenshots/checks.png)

Credits
---------

Sarah Glen, Vaughn Hagerty, Nelson Hsu

Assumptions
-----------

* Google visualization API

What's in here?
---------------

The project contains the following folders and important files:

* ``index.html`` -- The app html
* ``lib/js`` -- Javascript
* ``lib/css`` -- Strangely enough, stylesheets
* ``lib/img`` -- image used to annotate horizontal axis with significant events

License
----------

This code is available under the MIT license. For more information, please see the LICENSE file in this repo.


text:
<?php namespace Experiensa\Modules;

class CurlRequest
{
    public static function getApiResponse($apiUrl,$check_lang = false,$lang_var_name = 'lang'){
        if($check_lang){
            $code = \Helpers::getActiveLanguageCode();
            if($code){
                $apiUrl .= '&'.$lang_var_name.'='.$code;
            }
        }
        if (function_exists('curl_version')) {//Using Curl
            //  Initiate curl
            $ch = curl_init();
            // Disable SSL verification
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            // Will return the response, if false it print the response
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

            curl_setopt($ch, CURLOPT_URL, $apiUrl);
            // Execute
            $response = curl_exec($ch);
            // Closing
            curl_close($ch);
        }else{
            if(ini_get('allow_url_fopen')) {
                $response = @file_get_contents($apiUrl);
            }else
                $response = false;
        }
        return json_decode($response);
        wp_reset_postdata();
    }
    public static function getHeaders($url){
        if (function_exists('curl_version')) {
            $curl = curl_init();
            curl_setopt_array($curl, array(
                CURLOPT_HEADER => true,
                CURLOPT_NOBODY => true,
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_URL => $url));
            $headers = explode("\n", curl_exec($curl));
            curl_close($curl);
        }else{
            $headers = @get_headers($url);
        }
        return $headers;
    }
}


text:
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;

namespace Octokit
{
    ///
    /// A client for GitHub's Activity Starring API.
    ///
    /// <remarks>
    /// See the Activity Starring API documentation for more information.
    /// </remarks>
    public class StarredClient : ApiClient, IStarredClient
    {
        ///
        /// Instantiates a new GitHub Activity Starring API client.
        ///
        /// <param name="apiConnection">An API connection</param>
        public StarredClient(IApiConnection apiConnection) : base(apiConnection)
        {
        }

        ///
        /// Retrieves all of the stargazers for the passed repository.
        ///
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<User>> GetAllStargazers(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return GetAllStargazers(owner, name, ApiOptions.None);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository.
        ///
        /// <param name="repositoryId">The Id of the repository</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<User>> GetAllStargazers(int repositoryId)
        {
            return GetAllStargazers(repositoryId, ApiOptions.None);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository.
        ///
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<User>> GetAllStargazers(string owner, string name, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<User>(ApiUrls.Stargazers(owner, name), options);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository.
        ///
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<User>> GetAllStargazers(int repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<User>(ApiUrls.Stargazers(repositoryId), options);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository with star creation timestamps.
        ///
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<UserStar>> GetAllStargazersWithTimestamps(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return GetAllStargazersWithTimestamps(owner, name, ApiOptions.None);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository with star creation timestamps.
        ///
        /// <param name="repositoryId">The Id of the repository</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<UserStar>> GetAllStargazersWithTimestamps(int repositoryId)
        {
            return GetAllStargazersWithTimestamps(repositoryId, ApiOptions.None);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository with star creation timestamps.
        ///
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<UserStar>> GetAllStargazersWithTimestamps(string owner, string name, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<UserStar>(ApiUrls.Stargazers(owner, name), null, AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Retrieves all of the stargazers for the passed repository with star creation timestamps.
        ///
        /// <param name="repositoryId">The Id of the repository</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<UserStar>> GetAllStargazersWithTimestamps(int repositoryId, ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<UserStar>(ApiUrls.Stargazers(repositoryId), null, AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user.
        ///
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForCurrent()
        {
            return GetAllForCurrent(ApiOptions.None);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user.
        ///
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForCurrent(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<Repository>(ApiUrls.Starred(), options);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user with star creation timestamps.
        ///
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForCurrentWithTimestamps()
        {
            return GetAllForCurrentWithTimestamps(ApiOptions.None);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user with star creation timestamps.
        ///
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForCurrentWithTimestamps(ApiOptions options)
        {
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<RepositoryStar>(ApiUrls.Starred(), null, AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user.
        ///
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters",
            Justification = "But i think i do need star-specific request parameters")]
        public Task<IReadOnlyList<Repository>> GetAllForCurrent(StarredRequest request)
        {
            Ensure.ArgumentNotNull(request, "request");

            return GetAllForCurrent(request, ApiOptions.None);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user.
        ///
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForCurrent(StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNull(request, "request");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<Repository>(ApiUrls.Starred(), request.ToParametersDictionary(), options);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user with star creation timestamps.
        ///
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters",
            Justification = "But i think i do need star-specific request parameters")]
        public Task<IReadOnlyList<RepositoryStar>> GetAllForCurrentWithTimestamps(StarredRequest request)
        {
            Ensure.ArgumentNotNull(request, "request");

            return GetAllForCurrentWithTimestamps(request, ApiOptions.None);
        }

        ///
        /// Retrieves all of the starred <see cref="Repository"/>(ies) for the current user with star creation timestamps.
        ///
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForCurrentWithTimestamps(StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNull(request, "request");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<RepositoryStar>(ApiUrls.Starred(), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user.
        ///
        /// <param name="user">The login of the user</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForUser(string user)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");

            return GetAllForUser(user, ApiOptions.None);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForUser(string user, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<Repository>(ApiUrls.StarredByUser(user), options);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user with star creation timestamps.
        ///
        /// <param name="user">The login of the user</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForUserWithTimestamps(string user)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");

            return GetAllForUserWithTimestamps(user, ApiOptions.None);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user with star creation timestamps.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForUserWithTimestamps(string user, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<RepositoryStar>(ApiUrls.StarredByUser(user), null, AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
        public Task<IReadOnlyList<Repository>> GetAllForUser(string user, StarredRequest request)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(request, "request");

            return GetAllForUser(user, request, ApiOptions.None);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<Repository>> GetAllForUser(string user, StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(request, "request");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<Repository>(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), options);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user with star creation timestamps.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
        public Task<IReadOnlyList<RepositoryStar>> GetAllForUserWithTimestamps(string user, StarredRequest request)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(request, "request");

            return GetAllForUserWithTimestamps(user, request, ApiOptions.None);
        }

        ///
        /// Retrieves all of the <see cref="Repository"/>(ies) starred by the specified user with star creation timestamps.
        ///
        /// <param name="user">The login of the user</param>
        /// <param name="request">Star-specific request parameters that sort the results</param>
        /// <param name="options">Options for changing the API response</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public Task<IReadOnlyList<RepositoryStar>> GetAllForUserWithTimestamps(string user, StarredRequest request, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(user, "user");
            Ensure.ArgumentNotNull(request, "request");
            Ensure.ArgumentNotNull(options, "options");

            return ApiConnection.GetAll<RepositoryStar>(ApiUrls.StarredByUser(user), request.ToParametersDictionary(), AcceptHeaders.StarCreationTimestamps, options);
        }

        ///
        /// Check if a repository is starred by the current authenticated user.
        ///
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
        public async Task<bool> CheckStarred(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            try
            {
                var response = await Connection.Get<object>(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false);
                return response.HttpResponse.StatusCode == HttpStatusCode.NoContent;
            }
            catch (NotFoundException)
            {
                return false;
            }
        }

        ///
        /// Stars a repository for the authenticated user.
        ///
        /// <param name="owner">The owner of the repository to star</param>
        /// <param name="name">The name of the repository to star</param>
        public async Task<bool> StarRepo(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            try
            {
                var response = await Connection.Put<object>(ApiUrls.Starred(owner, name), null, null).ConfigureAwait(false);
                return response.HttpResponse.StatusCode == HttpStatusCode.NoContent;
            }
            catch (NotFoundException)
            {
                return false;
            }
        }

        ///
        /// Unstars a repository for the authenticated user.
        ///
        /// <param name="owner">The owner of the repository to unstar</param>
        /// <param name="name">The name of the repository to unstar</param>
        public async Task<bool> RemoveStarFromRepo(string owner, string name)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            try
            {
                var statusCode = await Connection.Delete(ApiUrls.Starred(owner, name)).ConfigureAwait(false);
                return statusCode == HttpStatusCode.NoContent;
            }
            catch (NotFoundException)
            {
                return false;
            }
        }
    }
}


text:
namespace avatar
{

	class FirstPersonViewCli : public QObject
	{

		Q_OBJECT

	public:

		FirstPersonViewCli();

		/// \brief Create a text command to rotate the FPV
		///
		/// The method takes euler angles in radians, converts these angles
		/// to values, which suit FPV rotation, and outputs a corresponding
		/// text command, which is to be sent to command line interpreter.
		///
		template <typename FpvAxisAngleCalculator>
		static QByteArray createCommand(FpvAxisAngleCalculator calculator, float yaw, float pitch, float roll)
		{
			Q_UNUSED(roll);

			int const fpvYaw = calculator(fpv_utils::TwoAxisFpvAngleCalculator::Axis::Y, yaw);
			int const fpvPitch = calculator(fpv_utils::TwoAxisFpvAngleCalculator::Axis::X, pitch);

			int const digitsCount = 3;
			int digitsRadix = 10;
			QChar const digitsPadding('0');

			QString const command =
				QString("Y") // 'Y' for yaw
				+
				QString("%1").arg(fpvYaw, digitsCount, digitsRadix, digitsPadding) // yaw value
				+
				QString('P') // 'P' for pitch
				+
				QString("%1").arg(fpvPitch, digitsCount, digitsRadix, digitsPadding); // pitch value

			return command.toUtf8();
		}

	public:

		/// \brief A method to support a delayed initialization
		///
		/// The method uses a non-virtual interface idiom.
		/// Thus, the method defines the executive part of the method.
		/// The engineering part must be defined by the derived classes
		/// by overriding pure virtual initializeImpl() method.
		/// Such a structure is needed to prevent additional initializations.
		/// If such an extra initialization is invoked,
		/// then a warning() signal is emitted.
		/// \sa initializeImpl()
		///
		void initialize();

		/// \brief A method to send a text command to the FPV
		///
		/// The method uses a non-virtual interface idiom.
		/// Thus, the method defines the executive part of the method.
		/// The engineering part must be defined by the derived classes
		/// by overriding pure virtual sendCommandImpl() method.
		/// Such a structure is needed to allow the command line interpreter
		/// to skip commands that are exactly the same as the last sent commands.
		/// Hence, avoiding too much stress on the communication line.
		/// \sa sendCommandImpl()
		///
		void sendCommand(QByteArray const & command);

	signals:

		void commandSent();

		void error(QString const & description);
		void warning(QString const & description);

	private:

		/// \brief A pure virtual method to perform the delayed initialization
		///
		/// This method is called from initialize() method as part of NVI idiom.
		/// This method is the place where derived classes must put their initialization logic.
		/// \sa initialize()
		///
		virtual void initializeImpl() = 0;

		/// \brief A pure virtual method to send a command to the FPV
		///
		/// This method is called from sendCommand() method as part of NVI idiom.
		/// This method is the place where derived classes must put the sending logic.
		/// \sa sendCommand()
		///
		virtual void sendCommandImpl(QByteArray const & command) = 0;

	private:

		bool m_initialized;
		QByteArray m_lastSentCommand;

	};

}


text:
#include <aws/elasticloadbalancingv2/model/SetRulePrioritiesRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::ElasticLoadBalancingv2::Model;
using namespace Aws::Utils;

SetRulePrioritiesRequest::SetRulePrioritiesRequest() :
    m_rulePrioritiesHasBeenSet(false)
{
}

Aws::String SetRulePrioritiesRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=SetRulePriorities&";
  if(m_rulePrioritiesHasBeenSet)
  {
    unsigned rulePrioritiesCount = 1;
    for(auto& item : m_rulePriorities)
    {
      item.OutputToStream(ss, "RulePriorities.member.", rulePrioritiesCount, "");
      rulePrioritiesCount++;
    }
  }

  ss << "Version=2015-12-01";
  return ss.str();
}

void  SetRulePrioritiesRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
<?php
	echo Form::open($submit_handler, array('name' => 'frmSetPswd', 'id' => 'id_frmSetPswd'));
?>
				<fieldset>
<?php
	echo '<legend>'.$page_description.'</legend>';
	echo Form::label('NA', 'Username: '.Session::instance()->get('username')).'
';
	echo Form::label('pwdNewPassword', 'New Password:');
	echo Form::password('pwdNewPassword', NULL, array('id' => 'id_pwdNewPassword', 'size' => '35', 'maxlength' => '30'));
	if (array_key_exists('pwdNewPassword', $errors))
	{
		echo ''.$errors['pwdNewPassword'].'';
	}
	echo Form::label('pwdConfPassword', 'Confirm Password:');
	echo Form::password('pwdConfPassword', NULL, array('id' => 'id_pwdConfPassword', 'size' => '35', 'maxlength' => '30'));
	if (array_key_exists('pwdConfPassword', $errors))
	{
		echo ''.$errors['pwdConfPassword'].'';
	}
	echo '
';
	echo Form::button('btnUpdate', 'Update', array('class' => 'small button radius submit'));
?>
				</fieldset>
<?php
	echo Form::close();
?>


text:
struct PP_Point;

class SkBitmap;
class TransportDIB;

namespace WebKit {
class WebInputEvent;
class WebMouseEvent;
class WebPluginContainer;
struct WebCompositionUnderline;
struct WebCursorInfo;
struct WebPrintParams;
}

namespace ppapi {
struct InputEventData;
struct PPP_Instance_Combined;
class Resource;
}

namespace ui {
class Range;
}

namespace webkit {
namespace ppapi {

class FullscreenContainer;
class MessageChannel;
class PluginDelegate;
class PluginModule;
class PluginObject;
class PPB_Graphics2D_Impl;
class PPB_Graphics3D_Impl;
class PPB_ImageData_Impl;
class PPB_URLLoader_Impl;
class PPB_URLRequestInfo_Impl;

// Represents one time a plugin appears on one web page.
//
// Note: to get from a PP_Instance to a PluginInstance*, use the
// ResourceTracker.
class WEBKIT_PLUGINS_EXPORT PluginInstance :
    public base::RefCounted<PluginInstance>,
    public base::SupportsWeakPtr<PluginInstance>,
    public ::ppapi::PPB_Instance_Shared {
 public:
  // Create and return a PluginInstance object which supports the most recent
  // version of PPP_Instance possible by querying the given get_plugin_interface
  // function. If the plugin does not support any valid PPP_Instance interface,
  // returns NULL.
  static PluginInstance* Create(PluginDelegate* delegate, PluginModule* module);
  // Delete should be called by the WebPlugin before this destructor.
  virtual ~PluginInstance();

  PluginDelegate* delegate() const { return delegate_; }
  PluginModule* module() const { return module_.get(); }
  MessageChannel& message_channel() { return *message_channel_; }

  WebKit::WebPluginContainer* container() const { return container_; }

  void set_always_on_top(bool on_top) { always_on_top_ = on_top; }

  // Returns the PP_Instance uniquely identifying this instance. Guaranteed
  // nonzero.
  PP_Instance pp_instance() const { return pp_instance_; }

  ::ppapi::thunk::ResourceCreationAPI& resource_creation() {
    return *resource_creation_.get();
  }

  // Does some pre-destructor cleanup on the instance. This is necessary
  // because some cleanup depends on the plugin instance still existing (like
  // calling the plugin's DidDestroy function). This function is called from
  // the WebPlugin implementation when WebKit is about to remove the plugin.
  void Delete();

  // Paints the current backing store to the web page.
  void Paint(WebKit::WebCanvas* canvas,
             const gfx::Rect& plugin_rect,
             const gfx::Rect& paint_rect);

  // Schedules a paint of the page for the given region. The coordinates are
  // relative to the top-left of the plugin. This does nothing if the plugin
  // has not yet been positioned. You can supply an empty gfx::Rect() to
  // invalidate the entire plugin.
  void InvalidateRect(const gfx::Rect& rect);

  // Schedules a scroll of the plugin.  This uses optimized scrolling only for
  // full-frame plugins, as otherwise there could be other elements on top.  The
  // slow path can also be triggered if there is an overlapping frame.
  void ScrollRect(int dx, int dy, const gfx::Rect& rect);

  // If the plugin instance is backed by a texture, return its texture ID in the
  // compositor's namespace. Otherwise return 0. Returns 0 by default.
  unsigned GetBackingTextureId();

  // Commit the backing texture to the screen once the side effects some
  // rendering up to an offscreen SwapBuffers are visible.
  void CommitBackingTexture();

  // Called when the out-of-process plugin implementing this instance crashed.
  void InstanceCrashed();

  // PPB_Instance and PPB_Instance_Private implementation.
  const GURL& plugin_url() const { return plugin_url_; }
  bool full_frame() const { return full_frame_; }
  const ::ppapi::ViewData& view_data() const { return view_data_; }

  // PPP_Instance and PPP_Instance_Private pass-through.
  bool Initialize(WebKit::WebPluginContainer* container,
                  const std::vector<std::string>& arg_names,
                  const std::vector<std::string>& arg_values,
                  const GURL& plugin_url,
                  bool full_frame);
  bool HandleDocumentLoad(PPB_URLLoader_Impl* loader);
  bool HandleInputEvent(const WebKit::WebInputEvent& event,
                        WebKit::WebCursorInfo* cursor_info);
  PP_Var GetInstanceObject();
  void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip);

  // Handlers for composition events.
  bool HandleCompositionStart(const string16& text);
  bool HandleCompositionUpdate(
      const string16& text,
      const std::vector<WebKit::WebCompositionUnderline>& underlines,
      int selection_start,
      int selection_end);
  bool HandleCompositionEnd(const string16& text);
  bool HandleTextInput(const string16& text);

  // Gets the current text input status.
  ui::TextInputType text_input_type() const { return text_input_type_; }
  gfx::Rect GetCaretBounds() const;
  bool IsPluginAcceptingCompositionEvents() const;
  void GetSurroundingText(string16* text, ui::Range* range) const;

  // Notifications about focus changes, see has_webkit_focus_ below.
  void SetWebKitFocus(bool has_focus);
  void SetContentAreaFocus(bool has_focus);

  // Notification about page visibility. The default is "visible".
  void PageVisibilityChanged(bool is_visible);

  // Notifications that the view is about to paint, has started painting, and
  // has flushed the painted content to the screen. These messages are used to
  // send Flush callbacks to the plugin for DeviceContext2D/3D.
  void ViewWillInitiatePaint();
  void ViewInitiatedPaint();
  void ViewFlushedPaint();

  // If this plugin can be painted merely by copying the backing store to the
  // screen, and the plugin bounds encloses the given paint bounds, returns
  // true. In this case, the location, clipping, and ID of the backing store
  // will be filled into the given output parameters.
  bool GetBitmapForOptimizedPluginPaint(
      const gfx::Rect& paint_bounds,
      TransportDIB** dib,
      gfx::Rect* dib_bounds,
      gfx::Rect* clip);

  // Tracks all live PluginObjects.
  void AddPluginObject(PluginObject* plugin_object);
  void RemovePluginObject(PluginObject* plugin_object);

  string16 GetSelectedText(bool html);
  string16 GetLinkAtPosition(const gfx::Point& point);
  void RequestSurroundingText(size_t desired_number_of_characters);
  void Zoom(double factor, bool text_only);
  bool StartFind(const string16& search_text,
                 bool case_sensitive,
                 int identifier);
  void SelectFindResult(bool forward);
  void StopFind();

  bool SupportsPrintInterface();
  bool IsPrintScalingDisabled();
  int PrintBegin(const WebKit::WebPrintParams& print_params);
  bool PrintPage(int page_number, WebKit::WebCanvas* canvas);
  void PrintEnd();

  bool CanRotateView();
  void RotateView(WebKit::WebPlugin::RotationType type);

  void Graphics3DContextLost();

  // There are 2 implementations of the fullscreen interface
  // PPB_FlashFullscreen is used by Pepper Flash.
  // PPB_Fullscreen is intended for other applications including NaCl.
  // The two interface are mutually exclusive.

  // Implementation of PPB_FlashFullscreen.

  // Because going to fullscreen is asynchronous (but going out is not), there
  // are 3 states:
  // - normal            : fullscreen_container_ == NULL
  //                       flash_fullscreen_ == false
  // - fullscreen pending: fullscreen_container_ != NULL
  //                       flash_fullscreen_ == false
  // - fullscreen        : fullscreen_container_ != NULL
  //                       flash_fullscreen_ == true
  //
  // In normal state, events come from webkit and painting goes back to it.
  // In fullscreen state, events come from the fullscreen container, and
  // painting goes back to it.
  // In pending state, events from webkit are ignored, and as soon as we
  // receive events from the fullscreen container, we go to the fullscreen
  // state.
  bool FlashIsFullscreenOrPending();

  // Switches between fullscreen and normal mode. If |delay_report| is set to
  // false, it may report the new state through DidChangeView immediately. If
  // true, it will delay it. When called from the plugin, delay_report should
  // be true to avoid re-entrancy.
  void FlashSetFullscreen(bool fullscreen, bool delay_report);

  // Updates |flash_fullscreen_| and sends focus change notification if
  // necessary.
  void UpdateFlashFullscreenState(bool flash_fullscreen);

  FullscreenContainer* fullscreen_container() const {
    return fullscreen_container_;
  }

  // Implementation of PPB_Fullscreen.

  // Because going to/from fullscreen is asynchronous, there are 4 states:
  // - normal            : desired_fullscreen_state_ == false
  //                       view_data_.is_fullscreen == false
  // - fullscreen pending: desired_fullscreen_state_ == true
  //                       view_data_.is_fullscreen == false
  // - fullscreen        : desired_fullscreen_state_ == true
  //                       view_data_.is_fullscreen == true
  // - normal pending    : desired_fullscreen_state_ = false
  //                       view_data_.is_fullscreen = true
  bool IsFullscreenOrPending();

  bool flash_fullscreen() const { return flash_fullscreen_; }

  // Switches between fullscreen and normal mode. The transition is
  // asynchronous. WebKit will trigger corresponding VewChanged calls.
  // Returns true on success, false on failure (e.g. trying to enter fullscreen
  // when not processing a user gesture or trying to set fullscreen when
  // already in fullscreen mode).
  bool SetFullscreen(bool fullscreen);

  // Implementation of PPB_Flash.
  int32_t Navigate(PPB_URLRequestInfo_Impl* request,
                   const char* target,
                   bool from_user_action);
  bool IsRectTopmost(const gfx::Rect& rect);

  // Implementation of PPB_Gamepad.
  void SampleGamepads(PP_Instance instance, PP_GamepadsSampleData* data)
      OVERRIDE;

  // Implementation of PPP_Messaging.
  void HandleMessage(PP_Var message);

  PluginDelegate::PlatformContext3D* CreateContext3D();

  // Returns true iff the plugin is a full-page plugin (i.e. not in an iframe
  // or embedded in a page).
  bool IsFullPagePlugin() const;

  // Returns true if the plugin is processing a user gesture.
  bool IsProcessingUserGesture();

  // A mouse lock request was pending and this reports success or failure.
  void OnLockMouseACK(bool succeeded);
  // A mouse lock was in place, but has been lost.
  void OnMouseLockLost();
  // A mouse lock is enabled and mouse events are being delievered.
  void HandleMouseLockedInputEvent(const WebKit::WebMouseEvent& event);

  // Simulates an input event to the plugin by passing it down to WebKit,
  // which sends it back up to the plugin as if it came from the user.
  void SimulateInputEvent(const ::ppapi::InputEventData& input_event);

  // Simulates an IME event at the level of RenderView which sends it back up to
  // the plugin as if it came from the user.
  bool SimulateIMEEvent(const ::ppapi::InputEventData& input_event);
  void SimulateImeSetCompositionEvent(
      const ::ppapi::InputEventData& input_event);

  // PPB_Instance_API implementation.
  virtual PP_Bool BindGraphics(PP_Instance instance,
                               PP_Resource device) OVERRIDE;
  virtual PP_Bool IsFullFrame(PP_Instance instance) OVERRIDE;
  virtual const ::ppapi::ViewData* GetViewData(PP_Instance instance) OVERRIDE;
  virtual PP_Var GetWindowObject(PP_Instance instance) OVERRIDE;
  virtual PP_Var GetOwnerElementObject(PP_Instance instance) OVERRIDE;
  virtual PP_Var ExecuteScript(PP_Instance instance,
                               PP_Var script,
                               PP_Var* exception) OVERRIDE;
  virtual uint32_t GetAudioHardwareOutputSampleRate(PP_Instance instance)
      OVERRIDE;
  virtual uint32_t GetAudioHardwareOutputBufferSize(PP_Instance instance)
      OVERRIDE;
  virtual PP_Var GetDefaultCharSet(PP_Instance instance) OVERRIDE;
  virtual PP_Var GetFontFamilies(PP_Instance instance) OVERRIDE;
  virtual void NumberOfFindResultsChanged(PP_Instance instance,
                                          int32_t total,
                                          PP_Bool final_result) OVERRIDE;
  virtual void SelectedFindResultChanged(PP_Instance instance,
                                         int32_t index) OVERRIDE;
  virtual PP_Bool SetFullscreen(PP_Instance instance,
                                     PP_Bool fullscreen) OVERRIDE;
  virtual PP_Bool GetScreenSize(PP_Instance instance, PP_Size* size)
      OVERRIDE;
  virtual ::ppapi::thunk::PPB_Flash_API* GetFlashAPI() OVERRIDE;
  virtual int32_t RequestInputEvents(PP_Instance instance,
                                     uint32_t event_classes) OVERRIDE;
  virtual int32_t RequestFilteringInputEvents(PP_Instance instance,
                                              uint32_t event_classes) OVERRIDE;
  virtual void ClearInputEventRequest(PP_Instance instance,
                                      uint32_t event_classes) OVERRIDE;
  virtual void ClosePendingUserGesture(PP_Instance instance,
                                       PP_TimeTicks timestamp);
  virtual void ZoomChanged(PP_Instance instance, double factor) OVERRIDE;
  virtual void ZoomLimitsChanged(PP_Instance instance,
                                 double minimum_factor,
                                 double maximium_factor) OVERRIDE;
  virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE;
  virtual PP_Bool SetCursor(PP_Instance instance,
                            PP_MouseCursor_Type type,
                            PP_Resource image,
                            const PP_Point* hot_spot) OVERRIDE;
  virtual int32_t LockMouse(
      PP_Instance instance,
      scoped_refptr< ::ppapi::TrackedCallback> callback) OVERRIDE;
  virtual void UnlockMouse(PP_Instance instance) OVERRIDE;
  virtual PP_Bool GetDefaultPrintSettings(
      PP_Instance instance,
      PP_PrintSettings_Dev* print_settings) OVERRIDE;
  virtual void SetTextInputType(PP_Instance instance,
                                PP_TextInput_Type type) OVERRIDE;
  virtual void UpdateCaretPosition(PP_Instance instance,
                                   const PP_Rect& caret,
                                   const PP_Rect& bounding_box) OVERRIDE;
  virtual void CancelCompositionText(PP_Instance instance) OVERRIDE;
  virtual void SelectionChanged(PP_Instance instance) OVERRIDE;
  virtual void UpdateSurroundingText(PP_Instance instance,
                                     const char* text,
                                     uint32_t caret,
                                     uint32_t anchor) OVERRIDE;
  virtual PP_Var ResolveRelativeToDocument(
      PP_Instance instance,
      PP_Var relative,
      PP_URLComponents_Dev* components) OVERRIDE;
  virtual PP_Bool DocumentCanRequest(PP_Instance instance, PP_Var url) OVERRIDE;
  virtual PP_Bool DocumentCanAccessDocument(PP_Instance instance,
                                            PP_Instance target) OVERRIDE;
  virtual PP_Var GetDocumentURL(PP_Instance instance,
                                PP_URLComponents_Dev* components) OVERRIDE;
  virtual PP_Var GetPluginInstanceURL(
      PP_Instance instance,
      PP_URLComponents_Dev* components) OVERRIDE;

  // Reset this instance as proxied. Resets cached interfaces to point to the
  // proxy and re-sends DidCreate, DidChangeView, and HandleDocumentLoad (if
  // necessary).
  // This is for use with the NaCl proxy.
  bool ResetAsProxied();

 private:
  // See the static Create functions above for creating PluginInstance objects.
  // This constructor is private so that we can hide the PPP_Instance_Combined
  // details while still having 1 constructor to maintain for member
  // initialization.
  PluginInstance(PluginDelegate* delegate,
                 PluginModule* module,
                 ::ppapi::PPP_Instance_Combined* instance_interface);

  bool LoadFindInterface();
  bool LoadInputEventInterface();
  bool LoadMessagingInterface();
  bool LoadMouseLockInterface();
  bool LoadPdfInterface();
  bool LoadPrintInterface();
  bool LoadPrivateInterface();
  bool LoadSelectionInterface();
  bool LoadTextInputInterface();
  bool LoadZoomInterface();

  // Determines if we think the plugin has focus, both content area and webkit
  // (see has_webkit_focus_ below).
  bool PluginHasFocus() const;
  void SendFocusChangeNotification();

  // Returns true if the plugin has registered to accept touch events.
  bool IsAcceptingTouchEvents() const;

  void ScheduleAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
  void SendAsyncDidChangeView(const ::ppapi::ViewData& previous_view);
  void SendDidChangeView(const ::ppapi::ViewData& previous_view);

  // Reports the current plugin geometry to the plugin by calling
  // DidChangeView.
  void ReportGeometry();

  // Queries the plugin for supported print formats and sets |format| to the
  // best format to use. Returns false if the plugin does not support any
  // print format that we can handle (we can handle only PDF).
  bool GetPreferredPrintOutputFormat(PP_PrintOutputFormat_Dev* format);
  bool PrintPDFOutput(PP_Resource print_output, WebKit::WebCanvas* canvas);

  // Get the bound graphics context as a concrete 2D graphics context or returns
  // null if the context is not 2D.
  PPB_Graphics2D_Impl* GetBoundGraphics2D() const;

  // Get the bound 3D graphics context.
  // Returns NULL if bound graphics is not a 3D context.
  PPB_Graphics3D_Impl* GetBoundGraphics3D() const;

  // Sets the id of the texture that the plugin draws to. The id is in the
  // compositor space so it can use it to composite with rest of the page.
  // A value of zero indicates the plugin is not backed by a texture.
  // is_opaque is true if the plugin contents are always opaque.
  void setBackingTextureId(unsigned int id, bool is_opaque);

  // Internal helper function for PrintPage().
  bool PrintPageHelper(PP_PrintPageNumberRange_Dev* page_ranges,
                       int num_ranges,
                       WebKit::WebCanvas* canvas);

  void DoSetCursor(WebKit::WebCursorInfo* cursor);

  // Internal helper functions for HandleCompositionXXX().
  bool SendCompositionEventToPlugin(
      PP_InputEvent_Type type,
      const string16& text);
  bool SendCompositionEventWithUnderlineInformationToPlugin(
      PP_InputEvent_Type type,
      const string16& text,
      const std::vector<WebKit::WebCompositionUnderline>& underlines,
      int selection_start,
      int selection_end);

  // Checks if the security origin of the document containing this instance can
  // assess the security origin of the main frame document.
  bool CanAccessMainFrame() const;

  // Returns true if the WebView the plugin is in renders via the accelerated
  // compositing path.
  bool IsViewAccelerated();

  // Track, set and reset size attributes to control the size of the plugin
  // in and out of fullscreen mode.
  void KeepSizeAttributesBeforeFullscreen();
  void SetSizeAttributesForFullscreen();
  void ResetSizeAttributesAfterFullscreen();

  PluginDelegate* delegate_;
  scoped_refptr<PluginModule> module_;
  scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_;

  PP_Instance pp_instance_;

  // NULL until we have been initialized.
  WebKit::WebPluginContainer* container_;

  // Plugin URL.
  GURL plugin_url_;

  // Indicates whether this is a full frame instance, which means it represents
  // an entire document rather than an embed tag.
  bool full_frame_;

  // Stores the current state of the plugin view.
  ::ppapi::ViewData view_data_;

  // Indicates if we've ever sent a didChangeView to the plugin. This ensure we
  // always send an initial notification, even if the position and clip are the
  // same as the default values.
  bool sent_initial_did_change_view_;

  // We use a weak ptr factory for scheduling DidChangeView events so that we
  // can tell whether updates are pending and consolidate them. When there's
  // already a weak ptr pending (HasWeakPtrs is true), code should update the
  // view_data_ but not send updates. This also allows us to cancel scheduled
  // view change events.
  base::WeakPtrFactory<PluginInstance> view_change_weak_ptr_factory_;

  // The current device context for painting in 2D or 3D.
  scoped_refptr< ::ppapi::Resource> bound_graphics_;

  // We track two types of focus, one from WebKit, which is the focus among
  // all elements of the page, one one from the browser, which is whether the
  // tab/window has focus. We tell the plugin it has focus only when both of
  // these values are set to true.
  bool has_webkit_focus_;
  bool has_content_area_focus_;

  // The id of the current find operation, or -1 if none is in process.
  int find_identifier_;

  // Helper object that creates resources.
  scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> resource_creation_;

  // The plugin-provided interfaces.
  const PPP_Find_Dev* plugin_find_interface_;
  const PPP_InputEvent* plugin_input_event_interface_;
  const PPP_Messaging* plugin_messaging_interface_;
  const PPP_MouseLock* plugin_mouse_lock_interface_;
  const PPP_Pdf* plugin_pdf_interface_;
  const PPP_Instance_Private* plugin_private_interface_;
  const PPP_Selection_Dev* plugin_selection_interface_;
  const PPP_TextInput_Dev* plugin_textinput_interface_;
  const PPP_Zoom_Dev* plugin_zoom_interface_;

  // Flags indicating whether we have asked this plugin instance for the
  // corresponding interfaces, so that we can ask only once.
  bool checked_for_plugin_input_event_interface_;
  bool checked_for_plugin_messaging_interface_;

  // This is only valid between a successful PrintBegin call and a PrintEnd
  // call.
  PP_PrintSettings_Dev current_print_settings_;
#if defined(OS_MACOSX)
  // On the Mac, when we draw the bitmap to the PDFContext, it seems necessary
  // to keep the pixels valid until CGContextEndPage is called. We use this
  // variable to hold on to the pixels.
  scoped_refptr<PPB_ImageData_Impl> last_printed_page_;
#endif  // defined(OS_MACOSX)
#if defined(USE_SKIA)
  // Always when printing to PDF on Linux and when printing for preview on Mac
  // and Win, the entire document goes into one metafile.  However, when users
  // print only a subset of all the pages, it is impossible to know if a call
  // to PrintPage() is the last call. Thus in PrintPage(), just store the page
  // number in |ranges_|. The hack is in PrintEnd(), where a valid |canvas_|
  // is preserved in PrintWebViewHelper::PrintPages. This makes it possible
  // to generate the entire PDF given the variables below:
  //
  // The most recently used WebCanvas, guaranteed to be valid.
  SkRefPtr<WebKit::WebCanvas> canvas_;
  // An array of page ranges.
  std::vector<PP_PrintPageNumberRange_Dev> ranges_;
#endif  // OS_LINUX || OS_WIN

  // The plugin print interface.
  const PPP_Printing_Dev* plugin_print_interface_;

  // The plugin 3D interface.
  const PPP_Graphics3D* plugin_graphics_3d_interface_;

  // Contains the cursor if it's set by the plugin.
  scoped_ptr<WebKit::WebCursorInfo> cursor_;

  // Set to true if this plugin thinks it will always be on top. This allows us
  // to use a more optimized painting path in some cases.
  bool always_on_top_;

  // Implementation of PPB_FlashFullscreen.

  // Plugin container for fullscreen mode. NULL if not in fullscreen mode. Note:
  // there is a transition state where fullscreen_container_ is non-NULL but
  // flash_fullscreen_ is false (see above).
  FullscreenContainer* fullscreen_container_;

  // True if we are in "flash" fullscreen mode. False if we are in normal mode
  // or in transition to fullscreen. Normal fullscreen mode is indicated in
  // the ViewData.
  bool flash_fullscreen_;

  // Implementation of PPB_Fullscreen.

  // Since entering fullscreen mode is an asynchronous operation, we set this
  // variable to the desired state at the time we issue the fullscreen change
  // request. The plugin will receive a DidChangeView event when it goes
  // fullscreen.
  bool desired_fullscreen_state_;

  // WebKit does not resize the plugin when going into fullscreen mode, so we do
  // this here by modifying the various plugin attributes and then restoring
  // them on exit.
  WebKit::WebString width_before_fullscreen_;
  WebKit::WebString height_before_fullscreen_;
  WebKit::WebString border_before_fullscreen_;
  WebKit::WebString style_before_fullscreen_;
  gfx::Size screen_size_for_fullscreen_;

  // The MessageChannel used to implement bidirectional postMessage for the
  // instance.
  scoped_ptr<MessageChannel> message_channel_;

  // Bitmap for crashed plugin. Lazily initialized, non-owning pointer.
  SkBitmap* sad_plugin_;

  typedef std::set<PluginObject*> PluginObjectSet;
  PluginObjectSet live_plugin_objects_;

  // Classes of events that the plugin has registered for, both for filtering
  // and not. The bits are PP_INPUTEVENT_CLASS_*.
  uint32_t input_event_mask_;
  uint32_t filtered_input_event_mask_;

  // Text composition status.
  ui::TextInputType text_input_type_;
  gfx::Rect text_input_caret_;
  gfx::Rect text_input_caret_bounds_;
  bool text_input_caret_set_;

  // Text selection status.
  std::string surrounding_text_;
  size_t selection_caret_;
  size_t selection_anchor_;

  scoped_refptr< ::ppapi::TrackedCallback> lock_mouse_callback_;

  // Track pending user gestures so out-of-process plugins can respond to
  // a user gesture after it has been processed.
  PP_TimeTicks pending_user_gesture_;

  // The Flash proxy is associated with the instance.
  PPB_Flash_Impl flash_impl_;

  // We store the arguments so we can re-send them if we are reset to talk to
  // NaCl via the IPC NaCl proxy.
  std::vector<std::string> argn_;
  std::vector<std::string> argv_;

  // This is NULL unless HandleDocumentLoad has called. In that case, we store
  // the pointer so we can re-send it later if we are reset to talk to NaCl.
  scoped_refptr<PPB_URLLoader_Impl> document_loader_;

  DISALLOW_COPY_AND_ASSIGN(PluginInstance);
};

}  // namespace ppapi
}  // namespace webkit

#endif  // WEBKIT_PLUGINS_PPAPI_PPAPI_PLUGIN_INSTANCE_H_


text:
// ~~strike through~~
//

import { getLineOffset } from '../common/utils.js';

// Insert each marker as a separate text token, and add it to delimiter list
//
export function tokenize(state, silent) {
  let i, scanned, token, len, ch, offset,
      start = state.pos,
      marker = state.src.charCodeAt(start);

  if (silent) { return false; }

  if (marker !== 0x7E/* ~ */) { return false; }

  scanned = state.scanDelims(state.pos, true);
  len = scanned.length;
  ch = String.fromCharCode(marker);

  if (len < 2) { return false; }

  offset = 0;
  if (len % 2) {
    token         = state.push('text', '', 0);
    token.content = ch;
    token.position = start;
    token.size = 1;
    offset = 1;
    len--;
  }

  for (i = 0; i < len; i += 2) {
    token         = state.push('text', '', 0);
    token.content = ch + ch;
    token.position = start + i + offset;
    token.size = 2;

    state.delimiters.push({
      marker: marker,
      position: start,
      length: 0,     // disable "rule of 3" length checks meant for emphasis
      jump:   i / 2, // for `~~` 1 marker = 2 characters
      token:  state.tokens.length - 1,
      end:    -1,
      open:   scanned.can_open,
      close:  scanned.can_close
    });
  }

  state.pos += scanned.length;

  return true;
}

function __postProcess(state, delimiters) {
  let i, j,
      startDelim,
      endDelim,
      token,
      loneMarkers = [],
      max = delimiters.length;

  for (i = 0; i < max; i++) {
    startDelim = delimiters[i];

    if (startDelim.marker !== 0x7E/* ~ */) {
      continue;
    }

    if (startDelim.end === -1) {
      continue;
    }

    endDelim = delimiters[startDelim.end];

    token         = state.tokens[startDelim.token];
    token.type    = 's_open';
    token.tag     = 's';
    token.nesting = 1;
    token.markup  = '~~';
    token.content = '';
    token.position = startDelim.position + getLineOffset(state, startDelim.token);

    token         = state.tokens[endDelim.token];
    token.type    = 's_close';
    token.tag     = 's';
    token.nesting = -1;
    token.markup  = '~~';
    token.content = '';

    if (state.tokens[endDelim.token - 1].type === 'text' &&
        state.tokens[endDelim.token - 1].content === '~') {

      loneMarkers.push(endDelim.token - 1);
    }
  }

  // If a marker sequence has an odd number of characters, it's splitted
  // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the
  // start of the sequence.
  //
  // So, we have to move all those markers after subsequent s_close tags.
  //
  while (loneMarkers.length) {
    i = loneMarkers.pop();
    j = i + 1;

    while (j < state.tokens.length && state.tokens[j].type === 's_close') {
      j++;
    }

    j--;

    if (i !== j) {
      token = state.tokens[j];
      state.tokens[j] = state.tokens[i];
      state.tokens[i] = token;
    }
  }
}

// Walk through delimiter list and replace text tokens with tags
//
export function postProcess(state) {
  let curr,
      tokens_meta = state.tokens_meta,
      max = state.tokens_meta.length;

  __postProcess(state, state.delimiters);

  for (curr = 0; curr < max; curr++) {
    if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
      __postProcess(state, tokens_meta[curr].delimiters);
    }
  }
}


text:
require File.expand_path('../../test_helper', __FILE__)

class Rougemine::IndexControllerTest < ActionController::TestCase
  # Replace this with your real tests.
  def test_truth
    assert true
  end
end


text:
var knex=require("../db/connect.js");
exports.create=function()
{

}