text:
using System.Diagnostics;
using Internal.Runtime.CompilerServices;

namespace System
{
    internal static partial class Number
    {
        //  We need 1 additional byte, per length, for the terminating null
        private const int DecimalNumberBufferLength = 29 + 1 + 1;  // 29 for the longest input + 1 for rounding
        private const int DoubleNumberBufferLength = 767 + 1 + 1;  // 767 for the longest input + 1 for rounding: 4.9406564584124654E-324
        private const int Int32NumberBufferLength = 10 + 1;    // 10 for the longest input: 2,147,483,647
        private const int Int64NumberBufferLength = 19 + 1;    // 19 for the longest input: 9,223,372,036,854,775,807
        private const int SingleNumberBufferLength = 112 + 1 + 1;  // 112 for the longest input + 1 for rounding: 1.40129846E-45
        private const int UInt32NumberBufferLength = 10 + 1;   // 10 for the longest input: 4,294,967,295
        private const int UInt64NumberBufferLength = 20 + 1;   // 20 for the longest input: 18,446,744,073,709,551,615

        internal unsafe ref struct NumberBuffer
        {
            public int Precision;
            public int Scale;
            public bool Sign;
            public bool HasNonZeroTail;
            public NumberBufferKind Kind;
            public Span<char> Digits;

            public NumberBuffer(NumberBufferKind kind, char* digits, int digitsLength)
            {
                Debug.Assert(Enum.IsDefined(typeof(NumberBufferKind), kind));
                Debug.Assert(kind != NumberBufferKind.Unknown);
                Debug.Assert(digits != null);
                Debug.Assert(digitsLength > 0);

                Precision = 0;
                Scale = 0;
                Sign = false;
                HasNonZeroTail = false;
                Kind = kind;
                Digits = new Span<char>(digits, digitsLength);
            }

            public char* GetDigitsPointer()
            {
                // This is safe to do since we are a ref struct
                return (char*)(Unsafe.AsPointer(ref Digits[0]));
            }
        }

        internal enum NumberBufferKind : byte
        {
            Unknown = 0,
            Integer = 1,
            Decimal = 2,
            FloatingPoint = 3,
        }
    }
}


text:
\begin{figure}[H]
\centering
\includegraphics[width=6in]{figs/run_65/run_65_ctke_005rdynamic}
\caption{Plot showing dynamic variations in turbulent kinetic energy between 0 and 0.5 core radii. $z/c$=10.00, $V_{free}$=23.23, station 7.}
\label{fig:run_65_ctke_005rdynamic}
\end{figure}

redpajama_set_name: RedPajamaGithub


text:
package org.openksavi.sponge.kotlin;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

import org.openksavi.sponge.core.action.BaseAction;
import org.openksavi.sponge.kotlin.core.KotlinKnowledgeBaseEngineOperations;
import org.openksavi.sponge.type.DataType;

/**
 * Kotlin-specific implementation of the action.
 */
@SuppressWarnings("rawtypes")
public abstract class KAction extends BaseAction {

    /**
     * Method required for accessing the engine operations in Kotlin-based processors.
     *
     * @return the engine operations.
     */
    @Override
    public final KotlinKnowledgeBaseEngineOperations getSponge() {
        return (KotlinKnowledgeBaseEngineOperations) super.getSponge();
    }

    @Override
    public final KAction withName(String name) {
        return (KAction) super.withName(name);
    }

    @Override
    public final KAction withLabel(String label) {
        return (KAction) super.withLabel(label);
    }

    @Override
    public final KAction withDescription(String description) {
        return (KAction) super.withDescription(description);
    }

    @Override
    public final KAction withVersion(Integer version) {
        return (KAction) super.withVersion(version);
    }

    @Override
    public final KAction withFeatures(Map<String, Object> features) {
        return (KAction) super.withFeatures(features);
    }

    @Override
    public final KAction withFeature(String name, Object value) {
        return (KAction) super.withFeature(name, value);
    }

    @Override
    public final KAction withCategory(String category) {
        return (KAction) super.withCategory(category);
    }

    @Override
    public final KAction withArgs(List<DataType> args) {
        return (KAction) super.withArgs(args);
    }

    public final KAction withArgs(DataType... args) {
        return withArgs(Arrays.asList(args));
    }

    @Override
    public final KAction withArg(DataType arg) {
        return (KAction) super.withArg(arg);
    }

    @Override
    public final KAction withNoArgs() {
        return (KAction) super.withNoArgs();
    }

    @Override
    public final KAction withResult(DataType result) {
        return (KAction) super.withResult(result);
    }

    @Override
    public final KAction withNoResult() {
        return (KAction) super.withNoResult();
    }

    @Override
    public final KAction withCallable(boolean callable) {
        return (KAction) super.withCallable(callable);
    }

    @Override
    public final KAction withNonCallable() {
        return (KAction) super.withNonCallable();
    }

    @Override
    public final KAction withActivatable() {
        return (KAction) super.withActivatable();
    }
}


text:
require 'test_helper'

class UserCompanyTypeTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


text:
package anypkg;

import javax.validation.constraints.NotNull;

import com.google.common.base.Strings;

/** This class uses guava (compile) and some EE annotation (provided). */
public class AnyClass {

	public void anyMethod(@NotNull String argument) {
		Strings.isNullOrEmpty(argument);
	}
}


text:
__author__ = "Daniel Fath <daniel DOT fath 7 AT gmail DOT com>"
__version__ = "0.1"

from setuptools import setup

NAME = 'DOMMLite  parser and utilities'
VERSION = __version__
DESC = 'DOMM Parser for master thesis'
AUTHOR = 'Daniel Fath'
AUTHOR_EMAIL = 'daniel DOT fath 7 AT gmail DOT com'
LICENCE = 'MIT'
URL = 'https://github.com/danielfath/master'

setup(
    name = NAME,
    version = VERSION,
    description = DESC,
    author = AUTHOR,
    author_email = AUTHOR_EMAIL,
    maintainer = AUTHOR,
    maintainer_email = AUTHOR_EMAIL,
    license = LICENCE,
    url = URL,
    packages = ["domm"],
    keywords = "parser dommlite utils graphic",
    classifiers=[
        'Development Status :: 1 - Beta',
        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Intended Audience :: Science/Research',
        'Topic :: Software Development :: Interpreters',
        'Topic :: Software Development :: Compilers',
        'Topic :: Software Development :: Libraries :: Python Modules'
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        ]

)


text:
package com.rackspace.com.papi.components.checker

import com.rackspace.com.papi.components.checker.handler.{ResultHandler, ServletResultHandler}

import scala.annotation.StaticAnnotation
import scala.reflect.BeanProperty
import scala.reflect.runtime.universe
import scala.xml._

/**
 * If set the annotation states that the configuration option
 * affects the state machine in checker format, if not set the
 * config option only affects runtime.
 */
private final class AffectsChecker extends StaticAnnotation

object Config {
  private val checkerConfigTypes = {
    val affectsCheckerType = universe.typeOf[AffectsChecker]
    universe.typeOf[Config].members.filter(i => i.annotations.map(a => a.tpe).contains(affectsCheckerType))
  }
}

/**
 * This class contains all the configuration options for a {@link com.rackspace.com.papi.components.checker.Validator}
 *
 * A license is required for any SaxonEE functionality.  SaxonEE can be declared in xslEngine
 * and xsdEngine.
 */
class Config {
  //
  //  Setup appropriate factories.  We need these set to ensure config
  //  options work correctly.
  //
  System.setProperty ("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema/saxonica", "com.saxonica.jaxp.SchemaFactoryImpl")
  System.setProperty ("javax.xml.validation.SchemaFactory:http://www.w3.org/XML/XMLSchema/v1.1", "org.apache.xerces.jaxp.validation.XMLSchema11Factory")
  System.setProperty ("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema", "org.apache.xerces.jaxp.validation.XMLSchemaFactory")

  //
  //  Don't allow duplicate nodes in the machine.
  //
  @BeanProperty
  @AffectsChecker
  var removeDups : Boolean = true

  //
  //  Run code to validate that the validator was correctly generated
  //
  @BeanProperty var validateChecker : Boolean = true

  //
  //  The result handler, recives and manages all results.
  //
  @BeanProperty var resultHandler : ResultHandler = new ServletResultHandler

  //
  //  Use Xerces or SAXON-EE for XSD validation.  Note that the Saxon
  //  validator requires a license.
  //
  private var xsde : String = "Xerces"
  private val supportedXSDEngines = Set("Xerces", "SaxonEE")

  def xsdEngine : String = xsde
  def xsdEngine_= (engine : String) : Unit = {
    if (!supportedXSDEngines.contains(engine)) {
      throw new IllegalArgumentException("Unrecognized XSL engine: "+
        engine+" supported engines: "+supportedXSDEngines)
    }
    xsde = engine
  }

  def setXSDEngine (engine : String) : Unit = { xsdEngine_=(engine) }
  def getXSDEngine : String = xsdEngine

  //
  //  Use SAXON-EE for XSD validation: This means that in cases where
  //  XSD validation needs to be done use the Saxon XSD validator
  //  instead of the default Xerces validator.  Note that the Saxon
  //  validator requires a license.
  //
  @Deprecated
  def setUseSaxonEEValidation( use : Boolean ) : Unit = {

    depUseSaxonEEValidation = use

    if ( use ) {

      setXSLEngine( "SaxonEE" )
      setXSDEngine( "SaxonEE" )
    }
    else {

      setXSDEngine( "Xerces" )
    }
  }

  private var depUseSaxonEEValidation : Boolean = false

  @Deprecated
  def getUseSaxonEEValidation() : Unit = {

    xsdEngine == "SaxonEE"
  }

  @Deprecated
  def useSaxonEEValidation = getUseSaxonEEValidation()

  @Deprecated
  def useSaxonEEValidation_= ( use : Boolean ) : Unit = setUseSaxonEEValidation( use )

  //
  //  Check Well-Formed XML and JSON
  //
  @BeanProperty
  @AffectsChecker
  var checkWellFormed : Boolean = false

  //
  //  Check all XML against XSD Grammars
  //
  @BeanProperty
  @AffectsChecker
  var checkXSDGrammar : Boolean = false

  //
  //  Allow XSD grammar transform.  Transform the XML after
  //  validation, to fill in things like default values etc.
  //
  @BeanProperty
  @AffectsChecker
  var doXSDGrammarTransform : Boolean = false

  //
  //  Check all JSON against JSON Schema Grammars
  //
  @BeanProperty
  @AffectsChecker
  var checkJSONGrammar : Boolean = false

  //
  //  Ensure elemets are correct
  //
  @BeanProperty
  @AffectsChecker
  var checkElements : Boolean = false

  //
  //  XPath version used in the WADL.  Can be 1 or 2. If 1 is set the
  //  Xalan implementation will be used, if 2 then Saxon will be used.
  //  Note that XPath 2 with schema awareness requires a Saxon
  //  license.
  //
  private var xpv : Int = 1

  @AffectsChecker
  def xpathVersion : Int = xpv

  def xpathVersion_= (version : Int) : Unit = {
    if ((version != 1) && (version != 2))
      throw new IllegalArgumentException("XPath version can only be 1 or 2.")
    xpv = version
  }

  def setXPathVersion (version : Int) : Unit = { xpathVersion_=(version) }
  def getXPathVersion : Int = xpathVersion

  //
  //  Check plain parameters
  //
  @BeanProperty
  @AffectsChecker
  var checkPlainParams : Boolean = false

  //
  //  Enable preprocess extension
  //
  @BeanProperty
  @AffectsChecker
  var enablePreProcessExtension : Boolean = true

  //
  //  Enable ignore XSD extension
  //
  @BeanProperty
  @AffectsChecker
  var enableIgnoreXSDExtension : Boolean = true

  //
  //  Enable ignore JSON Schema extension
  //
  @BeanProperty
  @AffectsChecker
  var enableIgnoreJSONSchemaExtension : Boolean = true

  //
  //  Enable message extension
  //
  @BeanProperty
  @AffectsChecker
  var enableMessageExtension : Boolean = true

  //
  //  Enable rax-roles extension
  //
  @BeanProperty
  @AffectsChecker
  var enableRaxRolesExtension : Boolean = false

  //
  //  Mask rax-roles with 404 and 405 errors. By default rax-roles
  //  response with a 403 if there is a role mismatch, if
  //  maskRaxRoles403 is true then the respose will be 404 if no
  //  methods are accessible or 405 if some methods are available.
  //
  @BeanProperty
  @AffectsChecker
  var maskRaxRoles403 : Boolean = false

  //
  //  Enable capture header extension.  This extension allows
  //  capturing the contents of a WADL parameter to a request
  //  header. Currently works with template, header, and XML plain
  //  parameters.
  @BeanProperty
  @AffectsChecker
  var enableCaptureHeaderExtension : Boolean = true

  //
  //  The XSL 1.0 engine to use.  Possible choices are Xalan, XalanC,
  //  and Saxon. Note that Saxon is an XSL 2.0 engine, but most 1.0
  //  XSLs should work fine.
  //
  private var xsle : String = "XalanC"
  private val supportedXSLEngines = Set("Xalan", "XalanC", "SaxonHE", "SaxonEE",
  "Saxon" )  // NOTE:  "Saxon" is deprecated as well, remove when removing depUseSaxonEEValidation

  def xslEngine : String = xsle
  def xslEngine_= (engine : String) : Unit = {

    if (!supportedXSLEngines.contains(engine)) {
      throw new IllegalArgumentException("Unrecognized XSL engine: "+
                                         engine+" supported engines: "+supportedXSLEngines)
    }

    xsle =  engine match {
      case "Saxon" => if (depUseSaxonEEValidation) "SaxonEE" else "SaxonHE"
      case _ => engine
    }
  }

  def setXSLEngine (engine : String) : Unit = { xslEngine_=(engine) }
  def getXSLEngine : String = xslEngine

  //
  //  This is an optimization where the well formness check and
  //  multiple XPath checks can be merged into a single check.
  //
  @BeanProperty
  @AffectsChecker
  var joinXPathChecks : Boolean = false

  //
  //  Check that required headers are set.
  //

  @BeanProperty
  @AffectsChecker
  var checkHeaders : Boolean = false

  //
  // Preserve the ability to process the request body always. Setting
  // this to true ensures that the request remains readable after
  // validation is performed. Setting this to true, however, may also
  // disable some optimizations.
  //

  @BeanProperty
  @AffectsChecker
  var preserveRequestBody : Boolean = false

  /**
   * Returns checker metadata (<meta/> element in checker format) for
   * the config options that affect the checker.
   */
  def checkerMetaElem : Elem = {
    <meta xmlns="http://www.rackspace.com/repose/wadl/checker">
      {
        checkerMetaMap.map(c => <config option={c._1} value={c._2.toString} />)
      }
    </meta>
  }

  /**
   * Provides a map from checker meta option to its value.
   */
  def checkerMetaMap : Map[String, Any] = {
    val conf_ref = universe.runtimeMirror(this.getClass.getClassLoader).reflect(this)
    val fields = Config.checkerConfigTypes.filter(s => !s.isMethod).map(s =>s.asTerm).map(s => {
      (s.name.toString.trim -> conf_ref.reflectField(s).get)
    }).toList
    val methods = Config.checkerConfigTypes.filter(s => s.isMethod).map(s =>s.asMethod).map(s => {
      (s.name.toString.trim -> conf_ref.reflectMethod(s).apply())
    }).toList
    Map() ++ (fields ::: methods)
  }
}


text:
namespace peachy {

  class ScriptSource;
  class TokenFactory;

  class Lexer : public TokenSource {

    public:

      Lexer(Log * logger, TokenFactory * tokenFactory,
            ScriptSource * scriptSource)
        : TokenSource(logger, tokenFactory, scriptSource) {
        logger->debug("Lexer constructor");
        setState(LEXER_NEED_INPUT);
        currentPos = 0;
      }
      ~Lexer();

      Token * nextToken();

    protected:

      void setState(LexerState state);
      void setCurrentLine(std::string line);
      bool atEndOfLine();

      LexerState getState();

      bool isNumeric(char c);
      bool isLetter(char c);
      bool isIdentifier(char c);
      bool isOperatorChar(char c);
      bool isKeyword(std::string s);
      bool isLineEnding(char c);
      bool isOperator(std::string s);

    private:

      void resetLine();
      void resetToken();
      void consume(bool appendChar);

      LexerState state;

      char currentChar;
      unsigned int currentPos;
      std::string currentLine;
      std::string currentSequence;

      Lexer();
      Lexer(const Lexer & lexer);
      Lexer & operator = (const Lexer & lexer);
  };
}

#endif


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.rocket.shop</groupId>
    <artifactId>myshop-manager</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>myshop-manager-service-interface</artifactId>
  <dependencies>
  	<dependency>
  		<groupId>com.rocket.shop</groupId>
  		<artifactId>myshop-common</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  	</dependency>
  </dependencies>
</project>


text:
class AgendaItem < ActiveRecord::Base
  self.table_name = 'opencivicdata_eventagendaitem'
  default_scope { includes(:event)
    .order('opencivicdata_event.start_time')
    .order('opencivicdata_event.name')
    .order('opencivicdata_eventagendaitem.order::int')
  }
  belongs_to :event
  has_many :event_related_entities

  def bill
    self.event_related_entities[0]
  end

  def self.votable
    self.where.contains(classification: ['action'])
  end

  def self.upcoming
    self.where('opencivicdata_event.start_time > ?', Time.now)
  end

  def self.latest
    # Approximates latest by assuming furthest ahead are latest :/
    self.reorder('opencivicdata_event.start_time DESC').order('opencivicdata_eventagendaitem.order::int')
  end
end


text:
<?php
/**
 * File WriteTestConfigurationsTest.php
 *
 * @author Edward Pfremmer <epfremme@nerdery.com>
 */
namespace Epfremme\Everything\Tests\Handler\Setup;

use Epfremme\Collection\Collection;
use Epfremme\Everything\Composer\Json;
use Epfremme\Everything\Entity\Package;
use Epfremme\Everything\Filesystem\Cache;
use Epfremme\Everything\Handler\Package\FilterPackageVersions;
use Epfremme\Everything\Handler\Setup\GetBaseConfiguration;
use Epfremme\Everything\Handler\Setup\WriteTestConfigurations;
use Epfremme\Everything\Tests\Composer\JsonTest;
use Epfremme\Everything\Tests\Entity\PackageTest;
use Epfremme\Everything\Tests\Traits\SerializerTrait;

/**
 * Class WriteTestConfigurationsTest
 *
 * @package Epfremme\Everything\Tests\Handler\Setup
 */
class WriteTestConfigurationsTest extends \PHPUnit_Framework_TestCase
{
    use SerializerTrait;

    /**
     * @var Collection
     */
    private $packages;

    /**
     * @var Cache|\Mockery\MockInterface
     */
    private $cache;

    /**
     * @var Json
     */
    private $json;

    /**
     * @var \ArrayObject
     */
    private $base;

    /**
     * {@inheritdoc}
     */
    public function setUp()
    {
        parent::setUp();

        $serializer = $this->getSerializer();

        $this->packages = new Collection([
            'a/a' => $serializer->deserialize(str_replace('test/test', 'a/a', PackageTest::TEST_PACKAGE_JSON), Package::class, 'json'),
            'b/b' => $serializer->deserialize(str_replace('test/test', 'b/b', PackageTest::TEST_PACKAGE_JSON), Package::class, 'json'),
            'c/c' => $serializer->deserialize(str_replace('test/test', 'c/c', PackageTest::TEST_PACKAGE_JSON), Package::class, 'json'),
        ]);

        $baseConfigHandler = new GetBaseConfiguration($this->packages);
        $versionFilterHandler = new FilterPackageVersions('^1.0');

        $this->packages->each(function(Package $package) use ($versionFilterHandler) {
            $versionFilterHandler($package);
        });

        $this->cache = \Mockery::mock(Cache::class);
        $this->json = new Json(JsonTest::TEST_COMPOSER_JSON);
        $this->base = $baseConfigHandler();
    }

    public function testConstruct()
    {
        $handler = new WriteTestConfigurations($this->packages, $this->cache, $this->json);

        $this->assertAttributeSame($this->packages, 'packages', $handler);
        $this->assertAttributeSame($this->cache, 'cache', $handler);
        $this->assertAttributeSame($this->json, 'json', $handler);
    }

    public function testInvoke()
    {
        $handler = new WriteTestConfigurations($this->packages, $this->cache, $this->json);

        $this->cache->shouldReceive('addConfig')->with($this->json)->atMost()->times(2);

        $this->assertSame($this->packages, $handler($this->base));
    }
}


text:
const { keyConfigBuildDll } = require('koot/defaults/before-build')
const build = require('./build')

/**
 * Webpack 打包: DLL
 * 参考文档: https://webpack.js.org/plugins/dll-plugin/
 * @async
 * @param {Object} kootBuildConfig
 * @returns {void}
 */
module.exports = async (kootBuildConfig = {}) => {
    kootBuildConfig[keyConfigBuildDll] = true
    return await build(kootBuildConfig)
}


text:
package com.zkhy.web.integration.index.entity;

import java.util.Date;

import com.zkhy.fw.integration.entity.BaseEntity;

public class TimeLineEntity extends BaseEntity {
    private static final long serialVersionUID = -5791886490654530524L;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column t_timeline.DATE_ID
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    private int dateId;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column t_timeline.DATE_START
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    private Date dateStart;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column t_timeline.DATE_END
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    private Date dateEnd;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column t_timeline.DATE_ID
     *
     * @return the value of t_timeline.DATE_ID
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public int getDateId() {
        return dateId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column t_timeline.DATE_ID
     *
     * @param dateId the value for t_timeline.DATE_ID
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public void setDateId(int dateId) {
        this.dateId = dateId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column t_timeline.DATE_START
     *
     * @return the value of t_timeline.DATE_START
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public Date getDateStart() {
        return dateStart;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column t_timeline.DATE_START
     *
     * @param dateStart the value for t_timeline.DATE_START
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public void setDateStart(Date dateStart) {
        this.dateStart = dateStart;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column t_timeline.DATE_END
     *
     * @return the value of t_timeline.DATE_END
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public Date getDateEnd() {
        return dateEnd;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column t_timeline.DATE_END
     *
     * @param dateEnd the value for t_timeline.DATE_END
     *
     * @mbggenerated Mon Apr 07 18:07:22 CST 2014
     */
    public void setDateEnd(Date dateEnd) {
        this.dateEnd = dateEnd;
    }
}


text:
**Design inspiration and planning made easy!**

[PaperBits](http://paperbits.imagineer.in) is a full-stack JavaScript productivity app for creative people. The idea is to provide an interface similar to a digital scrap board, where user can create, store and refer to colors, images, urls, notes and todo tasks. This aggregates the common requirements on the inspiration and planning phases of design.

## About the app
PaperBits is created on top of the [MEAN.JS](http://meanjs.org/) Boilerplate, which uses [Node.js](http://nodejs.org/), [Express server](http://expressjs.com/), [AngularJS](angularjs.org) and [MongoDB](http://www.mongodb.org/).

## Prerequisites
Make sure you have installed all of the following prerequisites on your development machine:
* Node.js - [Download & Install Node.js](http://www.nodejs.org/download/) and the npm package manager. If you encounter any problems, you can also use this [GitHub Gist](https://gist.github.com/isaacs/579814) to install Node.js.
* MongoDB - [Download & Install MongoDB](http://www.mongodb.org/downloads), and make sure it's running on the default port (27017).
* Bower - You're going to use the [Bower Package Manager](http://bower.io/) to manage your front-end packages. Make sure you've installed Node.js and npm first, then install bower globally using npm:

```bash
$ npm install -g bower
```

* Grunt - You're going to use the [Grunt Task Runner](http://gruntjs.com/) to automate your development process. Make sure you've installed Node.js and npm first, then install grunt globally using npm:

```bash
$ npm install -g grunt-cli
```

## Install
After cloning this project, go to application root directory.

Install Node.js dependencies:

```bash
$ npm install
```

This command does a few things:
* First it will install the dependencies needed for the application to run.
* If you're running in a development environment, it will then also install development dependencies needed for testing and running your application.
* Finally, when the install process is over, npm will initiate a bower install command to install all the front-end modules needed for the application.

## Running the app
After the install process is over, run grunt default task:

```bash
$ grunt
```

Now the application will be running at [http://localhost:3000](http://localhost:3000)

## Live Example
Browse the live app on [http://paperbits.imagineer.in](http://paperbits.imagineer.in).


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Annls mycol. 40: 122 (1942)

#### Original name
Lactarius imaianus Singer

### Remarks
null


text:
'use strict';

app.factory('CategoriesResource', function($http, baseUrl) {
    var categoriesApi = baseUrl + '/api/categories';

    return {
        getAll: function() {
            return $http.get(categoriesApi);
        },
        getArticlesInCategory: function(id) {
            return $http.get(categoriesApi + '/' + id);
        }
    }
});


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class org.deuce.transaction.tl2cm.cm.ContentionManager.Action
</TITLE>

<META NAME="date" CONTENT="2010-03-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.deuce.transaction.tl2cm.cm.ContentionManager.Action

Packages that use ContentionManager.Action

org.deuce.transaction.tl2cm.cm

Uses of ContentionManager.Action in org.deuce.transaction.tl2cm.cm

Methods in org.deuce.transaction.tl2cm.cm that return ContentionManager.Action

 ContentionManager.Action
Timestamp.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
Suicide.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
Polka.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
Polite.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
LockSkipper.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
KarmaLockStealer.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
Karma.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

 ContentionManager.Action
ContentionManager.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

          Resolves the conflict between the two threads

 ContentionManager.Action
Aggressive.resolve(WriteFieldAccess contentionPoint,
        Context contending,
        Context other)

static ContentionManager.Action
ContentionManager.Action.valueOf(java.lang.String name)

          Returns the enum constant of this type with the specified name.

static ContentionManager.Action[]
ContentionManager.Action.values()

          Returns an array containing the constants of this enum type, in
the order they are declared.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
\hypertarget{class_s_character}{}\section{S\+Character Class Reference}
\label{class_s_character}\index{S\+Character@{S\+Character}}

{\ttfamily \#include $<$S\+Character.\+hpp$>$}

Inheritance diagram for S\+Character\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=175pt]{class_s_character__inherit__graph}
\end{center}
\end{figure}

Collaboration diagram for S\+Character\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=175pt]{class_s_character__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{class_s_character_aaa56aee926cdedadae1db5335f047cd1}{S\+Character} (int id)
\item
\hyperlink{class_s_character_aafb443599efbd749337eb0190fc5eabe}{$\sim$\+S\+Character} ()
\item
int16\+\_\+t \hyperlink{class_s_character_aed3654ba330a24ac0990047e56bccd32}{get\+Id} ()
\item
int16\+\_\+t \hyperlink{class_s_character_a023df9332c559507d8986facbb37dcad}{get\+X} ()
\item
int16\+\_\+t \hyperlink{class_s_character_acbdd136e3a70a94f2f08c7158f042de6}{get\+Y} ()
\item
int16\+\_\+t \hyperlink{class_s_character_af36a0d74ed25de0dc9e29213b46f7928}{get\+Velocity} ()
\item
int16\+\_\+t \hyperlink{class_s_character_ab1ffdf2103c6277f1ff34c7b48920320}{get\+My\+Weapon} ()
\item
\hyperlink{_enums_8hpp_a9c13bb5b1d69698f9b47900990eaa598}{Team} \hyperlink{class_s_character_a4384f9f73da73ddb603d4d85fdae00d7}{get\+Team} ()
\item
\hyperlink{_enums_8hpp_a224b9163917ac32fc95a60d8c1eec3aa}{Direction} \hyperlink{class_s_character_a4c4daa4601c62ada0af0dccef8680c60}{get\+Dir} ()
\item
void \hyperlink{class_s_character_a435234e99c79e6094daa3c554033d4ae}{set\+Dir} (\hyperlink{_enums_8hpp_a224b9163917ac32fc95a60d8c1eec3aa}{Direction} dir)
\item
void \hyperlink{class_s_character_ab99fa7f23b8c7c9ca45d78d5e9bb8742}{serialize} (char $\ast$buffer)
\item
bool \hyperlink{class_s_character_a84075df93e0ad219264a349a247b6986}{get\+Ready} ()
\item
void \hyperlink{class_s_character_a4537343129f515509139a762f4d04390}{make\+\_\+ready} ()
\item
void \hyperlink{class_s_character_a410a1a3d599fc8e91252805ce4c50f10}{set\+X} (int16\+\_\+t x)
\item
void \hyperlink{class_s_character_a7034f78acd75a886ecd02912b20ddcde}{set\+Y} (int16\+\_\+t y)
\item
void \hyperlink{class_s_character_a50249c9fdf9c98080fce5d9ff0e944ca}{set\+Team} (\hyperlink{_enums_8hpp_a9c13bb5b1d69698f9b47900990eaa598}{Team} team)
\item
void \hyperlink{class_s_character_a91f39c3163ed5bbadf6d49c6b69d52f6}{set\+My\+Weapon} (\hyperlink{_enums_8hpp_ad9700e9db9d62004af4a04e4e13912c5}{Weapon} my\+Weapon)
\end{DoxyCompactItemize}

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_s_character_aaa56aee926cdedadae1db5335f047cd1}{}\index{S\+Character@{S\+Character}!S\+Character@{S\+Character}}
\index{S\+Character@{S\+Character}!S\+Character@{S\+Character}}
\subsubsection[{S\+Character(int id)}]{\setlength{\rightskip}{0pt plus 5cm}S\+Character\+::\+S\+Character (
\begin{DoxyParamCaption}
\item[{int}]{id}
\end{DoxyParamCaption}
)}\label{class_s_character_aaa56aee926cdedadae1db5335f047cd1}
\hypertarget{class_s_character_aafb443599efbd749337eb0190fc5eabe}{}\index{S\+Character@{S\+Character}!````~S\+Character@{$\sim$\+S\+Character}}
\index{````~S\+Character@{$\sim$\+S\+Character}!S\+Character@{S\+Character}}
\subsubsection[{$\sim$\+S\+Character()}]{\setlength{\rightskip}{0pt plus 5cm}S\+Character\+::$\sim$\+S\+Character (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{class_s_character_aafb443599efbd749337eb0190fc5eabe}

\subsection{Member Function Documentation}
\hypertarget{class_s_character_a4c4daa4601c62ada0af0dccef8680c60}{}\index{S\+Character@{S\+Character}!get\+Dir@{get\+Dir}}
\index{get\+Dir@{get\+Dir}!S\+Character@{S\+Character}}
\subsubsection[{get\+Dir()}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Direction} S\+Character\+::get\+Dir (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a4c4daa4601c62ada0af0dccef8680c60}
\hypertarget{class_s_character_aed3654ba330a24ac0990047e56bccd32}{}\index{S\+Character@{S\+Character}!get\+Id@{get\+Id}}
\index{get\+Id@{get\+Id}!S\+Character@{S\+Character}}
\subsubsection[{get\+Id()}]{\setlength{\rightskip}{0pt plus 5cm}int16\+\_\+t S\+Character\+::get\+Id (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_aed3654ba330a24ac0990047e56bccd32}

Implements \hyperlink{class_i_g_object_a40fdbe0db5e995e22996567d77bf45c6}{I\+G\+Object}.

\hypertarget{class_s_character_ab1ffdf2103c6277f1ff34c7b48920320}{}\index{S\+Character@{S\+Character}!get\+My\+Weapon@{get\+My\+Weapon}}
\index{get\+My\+Weapon@{get\+My\+Weapon}!S\+Character@{S\+Character}}
\subsubsection[{get\+My\+Weapon()}]{\setlength{\rightskip}{0pt plus 5cm}int16\+\_\+t S\+Character\+::get\+My\+Weapon (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_ab1ffdf2103c6277f1ff34c7b48920320}
\hypertarget{class_s_character_a84075df93e0ad219264a349a247b6986}{}\index{S\+Character@{S\+Character}!get\+Ready@{get\+Ready}}
\index{get\+Ready@{get\+Ready}!S\+Character@{S\+Character}}
\subsubsection[{get\+Ready()}]{\setlength{\rightskip}{0pt plus 5cm}bool S\+Character\+::get\+Ready (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a84075df93e0ad219264a349a247b6986}
\hypertarget{class_s_character_a4384f9f73da73ddb603d4d85fdae00d7}{}\index{S\+Character@{S\+Character}!get\+Team@{get\+Team}}
\index{get\+Team@{get\+Team}!S\+Character@{S\+Character}}
\subsubsection[{get\+Team()}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Team} S\+Character\+::get\+Team (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a4384f9f73da73ddb603d4d85fdae00d7}

Here is the caller graph for this function\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_s_character_a4384f9f73da73ddb603d4d85fdae00d7_icgraph}
\end{center}
\end{figure}

\hypertarget{class_s_character_af36a0d74ed25de0dc9e29213b46f7928}{}\index{S\+Character@{S\+Character}!get\+Velocity@{get\+Velocity}}
\index{get\+Velocity@{get\+Velocity}!S\+Character@{S\+Character}}
\subsubsection[{get\+Velocity()}]{\setlength{\rightskip}{0pt plus 5cm}int16\+\_\+t S\+Character\+::get\+Velocity (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_af36a0d74ed25de0dc9e29213b46f7928}

Implements \hyperlink{class_i_g_object_afc8764ec832e6a60c58dace401d65b32}{I\+G\+Object}.

\hypertarget{class_s_character_a023df9332c559507d8986facbb37dcad}{}\index{S\+Character@{S\+Character}!get\+X@{get\+X}}
\index{get\+X@{get\+X}!S\+Character@{S\+Character}}
\subsubsection[{get\+X()}]{\setlength{\rightskip}{0pt plus 5cm}int16\+\_\+t S\+Character\+::get\+X (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_a023df9332c559507d8986facbb37dcad}

Implements \hyperlink{class_i_g_object_aa6ae1f7bd99277a3558a8e90d833fa7a}{I\+G\+Object}.

\hypertarget{class_s_character_acbdd136e3a70a94f2f08c7158f042de6}{}\index{S\+Character@{S\+Character}!get\+Y@{get\+Y}}
\index{get\+Y@{get\+Y}!S\+Character@{S\+Character}}
\subsubsection[{get\+Y()}]{\setlength{\rightskip}{0pt plus 5cm}int16\+\_\+t S\+Character\+::get\+Y (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_acbdd136e3a70a94f2f08c7158f042de6}

Implements \hyperlink{class_i_g_object_a3491bdb3a6b6ba8d66e07443a5b5951d}{I\+G\+Object}.

\hypertarget{class_s_character_a4537343129f515509139a762f4d04390}{}\index{S\+Character@{S\+Character}!make\+\_\+ready@{make\+\_\+ready}}
\index{make\+\_\+ready@{make\+\_\+ready}!S\+Character@{S\+Character}}
\subsubsection[{make\+\_\+ready()}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::make\+\_\+ready (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{class_s_character_a4537343129f515509139a762f4d04390}
\hypertarget{class_s_character_ab99fa7f23b8c7c9ca45d78d5e9bb8742}{}\index{S\+Character@{S\+Character}!serialize@{serialize}}
\index{serialize@{serialize}!S\+Character@{S\+Character}}
\subsubsection[{serialize(char $\ast$buffer)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::serialize (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buffer}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{class_s_character_ab99fa7f23b8c7c9ca45d78d5e9bb8742}

Implements \hyperlink{class_i_g_object_a6e2dd93acb47fc77668e2571bff3481e}{I\+G\+Object}.

\hypertarget{class_s_character_a435234e99c79e6094daa3c554033d4ae}{}\index{S\+Character@{S\+Character}!set\+Dir@{set\+Dir}}
\index{set\+Dir@{set\+Dir}!S\+Character@{S\+Character}}
\subsubsection[{set\+Dir(\+Direction dir)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::set\+Dir (
\begin{DoxyParamCaption}
\item[{{\bf Direction}}]{dir}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a435234e99c79e6094daa3c554033d4ae}
\hypertarget{class_s_character_a91f39c3163ed5bbadf6d49c6b69d52f6}{}\index{S\+Character@{S\+Character}!set\+My\+Weapon@{set\+My\+Weapon}}
\index{set\+My\+Weapon@{set\+My\+Weapon}!S\+Character@{S\+Character}}
\subsubsection[{set\+My\+Weapon(\+Weapon my\+Weapon)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::set\+My\+Weapon (
\begin{DoxyParamCaption}
\item[{{\bf Weapon}}]{my\+Weapon}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a91f39c3163ed5bbadf6d49c6b69d52f6}
\hypertarget{class_s_character_a50249c9fdf9c98080fce5d9ff0e944ca}{}\index{S\+Character@{S\+Character}!set\+Team@{set\+Team}}
\index{set\+Team@{set\+Team}!S\+Character@{S\+Character}}
\subsubsection[{set\+Team(\+Team team)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::set\+Team (
\begin{DoxyParamCaption}
\item[{{\bf Team}}]{team}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\label{class_s_character_a50249c9fdf9c98080fce5d9ff0e944ca}
\hypertarget{class_s_character_a410a1a3d599fc8e91252805ce4c50f10}{}\index{S\+Character@{S\+Character}!set\+X@{set\+X}}
\index{set\+X@{set\+X}!S\+Character@{S\+Character}}
\subsubsection[{set\+X(int16\+\_\+t x)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::set\+X (
\begin{DoxyParamCaption}
\item[{int16\+\_\+t}]{x}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_a410a1a3d599fc8e91252805ce4c50f10}

Implements \hyperlink{class_i_g_object_a4b810d1b4a785d7532104113ef5cf0ba}{I\+G\+Object}.

\hypertarget{class_s_character_a7034f78acd75a886ecd02912b20ddcde}{}\index{S\+Character@{S\+Character}!set\+Y@{set\+Y}}
\index{set\+Y@{set\+Y}!S\+Character@{S\+Character}}
\subsubsection[{set\+Y(int16\+\_\+t y)}]{\setlength{\rightskip}{0pt plus 5cm}void S\+Character\+::set\+Y (
\begin{DoxyParamCaption}
\item[{int16\+\_\+t}]{y}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}\label{class_s_character_a7034f78acd75a886ecd02912b20ddcde}

Implements \hyperlink{class_i_g_object_a5092ff8b79a61c3856510adb0543f229}{I\+G\+Object}.

The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item
/home/clemente/projects/\+Troll-\/\+Killers/\hyperlink{_s_character_8hpp}{S\+Character.\+hpp}\item
/home/clemente/projects/\+Troll-\/\+Killers/\hyperlink{_s_character_8cpp}{S\+Character.\+cpp}\end{DoxyCompactItemize}


text:
'use strict'

var chai = require('chai')
var assert = chai.assert

var memory = require('../../lib/memory')

describe('memory', function () {
  afterEach(function () {
    memory.remove('x')
  })

  describe('#get', function () {
    it('should not not get an empty record', function () {
      assert(memory.get('abc') === undefined)
    })

    it('should get an existing record', function () {
      memory.set('x', { a: 'b' })
      assert.deepEqual(memory.get('x'), { a: 'b' })
    })
  })

  describe('#set', function () {
    it('should be able to set a record', function () {
      memory.set('x', { a: 'b' })
      assert.deepEqual(memory.get('x'), { a: 'b' })
    })
  })

  describe('#remove', function () {
    it('should be able to remove a record', function () {
      memory.set('x', { a: 'b' })
      assert.deepEqual(memory.get('x'), { a: 'b' })
      memory.remove('x')
      assert(memory.get('x') === undefined)
    })
  })
})


text:
package com.github.sandor_balazs.nosql_java.domain;

import com.datastax.driver.mapping.annotations.*;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
import java.util.UUID;

/**
 * A ProjectMilestone.
 */

@Table(name = "projectMilestone")
public class ProjectMilestone implements Serializable {

    @PartitionKey
    private UUID id;

    private Date planned;

    private Date actual;

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public Date getPlanned() {
        return planned;
    }

    public void setPlanned(Date planned) {
        this.planned = planned;
    }

    public Date getActual() {
        return actual;
    }

    public void setActual(Date actual) {
        this.actual = actual;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ProjectMilestone projectMilestone = (ProjectMilestone) o;
        return Objects.equals(id, projectMilestone.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "ProjectMilestone{" +
            "id=" + id +
            ", planned='" + planned + "'" +
            ", actual='" + actual + "'" +
            '}';
    }
}


text:
require 'parslet/rig/rspec'
require 'pry'

Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |path|
  require path
end

RSpec.configure do |config|
  config.order = 'random'
end

Pry.config.tap do |config|
  config.output = STDOUT
  config.input = STDIN
end


text:
package com.github.binarywang.wxpay.bean.request;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.*;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * 查询汇率请求.
 *
 * @author Binary Wang
 * created on  2020-05-23
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@XStreamAlias("xml")
public class WxPayQueryExchangeRateRequest extends BaseWxPayRequest {
  private static final long serialVersionUID = -8796516942563060554L;
  /**
   * 币种
   * fee_type
   * 是
   * String(10)
   * USD
   * 外币币种
   */
  @XStreamAlias("fee_type")
  private String feeType;

  /**
   * 日期
   * date
   * 是
   * String(14)
   * 20150807
   * 格式为yyyyMMdd,如2009年12月25日表示为20091225。时区为GMT+8 beijing
   */
  @XStreamAlias("date")
  private String date;

  @Override
  protected void checkConstraints() throws WxPayException {

  }

  @Override
  protected void storeMap(Map<String, String> map) {

  }

  @Override
  protected boolean needNonceStr() {
    return false;
  }
}


text:
Easypaisa
---

[Easypaisa](http://www.easypaisa.com.pk/) payment module for [Opencart](http://www.opencart.com/).

Easypaisa is a branchless banking service introduced by Telenor Pakistan in partnership with Tameer Micro Finance Bank. Opencart is "a robust e-commerce solution for internet merchants with the ability to create their own online business and participate in e-commerce at a minimal cost".

This is a payment module that let's you offer Easypaisa as a payment option at checkout of an Opencart based store.

Installation
---

- Download the relevant `.ocmod.zip` file from [here][releases]
- Upload the zip file via _Extensions > Extension Installer_
- Under _Extension > Modifications_ click the refresh button to rebuild your modification cache!
- No core files are overwritten.
- Tested to work with v2.1.0.1, v2.1.0.2, v2.3.0.2

For Easypaisa extension for OpenCart v1.5.6x, [click here][1.5.6x].

Screenshots
---
![Payment Modules List](https://github.com/aamnah/easypaisa/blob/master/screenshots/payment-modules-list.png)

![Easypaisa Module Settings](https://github.com/aamnah/easypaisa/blob/master/screenshots/easypaisa-module.png)

![Easypaisa at Checkout](https://github.com/aamnah/easypaisa/blob/master/screenshots/easypaisa-checkout.png)

[releases]: https://github.com/aamnah/easypaisa/releases
[1.5.6x]: https://github.com/aamnah/easypaisa/tree/OC1.5x


text:
package org.apache.carbondata.spark.testsuite.dblocation

import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.datastore.impl.FileFactory
import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
import org.apache.spark.sql.{AnalysisException, CarbonEnv, Row}
import org.apache.spark.sql.test.util.QueryTest
import org.scalatest.BeforeAndAfterAll

/**
 *
 */
class DBLocationCarbonTableTestCase extends QueryTest with BeforeAndAfterAll {

  def getMdtFileAndType() = {
    // if mdt file path is configured then take configured path else take default path
    val configuredMdtPath = CarbonProperties.getInstance()
      .getProperty(CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER,
        CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER_DEFAULT).trim
    var timestampFile = configuredMdtPath + "/" + CarbonCommonConstants.SCHEMAS_MODIFIED_TIME_FILE
    timestampFile = CarbonUtil.checkAndAppendFileSystemURIScheme(timestampFile)
    val timestampFileType = FileFactory.getFileType(timestampFile)
    (timestampFile, timestampFileType)

  }

  override def beforeAll {
    sql("drop database if exists carbon cascade")
  }

  //TODO fix this test case
  test("Update operation on carbon table with insert into") {
    sql("drop database if exists carbon2 cascade")
    sql(s"create database carbon2 location '$dblocation'")
    sql("use carbon2")
    sql("""create table carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    // update operation
    sql("""update carbontable d  set (d.c2) = (d.c2 + 1) where d.c1 = 'a'""").show()
    sql("""update carbontable d  set (d.c2) = (d.c2 + 1) where d.c1 = 'b'""").show()
    checkAnswer(
      sql("""select c1,c2,c3,c5 from carbontable"""),
      Seq(Row("a",2,"aa","aaa"),Row("b",2,"bb","bbb"))
    )
    sql("drop database if exists carbon2 cascade")
  }

  test("create and drop database test") {
    sql(s"create database carbon location '$dblocation'")
    sql("drop database if exists carbon cascade")
  }

  test("create two databases at same table") {
    sql(s"create database carbon location '$dblocation'")
    try {
      sql(s"create database carbon1 location '$dblocation'")
    } catch {
      case e: AnalysisException =>
        assert(true)
    }
  }

  test("create table and load data") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql(s"""LOAD DATA LOCAL INPATH '$resourcesPath/dblocation/test.csv' INTO table carbon.carbontable""")
    checkAnswer(sql("select count(*) from carbontable"), Row(5))
  }

  test("create table and insert data") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    checkAnswer(sql("select count(*) from carbontable"), Row(1))
    checkAnswer(sql("select c1 from carbontable"), Seq(Row("a")))
  }

  test("create table and 2 times data load") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'aa','aaa'")
    checkAnswer(sql("select count(*) from carbontable"), Row(2))
    checkAnswer(sql("select c1 from carbontable"), Seq(Row("a"), Row("b")))
  }

  test("Update operation on carbon table") {
    sql("drop database if exists carbon1 cascade")
    sql(s"create database carbon1 location '$dblocation'")
    sql("use carbon1")
    sql(
      """
         CREATE TABLE automerge(id int, name string, city string, age int)
         STORED BY 'org.apache.carbondata.format'
      """)
    val testData = s"$resourcesPath/sample.csv"
    sql(s"LOAD DATA LOCAL INPATH '$testData' into table automerge")
    // update operation
    sql("""update carbon1.automerge d  set (d.id) = (d.id + 1) where d.id > 2""").show()
    checkAnswer(
      sql("select count(*) from automerge"),
      Seq(Row(6))
    )
    //    sql("drop table carbontable")
  }

  test("Delete operation on carbon table") {
    sql("drop database if exists carbon1 cascade")
    sql(s"create database carbon1 location '$dblocation'")
    sql("use carbon1")
    sql("""create table carbon1.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    // delete operation
    sql("""delete from carbontable where c3 = 'aa'""").show
    checkAnswer(
      sql("""select c1,c2,c3,c5 from carbon1.carbontable"""),
      Seq(Row("b",1,"bb","bbb"))
    )
    sql("drop table carbontable")
  }

  test("Alter table add column test") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable add columns(c4 string) " +
        "TBLPROPERTIES('DICTIONARY_EXCLUDE'='c4', 'DEFAULT.VALUE.c4'='def')")
    checkAnswer(
      sql("""select c1,c2,c3,c5,c4 from carbon.carbontable"""),
      Seq(Row("a",1,"aa","aaa","def"), Row("b",1,"bb","bbb","def"))
    )
    sql("drop table carbontable")
  }

  test("Alter table change column datatype test") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable change c2 c2 long")
    checkAnswer(
      sql("""select c1,c2,c3,c5 from carbon.carbontable"""),
      Seq(Row("a",1,"aa","aaa"), Row("b",1,"bb","bbb"))
    )
    sql("drop table carbontable")
  }

  test("Alter table change dataType with sort column after adding measure column test"){
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql(
      """create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string)
        |STORED BY 'org.apache.carbondata.format'
        |TBLPROPERTIES('SORT_COLUMNS' = 'c2')
        |""".stripMargin)
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable add columns (c6 int)")
    sql("Alter table carbontable change c2 c2 bigint")
    checkAnswer(
      sql("""select c1,c2,c3,c5 from carbon.carbontable"""),
      Seq(Row("a",1,"aa","aaa"), Row("b",1,"bb","bbb"))
    )
    sql("drop table carbontable")
  }

  test("Alter table change dataType with sort column after adding date datatype with default value test"){
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql(
      """create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string)
        |STORED BY 'org.apache.carbondata.format'
        |TBLPROPERTIES('SORT_COLUMNS' = 'c2')
        |""".stripMargin)
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable add columns (dateData date) TBLPROPERTIES('DEFAULT.VALUE.dateData' = '1999-01-01')")
    sql("Alter table carbontable change c2 c2 bigint")
    checkAnswer(
      sql("""select c1,c2,c3,c5 from carbon.carbontable"""),
      Seq(Row("a",1,"aa","aaa"), Row("b",1,"bb","bbb"))
    )
    sql("drop table carbontable")
  }

  test("Alter table change dataType with sort column after adding dimension column with default value test"){
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql(
      """create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string)
        |STORED BY 'org.apache.carbondata.format'
        |TBLPROPERTIES('SORT_COLUMNS' = 'c2')
        |""".stripMargin)
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable add columns (name String) TBLPROPERTIES('DEFAULT.VALUE.name' = 'hello')")
    sql("Alter table carbontable change c2 c2 bigint")
    checkAnswer(
      sql("""select c1,c2,c3,c5,name from carbon.carbontable"""),
      Seq(Row("a",1,"aa","aaa","hello"), Row("b",1,"bb","bbb","hello"))
    )
    sql("drop table carbontable")
  }

  test("Alter table change dataType with sort column after rename test"){
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql(
      """create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string)
        |STORED BY 'org.apache.carbondata.format'
        |TBLPROPERTIES('SORT_COLUMNS' = 'c2')
        |""".stripMargin)
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable add columns (name String) TBLPROPERTIES('DEFAULT.VALUE.name' = 'hello')")
    sql("Alter table carbontable rename to carbontable1")
    sql("Alter table carbontable1 change c2 c2 bigint")
    checkAnswer(
      sql("""select c1,c2,c3,c5,name from carbon.carbontable1"""),
      Seq(Row("a",1,"aa","aaa","hello"), Row("b",1,"bb","bbb","hello"))
    )
    sql("drop table if exists carbontable")
    sql("drop table if exists carbontable1")
  }

  test("Alter table drop column test") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("insert into carbontable select 'a',1,'aa','aaa'")
    sql("insert into carbontable select 'b',1,'bb','bbb'")
    sql("Alter table carbontable drop columns(c2)")
    checkAnswer(
      sql("""select * from carbon.carbontable"""),
      Seq(Row("a","aa","aaa"), Row("b","bb","bbb"))
    )
    sql("drop table carbontable")
  }

  test("test mdt file path with configured paths") {
    sql("drop database if exists carbon cascade")
    sql(s"create database carbon location '$dblocation'")
    sql("use carbon")
    CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER, "/tmp/carbondata1/carbondata2/")
    val (timestampFile, timestampFileType) = getMdtFileAndType()
    FileFactory.deleteFile(timestampFile, timestampFileType)
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("drop table carbontable")
    // perform file check
    assert(FileFactory.isFileExist(timestampFile, timestampFileType, true) ||
           CarbonEnv.getInstance(sqlContext.sparkSession).carbonMetastore.isReadFromHiveMetaStore)

    CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER,
        CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER_DEFAULT)
    val (timestampFile2, timestampFileType2) = getMdtFileAndType()
    FileFactory.deleteFile(timestampFile2, timestampFileType2)
    sql("""create table carbon.carbontable (c1 string,c2 int,c3 string,c5 string) STORED BY 'org.apache.carbondata.format'""")
    sql("drop table carbontable")
    // perform file check
    assert(FileFactory.isFileExist(timestampFile, timestampFileType, true) ||
           CarbonEnv.getInstance(sqlContext.sparkSession).carbonMetastore.isReadFromHiveMetaStore)
  }

  override def afterAll {
    CarbonProperties.getInstance()
      .addProperty(CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER,
        CarbonCommonConstants.CARBON_UPDATE_SYNC_FOLDER_DEFAULT)
    sql("use default")
    sql("drop database if exists carbon cascade")
  }
}


text:
using System;
using System.IO;
using System.Text;
using FlubuCore.WebApi.Configuration;
using FlubuCore.WebApi.Infrastructure;
using FluentValidation.AspNetCore;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
#if NETCOREAPP3_1
    using Microsoft.Extensions.Hosting;
#else
using IHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
#endif
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
using Serilog;
using Swashbuckle.AspNetCore.Swagger;
using Logger = Serilog.Core.Logger;

namespace FlubuCore.WebApi
{
    public class Startup
    {
        private string _secretKey;

        private SymmetricSecurityKey _signingKey;

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

        public IConfigurationRoot Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(options =>
                {
#if NETCOREAPP3_1
                     options.EnableEndpointRouting = false;
#endif
                })
                .AddFluentValidation(fv => fv.RegisterValidatorsFromAssemblyContaining<Startup>());

            services.Configure<FormOptions>(x =>
            {
                x.ValueLengthLimit = 1017483648;
                x.MultipartBodyLengthLimit = 1017483648;
            });

            services
                .AddCoreComponentsForWebApi(Configuration)
                .AddCommandComponentsForWebApi()
                .AddScriptAnalyserForWebApi()
                .AddTasksForWebApi();

            ConfigureAuthenticationServices(services);
#if !NETCOREAPP3_1
            ConfigureSwagger(services);
 #endif
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostEnvironment env, ILoggerFactory loggerFactory)
        {
            Logger log = new LoggerConfiguration()
                .WriteTo.LiteDB($"Logs/log_{DateTime.Now.Date:yyyy-dd-M}.db")
                .CreateLogger();

            loggerFactory.AddSerilog(log, true);
            loggerFactory.AddFile("Logs/Flubu-{Date}.txt");
            app.UseDeveloperExceptionPage();
            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
            app.UseStaticFiles();
#if !NETCOREAPP3_1
            app.UseSwagger(c =>
            {
                c.PreSerializeFilters.Add((swagger, httpReq) => swagger.Host = httpReq.Host.Value);
            });
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
            });
#endif
        }

        private static void ConfigureSwagger(IServiceCollection services)
        {
            services.AddSwaggerGen(options =>
            {
                options.SwaggerDoc("v1", new Info
                {
                    Version = "v1",
                    Title = "A1 API",
                    Description = "A1 API",
                    TermsOfService = "None",
                });

                options.CustomSchemaIds(x => x.FullName);
                var basePath = AppContext.BaseDirectory;
                var webApifilePath = Path.Combine(basePath, "FlubuCore.WebApi.xml");
                var modelfilePath = Path.Combine(basePath, "FlubuCore.WebApi.Model.xml");
                options.IncludeXmlComments(webApifilePath);
                options.IncludeXmlComments(modelfilePath);
                options.DescribeAllEnumsAsStrings();
                options.AddSecurityDefinition("Bearer",
                    new ApiKeyScheme()
                    {
                        In = "header",
                        Description =
                            "Please insert JWT with Bearer into field. Example value(Enter token without braces.): Bearer {JwtToken} ",
                        Name = "Authorization",
                        Type = "apiKey"
                    });
            });
        }

        private void ConfigureAuthenticationServices(IServiceCollection services)
        {
            var jwtAppSettingOptions = Configuration.GetSection(nameof(JwtOptions));
            _secretKey = jwtAppSettingOptions["secretKey"];
            double validFor = double.Parse(jwtAppSettingOptions[nameof(JwtOptions.ValidFor)]);
            _signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(_secretKey));

            services.Configure<JwtOptions>(options =>
            {
                options.Issuer = jwtAppSettingOptions[nameof(JwtOptions.Issuer)];
                options.Audience = jwtAppSettingOptions[nameof(JwtOptions.Audience)];
                options.SigningCredentials = new SigningCredentials(_signingKey, SecurityAlgorithms.HmacSha256);
                options.ValidFor = TimeSpan.FromMinutes(validFor);
            });

            services.Configure<WebApiSettings>(settings =>
                Configuration.GetSection(nameof(WebApiSettings)).Bind(settings));
            services.Configure<WebAppSettings>(settings =>
                Configuration.GetSection(nameof(WebAppSettings)).Bind(settings));
            services.Configure<NotificationSettings>(settings =>
                Configuration.GetSection(nameof(NotificationSettings)).Bind(settings));

            var tokenValidationParameters = new TokenValidationParameters
            {
                ValidateIssuer = true,
                ValidIssuer = jwtAppSettingOptions[nameof(JwtOptions.Issuer)],

                ValidateAudience = true,
                ValidAudience = jwtAppSettingOptions[nameof(JwtOptions.Audience)],

                ValidateIssuerSigningKey = true,
                IssuerSigningKey = _signingKey,

                RequireExpirationTime = true,
                ValidateLifetime = true,

                ClockSkew = TimeSpan.Zero
            };

            services.AddAuthentication(o =>
            {
                o.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                o.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
            }).AddJwtBearer(o =>
            {
                o.TokenValidationParameters = tokenValidationParameters;
            });

             services.AddAuthentication(o =>
                {
                    o.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                    o.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                    o.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                }).AddCookie(options =>
                {
                    options.LoginPath = new PathString("/Login");
                    options.Cookie.HttpOnly = true;
                    options.Cookie.SameSite = SameSiteMode.Lax;
                    options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
                });
        }
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ListView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\search\ArticleSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::$app->name . ' '. Yii::t('frontend-site', 'news');
$this->params['breadcrumbs'][] = Yii::t('frontend-site', 'Articles');
?>

<?php echo Html::encode($this->title) ?>
         - <?php echo Yii::t('frontend-site', 'The best news available') ?>

    <?php echo ListView::widget([
        'summary'       => false,
        'dataProvider'  => $dataProvider,
        'emptyText'     => Yii::t('frontend-site', "We haven't created any articles yet."),
        'itemOptions'   => ['class' => 'item'],
        'itemView'      => function ($model, $key, $index, $widget) {
            return $this->render('_index', ['model' => $model]);
        },
    ]) ?>


text:
var fonts = {
    helveticaCondensed: "Helvetica-Condensed",
    helveticaCondensedBold: "Helvetica-Condensed-Bold",
    helveticaNeue: "HelveticaNeue",
    helveticaNeueBold: "HelveticaNeue-Bold"
};

fonts.helveticaNeue = "Helvetica-Neue";

fonts.helveticaNeueBold = "Helvetica-Neue-bold";

var commonFonts = {
    helveticaCondensed8: {
        fontSize: " 8dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed10: {
        fontSize: "10dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed11: {
        fontSize: "11dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed12: {
        fontSize: "12dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed13: {
        fontSize: "13dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed14: {
        fontSize: "14dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed15: {
        fontSize: "15dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed16: {
        fontSize: "16dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed18: {
        fontSize: "18dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed21: {
        fontSize: "21dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed25: {
        fontSize: "25dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensed36: {
        fontSize: "36dp",
        fontFamily: fonts.helveticaCondensed
    },
    helveticaCondensedBold8: {
        fontSize: " 8dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold10: {
        fontSize: "10dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold11: {
        fontSize: "11dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold12: {
        fontSize: "12dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold14: {
        fontSize: "14dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold15: {
        fontSize: "15dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold16: {
        fontSize: "16dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold18: {
        fontSize: "18dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold20: {
        fontSize: "20dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold22: {
        fontSize: "22dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold27: {
        fontSize: "27dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold30: {
        fontSize: "30dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaCondensedBold36: {
        fontSize: "36dp",
        fontFamily: fonts.helveticaCondensedBold,
        fontWeight: "bold"
    },
    helveticaNeue6: {
        fontSize: "6dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue8: {
        fontSize: "8dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue9: {
        fontSize: "9dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue10: {
        fontSize: "10dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue12: {
        fontSize: "12dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue14: {
        fontSize: "14dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue15: {
        fontSize: "15dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue18: {
        fontSize: "18dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue28: {
        fontSize: "22dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeue29: {
        fontSize: "29dp",
        fontFamily: fonts.helveticaNeue
    },
    helveticaNeueBold10: {
        fontSize: "10dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold11: {
        fontSize: "11dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold12: {
        fontSize: "12dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold14: {
        fontSize: "14dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold16: {
        fontSize: "16dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold18: {
        fontSize: "18dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold20: {
        fontSize: "20dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold22: {
        fontSize: "22dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    },
    helveticaNeueBold24: {
        fontSize: "24dp",
        fontFamily: fonts.helveticaNeueBold,
        fontWeight: "bold"
    }
};


text:
This document will be updated periodically. Each update will attempt to follow the this format:
```
├── Date of update
│   ├── Current Release [number]
│   │   ├── Details
│   │   ├── [Applicable Links/Extra Info]
│   ├── Next Release [number]
│   │   ├── Details
│   │   ├── [Applicable Links/Extra Info]
|   ├── Release [number] -- repeated as relevant
│   │   ├── Details
│   │   ├── [Applicable Links/Extra Info]
|   ├── In the future
│   │   ├── Details
│   │   ├── [Applicable Links/Extra Info]
```
## 4/29/2015
### Current Release - v0.1.0
#### Details
- View all issues for the requested repository - including comments.
- After entering a user name, the repository picker is pre-populated with the user/org repos.
- Clicking on the title of an `issue` will open the `issue` on github using the default action as set by the users machine

### Next release - v0.2.0
#### Details
- Allow sign-in using `OAuth`, without persistance between program runs.
- If signed in, github user picker defaults to current user.

### Next Release - v0.3.0
#### Details
- Add view of all issues for given user/org.
- If signed in default to this view -and load the data.

#### Extra Info
- The `Issue` model will need to be updated to provide the `repo` and `user` name.


text:
SCRIPT="/usr/bin/python3 /usr/local/garagecontrol/garage_service.py"
RUNAS=root

PIDFILE=/var/run/garagecontrol.pid
LOGFILE=/var/log/garagecontrol.log

start() {
  if [ -f $PIDFILE ] && kill -0 $(cat $PIDFILE); then
    echo 'Service already running' >&2
    return 1
  fi
  echo 'Starting service' >&2
  local CMD="$SCRIPT &> \"$LOGFILE\" & echo \$!"
  su -c "$CMD" $RUNAS > "$PIDFILE"
  echo 'Service started' >&2
}

stop() {
  if [ ! -f "$PIDFILE" ] || ! kill -0 $(cat "$PIDFILE"); then
    echo 'Service not running' >&2
    return 1
  fi
  echo 'Stopping service' >&2
  kill -15 $(cat "$PIDFILE") && rm -f "$PIDFILE"
  echo 'Service stopped' >&2
}

uninstall() {
  echo -n "Are you really sure you want to uninstall this service? That cannot be undone. [yes|No] "
  local SURE
  read SURE
  if [ "$SURE" = "yes" ]; then
    stop
    rm -f "$PIDFILE"
    echo "Notice: log file is not be removed: '$LOGFILE'" >&2
    update-rc.d -f garagecontrol remove
    rm -fv "$0"
  fi
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  uninstall)
    uninstall
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|uninstall}"
esac


text:
"""
Auth shell
"""
import sys
from romeo_auth.ldaptools import LDAPTools
import json
from blessings import Terminal

term = Terminal()
# Load config
fh=open("config.json", "r")
config = json.loads(fh.read())
fh.close()
# Set up tools
ldaptools = LDAPTools(config)
# Enter prompt
print("Entering interactive Romeo Auth admin shell")
sys.ps1 = "{t.magenta}auth > {t.normal}".format(t=term)
import code
code.InteractiveConsole(locals=globals()).interact()


text:
package org.apache.jena.fuseki.servlets ;

import org.apache.jena.fuseki.FusekiLib ;
import org.apache.jena.riot.RiotException ;
import org.apache.jena.riot.system.StreamRDF ;
import org.apache.jena.riot.system.StreamRDFLib ;
import org.apache.jena.sparql.core.DatasetGraph ;
import org.apache.jena.sparql.core.DatasetGraphFactory ;

/**
 * Servlet for operations directly on a dataset - REST(ish) behaviour on the
 * dataset URI.
 */

public class REST_Quads_RW extends REST_Quads_R {

    public REST_Quads_RW() {
        super() ;
    }

    @Override
    protected void validate(HttpAction action) { }

    @Override
    protected void doPost(HttpAction action) {
        if ( !action.getDataService().allowUpdate() )
            ServletOps.errorMethodNotAllowed("POST") ;

        if ( action.isTransactional() )
            doPutPostTxn(action, false) ;
        else
            doPutPostNonTxn(action, false) ;
    }

    @Override
    protected void doPut(HttpAction action) {
        if ( !action.getDataService().allowUpdate() )
            ServletOps.errorMethodNotAllowed("POST") ;

        if ( action.isTransactional() )
            doPutPostTxn(action, true) ;
        else
            doPutPostNonTxn(action, true) ;
    }

    // These are very similar to SPARQL_REST_RW.addDataIntoTxn/nonTxn
    // Maybe can be usually DRYed.

    @Override
    protected void doDelete(HttpAction action) {
        ServletOps.errorMethodNotAllowed("DELETE") ;
    }

    @Override
    protected void doPatch(HttpAction action) {
        ServletOps.errorMethodNotAllowed("PATCH") ;
    }

    private void doPutPostTxn(HttpAction action, boolean clearFirst) {
        UploadDetails details = null ;
        action.beginWrite() ;
        try {
            DatasetGraph dsg = action.getActiveDSG() ;
            if ( clearFirst )
                dsg.clear() ;
            StreamRDF dest = StreamRDFLib.dataset(dsg) ;
            details = Upload.incomingData(action, dest) ;
            action.commit() ;
            ServletOps.success(action) ;
        } catch (RiotException ex) {
            // Parse error
            action.abort() ;
            ServletOps.errorBadRequest(ex.getMessage()) ;
        } catch (Exception ex) {
            // Something else went wrong. Backout.
            action.abort() ;
            ServletOps.errorOccurred(ex.getMessage()) ;
        } finally {
            action.endWrite() ;
        }
        ServletOps.uploadResponse(action, details) ;
    }

    private void doPutPostNonTxn(HttpAction action, boolean clearFirst) {
        DatasetGraph dsgTmp = DatasetGraphFactory.createMem() ;
        StreamRDF dest = StreamRDFLib.dataset(dsgTmp) ;

        UploadDetails details ;
        try {
            details = Upload.incomingData(action, dest) ;
        } catch (RiotException ex) {
            ServletOps.errorBadRequest(ex.getMessage()) ;
            return ;
        }
        // Now insert into dataset
        action.beginWrite() ;
        try {
            DatasetGraph dsg = action.getActiveDSG() ;
            if ( clearFirst )
                dsg.clear() ;
            FusekiLib.addDataInto(dsgTmp, dsg) ;
            action.commit() ;
            ServletOps.success(action) ;
        } catch (Exception ex) {
            // We're in the non-transactional branch, this probably will not
            // work
            // but it might and there is no harm safely trying.
            try {
                action.abort() ;
            } catch (Exception ex2) {}
            ServletOps.errorOccurred(ex.getMessage()) ;
        } finally {
            action.endWrite() ;
        }
        ServletOps.uploadResponse(action, details) ;
    }
}


text:
import rospy, unittest, rostest
import rosnode
import time

class DetectionTest(unittest.TestCase):
    def test_node_exist(self):
        nodes = rosnode.get_node_names()
        self.assertIn('/receiver', nodes, 'node does not exist')

if __name__ == '__main__':
    time.sleep(3) # テスト対象のノードが立ち上がるのを待つ
    rospy.init_node('test_detection')
    rostest.rosrun('grsim_wrapper', 'test_detection', DetectionTest)


text:
NSSize const PADDING_RECESSEDBEZELSTYLE = {8,0};
NSSize const PADDING_TAGBEZELSTYLE = {10,2};
NSSize const MARGIN_TAGBEZELSTYLE = {5,3};

NSInteger const HEIGHT_RECESSEDBEZELSTYLE_SMALL = 15;

@interface PAButtonCell (PrivateAPI)

- (void)commonInit;

- (void)drawRecessedButtonWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
- (void)drawTagButtonWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;

@end

@implementation PAButtonCell

#pragma mark Init + Dealloc
- (id)initImageCell:(NSImage *)anImage
{
	self = [super initImageCell:anImage];
	if(self)
	{
		images = [[NSMutableDictionary alloc] init];
		//if (anImage) [self setImage:anImage forState:PAOffState];

		[self commonInit];
	}
	return self;
}

- (id)initTextCell:(NSString *)aText
{
	self = [super initTextCell:aText];
	if(self)
	{
		[self setTitle:aText];
		[self commonInit];
	}
	return self;
}

- (void)commonInit
{
	[self setState:PAOffState];
	[self setButtonType:PAMomentaryLightButton];
	[self setBezelStyle:PARecessedBezelStyle];
	[self setBordered:YES];

	[self setBezelColor:[NSColor colorWithDeviceRed:(222.0/255.0) green:(231.0/255.0) blue:(248.0/255.0) alpha:1.0]];
	[self setSelectedBezelColor:[NSColor alternateSelectedControlColor]];
	[self setNegatedBezelColor:[NSColor colorWithCalibratedRed:180.0/255.0 green:0.0 blue:0.0 alpha:1.0]];
	[self setFontSize:11];

	tag = [[NSMutableDictionary alloc] init];
}

- (void)dealloc
{
	if(bezelColor) [bezelColor release];
	if(selectedBezelColor) [selectedBezelColor release];
	if(negatedBezelColor) [negatedBezelColor release];
	if(title) [title release];
	if(attributedTitle) [attributedTitle release];
	if(images) [images release];
	if(tag) [tag release];
	[super dealloc];
}

#pragma mark Drawing
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
	// Clear all drawings
	[[NSColor clearColor] set];
	[[NSBezierPath bezierPathWithRect:cellFrame] fill];

	if(bordered)
	{
		switch(bezelStyle)
		{
			case PARecessedBezelStyle:
				[self drawRecessedButtonWithFrame:cellFrame inView:controlView]; break;
			case PATagBezelStyle:
				[self drawTagButtonWithFrame:cellFrame inView:controlView]; break;
		}

	} else {
		// TODO: Draw image-only button
	}
}

- (void)highlight:(BOOL)flag withFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
	[self drawInteriorWithFrame:cellFrame inView:controlView];
}

- (void)drawRecessedButtonWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
	NSMutableAttributedString *label = [self attributedTitle];

	// Set colors
	NSColor *textColor;
	NSColor *shadowColor;

	if([self isHighlighted] || [self isHovered])
	{
		textColor = [NSColor alternateSelectedControlTextColor];
		shadowColor = [NSColor colorWithDeviceWhite:0.2 alpha:0.6];
	} else {
		textColor = [NSColor colorWithDeviceWhite:0.1 alpha:0.9];
		shadowColor = [NSColor whiteColor];
	}
	[label addAttribute:NSForegroundColorAttributeName
				  value:textColor
				  range:NSMakeRange(0, [label length])];

	// Add shadow
	NSShadow *shdw = [[NSShadow alloc] init];

	NSSize shadowOffset;
	if([controlView isFlipped]) { shadowOffset = NSMakeSize(0, -1); } else { shadowOffset = NSMakeSize(0, 1); }
	[shdw setShadowOffset:shadowOffset];
	[shdw setShadowColor:shadowColor];
	[label addAttribute:NSShadowAttributeName
				  value:shdw
				  range:NSMakeRange(0, [label length])];
	[shdw release];

	NSMutableParagraphStyle *paraStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
	[paraStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];
	[paraStyle setAlignment:NSCenterTextAlignment];
	[label addAttribute:NSParagraphStyleAttributeName
				  value:paraStyle
				  range:NSMakeRange(0, [label length])];

	NSSize padding = PADDING_RECESSEDBEZELSTYLE;

	NSImage *bezelImage = nil;
	if([self isHovered] && ![self isHighlighted] && ![self isPressed])
		bezelImage = [NSImage imageNamed:@"TabHover"];
	else if([self isHighlighted] && ![self isPressed])
		bezelImage = [NSImage imageNamed:@"TabSelected"];
	else if([self isPressed])
		bezelImage = [NSImage imageNamed:@"TabActive"];

	if(bezelImage)
	{
		[bezelImage setScalesWhenResized:YES];
		if([controlView isFlipped]) [bezelImage setFlipped:YES];

		NSRect imgRect;
		NSRect destRect;

		// Draw left edge
		imgRect.origin = NSZeroPoint;
		imgRect.size = NSMakeSize(7, 15);
		destRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, 7, 15);
		[bezelImage drawInRect:destRect fromRect:imgRect operation:NSCompositeSourceOver fraction:1.0];

		// Draw scaled background
		imgRect.origin = NSMakePoint(7, 0);
		imgRect.size = NSMakeSize(1, 15);
		destRect = NSMakeRect(cellFrame.origin.x + 7, cellFrame.origin.y, abs(cellFrame.size.width) - 15, 15);
		//NSLog(@"%f %f", cellFrame.origin.x, cellFrame.size.width);
		[bezelImage drawInRect:destRect fromRect:imgRect operation:NSCompositeSourceOver fraction:1.0];

		// Draw right edge
		imgRect.origin = NSMakePoint(8, 0);
		imgRect.size = NSMakeSize(7, 15);
		destRect = cellFrame;
		destRect.origin.x = abs(destRect.size.width) - 8;
		destRect.size.width = 7;
		[bezelImage drawInRect:destRect fromRect:imgRect operation:NSCompositeSourceOver fraction:1.0];
	}

	[label drawInRect:NSInsetRect(cellFrame, padding.width, padding.height)];
}

- (void)drawTagButtonWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
	NSMutableAttributedString *label = [self attributedTitle];

	// Set colors
	NSColor *textColor;
	if([self isHighlighted] || [self isPressed])
	{
		textColor = [NSColor whiteColor];
	} else {
		textColor = [NSColor textColor];
	}
	[label addAttribute:NSForegroundColorAttributeName
				  value:textColor
				  range:NSMakeRange(0, [label length])];

	// Set paragraph style
	NSMutableParagraphStyle *paraStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
	[paraStyle setLineBreakMode:NSLineBreakByTruncatingMiddle];
	[paraStyle setAlignment:NSCenterTextAlignment];
	[label addAttribute:NSParagraphStyleAttributeName
				  value:paraStyle
				  range:NSMakeRange(0, [label length])];

	NSSize padding = PADDING_TAGBEZELSTYLE;

	// Move cellFrame if showsCloseIcon
	NSRect originalCellFrame = cellFrame;
	if([self showsCloseIcon])
	{
		if([controlView isFlipped])
			cellFrame.origin.y += MARGIN_TAGBEZELSTYLE.height;

		cellFrame.origin.x += MARGIN_TAGBEZELSTYLE.width;
		cellFrame.size.width -= MARGIN_TAGBEZELSTYLE.width;
		cellFrame.size.height -= MARGIN_TAGBEZELSTYLE.height;
	}

	// Add bezel
	if([self isHighlighted] || [self isHovered] || [self isPressed] || [self isSelected])
	{
		NSColor *outerBezelColor;
		if([self isHighlighted] || [self isPressed])
		{
			if ([self isNegated])
				outerBezelColor = [self negatedBezelColor];
			else
				outerBezelColor = [self selectedBezelColor];
		} else if([self isHovered]) {
			outerBezelColor = [bezelColor blendedColorWithFraction:0.55 ofColor:[self selectedBezelColor]];
		} else {
			outerBezelColor = [bezelColor blendedColorWithFraction:0.4 ofColor:[self selectedBezelColor]];
		}

		NSBezierPath *bezel = [NSBezierPath bezierPathWithRoundRectInRect:cellFrame radius:20.0];
		[bezel setLineWidth:1.1];
		[outerBezelColor set];
		[bezel fill];

		if(!([self isHighlighted] || [self isPressed]))
		{
			// Draw inner bezel
			NSColor *innerBezelColor = bezelColor;
			if([self isHovered])
				innerBezelColor = [bezelColor blendedColorWithFraction:0.15 ofColor:[self selectedBezelColor]];

			bezel = [NSBezierPath bezierPathWithRoundRectInRect:NSInsetRect(cellFrame, 1.0, 1.0) radius:20.0];
			[innerBezelColor set];
			[bezel fill];
		}
	}

	[label drawInRect:NSInsetRect(cellFrame, padding.width, padding.height)];

	// Draw close icon
	if([self showsCloseIcon] && ([self isHovered] || [self isPressed]))
	{
		NSImage *icon;
		if([self isPressed] && trackingInsideCloseIcon)
			icon = [NSImage imageNamed:@"sl-status_stop-pressed"];
		else
			icon = [NSImage imageNamed:@"sl-status_stop"];

		if([controlView isFlipped])
			[icon setFlipped:YES];

		NSRect iconRect;
		iconRect.origin = NSZeroPoint;
		iconRect.size = [icon size];

		NSPoint targetPoint;
		if([controlView isFlipped])
			targetPoint = NSZeroPoint;
		else
			targetPoint = NSMakePoint(0, originalCellFrame.size.height - 1);

		[icon drawAtPoint:targetPoint fromRect:iconRect operation:NSCompositeSourceOver fraction:1.0];
	}

	// Draw exclusion icon
//	if ([self showsExcludeIcon] || excluded)
//	{
//		NSImage *icon;
//		if([self isPressed] && trackingInsideExcludeIcon)
//			icon = [NSImage imageNamed:@"sl-status_exclude"];
//		else
//			icon = [NSImage imageNamed:@"sl-status_exclude"];
//
//		if([controlView isFlipped])
//			[icon setFlipped:YES];
//
//		NSRect iconRect;
//		iconRect.origin = NSZeroPoint;
//		iconRect.size = [icon size];
//
//		NSPoint targetPoint;
//		if([controlView isFlipped])
//			targetPoint = NSMakePoint(originalCellFrame.size.width - iconRect.size.width, 0);
//		else
//			targetPoint = NSMakePoint(originalCellFrame.size.width, originalCellFrame.size.height - 1);
//
//		[icon drawAtPoint:targetPoint fromRect:iconRect operation:NSCompositeSourceOver fraction:1.0];
//	}
}

#pragma mark Mouse Tracking
- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)untilMouseUp
{
	if([self showsCloseIcon] && [self bezelStyle] == PATagBezelStyle)
	{
		NSPoint location = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];

		NSRect iconRect;
		if([controlView isFlipped])
			iconRect.origin = NSZeroPoint;
		else
			iconRect.origin = NSMakePoint(0, cellFrame.size.height - 1);
		iconRect.size = NSMakeSize(13, 13);

		if(NSPointInRect(location, iconRect))
		{
			if(!defaultAction) defaultAction = [self action];
			[self setAction:closeAction];
			trackingInsideCloseIcon = YES;
		} else {
			if(defaultAction) [self setAction:defaultAction];
			trackingInsideCloseIcon = NO;
		}
	}

	return [super trackMouse:theEvent inRect:cellFrame ofView:controlView untilMouseUp:NO];
}

- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView
{
	[self setPressed:YES];
	[[self controlView] setNeedsDisplay:YES];
	return YES;
}

- (BOOL)continueTracking:(NSPoint)lastPoint at:(NSPoint)currentPoint inView:(NSView *)controlView
{
	return YES;
}

- (void)stopTracking:(NSPoint)lastPoint at:(NSPoint)stopPoint inView:(NSView *)controlView mouseIsUp:(BOOL)flag
{
	[self setPressed:NO];
	[[self controlView] setNeedsDisplay:YES];
}

#pragma mark Actions
- (NSMutableAttributedString *)attributedTitle
{
	if(attributedTitle)
	{
		return attributedTitle;
	}
	else
	{
		attributedTitle = [[NSMutableAttributedString alloc] initWithString:[self title]];

		switch([self bezelStyle])
		{
			case PARecessedBezelStyle:;
				[attributedTitle addAttribute:NSFontAttributeName
								  value:[NSFont boldSystemFontOfSize:11]
								  range:NSMakeRange(0, [attributedTitle length])];
				break;
			case PATagBezelStyle:;
				[attributedTitle addAttribute:NSFontAttributeName
								  value:[NSFont systemFontOfSize:[self fontSize]]
								  range:NSMakeRange(0, [attributedTitle length])];
				break;
		}

		return attributedTitle;
	}
}

#pragma mark Accessors
- (NSString *)title
{
	return title;
}

- (void)setTitle:(NSString *)aTitle
{
	[title release];
	[aTitle retain];
	title = aTitle;
}

- (BOOL)isBordered
{
	return bordered;
}

- (void)setBordered:(BOOL)flag
{
	bordered = flag;
}

- (BOOL)isHovered
{
	return hovered;
}

- (void)setHovered:(BOOL)flag
{
	hovered = flag;
}

- (BOOL)isPressed
{
	return pressed;
}

- (void)setPressed:(BOOL)flag
{
	pressed = flag;
}

- (void)select:(BOOL)flag
{
	selected = flag;
}

- (BOOL)isSelected
{
	return selected;
}

- (void)setNegated:(BOOL)flag
{
	negated = flag;
}

- (BOOL)isNegated
{
	return negated;
}

- (PAButtonState)state
{
	return state;
}

- (void)setState:(PAButtonState)aState
{
	state = aState;
}

- (PABezelStyle)bezelStyle
{
	return bezelStyle;
}

- (void)setBezelStyle:(PABezelStyle)aBezelStyle
{
	bezelStyle = aBezelStyle;
}

- (NSColor *)bezelColor
{
	return bezelColor;
}

- (void)setBezelColor:(NSColor *)color
{
	if(bezelColor) [bezelColor release];
	bezelColor = [color retain];
}

- (NSColor *)selectedBezelColor
{
	return selectedBezelColor;
}

- (void)setSelectedBezelColor:(NSColor *)color
{
	if(selectedBezelColor) [selectedBezelColor release];
	selectedBezelColor = [color retain];
}

- (NSColor *)negatedBezelColor
{
	return negatedBezelColor;
}

- (void)setNegatedBezelColor:(NSColor *)color
{
	if (negatedBezelColor) [negatedBezelColor release];
	negatedBezelColor = [color retain];
}

- (PAButtonType)buttonType
{
	return buttonType;
}

- (void)setButtonType:(PAButtonType)type
{
	buttonType = type;
}

- (NSInteger)fontSize
{
	return fontSize;
}

- (void)setFontSize:(NSInteger)size
{
	fontSize = size;
}

- (BOOL)showsCloseIcon
{
	return showsCloseIcon;
}

- (void)setShowsCloseIcon:(BOOL)flag
{
	showsCloseIcon = flag;
}

- (BOOL)showsExcludeIcon
{
	return showsExcludeIcon;
}

- (void)setShowsExcludeIcon:(BOOL)flag
{
	showsExcludeIcon = flag;
}

- (void)toggleExclusion
{
	excluded = (excluded) ? NO : YES;
}

- (void)setAction:(SEL)aSelector
{
	[super setAction:aSelector];
}

- (SEL)closeAction
{
	return closeAction;
}

- (void)setCloseAction:(SEL)action
{
	closeAction = action;
}

- (NSSize)cellSize
{
	NSSize size = NSMakeSize(0,0);
	NSSize labelSize = [[self attributedTitle] size];

	if([self isBordered])
	{
		switch([self bezelStyle])
		{
			case PARecessedBezelStyle:;
				size.width = labelSize.width + 2 * PADDING_RECESSEDBEZELSTYLE.width;
				size.height = HEIGHT_RECESSEDBEZELSTYLE_SMALL;
				break;
			case PATagBezelStyle:;
				size.width = labelSize.width + 2 * PADDING_TAGBEZELSTYLE.width;
				size.height = labelSize.height + 2 * PADDING_TAGBEZELSTYLE.height;

				// Enlarge cellFrame if showsCloseIcon
				if([self showsCloseIcon])
				{
					size.width += MARGIN_TAGBEZELSTYLE.width;
					size.height += MARGIN_TAGBEZELSTYLE.height;
				}

				break;
		}
	} else {
		// TODO: Set size to image size
	}

	return size;
}

@end


text:
import math
from record_reader import RecordItemReader

class AngularVelocity:
    def __init__(self):
        self.timestamp_list = []
        self.angular_velocity_list = []
        self.corrected_angular_velocity_list = []

        self.last_corrected_angular_velocity = None
        self.last_timestamp = None

    def add(self, location_est):
        timestamp_sec = location_est.header.timestamp_sec
        angular_velocity = location_est.pose.angular_velocity.z

        if self.last_corrected_angular_velocity is not None:
            corrected = self.correct_angular_velocity(
                angular_velocity, timestamp_sec)
        else:
            corrected = angular_velocity

        self.timestamp_list.append(timestamp_sec)
        self.angular_velocity_list.append(angular_velocity)
        self.corrected_angular_velocity_list.append(corrected)

        self.last_corrected_angular_velocity = corrected
        self.last_timestamp = timestamp_sec

    def correct_angular_velocity(self, angular_velocity, timestamp_sec):
        if self.last_corrected_angular_velocity is None:
            return angular_velocity
        delta = abs(angular_velocity - self.last_corrected_angular_velocity)\
            / abs(self.last_corrected_angular_velocity)

        if delta > 0.25:
            corrected = angular_velocity / 2.0
            return corrected
        else:
            return angular_velocity

    def get_anglular_velocity_list(self):
        return self.angular_velocity_list

    def get_corrected_anglular_velocity_list(self):
        return self.corrected_angular_velocity_list

    def get_timestamp_list(self):
        return self.timestamp_list

    def get_latest_angular_velocity(self):
        if len(self.angular_velocity_list) == 0:
            return None
        else:
            return self.angular_velocity_list[-1]

    def get_latest_corrected_angular_velocity(self):
        if len(self.corrected_angular_velocity_list) == 0:
            return None
        else:
            return self.corrected_angular_velocity_list[-1]

    def get_latest_timestamp(self):
        if len(self.timestamp_list) == 0:
            return None
        else:
            return self.timestamp_list[-1]

if __name__ == "__main__":
    import sys
    import matplotlib.pyplot as plt
    from os import listdir
    from os.path import isfile, join

    folders = sys.argv[1:]
    fig, ax = plt.subplots()
    colors = ["g", "b", "r", "m", "y"]
    markers = ["o", "o", "o", "o"]
    for i in range(len(folders)):
        folder = folders[i]
        color = colors[i % len(colors)]
        marker = markers[i % len(markers)]
        fns = [f for f in listdir(folder) if isfile(join(folder, f))]
        for fn in fns:
            reader = RecordItemReader(folder+"/"+fn)
            processor = AngularVelocity()
            for data in reader.read(["/apollo/localization/pose"]):
                processor.add(data["pose"])

            data_x = processor.get_timestamp_list()
            data_y = processor.get_corrected_anglular_velocity_list()
            ax.scatter(data_x, data_y, c=color, marker=marker, alpha=0.4)

            data_y = processor.get_anglular_velocity_list()
            ax.scatter(data_x, data_y, c='k', marker="+", alpha=0.8)

    plt.show()