text:
from __future__ import unicode_literals

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

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='LevelDua',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelDua_kode', models.CharField(max_length=2, verbose_name='Kode lvl 2')),
                ('LevelDua_nama', models.TextField(verbose_name='Nama lvl 2')),
            ],
        ),
        migrations.CreateModel(
            name='LevelEmpat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelEmpat_kode', models.CharField(max_length=5, verbose_name='Kode lvl 4')),
                ('LevelEmpat_nama', models.TextField(verbose_name='Nama lvl 4')),
                ('LevelEmpat_hasil', models.CharField(blank=True, max_length=150, verbose_name='Satuan hasil')),
                ('LevelEmpat_angka', models.FloatField(blank=True, verbose_name='Angka kredit')),
                ('LevelEmpat_pelaksana', models.CharField(choices=[('0', 'Semua Jenjang'), ('1', 'Perekayasa Pertama'), ('2', 'Perekayasa Muda'), ('3', 'Perekayasa Madya'), ('4', 'Perekayasa Utama'), ('', '')], default='', max_length=2, verbose_name='Pelaksana')),
            ],
        ),
        migrations.CreateModel(
            name='LevelEnam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelEnam_kode', models.CharField(max_length=5, verbose_name='Kode lvl 6')),
                ('LevelEnam_nama', models.TextField(verbose_name='Nama lvl 6')),
                ('LevelEnam_hasil', models.CharField(blank=True, max_length=150, verbose_name='Satuan hasil')),
                ('LevelEnam_angka', models.FloatField(blank=True, verbose_name='Angka kredit')),
                ('LevelEnam_pelaksana', models.CharField(choices=[('0', 'Semua Jenjang'), ('1', 'Perekayasa Pertama'), ('2', 'Perekayasa Muda'), ('3', 'Perekayasa Madya'), ('4', 'Perekayasa Utama'), ('', '')], default='', max_length=2, verbose_name='Pelaksana')),
            ],
        ),
        migrations.CreateModel(
            name='LevelLima',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelLima_kode', models.CharField(max_length=5, verbose_name='Kode lvl 5')),
                ('LevelLima_nama', models.TextField(verbose_name='Nama lvl 5')),
                ('LevelLima_hasil', models.CharField(blank=True, max_length=150, verbose_name='Satuan hasil')),
                ('LevelLima_angka', models.FloatField(blank=True, verbose_name='Angka kredit')),
                ('LevelLima_pelaksana', models.CharField(choices=[('0', 'Semua Jenjang'), ('1', 'Perekayasa Pertama'), ('2', 'Perekayasa Muda'), ('3', 'Perekayasa Madya'), ('4', 'Perekayasa Utama'), ('', '')], default='', max_length=2, verbose_name='Pelaksana')),
                ('LevelLima_link', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='perek_tugas.LevelEmpat', verbose_name='Kategori lvl 4')),
            ],
        ),
        migrations.CreateModel(
            name='LevelSatu',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelSatu_kode', models.CharField(max_length=5, verbose_name='Kode lvl 1')),
                ('LevelSatu_nama', models.CharField(max_length=100, verbose_name='Nama lvl 1')),
            ],
        ),
        migrations.CreateModel(
            name='LevelTiga',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('LevelTiga_kode', models.CharField(max_length=5, verbose_name='Kode lvl 3')),
                ('LevelTiga_nama', models.TextField(verbose_name='Nama lvl 3')),
                ('LevelTiga_hasil', models.CharField(blank=True, max_length=150, verbose_name='Satuan hasil')),
                ('LevelTiga_angka', models.FloatField(blank=True, verbose_name='Angka kredit')),
                ('LevelTiga_pelaksana', models.CharField(choices=[('0', 'Semua Jenjang'), ('1', 'Perekayasa Pertama'), ('2', 'Perekayasa Muda'), ('3', 'Perekayasa Madya'), ('4', 'Perekayasa Utama'), ('', '')], default='', max_length=2, verbose_name='Pelaksana')),
                ('LevelTiga_link', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='perek_tugas.LevelDua', verbose_name='Kategori lvl 2')),
            ],
        ),
        migrations.AddField(
            model_name='levelenam',
            name='LevelEnam_link',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='perek_tugas.LevelLima', verbose_name='Kategori lvl 5'),
        ),
        migrations.AddField(
            model_name='levelempat',
            name='LevelEmpat_link',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='perek_tugas.LevelTiga', verbose_name='Kategori lvl 3'),
        ),
        migrations.AddField(
            model_name='leveldua',
            name='LevelDua_link',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='perek_tugas.LevelSatu', verbose_name='Kategori lvl 1'),
        ),
    ]


text:
package foundation.softwaredesign.orbi.model.game.character;

import foundation.softwaredesign.orbi.model.game.gameobject.GameObjectTypeCategory;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Lucas Reeh <lr86gm@gmail.com>
 */
@XmlRootElement
public class Inventory {

    private List<InventoryItem> items = new ArrayList<>();
    private List<GameObjectTypeCategory> categories = new ArrayList<>();
    private Boolean newItemDiscovered = false;

    public List<InventoryItem> getItems() {
        return items;
    }

    public void setItems(List<InventoryItem> items) {
        this.items = items;
    }

    public List<GameObjectTypeCategory> getCategories() {
        return categories;
    }

    public void setCategories(List<GameObjectTypeCategory> categories) {
        this.categories = categories;
    }

    public Boolean getNewItemDiscovered() {
        return newItemDiscovered;
    }

    public void setNewItemDiscovered(Boolean newItemDiscovered) {
        this.newItemDiscovered = newItemDiscovered;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.zookeeper.server.quorum;

import java.io.File;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

import org.apache.zookeeper.PortAssignment;
import org.apache.zookeeper.ZKTestCase;
import org.apache.zookeeper.server.quorum.FastLeaderElection.Notification;
import org.apache.zookeeper.server.quorum.FastLeaderElection.ToSend;
import org.apache.zookeeper.server.quorum.FastLeaderElection.Messenger.WorkerReceiver;
import org.apache.zookeeper.server.quorum.QuorumCnxManager.Message;
import org.apache.zookeeper.server.quorum.QuorumPeer.QuorumServer;
import org.apache.zookeeper.server.quorum.QuorumPeer.ServerState;
import org.apache.zookeeper.server.util.ZxidUtils;
import org.apache.zookeeper.test.ClientBase;
import org.apache.zookeeper.test.FLETest;
import org.apache.zookeeper.test.QuorumBase;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

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

public class FLECompatibilityTest extends ZKTestCase {
    protected static final Logger LOG = LoggerFactory.getLogger(FLECompatibilityTest.class);

    int count;
    HashMap<Long,QuorumServer> peers;
    File tmpdir[];
    int port[];

    @Before
    public void setUp() throws Exception {
        count = 3;
        peers = new HashMap<Long,QuorumServer>(count);
        tmpdir = new File[count];
        port = new int[count];
    }

    @After
    public void tearDown() throws Exception {

    }

    class MockFLEMessengerBackward {
        QuorumCnxManager manager;
        QuorumPeer self;
        long logicalclock = 1L;
        LinkedBlockingQueue<ToSend> sendqueue = new LinkedBlockingQueue<ToSend>();
        LinkedBlockingQueue<ToSend> internalqueue = new LinkedBlockingQueue<ToSend>();
        LinkedBlockingQueue<Notification> recvqueue = new LinkedBlockingQueue<Notification>();
        WorkerReceiver wr;

        MockFLEMessengerBackward(QuorumPeer self, QuorumCnxManager manager){
            this.manager = manager;
            this.self = self;

            this.wr = new WorkerReceiver(manager);

            Thread t = new Thread(this.wr,
                    "WorkerReceiver[myid=" + self.getId() + "]");
            t.setDaemon(true);
            t.start();
        }

        void halt() {
            wr.stop = true;
        }

        /*
         * This class has been copied from before adding versions to notifications.
         *
         * {@see https://issues.apache.org/jira/browse/ZOOKEEPER-1808}
         */
        class WorkerReceiver implements Runnable {
            volatile boolean stop;
            QuorumCnxManager manager;
            final long proposedLeader = 2;
            final long proposedZxid = 0x1;
            final long proposedEpoch = 1;

            WorkerReceiver(QuorumCnxManager manager) {
                this.stop = false;
                this.manager = manager;
            }

            /*
             * The vote we return here is fixed for test purposes.
             */
            Vote getVote(){
                return new Vote(proposedLeader, proposedZxid, proposedEpoch);
            }

            public void run() {

                Message response;
                while (!stop) {
                    // Sleeps on receive
                    try{
                        response = manager.pollRecvQueue(3000, TimeUnit.MILLISECONDS);
                        if(response == null) continue;

                        /*
                         * If it is from an observer, respond right away.
                         * Note that the following predicate assumes that
                         * if a server is not a follower, then it must be
                         * an observer. If we ever have any other type of
                         * learner in the future, we'll have to change the
                         * way we check for observers.
                         */
                        if(!self.getVotingView().containsKey(response.sid)){
                            Vote current = self.getCurrentVote();
                            ToSend notmsg = new ToSend(ToSend.mType.notification,
                                    current.getId(),
                                    current.getZxid(),
                                    logicalclock,
                                    self.getPeerState(),
                                    response.sid,
                                    current.getPeerEpoch());

                            internalqueue.offer(notmsg);
                        } else {
                            // Receive new message
                            if (LOG.isDebugEnabled()) {
                                LOG.debug("Receive new notification message. My id = "
                                        + self.getId());
                            }

                            /*
                             * We check for 28 bytes for backward compatibility
                             */
                            if (response.buffer.capacity() < 28) {
                                LOG.error("Got a short response: "
                                        + response.buffer.capacity());
                                continue;
                            }
                            boolean backCompatibility = (response.buffer.capacity() == 28);
                            response.buffer.clear();

                            // State of peer that sent this message
                            QuorumPeer.ServerState ackstate = QuorumPeer.ServerState.LOOKING;
                            switch (response.buffer.getInt()) {
                            case 0:
                                ackstate = QuorumPeer.ServerState.LOOKING;
                                break;
                            case 1:
                                ackstate = QuorumPeer.ServerState.FOLLOWING;
                                break;
                            case 2:
                                ackstate = QuorumPeer.ServerState.LEADING;
                                break;
                            case 3:
                                ackstate = QuorumPeer.ServerState.OBSERVING;
                                break;
                            }

                            // Instantiate Notification and set its attributes
                            Notification n = new Notification();
                            n.leader = response.buffer.getLong();
                            n.zxid = response.buffer.getLong();
                            n.electionEpoch = response.buffer.getLong();
                            n.state = ackstate;
                            n.sid = response.sid;
                            if(!backCompatibility){
                                n.peerEpoch = response.buffer.getLong();
                            } else {
                                if(LOG.isInfoEnabled()){
                                    LOG.info("Backward compatibility mode, server id=" + n.sid);
                                }
                                n.peerEpoch = ZxidUtils.getEpochFromZxid(n.zxid);
                            }

                            /*
                             * If this server is looking, then send proposed leader
                             */

                            if(self.getPeerState() == QuorumPeer.ServerState.LOOKING){
                                recvqueue.offer(n);

                                /*
                                 * Send a notification back if the peer that sent this
                                 * message is also looking and its logical clock is
                                 * lagging behind.
                                 */
                                if((ackstate == QuorumPeer.ServerState.LOOKING)
                                        && (n.electionEpoch < logicalclock)){
                                    Vote v = getVote();
                                    ToSend notmsg = new ToSend(ToSend.mType.notification,
                                            v.getId(),
                                            v.getZxid(),
                                            logicalclock,
                                            self.getPeerState(),
                                            response.sid,
                                            v.getPeerEpoch());
                                    internalqueue.offer(notmsg);
                                }
                            } else {
                                /*
                                 * If this server is not looking, but the one that sent the ack
                                 * is looking, then send back what it believes to be the leader.
                                 */
                                Vote current = self.getCurrentVote();
                                if(ackstate == QuorumPeer.ServerState.LOOKING){
                                    if(LOG.isDebugEnabled()){
                                        LOG.debug("Sending new notification. My id =  " +
                                                self.getId() + " recipient=" +
                                                response.sid + " zxid=0x" +
                                                Long.toHexString(current.getZxid()) +
                                                " leader=" + current.getId());
                                    }
                                    ToSend notmsg = new ToSend(
                                            ToSend.mType.notification,
                                            current.getId(),
                                            current.getZxid(),
                                            current.getElectionEpoch(),
                                            self.getPeerState(),
                                            response.sid,
                                            current.getPeerEpoch());
                                    internalqueue.offer(notmsg);
                                }
                            }
                        }
                    } catch (InterruptedException e) {
                        System.out.println("Interrupted Exception while waiting for new message" +
                                e.toString());
                    }
                }
                LOG.info("WorkerReceiver is down");
            }
        }
    }

    class MockFLEMessengerForward extends FastLeaderElection {

        MockFLEMessengerForward(QuorumPeer self, QuorumCnxManager manager){
            super( self, manager );
        }

        void halt() {
            super.shutdown();
        }
    }

    void populate()
    throws Exception {
        for (int i = 0; i < count; i++) {
            peers.put(Long.valueOf(i),
                      new QuorumServer(i, "0.0.0.0",
                                       PortAssignment.unique(),
                                       PortAssignment.unique(), null));
            tmpdir[i] = ClientBase.createTmpDir();
            port[i] = PortAssignment.unique();
        }
    }

    @Test(timeout=20000)
    public void testBackwardCompatibility()
    throws Exception {
        populate();

        QuorumPeer peer = new QuorumPeer(peers, tmpdir[0], tmpdir[0], port[0], 3, 0, 1000, 2, 2);
        peer.setPeerState(ServerState.LOOKING);
        QuorumCnxManager mng = new QuorumCnxManager(peer);

        /*
         * Check that it generates an internal notification correctly
         */
        MockFLEMessengerBackward fle = new MockFLEMessengerBackward(peer, mng);
        ByteBuffer buffer = FastLeaderElection.buildMsg(ServerState.LOOKING.ordinal(), 2, 0x1, 1, 1);
        fle.manager.recvQueue.add(new Message(buffer, 2));
        Notification n = fle.recvqueue.take();
        Assert.assertTrue("Wrong state", n.state == ServerState.LOOKING);
        Assert.assertTrue("Wrong leader", n.leader == 2);
        Assert.assertTrue("Wrong zxid", n.zxid == 0x1);
        Assert.assertTrue("Wrong epoch", n.electionEpoch == 1);
        Assert.assertTrue("Wrong epoch", n.peerEpoch == 1);

        /*
         * Check that it sends a notification back to the sender
         */
        peer.setPeerState(ServerState.FOLLOWING);
        peer.setCurrentVote( new Vote(2, 0x1, 1, 1, ServerState.LOOKING) );
        buffer = FastLeaderElection.buildMsg(ServerState.LOOKING.ordinal(), 1, 0x1, 1, 1);
        fle.manager.recvQueue.add(new Message(buffer, 1));
        ToSend m = fle.internalqueue.take();
        Assert.assertTrue("Wrong state", m.state == ServerState.FOLLOWING);
        Assert.assertTrue("Wrong sid", m.sid == 1);
        Assert.assertTrue("Wrong leader", m.leader == 2);
        Assert.assertTrue("Wrong epoch", m.electionEpoch == 1);
        Assert.assertTrue("Wrong epoch", m.peerEpoch == 1);
    }

    @Test(timeout=20000)
    public void testForwardCompatibility()
    throws Exception {
        populate();

        QuorumPeer peer = new QuorumPeer(peers, tmpdir[0], tmpdir[0], port[0], 3, 0, 1000, 2, 2);
        peer.setPeerState(ServerState.LOOKING);
        QuorumCnxManager mng = new QuorumCnxManager(peer);

        /*
         * Check that it generates an internal notification correctly
         */
        MockFLEMessengerForward fle = new MockFLEMessengerForward(peer, mng);
        ByteBuffer notBuffer = FastLeaderElection.buildMsg(ServerState.LOOKING.ordinal(), 2, 0x1, 1, 1);
        ByteBuffer buffer = ByteBuffer.allocate( notBuffer.capacity() + 8 );
        notBuffer.flip();
        buffer.put(notBuffer);
        buffer.putLong( Long.MAX_VALUE );
        buffer.flip();

        fle.manager.recvQueue.add(new Message(buffer, 2));
        Notification n = fle.recvqueue.take();
        Assert.assertTrue("Wrong state", n.state == ServerState.LOOKING);
        Assert.assertTrue("Wrong leader", n.leader == 2);
        Assert.assertTrue("Wrong zxid", n.zxid == 0x1);
        Assert.assertTrue("Wrong epoch", n.electionEpoch == 1);
        Assert.assertTrue("Wrong epoch", n.peerEpoch == 1);
        Assert.assertTrue("Wrong version", n.version == FastLeaderElection.Notification.CURRENTVERSION);
    }
}


text:
layout: page
title: Research
permalink: /research/
---
## Under Review

* [Contingent Stimulus in Crowdfunding](http://ssrn.com/abstract=2925962), with [Ming Hu](http://ming.hu/) and [Jiahua Wu](http://www.imperial.ac.uk/people/j.wu).

<br/>

## Published Articles
* [Rationing and Pricing Strategies for Congestion Mitigation: Behavioral Theory, Econometric Model, and Application in Beijing](http://dx.doi.org/10.1016/j.trb.2013.07.013),  with [Shanjiang Zhu](http://civil.gmu.edu/people/shanjiang-zhu) and [Lei Zhang](http://lei.umd.edu/index.html), *Transportation Research Part B: Methodological*, 57 (2013), 210-224.


text:
define(function(require, exports, module) {

exports.isDark = false;
exports.cssClass = "ace-dawn";
exports.cssText = require("../requirejs/text!./dawn.css");

var dom = require("../lib/dom");
dom.importCssString(exports.cssText, exports.cssClass);
});


text:
package com.opengamma.analytics.math.surface;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals;

import java.util.Map;

import org.testng.annotations.Test;

import com.opengamma.analytics.math.interpolation.GridInterpolator2D;
import com.opengamma.analytics.math.interpolation.LinearInterpolator1D;
import com.opengamma.analytics.math.interpolation.data.Interpolator1DDataBundle;
import com.opengamma.util.test.TestGroup;
import com.opengamma.util.tuple.DoublesPair;

/**
 * Test.
 */
@Test(groups = TestGroup.UNIT)
public class InterpolatedSurfaceMultiplicativeShiftFunctionTest {
  private static final double[] X = new double[] {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4 };
  private static final double[] Y = new double[] {0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4 };
  private static final double[] Z = new double[] {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
  private static final GridInterpolator2D INTERPOLATOR = new GridInterpolator2D(new LinearInterpolator1D(), new LinearInterpolator1D()) {

        @Override
        public Double interpolate(Map<Double, Interpolator1DDataBundle> dataBundle, DoublesPair value) {
          return value.getFirst() + value.getSecond();
        }
      };
  private static final String NAME = "K";
  private static final InterpolatedDoublesSurface SURFACE = InterpolatedDoublesSurface.from(X, Y, Z, INTERPOLATOR, NAME);
  private static final InterpolatedSurfaceMultiplicativeShiftFunction F = new InterpolatedSurfaceMultiplicativeShiftFunction();

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull1() {
    F.evaluate(null, 3);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull2() {
    F.evaluate(null, 3, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull3() {
    F.evaluate(null, 3, 4, 5);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull4() {
    F.evaluate(null, 3, 4, 5, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull5() {
    F.evaluate(null, new double[] {3 }, new double[] {4 }, new double[] {5 });
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testNull6() {
    F.evaluate(null, new double[] {3 }, new double[] {4 }, new double[] {5 }, NAME);
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLengthY1() {
    F.evaluate(SURFACE, new double[] {1 }, new double[] {2, 3 }, new double[] {4 });
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLengthY2() {
    F.evaluate(SURFACE, new double[] {1 }, new double[] {2, 3 }, new double[] {4 }, "M");
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLengthZ1() {
    F.evaluate(SURFACE, new double[] {1 }, new double[] {2 }, new double[] {3, 4 });
  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void testWrongLengthZ2() {
    F.evaluate(SURFACE, new double[] {1 }, new double[] {2 }, new double[] {3, 4 }, "L");
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testParallel() {
    final double shift = 0.12;
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, shift);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    for (int i = 0; i < Z.length; i++) {
      assertEquals(Z[i] * (1 + shift), surface.getZDataAsPrimitive()[i], 0);
    }
    assertEquals(surface.getName(), "CONSTANT_MULTIPLIER_" + NAME);
    final String newName = "E";
    surface = F.evaluate(SURFACE, shift, newName);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    for (int i = 0; i < Z.length; i++) {
      assertEquals(Z[i] * (1 + shift), surface.getZDataAsPrimitive()[i], 0);
    }
    assertEquals(surface.getName(), newName);
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testSingle() {
    double x = 2;
    double y = 4;
    final double shift = 0.34;
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, x, y, shift);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    double[] z = surface.getZDataAsPrimitive();
    for (int i = 0; i < z.length; i++) {
      if (i == 14) {
        assertEquals(Z[i] * (1 + shift), z[i], 0);
      } else {
        assertEquals(Z[i], z[i], 0);
      }
    }
    assertEquals(surface.getName(), "SINGLE_MULTIPLIER_" + NAME);
    final String newName = "R";
    surface = F.evaluate(SURFACE, x, y, shift, newName);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    z = surface.getZDataAsPrimitive();
    for (int i = 0; i < z.length; i++) {
      if (i == 14) {
        assertEquals(Z[i] * (1 + shift), z[i], 0);
      } else {
        assertEquals(Z[i], z[i], 0);
      }
    }
    assertEquals(surface.getName(), newName);
    x = 1.5;
    y = 3.;
    final int n = X.length + 1;
    surface = F.evaluate(SURFACE, x, y, shift);
    double[] newX = surface.getXDataAsPrimitive();
    double[] newY = surface.getYDataAsPrimitive();
    z = surface.getZDataAsPrimitive();
    assertEquals(newX.length, n);
    assertEquals(newY.length, n);
    assertEquals(z.length, n);
    for (int i = 0; i < n - 1; i++) {
      assertEquals(X[i], newX[i], 0);
      assertEquals(Y[i], newY[i], 0);
      assertEquals(Z[i], z[i], 0);
    }
    assertEquals(newX[n - 1], x, 0);
    assertEquals(newY[n - 1], y, 0);
    assertEquals(z[n - 1], x + y + shift, 0);
    assertEquals(surface.getName(), "SINGLE_MULTIPLIER_" + NAME);
    surface = F.evaluate(SURFACE, x, y, shift, newName);
    newX = surface.getXDataAsPrimitive();
    newY = surface.getYDataAsPrimitive();
    z = surface.getZDataAsPrimitive();
    assertEquals(newX.length, n);
    assertEquals(newY.length, n);
    assertEquals(z.length, n);
    for (int i = 0; i < n - 1; i++) {
      assertEquals(X[i], newX[i], 0);
      assertEquals(Y[i], newY[i], 0);
      assertEquals(Z[i], z[i], 0);
    }
    assertEquals(newX[n - 1], x, 0);
    assertEquals(newY[n - 1], y, 0);
    assertEquals(z[n - 1], x + y + shift, 0);
    assertEquals(surface.getName(), newName);
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testMultipleNoData() {
    final double[] xShift = new double[0];
    final double[] yShift = new double[0];
    final double[] shift = new double[0];
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, xShift, yShift, shift);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    assertArrayEquals(surface.getZDataAsPrimitive(), Z, 0);
    assertEquals(surface.getName(), "MULTIPLE_MULTIPLIER_" + NAME);
    surface = F.evaluate(SURFACE, xShift, yShift, shift, "A");
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    assertArrayEquals(surface.getZDataAsPrimitive(), Z, 0);
    assertEquals(surface.getName(), "A");
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testMultipleOnPoints() {
    final double[] x = new double[] {1, 2 };
    final double[] y = new double[] {0, 3 };
    final double[] shift = new double[] {0.34, 0.56 };
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, x, y, shift);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    double[] z = surface.getZDataAsPrimitive();
    for (int i = 0; i < z.length; i++) {
      if (i == 5) {
        assertEquals(Z[i] * (1 + shift[0]), z[i], 0);
      } else if (i == 13) {
        assertEquals(Z[i] * (1 + shift[1]), z[i], 0);
      } else {
        assertEquals(Z[i], z[i], 0);
      }
    }
    assertEquals(surface.getName(), "MULTIPLE_MULTIPLIER_" + NAME);
    final String newName = "R";
    surface = F.evaluate(SURFACE, x, y, shift, newName);
    assertArrayEquals(surface.getXDataAsPrimitive(), X, 0);
    assertArrayEquals(surface.getYDataAsPrimitive(), Y, 0);
    z = surface.getZDataAsPrimitive();
    for (int i = 0; i < z.length; i++) {
      if (i == 5) {
        assertEquals(Z[i] * (1 + shift[0]), z[i], 0);
      } else if (i == 13) {
        assertEquals(Z[i] * (1 + shift[1]), z[i], 0);
      } else {
        assertEquals(Z[i], z[i], 0);
      }
    }
    assertEquals(surface.getName(), newName);
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testMultipleOneOnPoint() {
    final double[] x = new double[] {1, 2.3 };
    final double[] y = new double[] {0, 3.9 };
    final double[] shift = new double[] {0.34, 0.56 };
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, x, y, shift);
    final int n = X.length + 1;
    double[] newX = surface.getXDataAsPrimitive();
    double[] newY = surface.getYDataAsPrimitive();
    double[] newZ = surface.getZDataAsPrimitive();
    assertEquals(surface.size(), newX.length);
    assertEquals(surface.size(), newY.length);
    assertEquals(surface.size(), newZ.length);
    for (int i = 0; i < n - 1; i++) {
      if (i == 5) {
        assertEquals(Z[i] * (1 + shift[0]), newZ[i], 0);
      } else {
        assertEquals(Z[i], newZ[i], 0);
      }
    }
    assertEquals(newX[n - 1], x[1], 0);
    assertEquals(newY[n - 1], y[1], 0);
    assertEquals(newZ[n - 1], (x[1] + y[1]) * (1 + shift[1]), 0);
    assertEquals(surface.getName(), "MULTIPLE_MULTIPLIER_" + NAME);
    final String newName = "R";
    surface = F.evaluate(SURFACE, x, y, shift, newName);
    newX = surface.getXDataAsPrimitive();
    newY = surface.getYDataAsPrimitive();
    newZ = surface.getZDataAsPrimitive();
    assertEquals(surface.size(), newX.length);
    assertEquals(surface.size(), newY.length);
    assertEquals(surface.size(), newZ.length);
    for (int i = 0; i < n - 1; i++) {
      if (i == 5) {
        assertEquals(Z[i] * (1 + shift[0]), newZ[i], 0);
      } else {
        assertEquals(Z[i], newZ[i], 0);
      }
    }
    assertEquals(newX[n - 1], x[1], 0);
    assertEquals(newY[n - 1], y[1], 0);
    assertEquals(newZ[n - 1], (x[1] + y[1]) * (1 + shift[1]), 0);
    assertEquals(surface.getName(), newName);
  }

  // Disabled as relies on internal operation of InterpolatedDoublesSurface
  @Test(enabled = false)
  public void testMultiple() {
    final double[] x = new double[] {1.67, 2.3 };
    final double[] y = new double[] {0.15, 3.9 };
    final double[] shift = new double[] {0.34, 0.56 };
    InterpolatedDoublesSurface surface = F.evaluate(SURFACE, x, y, shift);
    final int n = X.length + 2;
    double[] newX = surface.getXDataAsPrimitive();
    double[] newY = surface.getYDataAsPrimitive();
    double[] newZ = surface.getZDataAsPrimitive();
    assertEquals(surface.size(), newX.length);
    assertEquals(surface.size(), newY.length);
    assertEquals(surface.size(), newZ.length);
    for (int i = 0; i < n - 2; i++) {
      assertEquals(Z[i], newZ[i], 0);
    }
    assertEquals(newX[n - 2], x[0], 0);
    assertEquals(newY[n - 2], y[0], 0);
    assertEquals(newZ[n - 2], (x[0] + y[0]) * (1 + shift[0]), 0);
    assertEquals(newX[n - 1], x[1], 0);
    assertEquals(newY[n - 1], y[1], 0);
    assertEquals(newZ[n - 1], (x[1] + y[1]) * (1 + shift[1]), 0);
    assertEquals(surface.getName(), "MULTIPLE_MULTIPLIER_" + NAME);
    final String newName = "R";
    surface = F.evaluate(SURFACE, x, y, shift, newName);
    newX = surface.getXDataAsPrimitive();
    newY = surface.getYDataAsPrimitive();
    newZ = surface.getZDataAsPrimitive();
    assertEquals(surface.size(), newX.length);
    assertEquals(surface.size(), newY.length);
    assertEquals(surface.size(), newZ.length);
    for (int i = 0; i < n - 2; i++) {
      assertEquals(Z[i], newZ[i], 0);
    }
    assertEquals(newX[n - 2], x[0], 0);
    assertEquals(newY[n - 2], y[0], 0);
    assertEquals(newZ[n - 2], (x[0] + y[0]) * (1 + shift[0]), 0);
    assertEquals(newX[n - 1], x[1], 0);
    assertEquals(newY[n - 1], y[1], 0);
    assertEquals(newZ[n - 1], (x[1] + y[1]) * (1 + shift[1]), 0);
    assertEquals(surface.getName(), newName);
  }
}


text:
.. _api:

API Reference
=============

.. _httpretty:

register_uri
------------

.. automethod:: httpretty.core.httpretty.register_uri
   :noindex:

enable
------

.. automethod:: httpretty.core.httpretty.enable
   :noindex:

disable
-------

.. automethod:: httpretty.core.httpretty.disable
   :noindex:

is_enabled
----------

.. automethod:: httpretty.core.httpretty.is_enabled
   :noindex:

last_request
------------

.. autofunction:: httpretty.last_request
   :noindex:

latest_requests
---------------

.. autofunction:: httpretty.latest_requests
   :noindex:

.. automodule:: httpretty

.. _activate:

activate
--------

.. autoclass:: httpretty.activate
   :members:
   :noindex:

.. _httprettified:

httprettified
-------------

.. autofunction:: httpretty.core.httprettified
   :noindex:

.. _enabled:

enabled
-------

.. autoclass:: httpretty.enabled
   :members:
   :noindex:

.. _httprettized:

httprettized
------------

.. autoclass:: httpretty.core.httprettized
   :members:
   :noindex:

.. _HTTPrettyRequest:

HTTPrettyRequest
----------------

.. autoclass:: httpretty.core.HTTPrettyRequest
   :members:
   :noindex:

.. _HTTPrettyRequestEmpty:

HTTPrettyRequestEmpty
---------------------

.. autoclass:: httpretty.core.HTTPrettyRequestEmpty
   :members:
   :noindex:

.. _FakeSockFile:

FakeSockFile
------------

.. autoclass:: httpretty.core.FakeSockFile
   :members:
   :noindex:

.. _FakeSSLSocket:

FakeSSLSocket
-------------

.. autoclass:: httpretty.core.FakeSSLSocket
   :members:
   :noindex:

.. _URIInfo:

URIInfo
-------

.. autoclass:: httpretty.URIInfo
   :members:
   :noindex:

.. _URIMatcher:

URIMatcher
----------

.. autoclass:: httpretty.URIMatcher
   :members:
   :noindex:

.. _Entry:

Entry
-----

.. autoclass:: httpretty.Entry
   :members:
   :noindex:

.. _api modules:

Modules
=======

.. _api module core:

Core
----

.. automodule:: httpretty.core
   :members:

.. _api module http:

Http
----

.. automodule:: httpretty.http
   :members:

.. _api module utils:

Utils
-----

.. automodule:: httpretty.utils
   :members:

.. _api module exceptions:

Exceptions
----------

.. automodule:: httpretty.errors
   :members:


text:
layout: page
title: HOME
description: "Know something about everything and everything about something"
---

{% for post in paginator.posts %}

            {{ post.title }}

        {% if post.subtitle %}

            {{ post.subtitle }}

        {% endif %}

            {{ post.content | strip_html | truncate:150 }}

Posted by {% if post.author %}{{ post.author }}{% else %}{{ site.title }}{% endif %} on {{ post.date | date: "%B %-d, %Y" }}

{% endfor %}

{% if paginator.total_pages > 1 %}

    {% if paginator.previous_page %}

        ← Newer Posts

    {% endif %}
    {% if paginator.next_page %}

        Older Posts →

    {% endif %}

{% endif %}


text:
package it.infn.ct.indigo.futuregateway.portlet;

import it.infn.ct.indigo.futuregateway.constants.FutureGatewayAdminPortletKeys;
import it.infn.ct.indigo.futuregateway.server.FGServerManeger;

import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.WebKeys;

import java.io.IOException;

import javax.portlet.Portlet;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;

/**
 * Main portlet for the Future Gateway (FG) administration.
 */
@Component(
        immediate = true,
        property = {
                "com.liferay.portlet.css-class-wrapper="
                        + "futuregateway_admin-portlet",
                "com.liferay.portlet.display-category=category.hidden",
                "com.liferay.portlet.header-portlet-css=/css/main.css",
                "com.liferay.portlet.layout-cacheable=true",
                "com.liferay.portlet.private-request-attributes=false",
                "com.liferay.portlet.private-session-attributes=false",
                "com.liferay.portlet.render-weight=50",
                "com.liferay.portlet.use-default-template=true",
                "javax.portlet.display-name=FutureGateway",
                "javax.portlet.expiration-cache=0",
                "javax.portlet.init-param.template-path=/",
                "javax.portlet.init-param.view-template=/view.jsp",
                "javax.portlet.name="
                        + FutureGatewayAdminPortletKeys.FUTURE_GATEWAY_ADMIN,
                "javax.portlet.resource-bundle=content.Language",
                "javax.portlet.security-role-ref=power-user,user",
                "javax.portlet.supports.mime-type=text/html"
                },
        service = Portlet.class
)
public class FutureGatewayAdminPortlet extends MVCPortlet {

    @Override
    protected final void doDispatch(
            final RenderRequest renderRequest,
            final RenderResponse renderResponse)
                    throws IOException, PortletException {
        ThemeDisplay themeDisplay =
                (ThemeDisplay) renderRequest.getAttribute(
                        WebKeys.THEME_DISPLAY);
        try {
            String fgURL = fgServerManager.getFGUrl(
                    themeDisplay.getCompanyId());
            renderRequest.setAttribute("FGURL", fgURL);
            if (fgURL == null || fgURL.isEmpty()) {
                include("/setup.jsp", renderRequest, renderResponse);
                return;
            }
        } catch (PortalException pe) {
            log.info("The FutureGateway URL cannot be retrieved");
        }
        super.doDispatch(renderRequest, renderResponse);
    }

    /**
     * Sets the FG Server manager.
     * This is used to get information of the service and for interactions.
     *
     * @param fgServerManeger The FG Server manager
     */
    @Reference(unbind = "-")
    protected final void setFGServerManeger(
            final FGServerManeger fgServerManeger) {
        this.fgServerManager = fgServerManeger;
    }

    /**
     * The logger.
     */
    private Log log = LogFactoryUtil.getLog(FutureGatewayAdminPortlet.class);

    /**
     * The reference to the FG Server manager.
     */
    private FGServerManeger fgServerManager;
}


text:
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required

from apps.characters.decorators import valid_character_selected
from apps.characters.models import CharacterApi

import apps.charts.charts as charts

@login_required
@valid_character_selected
def wallet_balance_chart(request, chart_type):
    try:
        character = CharacterApi.objects.get(pk=request.session['charpk'])
    except CharacterApi.DoesNotExist:
        return None
    if not character.api.access_to("WalletJournal"):
        return None

    if chart_type == "monthly_balance":
        #return JsonResponse(charts.monthly_balance(character))
        return JsonResponse(charts.monthly_balance(character))


text:
/*
 * Original Author: Chris Tomich
 * Web Site: http://mymemorysucks.com
 * Released into the public domain on the 2nd August, 2009 6:30PM +8:00 GMT.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleIoC
{
    public class RegisteredParameters : List<RegisteredParameter>
    {
        public RegisteredParameters()
            : base()
        {
        }

        public RegisteredParameters(int capacity)
            : base(capacity)
        {
        }

        public RegisteredParameters(IEnumerable<RegisteredParameter> collection)
            : base(collection)
        {
        }
    }
}


text:
package net.hasor.core.binder.schema;
import java.util.List;
/**
 * 表示一个{@link List}类型的值元信息描述。
 * @version 2010-9-17
 * @author 赵永春 (zyc@byshell.org)
 */
public class List_ValueMetaData extends Collection_ValueMetaData<ValueMetaData> {
    /**返回{@link PropertyType#List}*/
    @Override
    public String getType() {
        return PropertyType.List.value();
    }
}


text:
var karmaCommonConfig = require('./getKarmaCommonConfig');
var assign = require('object-assign');
var webpack = require('webpack');
var util = require('../util');
var fs = require('fs');
var file = require('html-wiring');

module.exports = function (config) {
  var customLaunchers = {
    sl_chrome: {
      base: 'SauceLabs',
      browserName: 'chrome',
      platform: 'Windows 7',
    },
    sl_firefox: {
      base: 'SauceLabs',
      browserName: 'firefox',
    },
    sl_safari: {
      base: 'SauceLabs',
      platform: 'OS X 10.11',
      browserName: 'safari',
    },
    sl_ie_11: {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      platform: 'Windows 8.1',
      version: '11',
    },
    sl_ie_10: {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '10',
    },
    sl_ie_9: {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '9',
    },
    sl_ie_8: {
      base: 'SauceLabs',
      browserName: 'internet explorer',
      version: '8',
    },
  };

  // Use ENV vars on Travis and sauce.json locally to get credentials
  if (!process.env.SAUCE_USERNAME) {
    if (!fs.existsSync(util.getFromCwd('sauce.json'))) {
      console.log('Create a sauce.json with your credentials.');
      process.exit(1);
    } else {
      var sauceCfg = JSON.parse(file.readFileAsString('sauce.json'));
      process.env.SAUCE_USERNAME = sauceCfg.username;
      process.env.SAUCE_ACCESS_KEY = sauceCfg.accessKey;
    }
  }

  var commonConfig = karmaCommonConfig();
  commonConfig.webpack.plugins = [];
  // see https://github.com/karma-runner/karma-sauce-launcher
  config.set(assign(commonConfig, {
    sauceLabs: {
      testName: 'UXCore cross-broswer util test',
    },
    customLaunchers: customLaunchers,
    browsers: Object.keys(customLaunchers),
    reporters: ['mocha', 'saucelabs'],
    singleRun: true,
    concurrency: 4,
  }));
}


text:
from sys import path
path.append("../libPython")
from sieve_eratosthenes import sieve
from sieve_eratosthenes import wrapper
from timeit import timeit

if __name__ == "__main__":
    N = 1000000
    rep = 10
    wrapped = wrapper(sieve, N)
    print("{:.5f} seg por loop".format(timeit(wrapped, number=rep) / rep))
    # print("resultado:\n{}".format(sieve(N)))


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

package com.azure.ai.textanalytics.lro;

import com.azure.ai.textanalytics.TextAnalyticsAsyncClient;
import com.azure.ai.textanalytics.TextAnalyticsClientBuilder;
import com.azure.ai.textanalytics.models.AbstractiveSummary;
import com.azure.ai.textanalytics.models.AbstractSummaryAction;
import com.azure.ai.textanalytics.models.AbstractSummaryActionResult;
import com.azure.ai.textanalytics.models.AbstractSummaryResult;
import com.azure.ai.textanalytics.models.AnalyzeActionsOperationDetail;
import com.azure.ai.textanalytics.models.AnalyzeActionsOptions;
import com.azure.ai.textanalytics.models.AnalyzeActionsResult;
import com.azure.ai.textanalytics.models.SummaryContext;
import com.azure.ai.textanalytics.models.TextAnalyticsActions;
import com.azure.core.credential.AzureKeyCredential;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * Sample demonstrates how to synchronously execute an "Abstractive Summarization" action in a batch of documents.
 */
public class AbstractiveSummarizationAsync {
    /**
     * Main method to invoke this demo about how to analyze an "Abstractive Summarization" action.
     *
     * @param args Unused arguments to the program.
     */
    public static void main(String[] args) {
        TextAnalyticsAsyncClient client = new TextAnalyticsClientBuilder()
            .credential(new AzureKeyCredential("{key}"))
            .endpoint("{endpoint}")
            .buildAsyncClient();

        List<String> documents = new ArrayList<>();

        documents.add(
            "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic,"
                + " human-centric approach to learning and understanding. As Chief Technology Officer of Azure AI"
                + " Cognitive Services, I have been working with a team of amazing scientists and engineers to turn "
                + "this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship"
                + " among three attributes of human cognition: monolingual text (X), audio or visual sensory signals,"
                + " (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code"
                + " as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear,"
                + " see, and understand humans better. We believe XYZ-code will enable us to fulfill our long-term"
                + " vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have"
                + " pretrained models that can jointly learn representations to support a broad range of downstream"
                + " AI tasks, much in the way humans do today. Over the past five years, we have achieved human"
                + " performance on benchmarks in conversational speech recognition, machine translation, "
                + "conversational question answering, machine reading comprehension, and image captioning. These"
                + " five breakthroughs provided us with strong signals toward our more ambitious aspiration to"
                + " produce a leap in AI capabilities, achieving multisensory and multilingual learning that "
                + "is closer in line with how humans learn and understand. I believe the joint XYZ-code is a "
                + "foundational component of this aspiration, if grounded with external knowledge sources in "
                + "the downstream AI tasks.");

        client.beginAnalyzeActions(documents,
            new TextAnalyticsActions()
                .setDisplayName("{tasks_display_name}")
                .setAbstractSummaryActions(
                    new AbstractSummaryAction().setMaxSentenceCount(3)),
            "en",
            new AnalyzeActionsOptions())
            .flatMap(result -> {
                AnalyzeActionsOperationDetail operationDetail = result.getValue();
                System.out.printf("Action display name: %s, Successfully completed actions: %d, in-process actions: %d,"
                        + " failed actions: %d, total actions: %d%n",
                    operationDetail.getDisplayName(), operationDetail.getSucceededCount(),
                    operationDetail.getInProgressCount(), operationDetail.getFailedCount(),
                    operationDetail.getTotalCount());
                return result.getFinalResult();
            })
            .flatMap(pagedFlux -> pagedFlux) // this unwrap the Mono<> of Mono<PagedFlux<T>> to return PagedFlux<T>
            .subscribe(
                actionsResult -> processAnalyzeActionsResult(actionsResult),
                ex -> System.out.println("Error listing pages: " + ex.getMessage()),
                () -> System.out.println("Successfully listed all pages"));

        // The .subscribe() creation and assignment is not a blocking call. For the purpose of this example, we sleep
        // the thread so the program does not end before the send operation is complete. Using .block() instead of
        // .subscribe() will turn this into a synchronous call.
        try {
            TimeUnit.MINUTES.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    private static void processAnalyzeActionsResult(AnalyzeActionsResult actionsResult) {
        System.out.println("Abstractive summarization action results:");
        for (AbstractSummaryActionResult actionResult : actionsResult.getAbstractSummaryResults()) {
            if (!actionResult.isError()) {
                for (AbstractSummaryResult documentResult : actionResult.getDocumentsResults()) {
                    if (!documentResult.isError()) {
                        System.out.println("\tAbstract summary sentences:");
                        for (AbstractiveSummary summarySentence : documentResult.getSummaries()) {
                            System.out.printf("\t\t Summary text: %s.%n", summarySentence.getText());
                            for (SummaryContext summaryContext : summarySentence.getContexts()) {
                                System.out.printf("\t\t offset: %d, length: %d%n",
                                    summaryContext.getOffset(), summaryContext.getLength());
                            }
                        }
                    } else {
                        System.out.printf("\tCannot get abstract summary. Error: %s%n",
                            documentResult.getError().getMessage());
                    }
                }
            } else {
                System.out.printf("\tCannot get Abstractive Summarization action. Error: %s%n",
                    actionResult.getError().getMessage());
            }
        }
    }
}


text:
"""Funciones para obtener datos de Apis Abiertas de gobierno
http://www.inegi.org.mx/desarrolladores/
"""

import json
import urllib2
import pandas as pn

def INEGI(indicador="1002000001",area="01",idioma="es",tipo="false"):
	token = "2b393191-23d5-7139-fbe1-3018ff170045"
	formato = "json"
	"""
	Indicador:
	El primer paso que se debe realizar para obtener información de la API es seleccionar el indicador e identificar su clave. Esto lo puede realizar consultando el "Constructor de consultas".

		#Busca aquí: http://www.inegi.org.mx/desarrolladores/indicadores/apiindicadores.aspx
					 http://www.inegi.org.mx/inegi/contenidos/serviciosweb/infoestadistica.aspx

	Área geográfica:
	Puede ser nacional [00], por entidad federativa [99] o por municipio [999], dependiendo de cada indicador.

	Idioma:
	La información está disponible en español [es] e inglés [en].

	Dato más reciente o Serie histórica:
	Puede consultarse solo el dato más reciente [true] o la serie histórica completa [false].

	Formato:
	Se ofrece la información en 3 tipos de formatos: JSON [json], JSONP [jsonp] o XML [xml].

	Token:
	Para utilizar la API es necesario mandarle un token válido, el cual puede obtener al registrarse aquí.
	"""
	formato = formato
	token = token

	search_url = "http://www3.inegi.org.mx/sistemas/api/indicadores/v1/Indicador/{0}/{1}/{2}/{3}/{4}/{5}".format(indicador,area,idioma,tipo,formato,token)
	temp = json.load(urllib2.urlopen(search_url))
	data = {}
	data["Data"] = {}
	data["Metadata"] = {}
	for each in range(len(temp.get("Data").get("Serie"))):
		Value = temp.get("Data").get("Serie")[each].get("CurrentValue")
		TimePeriod = temp.get("Data").get("Serie")[each].get("TimePeriod")
		data["Data"][TimePeriod] = Value

	data["Metadata"]['Freq'] =  temp.get("MetaData").get('Freq')
	data["Metadata"]['Indicator'] =  temp.get("MetaData").get('Indicator')
	data["Metadata"]['Region'] =  temp.get("MetaData").get('Region')
	data["Metadata"]['Unit'] =  temp.get("MetaData").get('Unit')

	pandasDF = pn.DataFrame.from_dict(data.get("Data"),orient='index')
	return data

def denue(condicion="camiones",coordenadas="21.85717833,-102.28487238",distancia="250"):
	token = "9fd58bbc-4198-44a8-b5c6-6b102c434856"
	formato = "json"
	"""
	#Api para Denue
	La API de DENUE te permite consultar datos de identificación, ubicación, actividad económica y tamaño de
	cerca de 5 millones de establecimientos a nivel nacional, por entidad federativa y municipio. Puedes utilizar
	la API para crear aplicaciones que muestren la información directamente de las bases de datos del INEGI en el
	preciso momento en que se actualiza.

	http://www.inegi.org.mx/desarrolladores/denue/apidenue.aspx

	Para el método de búsqueda se utilizan los siguientes parámetros:

	Condición:
	Palabra(s) a buscar dentro del nombre del establecimiento, razón social, calle, colonia, clase de actividad
	económica, entidad, municipio y localidad. Para buscar todos los establecimientos se deberá ingresar la palabra 'todos'.

	Coordenadas:
	Coordenadas centrales donde se hará la búsqueda.

	Distancia:
	Distancia a la redonda donde se realizará la búsqueda de establecimientos en metros. La distancia máxima es de 5 000 metros.

	Token:
	Es un número único que permite hacer consultas, el cual puede obtener al registrarse aquí

	"""
	token = token
	search_url = "http://www3.inegi.org.mx/sistemas/api/denue/v1/consulta/buscar/{0}/{1}/{2}/{3}".format(condicion,coordenadas,distancia,token)
	temp = json.load(urllib2.urlopen(search_url))
	data = pn.DataFrame(temp)

	return data


text:
<?php
/**
 * LikePDO Exception
 *
 * @name		PHP Like PDO
 * @author		Érick Carvalho <http://www.github.com/erickmcarvalho>
*/

namespace LikePDO;

use Exception;

class LikePDOException extends Exception
{
	/**
	 * Get Message
	 *
	 * @return	string
	*/
	/*public final function getMessage()
	{
		return "[LikePDO] ".parrent::getMessage();
	}*/
}


text:
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)

.

Copyright (c) (C) 2013, Jean Parpaillon

This file is provided to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License.  You may obtain
a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.

__Behaviours:__ [`occi_listener`](occi_listener.md).

__Authors:__ Jean Parpaillon ([`jean.parpaillon@free.fr`](mailto:jean.parpaillon@free.fr)).

## Function Index ##

start_link/2

terminate/2

## Function Details ##

### start_link/2 ###

`start_link(Ref, Opts) -> any()`

### terminate/2 ###

`terminate(Ref, Reason) -> any()`


text:
unsafe trait UnsafeTrait {
    fn foo(&self);
}

unsafe impl UnsafeTrait for isize {
    fn foo(&self) { }
}

pub unsafe trait PubUnsafeTrait {
    fn foo(&self);
}

fn main() { }


text:
package ve.ucv.ciens.ccg.nxtar.scenarios.bombgame;

import com.artemis.Component;

public class BombComponent extends Component {
	public enum bomb_type_t{
		COMBINATION(0), INCLINATION(1), WIRES(2);

		private int value;

		private bomb_type_t(int value){
			this.value = value;
		}

		public int getValue(){
			return this.value;
		}
	};

	public int id;
	public bomb_type_t bombType;
	public boolean enabled;

	public BombComponent(int id, bomb_type_t bomb_type){
		this.id = id;
		this.bombType = bomb_type;
		this.enabled = true;
	}

	public BombComponent(BombComponent bomb){
		this.id = bomb.id;
		this.bombType = bomb.bombType;
		this.enabled = bomb.enabled;
	}
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: Naty
 * Date: 5/27/2016
 * Time: 6:57 PM
 */

namespace UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;

class RankingController extends Controller
{
    /**
     * Show ranking.
     *
     * @param Request $request
     * @return \Symfony\Component\HttpFoundation\Response
     */
    public function showRankingAction(Request $request)
    {
        $userXpServices = $this->get('userbundle.user_experience');

        $users = $this->getDoctrine()->getRepository('UserBundle:User')->findAll();
        $languages = $this->getDoctrine()->getRepository('LessonBundle:Language')->findAll();

        foreach($users as $user)
        {
            $userName = $user->getUsername();
            $usersId[$userName] = $user->getId();
            $userXp = $userXpServices->getXpForAnUser($user);
            $userXp['total'] = $this->calculateTotalXp($userXp);
            $xpUsers[$userName] = $userXp;
        }
        uasort($xpUsers,array($this, 'compareXp'));

        return $this->render('UserBundle:Ranking:show.html.twig', array('xp' => $xpUsers, 'usersId' => $usersId ,'languages' => $languages));
    }

    /**
     * @param array $a
     * @param array $b
     * @return int
     */
    protected function compareXp($a, $b)
    {
        if($a['total'] == $b['total']){
            return 0;
        }

        return ($a['total'] < $b['total']) ? 1 : -1;
    }

    /**
     * @param array $userXps
     * @return int
     */
    protected function calculateTotalXp($userXps)
    {
        $totalXp = 0;
        foreach($userXps as $userXp){
            $totalXp += $userXp;
        }

        return$totalXp;
    }
}


text:
/*global describe, it, beforeEach, expect, xit, jasmine */

describe("Box", function () {
    "use strict";

    var Box = require('../../src/math/box.js'),
        b;

    beforeEach(function () {
        b = new Box(100,200);
    });

    it("should be able to create a Box", function () {
        expect(b instanceof Box).toBe(true);
    });

    describe("attributes", function () {

        it("should read the correct width attribute value", function () {
            expect(b.width()).toBe(100);
        });
        it("should read the correct height attribute value", function () {
            expect(b.height()).toBe(200);
        });

    });

});


text:
<?xml version="1.0"?>
<!--
  Copyright © 2012-2015 eBay Software Foundation
  This program is dual licensed under the MIT and Apache 2.0 licenses.
  Please see LICENSE for more information.
  -->
<assembly
    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
    <id>bin</id>
    <formats>
        <format>tar.gz</format>
    </formats>
    <dependencySets>
        <dependencySet>
            <outputDirectory>/lib</outputDirectory>
            <useProjectArtifact>false</useProjectArtifact>
            <outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
            <unpack>false</unpack>
            <scope>runtime</scope>
        </dependencySet>
    </dependencySets>

    <fileSets>
        <fileSet>
            <directory>${project.basedir}</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>README*</include>
                <include>LICENSE*</include>
                <include>NOTICE*</include>
            </includes>
        </fileSet>

        <fileSet>
            <directory>${project.basedir}/buildsrc/JetstreamConf</directory>
            <outputDirectory>JetstreamConf</outputDirectory>
            <includes>
                <include>**</include>
            </includes>
        </fileSet>

        <fileSet>
            <directory>${project.build.directory}</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>*.jar</include>
            </includes>
            <excludes>
                <exclude>*-javadoc.jar</exclude>
                <exclude>*-sources.jar</exclude>
            </excludes>
        </fileSet>

        <fileSet>
            <directory>${project.basedir}/buildsrc/scripts</directory>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>*.*</include>
            </includes>
            <fileMode>0755</fileMode>
        </fileSet>
    </fileSets>
</assembly>


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>phpDocumentor » \OAuthServer</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">

phpDocumentor

                                    API Documentation

Namespaces

 global

 miiCard

Packages

 Default

 MiiCardConsumers

                                    Charts

 Class hierarchy diagram

                                    Reports

 Errors
                173

 Markers

 Deprecated elements
                0

Back to top

                            Javascript is disabled; several features are only available
                            if Javascript is enabled.

<button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button>

<button class="btn details" title="Show descriptions and method names"></button><button class="btn simple" title="Show only method names"></button>

 Methods

__construct()

__construct()

add_signature_method()

add_signature_method()

process an access_token request
returns the access token on success
fetch_access_token()

process a request_token request
returns the request token on success
fetch_request_token()

verify an api call, checks all the parameters
verify_request()

» Private

check that the nonce is not repeated
check_nonce()

all-in-one function to check the signature on a request
should guess the signature method appropriately
check_signature()

check that the timestamp is new enough
check_timestamp()

try to find the consumer for the provided request's consumer key
get_consumer()

figure out the signature with some defaults
get_signature_method()

try to find the token for the provided request's token key
get_token()

version 1
get_version()

 Properties

» Protected

$data_store
$data_store

$signature_methods
$signature_methods

$timestamp_threshold
$timestamp_threshold

$version
$version

\

global

\OAuthServer

 Methods

__construct()

__construct($data_store)

Parameters

$data_store

add_signature_method()

add_signature_method($signature_method)

Parameters

$signature_method

process an access_token request
returns the access token on success

fetch_access_token($request)

Parameters

$request

process a request_token request
returns the request token on success

fetch_request_token($request)

Parameters

$request

verify an api call, checks all the parameters

verify_request($request)

Parameters

$request

check that the nonce is not repeated

check_nonce($consumer, $token, $nonce, $timestamp)

Parameters

$consumer

$token

$nonce

$timestamp

all-in-one function to check the signature on a request
should guess the signature method appropriately

check_signature($request, $consumer, $token)

Parameters

$request

$consumer

$token

check that the timestamp is new enough

check_timestamp($timestamp)

Parameters

$timestamp

try to find the consumer for the provided request's consumer key

get_consumer($request)

Parameters

$request

figure out the signature with some defaults

get_signature_method($request)

Parameters

$request

try to find the token for the provided request's token key

get_token($request, $consumer, $token_type)

Parameters

$request

$consumer

$token_type

version 1

get_version($request)

Parameters

$request

 Properties

$data_store

$data_store

$signature_methods

$signature_methods

$timestamp_threshold

$timestamp_threshold

$version

$version

            Template is built using Twitter Bootstrap 2 and icons provided by Glyphicons.

            Documentation is powered by phpDocumentor 2.0.0a10 and

            generated on 2013-06-12T12:50:38+01:00.


text:
{-# LANGUAGE TemplateHaskell #-}
module Language.Haskell.TH.Lift.Extras where

import Control.Applicative
import Language.Haskell.TH
import Language.Haskell.TH.Lift

liftAbstract :: (concrete -> ExpQ) -> Name -> (abstract -> concrete) -> abstract -> ExpQ
liftAbstract liftConcrete fromConcrete fromAbstract x
  = varE fromConcrete `appE` liftConcrete (fromAbstract x)

deriveLiftAbstract :: Name -> Name -> Name -> Q [Dec]
deriveLiftAbstract tyName fromConcrete fromAbstract
  = pure <$> instanceD (cxt []) (conT ''Lift `appT` conT tyName)
      [valD (varP 'lift) (normalB body) []]
  where
    body = [e|liftAbstract lift $(lift fromConcrete) $(varE fromAbstract) |]


text:
package smile.nlp.tokenizer;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Haifeng
 */
public class PennTreebankTokenizerTest {

    public PennTreebankTokenizerTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplit() {
        System.out.println("tokenize");
        String text = "Good muffins cost $3.88\nin New York.  Please buy "
                + "me\ntwo of them.\n\nYou cannot eat them. I gonna eat them. "
                + "Thanks.";

        String[] expResult = {"Good", "muffins", "cost", "$", "3.88", "in",
            "New", "York.", "Please", "buy", "me", "two", "of", "them", ".",
            "You", "can", "not", "eat", "them.", "I", "gon", "na", "eat",
            "them.", "Thanks", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitContraction() {
        System.out.println("tokenize contraction");
        String text = "Here are some examples of contractions: 'tis, "
                + "'twas, ain't, aren't, can't, could've, couldn't, didn't, doesn't, "
                + "don't, hasn't, he'd, he'll, he's, how'd, how'll, how's, i'd, i'll, i'm, "
                + "i've, isn't, it's, might've, mightn't, must've, mustn't, shan't, "
                + "she'd, she'll, she's, should've, shouldn't, that'll, that's, "
                + "there's, they'd, they'll, they're, they've, wasn't, we'd, we'll, "
                + "we're, weren't, what'd, what's, when'd, when'll, when's, "
                + "where'd, where'll, where's, who'd, who'll, who's, why'd, why'll, "
                + "why's, won't, would've, wouldn't, you'd, you'll, you're, you've";

        String[] expResult = {"Here", "are", "some", "examples", "of",
            "contractions", ":", "'t", "is", ",", "'t", "was", ",", "ai",
            "n't", ",", "are", "n't", ",", "ca", "n't", ",", "could", "'ve",
            ",", "could", "n't", ",", "did", "n't", ",", "does", "n't", ",", "do",
            "n't", ",", "has", "n't", ",", "he", "'d", ",", "he", "'ll", ",",
            "he", "'s", ",", "how", "'d", ",", "how", "'ll", ",", "how", "'s",
            ",", "i", "'d", ",", "i", "'ll", ",", "i", "'m", ",", "i", "'ve", ",",
            "is", "n't", ",", "it", "'s", ",", "might", "'ve", ",", "might",
            "n't", ",", "must", "'ve", ",", "must", "n't", ",", "sha",
            "n't", ",", "she", "'d", ",", "she", "'ll", ",", "she", "'s", ",",
            "should", "'ve", ",", "should", "n't", ",", "that", "'ll", ",",
            "that", "'s", ",", "there", "'s", ",", "they", "'d", ",", "they", "'ll",
            ",", "they", "'re", ",", "they", "'ve", ",", "was", "n't", ",", "we",
            "'d", ",", "we", "'ll", ",", "we", "'re", ",", "were", "n't", ",",
            "what", "'d", ",", "what", "'s", ",", "when",
            "'d", ",", "when", "'ll", ",", "when", "'s", ",", "where", "'d", ",",
            "where", "'ll", ",", "where", "'s", ",", "who", "'d", ",", "who",
            "'ll", ",", "who", "'s", ",", "why", "'d", ",", "why", "'ll", ",",
            "why", "'s", ",", "wo", "n't", ",", "would", "'ve", ",", "would",
            "n't", ",", "you", "'d", ",", "you", "'ll", ",", "you", "'re", ",",
            "you", "'ve"};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitAbbreviation() {
        System.out.println("tokenize abbreviation");
        String text = "Here are some examples of abbreviations: A.B., abbr., "
                + "acad., A.D., alt., A.M., B.C., etc.";

        String[] expResult = {"Here", "are", "some", "examples", "of",
            "abbreviations", ":", "A.B.", ",", "abbr.", ",", "acad.",
            ",", "A.D.", ",", "alt.", ",", "A.M.", ",", "B.C.", ",", "etc.", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitTis() {
        System.out.println("tokenize tis");
        String text = "'tis, 'tisn't, and 'twas were common in early modern English texts.";
        String[] expResult = {"'t", "is", ",", "'t", "is", "n't", ",", "and",
            "'t", "was", "were", "common", "in", "early", "modern", "English",
            "texts", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitHyphen() {
        System.out.println("tokenize hyphen");
        String text = "On a noncash basis for the quarter, the bank reported a "
                + "loss of $7.3 billion because of a $10.4 billion write-down "
                + "in the value of its credit card unit, attributed to federal "
                + "regulations that limit debit fees and other charges.";

        String[] expResult = {"On", "a", "noncash", "basis", "for", "the",
            "quarter", ",", "the", "bank", "reported", "a", "loss", "of", "$",
            "7.3", "billion", "because", "of", "a", "$", "10.4", "billion",
            "write-down", "in", "the", "value", "of", "its", "credit", "card",
            "unit", ",", "attributed", "to", "federal", "regulations", "that",
            "limit", "debit", "fees", "and", "other", "charges", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitSingleQuote() {
        System.out.println("tokenize single quote");
        String text = "String literals can be enclosed in matching single "
                + "quotes ('). But it's also appearing in contractions such as can't.";

        String[] expResult = {"String", "literals", "can", "be", "enclosed", "in",
            "matching", "single", "quotes", "(", "'", ")", ".", "But", "it", "'s", "also",
            "appearing", "in", "contractions", "such", "as", "ca", "n't", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testSplitRomanNumeral() {
        System.out.println("tokenize roman numeral");
        String text = "S.. or S: means \"twice\" (as in \"twice a third\").";
        String[] expResult = {"S..", "or", "S", ":", "means", "\"", "twice",
            "\"", "(", "as", "in", "\"", "twice", "a", "third", "\"", ")", "."};

        PennTreebankTokenizer instance = PennTreebankTokenizer.getInstance();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testTokenizeMixedAlphanumWords() {
        System.out.println("tokenize words with mixed numbers, letters, and punctuation");
        String text = "3M, L-3, BB&T, AutoZone, O'Reilly, Harley-Davidson, CH2M, A-Mark, "
            + "Quad/Graphics, Bloomin' Brands, B/E Aerospace, J.Crew, E*Trade.";

        // Note: would be very hard to get "Bloomin'" and "E*Trade" correct
        String[] expResult = {"3M", ",", "L-3", ",", "BB&T", ",", "AutoZone", ",", "O'Reilly",
            ",", "Harley-Davidson", ",", "CH2M", ",", "A-Mark", ",", "Quad/Graphics", ",", "Bloomin",
            "'", "Brands", ",", "B/E", "Aerospace", ",", "J.Crew", ",", "E", "*", "Trade", "."};

        SimpleTokenizer instance = new SimpleTokenizer();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testTokenizeDiacritizedWords() {
        System.out.println("tokenize words with diacritized chars (both composite and combining)");
        String text = "The naïve résumé of Raúl Ibáñez; re\u0301sume\u0301.";
        String[] expResult = {"The", "naïve", "résumé", "of", "Raúl", "Ibáñez", ";", "re\u0301sume\u0301", "."};

        SimpleTokenizer instance = new SimpleTokenizer();
        String[] result = instance.split(text);

        //assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testTokenizeNonLatinChars() {
        System.out.println("tokenize words containing non-Latin chars");
        // See https://en.wikipedia.org/wiki/Zero-width_non-joiner
        String text = "می‌خواهم   עֲו‌ֹנֹת   Auflage";
        String[] expResult = {"می‌خواهم", "עֲו‌ֹנֹת", "Auflage"};

        SimpleTokenizer instance = new SimpleTokenizer();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }

    /**
     * Test of split method, of class TreebankWordTokenizer.
     */
    @Test
    public void testTokenizeVariousSpaces() {
        System.out.println("tokenize words separated by various kinds of space");
        // No-break space and em-space
        String text = "the\u00A0cat\u2003the_cat";
        String[] expResult = {"the", "cat", "the_cat"};

        SimpleTokenizer instance = new SimpleTokenizer();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }
}


text:
import { Component } from '@angular/core';
import { Http , Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';

@Component({
    selector: 'my-app',
    templateUrl: 'templates/404.html'
})

export class AppPageNotFound {}


text:
Konventionen für VRZ-Software
=============================

Java-Packages
-------------

Die Struktur der Packages in Java orientieren sich an der Softwarearchitektur
mit dem Präfix `de.bsvrz`.

    de.bsvrz.segment.sweinheit.swkomponente*.swmodul

Die SW-Komponente ist optional und kann, wenn vorhanden, beliebig oft vorkommen.

Verzeichnis
-----------

Das Distributionspaket besteht aus einer ZIP-Datei mit folgendem Inhalt. Im
Beispiel wird die SW-Einheit `de.bsvrz.sys.funclib.foo` verwendet.

    de.bsvrz.sys.funclib.foo
        de.bsvrz.sys.funclib.foo.jar
        de.bsvrz.sys.funclib.foo-doc-api.zip
        de.bsvrz.sys.funclib.foo-doc-design.zip
        de.bsvrz.sys.funclib.foo-src.zip
        de.bsvrz.sys.funclib.foo-Build-Report.txt
        de.bsvrz.sys.funclib.foo-LGPL-lizenz.txt

Die Tests folgenden der selben Konvention mit dem zusätzlichen Namensbestandteil
*test*.

    de.bsvrz.sys.funclib.foo
        de.bsvrz.sys.funclib.foo-test.jar
        de.bsvrz.sys.funclib.foo-test-doc-api.zip
        de.bsvrz.sys.funclib.foo-test-doc-design.zip
        de.bsvrz.sys.funclib.foo-test-src.zip
        de.bsvrz.sys.funclib.foo-test-Build-Report.txt
        de.bsvrz.sys.funclib.foo-test-LGPL-lizenz.txt

Bibliotheken werden in seperaten Unterverzeichnissen abgelegt.

Konfiguration
-------------

Die Konfiguration wird in je ein Paket pro Konfigurationsverantwortlichen
geliefert. Das folgende Beispiel zeigt den Konfigurationsverantwortlichen *foo*.

    kv.foo
        config
        	kb.aoe.foo
        	kb.default.aoe.foo
            kb.kv.foo.config
            kb.tmBar.config
            kb.objekteFoobar.config
            verwaltungsdaten.xml
        xml
            kb.kv.foo.xml
            kb.tmBar.xml
            kb.objekteFoobar.xml
        ReleaseNotes
            Datenmodelle-kv-foo.pdf
            ReleaseNotes-kv.foo.doc

Projektstruktur
---------------

Die folgende Projektstruktur ist vorgeschlagen, aber noch nicht bestätigt.

    Projektname
        archiv
        bin
            ant
            bash
            dos
            logs
        debug
        dokumentation
        konfiguration
            config
            log
            xml
        lib
            de.bsvrz.*
        log
        parameter

Distributionspaket
------------------

Alle Dateinamen dürfen nur aus ASCII-Zeichen bestehen nach dem regulären
Ausdruck `[A-Za-z0-9_-.]` bestehen. Der Unterstrich _ wird nur Trennung von
Namensbestandteilen verwendet.

Der Name des Distributionspakets wird nach folgenden Schema gebildet.

    Typ_Bezeichnung_Status_Version_StandDatum[_StandZeit][_Zusatz].Endung

Die wichtigsten Typen sind:

  * SWE    -> SW-Einheit
  * KV     -> Konfiguration eines Konfigurationsverantwortlichen
  * PlugIn -> Plug-in für das Rahmenwerk

Die Bezeichnung ist der Name der zu liefernden Software, Konfiguration usw.

Die wichtigsten Werte für den Status sind.

  * FREI -> Produkt durch durch Hersteller freigegeben
  * BETA -> Beta

Die Version wird mit dem Buchstaben V als Präfix nach dem Schema *Semantic
Versioning* (http://semver.org) gebildet.

Das Standdatum wird mit dem Buchstaben D als Präfix nach dem Schema
`DYYYY-MM-DD` angegeben. Die Standzeit entsprechen mit dem Buchstaben T als
Präfix nach dem Schema `Thhmmss`.

Der Zusatz ist ein beliebiger Text.

Die Endung ist die übliche Dateiendung, z.B. `zip`.