text:
#ifndef PCL_IO_VTK_IO_H_
#define PCL_IO_VTK_IO_H_

#include <pcl/pcl_macros.h>
#include <sensor_msgs/PointCloud2.h>
#include <pcl/PolygonMesh.h>

// VTK
class vtkPolyData;
class vtkStructuredGrid;

namespace pcl
{
  namespace io
  {
    /** \brief Saves a PolygonMesh in ascii VTK format.
      * \param[in] file_name the name of the file to write to disk
      * \param[in] triangles the polygonal mesh to save
      * \param[in] precision the output ASCII precision
      * \ingroup io
      */
    PCL_EXPORTS int
    saveVTKFile (const std::string &file_name, const pcl::PolygonMesh &triangles, unsigned precision = 5);

    /** \brief Saves a PointCloud in ascii VTK format.
      * \param[in] file_name the name of the file to write to disk
      * \param[in] cloud the point cloud to save
      * \param[in] precision the output ASCII precision
      * \ingroup io
      */
    PCL_EXPORTS int
    saveVTKFile (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, unsigned precision = 5);

    template <typename PointT> void
    pointCloudToPolyData(const pcl::PointCloud<PointT>& cloud, vtkPolyData* const polydata);

    // PCL to vtkStructuredGrid
    template <typename PointT> void
    pointCloudToStructuredGrid(const pcl::PointCloud<PointT>& cloud, vtkStructuredGrid* const structured_grid);

    /** Convert a vtkPolyData to a pcl::PointCloud. */
    template <typename PointT> void
    polyDataToPointCloud(vtkPolyData* const polydata, pcl::PointCloud<PointT>& cloud);

    /** Convert a vtkStructuredGrid to a pcl::PointCloud. */
    template <typename PointT> void
    structuredGridToPointCloud(vtkStructuredGrid* const structured_grid, pcl::PointCloud<PointT>& cloud);

  }
}

#endif  //#ifndef PCL_IO_VTK_IO_H_


text:
import Component from 'vue-class-component';

import components from '../../../components';

@Component({
    components,
    template: require('./about-page.html')
})
export default class AboutPage {
}

redpajama_set_name: RedPajamaGithub


text:
import { get } from 'ember-metal/property_get';
import run from 'ember-metal/run_loop';
import EmberView from 'ember-views/views/view';
import ContainerView from 'ember-views/views/container_view';

var view;

QUnit.module('EmberView#destroyElement', {
  teardown() {
    run(function() {
      view.destroy();
    });
  }
});

QUnit.test('if it has no element, does nothing', function() {
  var callCount = 0;
  view = EmberView.create({
    willDestroyElement() { callCount++; }
  });

  ok(!get(view, 'element'), 'precond - does NOT have element');

  run(function() {
    view.destroyElement();
  });

  equal(callCount, 0, 'did not invoke callback');
});

QUnit.test('if it has a element, calls willDestroyElement on receiver and child views then deletes the element', function() {
  expectDeprecation('Setting `childViews` on a Container is deprecated.');

  var parentCount = 0;
  var childCount = 0;

  view = ContainerView.create({
    willDestroyElement() { parentCount++; },
    childViews: [ContainerView.extend({
      // no willDestroyElement here... make sure no errors are thrown
      childViews: [EmberView.extend({
        willDestroyElement() { childCount++; }
      })]
    })]
  });

  run(function() {
    view.createElement();
  });

  ok(get(view, 'element'), 'precond - view has element');

  run(function() {
    view.destroyElement();
  });

  equal(parentCount, 1, 'invoked destroy element on the parent');
  equal(childCount, 1, 'invoked destroy element on the child');
  ok(!get(view, 'element'), 'view no longer has element');
  ok(!get(get(view, 'childViews').objectAt(0), 'element'), 'child no longer has an element');
});

QUnit.test('returns receiver', function() {
  var ret;
  view = EmberView.create();

  run(function() {
    view.createElement();
    ret = view.destroyElement();
  });

  equal(ret, view, 'returns receiver');
});

QUnit.test('removes element from parentNode if in DOM', function() {
  view = EmberView.create();

  run(function() {
    view.append();
  });

  var parent = view.$().parent();

  ok(get(view, 'element'), 'precond - has element');

  run(function() {
    view.destroyElement();
  });

  equal(view.$(), undefined, 'view has no selector');
  ok(!parent.find('#'+view.get('elementId')).length, 'element no longer in parent node');
});


text:
# jbmorice.github.io
![Website](https://img.shields.io/website/https/jbmorice.github.io.svg?down_message=is%20not%20reachable&label=jbmorice.github.io&up_message=is%20reachable)
![Website](https://img.shields.io/website/https/jbmorice.com.svg?down_message=is%20not%20reachable&label=jbmorice.com&up_message=is%20reachable)
![Uptime Robot ratio (30 days)](https://img.shields.io/uptimerobot/ratio/m782708748-9ae50ad509947adc436907a4.svg)
[![GitHub license](https://img.shields.io/github/license/jbmorice/jbmorice.github.io.svg)](https://github.com/jbmorice/jbmorice.github.io)

My personal portfolio website. Created with the static website generator [Jekyll](https://jekyllrb.com/) (targeting the Github Pages environment), using the theme [Minimal Mistakes](https://mmistakes.github.io/minimal-mistakes/) (slightly customized for my needs) and hosted on [Github Pages](https://pages.github.com/).

## Features (i.e. theme customizations)

* A resume layout with configurable sections :
    * Banner section with customizable ID picture and background
    * Summary section with customizable text
    * Personal projects display section (based on a Jekyll collection named "projects")
    * Skill section with animated badges (with icons) sliding in
    * Education section
    * Experiences section with an animated timeline
    * Call for action/contact section
* A modified collection layout to sort collection posts in a user specified order

## Installation

If you want to run this project locally follow these instructions. If you are using Windows make sure that all the programs used are correctly setup in your PATH.

First, you will need to have Jekyll installed on your system, check out [their documentation](https://jekyllrb.com/docs/installation/) to install it. Then, open a terminal and do the following commands.

Clone this repository somewhere on your system :
```
git clone https://github.com/jbmorice/jbmorice.github.io.git
```

Step into the repository :
```
cd jbmorice.github.io.git
```

Fetch the bundled Ruby gems using Bundler :
```
bundler install
```

Run the following command to generate the website with Jekyll and launch a web server in your shell serving the website locally :
```
bundle exec jekyll serve
```

Go to the URL : `http://127.0.0.1:4000/` in your browser to see the website. All changes done to the project files while the server is running will trigger a rebuild and update what you see at this URL.

When you are done, press CTRL + C in your terminal to kill the server.

## Usage

> :warning: *Disclaimer : By no means am I a full fledged web developer or designer so things might be a bit messy here and there in this project. Use it at your own risk. If you found a mistake or something that could be done in a better, cleaner way, feel free to open an issue or submit a pull request.*

If you wish to use my resume template and/or the projects collection page in your own Jekyll website based on the Minimal Mistakes theme, follow the instructions below.

### Use the resume layout

* Copy and paste the `_includes/resume` folder into your `_includes` folder
* Copy and paste the `_layouts/resume.html` file into your `_layouts` folder
* Copy and paste the `assets/css` folder into your `assets` folder
* Copy and paste the `assets/fonts` folder into your `assets` folder
* Copy and paste the `assets/js` folder into your `assets` folder

Create a page with the `resume` layout to use it. Check the content of the `_pages/home.md` file to see how it is used.

### Use the custom order collection layout

* Copy and paste the `_includes/documents-collection.html` file into your `_includes` folder
* Copy and paste the `_layouts/collection.html` file into your `_layouts` folder

Now if you add the option `order: <value>` (replace *\<value\>* by an integer) to all the posts of the collection you want to sort and use the option `sort_by: order` in the corresponding collection display page, all the posts will be sorted according to their order value.

## Roadmap

I plan on adding a technical blog with articles on subjects I find interesting and that might useful to other people.

I will probably end up switching the whole website to Hugo sometime down the road, since I am not really happy the lack of multiple languages support on Jekyll for Github Pages and I would like to make this website fully available in english and in french.

## Support

If you found a mistake (typo, error in a blog post, etc.), something broken (dead-link, wrong picture, etc.) or if you tried to use a template and it did not work, or even if you think something could be done in a better/cleaner way, then feel free to open an issue or submit a pull request with a solution.

## Acknowledgments and attributions
* The Minimal Mistakes theme for Jekyll is copyrighted material owned by [Michael "mmistakes" Rose](https://github.com/mmistakes) and contributors.  It is hosted here : [https://github.com/mmistakes/minimal-mistakes](https://github.com/mmistakes/minimal-mistakes), and licensed under the [MIT License](https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE).
* The vertical timeline in the experiences sections of the resume layout is adapted from a CodyHouse Experiment made by [CodyHouse](https://codyhouse.co/) and is copyrighted material owned by Amber Creative Lab Ltd. It is hosted here : [https://github.com/CodyHouse/vertical-timeline](https://github.com/CodyHouse/vertical-timeline), and licensed under the [MIT License](https://codyhouse.co/license).
* Banner image in the home page from [Crytek Sponza scene rendered in Babylon.js](https://www.babylonjs.com/demos/sponza/)
* VR HMD timeline icon in the home page made by [Freepik](http://www.freepik.com) from [Flaticon](www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)
* Plane timeline icon in the home page made by [Dave Gandy](https://www.flaticon.com/authors/dave-gandy) from [Flaticon](www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)
* Milk bottle timeline icon in the home page made by [Freepik](http://www.freepik.com) from [Flaticon](www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)
* Vynil record timeline icon in the home page made by [Freepik](http://www.freepik.com) from [Flaticon](www.flaticon.com) is licensed by [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/)

## License

This project and all the code snippets you might find in the articles are licensed under the [MIT License](LICENSE).


text:
import { Component, ElementRef, Injector, OnInit, ViewEncapsulation } from '@angular/core';

import { AppMenuService } from '../../services/app-menu.service';
import { PermissionsService } from '../../services/permissions/permissions.service';
import { OTranslateService } from '../../services/translate/o-translate.service';
import { MenuRootItem } from '../../types/menu-root-item.type';
import { Util } from '../../util/util';

export const DEFAULT_INPUTS_O_BAR_MENU = [
  // title [string]: menu title. Default: no value.
  'menuTitle: title',
  // tooltip [string]: menu tooltip. Default: 'title' value.
  'tooltip',
];

@Component({
  selector: 'o-bar-menu',
  templateUrl: './o-bar-menu.component.html',
  styleUrls: ['./o-bar-menu.component.scss'],
  inputs: DEFAULT_INPUTS_O_BAR_MENU,
  encapsulation: ViewEncapsulation.None,
  host: {
    '[class.o-bar-menu]': 'true'
  }
})
export class OBarMenuComponent implements OnInit {

  protected permissionsService: PermissionsService;
  protected translateService: OTranslateService;
  private appMenuService: AppMenuService;
  private menuRoots: MenuRootItem[];

  protected _menuTitle: string;
  protected _tooltip: string;
  protected _id: string;

  constructor(
    protected elRef: ElementRef,
    protected injector: Injector) {
    this.id = 'm_' + String((new Date()).getTime() + Util.randomNumber().toString());
    this.permissionsService = this.injector.get(PermissionsService);
    this.translateService = this.injector.get(OTranslateService);
    this.appMenuService = this.injector.get(AppMenuService);
    this.menuRoots = this.appMenuService.getMenuRoots();
  }

  public ngOnInit() {
    if (!this.tooltip) {
      this.tooltip = this.menuTitle;
    }
    if (this.translateService) {
      this.translateService.onLanguageChanged.subscribe(() => {
        this.setDOMTitle();
      });
      this.setDOMTitle();
    }
  }

  setDOMTitle() {
    const tooltip = this.translateService.get(this.tooltip);
    this.elRef.nativeElement.setAttribute('title', tooltip);
  }

  collapseAll() {
    const inputs = this.elRef.nativeElement.querySelectorAll('input');
    if (inputs) {
      inputs.forEach(element => {
        element.checked = false;
      });
    }
    const fakeLis = this.elRef.nativeElement.querySelectorAll('.fake-li-hover');
    if (fakeLis) {
      fakeLis.forEach(element => {
        element.classList.remove('fake-li-hover');
      });
    }
  }

  getPermissionsService(): PermissionsService {
    return this.permissionsService;
  }

  get menuTitle(): string {
    return this._menuTitle;
  }

  set menuTitle(val: string) {
    this._menuTitle = val;
  }

  get tooltip(): string {
    return this._tooltip;
  }

  set tooltip(val: string) {
    this._tooltip = val;
  }

  get id(): string {
    return this._id;
  }

  set id(val: string) {
    this._id = val;
  }

  get menuItems(): MenuRootItem[] {
    return this.menuRoots;
  }
}


text:
<?php
// Heading
$_['heading_title']		= '   Materialize "Beden Tablosu"';
$_['sizechart_title']	= 'Materialize "Beden tablosu"';

// Text
$_['text_module']		= 'Modüller';
$_['text_success']		= 'Modül ayarları güncellendi!';
$_['text_edit']			= 'Materialize Beden tablosu modülünü düzenle';

// Status
$_['entry_status']		= 'Durum';

// Error
$_['error_permission']	= 'Bu modül yönetmek için izniniz yok!';


text:
/**
 * Bean Validation TCK
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */
package org.hibernate.beanvalidation.tck.tests.methodvalidation.parameternameprovider;

import static org.hibernate.beanvalidation.tck.util.TestUtil.asSet;
import static org.hibernate.beanvalidation.tck.util.ConstraintViolationAssert.assertNumberOfViolations;
import static org.hibernate.beanvalidation.tck.util.TestUtil.getParameterNames;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.fail;

import java.lang.reflect.Method;
import java.util.Set;

import javax.validation.ConstraintViolation;
import javax.validation.ValidationException;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.executable.ExecutableValidator;

import org.hibernate.beanvalidation.tck.beanvalidation.Sections;
import org.hibernate.beanvalidation.tck.tests.AbstractTCKTest;
import org.hibernate.beanvalidation.tck.util.TestUtil;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.test.audit.annotations.SpecAssertion;
import org.jboss.test.audit.annotations.SpecVersion;
import org.testng.annotations.Test;

/**
 * @author Gunnar Morling
 */
@SpecVersion(spec = "beanvalidation", version = "2.0.0")
public class ParameterNameProviderTest extends AbstractTCKTest {

	@Deployment
	public static WebArchive createTestArchive() {
		return webArchiveBuilder()
				.withTestClass( ParameterNameProviderTest.class )
				.withClass( CustomParameterNameProvider.class )
				.withClass( BrokenCustomParameterNameProvider.class )
				.withClass( User.class )
				.build();
	}

	@Test(expectedExceptions = UnsupportedOperationException.class,
			expectedExceptionsMessageRegExp = "Exception in ParameterNameProvider")
	@SpecAssertion(section = Sections.CONSTRAINTDECLARATIONVALIDATIONPROCESS_METHODLEVELCONSTRAINTS_PARAMETERCONSTRAINTS_NAMINGPARAMETERS, id = "b")
	public void testExceptionInParameterNameProviderIsWrappedIntoValidationException()
			throws Throwable {
		Validator validator = TestUtil.getConfigurationUnderTest()
				.parameterNameProvider( new BrokenCustomParameterNameProvider() )
				.buildValidatorFactory()
				.getValidator();

		try {
			Object object = new User();
			Method method = User.class.getMethod( "setNames", String.class, String.class );
			Object[] parameters = new Object[] { null, null };

			validator.forExecutables().validateParameters( object, method, parameters );
			fail( "Expected exception wasn't thrown" );
		}
		catch ( ValidationException e ) {
			throw e.getCause();
		}
	}

	@Test
	@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_VALIDATORFACTORY, id = "e")
	public void testGetParameterNameProviderFromValidatorFactory() {
		BrokenCustomParameterNameProvider parameterNameProvider = new BrokenCustomParameterNameProvider();

		ValidatorFactory validatorFactory = TestUtil.getConfigurationUnderTest()
				.parameterNameProvider( parameterNameProvider )
				.buildValidatorFactory();

		assertSame(
				validatorFactory.getParameterNameProvider(),
				parameterNameProvider,
				"getParameterNameProvider() should return the parameter name provider set via configuration"
		);
	}

	@Test
	@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_VALIDATORFACTORY, id = "g")
	public void testParameterNameProviderSetUsingContext() throws Exception {
		Object object = new User();
		Method method = User.class.getMethod( "setNames", String.class, String.class );
		Object[] parameters = new Object[] { null, null };

		ExecutableValidator executableValidator = TestUtil.getValidatorFactoryUnderTest()
				.usingContext()
				.parameterNameProvider( new CustomParameterNameProvider() )
				.getValidator()
				.forExecutables();
		Set<ConstraintViolation<Object>> constraintViolations = executableValidator.validateParameters(
				object,
				method,
				parameters
		);
		assertNumberOfViolations( constraintViolations, 2 );

		Set<String> actualParameterNames = getParameterNames( constraintViolations );
		Set<String> expectedParameterNames = asSet( "param0", "param1" );

		assertEquals( actualParameterNames, expectedParameterNames );
	}
}


text:
package com.odiago.flumebase.exec;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

import org.apache.hadoop.conf.Configuration;

import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cloudera.flume.core.EventImpl;

import com.odiago.flumebase.exec.EventWrapper;
import com.odiago.flumebase.exec.FlowElementContext;
import com.odiago.flumebase.exec.FlowElementImpl;
import com.odiago.flumebase.exec.ParsingEventWrapper;
import com.odiago.flumebase.exec.StreamSymbol;

import com.odiago.flumebase.lang.Timestamp;
import com.odiago.flumebase.lang.Type;

import com.odiago.flumebase.parser.TypedField;

/**
 * FlowElement providing source data from a file.
 * The file format is a set of text records with the form:
 * (long integer in base 10 str encoding) \t (string) \n
 *
 * The integer on each line specifies the timestamp of the event.
 */
public class FileSourceElement extends FlowElementImpl {
  private static final Logger LOG = LoggerFactory.getLogger(
      FileSourceElement.class.getName());

  /**
   * EVENT FORMAT property specifying which column of the input file is to be
   * used as the timestamp for each event. If left unspecified, the current
   * system time is used for the timestamp of the row, when each row is read
   * from the file.
   */
  public static final String TIMESTAMP_COL_KEY = "timestamp.col";

  private String mFilename;
  private boolean mLocal;
  private EventGenThread mEventGenThread;
  private volatile boolean mIsFinished;

  /** List of all typed fields defined in the stream, with their avro-name mappings, etc. */
  private List<TypedField> mFields;

  /** List of all avro names of the fields in the stream, in the same order as mFields. */
  private List<String> mFieldNames;

  private StreamSymbol mStream;

  /** Private extension of EventImpl that allows us to call setTimestamp(). */
  private static class FileSourceEvent extends EventImpl {
    public FileSourceEvent(byte[] body) {
      super(body, 0, Priority.INFO, 0, "localhost");
    }

    public void setTimestamp(long timestamp) {
      super.setTimestamp(timestamp);
    }
  }

  /**
   * Additional thread that actually reads the file and converts it
   * to events to inject into the flow.
   */
  private class EventGenThread extends Thread {
    public void run() {
      // If the user has specified a column to extract the timestamp from, get it here.
      String timestampCol = mStream.getFormatSpec().getParam(TIMESTAMP_COL_KEY);
      TypedField timestampField = null;
      if (null != timestampCol) {
        // timestampCol refers to a user-selected name for the column. Translate that
        // to the internal ("avro") name for the column.
        for (TypedField field : mFields) {
          if (field.getUserAlias().equals(timestampCol)) {
            timestampField = field;
            break;
          }
        }

        if (null == timestampField) {
          LOG.warn("Could not find column '" + timestampCol + "' to use for timestamps.");
          LOG.warn("Timestamps will be generated based on the local system clock.");
        } else if (!timestampField.getType().getPrimitiveTypeName()
            .equals(Type.TypeName.TIMESTAMP)) {
          LOG.warn("Specified timestamp.col '" + timestampCol + "' has type "
              + timestampField.getType() + ", but we need TIMESTAMP.");
          LOG.warn("Timestamps will be generated based on the local system clock.");
          timestampField = null;
        } else {
          // Ensure that we normalize the type associated with this column for ts retrieval.
          timestampField = new TypedField(timestampField.getAvroName(),
              Type.getNullable(Type.TypeName.TIMESTAMP));
        }
      }

      BufferedReader reader = null;
      try {
        // TODO: Inherit from a global configuration.
        Configuration conf = new Configuration();
        FileSystem fs;
        if (mLocal) {
          fs = FileSystem.getLocal(conf);
        } else {
          fs = FileSystem.get(conf);
        }

        reader = new BufferedReader(new InputStreamReader(fs.open(new Path(mFilename))));
        while (true) {
          if (mIsFinished) {
            LOG.info("Closing EventGenThread; mIsFinished set to true");
            break;
          }

          String line = reader.readLine();
          if (null == line) {
            LOG.info("Closing EventGenThread; file is complete");
            break;
          }

          try {
            FileSourceEvent event = new FileSourceEvent(line.getBytes());
            event.set(STREAM_NAME_ATTR, mStream.getName().getBytes());
            ParsingEventWrapper wrapper = new ParsingEventWrapper(mStream.getEventParser(),
                mFieldNames);
            wrapper.reset(event);

            if (timestampField == null) {
              event.setTimestamp(System.currentTimeMillis());
            } else {
              Timestamp timestamp = (Timestamp) wrapper.getField(timestampField);
              if (null == timestamp) {
                event.setTimestamp(System.currentTimeMillis());
              } else {
                event.setTimestamp(timestamp.milliseconds);
              }
            }
            emit(wrapper);
          } catch (NumberFormatException nfe) {
            LOG.warn("Could not parse timestamp: " + nfe);
          }
        }
      } catch (InterruptedException ie) {
        LOG.error("Interruption during EventGenThread (suspending): " + ie);
      } catch (IOException ioe) {
        LOG.error("IOException in EventGenThread: " + ioe);
      } finally {
        if (null != reader) {
          try {
            reader.close();
          } catch (IOException ioe) {
            LOG.warn("IOException closing file reader" + ioe);
          }
        }

        try {
          getContext().notifyCompletion();
        } catch (IOException ioe) {
          LOG.warn("IOException notifying flow of file source completion: " + ioe);
        } catch (InterruptedException ie) {
          LOG.warn("InterruptedException notifying flow of file source completion: " + ie);
        }
      }
    }
  }

  public FileSourceElement(FlowElementContext context, String fileName, boolean local,
      List<TypedField> fields, StreamSymbol streamSym) {
    super(context);
    mFilename = fileName;
    mLocal = local;
    mFields = fields;
    mFieldNames = new ArrayList<String>();
    mStream = streamSym;
    for (TypedField field : fields) {
      mFieldNames.add(field.getAvroName());
    }
  }

  @Override
  public void open() throws IOException {
    if (null != mEventGenThread) {
      throw new IOException("FileSourceElement.open() called multiple times");
    }
    mEventGenThread = new EventGenThread();
    mEventGenThread.start();
  }

  @Override
  public void close() throws IOException, InterruptedException {
    mIsFinished = true;
    mEventGenThread.join();
    super.close();
  }

  @Override
  public void takeEvent(EventWrapper e) {
    // We generate our own events; nothing should be upstream from us.
    throw new RuntimeException("FileSourceElement does not support incoming events");
  }

  @Override
  public String toString() {
    return "FileSource[mFilename=\"" + mFilename + "\", mLocal=" + mLocal + "]";
  }
}


text:
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml.Linq;
using Twilio.Types;

namespace Twilio.TwiML.Voice
{

    /// <summary>
    /// Adding a Pause in Say
    /// </summary>
    public class SsmlBreak : TwiML
    {
        public sealed class StrengthEnum : StringEnum
        {
            private StrengthEnum(string value) : base(value) {}
            public StrengthEnum() {}
            public static implicit operator StrengthEnum(string value)
            {
                return new StrengthEnum(value);
            }

            public static readonly StrengthEnum None = new StrengthEnum("none");
            public static readonly StrengthEnum XWeak = new StrengthEnum("x-weak");
            public static readonly StrengthEnum Weak = new StrengthEnum("weak");
            public static readonly StrengthEnum Medium = new StrengthEnum("medium");
            public static readonly StrengthEnum Strong = new StrengthEnum("strong");
            public static readonly StrengthEnum XStrong = new StrengthEnum("x-strong");
        }

        /// <summary>
        /// Set a pause based on strength
        /// </summary>
        public SsmlBreak.StrengthEnum Strength { get; set; }
        /// <summary>
        /// Set a pause to a specific length of time in seconds or milliseconds, available values: [number]s, [number]ms
        /// </summary>
        public string Time { get; set; }

        /// <summary>
        /// Create a new SsmlBreak
        /// </summary>
        /// <param name="strength"> Set a pause based on strength </param>
        /// <param name="time"> Set a pause to a specific length of time in seconds or milliseconds, available values:
        ///            [number]s, [number]ms </param>
        public SsmlBreak(SsmlBreak.StrengthEnum strength = null, string time = null) : base("break")
        {
            this.Strength = strength;
            this.Time = time;
        }

        /// <summary>
        /// Return the attributes of the TwiML tag
        /// </summary>
        protected override List<XAttribute> GetElementAttributes()
        {
            var attributes = new List<XAttribute>();
            if (this.Strength != null)
            {
                attributes.Add(new XAttribute("strength", this.Strength.ToString()));
            }
            if (this.Time != null)
            {
                attributes.Add(new XAttribute("time", this.Time));
            }
            return attributes;
        }

        /// <summary>
        /// Append a child TwiML element to this element returning this element to allow chaining.
        /// </summary>
        /// <param name="childElem"> Child TwiML element to add </param>
        public new SsmlBreak Append(TwiML childElem)
        {
            return (SsmlBreak) base.Append(childElem);
        }

        /// <summary>
        /// Add freeform key-value attributes to the generated xml
        /// </summary>
        /// <param name="key"> Option key </param>
        /// <param name="value"> Option value </param>
        public new SsmlBreak SetOption(string key, object value)
        {
            return (SsmlBreak) base.SetOption(key, value);
        }
    }

}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>movies</title>
  <meta name="author" content="" />
  <meta name="description"
        content=""/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="movies"/>
  <meta itemprop="description"
        content=""/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="movies"/>
  <meta property="og:type"
        content="website"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/categories/movies/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content=""/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:section" content="categories"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="movies"/>
  <meta name="twitter:description"
        content=""/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link href="http://www.cinetenisverde.com.br/categories/movies/index.xml" rel="alternate" type="application/rss+xml"
        title="Cine Tênis Verde"/>
  <link href="http://www.cinetenisverde.com.br/categories/movies/index.xml" rel="feed" type="application/rss+xml"
        title="Cine Tênis Verde"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

Category: movies

Roubo nas Alturas

      Jan 21, 2017
      2 min.

Este é um filhote dos filmes que criticam os ricaços de Wall Street que fraudaram seus clientes. Juntando em um bolo só, aqui os clientes são também funcionários de um prédio chique em Nova Iorque onde o ricaço é o cliente. Há um quê de retorno aos anos 80, com Eddie Murphy fazendo um ladrão pé-de-chinelo e um plot previsível entediante. O que salva é o elenco competente, com piadas engraçadas o suficiente para tornar a experiência passável.

Paraíso

      Jan 20, 2017
      2 min.

Quando quiser ver um filme sobre o nazismo realmente forte, não esqueça de procurar por um diretor russo. E no caso de Andrey Konchalovskiy, seu “Paraíso” flerta duramente com “A Fita Branca”, um trabalho de Michael Haneke que, como de praxe, desafia o espectador a achar um pingo de esperança na humanidade (spoiler: você nunca acha). Infelizmente (ou felizmente) Konchalovskiy não vai tão além, e se rende a um água-com-açúcar em seu final (ainda que sutil).

Champagne

      Jan 18, 2017
      3 min.

Champagne é uma divertida comédia dramática que esbanja críticas à alta sociedade. Em seu núcleo está a figura carismática e intensa de Betty Balfour, que faz, conforme o IMDB, “The Girl”. Em torno dela orbitam as pessoas comuns, que a veem como excêntrica. Mas, tudo bem, já que seu pai é rico. Mesmo se vestindo de empregada ela diverte e se diverte.
As expressões de Betty são as melhores partes do filme.

O Ring

      Jan 17, 2017
      2 min.

Hitchcock gosta de criar cenas icônicas em seus filmes. Aqui temos uma mulher apaixonada ao lado do seu amor, quase nocauteado no ringue. Ele também gosta de comédia de situações, e esta é uma delas, onde até o título do filme é um trocadilho em inglês (“ring” pode ser anel ou o ringue de boxe). Este não é um dos seus filmes de crimes, mas um triângulo… um quadrado amoroso. E confuso.

A Espera

      Jan 16, 2017
      1 min.

A Espera é um trabalho estilizado do diretor estreante Piero Messina, que flerta com simbolismos religiosos – claramente cristãos – e que utiliza isso para construir uma mentira alimentada por Anna, uma mãe (Juliette Binoche) que acabou de perder o filho (sugestivamente nunca mostrado no filme). Com a vinda da namorada de seu filho à casa em luto, a última fagulha de esperança ou de memória de Anna parece permanecer viva às custas da garota.

A Partida

      Jan 15, 2017
      3 min.

Este é um filme que trata a morte de maneira direta ao apresentar-nos a profissão de preparador de corpos. No Japão há uma cerimônia com os familiares e amigos presentes em que o corpo é limpo e maquiado para voltar à vida. Além de possui uma quantidade assombrosa de momentos tocantes (leve seu lenço), seja por esses momentos ou pela poesia implícita neles, A Partida de certa forma celebra a vida como um processo de auto-descoberta, e a morte como uma despedida solene das pessoas que convivemos por este breve tempo.

Jane Eyre

      Jan 15, 2017
      3 min.

Enquanto Jane Austen (Orgulho e Preconceito) escrevia sobre a sociedade britânica com uma vivacidade e energia encantadoras, Charlotte Brontë parece ir no exato oposto com Jane Eyre, um romance extremamente pesado, que encontra nos drama do destino um fiapo de misticismo assombrando uma Inglaterra que parece estar à beira do seu declínio.
Adaptado por Moira Buffini para o cinema, este drama faz um resumo extremamente sintético e eficiente do romance original, abordando toda a dor e sofrimento de sua protagonista, principalmente por não entender seu lugar em um mundo estático do ponto de vista feminino.

Aquarius

      Jan 13, 2017
      4 min.

Sônia Braga não está protagonizando um filme. Aquarius é um filme que protagoniza Sônia Braga. Ela é todo o filme. E quem garante isso é o diretor Kleber Mendonça Filho, mais uma vez, depois de O Som Ao Redor, fascinado (e enganado) a respeito da classe média “esclarecida” e das questões de propriedade privada. A direção de Kleber interfere apenas para dar passagem a Braga, que samba a dança do crioulo doido e entrega uma performance corporal e verbal que arrebata todo o filme, o leva para si.

Moonlight: Sob a Luz do Luar

      Jan 12, 2017
      4 min.

O que faz um filme notório? É seu estilo? Ou a história que quer contar? Ou seriam os dois? Moonlight, do diretor/roteirista Barry Jenkins, tem uma bela história com personagens de alguma forma genéricos, em uma época genérica, mas com alguns pequenos traços… genéricos também. E isso é narrado através de uma estilo forte, que bate no enquadramento, bate na trilha sonora, bate na fotografia, mas em nenhum deles parece conseguir extrair significado dessa história.

Max Steel

      Jan 11, 2017
      3 min.

Apesar de frequentemente ruins, tenho uma queda por fan films que “abraçam a causa”, que é homenagear o herói/personagem/brinquedo que tanto curtem. No caso deste novo filme da Mattel, a produtora do brinquedo Max Steel (que já tem séries e curtas de animação até dizer chega), é óbvio que se trata de um caça-níqueis, e portanto encarada como um projeto profissional. Porém, o resultado é um filme sem a paixão de um fan film e também sem a qualidade de um filme comercial.

  Previous
  Next

      1

      …

      48

      49

      50

      …

175


text:
/*
 * ManifestSyntax.java
 *
 * Created on July 20, 2005, 10:37 AM
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package org.netbeans.modules.manifestsupport;

import org.netbeans.editor.Syntax;
import org.netbeans.editor.TokenID;
import org.openide.ErrorManager;

/**
 *
 * @author Administrator
 */
public class ManifestSyntax extends Syntax {

    private static final ErrorManager LOGGER = ErrorManager.getDefault().getInstance("org.netbeans.modules.manifestsupport.ManifestSyntax");
    private static final boolean LOG = LOGGER.isLoggable(ErrorManager.INFORMATIONAL);

    private static final int ISI_NAME = 1;
    private static final int ISA_CR = 2;
    private static final int ISA_LF = 3;
    private static final int ISA_CRLF = 4;
    private static final int ISA_AFTER_NAME = 6;
    private static final int ISA_COLON = 7;
    private static final int ISA_AFTER_COLON = 8;
    private static final int ISI_VALUE = 9;

    /** Creates a new instance of ManifestSyntax */
    public ManifestSyntax() {
        tokenContextPath = ManifestTokenContext.contextPath;
    }

    protected TokenID parseToken() {
        TokenID result = doParseToken();
        if (LOG) {
            LOGGER.log(ErrorManager.INFORMATIONAL, "parseToken: " + result);
        }
        return result;
    }

    private TokenID doParseToken() {
        char actChar;

        while (offset < stopOffset) {
            actChar = buffer[offset];

            switch (state) {
                case INIT:
                    switch (actChar) {
                        case ':':
                            state = ISA_AFTER_COLON;
                            offset++;
                            return ManifestTokenContext.COLON;
                        case '\n':
                            state = INIT;
                            offset++;
                            return ManifestTokenContext.END_OF_LINE;
                        case '\r':
                            state = ISA_CR;
                            break;
                        default:
                            state = ISI_NAME;
                    }
                    break;

                case ISI_NAME:
                    switch (actChar) {
                        case ':':
                        case '\r':
                        case '\n':
                            state = ISA_AFTER_NAME;
                            return ManifestTokenContext.NAME;
                    }
                    break;

                case ISA_CR:
                    if (actChar == '\n') {
                        offset++;
                    }
                    state = INIT;
                    return ManifestTokenContext.END_OF_LINE;

                case ISA_AFTER_NAME:
                    switch (actChar) {
                        case ':':
                            state = ISA_AFTER_COLON;
                            offset++;
                            return ManifestTokenContext.COLON;
                        case '\n':
                            state = INIT;
                            offset++;
                            return ManifestTokenContext.END_OF_LINE;
                        case '\r':
                            state = ISA_CR;
                            break;
                        default:
                            assert false;
                    }
                    break;

                case ISA_AFTER_COLON:
                    switch (actChar) {
                        case '\n':
                            state = INIT;
                            offset++;
                            return ManifestTokenContext.END_OF_LINE;
                        case '\r':
                            state = ISA_CR;
                            break;
                        default:
                            state = ISI_VALUE;
                    }
                    break;

                case ISI_VALUE:
                    switch (actChar) {
                        case '\r':
                        case '\n':
                            state = INIT;
                            return ManifestTokenContext.VALUE;
                    }
                    break;
            }

            offset++;
        }

        switch (state) {
            case ISI_NAME:
                state = INIT;
                return ManifestTokenContext.NAME;
            case ISI_VALUE:
                state = INIT;
                return ManifestTokenContext.VALUE;
        }

        return null;
    }
}


text:
/** @file
    @brief Implementation

    @date 2014

    @author
    Sensics, Inc.
    <http://sensics.com/osvr>
*/

// Copyright 2014 Sensics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Internal Includes
#include <osvr/ClientKit/Context.h>
#include <osvr/ClientKit/Parameters.h>

// Library/third-party includes
// - none

// Standard includes
#include <iostream>

int main() {
    osvr::clientkit::ClientContext context(
        "com.osvr.exampleclients.DisplayParameter");

    std::string displayDescription = context.getStringParameter("/display");

    std::cout << "Got value of /display:\n" << displayDescription << std::endl;

    std::cout << "Library shut down, exiting." << std::endl;
    return 0;
}


text:
using System;
using System.Net;
using System.Net.Sockets;
using FeigDotNet.Exceptions;

namespace FeigDotNet.Connections
{
    public class FeigReaderTcpConnection : FeigReaderConnection
    {
        private readonly string readerHostAddress;
        private readonly int readerPortNumber;
        private readonly int timeout;
        private Socket tcpConnection = null;
        private bool isConnected = false;

        public FeigReaderTcpConnection(string readerHostAddress, int readerPortNumber, int timeout = 1000)
        {
            this.readerHostAddress = readerHostAddress;
            this.readerPortNumber = readerPortNumber;
            this.timeout = timeout;
        }

        public override void Open()
        {
            if (this.isConnected)
            {
                throw new FeigException("Already connected");
            }

            this.tcpConnection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.tcpConnection.ReceiveTimeout = this.timeout;
            this.tcpConnection.SendTimeout = this.timeout;

            this.tcpConnection.Connect(new IPEndPoint(IPAddress.Parse(this.readerHostAddress), this.readerPortNumber));
            this.isConnected = true;
        }

        public override void Close()
        {
            if (!this.isConnected)
            {
                return;
            }

            this.tcpConnection.Close(2000);
            this.isConnected = false;
        }

        public override byte[] SendAndRecieve(params byte[] data)
        {
            this.Send(data);
            return this.Recieve();
        }

        public override void Send(params byte[] data)
        {
            if (!this.isConnected)
            {
                this.Open();
            }

            byte[] package = new byte[data.Length + 5]; // 3 for prefix and 2 for crc16

            Array.Copy(data, 0, package, 3, data.Length);

            byte[] sendDataLength = BitConverter.GetBytes(package.Length);
            Array.Reverse(sendDataLength);

            package[0] = 0x02;
            package[1] = sendDataLength[2];
            package[2] = sendDataLength[3];

            byte[] crc16 = this.FastCRC16(package, 0, data.Length + 3); // all but 2 last bytes

            package[data.Length + 3] = crc16[0];
            package[data.Length + 4] = crc16[1];

            try
            {
                int res = this.tcpConnection.Send(package);
            }
            catch (SocketException e)
            {
                throw new FeigConnectionException("Unable to send data", e);
            }
        }

        public override byte[] Recieve()
        {
            if (!this.isConnected)
            {
                throw new FeigException("Connection closed");
            }

            try
            {
                byte[] responseTypeBuffer = new byte[1];
                this.tcpConnection.Receive(responseTypeBuffer);

                if (responseTypeBuffer[0] != 0x02)
                {
                    throw new FeigConnectionException("Invalid reader response");
                }

                byte[] dataLengthBuffer = new byte[2];
                this.tcpConnection.Receive(dataLengthBuffer);

                Array.Reverse(dataLengthBuffer);

                short dataLength = BitConverter.ToInt16(dataLengthBuffer, 0);

                byte[] dataBuffer = new byte[dataLength - 5];
                this.tcpConnection.Receive(dataBuffer);

                byte[] signatureBuffer = new byte[2];
                this.tcpConnection.Receive(signatureBuffer);

                return dataBuffer;
            }
            catch (SocketException e)
            {
                throw new FeigConnectionException("Unable to recieve data", e);
            }
        }
    }
}


text:
/* http://keith-wood.name/keypad.html
 Keypad field entry extension for jQuery v2.0.0.
 Written by Keith Wood (kbwood{at}iinet.com.au) August 2008.
 Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
 Please attribute the author if you use it. */

(function ($) { // hide the namespace

    var pluginName = 'keypad';

    var layoutStandard = ['  BSCECA', '_1_2_3_+@X', '_4_5_6_-@U', '_7_8_9_*@E', '_0_._=_/'];

    /** Create the keypad plugin.

Sets an input field to popup a keypad for keystroke entry,
     or creates an inline keypad in a div or span.

Expects HTML like:

<input type="text"> or
     <div></div>

Provide inline configuration like:

<input type="text" data-keypad="name: 'value'"/>

     @module Keypad
     @augments JQPlugin
     @example $(selector).keypad() */
    $.JQPlugin.createPlugin({

        /** The name of the plugin. */
        name: pluginName,

        /** Keypad before show callback.
         Triggered before the keypad is shown.
         @callback beforeShowCallback
         @param div {jQuery} The div to be shown.
         @param inst {object} The current instance settings. */

        /** Keypad on keypress callback.
         Triggered when a key on the keypad is pressed.
         @callback keypressCallback
         @param key {string} The key just pressed.
         @param value {string} The full value entered so far.
         @param inst {object} The current instance settings. */

        /** Keypad on close callback.
         Triggered when the keypad is closed.
         @callback closeCallback
         @param value {string} The full value entered so far.
         @param inst {object} The current instance settings. */

        /** Keypad is alphabetic callback.
         Triggered when an alphabetic key needs to be identified.
         @callback isAlphabeticCallback
         @param ch {string} The key to check.
         @return {boolean} True if this key is alphabetic, false if not.
         @example isAlphabetic: function(ch) {
	return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
 } */

        /** Keypad is numeric callback.
         Triggered when an numeric key needs to be identified.
         @callback isNumericCallback
         @param ch {string} The key to check.
         @return {boolean} True if this key is numeric, false if not.
         @example isNumeric: function(ch) {
	return (ch >= '0' && ch <= '9');
 } */

        /** Keypad to upper callback.
         Triggered to convert keys to upper case.
         @callback toUpperCallback
         @param ch {string} The key to convert.
         @return {string} The upper case version of this key.
         @example toUpper: function(ch) {
	return ch.toUpperCase();
 } */

        /** Default settings for the plugin.
         @property [showOn='focus'] {string} 'focus' for popup on focus, 'button' for trigger button, or 'both' for either.
         @property [buttonImage=''] {string} URL for trigger button image.
         @property [buttonImageOnly=false] {boolean} True if the image appears alone, false if it appears on a button.
         @property [showAnim='show'] {string} Name of jQuery animation for popup.
         @property [showOptions=null] {object} Options for enhanced animations.
         @property [duration='normal'] {string|number} Duration of display/closure.
         @property [appendText=''] {string} Display text following the text field, e.g. showing the format.
         @property [useThemeRoller=false] {boolean} True to add ThemeRoller classes.
         @property [keypadClass=''] {string} Additional CSS class for the keypad for an instance.
         @property [prompt=''] {string} Display text at the top of the keypad.
         @property [layout=this.numericLayout] {string} Layout of keys.
         @property [separator=''] {string} Separator character between keys.
         @property [target=null] {string|jQuery|Element} Input target for an inline keypad.
         @property [keypadOnly=true] {boolean} True for entry only via the keypad, false for real keyboard too.
         @property [randomiseAlphabetic=false] {boolean} True to randomise the alphabetic key positions, false to keep in order.
         @property [randomiseNumeric=false] {boolean} True to randomise the numeric key positions, false to keep in order.
         @property [randomiseOther=false] {boolean} True to randomise the other key positions, false to keep in order.
         @property [randomiseAll=false] {boolean} True to randomise all key positions, false to keep in order.
         @property [beforeShow=null] {beforeShowCallback} Callback before showing the keypad.
         @property [onKeypress=null] {keypressCallback} Callback when a key is selected.
         @property [onClose=null] {closeCallback} Callback when the panel is closed. */
        defaultOptions: {
            showOn: 'focus',
            buttonImage: '',
            buttonImageOnly: false,
            showAnim: 'slideDown',
            showOptions: null,
            duration: 'fast',
            appendText: '',
            useThemeRoller: false,
            keypadClass: '',
            prompt: '',
            layout: [], // Set at the end
            separator: '',
            target: null,
            keypadOnly: true,
            randomiseAlphabetic: false,
            randomiseNumeric: false,
            randomiseOther: false,
            randomiseAll: false,
            beforeShow: null,
            onKeypress: null,
            onClose: null
        },

        /** Localisations for the plugin.
         Entries are objects indexed by the language code ('' being the default US/English).
         Each object has the following attributes.
         @property [buttonText='...'] {string} Display text for trigger button.
         @property [buttonStatus='Open the keypad'] {string} Status text for trigger button.
         @property [closeText='Close'] {string} Display text for close link.
         @property [closeStatus='Close the keypad'] {string} Status text for close link.
         @property [clearText='Clear'] {string} Display text for clear link.
         @property [clearStatus='Erase all the text'] {string} Status text for clear link.
         @property [backText='Back'] {string} Display text for back link.
         @property [backStatus='Erase the previous character'] {string} Status text for back link.
         @property [spacebarText=' '] {string} Display text for space bar.
         @property [spacebarStatus='Space'] {string} Status text for space bar.
         @property [enterText='Enter'] {string} Display text for carriage return.
         @property [enterStatus='Carriage return'] {string} Status text for carriage return.
         @property [tabText='→'] {string} Display text for tab.
         @property [tabStatus='Horizontal tab'] {string} Status text for tab.
         @property [shiftText='Shift'] {string} Display text for shift link.
         @property [shiftStatus='Toggle upper/lower case characters'] {string} Status text for shift link.
         @property [alphabeticLayout=this.qwertyAlphabetic] {string} Default layout for alphabetic characters.
         @property [fullLayout=this.qwertyLayout] {string} Default layout for full keyboard.
         @property [isAlphabetic=this.isAlphabetic] {isAlphabeticCallback} Function to determine if character is alphabetic.
         @property [isNumeric=this.isNumeric] {isNumericCallback} Function to determine if character is numeric.
         @property [toUpper=this.toUpper] {toUpperCallback} Function to convert characters to upper case.
         @property [isRTL=false] {boolean} True if right-to-left language, false if left-to-right. */
        regionalOptions: { // Available regional settings, indexed by language/country code
            '': { // Default regional settings - English/US
                buttonText: '...',
                buttonStatus: 'Open the keypad',
                closeText: 'Close',
                closeStatus: 'Close the keypad',
                clearText: 'clear',
                clearStatus: 'Erase all the text',
                backText: '',
                backStatus: 'Erase the previous character',
                spacebarText: ' ',
                spacebarStatus: 'Space',
                enterText: 'Enter',
                enterStatus: 'Carriage return',
                tabText: '→',
                tabStatus: 'Horizontal tab',
                shiftText: 'Shift',
                shiftStatus: 'Toggle upper/lower case characters',
                alphabeticLayout: [], // Set at the end
                fullLayout: [],
                isAlphabetic: null,
                isNumeric: null,
                toUpper: null,
                isRTL: false
            }
        },

        /** Names of getter methods - those that can't be chained. */
        _getters: ['isDisabled'],

        _curInst: null, // The current instance in use
        _disabledFields: [], // List of keypad fields that have been disabled
        _keypadShowing: false, // True if the popup panel is showing , false if not
        _keyCode: 0,
        _specialKeys: [],

        _mainDivClass: pluginName + '-popup', // The main keypad division class
        _inlineClass: pluginName + '-inline', // The inline marker class
        _appendClass: pluginName + '-append', // The append marker class
        _triggerClass: pluginName + '-trigger', // The trigger marker class
        _disableClass: pluginName + '-disabled', // The disabled covering marker class
        _inlineEntryClass: pluginName + '-keyentry', // The inline entry marker class
        _rtlClass: pluginName + '-rtl', // The right-to-left marker class
        _rowClass: pluginName + '-row', // The keypad row marker class
        _promptClass: pluginName + '-prompt', // The prompt marker class
        _specialClass: pluginName + '-special', // The special key marker class
        _namePrefixClass: pluginName + '-', // The key name marker class prefix
        _keyClass: pluginName + '-key', // The key marker class
        _keyDownClass: pluginName + '-key-down', // The key down marker class

        // Standard US keyboard alphabetic layout
        qwertyAlphabetic: ['qwertyuiop', 'asdfghjkl', 'zxcvbnm'],
        // Standard US keyboard layout
        qwertyLayout: ['!@#$%^&*()_=' + this.HALF_SPACE + this.SPACE + this.CLOSE,
            this.HALF_SPACE + '`~[]{}<>\\|/' + this.SPACE + '789',
            'qwertyuiop\'"' + this.HALF_SPACE + '456',
            this.HALF_SPACE + 'asdfghjkl;:' + this.SPACE + '123',
            this.SPACE + 'zxcvbnm,.?' + this.SPACE + this.HALF_SPACE + '-0+',
            '' + this.TAB + this.ENTER + this.SPACE_BAR + this.SHIFT +
            this.HALF_SPACE + this.BACK + this.CLEAR],

        /** Add the definition of a special key.
         @param id {string} The identifier for this key - access via $.keypad.xxx.<id>.
         @param name {string} The prefix for localisation strings and the suffix for a class name.
         @param action {function} The action performed for this key - receives inst as a parameter.
         @param noHighlight {boolean} True to suppress highlight when using ThemeRoller.
         @return {Keypad} The keypad object for chaining further calls.
         @example $.keypad.addKeyDef('CLEAR', 'clear', function(inst) { plugin._clearValue(inst); }); */
        addKeyDef: function (id, name, action, noHighlight) {
            if (this._keyCode == 32) {
                throw 'Only 32 special keys allowed';
            }
            this[id] = String.fromCharCode(this._keyCode++);
            this._specialKeys.push({
                code: this[id], id: id, name: name,
                action: action, noHighlight: noHighlight
            });
            return this;
        },

        /** Additional setup for the keypad.
         Create popup div. */
        _init: function () {
            this.mainDiv = $('

');
            this._super();
        },

        _instSettings: function (elem, options) {
            var inline = !elem[0].nodeName.toLowerCase().match(/input|textarea/);
            return {
                _inline: inline, ucase: false,
                _mainDiv: (inline ? $('

') : plugin.mainDiv)
            };
        },

        _postAttach: function (elem, inst) {
            if (inst._inline) {
                elem.append(inst._mainDiv).on('click.' + inst.name, function () {
                    inst._input.focus();
                });
                this._updateKeypad(inst);
            }
            else if (elem.is(':disabled')) {
                this.disable(elem);
            }
        },

        /** Determine the input field for the keypad.
         @private
         @param elem {jQuery} The target control.
         @param inst {object} The instance settings. */
        _setInput: function (elem, inst) {
            inst._input = $(!inst._inline ? elem : inst.options.target ||
                '<input type="text" class="' + this._inlineEntryClass + '" disabled/>');
            if (inst._inline) {
                elem.find('input').remove();
                if (!inst.options.target) {
                    elem.append(inst._input);
                }
            }
        },

        _optionsChanged: function (elem, inst, options) {
            $.extend(inst.options, options);
            elem.off('.' + inst.name).siblings('.' + this._appendClass).remove().end().siblings('.' + this._triggerClass).remove();
            var appendText = inst.options.appendText;
            if (appendText) {
                elem[inst.options.isRTL ? 'before' : 'after'](
                    '' + appendText + '');
            }
            if (!inst._inline) {
                if (inst.options.showOn == 'focus' || inst.options.showOn == 'both') {
                    // pop-up keypad when in the marked field
                    elem.on('focus.' + inst.name, this.show).on('keydown.' + inst.name, this._doKeyDown);
                }
                if (inst.options.showOn == 'button' || inst.options.showOn == 'both') {
                    // pop-up keypad when button clicked
                    var buttonStatus = inst.options.buttonStatus;
                    var buttonImage = inst.options.buttonImage;
                    var trigger = $(inst.options.buttonImageOnly ?
                        $('') :
                        $('<button type="button" title="' + buttonStatus + '"></button>').html(buttonImage == '' ? inst.options.buttonText :
                            $('')));
                    elem[inst.options.isRTL ? 'before' : 'after'](trigger);
                    trigger.addClass(this._triggerClass).click(function () {
                        if (plugin._keypadShowing && plugin._lastField == elem[0]) {
                            plugin.hide();
                        }
                        else {
                            plugin.show(elem[0]);
                        }
                        return false;
                    });
                }
            }
            inst.saveReadonly = elem.attr('readonly');
            elem[inst.options.keypadOnly ? 'attr' : 'removeAttr']('readonly', true).on('setData.' + inst.name, function (event, key, value) {
                inst.options[key] = value;
            }).on('getData.' + inst.name, function (event, key) {
                return inst.options[key];
            });
            this._setInput(elem, inst);
            this._updateKeypad(inst);
        },

        _preDestroy: function (elem, inst) {
            if (this._curInst == inst) {
                this.hide();
            }
            elem.siblings('.' + this._appendClass).remove().end().siblings('.' + this._triggerClass).remove().end().prev('.' + this._inlineEntryClass).remove();
            elem.empty().off('.' + inst.name)
                [inst.saveReadonly ? 'attr' : 'removeAttr']('readonly', true);
            inst._input.removeData(inst.name);
        },

        /** Enable the keypad for a jQuery selection.
         @param elem {Element} The target text field.
         @example $(selector).keypad('enable'); */
        enable: function (elem) {
            elem = $(elem);
            if (!elem.hasClass(this._getMarker())) {
                return;
            }
            var nodeName = elem[0].nodeName.toLowerCase();
            if (nodeName.match(/input|textarea/)) {
                elem.prop('disabled', false).siblings('button.' + this._triggerClass).prop('disabled', false).end().siblings('img.' + this._triggerClass).css({
                    opacity: '1.0',
                    cursor: ''
                });
            }
            else if (nodeName.match(/div|span/)) {
                elem.children('.' + this._disableClass).remove();
                this._getInst(elem)._mainDiv.find('button').prop('disabled', false);
            }
            this._disabledFields = $.map(this._disabledFields,
                function (value) {
                    return (value == elem[0] ? null : value);
                }); // delete entry
        },

        /** Disable the keypad for a jQuery selection.
         @param elem {Element} The target text field.
         @example $(selector).keypad('disable'); */
        disable: function (elem) {
            elem = $(elem);
            if (!elem.hasClass(this._getMarker())) {
                return;
            }
            var nodeName = elem[0].nodeName.toLowerCase();
            if (nodeName.match(/input|textarea/)) {
                elem.prop('disabled', true).siblings('button.' + this._triggerClass).prop('disabled', true).end().siblings('img.' + this._triggerClass).css({
                    opacity: '0.5',
                    cursor: 'default'
                });
            }
            else if (nodeName.match(/div|span/)) {
                var inline = elem.children('.' + this._inlineClass);
                var offset = inline.offset();
                var relOffset = {left: 0, top: 0};
                inline.parents().each(function () {
                    if ($(this).css('position') == 'relative') {
                        relOffset = $(this).offset();
                        return false;
                    }
                });
                elem.prepend('

');
                this._getInst(elem)._mainDiv.find('button').prop('disabled', true);
            }
            this._disabledFields = $.map(this._disabledFields,
                function (value) {
                    return (value == elem[0] ? null : value);
                }); // delete entry
            this._disabledFields[this._disabledFields.length] = elem[0];
        },

        /** Is the text field disabled as a keypad?
         @param elem {Element} The target text field.
         @return {boolean} True if disabled, false if enabled.
         @example var disabled = $(selector).keypad('isDisabled'); */
        isDisabled: function (elem) {
            return (elem && $.inArray(elem, this._disabledFields) > -1);
        },

        /** Pop-up the keypad for a given text field.
         @param elem {Element|Event} The text field attached to the keypad or event if triggered by focus.
         @example $(selector).keypad('show'); */
        show: function (elem) {
            elem = elem.target || elem;
            if (plugin.isDisabled(elem) || plugin._lastField == elem) { // already here
                return;
            }
            var inst = plugin._getInst(elem);
            plugin.hide(null, '');
            plugin._lastField = elem;
            plugin._pos = plugin._findPos(elem);
            plugin._pos[1] += elem.offsetHeight; // add the height
            var isFixed = false;
            $(elem).parents().each(function () {
                isFixed |= $(this).css('position') == 'fixed';
                return !isFixed;
            });
            var offset = {left: plugin._pos[0], top: plugin._pos[1]};
            plugin._pos = null;
            // determine sizing offscreen
            inst._mainDiv.css({position: 'absolute', display: 'block', top: '-1000px', width: 'auto'});
            plugin._updateKeypad(inst);
            // and adjust position before showing
            offset = plugin._checkOffset(inst, offset, isFixed);
            inst._mainDiv.css({
                position: (isFixed ? 'fixed' : 'absolute'), display: 'none',
                left: offset.left + 'px', top: offset.top + 'px'
            });
            var duration = inst.options.duration;
            var showAnim = inst.options.showAnim;
            var postProcess = function () {
                plugin._keypadShowing = true;
            };
            if ($.effects && ($.effects[showAnim] || ($.effects.effect && $.effects.effect[showAnim]))) {
                var data = inst._mainDiv.data(); // Update old effects data
                for (var key in data) {
                    if (key.match(/^ec\.storage\./)) {
                        data[key] = inst._mainDiv.css(key.replace(/ec\.storage\./, ''));
                    }
                }
                inst._mainDiv.data(data).show(showAnim,
                    inst.options.showOptions || {}, duration, postProcess);
            }
            else {
                inst._mainDiv[showAnim || 'show']((showAnim ? duration : 0), postProcess);
            }
            if (inst._input[0].type != 'hidden') {
                inst._input[0].focus();
            }
            plugin._curInst = inst;
        },

        /** Generate the keypad content.
         @private
         @param inst {object} The instance settings. */
        _updateKeypad: function (inst) {
            var borders = this._getBorders(inst._mainDiv);
            inst._mainDiv.empty().append(this._generateHTML(inst)).removeClass().addClass(inst.options.keypadClass +
                (inst.options.useThemeRoller ? ' ui-widget ui-widget-content' : '') +
                (inst.options.isRTL ? ' ' + this._rtlClass : '') + ' ' +
                (inst._inline ? this._inlineClass : this._mainDivClass));
            if ($.isFunction(inst.options.beforeShow)) {
                inst.options.beforeShow.apply((inst._input ? inst._input[0] : null),
                    [inst._mainDiv, inst]);
            }
        },

        /** Retrieve the size of left and top borders for an element.
         @private
         @param elem {jQuery} The element of interest.
         @return {number[]} The left and top borders. */
        _getBorders: function (elem) {
            var convert = function (value) {
                return {thin: 1, medium: 3, thick: 5}[value] || value;
            };
            return [parseFloat(convert(elem.css('border-left-width'))),
                parseFloat(convert(elem.css('border-top-width')))];
        },

        /** Check positioning to remain on screen.
         @private
         @param inst {object} The instance settings.
         @param offset {object} The current offset.
         @param isFixed {boolean} True if the text field is fixed in position.
         @return {object} The updated offset. */
        _checkOffset: function (inst, offset, isFixed) {
            var pos = inst._input ? this._findPos(inst._input[0]) : null;
            var browserWidth = window.innerWidth || document.documentElement.clientWidth;
            var browserHeight = window.innerHeight || document.documentElement.clientHeight;
            var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
            var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
            // recalculate width as otherwise set to 100%
            var width = 0;
            inst._mainDiv.find(':not(div)').each(function () {
                width = Math.max(width, this.offsetLeft + $(this).outerWidth(true));
            });
            inst._mainDiv.css('width', width + 1);
            // reposition keypad panel horizontally if outside the browser window
            if (inst.options.isRTL ||
                (offset.left + inst._mainDiv.outerWidth() - scrollX) > browserWidth) {
                offset.left = Math.max((isFixed ? 0 : scrollX),
                    pos[0] + (inst._input ? inst._input.outerWidth() : 0) -
                    (isFixed ? scrollX : 0) - inst._mainDiv.outerWidth());
            }
            else {
                offset.left = Math.max((isFixed ? 0 : scrollX), offset.left - (isFixed ? scrollX : 0));
            }
            // reposition keypad panel vertically if outside the browser window
            if ((offset.top + inst._mainDiv.outerHeight() - scrollY) > browserHeight) {
                offset.top = Math.max((isFixed ? 0 : scrollY),
                    pos[1] - (isFixed ? scrollY : 0) - inst._mainDiv.outerHeight());
            }
            else {
                offset.top = Math.max((isFixed ? 0 : scrollY), offset.top - (isFixed ? scrollY : 0));
            }
            return offset;
        },

        /** Find an object's position on the screen.
         @private
         @param obj {Element} The element to find the position for.
         @return {number[]} The element's position. */
        _findPos: function (obj) {
            while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) {
                obj = obj.nextSibling;
            }
            var position = $(obj).offset();
            return [position.left, position.top];
        },

        /** Hide the keypad from view.
         @param elem {Element} The text field attached to the keypad.
         @param duration {string} The duration over which to close the keypad.
         @example $(selector).keypad('hide') */
        hide: function (elem, duration) {
            var inst = this._curInst;
            if (!inst || (elem && inst != $.data(elem, this.propertyName))) {
                return;
            }
            if (this._keypadShowing) {
                duration = (duration != null ? duration : inst.options.duration);
                var showAnim = inst.options.showAnim;
                if ($.effects && ($.effects[showAnim] || ($.effects.effect && $.effects.effect[showAnim]))) {
                    inst._mainDiv.hide(showAnim, inst.options.showOptions || {}, duration);
                }
                else {
                    inst._mainDiv[(showAnim == 'slideDown' ? 'slideUp' :
                        (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))](showAnim ? duration : 0);
                }
            }
            if ($.isFunction(inst.options.onClose)) {
                inst.options.onClose.apply((inst._input ? inst._input[0] : null),  // trigger custom callback
                    [inst._input.val(), inst]);
            }
            if (this._keypadShowing) {
                this._keypadShowing = false;
                this._lastField = null;
            }
            if (inst._inline) {
                inst._input.val('');
            }
            this._curInst = null;
        },

        /** Handle keystrokes.
         @private
         @param event {Event} The key event. */
        _doKeyDown: function (event) {
            if (event.keyCode == 9) { // Tab out
                plugin.mainDiv.stop(true, true);
                plugin.hide();
            }
        },

        /** Close keypad if clicked elsewhere.
         @private
         @param event {Event} The mouseclick details. */
        _checkExternalClick: function (event) {
            if (!plugin._curInst) {
                return;
            }
            var target = $(event.target);
            if (target.closest('.' + plugin._mainDivClass).length === 0 && !target.hasClass(plugin._getMarker()) &&
                target.closest('.' + plugin._triggerClass).length === 0 &&
                plugin._keypadShowing) {
                plugin.hide();
            }
        },

        /** Toggle between upper and lower case.
         @private
         @param inst {object} The instance settings. */
        _shiftKeypad: function (inst) {
            inst.ucase = !inst.ucase;
            this._updateKeypad(inst);
            inst._input.focus(); // for further typing
        },

        /** Erase the text field.
         @private
         @param inst {object} The instance settings. */
        _clearValue: function (inst) {
            this._setValue(inst, '', 0);
            this._notifyKeypress(inst, plugin.DEL);
        },

        /** Erase the last character.
         @private
         @param inst {object} The instance settings. */
        _backValue: function (inst) {
            var elem = inst._input[0];
            var value = inst._input.val();
            var range = [value.length, value.length];
            range = (inst._input.prop('readonly') || inst._input.prop('disabled') ? range :
                (elem.setSelectionRange /* Mozilla */ ? [elem.selectionStart, elem.selectionEnd] :
                    (elem.createTextRange /* IE */ ? this._getIERange(elem) : range)));
            this._setValue(inst, (value.length == 0 ? '' :
                value.substr(0, range[0] - 1) + value.substr(range[1])), range[0] - 1);
            this._notifyKeypress(inst, plugin.BS);
        },

        /** Update the text field with the selected value.
         @private
         @param inst {object} The instance settings.
         @param value {string} The new character to add. */
        _selectValue: function (inst, value) {
            this.insertValue(inst._input[0], value);
            this._setValue(inst, inst._input.val());
            this._notifyKeypress(inst, value);
        },

        /** Update the text field with the selected value.
         @param input {string|Element|jQuery} The jQuery selector, input field, or jQuery collection.
         @param value {string} The new character to add.
         @example $.keypad.insertValue(field, 'abc'); */
        insertValue: function (input, value) {
            input = (input.jquery ? input : $(input));
            var elem = input[0];
            var newValue = input.val();
            var range = [newValue.length, newValue.length];
            range = (input.attr('readonly') || input.attr('disabled') ? range :
                (elem.setSelectionRange /* Mozilla */ ? [elem.selectionStart, elem.selectionEnd] :
                    (elem.createTextRange /* IE */ ? this._getIERange(elem) : range)));
            input.val(newValue.substr(0, range[0]) + value + newValue.substr(range[1]));
            pos = range[0] + value.length;
            if (input.is(':visible')) {
                input.focus(); // for further typing
            }
            if (elem.setSelectionRange) { // Mozilla
                if (input.is(':visible')) {
                    elem.setSelectionRange(pos, pos);
                }
            }
            else if (elem.createTextRange) { // IE
                range = elem.createTextRange();
                range.move('character', pos);
                range.select();
            }
        },

        /** Get the coordinates for the selected area in the text field in IE.
         @private
         @param elem {Element} The target text field.
         @return {number[]} The start and end positions of the selection. */
        _getIERange: function (elem) {
            elem.focus();
            var selectionRange = document.selection.createRange().duplicate();
            // Use two ranges: before and selection
            var beforeRange = this._getIETextRange(elem);
            beforeRange.setEndPoint('EndToStart', selectionRange);
            // Check each range for trimmed newlines by shrinking the range by one
            // character and seeing if the text property has changed. If it has not
            // changed then we know that IE has trimmed a \r\n from the end.
            var checkCRLF = function (range) {
                var origText = range.text;
                var text = origText;
                var finished = false;
                while (true) {
                    if (range.compareEndPoints('StartToEnd', range) == 0) {
                        break;
                    }
                    else {
                        range.moveEnd('character', -1);
                        if (range.text == origText) {
                            text += '\r\n';
                        }
                        else {
                            break;
                        }
                    }
                }
                return text;
            };
            var beforeText = checkCRLF(beforeRange);
            var selectionText = checkCRLF(selectionRange);
            return [beforeText.length, beforeText.length + selectionText.length];
        },

        /** Create an IE text range for the text field.
         @private
         @param elem {Element} The target text field.
         @return {object} The corresponding text range. */
        _getIETextRange: function (elem) {
            var isInput = (elem.nodeName.toLowerCase() == 'input');
            var range = (isInput ? elem.createTextRange() : document.body.createTextRange());
            if (!isInput) {
                range.moveToElementText(elem); // Selects all the text for a textarea
            }
            return range;
        },

        /** Set the text field to the selected value, and trigger any on change event.
         @private
         @param inst {object} The instance settings.
         @param value {string} The new value for the text field. */
        _setValue: function (inst, value) {
            var maxlen = inst._input.attr('maxlength');
            if (maxlen > -1) {
                value = value.substr(0, maxlen);
            }
            inst._input.val(value);
            if (!$.isFunction(inst.options.onKeypress)) {
                inst._input.trigger('change'); // fire the change event
            }
        },

        /** Notify clients of a keypress.
         @private
         @param inst {object} The instance settings.
         @param key {string} The character pressed. */
        _notifyKeypress: function (inst, key) {
            if ($.isFunction(inst.options.onKeypress)) { // trigger custom callback
                inst.options.onKeypress.apply((inst._input ? inst._input[0] : null),
                    [key, inst._input.val(), inst]);
            }
        },

        /** Generate the HTML for the current state of the keypad.
         @private
         @param inst {object} The instance settings.
         @return {jQuery} The HTML for this keypad. */
        _generateHTML: function (inst) {
            var html = (!inst.options.prompt ? '' : '
' +
                inst.options.prompt + '
');
            var layout = this._randomiseLayout(inst);
            for (var i = 0; i < layout.length; i++) {
                html += '
';
                var keys = layout[i].split(inst.options.separator);
                for (var j = 0; j < keys.length; j++) {
                    if (inst.ucase) {
                        keys[j] = inst.options.toUpper(keys[j]);
                    }
                    var keyDef = this._specialKeys[keys[j].charCodeAt(0)];
                    if (keyDef) {
                        html += (keyDef.action ? '<button type="button" class="button ' + this._specialClass +
                            ' ' + this._namePrefixClass + keyDef.name +
                            (inst.options.useThemeRoller ? ' ui-corner-all ui-state-default' +
                                (keyDef.noHighlight ? '' : ' ui-state-highlight') : '') +
                            '" title="' + inst.options[keyDef.name + 'Status'] + '">' +
                            (inst.options[keyDef.name + 'Text'] || ' ') + '</button>' :
                            '

');
                    }
                    else {
                        html += '<button type="button" class="button ' + this._keyClass +
                            (inst.options.useThemeRoller ? ' ui-corner-all ui-state-default' : '') + '">' +
                            (keys[j] == ' ' ? ' ' : keys[j]) + '</button>';
                    }
                }
                html += '
';
            }
            html = $(html);
            var thisInst = inst;
            var activeClasses = this._keyDownClass + (inst.options.useThemeRoller ? ' ui-state-active' : '');
            html.find('button').mousedown(function () {
                $(this).addClass(activeClasses);
            }).mouseup(function () {
                $(this).removeClass(activeClasses);
            }).mouseout(function () {
                $(this).removeClass(activeClasses);
            }).filter('.' + this._keyClass).click(function () {
                plugin._selectValue(thisInst, $(this).text());
            });
            $.each(this._specialKeys, function (i, keyDef) {
                html.find('.' + plugin._namePrefixClass + keyDef.name).click(function () {
                    keyDef.action.apply(thisInst._input, [thisInst]);
                });
            });
            return html;
        },

        /** Check whether characters should be randomised, and, if so, produce the randomised layout.
         @private
         @param inst {object} The instance settings.
         @return {string[]} The layout with any requested randomisations applied. */
        _randomiseLayout: function (inst) {
            if (!inst.options.randomiseNumeric && !inst.options.randomiseAlphabetic && !inst.options.randomiseOther && !inst.options.randomiseAll) {
                return inst.options.layout;
            }
            var numerics = [];
            var alphas = [];
            var others = [];
            var newLayout = [];
            // Find characters of different types
            for (var i = 0; i < inst.options.layout.length; i++) {
                newLayout[i] = '';
                var keys = inst.options.layout[i].split(inst.options.separator);
                for (var j = 0; j < keys.length; j++) {
                    if (this._isControl(keys[j])) {
                        continue;
                    }
                    if (inst.options.randomiseAll) {
                        others.push(keys[j]);
                    }
                    else if (inst.options.isNumeric(keys[j])) {
                        numerics.push(keys[j]);
                    }
                    else if (inst.options.isAlphabetic(keys[j])) {
                        alphas.push(keys[j]);
                    }
                    else {
                        others.push(keys[j]);
                    }
                }
            }
            // Shuffle them
            if (inst.options.randomiseNumeric) {
                this._shuffle(numerics);
            }
            if (inst.options.randomiseAlphabetic) {
                this._shuffle(alphas);
            }
            if (inst.options.randomiseOther || inst.options.randomiseAll) {
                this._shuffle(others);
            }
            var n = 0;
            var a = 0;
            var o = 0;
            // And replace them in the layout
            for (var i = 0; i < inst.options.layout.length; i++) {
                var keys = inst.options.layout[i].split(inst.options.separator);
                for (var j = 0; j < keys.length; j++) {
                    newLayout[i] += (this._isControl(keys[j]) ? keys[j] :
                            (inst.options.randomiseAll ? others[o++] :
                                (inst.options.isNumeric(keys[j]) ? numerics[n++] :
                                    (inst.options.isAlphabetic(keys[j]) ? alphas[a++] :
                                        others[o++])))) + inst.options.separator;
                }
            }
            return newLayout;
        },

        /** Is a given character a control character?
         @private
         @param ch {string} The character to test.
         @return {boolean} True if a control character, false if not. */
        _isControl: function (ch) {
            return ch < ' ';
        },

        /** Is a given character alphabetic?
         @param ch {string} The character to test.
         @return {boolean} True if alphabetic, false if not. */
        isAlphabetic: function (ch) {
            return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
        },

        /** Is a given character numeric?
         @param ch {string} The character to test.
         @return {boolean} True if numeric, false if not. */
        isNumeric: function (ch) {
            return (ch >= '0' && ch <= '9');
        },

        /** Convert a character to upper case.
         @param ch {string} The character to convert.
         @return {string} Its uppercase version. */
        toUpper: function (ch) {
            return ch.toUpperCase();
        },

        /** Randomise the contents of an array.
         @private
         @param values {string[]} The array to rearrange. */
        _shuffle: function (values) {
            for (var i = values.length - 1; i > 0; i--) {
                var j = Math.floor(Math.random() * values.length);
                var ch = values[i];
                values[i] = values[j];
                values[j] = ch;
            }
        }
    });

    var plugin = $.keypad;

    // Initialise the key definitions
    plugin.addKeyDef('CLOSE', 'close', function (inst) {
        plugin._curInst = (inst._inline ? inst : plugin._curInst);
        plugin.hide();
    });
    plugin.addKeyDef('CLEAR', 'clear', function (inst) {
        plugin._clearValue(inst);
    });
    plugin.addKeyDef('BACK', 'back', function (inst) {
        plugin._backValue(inst);
    });
    plugin.addKeyDef('SHIFT', 'shift', function (inst) {
        plugin._shiftKeypad(inst);
    });
    plugin.addKeyDef('SPACE_BAR', 'spacebar', function (inst) {
        plugin._selectValue(inst, ' ');
    }, true);
    plugin.addKeyDef('SPACE', 'space');
    plugin.addKeyDef('HALF_SPACE', 'half-space');
    plugin.addKeyDef('ENTER', 'enter', function (inst) {
        plugin._selectValue(inst, '\x0D');
    }, true);
    plugin.addKeyDef('TAB', 'tab', function (inst) {
        plugin._selectValue(inst, '\x09');
    }, true);

    // Initialise the layouts and settings
    plugin.numericLayout = ['123' + plugin.CLOSE, '456' + plugin.CLEAR, '789' + plugin.BACK, plugin.SPACE + '0'];
    plugin.qwertyLayout = ['!@#$%^&*()_=' + plugin.HALF_SPACE + plugin.SPACE + plugin.CLOSE,
        plugin.HALF_SPACE + '`~[]{}<>\\|/' + plugin.SPACE + '789',
        'qwertyuiop\'"' + plugin.HALF_SPACE + '456',
        plugin.HALF_SPACE + 'asdfghjkl;:' + plugin.SPACE + '123',
        plugin.SPACE + 'zxcvbnm,.?' + plugin.SPACE + plugin.HALF_SPACE + '-0+',
        '' + plugin.TAB + plugin.ENTER + plugin.SPACE_BAR + plugin.SHIFT +
        plugin.HALF_SPACE + plugin.BACK + plugin.CLEAR],
        $.extend(plugin.regionalOptions[''], {
            alphabeticLayout: plugin.qwertyAlphabetic, fullLayout: plugin.qwertyLayout,
            isAlphabetic: plugin.isAlphabetic, isNumeric: plugin.isNumeric, toUpper: plugin.toUpper
        });
    plugin.setDefaults($.extend({layout: plugin.numericLayout}, plugin.regionalOptions['']));

    // Add the keypad division and external click check
    $(function () {
        $(document.body).append(plugin.mainDiv).mousedown(plugin._checkExternalClick);
    });

})(jQuery);


text:
package com.yammer.breakerbox.azure.model.tests;

import com.google.common.base.Optional;
import com.yammer.breakerbox.azure.TableClient;
import com.yammer.breakerbox.azure.TableClientFactory;
import com.yammer.breakerbox.azure.model.ServiceEntity;
import com.yammer.breakerbox.azure.tests.TableClientTester;
import com.yammer.breakerbox.azure.tests.WithConfiguration;
import com.yammer.breakerbox.store.DependencyId;
import com.yammer.breakerbox.store.ServiceId;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.UUID;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

public class ServiceEntityTest extends WithConfiguration {
    private ServiceId testServiceId;
    private DependencyId testDependencyId;
    private TableClient tableClient;
    private TableClientTester tableClientTester;

    @Before
    public void setup() {
        testServiceId = ServiceId.from(UUID.randomUUID().toString());
        testDependencyId = DependencyId.from(UUID.randomUUID().toString());
        tableClient = new TableClientFactory(azureTableConfiguration).create();
        tableClientTester = new TableClientTester(tableClient);
        assumeTrue(validAzureAccount());
    }

    @After
    public void tearDown() {
        tableClientTester.remove(ServiceEntity.build(testServiceId, testDependencyId));
    }

    @Test
    public void canInsert() {
        final ServiceEntity entity = ServiceEntity.build(testServiceId, testDependencyId);
        assertTrue(tableClient.insert(entity));

        final Optional<ServiceEntity> retrieveEntity = tableClient.retrieve(entity);
        assertThat(retrieveEntity).isEqualTo(Optional.of(entity));

        assertThat(retrieveEntity.get().getServiceId()).isEqualTo(testServiceId);
        assertThat(retrieveEntity.get().getDependencyId()).isEqualTo(testDependencyId);
    }
}


text:
struct XsControl;
struct XsPortInfo;
class SerialInterface;

class RestoreCommunication : public CallbackManagerXda, protected xsens::StandardThread
{
public:
	RestoreCommunication(XsControl* control);
	~RestoreCommunication();

	XsResultValue start(const XsString &portName);
	void stop();

protected:
	int32_t innerFunction(void) override;

private:
	XsResultValue openComPort(const XsPortInfo &portInfo);

	XsControl* m_control;
	SerialInterface* m_serialInterface;
	XsString m_portName;

	volatile std::atomic<bool> m_isRestoring;
};

#endif


text:
'use strict';

const assert     = require('chai').assert;
const parseScene = require('../lib/scene-parser');

describe('scene parser', function(){

  it('handles comma-separated actions', () => {
    let scene = {
      'intro': {
        'say': 'Hello world',
        'actions': {
          'FirstIntent,SecondIntent': {
            replay: null
          }
        }
      }
    };

    parseScene(scene);
    let actions = scene.intro.actions;

    assert.ok(actions.FirstIntent);
    assert.ok(actions.SecondIntent);
    assert.equal(actions.FirstIntent, actions.SecondIntent);
    assert.notOk(actions['FirstIntent,SecondIntent']);

  });

  it('removes hidden labels', () => {
    let scene = {
      '.hidden': {
        'say': 'Hello world',
        }
    };

    parseScene(scene);

    assert.equal(Object.keys(scene).length, 0);

  });

});


text:
#import <Foundation/NSPredicate.h>

@interface NSBlockPredicate : NSPredicate
{
    id _block;
}

- (id)_predicateBlock;
- (id)predicateWithSubstitutionVariables:(id)arg1;
- (void)acceptVisitor:(id)arg1 flags:(unsigned long long)arg2;
- (id)predicateFormat;
- (_Bool)evaluateWithObject:(id)arg1 substitutionVariables:(id)arg2;
- (void)dealloc;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (id)initWithCoder:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (_Bool)supportsSecureCoding;
- (id)initWithBlock:(id)arg1;

@end


text:
package com.rabbit.service.list;

import com.rabbit.bean.HqlBean;
import com.rabbit.dao.IBaseDao;
import com.rabbit.dao.daoImpl.BaseDao;
import com.rabbit.entity.LableEntity;
import com.rabbit.service.IListBean;
import com.rabbit.service.impl.AbstractListBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.lang.reflect.ParameterizedType;
import java.util.List;

/**
 * Created by weina on 2017/3/3.
 */
@Component
@Scope(value = "prototype")
public class BaseList<T> extends AbstractListBean<T> {
    private final IBaseDao<T> iBaseDao;
    @Autowired
    public BaseList(IBaseDao<T> iBaseDao) {
        this.iBaseDao = iBaseDao;

    }
    public static void main(String[] a){
        IListBean<LableEntity> lableEntityIListBean = new BaseList<LableEntity>(new BaseDao<LableEntity>());
        HqlBean hqlBean =  new HqlBean();
        lableEntityIListBean.init(hqlBean,1,2);
        System.out.println(lableEntityIListBean.getList().size());
    }

    @Override
    protected List<T> initList(int page, int lines) {
        String hql = "from "+ gettName().getName()+" where 1=1 " + getObject().getInnerHql() + getObject().getRulesHql();

        return iBaseDao.find(hql,getObject().getInnerParam(),page,lines);
    }

    @Override
    protected long count() {
        String hql = "select count(*) from "+gettName().getName()+" where 1=1 "+ getObject().getInnerHql();
        return iBaseDao.count(hql,getObject().getInnerParam());
    }
}


text:
'use strict';

angular.module('mean.articles', ["highcharts-ng"]);


text:
package workers

import "testing"

func TestCommand(t *testing.T) {
	t.Parallel()
	winners := []parameters{
		[]string{"sleep 0.00000001"},
		[]string{"echo this works"},
		[]string{"cd"},
		[]string{"mv --help"},
	}
	losers := []parameters{
		[]string{"sleep fail"},
		[]string{"cd /steppenwolf"},
		[]string{"mv /glass /bead-game"},
	}
	testInputs(t, command, winners, losers)
}

func TestCommandOutputMatches(t *testing.T) {
	t.Parallel()
	winners := []parameters{
		[]string{"echo siddhartha", "sid"},
		[]string{"cp --help", "cp"},
		[]string{"echo euler", "eu"},
	}
	losers := []parameters{
		[]string{"echo siddhartha", "fail"},
		[]string{"cp --help", "asdfalkjsdhldjfk"},
		[]string{"echo haskell", "curry"},
	}
	testInputs(t, commandOutputMatches, winners, losers)
}

func TestRunning(t *testing.T) {
	t.Parallel()
	//winners := []parameters{[]string{"/sbin/init"}}
	testInputs(t, running, []parameters{}, names)
}

func TestTemp(t *testing.T) {
	t.Parallel()
	winners := []parameters{
		[]string{"1414"}, // melting temp. of silicon
		[]string{"1510"}, // " " " steel
		[]string{"1600"}, // " " " glass
	}
	losers := []parameters{
		[]string{"0"}, // freezing temp. of water
		[]string{"1"},
		[]string{"2"},
	}
	testInputs(t, temp, winners, losers)
}

func TestModule(t *testing.T) {
	t.Parallel()
	// winners := []parameters{ []string{"iptable_nat"}, []string{"ip_tables"}, }
	losers := []parameters{
		[]string{"knecht"},
		[]string{"designori"},
		[]string{"tegularius"},
	}
	testInputs(t, module, []parameters{}, losers)
}

func TestKernelParameter(t *testing.T) {
	winners := []parameters{
		[]string{"net.ipv4.conf.all.accept_local"},
		[]string{"net.ipv4.conf.all.accept_redirects"},
		[]string{"net.ipv4.conf.all.arp_accept"},
	}
	losers := []parameters{
		[]string{"harry haller"},
		[]string{"loering"},
		[]string{"hermine"},
	}
	testInputs(t, kernelParameter, winners, losers)
}

func TestPHPConfig(t *testing.T) {
	t.Parallel()
	losers := []parameters{
		[]string{"vasudeva", "value"},
		[]string{"kamala", "value"},
		[]string{"gotama", "value"},
	}
	testInputs(t, phpConfig, []parameters{}, losers)
}


text:
/* app css stylesheet */

body {
  font-family: 'Open Sans', sans-serif;
}