text:
package com.google.spanner.v1;

public final class TransactionProto {
  private TransactionProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_spanner_v1_TransactionOptions_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_spanner_v1_TransactionOptions_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_spanner_v1_TransactionOptions_ReadWrite_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_spanner_v1_TransactionOptions_ReadWrite_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_spanner_v1_TransactionOptions_ReadOnly_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_spanner_v1_Transaction_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_spanner_v1_Transaction_fieldAccessorTable;
  static final com.google.protobuf.Descriptors.Descriptor
    internal_static_google_spanner_v1_TransactionSelector_descriptor;
  static final
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_google_spanner_v1_TransactionSelector_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n#google/spanner/v1/transaction.proto\022\021g" +
      "oogle.spanner.v1\032\034google/api/annotations" +
      ".proto\032\036google/protobuf/duration.proto\032\037" +
      "google/protobuf/timestamp.proto\"\340\003\n\022Tran" +
      "sactionOptions\022E\n\nread_write\030\001 \001(\0132/.goo" +
      "gle.spanner.v1.TransactionOptions.ReadWr" +
      "iteH\000\022C\n\tread_only\030\002 \001(\0132..google.spanne" +
      "r.v1.TransactionOptions.ReadOnlyH\000\032\013\n\tRe" +
      "adWrite\032\250\002\n\010ReadOnly\022\020\n\006strong\030\001 \001(\010H\000\0228" +
      "\n\022min_read_timestamp\030\002 \001(\0132\032.google.prot" +
      "obuf.TimestampH\000\0222\n\rmax_staleness\030\003 \001(\0132" +
      "\031.google.protobuf.DurationH\000\0224\n\016read_tim" +
      "estamp\030\004 \001(\0132\032.google.protobuf.Timestamp" +
      "H\000\0224\n\017exact_staleness\030\005 \001(\0132\031.google.pro" +
      "tobuf.DurationH\000\022\035\n\025return_read_timestam" +
      "p\030\006 \001(\010B\021\n\017timestamp_boundB\006\n\004mode\"M\n\013Tr" +
      "ansaction\022\n\n\002id\030\001 \001(\014\0222\n\016read_timestamp\030" +
      "\002 \001(\0132\032.google.protobuf.Timestamp\"\244\001\n\023Tr" +
      "ansactionSelector\022;\n\nsingle_use\030\001 \001(\0132%." +
      "google.spanner.v1.TransactionOptionsH\000\022\014" +
      "\n\002id\030\002 \001(\014H\000\0226\n\005begin\030\003 \001(\0132%.google.spa" +
      "nner.v1.TransactionOptionsH\000B\n\n\010selector" +
      "B\231\001\n\025com.google.spanner.v1B\020TransactionP" +
      "rotoP\001Z8google.golang.org/genproto/googl" +
      "eapis/spanner/v1;spanner\252\002\027Google.Cloud." +
      "Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1b\006pr" +
      "oto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          com.google.api.AnnotationsProto.getDescriptor(),
          com.google.protobuf.DurationProto.getDescriptor(),
          com.google.protobuf.TimestampProto.getDescriptor(),
        }, assigner);
    internal_static_google_spanner_v1_TransactionOptions_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_google_spanner_v1_TransactionOptions_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_spanner_v1_TransactionOptions_descriptor,
        new java.lang.String[] { "ReadWrite", "ReadOnly", "Mode", });
    internal_static_google_spanner_v1_TransactionOptions_ReadWrite_descriptor =
      internal_static_google_spanner_v1_TransactionOptions_descriptor.getNestedTypes().get(0);
    internal_static_google_spanner_v1_TransactionOptions_ReadWrite_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_spanner_v1_TransactionOptions_ReadWrite_descriptor,
        new java.lang.String[] { });
    internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor =
      internal_static_google_spanner_v1_TransactionOptions_descriptor.getNestedTypes().get(1);
    internal_static_google_spanner_v1_TransactionOptions_ReadOnly_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor,
        new java.lang.String[] { "Strong", "MinReadTimestamp", "MaxStaleness", "ReadTimestamp", "ExactStaleness", "ReturnReadTimestamp", "TimestampBound", });
    internal_static_google_spanner_v1_Transaction_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_google_spanner_v1_Transaction_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_spanner_v1_Transaction_descriptor,
        new java.lang.String[] { "Id", "ReadTimestamp", });
    internal_static_google_spanner_v1_TransactionSelector_descriptor =
      getDescriptor().getMessageTypes().get(2);
    internal_static_google_spanner_v1_TransactionSelector_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_google_spanner_v1_TransactionSelector_descriptor,
        new java.lang.String[] { "SingleUse", "Id", "Begin", "Selector", });
    com.google.api.AnnotationsProto.getDescriptor();
    com.google.protobuf.DurationProto.getDescriptor();
    com.google.protobuf.TimestampProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
<resources>
    <string name="app_name">Test</string>
    <string name="title_activity_main">NightBits HttpClient QuickTest</string>

    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
</resources>

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('activitystream', '0003_auto_20161030_0723'),
    ]

    operations = [
        migrations.AlterField(
            model_name='activity',
            name='content_type',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType'),
        ),
    ]


text:
package eu.qualimaster.monitoring.volumePrediction;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.TreeMap;

/**
 * Class containing static methods to write/read volume data.
 *
 * @author Andrea Ceroni
 */
public class DataUtils {
    /**
     * Reads volume data from a file. The usage of a TreeMap ensures the removal
     * of duplicate entries as well as the sorting of the values by date.
     *
     * @param f the file containing volume data.
     * @return A TreeMap representing the data: keys are timestamps, values are
     *         volumes.
     */
    public static TreeMap<String, Long> readData(File f) {
        TreeMap<String, Long> data = new TreeMap<String, Long>();
        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new FileReader(f));
            String line = null;
            while ((line = reader.readLine()) != null
                    && line.compareTo("") != 0) {
                String[] fields = line.split(",");
                String date = fields[0];
                String time = fields[1];
                if (time.split(":").length == 2) {
                    time = time + ":00";
                }
                long dataValue = Long.valueOf(fields[fields.length - 1].trim());
                if (dataValue > Integer.MAX_VALUE) {
                    continue;
                    // dataValue = Integer.MAX_VALUE / 2000;
                }
                String[] dateFields = date.split("/");
                String year = dateFields[2];
                String month = dateFields[0];
                String day = dateFields[1];

                // avoid the lines with volume = 1 (containing the summary for
                // the given day)
                if (dataValue == 1)
                    continue;

                // use an hashmap to avoid more than one value for the same date
                // and time, also in case they are not adjacent
                data.put(year + "-" + month + "-" + day + "T" + time, dataValue);
            }
            reader.close();

            return data;
        } catch (Exception e) {
            e.printStackTrace();
            return data;
        }
    }

    public static HashMap<String, ArrayList<Integer>> readStreamingData(
            String folder, HashSet<String> terms) {
        HashMap<String, ArrayList<Integer>> data = new HashMap<>();
        File dir = new File(folder);

        for (String term : terms) {
            File currFile = null;
            for (File f : dir.listFiles()) {
                if (f.getName().contains(term)) {
                    currFile = f;
                    break;
                }
            }

            if (currFile == null) {
                System.out.println("No streaming data available for term: "
                        + term);
                continue;
            }

            ArrayList<Integer> dataForTerm = readSingleColumnData(currFile);
            data.put(term, dataForTerm);
        }

        return data;
    }

    public static ArrayList<Integer> readSingleColumnData(File f) {
        ArrayList<Integer> data = new ArrayList<>();
        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new FileReader(f));
            String line = null;
            while ((line = reader.readLine()) != null) {
                int value = Integer.valueOf(line);
                data.add(value);
            }
            reader.close();

            return data;
        } catch (IOException e) {
            e.printStackTrace();
            return data;
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
  xmlns:flowable="http://flowable.org/bpmn"
  typeLanguage="http://www.w3.org/2001/XMLSchema"
  expressionLanguage="http://www.w3.org/1999/XPath"
  targetNamespace="http://www.flowable.org/processdef">

  <process id="holidayRequest" name="Holiday Request" isExecutable="true">

    <startEvent id="startEvent"/>
    <sequenceFlow sourceRef="startEvent" targetRef="approveTask"/>

    <userTask id="approveTask" name="Approve or reject request"/>
    <sequenceFlow sourceRef="approveTask" targetRef="decision"/>

    <exclusiveGateway id="decision"/>
    <sequenceFlow sourceRef="decision" targetRef="externalSystemCall">
      <conditionExpression xsi:type="tFormalExpression">
        <![CDATA[
          ${approved}
        ]]>
      </conditionExpression>
    </sequenceFlow>
    <sequenceFlow  sourceRef="decision" targetRef="sendRejectionMail">
      <conditionExpression xsi:type="tFormalExpression">
        <![CDATA[
          ${!approved}
        ]]>
      </conditionExpression>
    </sequenceFlow>

    <serviceTask id="externalSystemCall" name="Enter holidays in external system"
        flowable:class="org.flowable.CallExternalSystemDelegate"/>
    <sequenceFlow sourceRef="externalSystemCall" targetRef="holidayApprovedTask"/>

    <userTask id="holidayApprovedTask" name="Holiday approved"/>
    <sequenceFlow sourceRef="holidayApprovedTask" targetRef="approveEnd"/>

    <serviceTask id="sendRejectionMail" name="Send out rejection email"
        flowable:class="org.flowable.SendRejectionMail"/>
    <sequenceFlow sourceRef="sendRejectionMail" targetRef="rejectEnd"/>

    <endEvent id="approveEnd"/>

    <endEvent id="rejectEnd"/>

  </process>

</definitions>


text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v12/errors/feed_item_target_error.proto

namespace Google\Ads\GoogleAds\V12\Errors\FeedItemTargetErrorEnum;

use UnexpectedValueException;

/**
 * Enum describing possible feed item target errors.
 *
 * Protobuf type google.ads.googleads.v12.errors.FeedItemTargetErrorEnum.FeedItemTargetError
 */
class FeedItemTargetError
{
    /**
     * Enum unspecified.
     *
     * Generated from protobuf enum UNSPECIFIED = 0;
     */
    const UNSPECIFIED = 0;
    /**
     * The received error code is not known in this version.
     *
     * Generated from protobuf enum UNKNOWN = 1;
     */
    const UNKNOWN = 1;
    /**
     * On CREATE, the FeedItemTarget must have a populated field in the oneof
     * target.
     *
     * Generated from protobuf enum MUST_SET_TARGET_ONEOF_ON_CREATE = 2;
     */
    const MUST_SET_TARGET_ONEOF_ON_CREATE = 2;
    /**
     * The specified feed item target already exists, so it cannot be added.
     *
     * Generated from protobuf enum FEED_ITEM_TARGET_ALREADY_EXISTS = 3;
     */
    const FEED_ITEM_TARGET_ALREADY_EXISTS = 3;
    /**
     * The schedules for a given feed item cannot overlap.
     *
     * Generated from protobuf enum FEED_ITEM_SCHEDULES_CANNOT_OVERLAP = 4;
     */
    const FEED_ITEM_SCHEDULES_CANNOT_OVERLAP = 4;
    /**
     * Too many targets of a given type were added for a single feed item.
     *
     * Generated from protobuf enum TARGET_LIMIT_EXCEEDED_FOR_GIVEN_TYPE = 5;
     */
    const TARGET_LIMIT_EXCEEDED_FOR_GIVEN_TYPE = 5;
    /**
     * Too many AdSchedules are enabled for the feed item for the given day.
     *
     * Generated from protobuf enum TOO_MANY_SCHEDULES_PER_DAY = 6;
     */
    const TOO_MANY_SCHEDULES_PER_DAY = 6;
    /**
     * A feed item may either have an enabled campaign target or an enabled ad
     * group target.
     *
     * Generated from protobuf enum CANNOT_HAVE_ENABLED_CAMPAIGN_AND_ENABLED_AD_GROUP_TARGETS = 7;
     */
    const CANNOT_HAVE_ENABLED_CAMPAIGN_AND_ENABLED_AD_GROUP_TARGETS = 7;
    /**
     * Duplicate ad schedules aren't allowed.
     *
     * Generated from protobuf enum DUPLICATE_AD_SCHEDULE = 8;
     */
    const DUPLICATE_AD_SCHEDULE = 8;
    /**
     * Duplicate keywords aren't allowed.
     *
     * Generated from protobuf enum DUPLICATE_KEYWORD = 9;
     */
    const DUPLICATE_KEYWORD = 9;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::MUST_SET_TARGET_ONEOF_ON_CREATE => 'MUST_SET_TARGET_ONEOF_ON_CREATE',
        self::FEED_ITEM_TARGET_ALREADY_EXISTS => 'FEED_ITEM_TARGET_ALREADY_EXISTS',
        self::FEED_ITEM_SCHEDULES_CANNOT_OVERLAP => 'FEED_ITEM_SCHEDULES_CANNOT_OVERLAP',
        self::TARGET_LIMIT_EXCEEDED_FOR_GIVEN_TYPE => 'TARGET_LIMIT_EXCEEDED_FOR_GIVEN_TYPE',
        self::TOO_MANY_SCHEDULES_PER_DAY => 'TOO_MANY_SCHEDULES_PER_DAY',
        self::CANNOT_HAVE_ENABLED_CAMPAIGN_AND_ENABLED_AD_GROUP_TARGETS => 'CANNOT_HAVE_ENABLED_CAMPAIGN_AND_ENABLED_AD_GROUP_TARGETS',
        self::DUPLICATE_AD_SCHEDULE => 'DUPLICATE_AD_SCHEDULE',
        self::DUPLICATE_KEYWORD => 'DUPLICATE_KEYWORD',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }

    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(FeedItemTargetError::class, \Google\Ads\GoogleAds\V12\Errors\FeedItemTargetErrorEnum_FeedItemTargetError::class);


text:
/*
 * This file provides only very simple stubs to build IDF-based FreeRTOSes which use spinlocks on Linux.
 */
#pragma once

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#define SPINLOCK_FREE          0xB33FFFFF
#define SPINLOCK_WAIT_FOREVER  (-1)
#define SPINLOCK_NO_WAIT        0
#define SPINLOCK_INITIALIZER   {.owner = SPINLOCK_FREE,.count = 0}
#define CORE_ID_REGVAL_XOR_SWAP (0xCDCD ^ 0xABAB)

/**
 * @brief Spinlock object
 * Owner:
 *  - Set to 0 if uninitialized
 *  - Set to portMUX_FREE_VAL when free
 *  - Set to CORE_ID_REGVAL_PRO or CORE_ID_REGVAL_AP when locked
 *  - Any other value indicates corruption
 * Count:
 *  - 0 if unlocked
 *  - Recursive count if locked
 *
 * @note Not a true spinlock as single core RISC-V does not have atomic compare and set instruction
 * @note Keep portMUX_INITIALIZER_UNLOCKED in sync with this struct
 */
typedef struct {
    uint32_t owner;
    uint32_t count;
}spinlock_t;

static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t *lock)
{
}

static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *lock, int32_t timeout)
{
    return true;
}

static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *lock)
{
}

#ifdef __cplusplus
}
#endif


text:
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * 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.validator.cfg.defs;

import javax.validation.constraints.PastOrPresent;

import org.hibernate.validator.cfg.ConstraintDef;

/**
 * @author Marko Bekhta
 */
public class PastOrPresentDef extends ConstraintDef<PastOrPresentDef, PastOrPresent> {

	public PastOrPresentDef() {
		super( PastOrPresent.class );
	}
}


text:
using Citrus.Interactions.Internal;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Citrus.Interactions
{
    /// <summary>
    /// ContinuationManager is used to detect if the most recent activation was due
    /// to a continuation such as the FileOpenPicker or WebAuthenticationBroker
    /// </summary>
    public class ContinuationManager
    {
        private static readonly ContinuationManager current = new ContinuationManager();
        public static ContinuationManager Current
        {
            get { return current; }
        }

        private ContinuationManager() { }

        IContinuationActivatedEventArgs args = null;
        bool handled = false;
        Guid id = Guid.Empty;

        /// <summary>
        /// Sets the ContinuationArgs for this instance. Using default Frame of current Window
        /// Should be called by the main activation handling code in App.xaml.cs
        /// </summary>
        /// <param name="args">The activation args</param>
        public void Continue(IContinuationActivatedEventArgs args)
        {
            Continue(args, Window.Current.Content as Frame);
        }

        /// <summary>
        /// Sets the ContinuationArgs for this instance. Should be called by the main activation
        /// handling code in App.xaml.cs
        /// </summary>
        /// <param name="args">The activation args</param>
        /// <param name="rootFrame">The frame control that contains the current page</param>
        public void Continue(IContinuationActivatedEventArgs args, Frame rootFrame)
        {
            if (args == null)
                throw new ArgumentNullException("args");

            if (this.args != null && !handled)
                throw new InvalidOperationException("Can't set args more than once");

            this.args = args;
            this.handled = false;
            this.id = Guid.NewGuid();

            if (rootFrame == null)
                return;

            switch (args.Kind)
            {
                case ActivationKind.PickFileContinuation:
                    ContinuationFileOpenPicker(
                        rootFrame.Content as Page,
                        args as FileOpenPickerContinuationEventArgs);
                    break;

                case ActivationKind.PickSaveFileContinuation:
                    break;

                case ActivationKind.PickFolderContinuation:
                    break;

                case ActivationKind.WebAuthenticationBrokerContinuation:
                    break;
            }
        }

        private static void ContinuationFileOpenPicker(Page page, FileOpenPickerContinuationEventArgs e)
        {
            if (page == null) return;
            if (e == null) return;

            var operation = (string)e.ContinuationData["Operation"];

            var pickPhotoAction = page
                .FindAction<PickPhotoAction>(x => x.OperationName == operation);

            if (pickPhotoAction == null || pickPhotoAction.CallbackCommand == null) return;

            var photo = e.Files.SingleOrDefault();

            if (pickPhotoAction.CallbackCommand.CanExecute(photo))
            {
                pickPhotoAction.CallbackCommand.Execute(photo);
            }
        }

        /// <summary>
        /// Marks the contination data as 'stale', meaning that it is probably no longer of
        /// any use. Called when the app is suspended (to ensure future activations don't appear
        /// to be for the same continuation) and whenever the continuation data is retrieved
        /// (so that it isn't retrieved on subsequent navigations)
        /// </summary>
        public void MarkAsStale()
        {
            this.handled = true;
        }

        /// <summary>
        /// Retrieves the continuation args, if they have not already been retrieved, and
        /// prevents further retrieval via this property (to avoid accidentla double-usage)
        /// </summary>
        public IContinuationActivatedEventArgs ContinuationArgs
        {
            get
            {
                if (handled)
                    return null;
                MarkAsStale();
                return args;
            }
        }

        /// <summary>
        /// Unique identifier for this particular continuation. Most useful for components that
        /// retrieve the continuation data via <see cref="GetContinuationArgs"/> and need
        /// to perform their own replay check
        /// </summary>
        public Guid Id { get { return id; } }

        /// <summary>
        /// Retrieves the continuation args, optionally retrieving them even if they have already
        /// been retrieved
        /// </summary>
        /// <param name="includeStaleArgs">Set to true to return args even if they have previously been returned</param>
        /// <returns>The continuation args, or null if there aren't any</returns>
        public IContinuationActivatedEventArgs GetContinuationArgs(bool includeStaleArgs)
        {
            if (!includeStaleArgs && handled)
                return null;
            MarkAsStale();
            return args;
        }
    }
}


text:
package org.apache.jackrabbit.oak.benchmark;

import java.util.Random;
import java.util.concurrent.TimeUnit;

import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;

import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.jackrabbit.oak.spi.security.ConfigurationParameters;
import org.apache.jackrabbit.oak.spi.security.authentication.token.TokenConfiguration;
import org.apache.jackrabbit.oak.spi.security.authentication.token.TokenProvider;
import org.apache.jackrabbit.oak.spi.security.principal.PrincipalImpl;
import org.apache.jackrabbit.util.Text;

/**
 * Measure impact of synchronous token cleanup on the repository login with
 * tokens over multiple users. Concurrency can be set via the benchmark runner.
 *
 * Default expiration time login tokens is 2 hours, this benchmark uses 15
 * seconds to allow for cleanup during the benchmark.
 *
 */
public class LoginWithTokensTest extends AbstractLoginTest {

    private static final String REL_TEST_PATH = "testPath";
    private static final String USER = "user";
    private final Random r = new Random();

    // defaults to 10k
    private final int numberOfUsers;

    private final long tknExpy = TimeUnit.SECONDS.toMillis(15);

    private final long cleanupThreshold = 100;

    public LoginWithTokensTest(int numberOfUsers) {
        super("admin", true, DEFAULT_ITERATIONS);
        this.numberOfUsers = numberOfUsers;
    }

    @Override
    protected boolean customConfigurationParameters() {
        return true;
    }

    @Override
    protected ConfigurationParameters prepare(ConfigurationParameters conf) {
        ConfigurationParameters tkns = ConfigurationParameters.of(TokenProvider.PARAM_TOKEN_EXPIRATION, tknExpy,
                "tokenCleanupThreshold", cleanupThreshold);

        ConfigurationParameters tokenConfig = ConfigurationParameters.of(TokenConfiguration.NAME, tkns);
        return ConfigurationParameters.of(conf, tokenConfig);
    }

    @Override
    public void beforeSuite() throws Exception {
        super.beforeSuite();

        Session s = loginAdministrative();
        try {
            UserManager userManager = ((JackrabbitSession) s).getUserManager();

            for (int i = 0; i < numberOfUsers; i++) {
                String id = USER + i;
                userManager.createUser(id, id, new PrincipalImpl(id), REL_TEST_PATH);
            }

        } finally {
            s.save();
            s.logout();
        }
        System.out.println("setup done, created " + numberOfUsers + " users.");
    }

    @Override
    public void afterSuite() throws Exception {
        Session s = loginAdministrative();
        try {
            Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER + "0");
            if (authorizable != null) {
                Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
                n.remove();
            }

            s.save();
        } finally {
            s.logout();
        }
    }

    @Override
    public void runTest() throws RepositoryException {
        Repository repository = getRepository();
        String t = USER + r.nextInt(numberOfUsers);
        SimpleCredentials creds = new SimpleCredentials(t, t.toCharArray());
        creds.setAttribute(".token", "");
        repository.login(creds).logout();
    }

}


text:
XInputDotNet
============

C# wrapper around XInput, works with any Mono or .NET application (eg. Unity3D).

### What is XInput?

[XInput](http://msdn.microsoft.com/en-us/library/ee416996%28VS.85%29.aspx) is a DirectX API to manage the controllers connected to a PC (the same API is also used on Xbox 360). It allows an Xbox 360 controller to be used on a Windows PC.

### What is XInput.NET?

**XInput.NET** is a .NET library which wraps the functions of XInput. It is different from what you can find inside [SlimDX](http://slimdx.org/) for example because it is designed to be pure [CIL](http://en.wikipedia.org/wiki/Common_Intermediate_Language). That means you can use it in [Unity3D](http://unity3d.com/) Free (as well as Pro of course). The API was designed to be very similar (if not identical) to the [GamePad class from XNA](http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.gamepad.aspx).

### Ready to go !

Pre-built binaries are available in the Binaries folder above :

* **XInputDotNetPure.dll**, .NET assembly containing the [GamePad](http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.gamepad.aspx) class
    - You need to add a reference to this one in your C# project for example
* **XInputInterface.dll**, utility DLL which makes the calls to XInput
    - You have to copy this one next to your .exe

### Examples

Some examples are available in this repository :

* **Binaries/XInputDemo.exe**, small console application for the most simple use of the API
    - Tip : use the triggers to test the vibration
* **XInputUnity**, Unity 4 project rotating a cube with the pad, awesome stuff I swear
    - Tip : same tip !

### Using with Unity

![Unity](https://raw.github.com/speps/XInputDotNet/master/XInputUnity/Screenshot.jpg)

You can open the XInputUnity from Unity3D to see how it's setup. The main step is to put XInputDotNetPure.dll inside a **Assets/Plugins** folder (you can create it if missing).

When make a build in Unity, the XInputInterface.dll file won't be properly copied to the build folder, so you have to copy it yourself in the same folder as the executable of your project.

### Notes

* Under Windows XP, you'll need special drivers for your Xbox 360 Controller. You can find them at this address : [XBox 360 Controller for Windows Software](http://www.microsoft.com/en-us/download/details.aspx?id=34001)
* You'll need the latest DirectX SDK to compile it, the binaries were built with the June 2010 version.


text:
var mustache = require('mustache');
var fs = require('fs');
var join = require('path').join;
var highlight = require('highlight.js');
var marked = require('marked').parse;
marked.setOptions({
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: false,
  sanitize: true,
  smartLists: true,
  langPrefix: 'language-',
  highlight: function(code, lang) {
    if (lang === 'js') {
      return highlight.highlightAuto(code).value;
    }
    return code;
  }
});

var build_folder = './';
var chapter_folder = '../chapters';
var filename = 'Readme.md';
var template_file = './template.html';
var code_style_file = './code-github-style.css';

var slides = [];
var folders = [
  'built-ins',
  'functions',
  'inheritance',
  'introduction',
  'objects',
  'operators',
  'prototype',
  'statements',
  'syntax',
  'types'
];

var template;

fs.readFile(template_file, 'utf-8', function (err, template_data) {
  if (err) throw err;
  template = mustache.compile(template_data);

  fs.readFile(code_style_file, 'utf-8', function (err, code_style_data) {
    if (err) throw err;

    folders.forEach(function (folder, i) {
      fs.readFile(join(chapter_folder, folder, filename), 'utf-8', function (err, body) {
        if (err) throw err;

        slides[i] = template(
          {
            code_style: code_style_data,
            body: body
              .split(/\n[- ]+ *\n/)
              .map(function (data) {
                return '\n<article>\n' + marked(data) + '\n</article>\n';
              })
              .join('\n\n<!-- slide -->\n\n')
          }
        );

       fs.writeFile(join(build_folder, folder, 'index.html'), slides[i], function (err) {
         if (err) throw err;
       });
      });
    });
  });
});


text:
package org.openqa.selenium.grid.node;

import org.openqa.selenium.grid.web.CommandHandler;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;

import java.io.IOException;
import java.util.Objects;

class ForwardWebDriverCommand implements CommandHandler {

  private final Node node;

  public ForwardWebDriverCommand(Node node) {
    this.node = Objects.requireNonNull(node);
  }

  @Override
  public void execute(HttpRequest req, HttpResponse resp) throws IOException {
    node.executeWebDriverCommand(req, resp);
  }
}


text:
{% extends "admin/base_site.html" %}
{% load i18n admin_static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %} {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %}
{% block breadcrumbs %}

    {% block content_title %}{% if title %}{{ title }}{% endif %}{% endblock %}

{% trans 'Home' %}
› {% trans 'Password change' %}

{% endblock %}

{% block content %}

{% if form.errors %}

    {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}

{% endif %}

<form method="post">{% csrf_token %}

{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}

<fieldset class="module aligned wide">

    {{ form.old_password.errors }}
    {{ form.old_password.label_tag }} {{ form.old_password }}

    {{ form.new_password1.errors }}
    {{ form.new_password1.label_tag }} {{ form.new_password1 }}
    {% if form.new_password1.help_text %}

{{ form.new_password1.help_text|safe }}

    {% endif %}

{{ form.new_password2.errors }}
    {{ form.new_password2.label_tag }} {{ form.new_password2 }}
    {% if form.new_password2.help_text %}

{{ form.new_password2.help_text|safe }}

    {% endif %}

</fieldset>

    <input type="submit" value="{% trans 'Change my password' %}" class="btn btn-primary" />

</form>

{% endblock %}


text:
	<link rel="stylesheet prefetch" href="lib/css/foundation.min.css">

Step 1

					Email
					<input type="email" />

					First Name
					<input type="text" />

					Last Name
					<input type="text" />

				<button class="button button--submit" type="button">Next step</button>

Step 2

				<input type="text" />
				<input type="text" />
				<input type="text" />
				<button class="button button--submit" type="button">Next step</button>

Step 2 Load Progress


text:
<?xml version="1.0"?>
<entry type="method" name="change" return="jQuery">
  <title>.change()</title>
  <desc>Bind an event handler to the "change" JavaScript event, or trigger that event on an element.</desc>
  <signature>
    <added>1.0</added>
    <argument name="handler" type="Function">
      <desc>A function to execute each time the event is triggered.</desc>
      <argument name="eventObject" type="Event" />
    </argument>
  </signature>
  <signature>
    <added>1.4.3</added>
    <argument name="eventData" type="Anything" optional="true">
      <desc>An object containing data that will be passed to the event handler.</desc>
    </argument>
    <argument name="handler" type="Function">
      <desc>A function to execute each time the event is triggered.</desc>
      <argument name="eventObject" type="Event" />
    </argument>
  </signature>
  <signature>
    <added>1.0</added>
  </signature>
  <longdesc>

This method is a shortcut for .on( "change", handler ) in the first two variations, and .trigger( "change" ) in the third.

The change event is sent to an element when its value changes. This event is limited to <input> elements, <textarea> boxes and <select> elements. For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.

For example, consider the HTML:

<form>
  <input class="target" type="text" value="Field 1">
  <select class="target">
    <option value="option1" selected="selected">Option 1</option>
    <option value="option2">Option 2</option>
  </select>
</form>
<div id="other">
  Trigger the handler
</div>

The event handler can be bound to the text input and the select box:

$( ".target" ).change(function() {
  alert( "Handler for .change() called." );
});

Now when the second option is selected from the dropdown, the alert is displayed. It is also displayed if you change the text in the field and then click away. If the field loses focus without the contents having changed, though, the event is not triggered. To trigger the event manually, apply .change() without arguments:

$( "#other" ).click(function() {
  $( ".target" ).change();
});

After this code executes, clicks on <samp>Trigger the handler</samp> will also alert the message. The message will display twice, because the handler has been bound to the change event on both of the form elements.

As of jQuery 1.4, the change event bubbles in Internet Explorer, behaving consistently with the event in other modern browsers.

Note: Changing the value of an input element using JavaScript, using .val() for example, won't fire the event.

  </longdesc>
  <note id="detach-shorthand" type="additional" data-event="change"/>
  <example>
    <desc>Attaches a change event to the select that gets the text for each selected option and writes them in the div.  It then triggers the event for the initial text draw.</desc>
    <![CDATA[
$( "select" )
  .change(function () {
    var str = "";
    $( "select option:selected" ).each(function() {
      str += $( this ).text() + " ";
    });
    $( "div" ).text( str );
  })
  .change();
]]>
    <css><![CDATA[
  div {
    color: red;
  }
]]></css>
    <![CDATA[
<select name="sweets" multiple="multiple">
  <option>Chocolate</option>
  <option selected="selected">Candy</option>
  <option>Taffy</option>
  <option selected="selected">Caramel</option>
  <option>Fudge</option>
  <option>Cookie</option>
</select>

]]>
  </example>
  <example>
    <desc>To add a validity test to all text input elements:</desc>
    <![CDATA[
$( "input[type='text']" ).change(function() {
  // Check input( $( this ).val() ) for validity here
});
]]>
  </example>
  <category slug="events/form-events"/>
  <category slug="forms"/>
  <category slug="version/1.0"/>
  <category slug="version/1.4.3"/>
</entry>