text:
<stix:STIX_Package
	xmlns:cyboxCommon="http://cybox.mitre.org/common-2"
	xmlns:cybox="http://cybox.mitre.org/cybox-2"
	xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"
	xmlns:example="http://example.com"
	xmlns:incident="http://stix.mitre.org/Incident-1"
	xmlns:ttp="http://stix.mitre.org/TTP-1"
	xmlns:ta="http://stix.mitre.org/ThreatActor-1"
	xmlns:stixCommon="http://stix.mitre.org/common-1"
	xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
	xmlns:stix-ciqidentity="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1"
	xmlns:stix="http://stix.mitre.org/stix-1"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xal="urn:oasis:names:tc:ciq:xal:3"
	xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3"
	xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3"
	xsi:schemaLocation="
	http://cybox.mitre.org/common-2 http://cybox.mitre.org/XMLSchema/common/2.1/cybox_common.xsd
	http://cybox.mitre.org/cybox-2 http://cybox.mitre.org/XMLSchema/core/2.1/cybox_core.xsd
	http://cybox.mitre.org/default_vocabularies-2 http://cybox.mitre.org/XMLSchema/default_vocabularies/2.1/cybox_default_vocabularies.xsd
	http://stix.mitre.org/Incident-1 http://stix.mitre.org/XMLSchema/incident/1.1.1/incident.xsd
	http://stix.mitre.org/TTP-1 http://stix.mitre.org/XMLSchema/ttp/1.1.1/ttp.xsd
	http://stix.mitre.org/ThreatActor-1 http://stix.mitre.org/XMLSchema/threat_actor/1.1.1/threat_actor.xsd
	http://stix.mitre.org/common-1 http://stix.mitre.org/XMLSchema/common/1.1.1/stix_common.xsd
	http://stix.mitre.org/default_vocabularies-1 http://stix.mitre.org/XMLSchema/default_vocabularies/1.1.1/stix_default_vocabularies.xsd
	http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1 http://stix.mitre.org/XMLSchema/extensions/identity/ciq_3.0/1.1.1/ciq_3.0_identity.xsd
	http://stix.mitre.org/stix-1 http://stix.mitre.org/XMLSchema/core/1.1.1/stix_core.xsd
	urn:oasis:names:tc:ciq:xal:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xAL.xsd
	urn:oasis:names:tc:ciq:xnl:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xNL.xsd
	urn:oasis:names:tc:ciq:xpil:3 http://stix.mitre.org/XMLSchema/external/oasis_ciq_3.0/xPIL.xsd" id="example:Package-b4448323-c825-4143-ae03-a18767f41edb" version="1.1.1" timestamp="2013-02-11T22:35:15+00:00">
    <stix:TTPs>
        <stix:TTP id="example:ttp-3ff0abff-16b1-4dbc-b334-f6a536482aac" timestamp="2014-12-22T16:23:11.765000+00:00" xsi:type='ttp:TTPType'>
            <ttp:Behavior>
                <ttp:Attack_Patterns>
                    <ttp:Attack_Pattern>
                        <ttp:Title>Unknown</ttp:Title>
                    </ttp:Attack_Pattern>
                </ttp:Attack_Patterns>
            </ttp:Behavior>
        </stix:TTP>
    </stix:TTPs>
    <stix:Incidents>
        <stix:Incident id="example:incident-6e946d8a-cb99-4de9-b695-abb16ee15b76" timestamp="2014-05-10T00:58:18+00:00" xsi:type='incident:IncidentType'>
            <incident:Title>Springfield officials say the personal information of about 2,100 citizens may have been obtained by hackers when the city's website was "compromised" Feb. 17, a Friday.  Some functions have been turned off on the city's website, springfieldmo.gov, as authorities investigate the apparent breach, said city spokeswoman, Cora Scott.  Scott said officials are notifying the 2,100 individuals who may have been victimized.  She said those who were at risk will receive a letter offering a one-year subscription with an identity theft protection company.</incident:Title>
            <incident:External_ID source="VERIS">1F742634-0C6E-4D26-863E-64DB124EEAC1</incident:External_ID>
            <incident:Time>
                <incident:Initial_Compromise precision="day">2012-02-17T00:00:00</incident:Initial_Compromise>
            </incident:Time>
            <incident:Reporter>
                <stixCommon:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                    <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">swidup</xnl:NameLine>
  </xpil:PartyName>
</ExtSch:Specification>
                </stixCommon:Identity>
            </incident:Reporter>
            <incident:Victim xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xnl:NameLine xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">City of Springfield Missouri</xnl:NameLine>
  </xpil:PartyName>
  <xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xpil:Address>
      <xal:Country xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>US</xal:NameElement>
      </xal:Country>
      <xal:AdministrativeArea xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>MO</xal:NameElement>
      </xal:AdministrativeArea>
    </xpil:Address>
  </xpil:Addresses>
</ExtSch:Specification>
            </incident:Victim>
            <incident:Affected_Assets>
                <incident:Affected_Asset>
                    <incident:Type>Web application</incident:Type>
                    <incident:Nature_Of_Security_Effect>
                        <incident:Property_Affected>
                            <incident:Property xsi:type="stixVocabs:LossPropertyVocab-1.0">Confidentiality</incident:Property>
                            <incident:Description_Of_Effect>Unknown; Notes:Scott confirmed those affected were private citizens — not city employees — but she declined to say why the city had their information.</incident:Description_Of_Effect>
                        </incident:Property_Affected>
                    </incident:Nature_Of_Security_Effect>
                </incident:Affected_Asset>
            </incident:Affected_Assets>
            <incident:Impact_Assessment>
                <incident:Impact_Qualification xsi:type="stixVocabs:ImpactQualificationVocab-1.0">Unknown</incident:Impact_Qualification>
            </incident:Impact_Assessment>
            <incident:Leveraged_TTPs>
                <incident:Leveraged_TTP>
                    <stixCommon:TTP idref="example:ttp-3ff0abff-16b1-4dbc-b334-f6a536482aac" xsi:type='ttp:TTPType'/>
                </incident:Leveraged_TTP>
            </incident:Leveraged_TTPs>
            <incident:Attributed_Threat_Actors>
                <incident:Threat_Actor>
                    <stixCommon:Threat_Actor idref="example:threatactor-5ec1f1ce-f613-46ba-b989-98675ba5f0ff" xsi:type='ta:ThreatActorType'/>
                </incident:Threat_Actor>
            </incident:Attributed_Threat_Actors>
            <incident:Security_Compromise xsi:type="stixVocabs:SecurityCompromiseVocab-1.0">Yes</incident:Security_Compromise>
            <incident:Discovery_Method xsi:type="stixVocabs:DiscoveryMethodVocab-1.0">Unknown</incident:Discovery_Method>
            <incident:Information_Source>
                <stixCommon:Identity>
                    <stixCommon:Name>vcdb</stixCommon:Name>
                </stixCommon:Identity>
                <stixCommon:Tools>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>veris2stix</cyboxCommon:Name>
                        <cyboxCommon:Vendor>MITRE</cyboxCommon:Vendor>
                        <cyboxCommon:Version>0.1</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                    <cyboxCommon:Tool>
                        <cyboxCommon:Name>VERIS schema</cyboxCommon:Name>
                        <cyboxCommon:Vendor>Verizon</cyboxCommon:Vendor>
                        <cyboxCommon:Version>1.3.0</cyboxCommon:Version>
                    </cyboxCommon:Tool>
                </stixCommon:Tools>
                <stixCommon:References>
                    <stixCommon:Reference>http://www.news-leader.com/article/20120228/NEWS06/302280028/springfield-city-website-hacked-data-break-citizens-identity-protection?odyssey=mod|newswell|text|Special%20Reports|s&nclick_check=1</stixCommon:Reference>
                </stixCommon:References>
            </incident:Information_Source>
        </stix:Incident>
    </stix:Incidents>
    <stix:Threat_Actors>
        <stix:Threat_Actor id="example:threatactor-5ec1f1ce-f613-46ba-b989-98675ba5f0ff" timestamp="2014-12-22T16:23:11.781000+00:00" xsi:type='ta:ThreatActorType'>
            <ta:Identity xsi:type='stix-ciqidentity:CIQIdentity3.0InstanceType'>
                <ExtSch:Specification xmlns:ExtSch="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">
  <xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
    <xpil:Address>
      <xal:Country xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
        <xal:NameElement>Unknown</xal:NameElement>
      </xal:Country>
    </xpil:Address>
  </xpil:Addresses>
</ExtSch:Specification>
            </ta:Identity>
            <ta:Type timestamp="2014-12-22T16:23:11.781000+00:00">
                <stixCommon:Value>Unknown</stixCommon:Value>
            </ta:Type>
            <ta:Motivation timestamp="2014-12-22T16:23:11.781000+00:00">
                <stixCommon:Value>Unknown</stixCommon:Value>
            </ta:Motivation>
            <ta:Observed_TTPs>
                <ta:Observed_TTP>
                    <stixCommon:TTP idref="example:ttp-3ff0abff-16b1-4dbc-b334-f6a536482aac" xsi:type='ttp:TTPType'/>
                </ta:Observed_TTP>
            </ta:Observed_TTPs>
        </stix:Threat_Actor>
    </stix:Threat_Actors>
</stix:STIX_Package>


text:
binary-search-tree-fun
======================

WebGL JS/App for manipulating Binary Search Trees (e.g., using tree rotations) of various flavors.

## Author / Modifications

  * Wayne O. Cochran <wayne.cochran@gmail.com>
  * December 31, 2014 ........ initial commit

## Files

  * `LICENSE` ............ MIT License
  * `.gitignore` ......... files git should ignore
  * `matrix.js` .......... Matrix Library for WebGL Math
  * `bst.js` ............. Binary Search Tree (Model)
  * `bst.html` ........... WebGL/JS Binary Search Tree App

redpajama_set_name: RedPajamaGithub


text:
Package.describe({
  name: 'jss:popup-coffee',
  version: '0.0.2',
  summary: 'Popup window.',
  git: 'https://github.com/JSSolutions/meteor-popup/',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use([
    'coffeescript',
    'less',
    'templating',
    'jquery',
    'underscore',
    'fortawesome:fontawesome',
    'peerlibrary:blaze-components'
  ], 'client');
  api.addFiles([
    'popup/abs/popup.coffee',
    'popup/toggle/toggle.html',
    'popup/toggle/toggle.coffee',
    'popup/window/window.html',
    'popup/window/window.less',
    'popup/window/window.coffee'
  ], 'client');
});


text:
@extends('layouts.admin')
@section('content')

            @include('admin.include.button-add')
            @include('admin.include.button-cache-picture')

          @include('admin.include.search')

              {{trans('admin.fieldname_item_id')}}
              {{trans('admin.fieldname_item_modelid')}}
              {{trans('admin.fieldname_item_title')}}
              {{trans('admin.fieldname_item_attachment')}}
              {{trans('admin.fieldname_item_orderid')}}
              {{trans('admin.fieldname_item_status')}}
              {{trans('admin.fieldname_item_option')}}

              @include('admin.include.fieldvalue.v-for')
                @{{ item.id }}
                  {{trans('admin.define_model_picture1')}}
                  {{trans('admin.define_model_picture2')}}
                  {{trans('admin.define_model_picture3')}}
                  {{trans('admin.define_model_picture4')}}
                @{{ item.title }}
                @include('admin.include.fieldvalue.attachment')
                @{{ item.orderid }}
                @include('admin.include.fieldvalue.status')

                    @include('admin.include.fieldvalue.option')

        @include('admin.include.pages')

@endsection


text:
<!doctype html>

    <meta charset="utf-8">

    <title>Socket</title>

Hello!!

    {{data}}


text:
title: HTTP Transport
permalink: /docs/transports/http/
---

The HTTP transport uses http requests to communicate.

## Installation

The HTTP transport is not bundled with Hudson Taylor by default.

To install:

```
npm install ht-http-transport --save
```

## Options

| Name    | Type       | Required | Example       | Default   | Description                            |
|---------|------------|----------|---------------|-----------|----------------------------------------|
| host    | string     |          | "127.0.0.1"   | "0.0.0.0" | Network address to listen on.          |
| port    | number     | ✓        | 1234          | N/A       | Network port to listen on.             |
| path    | string     |          | "/endpoint"   | "/ht"     | Path to accept requests on.            |
| ssl     | Object     |          | { cert, key } | N/A       | Enable SSL                             |
| agent   | http.Agent |          |               | N/A       | To manage connection persistence       |
| timeout | number     |          | 1800          | N/A       | Timeout before the socket is connected |

## Example

```js
var htHTTPTransport = require('ht-http-transport')
var http = require('http')

var keepAliveAgent = new http.Agent({ keepAlive: true })
var transport = new ht.Transport.HTTP({
  host: "127.0.0.1",
  port: 1337,
  path: "/endpoint",
  ssl: {
    cert: "...",
    key: "..."
  },
  agent: keepAliveAgent,
  timeout: 1000
})
```


text:
CREATE SEQUENCE alf_activity_feed_seq START WITH 1 INCREMENT BY 1;
CREATE TABLE alf_activity_feed
(
    id INT8 NOT NULL,
    post_id INT8,
    post_date TIMESTAMP NOT NULL,
    activity_summary VARCHAR(1024),
    feed_user_id VARCHAR(255),
    activity_type VARCHAR(255) NOT NULL,
    site_network VARCHAR(255),
    app_tool VARCHAR(36),
    post_user_id VARCHAR(255) NOT NULL,
    feed_date TIMESTAMP NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX feed_postdate_idx ON alf_activity_feed (post_date);
CREATE INDEX feed_postuserid_idx ON alf_activity_feed (post_user_id);
CREATE INDEX feed_feeduserid_idx ON alf_activity_feed (feed_user_id);
CREATE INDEX feed_sitenetwork_idx ON alf_activity_feed (site_network);

CREATE SEQUENCE alf_activity_feed_control_seq START WITH 1 INCREMENT BY 1;
CREATE TABLE alf_activity_feed_control
(
    id INT8 NOT NULL,
    feed_user_id VARCHAR(255) NOT NULL,
    site_network VARCHAR(255),
    app_tool VARCHAR(36),
    last_modified TIMESTAMP NOT NULL,
    PRIMARY KEY (id)
);
CREATE INDEX feedctrl_feeduserid_idx ON alf_activity_feed_control (feed_user_id);

CREATE SEQUENCE alf_activity_post_seq START WITH 1 INCREMENT BY 1;
CREATE TABLE alf_activity_post
(
    sequence_id INT8 NOT NULL,
    post_date TIMESTAMP NOT NULL,
    status VARCHAR(10) NOT NULL,
    activity_data VARCHAR(1024) NOT NULL,
    post_user_id VARCHAR(255) NOT NULL,
    job_task_node INT4 NOT NULL,
    site_network VARCHAR(255),
    app_tool VARCHAR(36),
    activity_type VARCHAR(255) NOT NULL,
    last_modified TIMESTAMP NOT NULL,
    PRIMARY KEY (sequence_id)
);
CREATE INDEX post_jobtasknode_idx ON alf_activity_post (job_task_node);
CREATE INDEX post_status_idx ON alf_activity_post (status);


text:
package org.hawkular.feedcomm.ws.server;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import javax.annotation.PostConstruct;
import javax.ejb.ConcurrencyManagement;
import javax.ejb.ConcurrencyManagementType;
import javax.ejb.Lock;
import javax.ejb.LockType;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.websocket.CloseReason;
import javax.websocket.Session;

import org.hawkular.feedcomm.ws.MsgLogger;

/**
 * Maintains a runtime list of feeds currently connected with this server.
 */
@Startup
@Singleton
@ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class ConnectedFeeds {

    // key=feedID, value=feed websocket session
    private Map<String, Session> sessions;

    @PostConstruct
    public void initialize() {
        MsgLogger.LOG.debugf("ConnectedFeeds has initialized");
        this.sessions = new HashMap<>();
    }

    @Lock(LockType.READ)
    public int getTotalSessions() {
        return this.sessions.size();

    }

    @Lock(LockType.READ)
    public Session getSession(String feedId) {
        return this.sessions.get(feedId);
    }

    @Lock(LockType.READ)
    public Set<Session> getAllSessions() {
        return new HashSet<Session>(this.sessions.values());
    }

    @Lock(LockType.READ)
    public Set<String> getAllFeeds() {
        return new HashSet<String>(this.sessions.keySet());
    }

    /**
     * Adds the given session and associates it with the given feed ID.
     * If there is already a session associated with the given feed ID,
     * the given session is closed, it is not added or associated with the given feed ID
     * and a error will be logged. The original session remains associated with the feed ID.
     *
     * @param feedId the feed ID that will be associated wit the new session
     * @param newSession the new session to add
     * @return if the session was added true is returned; false otherwise.
     */
    @Lock(LockType.WRITE)
    public boolean addSession(String feedId, Session newSession) {
        Session oldSession = this.sessions.putIfAbsent(feedId, newSession);

        if (oldSession == null) {
            MsgLogger.LOG.infof("A feed session has been added [%s]. There are now [%d] connected feeds",
                    feedId, this.sessions.size());
        } else {
            // a feed already had a session open, cannot open more than one
            try {
                MsgLogger.LOG.errorClosingExtraFeedSession(feedId);
                newSession.close(new CloseReason(CloseReason.CloseCodes.VIOLATED_POLICY,
                        "Cannot have multiple sessions open, the new one will be closed"));
            } catch (Exception e) {
                MsgLogger.LOG.errorCannotCloseExtraFeedSession(feedId, e);
            }
        }

        return oldSession == null;
    }

    /**
     * Removes the session associated with the given feed ID.
     * If doomedSession is not null, the feed's session will only be removed
     * if that feed session has the same ID as the given doomedSession.
     *
     * @param feedId identifies the session to be removed
     * @param doomedSession if not null, ensures that only this session will be removed
     * @return the removed session or null if nothing was removed
     */
    @Lock(LockType.WRITE)
    public Session removeSession(String feedId, Session doomedSession) {
        Session removed = null;

        // If no session was passed in, remove any session associated with the given feed.
        // If a session was passed in, only remove it if the feedId is associated with that session.
        // This is to support the need to close extra sessions a feed might have created.
        if (doomedSession == null) {
            removed = this.sessions.remove(feedId);
        } else {
            Session existingSession = this.sessions.get(feedId);
            if (existingSession != null && existingSession.getId().equals(doomedSession.getId())) {
                removed = this.sessions.remove(feedId);
            }
        }

        if (removed != null) {
            MsgLogger.LOG.infof("Session [%s] for feed [%s] has been removed. There are now [%d] connected feeds",
                    removed.getId(), feedId, this.sessions.size());
        }

        return removed;
    }
}


text:
package com.googlecode.d2j.dex.writer.item;

import com.googlecode.d2j.dex.writer.io.DataOut;

public abstract class BaseItem {
    public static final int NO_INDEX = -1;
    public int index;
    public int offset;

    static protected void addPadding(DataOut out, int alignment) {
        int x = out.offset() % alignment;
        if (x != 0) {
            out.skip("padding", alignment - x);// Padding
        }
    }

    static public void addPadding(DataOut out, int offset, int alignment) {
        int x = offset % alignment;
        if (x != 0) {
            out.skip("padding", alignment - x);// Padding
        }
    }

    public static int padding(int offset, int alignment) {
        int x = offset % alignment;
        if (x != 0) {
            offset += alignment - x;// Padding
        }
        return offset;
    }

    public static int lengthOfSleb128(int value) {
        int remaining = value >> 7;
        boolean hasMore = true;
        int end = ((value & Integer.MIN_VALUE) == 0) ? 0 : -1;
        int count = 0;
        while (hasMore) {
            hasMore = (remaining != end)
                    || ((remaining & 1) != ((value >> 6) & 1));
            count++;
            value = remaining;
            remaining >>= 7;
        }
        return count;
    }

    public static int lengthOfUleb128(final int s) {
        int length = 1;
        if (s > 0x7f) {
            length++;
            if (s > (0x3fff)) {
                length++;
                if (s > (0x1fffff)) {
                    length++;
                    if (s > (0xfffffff)) {
                        length++;
                    }
                }
            }
        }
        return length;
    }

    public abstract void write(DataOut out);

    public abstract int place(int offset);
}


text:
package org.apache.logging.log4j.core.async;

import java.util.Locale;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import com.lmax.disruptor.*;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.util.Constants;
import org.apache.logging.log4j.core.util.Integers;
import org.apache.logging.log4j.status.StatusLogger;
import org.apache.logging.log4j.util.LoaderUtil;
import org.apache.logging.log4j.util.PropertiesUtil;

/**
 * Utility methods for getting Disruptor related configuration.
 */
final class DisruptorUtil {
    private static final Logger LOGGER = StatusLogger.getLogger();
    private static final int RINGBUFFER_MIN_SIZE = 128;
    private static final int RINGBUFFER_DEFAULT_SIZE = 256 * 1024;
    private static final int RINGBUFFER_NO_GC_DEFAULT_SIZE = 4 * 1024;

    private DisruptorUtil() {
    }

    static long getTimeout(final String propertyName, final long defaultTimeout) {
        return PropertiesUtil.getProperties().getLongProperty(propertyName, defaultTimeout);
    }

    static WaitStrategy createWaitStrategy(final String propertyName) {
        final String key = propertyName.startsWith("AsyncLogger.")
                ? "AsyncLogger.Timeout"
                : "AsyncLoggerConfig.Timeout";
        final long timeoutMillis = DisruptorUtil.getTimeout(key, 10L);
        return createWaitStrategy(propertyName, timeoutMillis);
    }

    static WaitStrategy createWaitStrategy(final String propertyName, final long timeoutMillis) {
        final String strategy = PropertiesUtil.getProperties().getStringProperty(propertyName, "TIMEOUT");
        LOGGER.trace("property {}={}", propertyName, strategy);
        final String strategyUp = strategy.toUpperCase(Locale.ROOT); // TODO Refactor into Strings.toRootUpperCase(String)
        switch (strategyUp) { // TODO Define a DisruptorWaitStrategy enum?
        case "SLEEP":
            return new SleepingWaitStrategy();
        case "YIELD":
            return new YieldingWaitStrategy();
        case "BLOCK":
            return new BlockingWaitStrategy();
        case "BUSYSPIN":
            return new BusySpinWaitStrategy();
        case "TIMEOUT":
            return new TimeoutBlockingWaitStrategy(timeoutMillis, TimeUnit.MILLISECONDS);
        default:
            return new TimeoutBlockingWaitStrategy(timeoutMillis, TimeUnit.MILLISECONDS);
        }
    }

    static int calculateRingBufferSize(final String propertyName) {
        int ringBufferSize = Constants.ENABLE_THREADLOCALS ? RINGBUFFER_NO_GC_DEFAULT_SIZE : RINGBUFFER_DEFAULT_SIZE;
        final String userPreferredRBSize = PropertiesUtil.getProperties().getStringProperty(propertyName,
                String.valueOf(ringBufferSize));
        try {
            int size = Integer.parseInt(userPreferredRBSize);
            if (size < RINGBUFFER_MIN_SIZE) {
                size = RINGBUFFER_MIN_SIZE;
                LOGGER.warn("Invalid RingBufferSize {}, using minimum size {}.", userPreferredRBSize,
                        RINGBUFFER_MIN_SIZE);
            }
            ringBufferSize = size;
        } catch (final Exception ex) {
            LOGGER.warn("Invalid RingBufferSize {}, using default size {}.", userPreferredRBSize, ringBufferSize);
        }
        return Integers.ceilingNextPowerOfTwo(ringBufferSize);
    }

    static ExceptionHandler<RingBufferLogEvent> getAsyncLoggerExceptionHandler() {
        final String cls = PropertiesUtil.getProperties().getStringProperty("AsyncLogger.ExceptionHandler");
        if (cls == null) {
            return new AsyncLoggerDefaultExceptionHandler();
        }
        try {
            @SuppressWarnings("unchecked")
            final Class<? extends ExceptionHandler<RingBufferLogEvent>> klass =
                (Class<? extends ExceptionHandler<RingBufferLogEvent>>) LoaderUtil.loadClass(cls);
            return klass.newInstance();
        } catch (final Exception ignored) {
            LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: error creating {}: ", cls, ignored);
            return new AsyncLoggerDefaultExceptionHandler();
        }
    }

    static ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper> getAsyncLoggerConfigExceptionHandler() {
        final String cls = PropertiesUtil.getProperties().getStringProperty("AsyncLoggerConfig.ExceptionHandler");
        if (cls == null) {
            return new AsyncLoggerConfigDefaultExceptionHandler();
        }
        try {
            @SuppressWarnings("unchecked")
            final Class<? extends ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper>> klass =
                    (Class<? extends ExceptionHandler<AsyncLoggerConfigDisruptor.Log4jEventWrapper>>) LoaderUtil.loadClass(cls);
            return klass.newInstance();
        } catch (final Exception ignored) {
            LOGGER.debug("Invalid AsyncLoggerConfig.ExceptionHandler value: error creating {}: ", cls, ignored);
            return new AsyncLoggerConfigDefaultExceptionHandler();
        }
    }

    /**
     * Returns the thread ID of the background appender thread. This allows us to detect Logger.log() calls initiated
     * from the appender thread, which may cause deadlock when the RingBuffer is full. (LOG4J2-471)
     *
     * @param executor runs the appender thread
     * @return the thread ID of the background appender thread
     */
    public static long getExecutorThreadId(final ExecutorService executor) {
        final Future<Long> result = executor.submit(new Callable<Long>() {
            @Override
            public Long call() {
                return Thread.currentThread().getId();
            }
        });
        try {
            return result.get();
        } catch (final Exception ex) {
            final String msg = "Could not obtain executor thread Id. "
                    + "Giving up to avoid the risk of application deadlock.";
            throw new IllegalStateException(msg, ex);
        }
    }
}


text:
#ifndef BUBBLEFS_BUILD_CONFIG_H_
#define BUBBLEFS_BUILD_CONFIG_H_

/////////////////////////////////////////////////////
// custom macros

#ifndef TF_COMPILE_LIBRARY
#define TF_COMPILE_LIBRARY 0
#endif

#ifndef TF_USE_NO_RTTI
#define TF_USE_NO_RTTI 0
#endif

// x86 and x86-64 can perform unaligned loads/stores directly.
#ifndef TF_USE_UNALIGNED
#define TF_USE_UNALIGNED 1
#endif

/*! \brief whether use glog for logging */
#ifndef TF_USE_GLOG
#define TF_USE_GLOG 0
#endif

#ifndef TF_USE_JEMALLOC
#define TF_USE_JEMALLOC 0
#endif

#ifndef TF_USE_SNAPPY
#define TF_USE_SNAPPY 0
#endif

#ifndef TF_USE_PTHREAD_SPINLOCK
#define TF_USE_PTHREAD_SPINLOCK 1
#endif

#ifndef TF_SUPPORT_THREAD_LOCAL
#define TF_SUPPORT_THREAD_LOCAL 1
#endif

#ifndef TF_USE_SSL
#define TF_USE_SSL 1
#endif

#endif // BUBBLEFS_BUILD_CONFIG_H_


text:
package com.iyzipay.model;

import com.iyzipay.ToStringRequestBuilder;

import java.util.Map;

public class CardInformation {

    private String cardAlias;
    private String cardNumber;
    private String expireYear;
    private String expireMonth;
    private String cardHolderName;
    private Map<String,String> metadata;

    public String getCardAlias() {
        return cardAlias;
    }

    public void setCardAlias(String cardAlias) {
        this.cardAlias = cardAlias;
    }

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getExpireYear() {
        return expireYear;
    }

    public void setExpireYear(String expireYear) {
        this.expireYear = expireYear;
    }

    public String getExpireMonth() {
        return expireMonth;
    }

    public void setExpireMonth(String expireMonth) {
        this.expireMonth = expireMonth;
    }

    public String getCardHolderName() {
        return cardHolderName;
    }

    public void setCardHolderName(String cardHolderName) {
        this.cardHolderName = cardHolderName;
    }

    public Map<String, String> getMetadata() {
        return metadata;
    }

    public void setMetadata(Map<String, String> metadata) {
        this.metadata = metadata;
    }

    @Override
    public String toString() {
        return new ToStringRequestBuilder(this)
                .append("cardAlias", cardAlias)
                .append("cardNumber", cardNumber)
                .append("expireYear", expireYear)
                .append("expireMonth", expireMonth)
                .append("cardHolderName", cardHolderName)
                .append("metadata", metadata)
                .toString();
    }
}


text:
using UnityEngine;
using System.Collections;

// frame timer
// 일정 시간 후 알림
// 일정 시간 후 반복 알림
// 일정 시간 후 반복횟수만큼 알림

public class NcTimerTool
{
	// Attribute ------------------------------------------------------------------------
	protected	bool		m_bEnable;
	private		float		m_fLastEngineTime	= 0;
	private		float		m_fCurrentTime;
	private		float		m_fLastTime			= 0;
	private		float		m_fTimeScale		= 1.0f;

	private		int			m_nSmoothCount		= 10;
	private		int			m_nSmoothIndex		= 0;
	private		float		m_fSmoothRate		= 1.3f;
	private		float[]		m_fSmoothTimes;
	private		float		m_fLastSmoothDeltaTime;

	// Property -------------------------------------------------------------------------
	public static float GetEngineTime()
	{
		if (Time.time == 0)
			return 0.000001f;
		return Time.time;
	}

	public static float GetEngineDeltaTime()
	{
		return Time.deltaTime;
	}

	private void InitSmoothTime()
	{
		if (m_fSmoothTimes == null)
		{
			m_fSmoothTimes = new float[m_nSmoothCount];
			for (int n = 0; n < m_nSmoothCount; n++)
				m_fSmoothTimes[n] = Time.deltaTime;
			m_fLastSmoothDeltaTime = Time.deltaTime;
		}
	}

	private float UpdateSmoothTime(float fDeltaTime)
	{
		m_fSmoothTimes[m_nSmoothIndex++] = Mathf.Min(fDeltaTime, m_fLastSmoothDeltaTime * m_fSmoothRate);
		if (m_nSmoothCount <= m_nSmoothIndex)
			m_nSmoothIndex = 0;

		m_fLastSmoothDeltaTime = 0;
		for (int n = 0; n < m_nSmoothCount; n++)
			m_fLastSmoothDeltaTime += m_fSmoothTimes[n];
		m_fLastSmoothDeltaTime /= m_nSmoothCount;
		return m_fLastSmoothDeltaTime;
	}

	public bool IsUpdateTimer()
	{
		return (m_fLastEngineTime != GetEngineTime());
	}

	private float UpdateTimer()
	{
		if (m_bEnable)
		{
			if (m_fLastEngineTime != GetEngineTime())
			{
				m_fLastTime		= m_fCurrentTime;
				m_fCurrentTime += (GetEngineTime() - m_fLastEngineTime) * GetTimeScale();
				m_fLastEngineTime = GetEngineTime();
				if (m_fSmoothTimes != null)
					UpdateSmoothTime(m_fCurrentTime - m_fLastTime);
			}
		} else {
			m_fLastEngineTime = GetEngineTime();
		}
		return m_fCurrentTime;
	}

	public float GetTime()
	{
		return UpdateTimer();
	}

	public float GetDeltaTime()
	{
		if (m_bEnable)
		{
			if (Time.timeScale == 0)
				return 0;
			UpdateTimer();
			return m_fCurrentTime - m_fLastTime;
		}
		return 0;
	}

	public float GetSmoothDeltaTime()
	{
		if (m_bEnable)
		{
			if (Time.timeScale == 0)
				return 0;
			if (m_fSmoothTimes == null)
				InitSmoothTime();
			UpdateTimer();
			return m_fLastSmoothDeltaTime;
		}
		return 0;
	}

	public bool IsEnable()
	{
		return m_bEnable;
	}

	public void Start()
	{
		m_bEnable			= true;
		m_fCurrentTime		= 0;
		m_fLastEngineTime	= GetEngineTime() - 0.000001f;
		UpdateTimer();
	}

	public void Reset(float fElapsedTime)
	{
		m_fCurrentTime		= fElapsedTime;
		m_fLastEngineTime	= GetEngineTime() - 0.000001f;
		UpdateTimer();
	}

	public void Pause()
	{
		UpdateTimer();
		m_bEnable = false;
		UpdateTimer();
	}

	public void Resume()
	{
		UpdateTimer();
		m_bEnable = true;
		UpdateTimer();
	}

	public void SetTimeScale(float fTimeScale)
	{
		m_fTimeScale = fTimeScale;
	}

	protected virtual float GetTimeScale()
	{
		return m_fTimeScale;
	}

	// Control Function -----------------------------------------------------------------
}


text:
<!DOCTYPE html>

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

<title>WordNet-Affect Lexicon — affect_wordnet • corpus</title>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<link href="../pkgdown.css" rel="stylesheet">

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">

      </button>
      corpus

  Get Started

  Reference

    Articles

      Chinese text handling

      Finding gendered words

      Stemming Words

      Text data in Corpus and other packages

  News

WordNet-Affect Lexicon

The WordNet-Affect Lexicon is a hand-curate collection of
    emotion-related words (nouns, verbs, adjectives, and adverbs),
    classified as “Positive”, “Negative”,
    “Neutral”, or “Ambiguous” and categorized into
    28 subcategories (“Joy”, “Love”, “Fear”,
    etc.).

Terms can and do appear in multiple categories.

The original lexicon contains multi-word phrases, but they
    are excluded here. Also, we removed the term ‘thing’
    from the lexicon.

The original WordNet-Affect lexicon is distributed as part
    of the WordNet Domains project, which is licensed under a
    Creative Commons Attribution 3.0 Unported License.
    You are free to share and adapt the lexicon, as long as you
    give attribution to the original authors.

affect_wordnet

Format

A data frame with one row for each term classification.

Source

http://wndomains.fbk.eu/wnaffect.html

References

Strapparava, C and Valitutti A. (2004).
    WordNet-Affect: an affective extension of WordNet.
    Proceedings of the 4th International Conference on Language
        Resources and Evaluation
    1083--1086.

Contents

Format

Source

References

Developed by Patrick O. Perry.

Site built with pkgdown.


text:
<?php

/**
 * Test kernel.
 */
class AppKernel extends \Symfony\Component\HttpKernel\Kernel
{
    /**
     * {@inheritdoc}
     */
    public function registerBundles()
    {
        return array(
            // Dependencies
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            // My Bundle to test
            new Ma27\ApiKeyAuthenticationBundle\Ma27ApiKeyAuthenticationBundle(),
        );
    }

    /**
     * {@inheritdoc}
     */
    public function registerContainerConfiguration(\Symfony\Component\Config\Loader\LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/configs/functional.yml');
        if ($this->environment === 'cache') {
            $loader->load(__DIR__.'/configs/cache.yml');
        }
    }
}


text:
@implementation KPHResponseStringField

+ (instancetype)stringFieldWithKey:(NSString *)key value:(NSString *)value {
  KPHResponseStringField *stringField = [KPHResponseStringField new];
  stringField.Key = key;
  stringField.Value = value;
  return stringField;
}

@end

@implementation KPHResponseEntry

+ (instancetype)entryWithUrl:(NSString *)url name:(NSString *)name login:(NSString *)login password:(NSString *)password uuid:(NSString *)uuid stringFields:(NSArray<KPHResponseStringField *><KPHResponseStringField,Optional> *)stringFields {
  KPHResponseEntry *entry = [[KPHResponseEntry alloc] init];
  entry.url = url;
  entry.Name = name;
  entry.Login = login;
  entry.Password = password;
  entry.Uuid = uuid;
  entry.StringFields = stringFields;
  return entry;
}

+ (BOOL)propertyIsIgnored:(NSString *)propertyName {
  return ([propertyName isEqualToString:@"sortValue"]);
}
@end

@implementation KPHResponse

- (instancetype)init {
  if (self = [super init]) {
    _Success = NO;
    NSBundle *bundle = [NSBundle bundleForClass:self.class];
    NSString *name = bundle.infoDictionary[(NSString *)kCFBundleNameKey];
    _Version =  [NSString stringWithFormat:@"%@", name];
  }
  return self;
}

+ (instancetype)responseWithRequestType:(NSString *)requestType hash:(NSString *)hash
{
  KPHResponse *response = [KPHResponse new];
  response.RequestType = requestType;
  response.Hash = hash;
  return response;
}

+ (BOOL)propertyIsOptional:(NSString*)propertyName {
  return ([propertyName isEqualToString:@"Count"]);
}

@end


text:
package com.nerodesk.takes.doc;

import com.nerodesk.om.Base;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.takes.Request;
import org.takes.Response;
import org.takes.Take;
import org.takes.rs.RsWithBody;

/**
 * Read file content.
 *
 * @author Yegor Bugayenko (yegor@teamed.io)
 * @version $Id$
 * @since 0.2
 */
final class TkRead implements Take {

    /**
     * Base.
     */
    private final transient Base base;

    /**
     * Ctor.
     * @param bse Base
     */
    TkRead(final Base bse) {
        this.base = bse;
    }

    @Override
    public Response act(final Request req) throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new RqDoc(req, this.base).doc().read(baos);
        return new RsWithBody(new ByteArrayInputStream(baos.toByteArray()));
    }

}


text:
"""
File calendar store tests.
"""

# FIXME: all test cases in this file aside from FileStorageTests should be
# deleted and replaced with either implementation-specific methods on
# FileStorageTests, or implementation-agnostic methods on CommonTests.

from pycalendar.datetime import DateTime
from twext.enterprise.ienterprise import AlreadyFinishedError
from twext.python.filepath import CachingFilePath as FilePath
from twisted.internet.defer import inlineCallbacks
from twisted.trial import unittest
from twistedcaldav.ical import Component as VComponent
from txdav.caldav.datastore.file import Calendar, CalendarObject
from txdav.caldav.datastore.file import CalendarStore, CalendarHome
from txdav.caldav.datastore.test.common import (
    CommonTests, test_event_text, event1modified_text
)
from txdav.common.datastore.test.util import buildTestDirectory
from txdav.common.datastore.test.util import StubNotifierFactory
from txdav.common.datastore.test.util import deriveQuota
from txdav.common.icommondatastore import HomeChildNameNotAllowedError
from txdav.common.icommondatastore import NoSuchHomeChildError
from txdav.common.icommondatastore import ObjectResourceNameNotAllowedError
from txdav.common.icommondatastore import ObjectResourceUIDAlreadyExistsError

storePath = FilePath(__file__).parent().child("calendar_store")

def _todo(f, why):
    f.todo = why
    return f

featureUnimplemented = lambda f: _todo(f, "Feature unimplemented")
testUnimplemented = lambda f: _todo(f, "Test unimplemented")
todo = lambda why: lambda f: _todo(f, why)

def setUpCalendarStore(test):
    test.root = FilePath(test.mktemp())
    test.root.createDirectory()

    storeRootPath = test.storeRootPath = test.root.child("store")
    calendarPath = storeRootPath.child("calendars").child("__uids__")
    calendarPath.parent().makedirs()
    storePath.copyTo(calendarPath)

    # Set year values to current year
    subs = {}
    nowYear = DateTime.getToday().getYear()
    subs["now"] = nowYear
    for i in range(1, 10):
        subs["now-{}".format(i)] = nowYear - 1
        subs["now+{}".format(i)] = nowYear + 1
    for home in calendarPath.child("ho").child("me").children():
        if not home.basename().startswith("."):
            for calendar in home.children():
                if not calendar.basename().startswith("."):
                    for resource in calendar.children():
                        if resource.basename().endswith(".ics"):
                            resource.setContent(resource.getContent() % subs)

    testID = test.id()
    test.counter = 0
    test.notifierFactory = StubNotifierFactory()
    test.calendarStore = CalendarStore(
        storeRootPath,
        {"push": test.notifierFactory} if test.notifierFactory else {},
        None,  # must create directory later
        quota=deriveQuota(test),
    )
    test.directory = buildTestDirectory(test.calendarStore, test.mktemp())
    test.txn = test.calendarStore.newTransaction(testID + "(old)")
    assert test.calendarStore is not None, "No calendar store?"

@inlineCallbacks
def setUpHome1(test):
    setUpCalendarStore(test)
    test.home1 = yield test.txn.calendarHomeWithUID("home1")
    assert test.home1 is not None, "No calendar home?"

@inlineCallbacks
def setUpCalendar1(test):
    yield setUpHome1(test)
    test.calendar1 = yield test.home1.calendarWithName("calendar_1")
    assert test.calendar1 is not None, "No calendar?"

class CalendarStoreTest(unittest.TestCase):
    """
    Test cases for L{CalendarStore}.
    """

    notifierFactory = None

    def setUp(self):
        setUpCalendarStore(self)

    @inlineCallbacks
    def tearDown(self):
        super(CalendarStoreTest, self).tearDown()
        try:
            yield self.txn.commit()
        except AlreadyFinishedError:
            pass

    def test_calendarHomeWithUID_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no UIDs may start with ".".
        """
        self.assertEquals(
            self.calendarStore.newTransaction().calendarHomeWithUID("xyzzy"),
            None
        )

class CalendarHomeTest(unittest.TestCase):

    notifierFactory = None

    def setUp(self):
        return setUpHome1(self)

    @inlineCallbacks
    def tearDown(self):
        super(CalendarHomeTest, self).tearDown()
        try:
            yield self.txn.commit()
        except AlreadyFinishedError:
            pass

    def test_init(self):
        """
        L{CalendarHome} has C{_path} and L{_calendarStore} attributes,
        indicating its location on disk and parent store, respectively.
        """
        self.failUnless(
            isinstance(self.home1._path, FilePath),
            self.home1._path
        )
        self.assertEquals(
            self.home1._calendarStore,
            self.calendarStore
        )

    def test_calendarWithName_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no calendar names may start with ".".
        """
        name = ".foo"
        self.home1._path.child(name).createDirectory()
        self.assertEquals(self.home1.calendarWithName(name), None)

    def test_createCalendarWithName_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no calendar names may start with ".".
        """
        self.assertRaises(
            HomeChildNameNotAllowedError,
            self.home1.createCalendarWithName, ".foo"
        )

    def test_removeCalendarWithName_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no calendar names may start with ".".
        """
        name = ".foo"
        self.home1._path.child(name).createDirectory()
        self.assertRaises(
            NoSuchHomeChildError,
            self.home1.removeCalendarWithName, name
        )

class CalendarTest(unittest.TestCase):

    notifierFactory = None

    def setUp(self):
        return setUpCalendar1(self)

    @inlineCallbacks
    def tearDown(self):
        super(CalendarTest, self).tearDown()
        try:
            yield self.txn.commit()
        except AlreadyFinishedError:
            pass

    def test_init(self):
        """
        L{Calendar.__init__} sets private attributes to reflect its constructor
        arguments.
        """
        self.failUnless(
            isinstance(self.calendar1._path, FilePath),
            self.calendar1
        )
        self.failUnless(
            isinstance(self.calendar1._calendarHome, CalendarHome),
            self.calendar1._calendarHome
        )

    @inlineCallbacks
    def test_useIndexImmediately(self):
        """
        L{Calendar._index} is usable in the same transaction it is created, with
        a temporary filename.
        """
        self.home1.createCalendarWithName("calendar2")
        calendar = yield self.home1.calendarWithName("calendar2")
        index = calendar._index
        yield self.assertEquals(set((yield index.calendarObjects())),
                                set((yield calendar.calendarObjects())))
        yield self.txn.commit()
        self.txn = self.calendarStore.newTransaction()
        self.home1 = yield self.txn.calendarHomeWithUID("home1")
        calendar = yield self.home1.calendarWithName("calendar2")
        # FIXME: we should be curating our own index here, but in order to fix
        # that the code in the old implicit scheduler needs to change.  This
        # test would be more effective if there were actually some objects in
        # this list.
        index = calendar._index
        self.assertEquals(set((yield index.calendarObjects())),
                          set((yield calendar.calendarObjects())))
        index._oldIndex._db_close()

    @inlineCallbacks
    def test_calendarObjectWithName_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no calendar object names may start with
        ".".
        """
        name = ".foo.ics"
        self.home1._path.child(name).touch()
        self.assertEquals(
            (yield self.calendar1.calendarObjectWithName(name)),
            None)

    @featureUnimplemented
    @inlineCallbacks
    def test_calendarObjectWithUID_exists(self):
        """
        Find existing calendar object by name.
        """
        calendarObject = yield self.calendar1.calendarObjectWithUID("1")
        self.failUnless(
            isinstance(calendarObject, CalendarObject),
            calendarObject
        )
        self.assertEquals(
            calendarObject.component(),
            (yield self.calendar1.calendarObjectWithName("1.ics")).component()
        )

    def test_createCalendarObjectWithName_dot(self):
        """
        Filenames starting with "." are reserved by this
        implementation, so no calendar object names may start with
        ".".
        """
        self.assertRaises(
            ObjectResourceNameNotAllowedError,
            self.calendar1.createCalendarObjectWithName,
            ".foo", VComponent.fromString(test_event_text)
        )

    @featureUnimplemented
    @inlineCallbacks
    def test_createCalendarObjectWithName_uidconflict(self):
        """
        Attempt to create a calendar object with a conflicting UID
        should raise.
        """
        name = "foo.ics"
        assert (yield self.calendar1.calendarObjectWithName(name)) is None
        component = VComponent.fromString(event1modified_text)
        self.assertRaises(
            ObjectResourceUIDAlreadyExistsError,
            self.calendar1.createCalendarObjectWithName,
            name, component
        )

    @inlineCallbacks
    def test_CalendarObject_remove_delayedEffect(self):
        """
        Removing a calendar object should not immediately remove the underlying
        file; it should only be removed upon commit() of the transaction.
        """
        obj1 = self.calendar1.calendarObjectWithName("2.ics")
        obj1.remove()
        self.failUnless(self.calendar1._path.child("2.ics").exists())
        yield self.txn.commit()
        self.failIf(self.calendar1._path.child("2.ics").exists())

    counter = 0

    @inlineCallbacks
    def _refresh(self):
        """
        Re-read the (committed) home1 and calendar1 objects in a new
        transaction.
        """
        self.counter += 1
        self.txn = self.calendarStore.newTransaction(
            self.id() + " (old #" + str(self.counter) + ")"
        )
        self.home1 = yield self.txn.calendarHomeWithUID("home1")
        self.calendar1 = yield self.home1.calendarWithName("calendar_1")

    @inlineCallbacks
    def test_undoCreateCalendarObject(self):
        """
        If a calendar object is created as part of a transaction, it will be
        removed if that transaction has to be aborted.
        """
        # Make sure that the calendar home is actually committed; rolling back
        # calendar home creation will remove the whole directory.
        yield self.txn.commit()
        yield self._refresh()
        self.calendar1.createCalendarObjectWithName(
            "sample.ics",
            VComponent.fromString(test_event_text)
        )
        yield self.txn.abort()
        yield self._refresh()
        self.assertIdentical(
            (yield self.calendar1.calendarObjectWithName("sample.ics")),
            None
        )
        yield self.txn.commit()

    @inlineCallbacks
    def doThenUndo(self):
        """
        Commit the current transaction, but add an operation that will cause it
        to fail at the end.  Finally, refresh all attributes with a new
        transaction so that further operations can be performed in a valid
        context.
        """
        def fail():
            raise RuntimeError("oops")
        self.txn.addOperation(fail, "dummy failing operation")
        self.assertRaises(RuntimeError, self.txn.commit)
        yield self._refresh()

    @inlineCallbacks
    def test_undoModifyCalendarObject(self):
        """
        If an existing calendar object is modified as part of a transaction, it
        should be restored to its previous status if the transaction aborts.
        """
        originalComponent = yield self.calendar1.calendarObjectWithName(
            "1.ics").component()
        (yield self.calendar1.calendarObjectWithName("1.ics")).setComponent(
            VComponent.fromString(event1modified_text)
        )
        # Sanity check.
        self.assertEquals(
            (yield self.calendar1.calendarObjectWithName("1.ics")).component(),
            VComponent.fromString(event1modified_text)
        )
        index = self.calendar1._index
        yield self.doThenUndo()
        self.assertEquals(
            (yield self.calendar1.calendarObjectWithName("1.ics")).component(),
            originalComponent
        )
        index._oldIndex._db_close()

    @testUnimplemented
    def test_syncToken(self):
        """
        Sync token is correct.
        """
        raise NotImplementedError()

    @testUnimplemented
    def test_calendarObjectsInTimeRange(self):
        """
        Find calendar objects occuring in a given time range.
        """
        raise NotImplementedError()

    @testUnimplemented
    def test_calendarObjectsSinceToken(self):
        """
        Find calendar objects that have been modified since a given
        sync token.
        """
        raise NotImplementedError()

class CalendarObjectTest(unittest.TestCase):
    notifierFactory = None

    @inlineCallbacks
    def setUp(self):
        yield setUpCalendar1(self)
        self.object1 = yield self.calendar1.calendarObjectWithName("1.ics")

    @inlineCallbacks
    def tearDown(self):
        super(CalendarObjectTest, self).tearDown()
        try:
            yield self.txn.commit()
        except AlreadyFinishedError:
            pass

    def test_init(self):
        """
        L{CalendarObject} has instance attributes, C{_path} and C{_calendar},
        which refer to its position in the filesystem and the calendar in which
        it is contained, respectively.
        """
        self.failUnless(
            isinstance(self.object1._path, FilePath),
            self.object1._path
        )
        self.failUnless(
            isinstance(self.object1._calendar, Calendar),
            self.object1._calendar
        )

    def test_componentType(self):
        """
        Component type is correct.
        """
        self.assertEquals(self.object1.componentType(), "VEVENT")

class FileStorageTests(CommonTests, unittest.TestCase):
    """
    File storage tests.
    """

    calendarStore = None

    def storeUnderTest(self):
        """
        Create and return a L{CalendarStore} for testing.
        """
        if self.calendarStore is None:
            setUpCalendarStore(self)
        return self.calendarStore

    def test_shareWith(self):
        """
        Overridden to be skipped.
        """

    # TODO: ideally the file store would support all of this sharing stuff.
    test_shareWith.skip = "Not implemented for file store yet."
    test_shareAgainChangesMode = test_shareWith
    test_unshareWith = test_shareWith
    test_unshareWithInDifferentTransaction = test_shareWith
    test_sharingInvites = test_shareWith
    test_unshareSharerSide = test_shareWith
    test_unshareShareeSide = test_shareWith
    test_sharedNotifierID = test_shareWith

    def test_init(self):
        """
        L{CalendarStore} has a C{_path} attribute which refers to its
        constructor argument.
        """
        self.assertEquals(self.storeUnderTest()._path,
                          self.storeRootPath)

    @inlineCallbacks
    def test_calendarObjectsWithDotFile(self):
        """
        Adding a dotfile to the calendar home should not increase the number of
        calendar objects discovered.
        """
        (yield self.homeUnderTest())._path.child(".foo").createDirectory()
        yield self.test_calendarObjects()

    @inlineCallbacks
    def test_calendarObjectsWithDirectory(self):
        """
        If a directory appears (even a non-hidden one) within a calendar, it
        should not show up in the directory listing.
        """
        ((yield self.calendarUnderTest())._path.child("not-a-calendar-object")
         .createDirectory())
        yield self.test_calendarObjects()

    def test_simpleHomeSyncToken(self):
        """
        File store doesn't have a functioning C{resourceNamesSinceToken} for
        L{CalendarHome}.
        """

    test_simpleHomeSyncToken.skip = "Not in file store."

    def test_calendarObjectMetaData(self):
        pass
    test_calendarObjectMetaData.skip = "Example file data has no xattrs"

    def test_notificationSyncToken(self):
        """
        File store doesn't have a functioning C{resourceNamesSinceToken} for
        L{Notifications}.
        """

    test_notificationSyncToken.skip = "Not in file store."


text:
package net.fortuna.ical4j.model.property;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URISyntaxException;

import junit.framework.TestCase;
import net.fortuna.ical4j.data.CalendarBuilder;
import net.fortuna.ical4j.data.CalendarOutputter;
import net.fortuna.ical4j.data.ParserException;
import net.fortuna.ical4j.model.Calendar;
import net.fortuna.ical4j.model.Component;
import net.fortuna.ical4j.model.Date;
import net.fortuna.ical4j.model.ParameterList;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.ValidationException;
import net.fortuna.ical4j.model.component.VEvent;
import net.fortuna.ical4j.model.parameter.Encoding;
import net.fortuna.ical4j.model.parameter.Value;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * $Id: AttachTest.java,v 1.14 2010/03/06 12:57:23 fortuna Exp $
 *
 * Created on 7/04/2005
 *
 * @author Ben Fortuna
 *
 * Test case for Attach property.
 */
public class AttachTest extends TestCase {

    private static Log log = LogFactory.getLog(AttachTest.class);

    private Attach attach;

    /* (non-Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        FileInputStream fin = new FileInputStream("etc/artwork/logo.png");
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        for (int i = fin.read(); i >= 0;) {
            bout.write(i);
            i = fin.read();
        }

        ParameterList params = new ParameterList();
        params.add(Encoding.BASE64);
        params.add(Value.BINARY);

//        Attach attach = new Attach(params, Base64.encodeBytes(bout.toByteArray(), Base64.DONT_BREAK_LINES));
        attach = new Attach(params, bout.toByteArray());
    }

    /*
     * Class under test for void Attach(ParameterList, String)
     */
    public void testAttachParameterListString() throws IOException, URISyntaxException, ValidationException, ParserException {

        //log.info(attach);

        // create event start date..
        java.util.Calendar cal = java.util.Calendar.getInstance();
        cal.set(java.util.Calendar.MONTH, java.util.Calendar.DECEMBER);
        cal.set(java.util.Calendar.DAY_OF_MONTH, 25);

        DtStart start = new DtStart(new Date(cal.getTime().getTime()));
        start.getParameters().replace(Value.DATE);

        Summary summary = new Summary("Christmas Day; \n this is a, test\\");

        VEvent christmas = new VEvent();
        christmas.getProperties().add(start);
        christmas.getProperties().add(summary);
        christmas.getProperties().add(attach);
        christmas.getProperties().add(new Uid("000001@modularity.net.au"));

        Calendar calendar = new Calendar();
        calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN"));
        calendar.getProperties().add(Version.VERSION_2_0);
        calendar.getProperties().add(CalScale.GREGORIAN);
        calendar.getComponents().add(christmas);

        StringWriter sw = new StringWriter();
        CalendarOutputter out = new CalendarOutputter();
        out.output(calendar, sw);

        CalendarBuilder builder = new CalendarBuilder();
        Calendar cout = builder.build(new StringReader(sw.toString()));

        VEvent eout = (VEvent) cout.getComponent(Component.VEVENT);

        Attach aout = (Attach) eout.getProperty(Property.ATTACH);
        assertNotNull(aout);
        assertEquals(attach, aout);

        log.info(sw.toString());
    }

    /**
     * Unit testing of serialization.
     */
    public void testSerialization() throws IOException, ClassNotFoundException,
        URISyntaxException {

        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(bout);
        out.writeObject(attach);

        ObjectInputStream in = new ObjectInputStream(
                new ByteArrayInputStream(bout.toByteArray()));

        Attach clone = (Attach) in.readObject();

        assertNotNull(clone);
        assertEquals(attach, clone);

        // set a bogus value to trigger logging..
        clone.getParameters().replace(new Encoding("BOGUS"));
        clone.setValue("");
    }
}


text:
<?php

ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
ini_set('display_errors', 1);

define('INSTALL_PATH', realpath(__DIR__ . '/../').'/');
define('RCUBE_INSTALL_PATH', INSTALL_PATH);
define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/');

$include_path  = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
$include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
$include_path .= ini_get('include_path');

set_include_path($include_path);

// include composer autoloader (if available)
if (@file_exists(INSTALL_PATH . 'vendor/autoload.php')) {
    require INSTALL_PATH . 'vendor/autoload.php';
}

require_once 'Roundcube/bootstrap.php';
// deprecated aliases (to be removed)
require_once 'bc.php';

if (function_exists('session_start'))
  session_start();

$RCI = rcmail_install::get_instance();
$RCI->load_config();

if (isset($_GET['_getconfig'])) {
  $filename = 'config.inc.php';
  if (!empty($_SESSION['config'])) {
    header('Content-type: text/plain');
    header('Content-Disposition: attachment; filename="'.$filename.'"');
    echo $_SESSION['config'];
    exit;
  }
  else {
    header('HTTP/1.0 404 Not found');
    die("The requested configuration was not found. Please run the installer from the beginning.");
  }
}

if ($RCI->configured && ($RCI->getprop('enable_installer') || $_SESSION['allowinstaller']) &&
    !empty($_GET['_mergeconfig'])) {
  $filename = 'config.inc.php';

  header('Content-type: text/plain');
  header('Content-Disposition: attachment; filename="'.$filename.'"');

  $RCI->merge_config();
  echo $RCI->create_config();
  exit;
}

// go to 'check env' step if we have a local configuration
if ($RCI->configured && empty($_REQUEST['_step'])) {
  header("Location: ./?_step=1");
  exit;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Roundcube Webmail Installer</title>
<meta name="Robots" content="noindex,nofollow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="styles.css" />

  How-to Wiki

<?php

  // exit if installation is complete
  if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
    // header("HTTP/1.0 404 Not Found");
    if ($RCI->configured && $RCI->legacy_config) {
      echo '
Your configuration needs to be migrated!
';
      echo '
We changed the configuration files structure and your installation needs to be updated accordingly.
';
      echo '
Please run the <tt>bin/update.sh</tt> script from the command line or set
  <tt>$rcube_config[\'enable_installer\'] = true;</tt>
';
      echo ' in your RCUBE_CONFIG_DIR/main.inc.php to let the installer help you migrating it.
';
    }
    else {
      echo '
The installer is disabled!
';
      echo '
To enable it again, set <tt>$config[\'enable_installer\'] = true;</tt> in RCUBE_CONFIG_DIR/config.inc.php
';
    }
    echo '
';
    exit;
  }

?>

Roundcube Webmail Installer

<?php
  $include_steps = array(
    1 => './check.php',
    2 => './config.php',
    3 => './test.php',
  );

  if (!in_array($RCI->step, array_keys($include_steps))) {
    $RCI->step = 1;
  }

  foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) {
    $j = $i + 1;
    $link = ($RCI->step >= $j || $RCI->configured) ? '' . Q($item) . '' : Q($item);
    printf('
%s
', $j+1, $RCI->step > $j ? ' passed' : ($RCI->step == $j ? ' current' : ''), $link);
  }
?>

<?php

include $include_steps[$RCI->step];

?>

  Installer by the Roundcube Dev Team. Copyright © 2008-2012 – Published under the GNU Public License;
  Icons by famfamfam


text:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:4.0.30319.42000
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On

Namespace My

    <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _
     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0"),  _
     Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _
    Partial Friend NotInheritable Class MySettings
        Inherits Global.System.Configuration.ApplicationSettingsBase

        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)

#Region "My.Settings Auto-Save Functionality"
#If _MyType = "WindowsForms" Then
    Private Shared addedHandler As Boolean

    Private Shared addedHandlerLockObject As New Object

    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
    Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
        If My.Application.SaveMySettingsOnExit Then
            My.Settings.Save()
        End If
    End Sub
#End If
#End Region

        Public Shared ReadOnly Property [Default]() As MySettings
            Get

#If _MyType = "WindowsForms" Then
               If Not addedHandler Then
                    SyncLock addedHandlerLockObject
                        If Not addedHandler Then
                            AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
                            addedHandler = True
                        End If
                    End SyncLock
                End If
#End If
                Return defaultInstance
            End Get
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Property SourceList() As String()
            Get
                Return CType(Me("SourceList"),String())
            End Get
            Set
                Me("SourceList") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("")>  _
        Public Property Logs() As String
            Get
                Return CType(Me("Logs"),String)
            End Get
            Set
                Me("Logs") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Property WhiteList() As String()
            Get
                Return CType(Me("WhiteList"),String())
            End Get
            Set
                Me("WhiteList") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Property BlackList() As String()
            Get
                Return CType(Me("BlackList"),String())
            End Get
            Set
                Me("BlackList") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("")>  _
        Public Property HostPreview() As String
            Get
                Return CType(Me("HostPreview"),String)
            End Get
            Set
                Me("HostPreview") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("")>  _
        Public Property GeneratedStatus() As String
            Get
                Return CType(Me("GeneratedStatus"),String)
            End Get
            Set
                Me("GeneratedStatus") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("0.0.0.0")>  _
        Public Property CustomIP() As String
            Get
                Return CType(Me("CustomIP"),String)
            End Get
            Set
                Me("CustomIP") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chClearLogOnExit() As Boolean
            Get
                Return CType(Me("chClearLogOnExit"),Boolean)
            End Get
            Set
                Me("chClearLogOnExit") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chClearOutputOnExit() As Boolean
            Get
                Return CType(Me("chClearOutputOnExit"),Boolean)
            End Get
            Set
                Me("chClearOutputOnExit") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chSort() As Boolean
            Get
                Return CType(Me("chSort"),Boolean)
            End Get
            Set
                Me("chSort") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
        Public Property chUpAll() As Boolean
            Get
                Return CType(Me("chUpAll"),Boolean)
            End Get
            Set
                Me("chUpAll") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
        Public Property chFlushDNS() As Boolean
            Get
                Return CType(Me("chFlushDNS"),Boolean)
            End Get
            Set
                Me("chFlushDNS") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chDisAutoBack() As Boolean
            Get
                Return CType(Me("chDisAutoBack"),Boolean)
            End Get
            Set
                Me("chDisAutoBack") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chAutoUpActive() As Boolean
            Get
                Return CType(Me("chAutoUpActive"),Boolean)
            End Get
            Set
                Me("chAutoUpActive") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
        Public Property chDiff() As Boolean
            Get
                Return CType(Me("chDiff"),Boolean)
            End Get
            Set
                Me("chDiff") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("")>  _
        Public Property Loopbacks() As String
            Get
                Return CType(Me("Loopbacks"),String)
            End Get
            Set
                Me("Loopbacks") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chUseTab() As Boolean
            Get
                Return CType(Me("chUseTab"),Boolean)
            End Get
            Set
                Me("chUseTab") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
        Public Property chRemWhites() As Boolean
            Get
                Return CType(Me("chRemWhites"),Boolean)
            End Get
            Set
                Me("chRemWhites") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("True")>  _
        Public Property chActAutoBack() As Boolean
            Get
                Return CType(Me("chActAutoBack"),Boolean)
            End Get
            Set
                Me("chActAutoBack") = value
            End Set
        End Property

        <Global.System.Configuration.UserScopedSettingAttribute(),  _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         Global.System.Configuration.DefaultSettingValueAttribute("False")>  _
        Public Property chPing() As Boolean
            Get
                Return CType(Me("chPing"),Boolean)
            End Get
            Set
                Me("chPing") = value
            End Set
        End Property
    End Class
End Namespace

Namespace My

    <Global.Microsoft.VisualBasic.HideModuleNameAttribute(),  _
     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()>  _
    Friend Module MySettingsProperty

        <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")>  _
        Friend ReadOnly Property Settings() As Global.HostsX.My.MySettings
            Get
                Return Global.HostsX.My.MySettings.Default
            End Get
        End Property
    End Module
End Namespace


text:
using System;
using Xamarin.Forms;

namespace RenderersEServices
{
	public class CustomNavigationPage : NavigationPage
	{
		public string ImageName {
			get;
			set;
		}

		public CustomNavigationPage (string imageName) : base(){
			ImageName = imageName;
		}

		public CustomNavigationPage(Page root, string imageName) : base(root){
			ImageName = imageName;
		}
	}
}


text:
<!DOCTYPE html>

<title>Índice de classes</title>

Índice de classes

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

A

QAbstractAnimation

QAbstractButton

QAbstractEventDispatcher

QAbstractExtensionFactory

QAbstractExtensionManager

QAbstractFileEngine

QAbstractFileEngineHandler

QAbstractFileEngineIterator

QAbstractFontEngine

QAbstractFormBuilder

QAbstractGraphicsShapeItem

QAbstractItemDelegate

QAbstractItemModel

QAbstractItemView

QAbstractListModel

QAbstractMessageHandler

QAbstractNetworkCache

QAbstractPrintDialog

QAbstractProxyModel

QAbstractScrollArea

QAbstractSlider

QAbstractSocket

QAbstractSpinBox

QAbstractState

QAbstractTableModel

QAbstractTextDocumentLayout

QAbstractTransition

QAbstractUriResolver

QAbstractVideoBuffer

QAbstractVideoSurface

QAbstractXmlNodeModel

QAbstractXmlReceiver

QAccessible

QAccessibleBridge

QAccessibleBridgePlugin

QAccessibleEvent

QAccessibleInterface

QAccessibleObject

QAccessiblePlugin

QAccessibleWidget

QAction

QActionEvent

QActionGroup

QAnimationGroup

QApplication

QAtomicInt

QAudioDeviceInfo

QAudioFormat

QAudioInput

QAudioOutput

QAuthenticator

QAxBase

QAxBindable

QAxFactory

QAxObject

QAxScript

QAxScriptEngine

QAxScriptManager

QAxWidget

voltar ao topo

B

QBasicAtomicInt

QBasicTimer

QBitArray

QBitmap

QBoxLayout

QBrush

QBuffer

QButtonGroup

QByteArray

QByteArrayMatcher

voltar ao topo

C

QCalendarWidget

QCDEStyle

QChar

QCheckBox

QChildEvent

QCleanlooksStyle

QClipboard

QClipboardEvent

QCloseEvent

QColor

QColorDialog

QColormap

QColumnView

QComboBox

QCommandLinkButton

QCommonStyle

QCompleter

QConicalGradient

QContextMenuEvent

QCoreApplication

QCryptographicHash

QCursor

voltar ao topo

D

QDataStream

QDataWidgetMapper

QDate

QDateEdit

QDateTime

QDateTimeEdit

QDebug

QDeclarativeComponent

QDeclarativeContext

QDeclarativeEngine

QDeclarativeError

QDeclarativeExpression

QDeclarativeExtensionPlugin

QDeclarativeImageProvider

QDeclarativeItem

QDeclarativeListReference

QDeclarativeNetworkAccessManagerFactory

QDeclarativeParserStatus

QDeclarativeProperty

QDeclarativePropertyMap

QDeclarativePropertyValueSource

QDeclarativeScriptString

QDeclarativeView

QDecoration

QDecorationDefault

QDecorationFactory

QDecorationPlugin

QDesignerActionEditorInterface

QDesignerContainerExtension

QDesignerCustomWidgetCollectionInterface

QDesignerCustomWidgetInterface

QDesignerDynamicPropertySheetExtension

QDesignerFormEditorInterface

QDesignerFormWindowCursorInterface

QDesignerFormWindowInterface

QDesignerFormWindowManagerInterface

QDesignerMemberSheetExtension

QDesignerObjectInspectorInterface

QDesignerPropertyEditorInterface

QDesignerPropertySheetExtension

QDesignerTaskMenuExtension

QDesignerWidgetBoxInterface

QDesktopServices

QDesktopWidget

QDial

QDialog

QDialogButtonBox

QDir

QDirectPainter

QDirIterator

QDockWidget

QDomAttr

QDomCDATASection

QDomCharacterData

QDomComment

QDomDocument

QDomDocumentFragment

QDomDocumentType

QDomElement

QDomEntity

QDomEntityReference

QDomImplementation

QDomNamedNodeMap

QDomNode

QDomNodeList

QDomNotation

QDomProcessingInstruction

QDomText

QDoubleSpinBox

QDoubleValidator

QDrag

QDragEnterEvent

QDragLeaveEvent

QDragMoveEvent

QDropEvent

QDynamicPropertyChangeEvent

voltar ao topo

E

QEasingCurve

QElapsedTimer

QErrorMessage

QEvent

QEventLoop

QEventTransition

QExtensionFactory

QExtensionManager

voltar ao topo

F

QFile

QFileDialog

QFileIconProvider

QFileInfo

QFileOpenEvent

QFileSystemModel

QFileSystemWatcher

QFinalState

QFocusEvent

QFocusFrame

QFont

QFontComboBox

QFontDatabase

QFontDialog

QFontEngineInfo

QFontEnginePlugin

QFontInfo

QFontMetrics

QFontMetricsF

QFormBuilder

QFormLayout

QFrame

QFSFileEngine

QFtp

QFutureInterfaceBase

QFutureWatcherBase

voltar ao topo

G

QGenericPlugin

QGenericPluginFactory

QGesture

QGestureEvent

QGestureRecognizer

QGLBuffer

QGLColormap

QGLContext

QGLFormat

QGLFramebufferObject

QGLFramebufferObjectFormat

QGLFunctions

QGLPixelBuffer

QGLShader

QGLShaderProgram

QGLWidget

QGlyphRun

QGradient

QGraphicsAnchor

QGraphicsAnchorLayout

QGraphicsBlurEffect

QGraphicsColorizeEffect

QGraphicsDropShadowEffect

QGraphicsEffect

QGraphicsEllipseItem

QGraphicsGridLayout

QGraphicsItem

QGraphicsItemAnimation

QGraphicsItemGroup

QGraphicsLayout

QGraphicsLayoutItem

QGraphicsLinearLayout

QGraphicsLineItem

QGraphicsObject

QGraphicsOpacityEffect

QGraphicsPathItem

QGraphicsPixmapItem

QGraphicsPolygonItem

QGraphicsProxyWidget

QGraphicsRectItem

QGraphicsRotation

QGraphicsScale

QGraphicsScene

QGraphicsSceneContextMenuEvent

QGraphicsSceneDragDropEvent

QGraphicsSceneEvent

QGraphicsSceneHelpEvent

QGraphicsSceneHoverEvent

QGraphicsSceneMouseEvent

QGraphicsSceneMoveEvent

QGraphicsSceneResizeEvent

QGraphicsSceneWheelEvent

QGraphicsSimpleTextItem

QGraphicsSvgItem

QGraphicsTextItem

QGraphicsTransform

QGraphicsView

QGraphicsWebView

QGraphicsWidget

QGridLayout

QGroupBox

voltar ao topo

H

QHBoxLayout

QHeaderView

QHelpContentItem

QHelpContentModel

QHelpContentWidget

QHelpEngine

QHelpEngineCore

QHelpEvent

QHelpIndexModel

QHelpIndexWidget

QHelpSearchEngine

QHelpSearchQuery

QHelpSearchQueryWidget

QHelpSearchResultWidget

QHideEvent

QHistoryState

QHostAddress

QHostInfo

QHoverEvent

QHttpMultiPart

QHttpPart

voltar ao topo

I

QIcon

QIconDragEvent

QIconEngine

QIconEnginePlugin

QIconEnginePluginV2

QIconEngineV2

QIdentityProxyModel

QImage

QImageIOHandler

QImageIOPlugin

QImageReader

QImageWriter

QInputContext

QInputContextFactory

QInputContextPlugin

QInputDialog

QInputEvent

QInputMethodEvent

QIntValidator

QIODevice

QItemDelegate

QItemEditorCreator

QItemEditorCreatorBase

QItemEditorFactory

QItemSelection

QItemSelectionModel

QItemSelectionRange

voltar ao topo

K

QKeyEvent

QKeyEventTransition

QKeySequence

voltar ao topo

L

QLabel

QLayout

QLayoutItem

QLCDNumber

QLibrary

QLibraryInfo

QLine

QLinearGradient

QLineEdit

QLineF

QListView

QListWidget

QListWidgetItem

QLocale

QLocalServer

QLocalSocket

voltar ao topo

M

QMainWindow

QMargins

QMatrix4x4

QMdiArea

QMdiSubWindow

QMenu

QMenuBar

QMessageBox

QMetaClassInfo

QMetaEnum

QMetaMethod

QMetaObject

QMetaProperty

QMetaType

QMimeData

QMimeSource

QModelIndex

QMotifStyle

QMouseEvent

QMouseEventTransition

QMoveEvent

QMovie

QMutex

QMutexLocker

voltar ao topo

N

QNetworkAccessManager

QNetworkAddressEntry

QNetworkCacheMetaData

QNetworkConfiguration

QNetworkConfigurationManager

QNetworkCookie

QNetworkCookieJar

QNetworkDiskCache

QNetworkInterface

QNetworkProxy

QNetworkProxyFactory

QNetworkProxyQuery

QNetworkReply

QNetworkRequest

QNetworkSession

voltar ao topo

O

QObject

QObjectCleanupHandler

voltar ao topo

P

QPageSetupDialog

QPaintDevice

QPaintEngine

QPaintEngineState

QPainter

QPainterPath

QPainterPathStroker

QPaintEvent

QPalette

QParallelAnimationGroup

QPauseAnimation

QPen

QPicture

QPixmap

QPlainTextDocumentLayout

QPlainTextEdit

QPlatformCursorImage

QPlatformFontDatabase

QPlatformWindowFormat

QPluginLoader

QPoint

QPointF

QPolygon

QPolygonF

QPrintDialog

QPrintEngine

QPrinter

QPrinterInfo

QPrintPreviewDialog

QPrintPreviewWidget

QProcess

QProcessEnvironment

QProgressBar

QProgressDialog

QPropertyAnimation

QPushButton

voltar ao topo

R

QRadialGradient

QRadioButton

QRawFont

QReadLocker

QReadWriteLock

QRect

QRectF

QRegExp

QRegExpValidator

QRegion

QResizeEvent

QResource

QRubberBand

QRunnable

voltar ao topo

S

QScriptable

QScriptClass

QScriptClassPropertyIterator

QScriptContext

QScriptContextInfo

QScriptEngine

QScriptEngineAgent

QScriptEngineDebugger

QScriptExtensionPlugin

QScriptProgram

QScriptString

QScriptSyntaxCheckResult

QScriptValue

QScriptValueIterator

QScrollArea

QScrollBar

QSemaphore

QSequentialAnimationGroup

QSessionManager

QSettings

QSharedData

QSharedMemory

QShortcut

QShortcutEvent

QShowEvent

QSignalMapper

QSignalTransition

QSimpleXmlNodeModel

QSize

QSizeF

QSizeGrip

QSizePolicy

QSlider

QSocketNotifier

QSortFilterProxyModel

QSound

QSourceLocation

QSpacerItem

QSpinBox

QSplashScreen

QSplitter

QSplitterHandle

QSqlDatabase

QSqlDriver

QSqlDriverCreator

QSqlDriverCreatorBase

QSqlDriverPlugin

QSqlError

QSqlField

QSqlIndex

QSqlQuery

QSqlQueryModel

QSqlRecord

QSqlRelation

QSqlRelationalDelegate

QSqlRelationalTableModel

QSqlResult

QSqlTableModel

QSslCertificate

QSslCipher

QSslConfiguration

QSslError

QSslKey

QSslSocket

QStackedLayout

QStackedWidget

QStandardItem

QStandardItemModel

QState

QStateMachine

QStaticText

QStatusBar

QStatusTipEvent

QStringListModel

QStringMatcher

QStyle

QStyledItemDelegate

QStyleHintReturn

QStyleHintReturnMask

QStyleHintReturnVariant

QSupportedWritingSystems

QSvgGenerator

QSvgRenderer

QSvgWidget

QSwipeGesture

QSyntaxHighlighter

QSysInfo

QSystemLocale

QSystemSemaphore

QSystemTrayIcon

voltar ao topo

T

QTabBar

QTabletEvent

QTableView

QTableWidget

QTableWidgetItem

QTableWidgetSelectionRange

QTabWidget

QTapAndHoldGesture

QTapGesture

QTcpServer

QTcpSocket

QTemporaryFile

QTestEventList

QTextBlock

QTextBlockFormat

QTextBlockGroup

QTextBlockUserData

QTextBoundaryFinder

QTextBrowser

QTextCharFormat

QTextCodec

QTextCursor

QTextDecoder

QTextDocument

QTextDocumentFragment

QTextDocumentWriter

QTextEdit

QTextEncoder

QTextFormat

QTextFragment

QTextFrame

QTextFrameFormat

QTextImageFormat

QTextInlineObject

QTextItem

QTextLayout

QTextLength

QTextLine

QTextList

QTextListFormat

QTextObject

QTextObjectInterface

QTextOption

QTextStream

QTextTable

QTextTableCell

QTextTableCellFormat

QTextTableFormat

QThread

QThreadPool

QTime

QTimeEdit

QTimeLine

QTimer

QTimerEvent

QToolBar

QToolBarChangeEvent

QToolBox

QToolButton

QTouchEvent

QTransform

QTranslator

QTreeView

QTreeWidget

QTreeWidgetItem

QTreeWidgetItemIterator

voltar ao topo

U

QUdpSocket

QUiLoader

QUndoCommand

QUndoGroup

QUndoStack

QUndoView

QUrl

QUrlInfo

QUuid

voltar ao topo

V

QValidator

QVariant

QVariantAnimation

QVBoxLayout

QVector2D

QVector3D

QVector4D

QVideoFrame

QVideoSurfaceFormat

voltar ao topo

W

QWaitCondition

QWebDatabase

QWebElement

QWebElementCollection

QWebFrame

QWebHistory

QWebHistoryInterface

QWebHistoryItem

QWebHitTestResult

QWebInspector

QWebPage

QWebPluginFactory

QWebSecurityOrigin

QWebSettings

QWebView

QWhatsThis

QWhatsThisClickedEvent

QWheelEvent

QWidget

QWidgetAction

QWidgetItem

QWindowsMime

QWindowsStyle

QWindowStateChangeEvent

QWindowsVistaStyle

QWindowsXPStyle

QWizard

QWizardPage

QWorkspace

QWriteLocker

voltar ao topo

X

QXmlAttributes

QXmlContentHandler

QXmlDeclHandler

QXmlDefaultHandler

QXmlDTDHandler

QXmlEntityResolver

QXmlErrorHandler

QXmlFormatter

QXmlInputSource

QXmlItem

QXmlLexicalHandler

QXmlLocator

QXmlName

QXmlNamePool

QXmlNamespaceSupport

QXmlNodeModelIndex

QXmlParseException

QXmlQuery

QXmlReader

QXmlResultItems

QXmlSchema

QXmlSchemaValidator

QXmlSerializer

QXmlSimpleReader

QXmlStreamAttribute

QXmlStreamAttributes

QXmlStreamEntityDeclaration

QXmlStreamEntityResolver

QXmlStreamNamespaceDeclaration

QXmlStreamNotationDeclaration

QXmlStreamReader

QXmlStreamWriter


text:
module GlobalSession
  # Rails integration for GlobalSession.
  #
  # The configuration file for Rails apps is located in +config/global_session.yml+ and a generator
  # (global_session_config) is available for creating a sensible default.
  #
  # There is also a generator (global_session_authority) for creating authority keypairs.
  #
  # The main integration touchpoint for Rails is the module ActionControllerInstanceMethods,
  # which gets mixed into ActionController::Base. This is where all of the magic happens..
  #
  module Rails
    # Module that is mixed into ActionController-derived classes when the class method
    # +has_global_session+ is called.
    #
    module ActionControllerInstanceMethods
      def self.included(base) # :nodoc:
        #Make sure a superclass hasn't already chained the methods...
        unless base.instance_methods.include?("log_processing_without_global_session")
          base.alias_method_chain :log_processing, :global_session
        end

        base.before_filter :global_session_initialize
      end

      # Shortcut accessor for global session configuration object.
      #
      # === Return
      # config(GlobalSession::Configuration)
      def global_session_config
        request.env['global_session.config']
      end

      def global_session_options
        self.class.global_session_options
      end

      # Global session reader.
      #
      # === Return
      # session(Session):: the global session associated with the current request, nil if none
      def global_session
        @global_session
      end

      # Filter to initialize the global session.
      #
      # === Return
      # true:: Always returns true
      def global_session_initialize
        options = global_session_options

        if options[:only] && !options[:only].include?(action_name)
          should_skip = true
        elsif options[:except] && options[:except].include?(action_name)
          should_skip = true
        elsif !options[:enabled]
          should_skip = true
        end

        if should_skip
          request.env['global_session.req.renew'] = false
          request.env['global_session.req.update'] = false
        else
          error = request.env['global_session.error']
          raise error unless error.nil? || options[:raise] == false
          @global_session = request.env['global_session']
        end

        return true
      end

      # Filter to disable auto-renewal of the session.
      #
      # === Return
      # true:: Always returns true
      def global_session_skip_renew
        request.env['global_session.req.renew'] = false
        true
      end

      # Filter to disable updating of the session cookie
      #
      # === Return
      # true:: Always returns true
      def global_session_skip_update
        request.env['global_session.req.update'] = false
        true
      end

      # Override for the ActionController method of the same name that logs
      # information about the request. Our version logs the global session ID
      # instead of the local session ID.
      #
      # === Parameters
      # name(Type):: Description
      #
      # === Return
      # name(Type):: Description
      def log_processing_with_global_session
        return unless logger && logger.info?

        gs = request.env['global_session']

        if gs && gs.id
          session_data = {}
          gs.each_pair { |key, value| session_data[key] = value }

          session_id = gs.id + " (#{session[:session_id] || request.session_options[:id]})"
        elsif session[:session_id]
          session_id = session[:session_id]
        elsif request.session_options[:id]
          session_id = request.session_options[:id]
        end

        request_id = "\n\nProcessing #{self.class.name}\##{action_name} "
        request_id << "to #{params[:format]} " if params[:format]
        request_id << "(for #{request_origin.split[0]}) [#{request.method.to_s.upcase}]"
        request_id << "\n  Session ID: #{session_id}" if session_id
        request_id << "\n  Session Data: #{session_data.inspect}" if session_data

        logger.info(request_id)

        parameters = respond_to?(:filter_parameters, true) ? filter_parameters(params) : params.dup
        parameters = parameters.except!(:controller, :action, :format, :_method)

        logger.info "  Parameters: #{parameters.inspect}" unless parameters.empty?
      end
    end
  end
end


text: if youre really reading this shit, go get a life


text:
package net.prasenjit.identity;

import com.nimbusds.jose.*;
import com.nimbusds.jose.crypto.*;
import com.nimbusds.jose.crypto.bc.BouncyCastleProviderSingleton;
import com.nimbusds.jose.jca.JCASupport;
import com.nimbusds.jose.jwk.source.ImmutableSecret;
import com.nimbusds.jose.jwk.source.JWKSource;
import com.nimbusds.jose.proc.JWSKeySelector;
import com.nimbusds.jose.proc.JWSVerificationKeySelector;
import com.nimbusds.jose.proc.SecurityContext;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.SignedJWT;
import com.nimbusds.jwt.proc.BadJWTException;
import com.nimbusds.jwt.proc.ConfigurableJWTProcessor;
import com.nimbusds.jwt.proc.DefaultJWTClaimsVerifier;
import com.nimbusds.jwt.proc.DefaultJWTProcessor;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.junit.Test;

import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.security.interfaces.RSAPublicKey;
import java.text.ParseException;
import java.util.Date;

import static org.junit.Assert.assertEquals;

public class JwtTest {

    @Test
    public void testJwt() throws NoSuchAlgorithmException, JOSEException, ParseException {

        BouncyCastleProvider bc = BouncyCastleProviderSingleton.getInstance();
        Security.addProvider(bc);

        System.out.println(JCASupport.isSupported(EncryptionMethod.A256CBC_HS512));

        KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
        generator.initialize(2048);
        KeyPair keyPair = generator.generateKeyPair();

        JWTClaimsSet claimsSet = new JWTClaimsSet.Builder().issuer("ccs")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .claim("key", "value")
                .audience("ccs")
                .build();

        RSASSASigner rsassaSigner = new RSASSASigner(keyPair.getPrivate());

        JWSHeader header = new JWSHeader(JWSAlgorithm.RS256);
        SignedJWT signedJWT = new SignedJWT(header, claimsSet);

        signedJWT.sign(rsassaSigner);

        String token = signedJWT.serialize();
        System.out.println(token);
        System.out.println(token.length());

        JWEHeader jweHeader = new JWEHeader.Builder(JWEAlgorithm.RSA_OAEP_256, EncryptionMethod.A128CBC_HS256)
                .contentType("JWT")
                .build();
        JWEObject jweObject = new JWEObject(jweHeader, new Payload(token));
        JWEEncrypter rsaEncryptor = new RSAEncrypter((RSAPublicKey) keyPair.getPublic());
        jweObject.encrypt(rsaEncryptor);

        System.out.println(jweObject.serialize());
        System.out.println(jweObject.serialize().length());

        jweObject = JWEObject.parse(jweObject.serialize());
        JWEDecrypter rsaDecryptor = new RSADecrypter(keyPair.getPrivate());
        jweObject.decrypt(rsaDecryptor);

        signedJWT = jweObject.getPayload().toSignedJWT();

        RSASSAVerifier rsassaVerifier = new RSASSAVerifier((RSAPublicKey) keyPair.getPublic());
        signedJWT.verify(rsassaVerifier);

        assertEquals("ccs", signedJWT.getJWTClaimsSet().getIssuer());
    }

    @Test
    public void testJWTValidation() throws Exception {
        KeyGenerator generator = KeyGenerator.getInstance("AES");
        generator.init(256);
        SecretKey secretKey = generator.generateKey();

        JWTClaimsSet claimsSet = new JWTClaimsSet.Builder().issuer("ccs")
                .expirationTime(new Date(System.currentTimeMillis()))
                .build();

        JWSHeader header = new JWSHeader.Builder(JWSAlgorithm.HS256).build();
        SignedJWT jwt = new SignedJWT(header, claimsSet);

        MACSigner signer = new MACSigner(secretKey);

        jwt.sign(signer);

        ConfigurableJWTProcessor<SecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
        JWKSource<SecurityContext> source = new ImmutableSecret<>(secretKey);
        JWSKeySelector<SecurityContext> keySelector = new JWSVerificationKeySelector<>(JWSAlgorithm.HS256, source);
        jwtProcessor.setJWSKeySelector(keySelector);

        jwtProcessor.setJWTClaimsSetVerifier(new DefaultJWTClaimsVerifier<SecurityContext>() {
            @Override
            public void verify(JWTClaimsSet claimsSet, SecurityContext context) throws BadJWTException {
                super.verify(claimsSet, context);

                if (!"ccs".equals(claimsSet.getIssuer())) {
                    throw new BadJWTException("Invalid issuer");
                }
            }
        });

        JWTClaimsSet receivedClaim = jwtProcessor.process(jwt.serialize(), null);
        System.out.println(receivedClaim.toJSONObject());
    }
}