text:
An LCD sign to go on my door that displays what's currently happening in my calendar, called "Door Sign" because nobody who was sitting around me at the time had a better name.

![Photo](http://newfangled.me/images/door-sign.jpg)

## Hardware

You need:

* [Spark Core](http://spark.io) - £25
* [20x4 LCD](http://www.ebay.co.uk/itm/IIC-I2C-TWI-SP-I-Serial-Interface2004-20X4-Character-LCD-Module-Display-Blue-AR-/191314647477?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item2c8b3dd9b5) (others [here](http://www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2047675.m570.l1313.TR0.TRC0.H0.X20x4+lcd+i2c+serial&_nkw=20x4+lcd+i2c+serial&_sacat=0)) - £7
* [5V Regulator](http://www.ebay.co.uk/itm/L7805CV-Voltage-Regulator-5V-Pack-of-10-/390423690236?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item5ae710bbfc) - £2.39 for 10
* Some breadboard wires

Wire it up like:

![Breadboard](http://i.imgur.com/GKMMska.png)

## Firmware

Make a new project in the Spark online IDE named whatever you want, then copy in the contents of `door-sign.ino`. Click the + button in the tab bar of the IDE, and add a .h and .cpp file for the LiquidCrystal library.

Then flash it to the Spark with the little lightning bolt button.

## Software

Put all the code on a Heroku thing.

Obtain a Google Client ID and Secret:

1. Go to the [Google Developers Console](https://console.developers.google.com/).
2. Select a project, or create a new one.
3. In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Calendar API.
4. In the sidebar on the left, select Credentials.
5. In either case, you end up on the Credentials page and can create your project's credentials from here.
6. If you haven't done so already, create your OAuth 2.0 credentials by clicking Create new Client ID under the OAuth heading. Use the "Installed Application" option, with "Other" as the platform. Next, look for your application's client ID and client secret in the relevant table. You may also create and edit redirect URIs from this page.

__Add your config__:

    heroku config:set CLIENT_ID="abc" CLIENT_SECRET="def" SPARK_ID="mysparkid" SPARK_TOKEN="mysparktoken"

Spark ID is the device ID for your core that can be found in the IDE by clicking the target symbol in the bottom left and then the arrow next to your core. Your Spark token can be found in the settings page of your Spark IDE.

<b>Next, find your calendar IDs</b>

1. Visit [Google Calendar](https://www.google.com/calendar/) in your web browser.
2. In the calendar list on the left, click the down-arrow button next to the appropriate calendar, then select Calendar settings.
3. In the Calendar Address section, locate the Calendar ID listed next to the XML, ICAL and HTML buttons.
4. Copy the Calendar ID.

Edit `bin/door-sign` and add the IDs and each calendar's friendly name.

Next, you need to obtain an access token (refresh token). To do so, run this command and follow the instructions:

    heroku run bundle exec ruby bin/authorize

Then add a scheduler to run the update script:

    heroku addons:add scheduler

Then set it up to run this command every ten minutes:

    bundle exec ruby bin/door-sign

Then stick the sign on your door and be happy.

redpajama_set_name: RedPajamaGithub


text:
<?php
use AspectMock\Test as test;
use Robo\Config;

class PhpspecTest extends \Codeception\TestCase\Test
{
    protected $container;

    /**
     * @var \AspectMock\Proxy\ClassProxy
     */
    protected $phpspec;

    protected function _before()
    {
        $this->phpspec = test::double('Robo\Task\Testing\Phpspec', [
            'executeCommand' => null,
            'getOutput' => new \Symfony\Component\Console\Output\NullOutput()
        ]);
        $this->container = Config::getContainer();
        $this->container->addServiceProvider(\Robo\Task\Testing\loadTasks::getTestingServices());
    }

    // tests
    public function testPhpSpecRun()
    {
        $this->container->get('taskPhpspec', ['phpspec'])->run();
        $this->phpspec->verifyInvoked('executeCommand', ['phpspec run']);
    }

    public function testPHPSpecCommand()
    {
        $task = $this->container->get('taskPhpspec', ['phpspec'])
            ->stopOnFail()
            ->noCodeGeneration()
            ->quiet()
            ->verbose('vv')
            ->noAnsi()
            ->noInteraction()
            ->format('pretty');
        verify($task->getCommand())->equals('phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty');
        $task->run();
        $this->phpspec->verifyInvoked('executeCommand', ['phpspec run --stop-on-failure --no-code-generation --quiet -vv --no-ansi --no-interaction --format pretty']);
    }

}


text:
//
//  swiss_cache_worker.h
//  swiss_cache_server
//
//  Created by Andrew McRobb on 3/4/15.
//  Copyright (c) 2015 Andrew McRobb. All rights reserved.
//

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <unistd.h>
#include <sstream>
#include <utility>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <utility>
#include <algorithm>

#ifndef swiss_cache_server_swiss_cache_worker_h
#define swiss_cache_server_swiss_cache_worker_h

#if defined(_MSC_VER) || defined(__INTEL_COMPILER)  /* FOR WINDOWS PORT */
    typedef unsigned __int64 uint64_t;
	typedef unsigned __int32 uint32_t;
	typedef unsigned __int16 uint16_t;
	typedef unsigned __int8 uint8_t;
	typedef __int32 int32_t;
#elif defined(__GNUC__) || defined(__CYGWIN__) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__PGI) || defined(__LCC__)
#include <stdint.h>
#else
    typedef unsigned long uint64_t;
	typedef unsigned int uint32_t;
	typedef unsigned short int uint16_t;
	typedef unsigned char uint8_t;
	typedef int int32_t;
#endif

namespace swiss_cache {

    const unsigned long CHUNK_SIZE = 5120;

    enum SWISS_FUNCTIONS
    {
        FUNCTION_UNKNOWN = 0,
        FUNCTION_GET,
        FUNCTION_SET,
        FUNCTION_DEL,
        FUNCTION_STRLEN,
        FUNCTION_FLUSH,
        FUNCTION_HEARTBEAT,
        FUNCTION_ISSET
    };

    std::size_t sendAll(uint32_t sock, std::string const &buffer);
    std::string recvAll(uint32_t sock, bool &quit, bool &endData);

    bool        parseLine(std::string const &buffer, SWISS_FUNCTIONS &func, std::vector<std::string> &args);
    bool        findEscapeKey(std::string &buffer, bool sub=true);

}

#endif


text:
import { __decorate, __metadata } from 'tslib';
import { ɵɵdefineInjectable, ɵɵinject, Injectable } from '@angular/core';
import { Angulartics2 } from 'angulartics2';

var Angulartics2Intercom = /** @class */ (function () {
    function Angulartics2Intercom(angulartics2) {
        var _this = this;
        this.angulartics2 = angulartics2;
        this.angulartics2.setUserProperties
            .subscribe(function (x) { return _this.setUserProperties(x); });
        this.angulartics2.setUserPropertiesOnce
            .subscribe(function (x) { return _this.setUserProperties(x); });
    }
    Angulartics2Intercom.prototype.startTracking = function () {
        var _this = this;
        this.angulartics2.pageTrack
            .pipe(this.angulartics2.filterDeveloperMode())
            .subscribe(function (x) { return _this.pageTrack(x.path); });
        this.angulartics2.eventTrack
            .pipe(this.angulartics2.filterDeveloperMode())
            .subscribe(function (x) { return _this.eventTrack(x.action, x.properties); });
    };
    Angulartics2Intercom.prototype.pageTrack = function (path) {
        try {
            this.eventTrack('Pageview', {
                url: path
            });
        }
        catch (e) {
            if (!(e instanceof ReferenceError)) {
                throw e;
            }
        }
    };
    Angulartics2Intercom.prototype.eventTrack = function (action, properties) {
        try {
            Intercom('trackEvent', action, properties);
        }
        catch (e) {
            if (!(e instanceof ReferenceError)) {
                throw e;
            }
        }
    };
    Angulartics2Intercom.prototype.setUserProperties = function (properties) {
        try {
            if (properties.userId && !properties.user_id) {
                properties.user_id = properties.userId;
            }
            Intercom('boot', properties);
        }
        catch (e) {
            if (!(e instanceof ReferenceError)) {
                throw e;
            }
        }
    };
    Angulartics2Intercom.ngInjectableDef = ɵɵdefineInjectable({ factory: function Angulartics2Intercom_Factory() { return new Angulartics2Intercom(ɵɵinject(Angulartics2)); }, token: Angulartics2Intercom, providedIn: "root" });
    Angulartics2Intercom = __decorate([
        Injectable({ providedIn: 'root' }),
        __metadata("design:paramtypes", [Angulartics2])
    ], Angulartics2Intercom);
    return Angulartics2Intercom;
}());

export { Angulartics2Intercom };
//# sourceMappingURL=angulartics2-intercom.js.map


text:
This Go package implements the parts of the FIDO U2F specification required on
the server side of an application.

## Features

- Native Go implementation
- No dependancies other than the Go standard library
- Token attestation certificate verification

## Usage

Please visit http://godoc.org/github.com/tstranex/u2f for the full
documentation.

### How to enrol a new token

```go
app_id := "http://localhost"

// Send registration request to the browser.
c, _ := NewChallenge(app_id, []string{app_id})
req, _ := c.RegisterRequest()

// Read response from the browser.
var resp RegisterResponse
reg, err := Register(resp, c, nil)
if err != nil {
    // Registration failed.
}

// Store registration in the database.
```

### How to perform an authentication

```go
// Fetch registration and counter from the database.
var reg Registration
var counter uint32

// Send authentication request to the browser.
c, _ := NewChallenge(app_id, []string{app_id})
req, _ := c.SignRequest(reg)

// Read response from the browser.
var resp SignResponse
newCounter, err := reg.Authenticate(resp, c, counter)
if err != nil {
    // Authentication failed.
}

// Store updated counter in the database.
```

## Installation

```
$ go get github.com/tstranex/u2f
```

## Example

See u2fdemo/main.go for an full example server. To run it:

```
$ go install github.com/tstranex/u2f/u2fdemo
$ ./bin/u2fdemo
```

Open https://localhost:3483 in Chrome.
Ignore the SSL warning (due to the self-signed certificate for localhost).
You can then test registering and authenticating using your token.

## License

The Go FIDO U2F Library is licensed under the MIT License.


text:
var Demo = function (name, id) {
  this.name = name;
  this.id = id;
};

module.exports.Abort = new Demo('abort', 255);
module.exports.Cover = new Demo('cover ', 0);
module.exports.CoverAndDock = new Demo('cover_and_dock', 1);
module.exports.SpotCover = new Demo('spot_cover', 2);
module.exports.Mouse = new Demo('mouse', 3);
module.exports.FigureEight = new Demo('figure_eight', 4);
module.exports.Wimp = new Demo('wimp', 5);
module.exports.Home = new Demo('home', 6);
module.exports.Tag = new Demo('tag', 7);
module.exports.Pachelbel = new Demo('pachelbel', 8);
module.exports.Banjo = new Demo('banjo', 9);


text:
+++
date = "2015-09-01T19:34:46-04:00"
title = "The d_icd_diagnoses table"
linktitle = "D_ICD_DIAGNOSES"
weight = 16
toc = "true"

+++

**Table source:** Online sources.

**Table purpose:** Definition table for ICD diagnoses.

**Number of rows:** 14,567

**Links to:**

* DIAGNOSES_ICD ON `ICD9_CODE`

# Brief summary

This table defines International Classification of Diseases Version 9 (ICD-9) codes for **diagnoses**. These codes are assigned at the end of the patient's stay and are used by the hospital to bill for care provided.

<!-- # Important considerations -->

# Table columns

Name | Postgres data type
---- | ----
ROW\_ID | INT
ICD9\_CODE | VARCHAR(10)
SHORT\_TITLE | VARCHAR(50)
LONG\_TITLE | VARCHAR(300)

# Detailed Description

## `ICD9_CODE`

`ICD9_CODE` is the International Coding Definitions Version 9 (ICD-9) code. Each code corresponds to a single diagnostic concept.

## `SHORT_TITLE`, `LONG_TITLE`

The title fields provide a brief definition for the given diagnosis code in `ICD9_CODE`.


text:
from django.test import TestCase
from model_mommy import mommy
import mox

from tools.models import Tool
from lending.models import Transaction, LendingAction

class TestLendingAction(TestCase):
    def setUp(self):
        # ToolClassification.object.create
        self.tool = mommy.make(Tool)
        self.transaction = mommy.make(Transaction, tool=self.tool)
        self.action = mommy.make(LendingAction)
        self.mox = mox.Mox()

    def tearDown(self):
        self.mox.UnsetStubs()

    def test_unicode(self):
        self.mox.StubOutWithMock(self.action, 'action_text')
        self.action.action_text().AndReturn('action_text')
        self.mox.StubOutWithMock(self.transaction.tool, '__unicode__')
        self.mox.StubOutWithMock(self.transaction.lendee, '__unicode__')
        self.transaction.tool.__unicode__().AndReturn('tool_unicode')
        self.transaction.lendee.__unicode__().AndReturn('lendee_unicode')
        self.mox.ReplayAll()
        self.assertEqual(
            str(self.action), 'action_text, tool_unicode to lendee_unicode')
        self.mox.VerifyAll()

    def test_lending_choices(self):
        pass

    def test_action_key(self):
        pass

    def test_action_text(self):
        pass

class TestTransaction(TestCase):
    def setUp(self):
        self.model = mommy.make(Transaction)
        self.mox = mox.Mox()

    def tearDown(self):
        self.mox.UnsetStubs()

    def test_unicode(self):
        self.assertEqual(
            str(self.model), 'tool_type, tool_owner to lendee')

    def test_lender_property(self):
        self.assertEqual(self.model.lender, self.tool.owner)

    def test_closed_property(self):
        self.mox.StubOutWithMock(self.model, 'get_closing_action')
        closing_action_return_qs = self.mox.CreateMockAnything()
        self.model.get_closing_action().AndReturn(closing_action_return_qs)
        closing_action_return_qs.exists().AndReturn(True)

        self.mox.ReplayAll()
        self.assertTrue(self.model.closed)
        self.mox.VerifyAll()

    def test_get_closing_action_no_actions(self):
        # Don't create history item models
        closing_action = self.model.get_closing_action()
        pass

    def test_get_closing_action_has_actions(self):
        # Create history item models
        closing_action = self.model.get_closing_action()
        pass


text:
"""Test rules resources."""

__all__ = ['UnsetVariableMatcherRule', 'EMatcherRule']


text:
package org.perfclipse.core.commands;

import org.eclipse.gef.commands.Command;
import org.perfclipse.core.model.GeneratorModel;

/**
 * @author Jakub Knetl
 *
 */
public class EditGeneratorTypeCommand extends Command {
	private String newClazz;
	private String oldClazz;
	private GeneratorModel model;

	public EditGeneratorTypeCommand(GeneratorModel model, String newClazz) {
		super();
		this.newClazz = newClazz;
		this.model = model;
		this.oldClazz = model.getGenerator().getClazz();
	}

	@Override
	public void execute() {
		model.setClazz(newClazz);
	}

	@Override
	public void undo() {
		model.setClazz(oldClazz);
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="labex.feevale.br.oinc" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-feature android:name="android.hardware.camera" />

    <uses-permission android:name="android.permission.CAMERA" />

    <application
        android:name=".ProjectApplication"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <meta-data
            android:name="AA_DB_NAME"
            android:value="Oinc.db" />
        <meta-data
            android:name="AA_DB_VERSION"
            android:value="5" />
        <meta-data
            android:name="AA_MODELS"
            android:value="labex.feevale.br.oinc.model.Entry,                            labex.feevale.br.oinc.model.Goal,                            labex.feevale.br.oinc.model.User,                            labex.feevale.br.oinc.model.Balance" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <provider
            android:name="com.facebook.NativeAppCallContentProvider"
            android:authorities="com.facebook.app.NativeAppCallContentProvider1554550108164243"
            android:exported="true" />

        <activity
            android:name=".MainActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".views.activities.EntryActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name=".views.activities.CameraActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name=".views.activities.PreviewPictureActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name=".views.activities.ShowTripsActivity"
            android:label="@string/title_activity_show_trips" >
        </activity>
        <activity
            android:name=".views.activities.GalleryGoalsActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait" >
        </activity>
        <activity
            android:name=".views.activities.GoalsAndEntryDataActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:screenOrientation="portrait" >
        </activity>
    </application>

</manifest>


text:
package org.apache.spark.streaming.kafka010

import java.{ util => ju }

import org.apache.kafka.clients.consumer.{ ConsumerConfig, ConsumerRecord }
import org.apache.kafka.common.TopicPartition

import org.apache.spark.{Partition, SparkContext, TaskContext}
import org.apache.spark.internal.Logging
import org.apache.spark.internal.config.Network._
import org.apache.spark.partial.{BoundedDouble, PartialResult}
import org.apache.spark.rdd.RDD
import org.apache.spark.scheduler.ExecutorCacheTaskLocation
import org.apache.spark.storage.StorageLevel

/**
 * A batch-oriented interface for consuming from Kafka.
 * Starting and ending offsets are specified in advance,
 * so that you can control exactly-once semantics.
 * @param kafkaParams Kafka
 *
 * configuration parameters. Requires "bootstrap.servers" to be set
 * with Kafka broker(s) specified in host1:port1,host2:port2 form.
 * @param offsetRanges offset ranges that define the Kafka data belonging to this RDD
 * @param preferredHosts map from TopicPartition to preferred host for processing that partition.
 * In most cases, use [[LocationStrategies.PreferConsistent]]
 * Use [[LocationStrategies.PreferBrokers]] if your executors are on same nodes as brokers.
 * @param useConsumerCache whether to use a consumer from a per-jvm cache
 * @tparam K type of Kafka message key
 * @tparam V type of Kafka message value
 */
private[spark] class KafkaRDD[K, V](
    sc: SparkContext,
    val kafkaParams: ju.Map[String, Object],
    val offsetRanges: Array[OffsetRange],
    val preferredHosts: ju.Map[TopicPartition, String],
    useConsumerCache: Boolean
) extends RDD[ConsumerRecord[K, V]](sc, Nil) with Logging with HasOffsetRanges {

  require("none" ==
    kafkaParams.get(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG).asInstanceOf[String],
    ConsumerConfig.AUTO_OFFSET_RESET_CONFIG +
      " must be set to none for executor kafka params, else messages may not match offsetRange")

  require(false ==
    kafkaParams.get(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG).asInstanceOf[Boolean],
    ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG +
      " must be set to false for executor kafka params, else offsets may commit before processing")

  // TODO is it necessary to have separate configs for initial poll time vs ongoing poll time?
  private val pollTimeout = conf.get(CONSUMER_POLL_MS).getOrElse(conf.get(NETWORK_TIMEOUT) * 1000L)
  private val cacheInitialCapacity = conf.get(CONSUMER_CACHE_INITIAL_CAPACITY)
  private val cacheMaxCapacity = conf.get(CONSUMER_CACHE_MAX_CAPACITY)
  private val cacheLoadFactor = conf.get(CONSUMER_CACHE_LOAD_FACTOR).toFloat
  private val compacted = conf.get(ALLOW_NON_CONSECUTIVE_OFFSETS)

  override def persist(newLevel: StorageLevel): this.type = {
    logError("Kafka ConsumerRecord is not serializable. " +
      "Use .map to extract fields before calling .persist or .window")
    super.persist(newLevel)
  }

  override def getPartitions: Array[Partition] = {
    offsetRanges.zipWithIndex.map { case (o, i) =>
        new KafkaRDDPartition(i, o.topic, o.partition, o.fromOffset, o.untilOffset)
    }.toArray
  }

  override def count(): Long =
    if (compacted) {
      super.count()
    } else {
      offsetRanges.map(_.count).sum
    }

  override def countApprox(
      timeout: Long,
      confidence: Double = 0.95
  ): PartialResult[BoundedDouble] =
    if (compacted) {
      super.countApprox(timeout, confidence)
    } else {
      val c = count
      new PartialResult(new BoundedDouble(c, 1.0, c, c), true)
    }

  override def isEmpty(): Boolean =
    if (compacted) {
      super.isEmpty()
    } else {
      count == 0L
    }

  override def take(num: Int): Array[ConsumerRecord[K, V]] =
    if (compacted) {
      super.take(num)
    } else if (num < 1) {
      Array.empty[ConsumerRecord[K, V]]
    } else {
      val nonEmptyPartitions = this.partitions
        .map(_.asInstanceOf[KafkaRDDPartition])
        .filter(_.count > 0)

      if (nonEmptyPartitions.isEmpty) {
        Array.empty[ConsumerRecord[K, V]]
      } else {
        // Determine in advance how many messages need to be taken from each partition
        val parts = nonEmptyPartitions.foldLeft(Map[Int, Int]()) { (result, part) =>
          val remain = num - result.values.sum
          if (remain > 0) {
            val taken = Math.min(remain, part.count)
            result + (part.index -> taken.toInt)
          } else {
            result
          }
        }

        context.runJob(
          this,
          (tc: TaskContext, it: Iterator[ConsumerRecord[K, V]]) =>
          it.take(parts(tc.partitionId)).toArray, parts.keys.toArray
        ).flatten
      }
    }

  private def executors(): Array[ExecutorCacheTaskLocation] = {
    val bm = sparkContext.env.blockManager
    bm.master.getPeers(bm.blockManagerId).toArray
      .map(x => ExecutorCacheTaskLocation(x.host, x.executorId))
      .sortWith(compareExecutors)
  }

  protected[kafka010] def compareExecutors(
      a: ExecutorCacheTaskLocation,
      b: ExecutorCacheTaskLocation): Boolean =
    if (a.host == b.host) {
      a.executorId > b.executorId
    } else {
      a.host > b.host
    }

  override def getPreferredLocations(thePart: Partition): Seq[String] = {
    // The intention is best-effort consistent executor for a given topicpartition,
    // so that caching consumers can be effective.
    // TODO what about hosts specified by ip vs name
    val part = thePart.asInstanceOf[KafkaRDDPartition]
    val allExecs = executors()
    val tp = part.topicPartition
    val prefHost = preferredHosts.get(tp)
    val prefExecs = if (null == prefHost) allExecs else allExecs.filter(_.host == prefHost)
    val execs = if (prefExecs.isEmpty) allExecs else prefExecs
    if (execs.isEmpty) {
      Seq.empty
    } else {
      // execs is sorted, tp.hashCode depends only on topic and partition, so consistent index
      val index = Math.floorMod(tp.hashCode, execs.length)
      val chosen = execs(index)
      Seq(chosen.toString)
    }
  }

  private def errBeginAfterEnd(part: KafkaRDDPartition): String =
    s"Beginning offset ${part.fromOffset} is after the ending offset ${part.untilOffset} " +
      s"for topic ${part.topic} partition ${part.partition}. " +
      "You either provided an invalid fromOffset, or the Kafka topic has been damaged"

  override def compute(thePart: Partition, context: TaskContext): Iterator[ConsumerRecord[K, V]] = {
    val part = thePart.asInstanceOf[KafkaRDDPartition]
    require(part.fromOffset <= part.untilOffset, errBeginAfterEnd(part))
    if (part.fromOffset == part.untilOffset) {
      logInfo(s"Beginning offset ${part.fromOffset} is the same as ending offset " +
        s"skipping ${part.topic} ${part.partition}")
      Iterator.empty
    } else {
      logInfo(s"Computing topic ${part.topic}, partition ${part.partition} " +
        s"offsets ${part.fromOffset} -> ${part.untilOffset}")
      if (compacted) {
        new CompactedKafkaRDDIterator[K, V](
          part,
          context,
          kafkaParams,
          useConsumerCache,
          pollTimeout,
          cacheInitialCapacity,
          cacheMaxCapacity,
          cacheLoadFactor
        )
      } else {
        new KafkaRDDIterator[K, V](
          part,
          context,
          kafkaParams,
          useConsumerCache,
          pollTimeout,
          cacheInitialCapacity,
          cacheMaxCapacity,
          cacheLoadFactor
        )
      }
    }
  }
}

/**
 * An iterator that fetches messages directly from Kafka for the offsets in partition.
 * Uses a cached consumer where possible to take advantage of prefetching
 */
private class KafkaRDDIterator[K, V](
  part: KafkaRDDPartition,
  context: TaskContext,
  kafkaParams: ju.Map[String, Object],
  useConsumerCache: Boolean,
  pollTimeout: Long,
  cacheInitialCapacity: Int,
  cacheMaxCapacity: Int,
  cacheLoadFactor: Float
) extends Iterator[ConsumerRecord[K, V]] {

  context.addTaskCompletionListener[Unit](_ => closeIfNeeded())

  val consumer = {
    KafkaDataConsumer.init(cacheInitialCapacity, cacheMaxCapacity, cacheLoadFactor)
    KafkaDataConsumer.acquire[K, V](part.topicPartition(), kafkaParams, context, useConsumerCache)
  }

  var requestOffset = part.fromOffset

  def closeIfNeeded(): Unit = {
    if (consumer != null) {
      consumer.release()
    }
  }

  override def hasNext: Boolean = requestOffset < part.untilOffset

  override def next(): ConsumerRecord[K, V] = {
    if (!hasNext) {
      throw new ju.NoSuchElementException("Can't call getNext() once untilOffset has been reached")
    }
    val r = consumer.get(requestOffset, pollTimeout)
    requestOffset += 1
    r
  }
}

/**
 * An iterator that fetches messages directly from Kafka for the offsets in partition.
 * Uses a cached consumer where possible to take advantage of prefetching.
 * Intended for compacted topics, or other cases when non-consecutive offsets are ok.
 */
private class CompactedKafkaRDDIterator[K, V](
    part: KafkaRDDPartition,
    context: TaskContext,
    kafkaParams: ju.Map[String, Object],
    useConsumerCache: Boolean,
    pollTimeout: Long,
    cacheInitialCapacity: Int,
    cacheMaxCapacity: Int,
    cacheLoadFactor: Float
  ) extends KafkaRDDIterator[K, V](
    part,
    context,
    kafkaParams,
    useConsumerCache,
    pollTimeout,
    cacheInitialCapacity,
    cacheMaxCapacity,
    cacheLoadFactor
  ) {

  consumer.compactedStart(part.fromOffset, pollTimeout)

  private var nextRecord = consumer.compactedNext(pollTimeout)

  private var okNext: Boolean = true

  override def hasNext: Boolean = okNext

  override def next(): ConsumerRecord[K, V] = {
    if (!hasNext) {
      throw new ju.NoSuchElementException("Can't call getNext() once untilOffset has been reached")
    }
    val r = nextRecord
    if (r.offset + 1 >= part.untilOffset) {
      okNext = false
    } else {
      nextRecord = consumer.compactedNext(pollTimeout)
      if (nextRecord.offset >= part.untilOffset) {
        okNext = false
        consumer.compactedPrevious()
      }
    }
    r
  }
}


text:
from unlocode.models import LocChangeIndicator, LocChangeTag

def addLocChangeIndicator(changecode, description):
    locchangeindicator = LocChangeIndicator.objects.get_or_create(changecode=changecode,
                                                                  description=description)[0]
    locchangeindicator.save()
    return locchangeindicator

def addLocChangeTag(changetag, description):
    locchangetag = LocChangeTag.objects.get_or_create(changetag=changetag,
                                                       description=description)[0]
    locchangetag.save()
    return locchangetag

def populateInitial():
    # Populate initial unlocode data into the database that is not related to version.

    # LocChangeIndicator
    addLocChangeIndicator("+", "added entry")
    addLocChangeIndicator("#", "Change in the location name")
    addLocChangeIndicator("X", "entry  to be removed in the next issue")
    addLocChangeIndicator("|", "entry has been changed")
    addLocChangeIndicator("=", "reference entry")
    addLocChangeIndicator("!", "US locations with duplicate IATA code, under review")

    # LocChangeTag
    addLocChangeTag("@Coo", "Change affecting or adding Coordinates (change indicator \'|\')")
    addLocChangeTag("@Fun", "Change affecting the Function (change indicator \'|\')")
    addLocChangeTag("@Sta", "Change of status (change indicator \'|\')")
    addLocChangeTag("@Sub", "Addition or change of subdivision code (change indicator \'|\')")
    addLocChangeTag("@Nam", "Change in the location name (change indicator \'#\')")
    addLocChangeTag("@Spe", "Correction of spelling of name (change indicator \'#\')")

    return "Data imported"


text:
<?php

/**
* 抢票页
*/
class Action_Index extends Action_Base
{

	function __construct($resource)
	{
		parent::__construct($resource);
	}

	public function run()
	{

	}
}

?>


text:
const CJX_MethodSpec CJX_Form::MethodSpecs[] = {
    {"execCalculate", execCalculate_static},
    {"execInitialize", execInitialize_static},
    {"execValidate", execValidate_static},
    {"formNodes", formNodes_static},
    {"recalculate", recalculate_static},
    {"remerge", remerge_static}};

CJX_Form::CJX_Form(CXFA_Form* form) : CJX_Model(form) {
  DefineMethods(MethodSpecs);
}

CJX_Form::~CJX_Form() {}

bool CJX_Form::DynamicTypeIs(TypeTag eType) const {
  return eType == static_type__ || ParentType__::DynamicTypeIs(eType);
}

CJS_Result CJX_Form::formNodes(
    CFX_V8* runtime,
    const std::vector<v8::Local<v8::Value>>& params) {
  if (params.size() != 1)
    return CJS_Result::Failure(JSMessage::kParamError);

  CXFA_Node* pDataNode =
      ToNode(static_cast<CFXJSE_Engine*>(runtime)->ToXFAObject(params[0]));
  if (!pDataNode)
    return CJS_Result::Failure(JSMessage::kValueError);

  CXFA_ArrayNodeList* pFormNodes = new CXFA_ArrayNodeList(GetDocument());
  CFXJSE_Value* value =
      GetDocument()->GetScriptContext()->GetOrCreateJSBindingFromMap(
          pFormNodes);

  return CJS_Result::Success(
      value->DirectGetValue().Get(runtime->GetIsolate()));
}

CJS_Result CJX_Form::remerge(CFX_V8* runtime,
                             const std::vector<v8::Local<v8::Value>>& params) {
  if (!params.empty())
    return CJS_Result::Failure(JSMessage::kParamError);

  GetDocument()->DoDataRemerge(true);
  return CJS_Result::Success();
}

CJS_Result CJX_Form::execInitialize(
    CFX_V8* runtime,
    const std::vector<v8::Local<v8::Value>>& params) {
  if (!params.empty())
    return CJS_Result::Failure(JSMessage::kParamError);

  CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
  if (pNotify)
    pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Initialize, false,
                                  true);
  return CJS_Result::Success();
}

CJS_Result CJX_Form::recalculate(
    CFX_V8* runtime,
    const std::vector<v8::Local<v8::Value>>& params) {
  CXFA_EventParam* pEventParam =
      GetDocument()->GetScriptContext()->GetEventParam();
  if (pEventParam && (pEventParam->m_eType == XFA_EVENT_Calculate ||
                      pEventParam->m_eType == XFA_EVENT_InitCalculate)) {
    return CJS_Result::Success();
  }
  if (params.size() != 1)
    return CJS_Result::Failure(JSMessage::kParamError);

  CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
  if (!pNotify || runtime->ToInt32(params[0]) != 0)
    return CJS_Result::Success();

  pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false, true);
  pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Validate, false, true);
  pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Ready, true, true);
  return CJS_Result::Success();
}

CJS_Result CJX_Form::execCalculate(
    CFX_V8* runtime,
    const std::vector<v8::Local<v8::Value>>& params) {
  if (!params.empty())
    return CJS_Result::Failure(JSMessage::kParamError);

  CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
  if (pNotify)
    pNotify->ExecEventByDeepFirst(GetXFANode(), XFA_EVENT_Calculate, false,
                                  true);
  return CJS_Result::Success();
}

CJS_Result CJX_Form::execValidate(
    CFX_V8* runtime,
    const std::vector<v8::Local<v8::Value>>& params) {
  if (params.size() != 0)
    return CJS_Result::Failure(JSMessage::kParamError);

  CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
  if (!pNotify)
    return CJS_Result::Success(runtime->NewBoolean(false));

  XFA_EventError iRet = pNotify->ExecEventByDeepFirst(
      GetXFANode(), XFA_EVENT_Validate, false, true);
  return CJS_Result::Success(
      runtime->NewBoolean(iRet != XFA_EventError::kError));
}

void CJX_Form::checksumS(CFXJSE_Value* pValue,
                         bool bSetting,
                         XFA_Attribute eAttribute) {
  if (bSetting) {
    SetAttribute(XFA_Attribute::Checksum, pValue->ToWideString().AsStringView(),
                 false);
    return;
  }

  Optional<WideString> checksum = TryAttribute(XFA_Attribute::Checksum, false);
  pValue->SetString(checksum ? checksum->ToUTF8().AsStringView() : "");
}


text:
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit297c18b577058f4031cf8059e53092b3::getLoader();


text:
<!DOCTYPE html>

		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>JQuery Validation Engine</title>
		<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
		<link rel="stylesheet" href="../css/template.css" type="text/css"/>
		<link rel="stylesheet" href="http://labs.abeautifulsite.net/jquery-selectBox/jquery.selectBox.css" type="text/css" />

			Back to index

			This demonstration shows the validation with the jQuery SelectBox plugin

		<form id="formID" class="formular" method="post" action="">
			<fieldset>
				<legend>
					Select single
				</legend>

					<select name="country" id="country" class="validate[required]">
						<option value="">- Please Select -</option>
						<option value="United States">United States</option>
						<option value="United Kingdom">United Kingdom</option>
						<option value="Afghanistan">Afghanistan</option>
						<option value="Albania">Albania</option>
						<option value="Algeria">Algeria</option>
						<option value="American Samoa">American Samoa</option>
						<option value="Andorra">Andorra</option>
						<option value="Angola">Angola</option>
						<option value="Anguilla">Anguilla</option>
						<option value="Antarctica">Antarctica</option>
						<option value="Antigua and Barbuda">Antigua and Barbuda</option>
						<option value="Argentina">Argentina</option>
						<option value="Armenia">Armenia</option>
						<option value="Aruba">Aruba</option>
						<option value="Australia">Australia</option>
						<option value="Austria">Austria</option>
						<option value="Azerbaijan">Azerbaijan</option>
						<option value="Bahamas">Bahamas</option>
						<option value="Bahrain">Bahrain</option>
						<option value="Bangladesh">Bangladesh</option>
						<option value="Barbados">Barbados</option>
						<option value="Belarus">Belarus</option>
						<option value="Belgium">Belgium</option>
						<option value="Belize">Belize</option>
						<option value="Benin">Benin</option>
						<option value="Bermuda">Bermuda</option>
						<option value="Bhutan">Bhutan</option>
						<option value="Bolivia">Bolivia</option>
						<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
						<option value="Botswana">Botswana</option>
						<option value="Bouvet Island">Bouvet Island</option>
						<option value="Brazil">Brazil</option>
						<option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
						<option value="Brunei Darussalam">Brunei Darussalam</option>
						<option value="Bulgaria">Bulgaria</option>
						<option value="Burkina Faso">Burkina Faso</option>
						<option value="Burundi">Burundi</option>
						<option value="Cambodia">Cambodia</option>
						<option value="Cameroon">Cameroon</option>
						<option value="Canada">Canada</option>
						<option value="Cape Verde">Cape Verde</option>
						<option value="Cayman Islands">Cayman Islands</option>
						<option value="Central African Republic">Central African Republic</option>
						<option value="Chad">Chad</option>
						<option value="Chile">Chile</option>
						<option value="China">China</option>
						<option value="Christmas Island">Christmas Island</option>
						<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
						<option value="Colombia">Colombia</option>
						<option value="Comoros">Comoros</option>
						<option value="Congo">Congo</option>
						<option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
						<option value="Cook Islands">Cook Islands</option>
						<option value="Costa Rica">Costa Rica</option>
						<option value="Cote D'ivoire">Cote D'ivoire</option>
						<option value="Croatia">Croatia</option>
						<option value="Cuba">Cuba</option>
						<option value="Cyprus">Cyprus</option>
						<option value="Czech Republic">Czech Republic</option>
						<option value="Denmark">Denmark</option>
						<option value="Djibouti">Djibouti</option>
						<option value="Dominica">Dominica</option>
						<option value="Dominican Republic">Dominican Republic</option>
						<option value="Ecuador">Ecuador</option>
						<option value="Egypt">Egypt</option>
						<option value="El Salvador">El Salvador</option>
						<option value="Equatorial Guinea">Equatorial Guinea</option>
						<option value="Eritrea">Eritrea</option>
						<option value="Estonia">Estonia</option>
						<option value="Ethiopia">Ethiopia</option>
						<option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
						<option value="Faroe Islands">Faroe Islands</option>
						<option value="Fiji">Fiji</option>
						<option value="Finland">Finland</option>
						<option value="France">France</option>
						<option value="French Guiana">French Guiana</option>
						<option value="French Polynesia">French Polynesia</option>
						<option value="French Southern Territories">French Southern Territories</option>
						<option value="Gabon">Gabon</option>
						<option value="Gambia">Gambia</option>
						<option value="Georgia">Georgia</option>
						<option value="Germany">Germany</option>
						<option value="Ghana">Ghana</option>
						<option value="Gibraltar">Gibraltar</option>
						<option value="Greece">Greece</option>
						<option value="Greenland">Greenland</option>
						<option value="Grenada">Grenada</option>
						<option value="Guadeloupe">Guadeloupe</option>
						<option value="Guam">Guam</option>
						<option value="Guatemala">Guatemala</option>
						<option value="Guinea">Guinea</option>
						<option value="Guinea-bissau">Guinea-bissau</option>
						<option value="Guyana">Guyana</option>
						<option value="Haiti">Haiti</option>
						<option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
						<option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
						<option value="Honduras">Honduras</option>
						<option value="Hong Kong">Hong Kong</option>
						<option value="Hungary">Hungary</option>
						<option value="Iceland">Iceland</option>
						<option value="India">India</option>
						<option value="Indonesia">Indonesia</option>
						<option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
						<option value="Iraq">Iraq</option>
						<option value="Ireland">Ireland</option>
						<option value="Israel">Israel</option>
						<option value="Italy">Italy</option>
						<option value="Jamaica">Jamaica</option>
						<option value="Japan">Japan</option>
						<option value="Jordan">Jordan</option>
						<option value="Kazakhstan">Kazakhstan</option>
						<option value="Kenya">Kenya</option>
						<option value="Kiribati">Kiribati</option>
						<option value="Korea, Democratic People's Republic of">Korea, Democratic People's Republic of</option>
						<option value="Korea, Republic of">Korea, Republic of</option>
						<option value="Kuwait">Kuwait</option>
						<option value="Kyrgyzstan">Kyrgyzstan</option>
						<option value="Lao People's Democratic Republic">Lao People's Democratic Republic</option>
						<option value="Latvia">Latvia</option>
						<option value="Lebanon">Lebanon</option>
						<option value="Lesotho">Lesotho</option>
						<option value="Liberia">Liberia</option>
						<option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</option>
						<option value="Liechtenstein">Liechtenstein</option>
						<option value="Lithuania">Lithuania</option>
						<option value="Luxembourg">Luxembourg</option>
						<option value="Macao">Macao</option>
						<option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
						<option value="Madagascar">Madagascar</option>
						<option value="Malawi">Malawi</option>
						<option value="Malaysia">Malaysia</option>
						<option value="Maldives">Maldives</option>
						<option value="Mali">Mali</option>
						<option value="Malta">Malta</option>
						<option value="Marshall Islands">Marshall Islands</option>
						<option value="Martinique">Martinique</option>
						<option value="Mauritania">Mauritania</option>
						<option value="Mauritius">Mauritius</option>
						<option value="Mayotte">Mayotte</option>
						<option value="Mexico">Mexico</option>
						<option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
						<option value="Moldova, Republic of">Moldova, Republic of</option>
						<option value="Monaco">Monaco</option>
						<option value="Mongolia">Mongolia</option>
						<option value="Montenegro">Montenegro</option>
						<option value="Montserrat">Montserrat</option>
						<option value="Morocco">Morocco</option>
						<option value="Mozambique">Mozambique</option>
						<option value="Myanmar">Myanmar</option>
						<option value="Namibia">Namibia</option>
						<option value="Nauru">Nauru</option>
						<option value="Nepal">Nepal</option>
						<option value="Netherlands">Netherlands</option>
						<option value="Netherlands Antilles">Netherlands Antilles</option>
						<option value="New Caledonia">New Caledonia</option>
						<option value="New Zealand">New Zealand</option>
						<option value="Nicaragua">Nicaragua</option>
						<option value="Niger">Niger</option>
						<option value="Nigeria">Nigeria</option>
						<option value="Niue">Niue</option>
						<option value="Norfolk Island">Norfolk Island</option>
						<option value="Northern Mariana Islands">Northern Mariana Islands</option>
						<option value="Norway">Norway</option>
						<option value="Oman">Oman</option>
						<option value="Pakistan">Pakistan</option>
						<option value="Palau">Palau</option>
						<option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
						<option value="Panama">Panama</option>
						<option value="Papua New Guinea">Papua New Guinea</option>
						<option value="Paraguay">Paraguay</option>
						<option value="Peru">Peru</option>
						<option value="Philippines">Philippines</option>
						<option value="Pitcairn">Pitcairn</option>
						<option value="Poland">Poland</option>
						<option value="Portugal">Portugal</option>
						<option value="Puerto Rico">Puerto Rico</option>
						<option value="Qatar">Qatar</option>
						<option value="Reunion">Reunion</option>
						<option value="Romania">Romania</option>
						<option value="Russian Federation">Russian Federation</option>
						<option value="Rwanda">Rwanda</option>
						<option value="Saint Helena">Saint Helena</option>
						<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
						<option value="Saint Lucia">Saint Lucia</option>
						<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
						<option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
						<option value="Samoa">Samoa</option>
						<option value="San Marino">San Marino</option>
						<option value="Sao Tome and Principe">Sao Tome and Principe</option>
						<option value="Saudi Arabia">Saudi Arabia</option>
						<option value="Senegal">Senegal</option>
						<option value="Serbia">Serbia</option>
						<option value="Seychelles">Seychelles</option>
						<option value="Sierra Leone">Sierra Leone</option>
						<option value="Singapore">Singapore</option>
						<option value="Slovakia">Slovakia</option>
						<option value="Slovenia">Slovenia</option>
						<option value="Solomon Islands">Solomon Islands</option>
						<option value="Somalia">Somalia</option>
						<option value="South Africa">South Africa</option>
						<option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
						<option value="South Sudan">South Sudan</option>
						<option value="Spain">Spain</option>
						<option value="Sri Lanka">Sri Lanka</option>
						<option value="Sudan">Sudan</option>
						<option value="Suriname">Suriname</option>
						<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
						<option value="Swaziland">Swaziland</option>
						<option value="Sweden">Sweden</option>
						<option value="Switzerland">Switzerland</option>
						<option value="Syrian Arab Republic">Syrian Arab Republic</option>
						<option value="Taiwan, Republic of China">Taiwan, Republic of China</option>
						<option value="Tajikistan">Tajikistan</option>
						<option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
						<option value="Thailand">Thailand</option>
						<option value="Timor-leste">Timor-leste</option>
						<option value="Togo">Togo</option>
						<option value="Tokelau">Tokelau</option>
						<option value="Tonga">Tonga</option>
						<option value="Trinidad and Tobago">Trinidad and Tobago</option>
						<option value="Tunisia">Tunisia</option>
						<option value="Turkey">Turkey</option>
						<option value="Turkmenistan">Turkmenistan</option>
						<option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
						<option value="Tuvalu">Tuvalu</option>
						<option value="Uganda">Uganda</option>
						<option value="Ukraine">Ukraine</option>
						<option value="United Arab Emirates">United Arab Emirates</option>
						<option value="United Kingdom">United Kingdom</option>
						<option value="United States">United States</option>
						<option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
						<option value="Uruguay">Uruguay</option>
						<option value="Uzbekistan">Uzbekistan</option>
						<option value="Vanuatu">Vanuatu</option>
						<option value="Venezuela">Venezuela</option>
						<option value="Viet Nam">Viet Nam</option>
						<option value="Virgin Islands, British">Virgin Islands, British</option>
						<option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
						<option value="Wallis and Futuna">Wallis and Futuna</option>
						<option value="Western Sahara">Western Sahara</option>
						<option value="Yemen">Yemen</option>
						<option value="Zambia">Zambia</option>
						<option value="Zimbabwe">Zimbabwe</option>
					</select>
			</fieldset>

			<fieldset>
				<legend>
					Hidden Form Sections
				</legend>

					<select name="hidden_samples" id="hidden_samples" class="validate[required]">
						<option value="">- Please Select -</option>
						<option value="1">Show Option 1</option>
						<option value="2">Show Option 2</option>
					</select>

							This is the hidden option for "Show Option 1"
							<select name="hidden_samples" id="hidden_samples_1" class="validate[required]">
								<option value="">- Please Select -</option>
								<option value="1">Show Option 1</option>
								<option value="2">Show Option 2</option>
							</select>

							This is the hidden option for "Show Option 2"
							<select name="hidden_samples" id="hidden_samples_2" class="validate[required]">
								<option value="">- Please Select -</option>
								<option value="1">Show Option 1</option>
								<option value="2">Show Option 2</option>
							</select>

			</fieldset>

			<input class="submit" type="submit" value="Validate & Send the form!"/>

		</form>


text:
phone-highlight
===============

iPhone like text highlight plugin for jQuery

## Live demo

http://jsfiddle.net/2XLBr/

## Installation

Include script *after* the jQuery library (unless you are packaging scripts somehow else):

    <script src="/path/to/jquery.phonehighlight.js"></script>

You should also include the default stylesheet

    <link href="/path/to/style.css" rel="stylesheet" type="text/css" media="screen" />

**Do not include the script directly from GitHub (http://raw.github.com/...).** The file is being served as text/plain and as such being blocked
in Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN.

## Usage

Default use case

    <script>
      jQuery('selector').phoneHighlight();
    </script>

Pre selected words (will pre-select the words between the 2nd and the 3rd words)

    <script>
      jQuery('selector').phoneHighlight({
        highlighted: [1,2]
      });
    </script>

Callback

    <script>
      jQuery('selector').phoneHighlight({
        onchange: function(text){
          console.log(text);
        }
      });
    </script>

## Compatibility

Tested with the latest versions of **Opera**, **Firefox** and **Chrome**. It most likely won't work with IE, but who knows

## Disclaimer

This is my first jQuery plugin so be easy on me. Also props for Manon Dave to help him make his parents proud.


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2012-2013 Facebook, 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.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.facebook.nifty</groupId>
        <artifactId>nifty-parent</artifactId>
        <version>0.12.0-SNAPSHOT</version>
    </parent>

    <name>Nifty Core</name>
    <artifactId>nifty-core</artifactId>
    <packaging>jar</packaging>

    <properties>
        <fb.main.basedir>${project.parent.basedir}</fb.main.basedir>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</artifactId>
        </dependency>

        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.thrift</groupId>
            <artifactId>libthrift</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
package domain_intl

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// QueryRegistrantProfileRealNameVerificationInfo invokes the domain_intl.QueryRegistrantProfileRealNameVerificationInfo API synchronously
// api document: https://help.aliyun.com/api/domain-intl/queryregistrantprofilerealnameverificationinfo.html
func (client *Client) QueryRegistrantProfileRealNameVerificationInfo(request *QueryRegistrantProfileRealNameVerificationInfoRequest) (response *QueryRegistrantProfileRealNameVerificationInfoResponse, err error) {
	response = CreateQueryRegistrantProfileRealNameVerificationInfoResponse()
	err = client.DoAction(request, response)
	return
}

// QueryRegistrantProfileRealNameVerificationInfoWithChan invokes the domain_intl.QueryRegistrantProfileRealNameVerificationInfo API asynchronously
// api document: https://help.aliyun.com/api/domain-intl/queryregistrantprofilerealnameverificationinfo.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) QueryRegistrantProfileRealNameVerificationInfoWithChan(request *QueryRegistrantProfileRealNameVerificationInfoRequest) (<-chan *QueryRegistrantProfileRealNameVerificationInfoResponse, <-chan error) {
	responseChan := make(chan *QueryRegistrantProfileRealNameVerificationInfoResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.QueryRegistrantProfileRealNameVerificationInfo(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// QueryRegistrantProfileRealNameVerificationInfoWithCallback invokes the domain_intl.QueryRegistrantProfileRealNameVerificationInfo API asynchronously
// api document: https://help.aliyun.com/api/domain-intl/queryregistrantprofilerealnameverificationinfo.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) QueryRegistrantProfileRealNameVerificationInfoWithCallback(request *QueryRegistrantProfileRealNameVerificationInfoRequest, callback func(response *QueryRegistrantProfileRealNameVerificationInfoResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *QueryRegistrantProfileRealNameVerificationInfoResponse
		var err error
		defer close(result)
		response, err = client.QueryRegistrantProfileRealNameVerificationInfo(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// QueryRegistrantProfileRealNameVerificationInfoRequest is the request struct for api QueryRegistrantProfileRealNameVerificationInfo
type QueryRegistrantProfileRealNameVerificationInfoRequest struct {
	*requests.RpcRequest
	FetchImage          requests.Boolean `position:"Query" name:"FetchImage"`
	UserClientIp        string           `position:"Query" name:"UserClientIp"`
	RegistrantProfileId requests.Integer `position:"Query" name:"RegistrantProfileId"`
	Lang                string           `position:"Query" name:"Lang"`
}

// QueryRegistrantProfileRealNameVerificationInfoResponse is the response struct for api QueryRegistrantProfileRealNameVerificationInfo
type QueryRegistrantProfileRealNameVerificationInfoResponse struct {
	*responses.BaseResponse
	RequestId              string `json:"RequestId" xml:"RequestId"`
	SubmissionDate         string `json:"SubmissionDate" xml:"SubmissionDate"`
	ModificationDate       string `json:"ModificationDate" xml:"ModificationDate"`
	IdentityCredential     string `json:"IdentityCredential" xml:"IdentityCredential"`
	RegistrantProfileId    int    `json:"RegistrantProfileId" xml:"RegistrantProfileId"`
	IdentityCredentialNo   string `json:"IdentityCredentialNo" xml:"IdentityCredentialNo"`
	IdentityCredentialType string `json:"IdentityCredentialType" xml:"IdentityCredentialType"`
	IdentityCredentialUrl  string `json:"IdentityCredentialUrl" xml:"IdentityCredentialUrl"`
}

// CreateQueryRegistrantProfileRealNameVerificationInfoRequest creates a request to invoke QueryRegistrantProfileRealNameVerificationInfo API
func CreateQueryRegistrantProfileRealNameVerificationInfoRequest() (request *QueryRegistrantProfileRealNameVerificationInfoRequest) {
	request = &QueryRegistrantProfileRealNameVerificationInfoRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("Domain-intl", "2017-12-18", "QueryRegistrantProfileRealNameVerificationInfo", "domain", "openAPI")
	return
}

// CreateQueryRegistrantProfileRealNameVerificationInfoResponse creates a response to parse from QueryRegistrantProfileRealNameVerificationInfo response
func CreateQueryRegistrantProfileRealNameVerificationInfoResponse() (response *QueryRegistrantProfileRealNameVerificationInfoResponse) {
	response = &QueryRegistrantProfileRealNameVerificationInfoResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
package com.continuum.nova.utils;

import com.continuum.nova.NovaNative;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.MobEffects;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

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

public class RenderCommandBuilder {
    private static final Logger LOG = LogManager.getLogger(RenderCommandBuilder.class);

    public static NovaNative.mc_set_gui_screen_command createSetGuiScreenCommand(GuiScreen curScreen) {
        NovaNative.mc_set_gui_screen_command set_gui_screen_command = new NovaNative.mc_set_gui_screen_command();
        int cur_button = 0;

        for (GuiButton button : curScreen.getButtonList()) {
            NovaNative.mc_gui_button new_button = new NovaNative.mc_gui_button();
            new_button.x_position = button.xPosition;
            new_button.y_position = button.yPosition;
            new_button.width = button.getButtonWidth();
            new_button.height = button.getButtonHeight();
            new_button.text = button.displayString;
            new_button.enabled = button.enabled ? 1 : 0;
            set_gui_screen_command.screen.buttons[cur_button] = new_button;
            cur_button++;
        }

        set_gui_screen_command.screen.num_buttons = cur_button;
        return set_gui_screen_command;
    }

    private static NovaNative.mc_chunk makeChunk(World world, BlockPos chunkCoordinates) {
        NovaNative.mc_chunk chunk = new NovaNative.mc_chunk();
        NovaNative.mc_block[] blocks = new NovaNative.mc_block[16 * 16 * 16];
        return chunk;
    }

    private static List<NovaNative.mc_chunk> getAllChunks(World world, int renderChunkDistance) {
        List<NovaNative.mc_chunk> renderableChunks = new ArrayList<>();
        int chunkCountX = renderChunkDistance;
        int chunkCountY = 16;
        int chunkCountZ = renderChunkDistance;

        for (int x = 0; x < chunkCountX; x++) {
            for (int y = 0; y < chunkCountY; y++) {
                for (int z = 0; z < chunkCountZ; z++) {
                    BlockPos pos = new BlockPos(x * 16, y * 16, z * 16);
                    renderableChunks.add(makeChunk(world, pos));
                }
            }
        }

        return renderableChunks;
    }
}


text:
namespace PiWars
{

SensorRTIMU::SensorRTIMU()
  : Sensor()
  , _initialised(false)
  , _pitch(0)
  , _roll(0)
  , _yaw(0)
  , _rtimuReader(nullptr)
  , _rtimuReaderQuit(false)
{
}

SensorRTIMU::~SensorRTIMU() {
}

bool SensorRTIMU::exists() {
  // Always return true for now, as the RTIMU library supports various
  // sensors
  return true;
}

bool SensorRTIMU::enable() {
  if(!isEnabled()) {
    // Create a thread to poll the range sensor, so there is always a valid
    // range ready to be read.
    _rtimuReaderQuit = false;
    _rtimuReader = new std::thread(rtimuReader, std::ref(_rtimuReaderQuit), std::ref(_pitch), std::ref(_roll), std::ref(_yaw));

    // Call the base class to perform any
    // generic changes
    Sensor::enable();
  }

  return isEnabled();

}

void SensorRTIMU::disable() {
  if(isEnabled()) {
    // Tell the thread to exit
    _rtimuReaderQuit = true;

    // and wait for it to do so
    _rtimuReader->join();
    _rtimuReader = nullptr;

    Sensor::disable();
  }
}
void SensorRTIMU::fusion(float &pitch, float &roll, float &yaw) {
  pitch = _pitch;
  roll = _roll;
  yaw = _yaw;
}

void SensorRTIMU::rtimuReader(std::atomic<bool> &quit, std::atomic<float> &pitch, std::atomic<float> &roll, std::atomic<float> &yaw)
{
  // read in the main settings and create the RTIMU class
  RTIMUSettings *settings = new RTIMUSettings("/etc", "RTIMULib");
  RTIMU *imu = RTIMU::createIMU(settings);

  if ((imu == NULL) || (imu->IMUType() == RTIMU_TYPE_NULL)) {
    std::cerr << __func__ << ": IMU not found!" << std::endl;

    // Exit out early
    return;
  }

  imu->IMUInit();

  // Use the recommended values
  imu->setSlerpPower(0.02);
  imu->setGyroEnable(true);
  imu->setAccelEnable(true);
  imu->setCompassEnable(true);

  while(!quit.load()) {

    std::this_thread::sleep_for (std::chrono::milliseconds(imu->IMUGetPollInterval()));

    if(imu->IMURead()) {
      RTIMU_DATA imuData = imu->getIMUData();

      if(imuData.fusionPoseValid) {
        pitch = imuData.fusionPose.x()* RTMATH_RAD_TO_DEGREE;
        roll = imuData.fusionPose.y()* RTMATH_RAD_TO_DEGREE;
        yaw = imuData.fusionPose.z() * RTMATH_RAD_TO_DEGREE;
      }
    }
  }

  delete imu;
  delete settings;
}

void SensorRTIMU::init() {
  // Nothing to be done for now
}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.google.protobuf.GeneratedMessageTest" time="0.179" tests="80" errors="0" skipped="0" failures="0">
  <properties>
    <property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
    <property name="sun.boot.library.path" value="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64"/>
    <property name="java.vm.version" value="24.75-b04"/>
    <property name="java.vm.vendor" value="Oracle Corporation"/>
    <property name="java.vendor.url" value="http://java.oracle.com/"/>
    <property name="path.separator" value=":"/>
    <property name="guice.disable.misplaced.annotation.check" value="true"/>
    <property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
    <property name="file.encoding.pkg" value="sun.io"/>
    <property name="user.country" value="US"/>
    <property name="sun.java.launcher" value="SUN_STANDARD"/>
    <property name="sun.os.patch.level" value="unknown"/>
    <property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
    <property name="user.dir" value="/home/ubuntu/GRPCAPI/grpc-java/protobuf/protobuf-3.0.0-alpha-2/java"/>
    <property name="java.runtime.version" value="1.7.0_75-b13"/>
    <property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
    <property name="java.endorsed.dirs" value="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed"/>
    <property name="os.arch" value="amd64"/>
    <property name="java.io.tmpdir" value="/tmp"/>
    <property name="line.separator" value="
"/>
    <property name="java.vm.specification.vendor" value="Oracle Corporation"/>
    <property name="os.name" value="Linux"/>
    <property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
    <property name="sun.jnu.encoding" value="UTF-8"/>
    <property name="java.library.path" value="/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
    <property name="java.specification.name" value="Java Platform API Specification"/>
    <property name="java.class.version" value="51.0"/>
    <property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
    <property name="os.version" value="3.13.0-44-generic"/>
    <property name="user.home" value="/home/ubuntu"/>
    <property name="user.timezone" value="Etc/UTC"/>
    <property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
    <property name="file.encoding" value="UTF-8"/>
    <property name="java.specification.version" value="1.7"/>
    <property name="user.name" value="ubuntu"/>
    <property name="java.class.path" value="/usr/share/maven/boot/plexus-classworlds-2.x.jar"/>
    <property name="java.vm.specification.version" value="1.7"/>
    <property name="sun.arch.data.model" value="64"/>
    <property name="java.home" value="/usr/lib/jvm/java-7-openjdk-amd64/jre"/>
    <property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher install"/>
    <property name="java.specification.vendor" value="Oracle Corporation"/>
    <property name="user.language" value="en"/>
    <property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
    <property name="java.vm.info" value="mixed mode"/>
    <property name="java.version" value="1.7.0_75"/>
    <property name="java.ext.dirs" value="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext"/>
    <property name="securerandom.source" value="file:/dev/./urandom"/>
    <property name="sun.boot.class.path" value="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/classes"/>
    <property name="java.vendor" value="Oracle Corporation"/>
    <property name="maven.home" value="/usr/share/maven"/>
    <property name="file.separator" value="/"/>
    <property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
    <property name="sun.cpu.endian" value="little"/>
    <property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
    <property name="sun.cpu.isalist" value=""/>
  </properties>
  <testcase name="testSerialize" classname="com.google.protobuf.GeneratedMessageTest" time="0.039"/>
  <testcase name="testDefaultInstance" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testMessageOrBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testUsingBuilderMultipleTimes" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testProtosShareRepeatedArraysIfDidntChange" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testRepeatedArraysAreImmutable" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testParsedMessagesAreImmutable" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testRepeatedSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testRepeatedSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testRepeatedAppend" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testRepeatedAppendRejectsNull" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testRepeatedAppendIterateOnlyOnce" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testMergeFromOtherRejectsNull" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testSettingForeignMessageUsingBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testSettingRepeatedForeignMessageUsingBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testDefaults" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testReflectionGetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testReflectionSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testReflectionSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testReflectionRepeatedSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testReflectionRepeatedSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testReflectionDefaults" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testReflectionGetOneof" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testReflectionClearOneof" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testEnumInterface" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testEnumMap" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testParsePackedToUnpacked" classname="com.google.protobuf.GeneratedMessageTest" time="0.007"/>
  <testcase name="testParseUnpackedToPacked" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testExtensionMessageOrBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testExtensionRepeatedSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testExtensionDefaults" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testExtensionReflectionGetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testExtensionReflectionSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testExtensionReflectionSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testExtensionReflectionRepeatedSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testExtensionReflectionRepeatedSettersRejectNull" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testExtensionReflectionDefaults" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testClearExtension" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testExtensionCopy" classname="com.google.protobuf.GeneratedMessageTest" time="0.005"/>
  <testcase name="testExtensionMergeFrom" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testLiteExtensionMessageOrBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.007"/>
  <testcase name="testLiteExtensionRepeatedSetters" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testLiteExtensionDefaults" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testClearLiteExtension" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testLiteExtensionCopy" classname="com.google.protobuf.GeneratedMessageTest" time="0.006"/>
  <testcase name="testLiteExtensionMergeFrom" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testEnumValueOptionsInMultipleFilesMode" classname="com.google.protobuf.GeneratedMessageTest" time="0.017"/>
  <testcase name="testMultipleFilesOption" classname="com.google.protobuf.GeneratedMessageTest" time="0.011"/>
  <testcase name="testOptionalFieldWithRequiredSubfieldsOptimizedForSize" classname="com.google.protobuf.GeneratedMessageTest" time="0.005"/>
  <testcase name="testUninitializedExtensionInOptimizedForSize" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testToBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testFieldConstantValues" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testExtensionConstantValues" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testRecursiveMessageDefaultInstance" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testSerializePartial" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testEnumValues" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testNonNestedExtensionInitialization" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testNestedExtensionInitialization" classname="com.google.protobuf.GeneratedMessageTest" time="0.004"/>
  <testcase name="testNonNestedExtensionLiteInitialization" classname="com.google.protobuf.GeneratedMessageTest" time="0.003"/>
  <testcase name="testNestedExtensionLiteInitialization" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testInvalidations" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testInvalidations_Extensions" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testBaseMessageOrBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testMessageOrBuilderGetters" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testGetFieldBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testGetFieldBuilderWithInitializedValue" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testGetFieldBuilderNotSupportedException" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testConflictingOuterClassName" classname="com.google.protobuf.GeneratedMessageTest" time="0.005"/>
  <testcase name="testOneofEnumCase" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testClearOneof" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testSetOneofClearsOthers" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testOneofTypes" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testOneofMerge" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testOneofSerialization" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testOneofNestedBuilderOnChangePropagation" classname="com.google.protobuf.GeneratedMessageTest" time="0.002"/>
  <testcase name="testClear" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testGetRepeatedFieldBuilder" classname="com.google.protobuf.GeneratedMessageTest" time="0.001"/>
  <testcase name="testGetRepeatedFieldBuilderWithInitializedValue" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
  <testcase name="testGetRepeatedFieldBuilderNotSupportedException" classname="com.google.protobuf.GeneratedMessageTest" time="0"/>
</testsuite>


text:
const Enzyme = require('enzyme');
const EnzymeAdapter = require('enzyme-adapter-react-16');

Enzyme.configure({ adapter: new EnzymeAdapter() });


text:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CreateToolPreview : MonoBehaviour
{
  [SerializeField] Material previewMaterial;
  GameObject resultRenderable;
  AssetSearch assetSearch;

  Material materialCopy;

  void Awake()
  {
    Util.FindIfNotSet(this, ref assetSearch);
    materialCopy = Instantiate(previewMaterial);
  }

  public GameObject GetResultRenderable()
  {
    return resultRenderable;
  }

  public void SetRenderableByReference(
    RenderableReference renderableReference,
    Quaternion addlRotation,
    Vector3 renderableOffset,
    Quaternion renderableRotation,
    PreferredScaleFunction scaleFunction,
    System.Func<bool> isStillValid)
  {
    if (resultRenderable != null)
    {
      Destroy(resultRenderable);
    }

    assetSearch.RequestRenderable(renderableReference,
      renderableObj =>
      {
        if (renderableObj == null) return; // Just to be safe..
        // Can be called async - so we could be gone already.
        if (this == null || this.gameObject == null) return;

        if (isStillValid())
        {
          renderableObj.transform.SetParent(transform);
          renderableObj.transform.rotation = renderableRotation * addlRotation;
          renderableObj.transform.localPosition = renderableOffset;
          renderableObj.transform.localScale = scaleFunction(renderableObj);
          MakeLookLikeGhost(renderableObj);

          if (resultRenderable != null) Destroy(resultRenderable);
          resultRenderable = renderableObj;
          renderableObj.SetActive(true);
        }
        else
        {
          Destroy(renderableObj);
          Debug.Log("renderable callback out of date");
        }
      });
  }

  public void SetTint(Color color)
  {
    materialCopy.SetColor("_MainTint", ArtUtil.GetHologramColor(color));
  }

  void MakeLookLikeGhost(GameObject newModelObject)
  {
    foreach (MeshRenderer _render in newModelObject.GetComponentsInChildren<MeshRenderer>(true))
    {
      _render.material = materialCopy;
    }

    foreach (SkinnedMeshRenderer _render in newModelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true))
    {
      _render.material = materialCopy;
    }

    foreach (Collider col in newModelObject.GetComponentsInChildren<Collider>(true))
    {
      GameObject.Destroy(col);
    }

    foreach (ParticleSystem ps in newModelObject.GetComponentsInChildren<ParticleSystem>(true))
    {
      GameObject.Destroy(ps);
    }
  }
}


text:
<wicket:panel>

</wicket:panel>


text:
.tag-cloud {
    font-size: 100%;
    width: 100%;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 2em;
    word-spacing: normal;
    letter-spacing: normal;
    text-transform: none;
    text-align: center;
    text-indent: 0
}

.tag-cloud a:link {
    text-decoration: none
}

.tag-cloud a:visited {
    text-decoration: none
}

.tag-cloud a:hover {
    text-decoration: underline;
}

.tag-cloud a:active {
    text-decoration: underline;
}

.tag-cloud-word {
    padding: 0;
    position: relative
}

.tag-cloud-word a {
    text-decoration: none
}


text:
layout: default
id: 2016-08-23-Loria-Enrica
surname: Loria
name: Enrica
university: University of Trento
date: 23/08/2016
aboutme:
from: Italy
research_topic: Gamification for Smart Cities and Communities
abstract:
advisor: Marconi Annapaola
keywords:
website:
img: loria.jpg
email: eloria<i class="fa fa-at" aria-hidden="true"></i>fbk.eu
alt: Enrica Loria
modal-id: stud88
---


text:
/***********************************************************

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

******************************************************************/

#ifndef DIX_ACCESS_H
#define DIX_ACCESS_H

/* These are the access modes that can be passed in the last parameter
 * to several of the dix lookup functions.  They were originally part
 * of the Security extension, now used by XACE.
 *
 * You can or these values together to indicate multiple modes
 * simultaneously.
 */

#define DixUnknownAccess	0       /* don't know intentions */
#define DixReadAccess		(1<<0)  /* inspecting the object */
#define DixWriteAccess		(1<<1)  /* changing the object */
#define DixDestroyAccess	(1<<2)  /* destroying the object */
#define DixCreateAccess		(1<<3)  /* creating the object */
#define DixGetAttrAccess	(1<<4)  /* get object attributes */
#define DixSetAttrAccess	(1<<5)  /* set object attributes */
#define DixListPropAccess	(1<<6)  /* list properties of object */
#define DixGetPropAccess	(1<<7)  /* get properties of object */
#define DixSetPropAccess	(1<<8)  /* set properties of object */
#define DixGetFocusAccess	(1<<9)  /* get focus of object */
#define DixSetFocusAccess	(1<<10) /* set focus of object */
#define DixListAccess		(1<<11) /* list objects */
#define DixAddAccess		(1<<12) /* add object */
#define DixRemoveAccess		(1<<13) /* remove object */
#define DixHideAccess		(1<<14) /* hide object */
#define DixShowAccess		(1<<15) /* show object */
#define DixBlendAccess		(1<<16) /* mix contents of objects */
#define DixGrabAccess		(1<<17) /* exclusive access to object */
#define DixFreezeAccess		(1<<18) /* freeze status of object */
#define DixForceAccess		(1<<19) /* force status of object */
#define DixInstallAccess	(1<<20) /* install object */
#define DixUninstallAccess	(1<<21) /* uninstall object */
#define DixSendAccess		(1<<22) /* send to object */
#define DixReceiveAccess	(1<<23) /* receive from object */
#define DixUseAccess		(1<<24) /* use object */
#define DixManageAccess		(1<<25) /* manage object */
#define DixDebugAccess		(1<<26) /* debug object */
#define DixBellAccess		(1<<27) /* audible sound */
#define DixPostAccess		(1<<28) /* post or follow-up call */

#endif                          /* DIX_ACCESS_H */


text:
/*
	This module exopes a function that will convert all
	Windows path separators into Unix path separators.
	Returns a path with a trailing Unix separator.
*/

"use strict";

var path = require("path");

function toUnixPath(p) {
	if (p) {
		return path.normalize(p).replace(/\\/g, "/");
	}

	return p;
}

module.exports = toUnixPath;


text:
package org.apache.olingo.client.api.communication.request.cud;

import org.apache.olingo.client.api.communication.request.ODataBasicRequest;
import org.apache.olingo.client.api.communication.request.ODataBatchableRequest;
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.api.domain.ClientEntity;

/**
 * This class implements an OData update request.
 *
 * @param <E> concrete ODataEntity implementation
 */
public interface ODataEntityUpdateRequest<E extends ClientEntity>
    extends ODataBasicRequest<ODataEntityUpdateResponse<E>>, ODataBatchableRequest {
//No additional methods needed for now.
}


text:
DGR2_NP_BEGIN
struct DGR2_API Appender : public DGRObject
{
    virtual bool publish(const Log& log) = 0;
    virtual void setFilter(Filter* filter) = 0;
    virtual Filter* getFilter() = 0;
    virtual void setFormatter(Formatter* formatter) = 0;
    virtual Formatter* getFormatter() = 0;
    virtual void destroy();
protected:
    virtual ~Appender() {}
};
NP_END
#endif


text:
/*
 * 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.
 */
package com.facebook.presto.execution;

import com.facebook.presto.metadata.MetadataManager;
import com.facebook.presto.sql.tree.Expression;
import com.facebook.presto.sql.tree.FunctionCall;
import com.facebook.presto.sql.tree.QualifiedName;
import com.facebook.presto.sql.tree.SetSession;
import com.facebook.presto.sql.tree.StringLiteral;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;

import java.net.URI;
import java.util.Map;
import java.util.concurrent.ExecutorService;

import static com.facebook.presto.SessionTestUtils.TEST_SESSION;
import static com.facebook.presto.spi.session.SessionPropertyMetadata.stringSessionProperty;
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static java.util.concurrent.Executors.newCachedThreadPool;
import static org.testng.Assert.assertEquals;

public class TestSetSessionTask
{
    private final MetadataManager metadata = MetadataManager.createTestMetadataManager();

    public TestSetSessionTask()
    {
        metadata.getSessionPropertyManager().addSystemSessionProperty(stringSessionProperty(
                "foo",
                "test property",
                null,
                false));
        metadata.getSessionPropertyManager().addConnectorSessionProperties("foo", ImmutableList.of(stringSessionProperty(
                "bar",
                "test property",
                null,
                false)));
    }

    private final ExecutorService executor = newCachedThreadPool(daemonThreadsNamed("stage-executor-%s"));

    @AfterClass(alwaysRun = true)
    public void tearDown()
            throws Exception
    {
        executor.shutdownNow();
    }

    @Test
    public void testSetSession()
            throws Exception
    {
        testSetSession(new StringLiteral("baz"), "baz");
        testSetSession(new FunctionCall(new QualifiedName("concat"), ImmutableList.of(
                new StringLiteral("ban"),
                new StringLiteral("ana"))), "banana");
    }

    private void testSetSession(Expression expression, String expectedValue)
            throws Exception
    {
        QueryStateMachine stateMachine = new QueryStateMachine(new QueryId("query"), "set foo.bar = 'baz'", TEST_SESSION, URI.create("fake://uri"), executor);
        new SetSessionTask().execute(new SetSession(QualifiedName.of("foo", "bar"), expression), TEST_SESSION, metadata, stateMachine);

        Map<String, String> sessionProperties = stateMachine.getSetSessionProperties();
        assertEquals(sessionProperties, ImmutableMap.of("foo.bar", expectedValue));
    }
}


text:
import os
import logging

import pits

import twisted.trial.unittest as unittest

class PITSTest(unittest.TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        self.treader.cleanup()

    def _doTest(self, transport_name, test_case_file):
        self.treader = pits.TestReader(self.assertTrue, test_case_file)
        return self.treader.do_test(
            ('%s' % transport_name,
             'client',
             '127.0.0.1:%d' % pits.CLIENT_OBFSPORT,
             '--dest=127.0.0.1:%d' % pits.SERVER_OBFSPORT),
            ('%s' % transport_name,
             'server',
             '127.0.0.1:%d' % pits.SERVER_OBFSPORT,
             '--dest=127.0.0.1:%d' % self.treader.pits.get_pits_inbound_address().port))

    # XXX This is pretty ridiculous. Find a smarter way to make up for the
    # absense of load_tests().
    def test_dummy_1(self):
        return self._doTest("dummy", "../test_case.pits")

    def test_dummy_2(self):
        return self._doTest("dummy", "../test_case_simple.pits")

    def test_obfs2_1(self):
        return self._doTest("obfs2", "../test_case.pits")

    def test_obfs2_2(self):
        return self._doTest("obfs2", "../test_case_simple.pits")

    def test_obfs3_1(self):
        return self._doTest("obfs3", "../test_case.pits")

    def test_obfs3_2(self):
        return self._doTest("obfs3", "../test_case_simple.pits")

if __name__ == '__main__':
    from unittest import main
    main()