text:
require 'uri'
module Bandwidth
  MEDIA_PATH = "media"
  # The Media resource lets you upload your media files to Bandwidth API servers
  class Media
    extend ClientWrapper

    # Get a list of your media files
    # @param client [Client] optional client instance to make requests
    # @param query [Hash] query options
    # @return [Array] array with file information
    # @example
    #   files = Media.list(client)
    def self.list(client, query = nil)
      client.make_request(:get, client.concat_user_path(MEDIA_PATH), query)[0]
    end
    wrap_client_arg :list

    # Upload file to the Bandwidth API server
    # @param client [Client] optional client instance to make requests
    # @param name [String] file name
    # @param io [IO] io object file file content (file, string, etc)
    # @param media_type media type of file
    # @example
    #   Media.upload((client, "file.pdf", File.open("/path/to/file.pdf", "r"), "application/pdf")
    def self.upload(client, name, io, media_type = nil)
      connection = client.create_connection()
      # FIXME use streams directly when Faraday will be support streaming
      buf = io.read()
      response = connection.put("/#{client.api_version}#{client.concat_user_path(MEDIA_PATH)}/#{URI.encode(name)}") do |req|
        req.headers['Content-Length'] = buf.size.to_s
        req.headers['Content-Type'] = media_type || 'application/octet-stream'
        req.body = buf
      end
      client.check_response(response)
    end
    wrap_client_arg :upload

    # Download file from Bandwidth API server
    # @param client [Client] optional client instance to make requests
    # @param name [String] file name
    # @return [Array] file content and media type
    # @example
    #   file_content, media_type = Media.download(client, "file.pdf")
    def self.download(client, name)
      connection = client.create_connection()
      response = connection.get("/#{client.api_version}#{client.concat_user_path(MEDIA_PATH)}/#{URI.encode(name)}")
      [response.body, response.headers['Content-Type'] || 'application/octet-stream']
    end
    wrap_client_arg :download

    # Remove file from the Bandwidth API server
    # @param client [Client] optional client instance to make requests
    # @param name [String] file name
    # @example
    #   Media.delete(client, "file.pdf")
    def self.delete(client, name)
      client.make_request(:delete, client.concat_user_path("#{MEDIA_PATH}/#{URI.encode(name)}"))[0]
    end
    wrap_client_arg :delete

    # Get information about a media file
    # @param client [Client] optional client instance to make requests
    # @param name [String] file name
    # @return [Hash] content_type and content_length
    # @example
    #   Media.get_info(client, "file.pdf")
    def self.get_info(client, name)
      headers = client.make_request(:head, client.concat_user_path("#{MEDIA_PATH}/#{URI.encode(name)}"))[1]
      puts headers
      {:content_type => headers[:content_type], :content_length => headers[:content_length]}
    end
    wrap_client_arg :get_info
  end
end


text:
source pHeader.sh

python $prjPath/rbm.py --xTrain "$xTrain" --yTrain "$yTrain" --xTest "$xTest" --yTest "$yTest" --optimize gs --visualize 0

redpajama_set_name: RedPajamaGithub


text:
package com.smartsheet.api.internal;

import com.smartsheet.api.SmartsheetException;
import com.smartsheet.api.internal.http.DefaultHttpClient;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.PaginationParameters;
import com.smartsheet.api.models.Share;
import com.smartsheet.api.models.enums.AccessLevel;
import org.junit.Before;
import org.junit.Test;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class ShareResourcesImplTest extends ResourcesImplBase {

    private ShareResourcesImpl shareResourcesImpl;

    @Before
    public void setUp() throws Exception {
        shareResourcesImpl = new ShareResourcesImpl(new SmartsheetImpl("http://localhost:9090/1.1/", "accessToken",
                new DefaultHttpClient(), serializer), "sheets");
    }

    @Test
    public void testShareResourcesImpl() {
    }

    @Test
    public void testListShares() throws SmartsheetException, IOException {

        server.setResponseBody(new File("src/test/resources/listShares.json"));
        PaginationParameters parameters = new PaginationParameters(false, 1, 1);
        PagedResult<Share> shares = shareResourcesImpl.listShares(2906571706525572L, parameters, false);
        assertTrue("The number of shares returned is incorrect.", shares.getTotalCount() == 2);

        assertEquals("Email attribute of the share is incorrect.", "john.doe@smartsheet.com", shares.getData().get(0).getEmail());
        assertEquals("Email attribute of the share is incorrect.",null, shares.getData().get(1).getEmail());
    }

    @Test
    public void testGetShare() throws SmartsheetException, IOException {
        server.setResponseBody(new File("src/test/resources/getShare.json"));

        Share share = shareResourcesImpl.getShare(1234L, "fhqwhgads");

        assertEquals("Group 1", share.getName());
        assertEquals(AccessLevel.ADMIN, share.getAccessLevel());
        assertEquals("AQAISF82FOeE", share.getId());
    }

    @Test
    public void testUpdateShare() throws SmartsheetException, IOException {
        server.setResponseBody(new File("src/test/resources/updateShare.json"));
        Share share = new Share();
        share.setAccessLevel(AccessLevel.ADMIN);
        Share newShare = shareResourcesImpl.updateShare(123L, share);
        assertEquals(share.getAccessLevel(), newShare.getAccessLevel());
    }

    @Test(expected = IllegalArgumentException.class)
    public void testUpdateShareWithNullShare() throws SmartsheetException {
        shareResourcesImpl.updateShare(123L, null);
    }

    @Test
    public void testDeleteShare() throws SmartsheetException, IOException {
        server.setResponseBody(new File("src/test/resources/deleteShare.json"));

        shareResourcesImpl.deleteShare(1234L, "fhqwhgads");
    }

    @Test
    public void testShareTo() throws SmartsheetException, IOException {
        server.setResponseBody(new File("src/test/resources/shareTo.json"));

        List<Share> shares = new ArrayList<Share>();
        shares.add(new Share.CreateUserShareBuilder().setEmailAddress("john.doe@smartsheet.com")
                .setAccessLevel(AccessLevel.EDITOR).build());
        shares.add(new Share.CreateUserShareBuilder().setEmailAddress("jane.doe@smartsheet.com")
                .setAccessLevel(AccessLevel.EDITOR).build());
        shares.add(new Share.CreateGroupShareBuilder().setGroupId(34343l)
                .setAccessLevel(AccessLevel.EDITOR).build());

        shares = shareResourcesImpl.shareTo(1234L, shares, true);
        assertTrue(shares.size() == 1);
        assertEquals("jane.doe@smartsheet.com", shares.get(0).getEmail());
        assertEquals("Jane Doe", shares.get(0).getName());
    }
}


text:
layout: single
property_name: border-bottom-right-radius
---

    {% include section-nav.html property_name="border-bottom-right-radius" %}

      #border-bottom-right-radius

定义右下角的圆角。

            默认

          border-bottom-right-radius: 0;

去掉右下角的圆角。

Hello world

          border-bottom-right-radius: 20px;

可以使用像素值。

Hello world

          border-bottom-right-radius: 50%;

也可以使用百分比值。在这个例子中,圆角从下边框的中间开始,到右边框的中间结束。

Hello world

          border-bottom-right-radius: 20px 50%;

如果设置了两个值,第一个值设置的是下边框的圆角半径,第二个值设置的是右边框的圆角半径。

Hello world


text:
package com.candc.service;

import android.net.Proxy;
import org.apache.http.HttpHost;
import org.apache.http.HttpVersion;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.params.ClientPNames;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.conn.params.ConnPerRoute;
import org.apache.http.conn.params.ConnRouteParams;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.cookie.*;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.impl.cookie.BrowserCompatSpec;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.HttpContext;

import java.io.IOException;

public class HttpClientWrapper {
    private static HttpClientWrapper mInstance;

    private DefaultHttpClient mHttpClient;

    public static HttpClientWrapper getInstance() {
        return mInstance;
    }

    private static void createHttpClient() {
        mInstance = new HttpClientWrapper();

        HttpRequestRetryHandler retryHandler = new HttpRequestRetryHandler() {
            @Override
            public boolean retryRequest(IOException e, int executionCount, HttpContext context) {
                return executionCount < 3;
            }

        };

        HttpParams params = new BasicHttpParams();
        HttpConnectionParams.setConnectionTimeout(params, 5000);
        HttpConnectionParams.setSoTimeout(params, 50000);
        HttpConnectionParams.setSocketBufferSize(params, 8192);
        HttpConnectionParams.setTcpNoDelay(params, true);
        HttpConnectionParams.setStaleCheckingEnabled(params, false);

        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
        HttpProtocolParams.setContentCharset(params, "utf-8");
        HttpProtocolParams.setUseExpectContinue(params, false);

        ConnManagerParams.setMaxTotalConnections(params, 6);
        ConnManagerParams.setMaxConnectionsPerRoute(params, new ConnPerRoute() {
            @Override
            public int getMaxForRoute(HttpRoute httpRoute) {
                return 6;
            }
        });

        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        ThreadSafeClientConnManager connManager = new ThreadSafeClientConnManager(params, registry);

        DefaultHttpClient httpclient = new DefaultHttpClient(connManager, params);

        CookieSpecFactory csf = new CookieSpecFactory() {
            public CookieSpec newInstance(HttpParams params) {

                return	new BrowserCompatSpec() {

                    @Override
                    public void validate(Cookie cookie, CookieOrigin origin)   throws MalformedCookieException {

                    	String domain = cookie.getDomain();
                    	String host = origin.getHost();
                    	android.util.Log.d("HttpClientWrapper", "BrowserCompatSpec validate cookie.getDomain: " + domain + " origin.getHost: " + host);

                    }
                };
            }
        };
        httpclient.getCookieSpecs().register("easy", csf);
        httpclient.getParams().setParameter(   ClientPNames.COOKIE_POLICY, "easy");

        mInstance.mHttpClient = httpclient;
        mInstance.mHttpClient.setHttpRequestRetryHandler(retryHandler);
    }

    private HttpClientWrapper() { }

    public static synchronized DefaultHttpClient getHttpClient() {
        if (mInstance == null || mInstance.mHttpClient == null) {
            createHttpClient();
        }
        return mInstance.mHttpClient;
    }

    @SuppressWarnings("deprecation")
	public static void setUseProxy (boolean useProxy) {
        HttpParams params = getHttpClient().getParams();

        if (useProxy) {
            try {
                params.setParameter(ConnRouteParams.DEFAULT_PROXY, new HttpHost(Proxy.getDefaultHost(), Proxy.getDefaultPort()));
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            params.removeParameter(ConnRouteParams.DEFAULT_PROXY);
        }
    }
}


text:
class TextError(Exception):
    pass

class AmountError(Exception):
    pass

def parz_mov(line):
    """ return word and import of a string line"""
    amount = None
    text = []
    line = line.split(" ")
    for token in line:
        try:
            amount = float(token)
        except ValueError:
            if token != 'EUR':
                text.append(token)
    print(amount)
    if len(text) == 0:  # or len(amount) == 0:
        raise TextError('Errore! non hai inserito correttamente il testo ')

    if amount is None:
        raise AmountError('Errore! non hai inserito correttamente l\'importo')

    return text, amount

def test():
    print('Running tests . . . ')
    assert parz_mov('enel 30.5 EUR') == (['enel'], 30.5)
    assert parz_mov('enel EUR 30.5') == (['enel'], 30.5)
    assert parz_mov('enel 30.5 elettricita') == (['enel', 'elettricita'], 30.5)
    print('All tests ok!')


text:
<?php

namespace User\GeneralBundle\Controller;

# General
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

# Entity
use User\GeneralBundle\Entity\User;
use User\GeneralBundle\Entity\LastVisit;
use User\GeneralBundle\Entity\BonusLastVisit;

class DefaultController extends Controller {

    public function getConfig() {
        $rep = $this->getDoctrine()
            ->getRepository('UserGeneralBundle:Config');

        $conf = $rep->findAll();

        $config = array();
        foreach ($conf as $c) {
            $config[ $c->getName() ] = $c->getValue();
        }

        return $config;
    }

    public function lookupUserByUid($id) {
        $rep = $this->getDoctrine()->getRepository('UserGeneralBundle:User');
        $q = $rep->createQueryBuilder('p')
            ->where('p.uid = :uid')
            ->setParameters(array(
                'uid' => $id
            ))
            ->getQuery();

        return $q->getResult();
    }

    public function getUserAction(Request $r) {
        $uid = $r->get('uid');

        $user = $this->lookupUserByUid($uid);

        if (!$user) {
            $answer = array( 'error' => 'user not found' );
            $response = new Response(json_encode($answer));
            return $response;
        } else {
            $user = $user[0];

            $serializer = $this->get('serializer');
            $json = $serializer->serialize($user, 'json');
            $response = new Response($json);
            return $response;
        }
    }

    public function registerUserAction(Request $r) {
        $user = $this->lookupUserByUid($r->get('uid'));

        if ($user) {
            $answer = array( 'error' => 'user exists' );
            $response = new Response(json_encode($answer));
            return $response;
        }

        $email_arr = array();
        preg_match("/my.mail.ru\/(\S+)\/(\S+)\//", $r->get('link'), $email_arr);
        $box   = $email_arr[1];
        $login = $email_arr[2];
        $email = '';

        if ('corp' == $box) {
            $email = "$login@corp.mail.ru";
        } else {
            $email = "$login@$box.ru";
        }

        $name = $r->get('first_name').' '.$r->get('last_name');
        if (strlen($name) < 3) {
            $name = $r->get('nick');
        }

        # Register new User
        $user = new User;

        $user->setUid( $r->get('uid') );

        $user->setGender( $r->get('sex') );
        $user->setBirthday( $r->get('birthday') );

        $user->setFirstName( $r->get('first_name') );
        $user->setLastName( $r->get('last_name') );
        $user->setNick( $r->get('nick') );

        $user->setEmail( $email );
        $user->setBox( $box );
        $user->setLogin( $login );
        $user->setLink( $r->get('link') );

        $user->setRefType( $r->get('referer_type') );
        $user->setRefId( $r->get('referer_id') );

        $location = $r->get('location');

        if (isset($location)) {

            if (isset($location['country'])) {
                $user->setCountryId( $location['country']['id'] );
                $user->setCountryName( $location['country']['name'] );
            }

            if (isset($location['city'])) {
                $user->setCityId( $location['city']['id'] );
                $user->setCityName( $location['city']['name'] );
            }

            if (isset($location['region'])) {
                $user->setRegionId( $location['region']['id'] );
                $user->setRegionName( $location['region']['name'] );
            }
        }

        # Default balance value for newbie
        $config = $this->getConfig();
        $user->setBalance($config['start_bonus']);

        $em = $this->getDoctrine()->getManager();
        $em->persist($user);
        $em->flush();

        // Set user balance
        $redis = $this->container->get('snc_redis.default');
        $redis->set('ub_'.$user->getId(), $config['start_bonus']);

        $serializer = $this->get('serializer');
        $json = $serializer->serialize($user, 'json');
        $response = new Response($json);
        return $response;

        $answer = array( 'error' => 'user not found' );
        $response = new Response(json_encode($answer));
        return $response;
    }

    public function changeBalanceAction(Request $r) {
        $uid = $r->get('uid');
        $balance = $r->get('balance') ? $r->get('balance') : 0;

        $user = $this->lookupUserByUid($uid);

        if (!$user) {
            $answer = array( 'error' => 'user not found' );
            $response = new Response(json_encode($answer));
            return $response;

        } else {
            $user = $user[0];

            $user->setBalance($balance);

            $em = $this->getDoctrine()->getManager();
            $em->persist($user);
            $em->flush();

            $serializer = $this->get('serializer');
            $json = $serializer->serialize($user, 'json');
            $response = new Response($json);
            return $response;
        }
    }

    public function getLastVisitAction(Request $r) {
        $uid = $r->get('uid');

        $now = new \DateTime('NOW');
        $last_visit = '';

        # Get Last visit time
        $rep   = $this->getDoctrine()->getRepository('UserGeneralBundle:LastVisit');
        $visit = $rep->createQueryBuilder('p')
            ->where('p.uid = :uid')
            ->setParameters(array(
                'uid' => $uid
            ))
            ->getQuery()
            ->getResult();

        if (count($visit) > 0) {
            $visit = $visit[0];
            $last_visit = $visit->getUpdatedAt();

            $visit->setUpdatedAt( $now );

        } else {
            $last_visit = new \DateTime("2013-09-19 00:00:00");

            $visit = new LastVisit;
            $visit->setUid($uid);
            $visit->setUpdatedAt( $now );
        }

        # Update it
        $em = $this->getDoctrine()->getManager();
        $em->persist($visit);
        $em->flush();

        $answer = array( 'last_visit' => $last_visit );
        $response = new Response(json_encode($answer));
        return $response;
    }

    public function getBonusLastVisitAction(Request $r) {
        $uid = $r->get('uid');

        $last_visit = '';

        # Get Last visit time
        $rep   = $this->getDoctrine()->getRepository('UserGeneralBundle:BonusLastVisit');
        $visit = $rep->createQueryBuilder('p')
            ->where('p.uid = :uid')
            ->setParameters(array(
                'uid' => $uid
            ))
            ->getQuery()
            ->getResult();

        if (count($visit) > 0) {
            $visit = $visit[0];
            $last_visit = $visit->getUpdatedAt();
        } else {
            $last_visit = new \DateTime("2013-09-19 00:00:00");

            $visit = new BonusLastVisit;
            $visit->setUid($uid);
            $visit->setUpdatedAt( $last_visit );
        }

        # Update it
        $em = $this->getDoctrine()->getManager();
        $em->persist($visit);
        $em->flush();

        $answer = array( 'last_visit' => $last_visit->format("U") );
        $response = new Response(json_encode($answer));
        return $response;
    }

    public function updateBonusLastVisitAction(Request $r) {
        $uid = $r->get('uid');

        # Get Last visit time
        $rep   = $this->getDoctrine()->getRepository('UserGeneralBundle:BonusLastVisit');
        $visit = $rep->createQueryBuilder('p')
            ->where('p.uid = :uid')
            ->setParameters(array(
                'uid' => $uid
            ))
            ->getQuery()
            ->getResult();

        if (count($visit) > 0) {
            $now = new \DateTime('NOW');

            $visit = $visit[0];
            $visit->setUpdatedAt( $now );

            $em = $this->getDoctrine()->getManager();
            $em->persist($visit);
            $em->flush();

            $answer = array( 'done' => 'last time updated' );
            $response = new Response(json_encode($answer));
            return $response;
        } else {
            $answer = array( 'error' => 'user not found' );
            $response = new Response(json_encode($answer));
            return $response;
        }
    }
}


text:
var RBTree = require('bintrees').RBTree,
    fnv = require('hash.fnv'),
    assert = require('assert')

function Aplomb (options) {
    this.compare = options.compare
    this.extract = options.extract
    this.bucketCount = options.bucketCount
    this.delegations = new RBTree(compare)
    this.connections = new RBTree(compare)

    function compare (a, b) { return options.compare(a.key, b.key) }
}

Aplomb.prototype.getIndex = function (connection) {
    var key = this.extract(connection),
        hash = fnv(0, new Buffer(key), 0, Buffer.byteLength(key))
    return hash % this.bucketCount
}

Aplomb.prototype.getDelegates = function (connection) {
    var index = this.getIndex(connection),
        delegates = []

    this.delegations.reach(function (delegation) {
        if (delegation.delegates.length != 0) {
            delegates.push(delegation.buckets[index])
        }
    })

    return delegates.filter(function (del, i, set) {
        return (set.indexOf(del) == i)
    })
}

Aplomb.prototype.getDelegate = function (connection) {
    var delegation = this.delegations.max()
    if (delegation == null || delegation.delegates.length == 0) return null
    return delegation.buckets[this.getIndex(connection)]
}

Aplomb.prototype.addDelegate = function (delegate) {

    if (this.delegations.size) {
        var delegation = this.delegations.max(),
            delegates = delegation.delegates

        if (delegates.length) {
            var buckets = delegation.buckets.slice(),
                redist = Array.apply(null, Array(delegates.length)).map(Number.prototype.valueOf, 0)

            delegates.push(delegate)

            var total = Math.ceil(buckets.length / delegates.length)
            var each = Math.ceil(total / (delegates.length - 1))

            for (var b = 0, I = buckets.length; b < I && total; b++) {
                if (redist[delegates.indexOf(buckets[b])] == each) continue
                redist[delegates.indexOf(buckets[b])]++
                buckets[b] = delegate
                total--
            }

            return { buckets: buckets, delegates: delegates }
        }
    }

    return {
        buckets: Array.apply(null, Array(this.bucketCount)).map(String.prototype.toString, delegate),
        delegates: [ delegate ]
    }

}

Aplomb.prototype.removeDelegate = function (delegate) {
    assert(this.delegations.size, 'No delegations found')

    var delegation = this.delegations.max()
    if (delegation.delegates.length > 1) {
        var delegates = delegation.delegates.slice(),
            buckets = delegation.buckets.slice(),
            index = delegates.indexOf(delegate)

        assert(~index, 'index not found')
        delegates.splice(index, 1)

        for (var i = 0, b = 0, I = buckets.length; b < I; b++) {
            if (buckets[b] == delegate) {
                buckets[b] = delegates[i++ % delegates.length]
            }
        }

        return { buckets: buckets, delegates: delegates }
    }

    return { buckets: null, delegates: [] }
}

Aplomb.prototype.replaceDelegate = function (oldDelegate, newDelegate) {
    var delegation = this.delegations.max(),
        buckets = delegation.buckets.slice()

    delegates = delegation.delegates.map(function (delegate) {
        return delegate == oldDelegate ? newDelegate : delegate
    })

    for (var b = 0, I = buckets.length; b < I; b++) {
        if (delegation.buckets[b].url == oldDelegate) {
            buckets[b].url = newDelegate
        }
    }

    return { buckets: buckets, delegates: delegates }
}

Aplomb.prototype.addConnection = function (key, connection) {
    var tree = this.connections.find(key)
    if (tree == null) {
        tree = {
            key: key,
            connections: new RBTree(function (a, b) {
                a = this.extract(a)
                b = this.extract(b)
                return a < b ? -1 : a > b ? 1 : 0
            }.bind(this))
        }
        this.connections.insert(tree)
    }
    tree.connections.insert(connection)
}

Aplomb.prototype.removeConnection = function (connection) {
    var tree, iterator = this.connections.iterator()

    while (tree = iterator.prev()) {
        tree.connections.remove(connection)
        if (tree.connections.size == 0) {
            this.connections.remove(tree)
        }
    }
}

Aplomb.prototype.getConnection = function (connection) {
    var delegate, tree, iterator = this.connections.iterator()

    while (tree = iterator.prev()) {
        if (delegate = tree.connections.find(connection)) {
            return delegate
        }
    }

    return null
}

Aplomb.prototype.getDelegations = function () {
    var delegations = []
    this.delegations.reach(function (delegation) {
        delegations.push(delegation)
    })
    return delegations
}

Aplomb.prototype.addDelegation = function (key, delegation) {
    this.delegations.insert({
        key: key,
        buckets: delegation.buckets,
        delegates: delegation.delegates
    })
}

Aplomb.prototype.removeDelegation = function (key) {
    return this.delegations.remove({ key: key })
}

Aplomb.prototype.evictable = function (delegate) {
    var tree,
        compare = this.compare,
        latest = this.delegations.max(),
        iterator = this.connections.iterator()

    while(((tree = iterator.next()) != null) && compare(tree.key, latest.key) != 0) {
        while (tree.connections.size > 0) {
            var connection = tree.connections.min()
            if (this.getDelegate(connection) == delegate) {
                tree.connections.remove(connection)
                this.addConnection(latest.key, connection)
            } else {
                return connection
            }
        }
    }
    return null
}

module.exports = Aplomb


text:
package org.aikodi.chameleon.analysis.dependency;

import org.aikodi.chameleon.analysis.Analysis;
import org.aikodi.chameleon.core.declaration.Declaration;
import org.aikodi.chameleon.core.element.Element;
import org.aikodi.chameleon.core.lookup.LookupException;
import org.aikodi.chameleon.core.reference.CrossReference;
import org.aikodi.chameleon.util.Lists;
import org.aikodi.rejuse.action.Nothing;
import org.aikodi.rejuse.contract.Contracts;
import org.aikodi.rejuse.data.tree.TreeStructure;
import org.aikodi.rejuse.function.Function;
import org.aikodi.rejuse.predicate.Predicate;
import org.aikodi.rejuse.predicate.UniversalPredicate;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * An analysis the reports dependencies between elements and declarations.
 *
 * You can choose of which elements you want to analyze the dependencies via
 * type parameter E, and the corresponding class object passed to the
 * constructor. You can choose in which dependencies you are interested in a
 * number of ways:
 *
 *

 *
Via a predicate that is used to filter the elements of which the
 * dependencies must be computed.

 *
Via a predicate that filter the cross-references that must be analyzed.
 *

 *
Via a function that maps dependency declarations to other dependency
 * declarations. This can for example be used to map arrays to their component
 * types. Typically a dependency on A[] is just a dependency on A. If there are
 * no such cases in your analysis, simply provide the identity function.
 *
Via a predicate that filters the resulting dependency declaration.

 *
Via a predicate that filters the entire dependency. Only use this when
 * necessary as it is applied last. If the criteria for element,
 * cross-reference, and dependency declaration are independent, it is best to
 * use the more fine-grained predicates. That way, pruning happens earlier,
 * avoiding pointless computations.

 *

 *
 * In the most interesting cases, E and T will typically be the same. Usually we
 * want to analyze dependencies between types or modules or other high-level
 * concepts. But you could also analyze on which methods the body of a for-loop
 * depends.
 *
 * @author Marko van Dooren
 *
 * @param <E> The type of the elements of which the dependencies must be
 *          analyzed.
 * @param <D> The type of the declarations that are analyzed as possible
 *          dependencies.
 */
public class DependencyAnalysis<S extends Element, D extends Element> extends Analysis<Element, DependencyResult, LookupException> {

  /**
   * Create a new dependency analysis.
   *
   * @param sourcePredicate A predicate that determines of which elements the
   *          dependencies must be computed.
   * @param crossReferencePredicate A predicate that determines which
   *          cross-references must be analyzed.
   * @param decomposer A function that is used to decompose an algebraic
   *        declaration (such as a union type) into its components. If the
   *        given value is null, and identity function is used instead.
   * @param declarationPredicate A predicate that determines whether a declaration
   *          is the target of a dependency. After a cross-reference has been
   *          resolved, the logical structure of the resolved element (including
   *          the resolved element itself) is traversed to find the nearest
   *          declaration that matches the predicate. The matching declaration
   *          is the target of the dependency.
   * @param dependencyPredicate A predicate that determines whether a given
   *          dependency is recorded.
   * @param historyFilter
   */
  public DependencyAnalysis(UniversalPredicate<S, Nothing> sourcePredicate,
      UniversalPredicate<? super CrossReference<?>, Nothing> crossReferencePredicate,
      Function<Declaration, List<Declaration>, Nothing> decomposer,
      UniversalPredicate<D, Nothing> declarationPredicate,
      UniversalPredicate<? super Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> dependencyPredicate,
      HistoryFilter<S, D> historyFilter) {
    this(sourcePredicate.type(), sourcePredicate, crossReferencePredicate, declarationPredicate.type(),
        decomposer, declarationPredicate, dependencyPredicate, historyFilter);
  }

  public <C extends CrossReference<?>> DependencyAnalysis(
      Class<S> sourceType,
      Predicate<S, Nothing> sourcePredicate,
      Class<C> crossReferenceType,
      Predicate<C, Nothing> crossReferencePredicate,
      Class<D> targetType,
      Predicate<? super D, Nothing> targetPredicate,
      Function<Declaration, List<Declaration>, Nothing> decomposer,
      Predicate<? super Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> dependencyPredicate,
      HistoryFilter<S, D> historyFilter) {
    super(null,null);
    _sourcePredicate = null;
    _dependencyPredicate = null;
    _dependencyFinder = null;
    _decomposer = null;
    _historyFilter = null;
    _crossReferencePredicate = null;

  }

  public DependencyAnalysis(Class<S> sourceType,
      Predicate<? super S, Nothing> sourcePredicate,
      UniversalPredicate<? super CrossReference<?>, Nothing> crossReferencePredicate,
      Class<D> targetType,
      Function<Declaration, List<Declaration>, Nothing> decomposer,
      UniversalPredicate<? super D, Nothing> targetPredicate,
      UniversalPredicate<? super Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> dependencyPredicate,
      HistoryFilter<S, D> historyFilter) {
    super(Element.class, new DependencyResult());
    Contracts.notNull(sourceType, "The source type should not be null");
    Contracts.notNull(sourcePredicate, "The source predicate should not be null");
    Contracts.notNull(crossReferencePredicate, "The cross-reference predicate should not be null");
    Contracts.notNull(targetType, "The target type should not be null");
    //    Contracts.notNull(decomposer, "The decomposer should not be null");
    Contracts.notNull(targetPredicate, "The target predicate should not be null");
    Contracts.notNull(dependencyPredicate, "The dependency predicate should not be null");
    _sourcePredicate = UniversalPredicate.of(sourceType, sourcePredicate);
    _crossReferencePredicate = crossReferencePredicate.makeUniversal(CrossReference.class);
    _dependencyPredicate = _noSelfReference.and(dependencyPredicate);
    if(decomposer == null) {
      _decomposer = d -> Lists.create(d);
    } else {
      _decomposer = decomposer;
    }
    _historyFilter = historyFilter;
    _dependencyFinder = UniversalPredicate.of(targetType, d -> targetPredicate.eval(d));

  }

  private UniversalPredicate<Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> _noSelfReference = (UniversalPredicate) new UniversalPredicate<Dependency, Nothing>(
      Dependency.class) {
    @Override
    public boolean uncheckedEval(Dependency t) throws Nothing {
      return t.source() != t.target();
    }
  };

  public static interface HistoryFilter<E extends Element, D extends Element> {

    public default boolean process(Dependency<E, CrossReference<?>, D> dependency, DependencyResult result) {
      return true;
    }

    public default boolean processSource(E source, DependencyResult result) {
      return true;
    }

    public default HistoryFilter<E, D> and(HistoryFilter<E, D> other) {
      if (other instanceof NOOP) {
        return this;
      } else {
        return new AndHistoryFilter<>(this, other);
      }
    }
  }

  public static class AndHistoryFilter<E extends Element, D extends Element> implements HistoryFilter<E, D> {
    private HistoryFilter<E, D> _first;
    private HistoryFilter<E, D> _second;

    public AndHistoryFilter(HistoryFilter<E, D> first, HistoryFilter<E, D> second) {
      _first = first;
      _second = second;
    }

    @Override
    public boolean process(Dependency<E, CrossReference<?>, D> dependency, DependencyResult result) {
      return _first.process(dependency, result) && _second.process(dependency, result);
    }

    @Override
    public boolean processSource(E source, DependencyResult result) {
      return _first.processSource(source, result) && _second.processSource(source, result);
    }
  }

  public static class NOOP<E extends Element, D extends Declaration> implements HistoryFilter<E, D> {
    @Override
    public HistoryFilter<E, D> and(HistoryFilter<E, D> other) {
      return other;
    }
  }

  private final UniversalPredicate<D, Nothing> _dependencyFinder;

  private final UniversalPredicate<? super S, Nothing> _sourcePredicate;

  private final UniversalPredicate<? super CrossReference<?>, Nothing> _crossReferencePredicate;

  public UniversalPredicate<? super Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> dependencyPredicate() {
    return _dependencyPredicate;
  }

  private final UniversalPredicate<? super Dependency<? super S, ? super CrossReference<?>, ? super D>, Nothing> _dependencyPredicate;

  private final Function<Declaration, List<Declaration>, Nothing> _decomposer;

  private HistoryFilter<S, D> _historyFilter;

  @Override
  public void doEnter(Element object) {
    if (_sourcePredicate.eval(object)) {
      _elements.addLast((Element) object);
    }
  }

  @Override
  public <N extends Exception> void exit(TreeStructure<?, N> tree) {
    Object object = tree.node();
    if (!_elements.isEmpty()) {
      if (_elements.getLast() == object) {
        _elements.removeLast();
      }
    }
  }

  private LinkedList<Element> _elements = new LinkedList<>();

  private List<D> map(List<Declaration> initial) {
    java.util.function.Function<? super Declaration, ? extends D> mapper = i -> i.logical().nearestAncestorOrSelf(_dependencyFinder);
    return initial.stream().map(mapper).filter(d -> d != null).collect(Collectors.toList());
  }

  @SuppressWarnings("unchecked")
  @Override
  protected void analyze(Element element) throws LookupException {
      if (!_elements.isEmpty()) {
        if (_crossReferencePredicate.eval(element)) {
          CrossReference<?> cref = (CrossReference<?>) element;
          // This is the expensive part. File loading is relatively large part
          // if the documents have not yet been loaded.
          Declaration declaration = cref.getElement();
          List<Declaration> initial = _decomposer.apply(declaration);
          List<D> targets = map(initial);

          boolean fixed = false;
          while(! fixed) {
            List<D> tmp = new ArrayList<>();
            for(D target: targets) {
              if(target instanceof Declaration) {
                List<Declaration> decomp = _decomposer.apply((Declaration) target);
                List<D> newTargets = map(decomp);
                tmp.addAll(newTargets);
              } else {
                tmp.add(target);
              }
            }
            if(tmp.containsAll(targets) && targets.containsAll(tmp)) {
              fixed = true;
            }
            targets = tmp;
          }

          for(D target: targets) {
            for (Element e : _elements) {
              Dependency dependency = new Dependency<>(e, cref, target);
              if (_dependencyPredicate.eval(dependency)) {
                DependencyResult result = result();
                if (_historyFilter.process(dependency, result)) {
                  result.add(dependency);
                }
              }
            }
          }
        }
      }
  }

}


text:
Hello the fucking world!

public class Iterables {

    public static <E> void forEach(
            Iterable<? extends E> elements, BiConsumer<Integer, ? super E> action) {
        Objects.requireNonNull(elements);
        Objects.requireNonNull(action);

        int index = 0;
        for (E element : elements) {
            action.accept(index++, element);
        }
    }
}


text:
#ifndef TENSORFLOW_CORE_PROFILER_UTILS_XPLANE_UTILS_H_
#define TENSORFLOW_CORE_PROFILER_UTILS_XPLANE_UTILS_H_

#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/strings/string_view.h"
#include "tensorflow/core/platform/types.h"
#include "tensorflow/core/profiler/protobuf/xplane.pb.h"
#include "tensorflow/core/profiler/utils/timespan.h"
#include "tensorflow/core/profiler/utils/trace_utils.h"

namespace tensorflow {
namespace profiler {

// Returns a Timespan from an XEvent.
// WARNING: This should only be used when comparing events from the same XLine.
inline Timespan XEventTimespan(const XEvent& event) {
  return Timespan(event.offset_ps(), event.duration_ps());
}

// Returns the plane with the given name or nullptr if not found.
const XPlane* FindPlaneWithName(const XSpace& space, absl::string_view name);
XPlane* FindMutablePlaneWithName(XSpace* space, absl::string_view name);

// Returns the planes with the given names, if found.
std::vector<const XPlane*> FindPlanesWithNames(
    const XSpace& space, const std::vector<absl::string_view>& names);

// Returns the plane with the given name in the container. If necessary, adds a
// new plane to the container.
XPlane* FindOrAddMutablePlaneWithName(XSpace* space, absl::string_view name);

// Returns all the planes with a given prefix.
std::vector<const XPlane*> FindPlanesWithPrefix(const XSpace& space,
                                                absl::string_view prefix);
std::vector<XPlane*> FindMutablePlanesWithPrefix(XSpace* space,
                                                 absl::string_view prefix);

// Returns the plane with the given id or nullptr if not found.
const XLine* FindLineWithId(const XPlane& plane, int64 id);

XStat* FindOrAddMutableStat(const XStatMetadata& stat_metadata, XEvent* event);

void RemovePlane(XSpace* space, const XPlane* plane);
void RemovePlanes(XSpace* space, const std::vector<const XPlane*>& planes);
void RemoveLine(XPlane* plane, const XLine* line);
void RemoveEvents(XLine* line,
                  const absl::flat_hash_set<const XEvent*>& events);

void RemoveEmptyPlanes(XSpace* space);
void RemoveEmptyLines(XPlane* plane);

// Sort lines in plane with a provided comparator.
template <class Compare>
void SortXLinesBy(XPlane* plane, Compare comp) {
  std::sort(plane->mutable_lines()->pointer_begin(),
            plane->mutable_lines()->pointer_end(), comp);
}

class XLinesComparatorByName {
 public:
  bool operator()(const XLine* a, const XLine* b) const {
    auto& line_a = a->display_name().empty() ? a->name() : a->display_name();
    auto& line_b = b->display_name().empty() ? b->name() : b->display_name();
    return line_a < line_b;
  }
};

// Sorts each XLine's XEvents by offset_ps (ascending) and duration_ps
// (descending) so nested events are sorted from outer to innermost.
void SortXPlane(XPlane* plane);
// Sorts each plane of the XSpace.
void SortXSpace(XSpace* space);

// Functor that compares XEvents for sorting by timespan.
struct XEventsComparator {
  bool operator()(const XEvent* a, const XEvent* b) const;
};

// Returns a sorted vector of all XEvents in the given XPlane.
template <class Compare>
std::vector<XEvent*> GetSortedEvents(XPlane* plane, Compare comp,
                                     bool include_derived_events = false) {
  std::vector<XEvent*> events;
  for (XLine& line : *plane->mutable_lines()) {
    if (!include_derived_events && IsDerivedThreadId(line.id())) continue;
    for (XEvent& event : *line.mutable_events()) {
      events.push_back(&event);
    }
  }
  absl::c_sort(events, XEventsComparator());
  return events;
}

// Normalize timestamps by time-shifting to start_time_ns_ as origin.
void NormalizeTimestamps(XPlane* plane, uint64 start_time_ns);
void NormalizeTimestamps(XSpace* space, uint64 start_time_ns);

// Merges src_plane into dst_plane. Both plane level stats, lines, events and
// event level stats are merged. If src_plane and dst_plane both have the same
// line, which have different start timestamps, we will normalize the events
// offset timestamp correspondingly.
void MergePlanes(const XPlane& src_plane, XPlane* dst_plane);

// Merges each plane with a src_planes, into the dst_plane.
void MergePlanes(const std::vector<const XPlane*>& src_planes,
                 XPlane* dst_plane);

// Plane's start timestamp is defined as the minimum of all lines' start
// timestamps. If zero line exists, return 0;
uint64 GetStartTimestampNs(const XPlane& plane);

// Returns true if there are no XEvents.
bool IsEmpty(const XSpace& space);

}  // namespace profiler
}  // namespace tensorflow

#endif  // TENSORFLOW_CORE_PROFILER_UTILS_XPLANE_UTILS_H_


text:
<?php

function closure_generator_tests() {
    $bad_generator = function() : Generator {
        return 1;  // Should print an error
    };

    $bad_generator2 = function() : Iterator {
        return 1;  // Should print an error
    };

    $bad_generator3 = function () : Traversable {
        return 1;  // Should print an error
    };

    /** @return int */
    $bad_generator4 = function () {
        yield;
        return 1;  // Should print an error
    };

    $good_generator = function() : Generator {
        yield 1;
        return 1;
    };

    $good_generator2 = function() use($good_generator) : Generator {
        return $good_generator();
    };

    $good_generator3 = function() : Traversable {
        if (rand()) { return 1; }
        yield;
    };

    /** @return Traversable */
    $good_generator3b = function() {
        if (rand()) { return 1; }
        yield;
    };

    $good_generator3c = function() use($good_generator) : Generator {
        if (rand()) { return 1; }
        yield from $good_generator();
    };

    $good_generator4 = function() use($good_generator) : Generator {
        return (yield from $good_generator());
    };

    /** @return Iterator */
    $good_generator5 = function() {
        yield (new stdClass());
    };
}


text:
BUILD=1 npm run build-site

# Push the site live, requires credentials, open a bug
# if you need to be able to push the site
scp -r docs/_site/* pouchdb@pouchdb.com:/home/pouchdb/www/pouchdb.com/


text:
A collection of node-red nodes for IoT sensors

### Installation

In the root directory of your Node-RED install, run the following command:

        npm install node-red-contrib-{nodename}


text:
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
    internal sealed class EXPRCALL : EXPR
    {
        private EXPR _OptionalArguments;
        public EXPR GetOptionalArguments() { return _OptionalArguments; }
        public void SetOptionalArguments(EXPR value) { _OptionalArguments = value; }

        private EXPRMEMGRP _MemberGroup;
        public EXPRMEMGRP GetMemberGroup() { return _MemberGroup; }
        public void SetMemberGroup(EXPRMEMGRP value) { _MemberGroup = value; }

        public MethWithInst mwi;

        public PREDEFMETH PredefinedMethod;

        public NullableCallLiftKind nubLiftKind;
        public EXPR pConversions;
        public EXPR castOfNonLiftedResultToLiftedType;
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
   Copyright 2009 TiTA Project, Vienna University of Technology

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

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

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>at.ac.tuwien.ifs</groupId>
  <artifactId>tita-parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0.0-SNAPSHOT</version>
  <name>tita-parent</name>

  <licenses>
    <license>
      <name>Propietary</name>
      <comments>(C) 2009 - 2010 TiTA</comments>
    </license>
  </licenses>

  <properties>

    <!-- Library Versions -->
    <spring.version>2.5.6.SEC01</spring.version>
    <jdk.version>1.6</jdk.version>
    <jetty.version>6.1.15</jetty.version>
    <persistence.version>1.0</persistence.version>
    <hibcore.version>3.3.2.GA</hibcore.version>
    <hibentity.version>3.4.0.GA</hibentity.version>

    <slf4j.version>1.5.8</slf4j.version>
    <jgit.version>0.5.0</jgit.version>
    <log4j.version>1.2.14</log4j.version>
    <commons.lang.version>2.4</commons.lang.version>
    <commons.dbcp.version>1.2.2</commons.dbcp.version>
    <junit.version>4.4</junit.version>
    <mockito.version>1.7</mockito.version>
    <xmlunit.version>1.3</xmlunit.version>
    <jcommon.version>1.0.16</jcommon.version>
    <jasperreports.version>3.6.1</jasperreports.version>
    <jfreechart.version>1.0.13</jfreechart.version>
    <wicket.version>1.4.5</wicket.version>
    <velocity.version>1.4</velocity.version>
    <jhighlight.version>1.0</jhighlight.version>
    <portlet.version>1.0</portlet.version>
    <httpunit.version>1.6.1</httpunit.version>
    <cglib-nodep.version>2.2</cglib-nodep.version>
    <portlet.version>1.0</portlet.version>
    <httpunit.version>1.6.1</httpunit.version>
    <commons-digester.version>2.0</commons-digester.version>
    <itext.version>2.1.7</itext.version>
    <commons-collections.version>20040616</commons-collections.version>
    <supercsv.version>1.52</supercsv.version>
    <spiffy.version>0.05</spiffy.version>
	<bouncycastle.version>138</bouncycastle.version>

    <!-- DB Versions -->
    <postgreSql.version>8.4-701.jdbc4</postgreSql.version>
    <h2db.version>1.2.133</h2db.version>
    <mySql.version>5.1.10</mySql.version>

    <!-- mantis libs versions -->
    <mantis.connect.version>1.1.1.0</mantis.connect.version>
    <axis.version>1.4</axis.version>
    <wsdl4j.version>1.5.1</wsdl4j.version>
    <axis.ant.version>1.4</axis.ant.version>
    <commons.discovery.version>0.2</commons.discovery.version>
    <commons.logging.version>1.1.1</commons.logging.version>
    <javax.xml.rpc.version>1.1</javax.xml.rpc.version>

    <wicket-security.version>1.4-SNAPSHOT</wicket-security.version>

    <!-- Plugin Version -->
    <docbkx.version>2.0.7</docbkx.version>
    <maven.plugin.surefire>2.4.3</maven.plugin.surefire>
    <maven.plugin.checkstyle>2.3</maven.plugin.checkstyle>
    <maven.plugin.cobertura>1.4</maven.plugin.cobertura>
  </properties>

  <description>
	Parent project of all TiTA subprojects.
  </description>

  <modules>
    <module>tita-entity</module>
    <module>tita-dao</module>
    <module>tita-issuetracker-integration</module>
    <module>tita-jasperreports</module>
    <module>tita-business</module>
    <module>tita-wicket</module>
  </modules>

  <inceptionYear>2009</inceptionYear>

  <scm>
    <connection>scm:git:git://github.com/tita/tita.git</connection>
    <developerConnection>scm:git:git@github.com:tita/tita.git</developerConnection>
    <url>http://github.com/tita/tita</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>.....</url>
  </issueManagement>

  <ciManagement>
    <!--Hudson -->
  </ciManagement>

  <mailingLists>

    <mailingList>
      <name>Developer Mailing List</name>
      <post>tita_ase@googlegroups.com</post>
      <archive>http://groups.google.com/group/tita_ase</archive>
    </mailingList>

  </mailingLists>

  <developers>
    <developer>
      <id>api</id>
      <name>Christoph Zehetner</name>
      <organization>ASE Group 10 TiTA</organization>
      <email>chris.zehetner@gmail.com</email>
      <timezone>+1</timezone>
      <roles>
        <role>Team coordinator</role>
        <role>Developer</role>
        <role>Git Expert</role>
      </roles>
    </developer>
    <developer>
      <id>fwa</id>
      <name>Johannes Ferner</name>
      <organization>ASE Group 10 TiTA</organization>
      <email>johannes_ferner@yahoo.de</email>
      <timezone>+1</timezone>
      <roles>
        <role>2nd Team coordniator</role>
        <role>Developer</role>
        <role>Spring Expert</role>
      </roles>
    </developer>
    <developer>
      <name>Herbert Brunner</name>
      <email>herbert.brunner@gmail.com</email>
      <organization>ASE Group 10 TiTA</organization>
      <timezone>+1</timezone>
      <roles>
        <role>Technical architect</role>
        <role>Developer</role>
        <role>Wicket Expert</role>
      </roles>
    </developer>
    <developer>
      <name>Rene Kernegger</name>
      <email>rene.kernegger@tele2.at</email>
      <organization>ASE Group 10 TiTA</organization>
      <timezone>+1</timezone>
      <roles>
        <role>2nd Technical Archtect</role>
        <role>Developer</role>
        <role>Jasper Reports Expert</role>
      </roles>
    </developer>
    <developer>
      <name>Karin Popp</name>
      <email>karin.popp@telering.at</email>
      <organization>ASE Group 10 TiTA</organization>
      <timezone>+1</timezone>
      <roles>
        <role>Tester</role>
        <role>Developer</role>
        <role>Issue Tracker Expert</role>
      </roles>
    </developer>
    <developer>
      <name>Markus Siedler</name>
      <email>markus.siedler@gmail.com</email>
      <organization>ASE Group 10 TiTA</organization>
      <timezone>+1</timezone>
      <roles>
        <role>Document Manager</role>
        <role>Developer</role>
        <role>Issue Tracker Expert</role>
      </roles>
    </developer>
  </developers>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <targetJdk>${jdk.version}</targetJdk>
          <fork>true</fork>
          <meminitial>128m</meminitial>
          <maxmem>512m</maxmem>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <directory>${basedir}/src/main/java</directory>
              <targetPath>WEB-INF/classes</targetPath>
              <includes>
                <include>**/*.html</include>
              </includes>
            </resource>
          </webResources>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${maven.plugin.surefire}</version>
        <configuration>
          <reportSets>
            <reportSet>
              <reports>
                <report>report-only</report>
              </reports>
            </reportSet>
          </reportSets>
        </configuration>
      </plugin>

      <!--
        code covarge for hudson <plugin> <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId> <configuration>

        <outputDirectory>results/cobertura</outputDirectory> <formats> <format>xml</format>
        </formats> <instrumentation> <excludes> <exclude>**/*Test*.class</exclude> </excludes>
        </instrumentation> </configuration> </plugin> <plugin>
        <groupId>com.keyboardsamurais.maven</groupId>
        <artifactId>maven-timestamp-plugin</artifactId> <version>0.1</version> <configuration>
        <propertyName>build.timestamp</propertyName> <timestampPattern>yyyyMMdd</timestampPattern>
        </configuration> <executions> <execution> <goals> <goal>create</goal> </goals> </execution>
        </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId> <configuration> <linkXref>false</linkXref>
        <sourceEncoding>UTF-8</sourceEncoding> <minimumTokens>30</minimumTokens>
        <targetJdk>{jdk.version}</targetJdk> <rulesets> <ruleset>/rulesets/unusedcode.xml</ruleset>
        <ruleset>/rulesets/basic.xml</ruleset> <ruleset>/rulesets/design.xml</ruleset>
        <ruleset>/rulesets/braces.xml</ruleset> <ruleset>/rulesets/naming.xml</ruleset> </rulesets>
        </configuration> </plugin>
      -->

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <manifest>
              <addDefaultImplementationEntries> true
						</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <!--
                siehe http://hudson.gotdns.com/wiki/display/HUDSON/Building+a+software+project
              -->
              <Revision>${SVN_REVISION}</Revision>
              <BuildTag>${BUILD_TAG}</BuildTag>
              <BuildTimestamp>${build.timestamp}</BuildTimestamp>
              <JDKVersion>${jdk.version}</JDKVersion>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven.plugin.checkstyle}</version>
        <configuration>
          <!--
            <configLocation>checkstyle.xml</configLocation>
            <cacheFile>${project.build.directory}/resources/checkstyle-cachefile</cacheFile>
            <outputFile>${project.build.directory}/checkstyle/checkstyle-result.xml</outputFile>
            <enableRSS>false</enableRSS>
          -->
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <!-- licenses -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludeSubProjects>false</excludeSubProjects>
          <excludes>
            <exclude>**/.gitignore</exclude>
            <exclude>**/.git/**</exclude>

            <exclude>**/target/**</exclude>
            <exclude>**/.classpath</exclude>
            <exclude>**/.project</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>**/.metadata/**</exclude>
			<exclude>**/codecoverage/**</exclude>

            <exclude>**/*.pdf</exclude>
            <exclude>**/*.jpg</exclude>
            <exclude>**/*.dia</exclude>
            <exclude>**/*.zargo</exclude>
            <exclude>**/*.jasper</exclude>
            <exclude>**/*.log</exclude>
			<exclude>**/*.log.*</exclude>
            <exclude>**/*.MF</exclude>
            <exclude>**/*.checkstyle</exclude>
            <exclude>**/*.js</exclude>
            <exclude>**/*.db</exclude>
            <exclude>**/*.csv</exclude>
            <exclude>**/*.springBeans</exclude>
            <exclude>**/*.jrxml</exclude>

            <exlude>**/*.db</exlude>

            <exclude>NOTICE</exclude>
            <exclude>LICENSE</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!--
        for automatic validating and compiling of jasper jrxml reports <plugin>
        <groupId>org.codehaus.mojo</groupId> <artifactId>jasperreports-maven-plugin</artifactId>
        <configuration> <outputDirectory>${project.build.directory}/jasper</outputDirectory>
        </configuration> <executions> <execution> <goals> <goal>compile-reports</goal> </goals>
        </execution> </executions>
      -->
      <!--
        do not delete is needed a second time <dependencies> <dependency>
        <groupId>jasperreports</groupId> <artifactId>jasperreports</artifactId>
        <version>${jasperreports.version}</version> </dependency> </dependencies> </plugin>
      -->

    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>

      <!-- Documentation -->

      <!-- Logging Dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
      </dependency>

      <!-- Spring Dependencies -->
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>${spring.version}</version>
      </dependency>

      <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>${cglib-nodep.version}</version>
      </dependency>

      <!-- JPA & Hibernate -->
      <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>persistence-api</artifactId>
        <version>${persistence.version}</version>
      </dependency>

      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibcore.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
          </exclusion>
          <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
          </exclusion>
          <exclusion>
            <groupId>asm</groupId>
            <artifactId>asm-attrs</artifactId>
          </exclusion>
          <exclusion>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibentity.version}</version>
      </dependency>

      <!--  H2 Database -->

        <dependency>
          <groupId>com.h2database</groupId>
          <artifactId>h2</artifactId>
          <version>${h2db.version}</version>
        </dependency>

      <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.8.0.10</version>
      </dependency>

      <!-- dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.4-701.jdbc4</version>
      </dependency-->

      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mySql.version}</version>
      </dependency>

      <!-- Util Dependencies -->
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>${commons.lang.version}</version>
      </dependency>

      <!-- Test Dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>xmlunit</groupId>
        <artifactId>xmlunit</artifactId>
        <version>${xmlunit.version}</version>
        <scope>test</scope>
      </dependency>

      <!-- JFreeChart dependencies -->
      <dependency>
        <groupId>jcommon</groupId>
        <artifactId>jcommon</artifactId>
        <version>${jcommon.version}</version>
      </dependency>

      <dependency>
        <groupId>jfreechart</groupId>
        <artifactId>jfreechart</artifactId>
        <version>${jfreechart.version}</version>
      </dependency>

      <!-- Jasper dependencies -->
      <dependency>
        <groupId>jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>${jasperreports.version}</version>
      </dependency>

      <!-- Jetty Dependencies -->

      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-util</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-management</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-plus</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>jetty-naming</artifactId>
        <version>${jetty.version}</version>
      </dependency>

      <!-- wicket dependencies -->

      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-extensions</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-guice</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-jmx</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-auth-roles</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket.wicket-security</groupId>
        <artifactId>swarm</artifactId>
        <version>${wicket-security.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-datetime</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-velocity</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.wicket</groupId>
        <artifactId>wicket-spring</artifactId>
        <version>${wicket.version}</version>
      </dependency>
      <dependency>
        <groupId>velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>${velocity.version}</version>
      </dependency>
      <dependency>
        <groupId>com.uwyn</groupId>
        <artifactId>jhighlight</artifactId>
        <version>${jhighlight.version}</version>
      </dependency>
      <dependency>
        <groupId>httpunit</groupId>
        <artifactId>httpunit</artifactId>
        <version>${httpunit.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>${portlet.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>${commons-digester.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>${commons.dbcp.version}</version>
      </dependency>
      <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>${itext.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commons-collections.version}</version>
      </dependency>
      <dependency>
        <groupId>org.wicketstuff</groupId>
        <version>1.4.TITA.2</version>
        <artifactId>table</artifactId>
      </dependency>
      <dependency>
        <groupId>maven-plugins</groupId>
        <artifactId>maven-cobertura-plugin</artifactId>
        <version>${maven.plugin.cobertura}</version>
      </dependency>
      <dependency>
        <groupId>supercsv</groupId>
        <artifactId>supercsv</artifactId>
        <version>${supercsv.version}</version>
      </dependency>
      <dependency>
        <groupId>spiffy</groupId>
        <artifactId>spiffy</artifactId>
        <version>${spiffy.version}</version>
      </dependency>

    <!-- mantis connect dependencies -->
    <dependency>
      <groupId>javax.xml</groupId>
      <artifactId>jaxrpc</artifactId>
      <version>${javax.xml.rpc.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>${commons.logging.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-discovery</groupId>
      <artifactId>commons-discovery</artifactId>
      <version>${commons.discovery.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.axis</groupId>
      <artifactId>axis-ant</artifactId>
      <version>${axis.ant.version}</version>
    </dependency>

    <dependency>
      <groupId>wsdl4j</groupId>
      <artifactId>wsdl4j</artifactId>
      <version>${wsdl4j.version}</version>
    </dependency>

      <dependency>
        <groupId>mantisconnect</groupId>
        <artifactId>mantisconnect</artifactId>
        <version>${mantis.connect.version}</version>
      </dependency>
      <dependency>
        <groupId>axis</groupId>
        <artifactId>axis</artifactId>
        <version>${axis.version}</version>
      </dependency>

			<dependency>
				<groupId>bouncycastle</groupId>
				<artifactId>bcprov-jdk14</artifactId>
				<version>${bouncycastle.version}</version>
			</dependency>

    </dependencies>
  </dependencyManagement>

  <repositories>
    <repository>
      <id>org.wicketstuff</id>
      <name>Wicket Stuff Repository</name>
      <url>http://wicketstuff.org/maven/repository</url>
    </repository>

    <repository>
      <id>thirdparty</id>
      <url>http://maven.openengsb.org/nexus/content/repositories/thirdparty</url>
    </repository>
  </repositories>

  <distributionManagement>
    <!--
      <repository> <id>internal</id> <name>Internal Release Repository</name> <url>
      dav:http://svnmaster:8181/archiva/repository/internal/ </url> </repository>
      <snapshotRepository> <id>snapshots</id> <name>Internal Snapshot Repository</name> <url>
      dav:http://svnmaster:8181/archiva/repository/snapshots/ </url> </snapshotRepository>
    -->

  </distributionManagement>

  <reports>
    <report>maven-cobertura-plugin</report>
  </reports>

</project>


text:
package org.craft.network;

import io.netty.buffer.*;

public class NettyPacket
{

    ByteBuf     payload;
    int         id;
    NetworkSide side;

    NettyPacket()
    {

    }

    public NettyPacket(int id, ByteBuf payload, NetworkSide side)
    {
        this.side = side;
        this.id = id;
        this.payload = payload;
    }

    public int getID()
    {
        return id;
    }

    public ByteBuf getPayload()
    {
        return payload;
    }

    public NetworkSide getSide()
    {
        return side;
    }
}