text:
package org.osanchezhuerta.employees.hr.ws.web.facade;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.osanchezhuerta.employees.hr.ws.web.domain.xsd.GovernanceHeaderRequest;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="governanceHeaderRequest" type="{http://domain.web.ws.hr.employees.osanchezhuerta.org/xsd/}governanceHeaderRequest"/>
 *         <element name="empNo" type="{http://www.w3.org/2001/XMLSchema}int"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "governanceHeaderRequest",
    "empNo"
})
@XmlRootElement(name = "consultarTitlesPorEmpNo")
public class ConsultarTitlesPorEmpNo {

    @XmlElement(required = true)
    protected GovernanceHeaderRequest governanceHeaderRequest;
    protected int empNo;

    /**
     * Gets the value of the governanceHeaderRequest property.
     *
     * @return
     *     possible object is
     *     {@link GovernanceHeaderRequest }
     *
     */
    public GovernanceHeaderRequest getGovernanceHeaderRequest() {
        return governanceHeaderRequest;
    }

    /**
     * Sets the value of the governanceHeaderRequest property.
     *
     * @param value
     *     allowed object is
     *     {@link GovernanceHeaderRequest }
     *
     */
    public void setGovernanceHeaderRequest(GovernanceHeaderRequest value) {
        this.governanceHeaderRequest = value;
    }

    /**
     * Gets the value of the empNo property.
     *
     */
    public int getEmpNo() {
        return empNo;
    }

    /**
     * Sets the value of the empNo property.
     *
     */
    public void setEmpNo(int value) {
        this.empNo = value;
    }

}


text:
import bruces
from bruces.api import ModuleManager

@bruces.api.module("module")

@bruces.api.action
def ls():
    """
    List all active modules.
    """
    return list(ModuleManager.modules)

@bruces.api.action
@bruces.api.argument("module", "The module to list arguments for")
def cat(module):
    """
    List actions within a specific module.
    """
    mod = ModuleManager.modules[module]
    return list(mod.actions)

@bruces.api.action
@bruces.api.argument("module", "The module containing the action")
@bruces.api.argument("action", "The name of the action to get arguments for")
@bruces.api.argument("named_only", "Whether or not to show only named arguments")
def desc(module, action, named_only=False):
    """
    Get the list of arguments for a specific action.
    """
    mod = ModuleManager.modules[module]
    cmd = mod[action]
    if not named_only:
        return list(cmd.args)

    retval = []
    for a in cmd.args:
        if cmd.args[a].optional is True and cmd.args[a].positional is False:
            retval.append(a)

    return retval

redpajama_set_name: RedPajamaGithub


text:
/*
 * Copyright (C) 2002,
 *
 * Arjuna Technologies Limited,
 * Newcastle upon Tyne,
 * Tyne and Wear,
 * UK.
 *
 * $Id: NoTransaction.java,v 1.1 2002/11/25 11:00:53 nmcl Exp $
 */

package com.arjuna.mw.wstx.status;

import com.arjuna.mw.wsas.status.Status;

/**
 * There is no transaction associated with the current thread.
 *
 * @author Mark Little (mark@arjuna.com)
 * @version $Id: NoTransaction.java,v 1.1 2002/11/25 11:00:53 nmcl Exp $
 * @since 1.0.
 */

public class NoTransaction implements Status
{

    public static NoTransaction instance ()
    {
	return _instance;
    }

    public String toString ()
    {
	return "Status.NoTransaction";
    }

    private NoTransaction ()
    {
    }

    private static final NoTransaction _instance = new NoTransaction();

}


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
      class Whatsapp_buffer_in extends My_Model {
          function __construct()
          {
              parent::__construct("whatsapp_buffer_in");
          }
          function plain($values){
              try {
                  $i=0;
                  //$records=getRecords($this,$values);
                  $where="WHERE ".$values["where"];
                  $where.=" AND type IN ('receive','send') ";
                  $groupby=" GROUP BY [description],username,phonenumber";
                  $order=" ORDER BY username";
                  $sql="SELECT count(id) as total,[description],username,phonenumber FROM ".$this->model." ".$where." ".$groupby." ".$order;
                  $records["records"]=getRecordsAdHoc($this,$sql);
                  foreach($records["records"] as $row) {
                      $sql="SELECT * FROM ".$this->model." ".$where." AND phonenumber='".$row["phonenumber"]."' ORDER BY received ASC";
                      $children=getRecordsAdHoc($this,$sql);
                      $records["records"][$i]["children"]=$children;
                      $message="";
                      $received="";
                      $id_contact_channel=0;
                      $id="";
                      foreach($children as $child) {
                          $id.=$child["id"]."-";
                          $message.=$child["message"]."<br/>";
                          $received=$child["received"];
                          $id_contact_channel=$child["id_contact_channel"];
                      }
                      $records["records"][$i]["id"]=$id;
                      $records["records"][$i]["message"]=$message;
                      $records["records"][$i]["received"]=$received;
                      $records["records"][$i]["id_contact_channel"]=$id_contact_channel;
                      $i+=1;
                  }
                  $this->records=$records;
                  return $this->records;
              }
              catch(Exception $e) {
                  return null;
              }
          }

          function expandToUser($values) {
              try {
                  $arrData=array("TelefonoCelular"=>$values["user_id"]);
                  generalUpdater("Clientes",$arrData,"idCliente=".$values["id_client_credipaz"],$this);
                  return array("status"=>"AK","message"=>"N/A");
              }
              catch(Exception $e) {
                  return array("status"=>"ERROR","message"=>$e->getMessage());
              }
          }
      }


text:
<!-- Stored in resources/views/layouts/app.blade.php -->

<html>
<head>
    <title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
    This is the master sidebar.
@show

<div class="container">
    @yield('content')
</div>
</body>
</html>


text:
//Provides class sap.ui.model.odata.v4.lib._MetadataRequestor
sap.ui.define([
	"jquery.sap.global",
	"./_Helper",
	"./_V2MetadataConverter",
	"./_V4MetadataConverter"
], function (jQuery, _Helper, _V2MetadataConverter, _V4MetadataConverter) {
	"use strict";

	return {
		/**
		 * Creates a requestor for metadata documents.
		 * @param {object} mHeaders
		 *   A map of headers
		 * @param {string} sODataVersion
		 *   The version of the OData service. Supported values are "2.0" and "4.0".
		 * @param {object} [mQueryParams={}]
		 *   A map of query parameters as described in {@link _Helper.buildQuery}
		 * @returns {object}
		 *   A new MetadataRequestor object
		 */
		create : function (mHeaders, sODataVersion, mQueryParams) {
			var sQueryStr = _Helper.buildQuery(mQueryParams);

			return {
				/**
				 * Reads a metadata document from the given URL.
				 * @param {string} sUrl
				 *   The URL of a metadata document, it must not contain a query string or a
				 *   fragment part
				 * @param {boolean} [bAnnotations=false]
				 *   true if an additional annotation file is read, otherwise it is
				 *   expected to be a metadata document in the correct OData version
				 * @returns {Promise}
				 *   A promise fulfilled with the metadata as a JSON object, enriched with a
				 *   "$LastModified" property that contains the value of the response header
				 *   "Last-Modified" (or, as a fallback, "Date"); the "$LastModified" property is
				 *   missing if there is no such header
				 */
				read : function (sUrl, bAnnotations) {
					return new Promise(function (fnResolve, fnReject) {
						jQuery.ajax(bAnnotations ? sUrl : sUrl + sQueryStr, {
							method : "GET",
							headers : mHeaders
						})
						.then(function (oData, sTextStatus, jqXHR) {
							var oConverter = sODataVersion === "4.0" || bAnnotations
									? _V4MetadataConverter : _V2MetadataConverter,
								oJSON = oConverter.convertXMLMetadata(oData, sUrl),
								sLastModified = jqXHR.getResponseHeader("Last-Modified")
									|| jqXHR.getResponseHeader("Date");

							if (sLastModified) {
								oJSON.$LastModified = sLastModified;
							}
							fnResolve(oJSON);
						}, function (jqXHR, sTextStatus, sErrorMessage) {
							var oError = _Helper.createError(jqXHR);

							jQuery.sap.log.error("GET " + sUrl, oError.message,
								"sap.ui.model.odata.v4.lib._MetadataRequestor");
							fnReject(oError);
						});
					});
				}
			};
		}
	};
}, /* bExport= */false);


text:
/*
    Part of this file were copied from the Chart.js project (http://chartjs.org/)
    and translated into C++.

    The files of the Chart.js project have the following copyright and license.

    Copyright (c) 2013-2016 Nick Downie
    Released under the MIT license
    https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/

/// @file

#ifndef _WX_CHARTS_WXLINECHART_H_
#define _WX_CHARTS_WXLINECHART_H_

#include "wxcharts_export.h"

#include "wxchart.h"
#include "wxchartscategoricaldata.h"
#include "wxlinechartoptions.h"
#include "wxchartsgrid.h"
#include "wxchartspoint.h"
#include <wx/sharedptr.h>

enum wxChartsLineType
{
    wxCHARTSLINETYPE_STRAIGHT,
    wxCHARTSLINETYPE_STEPPED
};

/// A line chart.

/// \ingroup chartclasses
class WXCHARTS_EXPORT wxLineChart : public wxChart
{
public:
    wxLineChart(wxChartsCategoricalData::ptr &data, const wxChartsLineType &lineType,
        const wxSize &size);
    wxLineChart(wxChartsCategoricalData::ptr &data, const wxChartsLineType &lineType,
        const wxLineChartOptions &options, const wxSize &size);

    virtual const wxChartCommonOptions& GetCommonOptions() const;

    void Save(const wxString &filename, const wxBitmapType &type,
        const wxSize &size, const wxColor &backgroundColor);

private:
    void Initialize(wxChartsCategoricalData::ptr &data);
    static wxDouble GetMinValue(const wxVector<wxChartsDoubleDataset::ptr>& datasets);
    static wxDouble GetMaxValue(const wxVector<wxChartsDoubleDataset::ptr>& datasets);

    virtual void DoSetSize(const wxSize &size);
    virtual void DoFit();
    virtual void DoDraw(wxGraphicsContext &gc, bool suppressTooltips);
    virtual wxSharedPtr<wxVector<const wxChartsElement*>> GetActiveElements(const wxPoint &point);

private:
    class Point : public wxChartsPoint
    {
    public:
        typedef wxSharedPtr<Point> ptr;

        Point(wxDouble value,
            const wxSharedPtr<wxChartTooltipProvider> tooltipProvider,
            wxDouble x, wxDouble y, wxDouble radius,
            unsigned int strokeWidth, const wxColor &strokeColor,
            const wxColor &fillColor, wxDouble hitDetectionRange);

        virtual bool HitTest(const wxPoint &point) const;

        wxDouble GetValue() const;

    private:
        wxDouble m_value;
        wxDouble m_hitDetectionRange;
    };

    class Dataset
    {
    public:
        typedef wxSharedPtr<Dataset> ptr;

        Dataset(bool showDots, bool showLine, const wxColor &lineColor,
                bool fill, const wxColor &fillColor,
                const wxChartsLineType &lineType);

        bool ShowDots() const;
        bool ShowLine() const;
        const wxColor& GetLineColor() const;
        bool Fill() const;
        const wxColor& GetFillColor() const;
        const wxChartsLineType& GetType() const;

        const wxVector<Point::ptr>& GetPoints() const;
        void AppendPoint(Point::ptr point);

    private:
        bool m_showDots;
        bool m_showLine;
        wxColor m_lineColor;
        bool m_fill;
        wxColor m_fillColor;
        wxChartsLineType m_type;
        wxVector<Point::ptr> m_points;
    };

private:
    wxSharedPtr<wxLineChartOptions> m_options;
    wxChartsGrid m_grid;
    wxVector<Dataset::ptr> m_datasets;
    wxChartsLineType m_lineType;
};

#endif


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
J. Bot. , London 49: 61 (1911)

#### Original name
Licea castanea G. Lister, 1911

### Remarks
null


text:
package scoverage.reporter

import java.io.File

import scoverage.domain.Coverage
import scoverage.serialize.Serializer

object CoverageAggregator {

  // to be used by gradle-scoverage plugin
  def aggregate(dataDirs: Array[File], sourceRoot: File): Option[Coverage] =
    aggregate(
      dataDirs.toSeq,
      sourceRoot
    )

  def aggregate(dataDirs: Seq[File], sourceRoot: File): Option[Coverage] = {
    println(
      s"[info] Found ${dataDirs.size} subproject scoverage data directories [${dataDirs.mkString(",")}]"
    )
    if (dataDirs.size > 0) {
      Some(aggregatedCoverage(dataDirs, sourceRoot))
    } else {
      None
    }
  }

  def aggregatedCoverage(dataDirs: Seq[File], sourceRoot: File): Coverage = {
    var id = 0
    val coverage = Coverage()
    dataDirs foreach { dataDir =>
      val coverageFile: File = Serializer.coverageFile(dataDir)
      if (coverageFile.exists) {
        val subcoverage: Coverage =
          Serializer.deserialize(coverageFile, sourceRoot)
        val measurementFiles: Array[File] =
          IOUtils.findMeasurementFiles(dataDir)
        val measurements = IOUtils.invoked(measurementFiles.toIndexedSeq)
        subcoverage.apply(measurements)
        subcoverage.statements foreach { stmt =>
          // need to ensure all the ids are unique otherwise the coverage object will have stmt collisions
          id = id + 1
          coverage add stmt.copy(id = id)
        }
      }
    }
    coverage
  }
}


text:
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using BoardUtils;
namespace ChinaChess {

	public enum PieceColor {Red=1, Black};
	public static class PieceColorExtensions {
		public static PieceColor Opposite(this PieceColor color) {
			return color == PieceColor.Red ? PieceColor.Black : PieceColor.Red;
		}
	}

	public enum PieceCode {Rook=1,Knight,Elephant,Mandarin,King,Connon,Pawn};

	public class Piece {
		public static bool ValidId(int id) {
			return (1 <= id && id <= 7) || (11 <= id && id <= 17);
		}
		public static int ToId(PieceColor color, PieceCode code) {
			return (int)(code) + (color == PieceColor.Black ? 10 : 0);
		}

		int id;
		public Piece (int id) {
			if (!ValidId (id)) {
				throw new System.ArgumentException();
			}
			this.id = id;
		}
		public int Id {
			get {
				return id;
			}
		}
		public PieceColor Color {
			get {
				return id < 10 ? PieceColor.Red : PieceColor.Black;
			}
		}
		public PieceCode Code {
			get {
				return (PieceCode)(id % 10);
			}
		}
	}
}


text:
import { IBufferService, ICoreService, ICoreMouseService } from 'common/services/Services';
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { ICoreMouseProtocol, ICoreMouseEvent, CoreMouseEncoding, CoreMouseEventType, CoreMouseButton, CoreMouseAction } from 'common/Types';
import { Disposable } from 'common/Lifecycle';

/**
 * Supported default protocols.
 */
const DEFAULT_PROTOCOLS: { [key: string]: ICoreMouseProtocol } = {
  /**
   * NONE
   * Events: none
   * Modifiers: none
   */
  NONE: {
    events: CoreMouseEventType.NONE,
    restrict: () => false
  },
  /**
   * X10
   * Events: mousedown
   * Modifiers: none
   */
  X10: {
    events: CoreMouseEventType.DOWN,
    restrict: (e: ICoreMouseEvent) => {
      // no wheel, no move, no up
      if (e.button === CoreMouseButton.WHEEL || e.action !== CoreMouseAction.DOWN) {
        return false;
      }
      // no modifiers
      e.ctrl = false;
      e.alt = false;
      e.shift = false;
      return true;
    }
  },
  /**
   * VT200
   * Events: mousedown / mouseup / wheel
   * Modifiers: all
   */
  VT200: {
    events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL,
    restrict: (e: ICoreMouseEvent) => {
      // no move
      if (e.action === CoreMouseAction.MOVE) {
        return false;
      }
      return true;
    }
  },
  /**
   * DRAG
   * Events: mousedown / mouseup / wheel / mousedrag
   * Modifiers: all
   */
  DRAG: {
    events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL | CoreMouseEventType.DRAG,
    restrict: (e: ICoreMouseEvent) => {
      // no move without button
      if (e.action === CoreMouseAction.MOVE && e.button === CoreMouseButton.NONE) {
        return false;
      }
      return true;
    }
  },
  /**
   * ANY
   * Events: all mouse related events
   * Modifiers: all
   */
  ANY: {
    events:
      CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL
      | CoreMouseEventType.DRAG | CoreMouseEventType.MOVE,
    restrict: (e: ICoreMouseEvent) => true
  }
};

const enum Modifiers {
  SHIFT = 4,
  ALT = 8,
  CTRL = 16
}

// helper for default encoders to generate the event code.
function eventCode(e: ICoreMouseEvent, isSGR: boolean): number {
  let code = (e.ctrl ? Modifiers.CTRL : 0) | (e.shift ? Modifiers.SHIFT : 0) | (e.alt ? Modifiers.ALT : 0);
  if (e.button === CoreMouseButton.WHEEL) {
    code |= 64;
    code |= e.action;
  } else {
    code |= e.button & 3;
    if (e.button & 4) {
      code |= 64;
    }
    if (e.button & 8) {
      code |= 128;
    }
    if (e.action === CoreMouseAction.MOVE) {
      code |= CoreMouseAction.MOVE;
    } else if (e.action === CoreMouseAction.UP && !isSGR) {
      // special case - only SGR can report button on release
      // all others have to go with NONE
      code |= CoreMouseButton.NONE;
    }
  }
  return code;
}

const S = String.fromCharCode;

/**
 * Supported default encodings.
 */
const DEFAULT_ENCODINGS: { [key: string]: CoreMouseEncoding } = {
  /**
   * DEFAULT - CSI M Pb Px Py
   * Single byte encoding for coords and event code.
   * Can encode values up to 223 (1-based).
   */
  DEFAULT: (e: ICoreMouseEvent) => {
    const params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];
    // supress mouse report if we exceed addressible range
    // Note this is handled differently by emulators
    // - xterm:         sends 0;0 coords instead
    // - vte, konsole:  no report
    if (params[0] > 255 || params[1] > 255 || params[2] > 255) {
      return '';
    }
    return `\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;
  },
  /**
   * SGR - CSI < Pb ; Px ; Py M|m
   * No encoding limitation.
   * Can report button on release and works with a well formed sequence.
   */
  SGR: (e: ICoreMouseEvent) => {
    const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';
    return `\x1b[<${eventCode(e, true)};${e.col};${e.row}${final}`;
  },
  SGR_PIXELS: (e: ICoreMouseEvent) => {
    const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';
    return `\x1b[<${eventCode(e, true)};${e.x};${e.y}${final}`;
  }
};

/**
 * CoreMouseService
 *
 * Provides mouse tracking reports with different protocols and encodings.
 *  - protocols: NONE (default), X10, VT200, DRAG, ANY
 *  - encodings: DEFAULT, SGR (UTF8, URXVT removed in #2507)
 *
 * Custom protocols/encodings can be added by `addProtocol` / `addEncoding`.
 * To activate a protocol/encoding, set `activeProtocol` / `activeEncoding`.
 * Switching a protocol will send a notification event `onProtocolChange`
 * with a list of needed events to track.
 *
 * The service handles the mouse tracking state and decides whether to send
 * a tracking report to the backend based on protocol and encoding limitations.
 * To send a mouse event call `triggerMouseEvent`.
 */
export class CoreMouseService extends Disposable implements ICoreMouseService {
  private _protocols: { [name: string]: ICoreMouseProtocol } = {};
  private _encodings: { [name: string]: CoreMouseEncoding } = {};
  private _activeProtocol: string = '';
  private _activeEncoding: string = '';
  private _lastEvent: ICoreMouseEvent | null = null;

  private readonly _onProtocolChange = this.register(new EventEmitter<CoreMouseEventType>());
  public readonly onProtocolChange =  this._onProtocolChange.event;

  constructor(
    @IBufferService private readonly _bufferService: IBufferService,
    @ICoreService private readonly _coreService: ICoreService
  ) {
    super();
    // register default protocols and encodings
    for (const name of Object.keys(DEFAULT_PROTOCOLS)) this.addProtocol(name, DEFAULT_PROTOCOLS[name]);
    for (const name of Object.keys(DEFAULT_ENCODINGS)) this.addEncoding(name, DEFAULT_ENCODINGS[name]);
    // call reset to set defaults
    this.reset();
  }

  public addProtocol(name: string, protocol: ICoreMouseProtocol): void {
    this._protocols[name] = protocol;
  }

  public addEncoding(name: string, encoding: CoreMouseEncoding): void {
    this._encodings[name] = encoding;
  }

  public get activeProtocol(): string {
    return this._activeProtocol;
  }

  public get areMouseEventsActive(): boolean {
    return this._protocols[this._activeProtocol].events !== 0;
  }

  public set activeProtocol(name: string) {
    if (!this._protocols[name]) {
      throw new Error(`unknown protocol "${name}"`);
    }
    this._activeProtocol = name;
    this._onProtocolChange.fire(this._protocols[name].events);
  }

  public get activeEncoding(): string {
    return this._activeEncoding;
  }

  public set activeEncoding(name: string) {
    if (!this._encodings[name]) {
      throw new Error(`unknown encoding "${name}"`);
    }
    this._activeEncoding = name;
  }

  public reset(): void {
    this.activeProtocol = 'NONE';
    this.activeEncoding = 'DEFAULT';
    this._lastEvent = null;
  }

  /**
   * Triggers a mouse event to be sent.
   *
   * Returns true if the event passed all protocol restrictions and a report
   * was sent, otherwise false. The return value may be used to decide whether
   * the default event action in the bowser component should be omitted.
   *
   * Note: The method will change values of the given event object
   * to fullfill protocol and encoding restrictions.
   */
  public triggerMouseEvent(e: ICoreMouseEvent): boolean {
    // range check for col/row
    if (e.col < 0 || e.col >= this._bufferService.cols
      || e.row < 0 || e.row >= this._bufferService.rows) {
      return false;
    }

    // filter nonsense combinations of button + action
    if (e.button === CoreMouseButton.WHEEL && e.action === CoreMouseAction.MOVE) {
      return false;
    }
    if (e.button === CoreMouseButton.NONE && e.action !== CoreMouseAction.MOVE) {
      return false;
    }
    if (e.button !== CoreMouseButton.WHEEL && (e.action === CoreMouseAction.LEFT || e.action === CoreMouseAction.RIGHT)) {
      return false;
    }

    // report 1-based coords
    e.col++;
    e.row++;

    // debounce move events at grid or pixel level
    if (e.action === CoreMouseAction.MOVE
      && this._lastEvent
      && this._equalEvents(this._lastEvent, e, this._activeEncoding === 'SGR_PIXELS')
    ) {
      return false;
    }

    // apply protocol restrictions
    if (!this._protocols[this._activeProtocol].restrict(e)) {
      return false;
    }

    // encode report and send
    const report = this._encodings[this._activeEncoding](e);
    if (report) {
      // always send DEFAULT as binary data
      if (this._activeEncoding === 'DEFAULT') {
        this._coreService.triggerBinaryEvent(report);
      } else {
        this._coreService.triggerDataEvent(report, true);
      }
    }

    this._lastEvent = e;

    return true;
  }

  public explainEvents(events: CoreMouseEventType): { [event: string]: boolean } {
    return {
      down: !!(events & CoreMouseEventType.DOWN),
      up: !!(events & CoreMouseEventType.UP),
      drag: !!(events & CoreMouseEventType.DRAG),
      move: !!(events & CoreMouseEventType.MOVE),
      wheel: !!(events & CoreMouseEventType.WHEEL)
    };
  }

  private _equalEvents(e1: ICoreMouseEvent, e2: ICoreMouseEvent, pixels: boolean): boolean {
    if (pixels) {
      if (e1.x !== e2.x) return false;
      if (e1.y !== e2.y) return false;
    } else {
      if (e1.col !== e2.col) return false;
      if (e1.row !== e2.row) return false;
    }
    if (e1.button !== e2.button) return false;
    if (e1.action !== e2.action) return false;
    if (e1.ctrl !== e2.ctrl) return false;
    if (e1.alt !== e2.alt) return false;
    if (e1.shift !== e2.shift) return false;
    return true;
  }
}


text:
package io.siddhi.core.util.cache;

import io.siddhi.core.config.SiddhiAppContext;
import io.siddhi.core.config.SiddhiQueryContext;
import io.siddhi.core.event.ComplexEventChunk;
import io.siddhi.core.event.state.MetaStateEvent;
import io.siddhi.core.event.state.StateEvent;
import io.siddhi.core.event.stream.MetaStreamEvent;
import io.siddhi.core.event.stream.StreamEvent;
import io.siddhi.core.event.stream.StreamEventFactory;
import io.siddhi.core.exception.ConnectionUnavailableException;
import io.siddhi.core.exception.SiddhiAppRuntimeException;
import io.siddhi.core.executor.VariableExpressionExecutor;
import io.siddhi.core.table.CacheTable;
import io.siddhi.core.table.InMemoryTable;
import io.siddhi.core.table.Table;
import io.siddhi.core.table.record.AbstractQueryableRecordTable;
import io.siddhi.core.util.collection.operator.CompiledCondition;
import io.siddhi.core.util.collection.operator.MatchingMetaInfoHolder;
import io.siddhi.core.util.parser.MatcherParser;
import io.siddhi.query.api.definition.Attribute;
import io.siddhi.query.api.definition.TableDefinition;
import io.siddhi.query.api.expression.Expression;
import io.siddhi.query.api.expression.Variable;
import io.siddhi.query.api.expression.condition.Compare;
import io.siddhi.query.api.expression.constant.LongConstant;
import io.siddhi.query.api.expression.math.Subtract;
import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import static io.siddhi.core.util.SiddhiConstants.CACHE_EXPIRE_CURRENT_TIME;
import static io.siddhi.core.util.SiddhiConstants.CACHE_TABLE_TIMESTAMP_ADDED;
import static io.siddhi.core.util.cache.CacheUtils.findEventChunkSize;

/**
 * this class has a runnable which runs on a separate thread called by AbstractQueryableRecordTable and handles cache
 * expiry
 */
public class CacheExpirer {
    private static final Logger log = Logger.getLogger(CacheExpirer.class);
    private InMemoryTable cacheTable;
    private StreamEventFactory streamEventFactory;
    private Map<String, Table> tableMap;
    private AbstractQueryableRecordTable storeTable;
    private SiddhiAppContext siddhiAppContext;
    private long retentionPeriod;
    private ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    private CompiledCondition cacheExpiryCompiledCondition;

    public CacheExpirer(long retentionPeriod, InMemoryTable cacheTable, Map<String, Table> tableMap,
                        AbstractQueryableRecordTable storeTable, SiddhiAppContext siddhiAppContext) {
        this.cacheTable = cacheTable;
        this.tableMap = tableMap;
        this.storeTable = storeTable;
        this.siddhiAppContext = siddhiAppContext;
        this.retentionPeriod = retentionPeriod;
        this.cacheExpiryCompiledCondition = generateExpiryCompiledCondition();
    }

    private ComplexEventChunk<StateEvent> generateDeleteEventChunk() {
        ComplexEventChunk<StateEvent> deleteEventChunk = new ComplexEventChunk<>();
        StateEvent stateEvent = new StateEvent(2, 0);
        StreamEvent deletingEvent = streamEventFactory.newInstance();
        deletingEvent.setOutputData(new Object[]{siddhiAppContext.getTimestampGenerator().currentTime()});
        stateEvent.addEvent(0, deletingEvent);
        deleteEventChunk.add(stateEvent);
        return deleteEventChunk;
    }

    private CompiledCondition generateExpiryCompiledCondition() {
        MetaStreamEvent tableMetaStreamEvent = new MetaStreamEvent();
        tableMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);
        TableDefinition matchingTableDefinition = TableDefinition.id(cacheTable.getTableDefinition().getId());
        for (Attribute attribute : cacheTable.getTableDefinition().getAttributeList()) {
            tableMetaStreamEvent.addOutputData(attribute);
            matchingTableDefinition.attribute(attribute.getName(), attribute.getType());
        }
        tableMetaStreamEvent.addInputDefinition(matchingTableDefinition);
        streamEventFactory = new StreamEventFactory(tableMetaStreamEvent);

        Variable rightExpressionForSubtract = new Variable(CACHE_TABLE_TIMESTAMP_ADDED);
        rightExpressionForSubtract.setStreamId(cacheTable.getTableDefinition().getId());
        Expression rightExpressionForCompare = new LongConstant(retentionPeriod);
        Compare.Operator greaterThanOperator = Compare.Operator.GREATER_THAN;

        MetaStreamEvent currentTimeMetaStreamEvent = new MetaStreamEvent();
        currentTimeMetaStreamEvent.setEventType(MetaStreamEvent.EventType.TABLE);
        Attribute currentTimeAttribute = new Attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);
        currentTimeMetaStreamEvent.addOutputData(currentTimeAttribute);
        TableDefinition currentTimeTableDefinition = TableDefinition.id("");
        currentTimeTableDefinition.attribute(CACHE_EXPIRE_CURRENT_TIME, Attribute.Type.LONG);
        currentTimeMetaStreamEvent.addInputDefinition(currentTimeTableDefinition);

        MetaStateEvent metaStateEvent = new MetaStateEvent(2);
        metaStateEvent.addEvent(currentTimeMetaStreamEvent);
        metaStateEvent.addEvent(tableMetaStreamEvent);

        MatchingMetaInfoHolder matchingMetaInfoHolder =
                MatcherParser.constructMatchingMetaStateHolder(metaStateEvent, 0,
                        cacheTable.getTableDefinition(), 0);
        List<VariableExpressionExecutor> variableExpressionExecutors = new ArrayList<>();
        Expression leftExpressionForSubtract = new Variable(CACHE_EXPIRE_CURRENT_TIME);
        Expression leftExpressionForCompare = new Subtract(leftExpressionForSubtract, rightExpressionForSubtract);
        Expression deleteCondition = new Compare(leftExpressionForCompare, greaterThanOperator,
                rightExpressionForCompare);
        SiddhiQueryContext siddhiQueryContext = new SiddhiQueryContext(siddhiAppContext, "expiryDeleteQuery");
        return cacheTable.compileCondition(deleteCondition, matchingMetaInfoHolder, variableExpressionExecutors,
                tableMap, siddhiQueryContext);
    }

    private void handleCacheExpiry() {
        log.debug(siddhiAppContext.getName() + ": CacheExpirer started");
        StateEvent stateEventForCaching = new StateEvent(1, 0);
        StreamEvent loadedDataFromStore;

        if (storeTable.getStoreTableSize() != -1 && storeTable.getStoreSizeLastCheckedTime() >
                        siddhiAppContext.getTimestampGenerator().currentTime() - retentionPeriod * 10) {
            if (log.isDebugEnabled()) {
                log.debug(siddhiAppContext.getName() + ": checking size of store table");
            }
            try {
            if (storeTable.getStoreTableSize() <= storeTable.getMaxCacheSize()) {
                AbstractQueryableRecordTable.queryStoreWithoutCheckingCache.set(Boolean.TRUE);
                try {
                    if (storeTable.getCacheLastReloadTime() < siddhiAppContext.getTimestampGenerator().currentTime() +
                            retentionPeriod) {
                        loadedDataFromStore = storeTable.query(stateEventForCaching,
                                storeTable.getCompiledConditionForCaching(),
                                storeTable.getCompiledSelectionForCaching(), storeTable.
                                        getOutputAttributesForCaching());
                        clearCacheAndReload(loadedDataFromStore);
                        storeTable.setCacheLastReloadTime(siddhiAppContext.getTimestampGenerator().currentTime());
                    }
                } finally {
                    AbstractQueryableRecordTable.queryStoreWithoutCheckingCache.set(Boolean.FALSE);
                }
            } else {
                cacheTable.delete(generateDeleteEventChunk(), cacheExpiryCompiledCondition);
            }
            } catch (ConnectionUnavailableException e) {
                throw new SiddhiAppRuntimeException(siddhiAppContext.getName() + ": " + e.getMessage());
            }
        } else {
            readWriteLock.writeLock().lock();
            try {
                AbstractQueryableRecordTable.queryStoreWithoutCheckingCache.set(Boolean.TRUE);
                try {
                    loadedDataFromStore = storeTable.query(stateEventForCaching,
                            storeTable.getCompiledConditionForCaching(),
                            storeTable.getCompiledSelectionForCaching(), storeTable.getOutputAttributesForCaching());
                    storeTable.setStoreTableSize(findEventChunkSize(loadedDataFromStore));
                    storeTable.setStoreSizeLastCheckedTime(siddhiAppContext.getTimestampGenerator().currentTime());
                } finally {
                    AbstractQueryableRecordTable.queryStoreWithoutCheckingCache.set(Boolean.FALSE);
                }
                if (storeTable.getStoreTableSize() <= storeTable.getMaxCacheSize()) {
                    if (storeTable.getCacheLastReloadTime() < siddhiAppContext.getTimestampGenerator().currentTime() +
                            retentionPeriod) {
                        clearCacheAndReload(loadedDataFromStore);
                        storeTable.setCacheLastReloadTime(siddhiAppContext.getTimestampGenerator().currentTime());
                    }
                } else {
                    cacheTable.delete(generateDeleteEventChunk(), cacheExpiryCompiledCondition);
                }
            } catch (Exception e) {
                throw new SiddhiAppRuntimeException(siddhiAppContext.getName() + ": " + e.getMessage());
            } finally {
                readWriteLock.writeLock().unlock();
            }
        }
        log.debug(siddhiAppContext.getName() + ": CacheExpirer ended");
    }

    private void clearCacheAndReload(StreamEvent loadedDataFromStore) {
        readWriteLock.writeLock().lock();
        try {
            ((CacheTable) cacheTable).deleteAll();
            if (loadedDataFromStore != null) {
                ((CacheTable) cacheTable).addStreamEventUptoMaxSize(loadedDataFromStore);
            }
        } finally {
            readWriteLock.writeLock().unlock();
        }
    }

    public Runnable generateCacheExpirer() {
        class CheckAndExpireCache implements Runnable {

            public CheckAndExpireCache() {
            }

            @Override
            public void run() {
                try {
                    handleCacheExpiry();
                } catch (Exception e) {
                    throw new SiddhiAppRuntimeException(siddhiAppContext.getName() + ": " + e.getMessage());
                }
            }
        }
        return new CheckAndExpireCache();
    }
}


text:
#include <aws/medialive/model/InputDestination.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace MediaLive
{
namespace Model
{

InputDestination::InputDestination() :
    m_ipHasBeenSet(false),
    m_portHasBeenSet(false),
    m_urlHasBeenSet(false)
{
}

InputDestination::InputDestination(JsonView jsonValue) :
    m_ipHasBeenSet(false),
    m_portHasBeenSet(false),
    m_urlHasBeenSet(false)
{
  *this = jsonValue;
}

InputDestination& InputDestination::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("ip"))
  {
    m_ip = jsonValue.GetString("ip");

    m_ipHasBeenSet = true;
  }

  if(jsonValue.ValueExists("port"))
  {
    m_port = jsonValue.GetString("port");

    m_portHasBeenSet = true;
  }

  if(jsonValue.ValueExists("url"))
  {
    m_url = jsonValue.GetString("url");

    m_urlHasBeenSet = true;
  }

  return *this;
}

JsonValue InputDestination::Jsonize() const
{
  JsonValue payload;

  if(m_ipHasBeenSet)
  {
   payload.WithString("ip", m_ip);

  }

  if(m_portHasBeenSet)
  {
   payload.WithString("port", m_port);

  }

  if(m_urlHasBeenSet)
  {
   payload.WithString("url", m_url);

  }

  return payload;
}

} // namespace Model
} // namespace MediaLive
} // namespace Aws


text:
  Le Manoir est
      une commune située dans le département de l'Eure en Haute-Normandie. Elle totalisait 1 226 habitants en 2008.

Le parc d'habitations, à Le Manoir, se décomposait en 2011 en 140 appartements et 386 maisons soit
 un marché relativement équilibré.

La commune propose quelques  aménagements, elle dispose, entre autres, de un terrain de tennis, un terrain de sport et un équipement de roller/skate.

À proximité de Le Manoir sont situées les communes de
Alizay située à 2 km, 1 349 habitants,
Pont-de-l'Arche située à 3 km, 3 898 habitants,
Quévreville-la-Poterie à 4 km, 935 habitants,
Ymare située à 4 km, 1 104 habitants,
Igoville à 3 km, 1 477 habitants,
Léry située à 3 km, 2 066 habitants,
 entre autres. De plus, Le Manoir est située à seulement 16 km de Rouen.

À Le Manoir, le prix moyen à l'achat d'un appartement s'évalue à 957 € du m² en vente. Le prix moyen d'une maison à l'achat se situe à 1 765 € du m². À la location la valorisation moyenne se situe à 7,12 € du m² mensuel.


text:
var App = require("/core");
var Api = require("/api");
var args = arguments[0] || {};

$.call = args.call;
$.store = args.store;
$.callPromos = [];

var counter = 0;
var clearText = "-Clear-";

var lastView;
var lastItem;
var feets;

// Ti.API.info(args.uiEnabled);
if(args && (args.uiEnabled != null) && !args.uiEnabled){
	$.content.touchEnabled = false;
}

function init(){
		if($.call){
			loadMadtop($.call.get("CallMadtop"));
		}
}

showView("m");
// var mResetValues = ["Dog", "Cat", "Both"];
// var aPop = [1,2,3,4,5,6,7,8,9,10];
// var aShow = ["Trade","Consumer","Distributor"];
// var aRecomp =  ["Yes", "No"];
// var dOrderValues = ["Dog", "Cat", "Both"];
// var tSeminarValues = ["Planned", "Unplanned"];
// var tTrainingValues = ["Breed Club", "Training"];
// var oObjectivesValues = ["0/1", "0/2", "0/3", "1/1", "1/2", "1/3", "2/2", "2/3", "3/3"];
// var oRideValues = ["Yes", "No"];

exports.save = saveInformation;

var availableOptions = [];
availableOptions["mReset"]  	= [{title: clearText, data: null},{title: "Dog", data: "1"}, {title: "Cat", data: "2"}, {title: "Both", data: "3"}];
availableOptions["mEndcap"]		= [{title: clearText, data: null},{title:"1", data: "1"}, {title:"2", data: "2"}, {title:"3", data: "3"}, {title:"4", data: "4"}, {title:"5", data: "5"} ];
availableOptions["mOffshelf"]	= [{title: clearText, data: null},{data:"001", title:"1"},{data:"002",title:"2"},{data:"003",title:"3"},{data:"004",title:"4"},{data:"005",title:"5"},{data:"006",title:"6"},{data:"007",title:"7"},{data:"008",title:"8"},{data:"009",title:"9"},{data:"010",title:"10"},{data:"011",title:"11"},{data:"012",title:"12"},{data:"013",title:"13"},{data:"014",title:"14"},{data:"015",title:"15"},{data:"016",title:"16"},{data:"017",title:"17"},{data:"018",title:"18"},{data:"019",title:"19"},{data:"020",title:"20"} ];
availableOptions["aPop"]		= [{title: clearText, data: null},{title: "1", data: "001"}, {title: "2", data: "002"}, {title: "3", data: "003"}, {title: "4", data: "004"}, {title: "5", data: "005"}, {title: "6", data: "006"}, {title: "7", data: "007"}, {title: "8", data: "008"}, {title: "9", data: "009"}, {title: "10", data: "010"}, {title: "11", data: "011"}, {title: "12", data: "012"}, {title: "13", data: "013"}, {title: "14", data: "014"}, {title: "15", data: "015"}, {title: "16", data: "016"}, {title: "17", data: "017"}, {title: "18", data: "018"}, {title: "19", data: "019"}, {title: "20", data: "020"}];
availableOptions["aShow"]		= [{title: clearText, data: null},{title: "Trade", data: "0"}, {title: "Consumer", data: "1"}, {title: "Distributor", data: "2"}];
availableOptions["aRecomp"] 	= [{title: clearText, data: null},{title:"No", data: "0"},{title:"Yes", data: "1"}];
availableOptions["dOrder"]		= [{title: clearText, data: null},{title:"Dog", data: "1"}, {title:  "Cat", data: "2"}, {title:  "Both",data: "3"}];
availableOptions["dSku"]		= [{title: clearText, data: null},{data:"001", title:"1"},{data:"002",title:"2"},{data:"003",title:"3"},{data:"004",title:"4"},{data:"005",title:"5"},{data:"006",title:"6"},{data:"007",title:"7"},{data:"008",title:"8"},{data:"009",title:"9"}];
availableOptions["tAttendees"]	= [{title: clearText, data: null},{title:"2", data: "02"}, {title:"3", data: "03"}, {title:"4", data: "04"}, {title:"5", data: "05"}, {title:"6", data: "06"}, {title:"7", data: "07"}, {title:"8", data: "08"}, {title:"9", data: "09"}, {title:"10", data: "10"}, {title:"10+", data: "11"}];
availableOptions["tSeminar"]	= [{title: clearText, data: null},{title:"PrePlanned", data: "1"},{title: "Unplanned", data: "2"}];
availableOptions["tTraining"]	= [{title: clearText, data: null},{title:"Breed Club", data: "0"}, {title: "Training", data: "1"}];
availableOptions["oObjectives"]	= [{title: clearText, data: null},{title:"0/1", data: "001"}, {title:  "0/2", data: "002"}, {title:  "0/3", data: "003"}, {title:  "1/1", data: "011"}, {title:  "1/2", data: "012"}, {title:  "1/3", data: "013"}, {title:  "2/2", data: "022" }, {title:  "2/3", data: "023"}, {title:  "3/3",data: "033"}];
availableOptions["oRide"]		= [{title: clearText, data: null},{title:"No", data: "0"},{title:"Yes", data: "1"}];

var availableObjectives = [];
availableObjectives["001"] = "0/1";
availableObjectives["002"] = "0/2";
availableObjectives["003"] = "0/3";
availableObjectives["011"] = "1/1";
availableObjectives["012"] = "1/2";
availableObjectives["013"] = "1/3";
availableObjectives["022"] = "2/2";
availableObjectives["023"] = "2/3";
availableObjectives["033"] = "3/3";
availableObjectives["000"] = " ";

$.menu.addEventListener("click", function(evt){
	var id = evt.source.action;
	id && showView(id);
});

$.content.addEventListener("click",function(e){
	switch(e.source.id){
	case "mReset":
	case "mEndcap":
	case "mOffshelf":
	case "aPop":
	case "aShow":
	case "aRecomp":
	case "dOrder":
	case "dSku":
	case "tAttendees":
	case "tSeminar":
	case "tTraining":
	case "oObjectives":
	case "oRide":
		createPopover(e.source);
		break;
	}

});
function createPopover(rcvElement){
	var previousElement = rcvElement;
	var popover = Alloy.createController("popover", {
		rows: availableOptions[rcvElement.id],
		callback: function(value, title){
		previousElement.text = title == clearText ? "" : title;
		previousElement.data = value;
	}
	});
	popover.open(rcvElement);

}
$.addPromo.addEventListener("click", function(){
	var availableCampaigns = Alloy.createCollection("campaign");

	availableCampaigns.fetch({
		source: "local",
		query : "SELECT CampaignId, VPAReference, Description, Active, UnitsToDate, Bought, NotPresented, NotAvailable, EndDate FROM campaign"	  //notbought == available?
	});

	var selectPromo = Alloy.createController("selectPromo", {
		campaigns: availableCampaigns,
		callback: function(selectedPromos){

		var alertDuplicates = false;
		for(var i in selectedPromos){
			var notAdded = true;
			for(var j = 0; j < $.callPromos.length; j++){
				if($.callPromos[j] != null){
					if(selectedPromos[i].campaign.get("CampaignId") == $.callPromos[j].get("CampaignId")){
						notAdded = false;
						alertDuplicates = true;
						j = $.callPromos.length;
					}
				}

			}
			if(notAdded){

				var selectedPromo = selectedPromos[i];
				//Newly selected promo
				var promo = new Backbone.Model({
					VPAReference: selectedPromo.campaign.get("VPAReference"),
					Campaign : selectedPromo.campaign
				});

				var promoRow = Alloy.createController("promoRow", {
					promo: promo,
					index : counter,
					callback: function(promo,index){
								updatePromo(promo,index);
							}
				});
				counter++;
				$.promo.appendRow(promoRow.getView());
			}

		}
		if(alertDuplicates){
			alert("Duplicated Promos detected, duplicated entries have been ignored.");
		}
	}
	});
	selectPromo.open();
});

$.promo.addEventListener("click", function(evt){
	var previousEvent = evt;
	if(evt.source.id === "deleteBtn"){
		hasChanged = true;
		var discardConfirmation = Titanium.UI.createAlertDialog({
			title: 'Delete',
			message: 'Do you want to remove this Promo?',
			buttonNames: ['Yes','No'],
			cancel: 1
		});
		discardConfirmation.show();
		discardConfirmation.addEventListener('click', function(e) {
			if (e.index == 0) { // clicked "YES"
				$.callPromos.splice(previousEvent.index, 1);
				$.promo.deleteRow(previousEvent.index);
			} else if (e.index == 1) { // clicked "NO"
			}
		});

	}
});

function showView (itemId) {
	var name = itemId + "_wrapper";
	lastView && lastView.hide();
	if(lastItem){
		lastItem.color = lastItem.normalColor;
		lastItem.backgroundColor = lastItem.backgroundNormalColor;
	}
	lastView = $[name];
	lastItem = $[itemId];
	lastItem.color = lastItem.selectedColor;
	lastItem.backgroundColor = lastItem.backgroundSelectedColor;
	lastView.show();
}

function loadMadtop (madtop) {

	madtop = madtop.toJSON();

	if(madtop == null){
		madtop = JSON.parse('{"Attendees":null,"BreedClub":null,"Demo":null,"Endcap":null,"New":null,"Objectives":null,"OffShelf":null,"Order":null,"Pop":null,"Promo":null,"Recommendation":null,"Reset":null,"Ride":null,"Samples":null,"Seminar":null,"Show":null,"SKU":null,"Store":null,"Trainer":null,"Training":null}');
	}

	//M
	var m = {
			offshelf: madtop.Offshelf ,
			endcap: madtop.Endcap ,
			reset: madtop.Reset
	};

	$.mOffshelf.text = m.offshelf;

	$.mEndcap.text = m.endcap;

	$.mReset.text = m.reset;

	var a = {

			recomp : 	madtop.Recommendation , //When dinamically receiving values from WS double check correct functionality
			pop : 		madtop.Pop ,
			show : 		madtop.Show   //WS decided that we need to start values in zero here and not one as any other fields
	};

	$.aRecomp.text = a.recomp;

	$.aPop.text =  a.pop;

	$.aShow.text =  a.show;

	feets = [];
	feets = [
	             {
	            	 product: "Cat Dry",
	            	 oldValue: $.store.get("CatDryLinearFeet") || 0,
	            	 modifiedValue : $.call.get("CatDryLinearFeet"),
	            	 feet: $.store.get("CatDryLinearFeet") || 0,
	            	 index : 1,
	             },
	             {
	            	 product: "Cat Can",
	            	 oldValue: $.store.get("CatCanLinearFeet")|| 0,
	            	 modifiedValue : $.call.get("CatCanLinearFeet"),
	            	 feet: $.store.get("CatCanLinearFeet")|| 0,
	            	 index : 2,
	             },
	             {
	            	 product: "Dog Dry",
	            	 oldValue: $.store.get("DogDryLinearFeet")|| 0,
	            	 modifiedValue : $.call.get("DogDryLinearFeet"),
	            	 feet: $.store.get("DogDryLinearFeet")|| 0,
	            	 index : 3,
	             },
	             {
	            	 product: "Dog Can",
	            	 oldValue: $.store.get("DogCanLinearFeet")|| 0,
	            	 modifiedValue : $.call.get("DogCanLinearFeet"),
	            	 feet: $.store.get("DogCanLinearFeet")|| 0,
	            	 index : 4,
	             },
	             {
	            	 product: "Treat",
	            	 oldValue: $.store.get("TreatLinearFeet")|| 0,
	            	 modifiedValue : $.call.get("TreatsLinearFeet"),
	            	 feet: $.store.get("TreatLinearFeet")|| 0,
	            	 index : 5,
	             }
	             ];
	$.mTotal.text = "0";

	for(var i in feets){
		var feet = feets[i];
		var footRow = Alloy.createController("footRow", {
			product: feet.product,
			feet: feet.feet,
			delta: feet.delta,
			oldValue: feet.oldValue,
			index: feets[i].index,
			modifiedValue: feets[i].modifiedValue,
			callback: function(delta){
			updateTotal(delta);
		}
		});
		feets[i] = footRow;
		var valueToAdd = 0;
		valueToAdd = feet.modifiedValue || feet.oldValue;
		$.mTotal.text = parseInt($.mTotal.text) + parseInt(valueToAdd);

		if($.feets.data.length > 0){
			$.feets.insertRowBefore( i, footRow.getView());
		}else{
			$.feets.add(footRow.getView());
		}

	}

	//D
	var d = {

			sku 	: madtop.SKU,
			order   : madtop.Order,

			dsv 	: madtop.DistributionSalesValue || 0.0,
			rsv 	: madtop.RetailSalesValue || 0.0
	};

	$.dSku.text = d.sku;

	$.dOrder.text = d.order;

	$.dsvSales.value = d.dsv ;
	$.rsvSales.value = d.rsv ;

	//T

	var	tmpAttendees;

	if( (madtop.Attendees ==  "")  || (madtop.Attendees == null) ){
		tmpAttendees = 0;
		$.tAttendees.data  = "";
	}else{
		tmpAttendees =  madtop.Attendees;
	}
	var t = {

			seminar   : madtop.Seminar ,
			attendees : tmpAttendees,
			training  : madtop.Training
	};

	$.tSeminar.text = t.seminar;

	if(t.attendees != 0){
		$.tAttendees.text  = t.attendees;
	}

	$.tTraining.text =  t.training;

	//O
	var o = {

			objectives : madtop.Objectives ,
			ride : 		 madtop.Ride
	};

	$.oObjectives.text = o.objectives;

	$.oRide.text = o.ride;

	//P
	var p = $.call.get("Promos") || new Backbone.Collection();
	p.each(function(promo){
		var promoRow = Alloy.createController("promoRow", {
			promo: promo,
			index : counter,
			callback: function(promo,index){
							updatePromo(promo,index);
						}
		});
		$.promo.appendRow(promoRow.getView());
		counter++;
	});
}

function saveInformation(rcvModifiedCall){

	tmpMadtop =  JSON.parse("{}");

	tmpMadtop.Attendees =  $.tAttendees.text ;
	tmpMadtop.Endcap    =  $.mEndcap.text;
	tmpMadtop.Objectives =  $.oObjectives.text;
	tmpMadtop.Offshelf  =  $.mOffshelf.text;
	tmpMadtop.Order     =  $.dOrder.text;
	tmpMadtop.DistributionSalesValue     =  parseFloat($.dsvSales.value);
	tmpMadtop.RetailSalesValue     		 =  parseFloat($.rsvSales.value);
	tmpMadtop.Pop       =  $.aPop.text;
	tmpMadtop.Recommendation =  $.aRecomp.text;
	tmpMadtop.Reset     =  $.mReset.text;
	tmpMadtop.Ride      = $.oRide.text ;
	tmpMadtop.Seminar   =  $.tSeminar.text;
	tmpMadtop.Show    =  $.aShow.text;
	tmpMadtop.SKU     =  $.dSku.text;
	tmpMadtop.Training  =  $.tTraining.text ;

	tmpMadtop.Store     =  $.store.get("StoreId");

	tmpMadtop.New     =  false;

	if(rcvModifiedCall != null ){
		var promosToSave = new Backbone.Collection();
		for(var i = 0; i < $.callPromos.length ; i++){
			if($.callPromos[i] != null){
				promosToSave.add($.callPromos[i]);
			}
		}

		rcvModifiedCall.set({
			alloy_id :   rcvModifiedCall.get("alloy_id"),
			CallMadtop:  new Backbone.Model(tmpMadtop),
			Promos:		 promosToSave
		});

	for(var x = 0; x < feets.length; x++){

		switch(feets[x].index){
			case 1:
				rcvModifiedCall.set({
					CatDryLinearFeet : feets[x].feet.value
				});
			break;
			case 2:
				rcvModifiedCall.set({
					CatCanLinearFeet : feets[x].feet.value
				});
			break;
			case 3:
				rcvModifiedCall.set({
					DogDryLinearFeet : feets[x].feet.value
				});
			break;
			case 4:
				rcvModifiedCall.set({
					DogCanLinearFeet : feets[x].feet.value
				});
			break;
			case 5:
				rcvModifiedCall.set({
					TreatsLinearFeet : feets[x].feet.value
				});
			break;
			case -1:
				Ti.API.info("Missing index at linear feets information");
			break;
			}

		}
		rcvModifiedCall.save();
	}

}

$.dsvSales.addEventListener("blur", function(evt){

	if(evt.value != ""){
		var tmpValue = parseFloat(evt.value);
		if(!tmpValue){
			tmpValue = 0;
		}
		$.dsvSales.value = tmpValue.toFixed(2);
	}
});

$.rsvSales.addEventListener("blur", function(evt){
	if(evt.value != ""){
		var tmpValue = parseFloat(evt.value);
		if(!tmpValue){
			tmpValue = 0;
		}
		$.rsvSales.value = tmpValue.toFixed(2);

	}

});

function updateTotal(delta){
	$.mTotal.text = parseInt($.mTotal.text + delta);
}

function updatePromo(promo,index){
	if(index != -1){
		$.callPromos[index] = promo;
	}
}

init();


text:
package net.iexos.musicalarm;

import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.IBinder;
import android.os.PowerManager;
import android.telephony.TelephonyManager;
import android.util.Log;

import java.io.IOException;

public final class AlarmService extends Service {

    public static final String WAKE_LOCK_TAG = "net.iexos.musicalarm.WAKE_LOCK";
    public static final String LOGGING_TAG = "AlarmService";
    public static final String EXTRA_STATE_CHANGE = "net.iexos.musicalarm.EXTRA_STATE_CHANGE";
    public static final int NOTIFICATION_ID = 31415;

    private PowerManager.WakeLock mWakeLock;
    private MediaPlayer mAlarmPlayer;
    private MusicPlayer mMusicPlayer;
    private Uri mRingtoneUri;
    private int mDelay;
    private int mSnooze;
    private boolean mIsPlaying = false;
    private static boolean mAlarmWaiting = false;
    public enum State {INIT, IDLE, RINGING, IN_CALL}
    private static State mState = State.INIT;
    public enum StateChange {
        START_PLAYBACK, STOP_PLAYBACK, START_RINGING, STOP_RINGING, STOP_ALL, SNOOZE,
        START_CALL, STOP_CALL
    }
    public AlarmService() {
    }

    public static boolean isRinging() {
        return (mAlarmWaiting || mState == State.RINGING);
    }

    private final BroadcastReceiver receiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action.equals(AudioManager.ACTION_AUDIO_BECOMING_NOISY)) {
                sendStateChangeIntent(context, StateChange.STOP_PLAYBACK);
            }
            if (action.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) {
                String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
                if (state.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
                    sendStateChangeIntent(context, StateChange.STOP_CALL);
                }
                else {
                    sendStateChangeIntent(context, StateChange.START_CALL);
                }
            }
        }
    };

    private static Intent getStateChangeIntent(Context con, StateChange change) {
        Intent intent = new Intent(con, AlarmService.class);
        intent.putExtra(EXTRA_STATE_CHANGE, change);
        return intent;
    }

    public static PendingIntent getPendingStateChangeIntent(Context con, StateChange change) {
        return PendingIntent.getService(con, change.hashCode(),
                getStateChangeIntent(con, change), PendingIntent.FLAG_UPDATE_CURRENT);
    }

    public static void sendStateChangeIntent(Context con, StateChange change) {
        con.startService(getStateChangeIntent(con, change));
    }

    @Override
    public IBinder onBind (Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, WAKE_LOCK_TAG);
        mWakeLock.acquire();

        SharedPreferences settings = getSharedPreferences(AlarmViewActivity.PREFERENCES, 0);
        long playlistID = settings.getLong(AlarmViewActivity.PREF_PLAYLIST_ID, 0);
        String playlistName = settings.getString(AlarmViewActivity.PREF_PLAYLIST_NAME,
                this.getString(R.string.choose_playlist));
        mRingtoneUri = Uri.parse(settings.getString(AlarmViewActivity.PREF_RINGTONE_URI, ""));
        mDelay = settings.getInt(AlarmViewActivity.PREF_DELAY,
                AlarmViewActivity.DEFAULT_DELAY);
        mSnooze = settings.getInt(AlarmViewActivity.PREF_SNOOZE,
                AlarmViewActivity.DEFAULT_SNOOZE);

        mMusicPlayer = new MusicPlayer(this, playlistID, playlistName);

        mAlarmPlayer = new MediaPlayer();

        TelephonyManager tMan = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
        if (tMan.getCallState() != TelephonyManager.CALL_STATE_IDLE) {
            mState = State.IN_CALL;
        }

        IntentFilter filter = new IntentFilter();
        filter.addAction(AudioManager.ACTION_AUDIO_BECOMING_NOISY);
        filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
        registerReceiver(receiver, filter);

        Log.v(LOGGING_TAG, "AlarmService started");
    }

    @Override
    public void onDestroy() {
        Log.v(LOGGING_TAG, "AlarmService stopped");
        mAlarmWaiting = false;
        mState = State.INIT;
        mMusicPlayer.stop();
        mAlarmPlayer.release();
        mWakeLock.release();
        unregisterReceiver(receiver);
    }

    private void startPlayback() {
        switch (mState) {
            case INIT:
                mState = State.IDLE;
                mMusicPlayer.resume();
                break;
            case IDLE:
                mMusicPlayer.resume();
                break;
            case RINGING: case IN_CALL:
                break;
        }
        mIsPlaying = true;
    }

    private void stopPlayback() {
        mMusicPlayer.stop();
        mIsPlaying = false;
    }

    private void startRinging() {
        switch (mState) {
            case IN_CALL:
                mAlarmWaiting = true;
            case RINGING:
                return;
        }
        mState = State.RINGING;
        if (mIsPlaying) mMusicPlayer.pause();
        mAlarmPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
        mAlarmPlayer.setLooping(true);
        try {
            mAlarmPlayer.setDataSource(this, mRingtoneUri);
            mAlarmPlayer.prepare();
            mAlarmPlayer.start();
        }
        catch (IOException e1) {
            Log.e(LOGGING_TAG, e1.toString());
            Log.i(LOGGING_TAG, "Using fallback ringtone");
            try {
                mAlarmPlayer.reset();
                mAlarmPlayer.setDataSource(this,
                        RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM));
                mAlarmPlayer.prepare();
                mAlarmPlayer.start();
            }
            catch (IOException e2) {
                Log.e(LOGGING_TAG, "fallback failed: " + e2.toString());
            }
        }
    }

    private void stopRinging() {
        mAlarmWaiting = false;
        AlarmUtils.dismissRingAlarm(this);
        AlarmViewActivity.sendUpdateStatus(this);
        if (mState != State.RINGING) return;
        if (mIsPlaying) mMusicPlayer.resume();
        mState = State.IDLE;
        mAlarmPlayer.reset();
    }

    private void callStarted() {
        if (mIsPlaying) mMusicPlayer.pause();
        if (mState == State.RINGING) {
            mAlarmPlayer.reset();
            mAlarmWaiting = true;
        }
        mState = State.IN_CALL;
    }

    private void callStopped() {
        if (mState != State.IN_CALL) return;
        mState = State.IDLE;
        if (mAlarmWaiting) {
            mAlarmWaiting = false;
            startRinging();
        }
        else if (mIsPlaying) {
            mMusicPlayer.resume();
        }
    }

    private void checkErrorStates(StateChange change) {
        if ((!mIsPlaying && mState == State.IDLE) || (mIsPlaying && mState == State.INIT)) {
            Log.e(LOGGING_TAG, "This should not happen: State: " + mState.toString()
                    + " IsPlaying: " + String.valueOf(mIsPlaying)
                    + " StateChange: " + change.toString());
        }
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startID) {
        StateChange change = (StateChange) intent.getSerializableExtra(EXTRA_STATE_CHANGE);
        if (change != null) {
            checkErrorStates(change);
            switch (change) {
                case START_PLAYBACK:
                    if (mState == State.INIT) AlarmUtils.setRingAlarm(this, mDelay);
                    startPlayback();
                    break;
                case STOP_PLAYBACK:
                    stopPlayback();
                    break;
                case START_RINGING:
                    startRinging();
                    break;
                case STOP_RINGING:
                    stopRinging();
                    break;
                case START_CALL:
                    callStarted();
                    break;
                case STOP_CALL:
                    callStopped();
                    break;
                case STOP_ALL:
                    stopPlayback();
                    stopRinging();
                    break;
                case SNOOZE:
                    stopRinging();
                    AlarmUtils.setRingAlarm(this, mSnooze);
                    break;
            }

            if (mState == State.INIT
                    || (mState == State.IDLE && !mIsPlaying)
                    || (mState == State.IN_CALL && !mAlarmWaiting && !mIsPlaying)) {
                stopForeground(true);
                NotificationUtils.displayStoppedNotification(this);
                stopSelf();
            }
            else {
                NotificationUtils.displayForegroundNotification(this, mState);
            }
        }
        return Service.START_NOT_STICKY;
    }
}


text:
{% extends "basic/layout.html" %}
{% set script_files = ['_static/js/vendor/modernizr-2.6.2.min.js'] %}
{% set css_files = css_files + ['_static/css/normalize.css', '_static/css/github.min.css'] %}

{%- block doctype -%}
<!DOCTYPE html>
{%- endblock %}

{%- macro script() %}

    {%- for scriptfile in script_files %}

    {%- endfor %}
{%- endmacro %}

{%- macro css() %}
    <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
    <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
    {%- for cssfile in css_files %}
    <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
    {%- endfor %}
{%- endmacro %}

    <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {{ metatags }}
    {%- block htmltitle %}
    <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
    {%- endblock %}
    {{ css() }}
    {{ script() }}
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Roboto:300,400,700,700italic,400italic|Open+Sans:300' rel='stylesheet' type='text/css'>
    {%- if favicon %}
    <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
    {%- endif %}
    {%- block extrahead %} {% endblock %}

    {%- block header %}

          gcloud

Python

              Node.js

              Python

    {% endblock %}

    {# Silence the sidebar and relbars. #}
    {% block sidebar1 %}{% endblock %}
    {% block relbar1 %}{% endblock %}
    {% block relbar2 %}{% endblock %}

    {%- block content %}

Python

            {{ release|e }}

        {% block body %} {% endblock %}

gcloud

        {{ toctree(includehidden=True, maxdepth=1, titles_only=True) }}

              Github

              Issues

              gcloud

              Package Manager

  {% endblock %}

  {# Silence the footer #}
  {% block footer %}{% endblock %}


text:
@interface CIMuseumNewsViewController : UIViewController <UIWebViewDelegate> {
    IBOutlet UIWebView *newsWebView;
    IBOutlet UIView *errorView;
    NSString *requestURL;
}

@end


text:
export class HelloDb {
    constructor(
        public Item: DbDes
    ) {}
}
export class DbDes {
    constructor(
        public description: String
    ) {}
}


text:
#define pr_fmt(fmt) "cache-hwmon: " fmt

#include <linux/kernel.h>
#include <linux/sizes.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/ktime.h>
#include <linux/time.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/devfreq.h>
#include "governor.h"
#include "governor_cache_hwmon.h"

#define show_attr(name) \
static ssize_t show_##name(struct device *dev,				\
			struct device_attribute *attr, char *buf)	\
{									\
	return snprintf(buf, PAGE_SIZE, "%u\n", name);			\
}

#define store_attr(name, _min, _max) \
static ssize_t store_##name(struct device *dev,				\
			struct device_attribute *attr, const char *buf,	\
			size_t count)					\
{									\
	int ret;							\
	unsigned int val;						\
	ret = sscanf(buf, "%u", &val);					\
	if (ret != 1)							\
		return -EINVAL;						\
	val = max(val, _min);						\
	val = min(val, _max);						\
	name = val;							\
	return count;							\
}

#define gov_attr(__attr, min, max)	\
show_attr(__attr)			\
store_attr(__attr, min, max)		\
static DEVICE_ATTR(__attr, 0644, show_##__attr, store_##__attr)

static struct cache_hwmon *hw;
static unsigned int cycles_per_low_req;
static unsigned int cycles_per_med_req = 20;
static unsigned int cycles_per_high_req = 35;
static unsigned int min_busy = 100;
static unsigned int max_busy = 100;
static unsigned int tolerance_mrps = 5;
static unsigned int guard_band_mhz = 100;
static unsigned int decay_rate = 90;

#define MIN_MS	10U
#define MAX_MS	500U
static unsigned int sample_ms = 50;
static unsigned long prev_mhz;
static ktime_t prev_ts;

static unsigned long measure_mrps_and_set_irq(struct devfreq *df,
			struct mrps_stats *stat)
{
	ktime_t ts;
	unsigned int us;

	/*
	 * Since we are stopping the counters, we don't want this short work
	 * to be interrupted by other tasks and cause the measurements to be
	 * wrong. Not blocking interrupts to avoid affecting interrupt
	 * latency and since they should be short anyway because they run in
	 * atomic context.
	 */
	preempt_disable();

	ts = ktime_get();
	us = ktime_to_us(ktime_sub(ts, prev_ts));
	if (!us)
		us = 1;

	hw->meas_mrps_and_set_irq(df, tolerance_mrps, us, stat);
	prev_ts = ts;

	preempt_enable();

	pr_debug("stat H=%3lu, M=%3lu, T=%3lu, b=%3u, f=%4lu, us=%d\n",
		 stat->high, stat->med, stat->high + stat->med,
		 stat->busy_percent, df->previous_freq / 1000, us);

	return 0;
}

static void compute_cache_freq(struct mrps_stats *mrps, unsigned long *freq)
{
	unsigned long new_mhz;
	unsigned int busy;

	new_mhz = mrps->high * cycles_per_high_req
		+ mrps->med * cycles_per_med_req
		+ mrps->low * cycles_per_low_req;

	busy = max(min_busy, mrps->busy_percent);
	busy = min(max_busy, busy);

	new_mhz *= 100;
	new_mhz /= busy;

	if (new_mhz < prev_mhz) {
		new_mhz = new_mhz * decay_rate + prev_mhz * (100 - decay_rate);
		new_mhz /= 100;
	}
	prev_mhz = new_mhz;

	new_mhz += guard_band_mhz;
	*freq = new_mhz * 1000;
}

#define TOO_SOON_US	(1 * USEC_PER_MSEC)
static irqreturn_t mon_intr_handler(int irq, void *dev)
{
	struct devfreq *df = dev;
	ktime_t ts;
	unsigned int us;
	int ret;

	if (!hw->is_valid_irq(df))
		return IRQ_NONE;

	pr_debug("Got interrupt\n");
	devfreq_monitor_stop(df);

	/*
	 * Don't recalc cache freq if the interrupt comes right after a
	 * previous cache freq calculation.  This is done for two reasons:
	 *
	 * 1. Sampling the cache request during a very short duration can
	 *    result in a very inaccurate measurement due to very short
	 *    bursts.
	 * 2. This can only happen if the limit was hit very close to the end
	 *    of the previous sample period. Which means the current cache
	 *    request estimate is not very off and doesn't need to be
	 *    readjusted.
	 */
	ts = ktime_get();
	us = ktime_to_us(ktime_sub(ts, prev_ts));
	if (us > TOO_SOON_US) {
		mutex_lock(&df->lock);
		ret = update_devfreq(df);
		if (ret)
			pr_err("Unable to update freq on IRQ!\n");
		mutex_unlock(&df->lock);
	}

	devfreq_monitor_start(df);

	return IRQ_HANDLED;
}

static int devfreq_cache_hwmon_get_freq(struct devfreq *df,
					unsigned long *freq,
					u32 *flag)
{
	struct mrps_stats stat;

	measure_mrps_and_set_irq(df, &stat);
	compute_cache_freq(&stat, freq);

	return 0;
}

gov_attr(cycles_per_low_req, 1U, 100U);
gov_attr(cycles_per_med_req, 1U, 100U);
gov_attr(cycles_per_high_req, 1U, 100U);
gov_attr(min_busy, 1U, 100U);
gov_attr(max_busy, 1U, 100U);
gov_attr(tolerance_mrps, 0U, 100U);
gov_attr(guard_band_mhz, 0U, 500U);
gov_attr(decay_rate, 0U, 100U);

static struct attribute *dev_attr[] = {
	&dev_attr_cycles_per_low_req.attr,
	&dev_attr_cycles_per_med_req.attr,
	&dev_attr_cycles_per_high_req.attr,
	&dev_attr_min_busy.attr,
	&dev_attr_max_busy.attr,
	&dev_attr_tolerance_mrps.attr,
	&dev_attr_guard_band_mhz.attr,
	&dev_attr_decay_rate.attr,
	NULL,
};

static struct attribute_group dev_attr_group = {
	.name = "cache_hwmon",
	.attrs = dev_attr,
};

static int start_monitoring(struct devfreq *df)
{
	int ret;
	struct mrps_stats mrps;

	prev_ts = ktime_get();
	prev_mhz = 0;
	mrps.high = (df->previous_freq / 1000) - guard_band_mhz;
	mrps.high /= cycles_per_high_req;

	ret = hw->start_hwmon(df, &mrps);
	if (ret) {
		pr_err("Unable to start HW monitor!\n");
		return ret;
	}

	devfreq_monitor_start(df);

	ret = request_threaded_irq(hw->irq, NULL, mon_intr_handler,
			  IRQF_ONESHOT | IRQF_SHARED,
			  "cache_hwmon", df);
	if (ret) {
		pr_err("Unable to register interrupt handler!\n");
		goto req_irq_fail;
	}

	ret = sysfs_create_group(&df->dev.kobj, &dev_attr_group);
	if (ret) {
		pr_err("Error creating sys entries!\n");
		goto sysfs_fail;
	}

	return 0;

sysfs_fail:
	disable_irq(hw->irq);
	free_irq(hw->irq, df);
req_irq_fail:
	devfreq_monitor_stop(df);
	hw->stop_hwmon(df);
	return ret;
}

static void stop_monitoring(struct devfreq *df)
{
	sysfs_remove_group(&df->dev.kobj, &dev_attr_group);
	disable_irq(hw->irq);
	free_irq(hw->irq, df);
	devfreq_monitor_stop(df);
	hw->stop_hwmon(df);
}

static int devfreq_cache_hwmon_ev_handler(struct devfreq *df,
					unsigned int event, void *data)
{
	int ret;

	switch (event) {
	case DEVFREQ_GOV_START:
		sample_ms = df->profile->polling_ms;
		sample_ms = max(MIN_MS, sample_ms);
		sample_ms = min(MAX_MS, sample_ms);
		df->profile->polling_ms = sample_ms;

		ret = start_monitoring(df);
		if (ret)
			return ret;

		pr_debug("Enabled Cache HW monitor governor\n");
		break;

	case DEVFREQ_GOV_STOP:
		stop_monitoring(df);
		pr_debug("Disabled Cache HW monitor governor\n");
		break;

	case DEVFREQ_GOV_INTERVAL:
		sample_ms = *(unsigned int *)data;
		sample_ms = max(MIN_MS, sample_ms);
		sample_ms = min(MAX_MS, sample_ms);
		devfreq_interval_update(df, &sample_ms);
		break;
	}

	return 0;
}

static struct devfreq_governor devfreq_cache_hwmon = {
	.name = "cache_hwmon",
	.get_target_freq = devfreq_cache_hwmon_get_freq,
	.event_handler = devfreq_cache_hwmon_ev_handler,
};

int register_cache_hwmon(struct cache_hwmon *hwmon)
{
	int ret;

	hw = hwmon;
	ret = devfreq_add_governor(&devfreq_cache_hwmon);
	if (ret) {
		pr_err("devfreq governor registration failed\n");
		return ret;
	}

	return 0;
}

MODULE_DESCRIPTION("HW monitor based cache freq driver");
MODULE_LICENSE("GPL v2");


text:
package berlin.reiche.jtriple;

import static berlin.reiche.jtriple.example.Branch.EPISTEMOLOGY;
import static berlin.reiche.jtriple.example.Branch.METAPHYSISC;
import static berlin.reiche.jtriple.example.Branch.PHILOSOPHY_OF_MIND;
import static berlin.reiche.jtriple.example.Philosopher.NAMESPACE;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;

import berlin.reiche.jtriple.example.Branch;
import berlin.reiche.jtriple.example.Dummy;
import berlin.reiche.jtriple.example.Philosopher;
import berlin.reiche.jtriple.rdf.IdentifierException;
import berlin.reiche.jtriple.rdf.Label;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

/**
 * Tests the whole binding procedure. This unit test is the most general test of
 * the library functionality.
 *
 * @author Konrad Reiche
 *
 */
public class BindingTest {

	Binding binding;

	Model model;

	@Before
	public void setUp() {
		binding = new Binding(NAMESPACE);
		model = binding.getModel();
		model.setNsPrefix("philosophy", NAMESPACE);
		model.setNsPrefix("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
		model.setNsPrefix("xfoaf", "http://www.foafrealm.org/xfoaf/0.1/");
		model.setNsPrefix("dbpedia", "http://dbpedia.org/resource/");
	}

	@Test
	public void testMinimumRequirements() {

		Dummy dummy = new Dummy();
		dummy.setValue(42);
		Binding binding = new Binding("http://konrad-reiche.com/dummy");

		try {
			binding.createNewResource(dummy);
		} catch (IdentifierException e) {
			return;
		}

		fail("No " + IdentifierException.class.getSimpleName() + "was thrown.");
	}

	@Test
	public void testBind() {

		Philosopher locke = new Philosopher();
		locke.setName("John Locke");
		locke.setNationality("English");

		List<Branch> branches = new ArrayList<>();
		branches.add(METAPHYSISC);
		branches.add(EPISTEMOLOGY);
		branches.add(PHILOSOPHY_OF_MIND);
		locke.setInterests(branches);

		binding.bind(locke);
		model.write(System.out, "TURTLE");

		Property label = model.getProperty(Label.uri);
		Property nationality = model
				.getProperty("http://www.foafrealm.org/xfoaf/0.1/nationality");
		Property interests = model.getProperty(NAMESPACE + "interests");

		Resource res = model.getResource(NAMESPACE + "philosopher/John locke");
		assertFalse(res.hasProperty(model.getProperty(Label.uri)));

		res = model.getResource(NAMESPACE + "philosopher/John_locke");
		assertTrue(res.hasProperty(label));
		assertTrue(res.hasProperty(nationality));
		assertTrue(res.hasProperty(interests));
	}
}


text:
require 'spec_helper'
require 'rp/options'
require 'rp/version'

describe Rp::Options do

  let(:output) { StringIO.new }

  it 'stores the specified directory name' do
    arguments = ["myrubyproject"]

    options = Rp::Options.parse(arguments)

    options.directory_name.should == "myrubyproject"
  end

  it 'stores the specified ruby version' do
    arguments = ["-r", "ruby-1.9.2"]

    options = Rp::Options.parse(arguments)

    options.ruby_version.should == "ruby-1.9.2"
  end

  it 'put help message to output if no argumens given' do
    arguments = []

    Rp::Options.should_receive(:exit)

    capture(:stdout) {
      Rp::Options.parse(arguments)
    }.split("\n").should == ["Usage: rp [NAME] ... [OPTION] ...",
                             "",
                             "Specific options:",
                             "    -r, --ruby-version [VERSION]     ruby version used in .rvmrc file",
                             "    -h, --help                       display this help and exit",
                             "    -v, --version                    show version"]
  end

  it 'put version information to the outout' do
    Rp.stub(:VERSION => "0.0.1")

    arguments = ["-v"]

    Rp::Options.should_receive(:exit)

    capture(:stdout) { Rp::Options.parse(arguments) }.should == "rp, version 0.0.1\n"
  end

end


text:
<?php

declare(strict_types=1);

namespace OpenTelemetry\SDK\Trace\SpanProcessor;

use OpenTelemetry\Context\ContextInterface;
use OpenTelemetry\SDK\Common\Future\CancellationInterface;
use OpenTelemetry\SDK\Trace\ReadableSpanInterface;
use OpenTelemetry\SDK\Trace\ReadWriteSpanInterface;
use OpenTelemetry\SDK\Trace\SpanProcessorInterface;

/**
 * Class SpanMultiProcessor is a SpanProcessor that forwards all events to an
 * array of SpanProcessors.
 */
final class MultiSpanProcessor implements SpanProcessorInterface
{
    /** @var list<SpanProcessorInterface> */
    private array $processors = [];

    public function __construct(SpanProcessorInterface ...$spanProcessors)
    {
        foreach ($spanProcessors as $processor) {
            $this->addSpanProcessor($processor);
        }
    }

    public function addSpanProcessor(SpanProcessorInterface $processor): void
    {
        $this->processors[] = $processor;
    }

    /** @return list<SpanProcessorInterface> */
    public function getSpanProcessors(): array
    {
        return $this->processors;
    }

    /** @inheritDoc */
    public function onStart(ReadWriteSpanInterface $span, ContextInterface $parentContext): void
    {
        foreach ($this->processors as $processor) {
            $processor->onStart($span, $parentContext);
        }
    }

    /** @inheritDoc */
    public function onEnd(ReadableSpanInterface $span): void
    {
        foreach ($this->processors as $processor) {
            $processor->onEnd($span);
        }
    }

    /** @inheritDoc */
    public function shutdown(?CancellationInterface $cancellation = null): bool
    {
        $result = true;

        foreach ($this->processors as $processor) {
            $result = $result && $processor->shutdown();
        }

        return $result;
    }

    /** @inheritDoc */
    public function forceFlush(?CancellationInterface $cancellation = null): bool
    {
        $result = true;

        foreach ($this->processors as $processor) {
            $result = $result && $processor->forceFlush();
        }

        return $result;
    }
}


text:
package org.uma.jmetal.lab.visualization.plot;

public interface PlotFront {
  void plot() ;
}


text:
using System;
using System.Web;
using System.Web.UI;
using TropoCSharp.Tropo;

namespace TropoSamples
{
	/// <summary>
	/// A simple example showing how to say Hello World to a user.
	/// </summary>
    public partial class HelloWorld : Page
	{
		public void Page_Load (object sender, EventArgs args)
		{
            // Create a new instance of the Tropo object.
            Tropo tropo = new Tropo();

            // Call the say method of the Tropo object and give it a prompt to say.
            tropo.Say("Hello World!");
            tropo.Say("hello London", null, null, "shname", null, null, null);
            tropo.Say("hello Tokyo", null, null, "shname", null, null, "none");
            tropo.Say("hello Moscow", null, null, "shname", null, null, "suppress");

            //HttpContext.Current.Trace.Warn("tropo.JSONToTe666666xt() is " + tropo.JSONToText());

            tropo.RenderJSON(Response);
		}
	}
}


text:
package org.wso2.developerstudio.eclipse.esb.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.w3c.dom.Element;
import org.wso2.developerstudio.eclipse.esb.AbstractLocationKeyResource;
import org.wso2.developerstudio.eclipse.esb.EsbPackage;
import org.wso2.developerstudio.eclipse.esb.RegistryKeyProperty;

/**
 *
 * An implementation of the model object 'Abstract Location Key Resource'.
 *
 *

 * The following features are implemented:
 *

 *
{@link org.wso2.developerstudio.eclipse.esb.impl.AbstractLocationKeyResourceImpl#getLocation Location}

 *
{@link org.wso2.developerstudio.eclipse.esb.impl.AbstractLocationKeyResourceImpl#getKey Key}

 *

 *

 *
 * @generated
 */
public abstract class AbstractLocationKeyResourceImpl extends ModelObjectImpl implements AbstractLocationKeyResource {
	/**
	 * The default value of the '{@link #getLocation() Location}' attribute.
	 *
	 *
	 * @see #getLocation()
	 * @generated
	 * @ordered
	 */
	protected static final String LOCATION_EDEFAULT = "default_location";

	/**
	 * The cached value of the '{@link #getLocation() Location}' attribute.
	 *
	 *
	 * @see #getLocation()
	 * @generated
	 * @ordered
	 */
	protected String location = LOCATION_EDEFAULT;

	/**
	 * The cached value of the '{@link #getKey() Key}' containment reference.
	 *
	 *
	 * @see #getKey()
	 * @generated
	 * @ordered
	 */
	protected RegistryKeyProperty key;

	/**
	 *
	 *
	 * @generated
	 */
	protected AbstractLocationKeyResourceImpl() {
		super();
	}

	/**
	 * {@inheritDoc}
	 */
	protected void doLoad(Element self) throws Exception {
		setLocation(self.getAttribute("location"));
		getKey().load(self);
		super.doLoad(self);
	}

	/**
	 * {@inheritDoc}
	 */
	protected Element doSave(Element parent) throws Exception {
		Element self = createChildElement(parent, "resource");
		self.setAttribute("location", getLocation());
		getKey().save(self);

		addComments(self);
		return self;
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	protected EClass eStaticClass() {
		return EsbPackage.Literals.ABSTRACT_LOCATION_KEY_RESOURCE;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public String getLocation() {
		return location;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setLocation(String newLocation) {
		String oldLocation = location;
		location = newLocation;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__LOCATION, oldLocation, location));
	}

	/**
	 *
	 *
	 * @generated
	 */
	public RegistryKeyProperty getKey() {
		return key;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public NotificationChain basicSetKey(RegistryKeyProperty newKey, NotificationChain msgs) {
		RegistryKeyProperty oldKey = key;
		key = newKey;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY, oldKey, newKey);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 *
	 *
	 * @generated
	 */
	public void setKey(RegistryKeyProperty newKey) {
		if (newKey != key) {
			NotificationChain msgs = null;
			if (key != null)
				msgs = ((InternalEObject)key).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY, null, msgs);
			if (newKey != null)
				msgs = ((InternalEObject)newKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY, null, msgs);
			msgs = basicSetKey(newKey, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY, newKey, newKey));
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY:
				return basicSetKey(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__LOCATION:
				return getLocation();
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY:
				return getKey();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__LOCATION:
				setLocation((String)newValue);
				return;
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY:
				setKey((RegistryKeyProperty)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__LOCATION:
				setLocation(LOCATION_EDEFAULT);
				return;
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY:
				setKey((RegistryKeyProperty)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__LOCATION:
				return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location);
			case EsbPackage.ABSTRACT_LOCATION_KEY_RESOURCE__KEY:
				return key != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 *
	 *
	 * @generated
	 */

	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (location: ");
		result.append(location);
		result.append(')');
		return result.toString();
	}

} //AbstractLocationKeyResourceImpl


text:
package org.jboss.weld.tests.proxy;

import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named;
import java.io.Serializable;

@Named
@RequestScoped
public class Wobble implements Serializable {
    public Wobble getThis() {
        return this;
    }
}


text:
package org.apache.camel.example.cdi.osgi;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.inject.Named;

import org.apache.camel.component.properties.PropertiesComponent;

public class Config {

    @Produces
    @ApplicationScoped
    @Named("properties")
    PropertiesComponent properties() {
        PropertiesComponent component = new PropertiesComponent();
        component.setLocation("classpath:jms.properties");
        return component;
    }
}


text:
<?php

namespace app\models\traits;

use Yii;
use app\models\appdata\County;
use app\models\appdata\Image;
use app\models\Trail;

trait TourTrailTrait
{

    public static function typeDropDownArray()
    {
        return [
            Trail::TYPE_MTB => Yii::t('app', ucfirst(Trail::TYPE_MTB)),
            Trail::TYPE_ROAD => Yii::t('app', ucfirst(Trail::TYPE_ROAD)),
            Trail::TYPE_CYCLOCROSS => Yii::t('app', ucfirst(Trail::TYPE_CYCLOCROSS)),
            Trail::TYPE_HIKE => Yii::t('app', ucfirst(Trail::TYPE_HIKE)),
            ];
    }
}


text:
package de.linkvt.ontobench.features.annotations.ontology.dc;

import de.linkvt.ontobench.features.Feature;
import de.linkvt.ontobench.features.FeatureCategory;
import de.linkvt.ontobench.features.annotations.ontology.OntologyConstants;

import org.semanticweb.owlapi.model.AddOntologyAnnotation;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotation;
import org.semanticweb.owlapi.model.OWLAnnotationProperty;
import org.semanticweb.owlapi.vocab.Namespaces;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Optional;

@Component
public class DcIdentifierFeature extends Feature {

  @Autowired
  private OntologyConstants ontologyConstants;

  @Override
  public void addToOntology() {
    OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "identifier"));

    Optional<IRI> optionalIri = ontology.getOntologyID().getOntologyIRI();
    if (optionalIri.isPresent()) {
      String iri = optionalIri.get().toString();
      OWLAnnotation identifier = factory.getOWLAnnotation(property, factory.getOWLLiteral(iri));

      addChangeToOntology(new AddOntologyAnnotation(ontology, identifier));
    }
  }

  @Override
  public String getName() {
    return "dc:identifier";
  }

  @Override
  public String getToken() {
    return "dcidentifier";
  }

  @Override
  public FeatureCategory getCategory() {
    return FeatureCategory.DC;
  }
}


text:
package mpi;

import p2pmpi.mpi.MPI;
import p2pmpi.mpi.Status;
import utils.AirportLogger;
import air.SimWorld;

public class RecvThread extends Thread {
	public void run() {
		while(true) {
			MpiMessage[] data = new MpiMessage[1];
			Status status = MPI.COMM_WORLD.Recv(data, 0, 1, MPI.OBJECT, MPI.ANY_SOURCE, 1);

			MpiEvent.createEventFromMessage(data[0]);

			int sender = status.source;
			long lookahead = data[0].getLookAhead();
			long timestamp = data[0].getTimeStamp();
			AirportLogger.getLogger().debug("Received lookahead" + lookahead + " with TS " + timestamp + " from " + sender);
			SimWorld.getInstance().getLookaheadQueue().addLookahead(sender, timestamp + lookahead);

			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}


text:
:mod:`framebuf` --- frame buffer manipulation
=============================================

.. module:: framebuf
   :synopsis: Frame buffer manipulation

This module provides a general frame buffer which can be used to create
bitmap images, which can then be sent to a display.

class FrameBuffer
-----------------

The FrameBuffer class provides a pixel buffer which can be drawn upon with
pixels, lines, rectangles, text and even other FrameBuffer's. It is useful
when generating output for displays.

For example::

    import framebuf

    # FrameBuffer needs 2 bytes for every RGB565 pixel
    fbuf = framebuf.FrameBuffer(bytearray(10 * 100 * 2), 10, 100, framebuf.RGB565)

    fbuf.fill(0)
    fbuf.text('MicroPython!', 0, 0, 0xffff)
    fbuf.hline(0, 10, 96, 0xffff)

Constructors
------------

.. class:: FrameBuffer(buffer, width, height, format, stride=width, /)

    Construct a FrameBuffer object.  The parameters are:

        - *buffer* is an object with a buffer protocol which must be large
          enough to contain every pixel defined by the width, height and
          format of the FrameBuffer.
        - *width* is the width of the FrameBuffer in pixels
        - *height* is the height of the FrameBuffer in pixels
        - *format* specifies the type of pixel used in the FrameBuffer;
          permissible values are listed under Constants below. These set the
          number of bits used to encode a color value and the layout of these
          bits in *buffer*.
          Where a color value c is passed to a method, c is a small integer
          with an encoding that is dependent on the format of the FrameBuffer.
        - *stride* is the number of pixels between each horizontal line
          of pixels in the FrameBuffer. This defaults to *width* but may
          need adjustments when implementing a FrameBuffer within another
          larger FrameBuffer or screen. The *buffer* size must accommodate
          an increased step size.

    One must specify valid *buffer*, *width*, *height*, *format* and
    optionally *stride*.  Invalid *buffer* size or dimensions may lead to
    unexpected errors.

Drawing primitive shapes
------------------------

The following methods draw shapes onto the FrameBuffer.

.. method:: FrameBuffer.fill(c)

    Fill the entire FrameBuffer with the specified color.

.. method:: FrameBuffer.pixel(x, y[, c])

    If *c* is not given, get the color value of the specified pixel.
    If *c* is given, set the specified pixel to the given color.

.. method:: FrameBuffer.hline(x, y, w, c)
.. method:: FrameBuffer.vline(x, y, h, c)
.. method:: FrameBuffer.line(x1, y1, x2, y2, c)

    Draw a line from a set of coordinates using the given color and
    a thickness of 1 pixel. The `line` method draws the line up to
    a second set of coordinates whereas the `hline` and `vline`
    methods draw horizontal and vertical lines respectively up to
    a given length.

.. method:: FrameBuffer.rect(x, y, w, h, c)
.. method:: FrameBuffer.fill_rect(x, y, w, h, c)

    Draw a rectangle at the given location, size and color. The `rect`
    method draws only a 1 pixel outline whereas the `fill_rect` method
    draws both the outline and interior.

Drawing text
------------

.. method:: FrameBuffer.text(s, x, y[, c])

    Write text to the FrameBuffer using the the coordinates as the upper-left
    corner of the text. The color of the text can be defined by the optional
    argument but is otherwise a default value of 1. All characters have
    dimensions of 8x8 pixels and there is currently no way to change the font.

Other methods
-------------

.. method:: FrameBuffer.scroll(xstep, ystep)

    Shift the contents of the FrameBuffer by the given vector. This may
    leave a footprint of the previous colors in the FrameBuffer.

.. method:: FrameBuffer.blit(fbuf, x, y, key=-1, palette=None)

    Draw another FrameBuffer on top of the current one at the given coordinates.
    If *key* is specified then it should be a color integer and the
    corresponding color will be considered transparent: all pixels with that
    color value will not be drawn.

    The *palette* argument enables blitting between FrameBuffers with differing
    formats. Typical usage is to render a monochrome or grayscale glyph/icon to
    a color display. The *palette* is a FrameBuffer instance whose format is
    that of the current FrameBuffer. The *palette* height is one pixel and its
    pixel width is the number of colors in the source FrameBuffer. The *palette*
    for an N-bit source needs 2**N pixels; the *palette* for a monochrome source
    would have 2 pixels representing background and foreground colors. The
    application assigns a color to each pixel in the *palette*. The color of the
    current pixel will be that of that *palette* pixel whose x position is the
    color of the corresponding source pixel.

Constants
---------

.. data:: framebuf.MONO_VLSB

    Monochrome (1-bit) color format
    This defines a mapping where the bits in a byte are vertically mapped with
    bit 0 being nearest the top of the screen. Consequently each byte occupies
    8 vertical pixels. Subsequent bytes appear at successive horizontal
    locations until the rightmost edge is reached. Further bytes are rendered
    at locations starting at the leftmost edge, 8 pixels lower.

.. data:: framebuf.MONO_HLSB

    Monochrome (1-bit) color format
    This defines a mapping where the bits in a byte are horizontally mapped.
    Each byte occupies 8 horizontal pixels with bit 7 being the leftmost.
    Subsequent bytes appear at successive horizontal locations until the
    rightmost edge is reached. Further bytes are rendered on the next row, one
    pixel lower.

.. data:: framebuf.MONO_HMSB

    Monochrome (1-bit) color format
    This defines a mapping where the bits in a byte are horizontally mapped.
    Each byte occupies 8 horizontal pixels with bit 0 being the leftmost.
    Subsequent bytes appear at successive horizontal locations until the
    rightmost edge is reached. Further bytes are rendered on the next row, one
    pixel lower.

.. data:: framebuf.RGB565

    Red Green Blue (16-bit, 5+6+5) color format

.. data:: framebuf.GS2_HMSB

    Grayscale (2-bit) color format

.. data:: framebuf.GS4_HMSB

    Grayscale (4-bit) color format

.. data:: framebuf.GS8

    Grayscale (8-bit) color format


text: import symath