text:
package utils;

import com.vividsolutions.jts.geom.*;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
import models.CandidatePoint;
import models.NodedRoadSegment;
import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.opengis.referencing.operation.TransformException;
import play.Logger;
import play.cache.Cache;
import play.db.jpa.JPA;
import javax.persistence.Query;
import java.util.*;

public class PGRouting {
    private static String edgeQuery ="" +
            "SELECT " +
            "   id, " +
            "   source::integer, " +
            "   target::integer, " +
            "   ST_Length(ST_Transform(ST_SetSRID(linestring, 4326),2163)) as cost " +
            "FROM " +
            "   roadsegment_noded";
    private static String routingQuery ="" +
            "SELECT " +
            "   seq, " +
            "   id1 AS node, " +
            "   id2 AS edge, " +
            "   cost " +
            "FROM pgr_dijkstra(" +
            "text(:edge_query), " +
            "CAST (:start_vertex as integer), " +
            "CAST (:end_vertex as integer), " +
            "false, " +
            "false);";
    private static String vertexQuery ="" +
            "SELECT " +
            "   ST_AsText(the_geom) as point_wkt " +
            "FROM " +
            "   roadsegment_noded_vertices_pgr " +
            "WHERE " +
            "   id = :id";

    private static String distanceBySegment = "" +
      "SELECT " +
      "  ST_Length(ST_Transform(ST_SetSRID(ST_Line_Substring(" +
      "    c.linestring, " +
      "    0.0, " +
      "    CASE WHEN c.p1_pos < c.p2_pos THEN c.p1_pos ELSE c.p2_pos END), 4326),2163)) as a_len," +
      "  ST_Length(ST_Transform(ST_SetSRID(ST_Line_Substring(" +
      "    c.linestring, " +
      "    CASE WHEN c.p1_pos < c.p2_pos THEN c.p1_pos ELSE c.p2_pos END, " +
      "    CASE WHEN c.p1_pos < c.p2_pos THEN c.p2_pos ELSE c.p1_pos END), 4326),2163)) as b_len," +
      "  ST_Length(ST_Transform(ST_SetSRID(ST_Line_Substring(" +
      "    c.linestring, " +
      "    CASE WHEN c.p1_pos < c.p2_pos THEN c.p2_pos ELSE c.p1_pos END, " +
      "    1.0), 4326),2163)) as c_len, " +
      "  ST_Length(ST_Transform(ST_SetSRID(c.linestring, 4326),2163)) as tot_len, " +
      "  c.p1_pos as p1, " +
      "  c.p2_pos as p2 " +
      "FROM " +
      "(" +
      "  SELECT " +
      "    e.linestring as linestring," +
      "    ST_Line_Locate_Point(e.linestring, e.p1) as p1_pos," +
      "    ST_Line_Locate_Point(e.linestring, e.p2) as p2_pos " +
      "  FROM " +
      "    ( SELECT " +
      "        ST_AsBinary(ST_GeomFromText(:linestring)) as linestring," +
      "        ST_Point(:p1_lon, :p1_lat) as p1," +
      "        ST_Point(:p2_lon, :p2_lat) as p2 " +
      "    ) as e " +
      ") as c;";

    public static Double getCandidatesRoutingLength(CandidatePoint startCandidate, CandidatePoint endCandidate) {
      Double distance = 0.0;
      // I) point A and B are on the same road segment, routing length
      //    is the portion of linestring between points

      if(startCandidate.nodedRoadSegment.equals(endCandidate.nodedRoadSegment)) {
        if(!startCandidate.getPoint().equals(endCandidate.getPoint())) {
          distance = distanceFollowingSegment(startCandidate.nodedRoadSegment.linestring, startCandidate.getPoint(), endCandidate.getPoint()).get(1);
          Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case I: " + distance + "m");
        }
        return distance;
      }

      // II) point A and B are on consecutive road segments, routing length
      //     are partials from each segment

      Long aSource = startCandidate.nodedRoadSegment.source;
      Long aTarget = startCandidate.nodedRoadSegment.target;
      Long bSource = endCandidate.nodedRoadSegment.source;
      Long bTarget = endCandidate.nodedRoadSegment.target;

      List<Double> asplitted = distanceFollowingSegment(startCandidate.nodedRoadSegment.linestring, startCandidate.getPoint());
      List<Double> bsplitted = distanceFollowingSegment(endCandidate.nodedRoadSegment.linestring, endCandidate.getPoint());
      Double as = asplitted.get(0);
      Double at = asplitted.get(1);
      Double bs = bsplitted.get(0);
      Double bt = asplitted.get(1);

      if(aSource == bSource) {
        distance = bs + as;
        Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case II: " + distance + "m");
        return distance;
      } else if (aSource == bTarget) {
        distance = bt + as;
        Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case II: " + distance + "m");
        return distance;
      } else if(aTarget == bSource) {
        distance = at + bs;
        Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case II: " + distance + "m");
        return distance;
      } else if(aTarget == bTarget) {
        distance = at + bt;
        Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case II: " + distance + "m");
        return distance;
      }

      // III) point A and B belongs to different non consecutive road segments, we
      //      need to compute the shortest path between the tho segments

      Set<Double> routes  = new HashSet<Double>();
      routes.add(as + getRoutingLength(aSource, bSource) + bs);
      routes.add(as + getRoutingLength(aSource, bTarget) + bt);
      routes.add(at + getRoutingLength(aTarget, bSource) + bs);
      routes.add(at + getRoutingLength(aTarget, bTarget) + bt);

      distance = Collections.min(routes);

      Logger.trace("Distance " + startCandidate + " - " + endCandidate + " - case III: " + distance + "m");
      return distance;
    }

    public static Double getRoutingLength(Long startVertex, Long endVertex) {
        Double cost = 0.0;
        if(startVertex == endVertex) {
            Logger.trace("Router " + startVertex + " - " + endVertex + " => " + cost + " (same)");
            return cost;
        }

        Double cacheCost = Cache.get("pgr_dijkstra_" + startVertex +"-"+endVertex, Double.class);
        if(cacheCost == null) {
            Query query = JPA.em().createNativeQuery(routingQuery).setParameter("edge_query", edgeQuery).setParameter("start_vertex", startVertex)
                    .setParameter("end_vertex", endVertex);
            for (Object res : query.getResultList()) {
                Object[] resArray = (Object[]) res;
                cost += (Double) resArray[3];
            }
            Cache.set("pgr_dijkstra_" + startVertex +"-"+endVertex, cost, "5mn");
            Logger.trace("Router " + startVertex + " - " + endVertex + " => " + cost);
            return  cost;
        } else {
            Logger.trace("Router " + startVertex + " - " + endVertex + " => " + cost + " (cached)");
            return cacheCost;
        }
    }

    public static Point getVertexPoint(Long id) {
        Point cacheVertexPoint = Cache.get("pgr_vertex_point_" + id, Point.class);
        if(cacheVertexPoint != null) {
            Logger.trace("Point for vertex " + id + " from cache.");
            return cacheVertexPoint;
        }

        Query query = JPA.em().createNativeQuery(vertexQuery).setParameter("id", id);
        String wkt = (String) query.getSingleResult();;
        WKTReader reader = new WKTReader();
        try {
            Point vertex = (Point) reader.read(wkt);
            Cache.set("pgr_vertex_point_" + id, vertex);
            return vertex;
        } catch (ParseException e) {
            e.printStackTrace();
            return null;
        }
    }

  public static Double distance (Point p1, Point p2) {
    try {
      return JTS.orthodromicDistance(p1.getCoordinate(), p2.getCoordinate(), DefaultGeographicCRS.WGS84);
    } catch (TransformException e) {
      e.printStackTrace();
      return null;
    }
  }

  public static List<Double> distanceFollowingSegment (LineString linestring, Point p) {
    List<Double> l = distanceFollowingSegment(linestring, p, p);
    l.remove(1);
    return l;
  }

  public static List<Double> distanceFollowingSegment (LineString linestring, Point p1, Point p2) {
    Query query = JPA.em().createNativeQuery(distanceBySegment)
        .setParameter("linestring", linestring.toString())
        .setParameter("p1_lon", p1.getX())
        .setParameter("p1_lat", p1.getY())
        .setParameter("p2_lon", p2.getX())
        .setParameter("p2_lat", p2.getY());

    Object[] result = (Object[]) query.getSingleResult();

    List<Double> l = new ArrayList<Double>();
    l.add((Double) result[0]);
    l.add((Double) result[1]);
    l.add((Double) result[2]);
    l.add((Double) result[3]);

    Logger.trace("Split Segment: " + result[0] + " - p1(" + result[4] + ") - " + result[1] + " - p2(" + result[5] + ") - " + result[2] + " = " + result[3]);

    return l;
    }

}


text:
package spinoco.fs2.kafka.network

import java.net.InetSocketAddress

import fs2._
import cats.effect.IO
import scodec.bits.ByteVector
import shapeless.tag
import spinoco.protocol.kafka.Request.RequiredAcks
import spinoco.protocol.kafka._

import scala.concurrent.duration._

/**
  * Created by pach on 28/08/16.
  */
object BrokerConnectionApp extends App {

  import spinoco.fs2.kafka.Fs2KafkaClientResources._

  def metadata = {
    val source =
      Stream[IO, RequestMessage](
        RequestMessage(
          version = ProtocolVersion.Kafka_0_8
          , correlationId = 1
          , clientId = "manager"
          , request = Request.MetadataRequest(Vector.empty)
        )
      ) ++ Stream.sleep_[IO](10.seconds)

    source.through(BrokerConnection(
      address = new InetSocketAddress("127.0.0.1", 9092)
    ))
    .evalMap(rcv => IO {
      println(rcv)
    })
    .compile.drain.unsafeRunSync()
  }

  def publish = {
    val source =
      Stream[IO, RequestMessage](
        RequestMessage(
          version = ProtocolVersion.Kafka_0_8
          , correlationId = 2
          , clientId = "publisher"
          , request = Request.ProduceRequest(
            requiredAcks = RequiredAcks.LocalOnly
            , timeout = 10.seconds
            , messages = Vector(
              (tag[TopicName]("test"), Vector(
                (tag[PartitionId](0), Vector(
                  Message.SingleMessage(0l,MessageVersion.V0,None,ByteVector(1,2,3), ByteVector(5,6,7,8))
                ))
              ))
            )
          )
        )
      ) ++ Stream.sleep_[IO](10.seconds)

    source.through(BrokerConnection(
      address = new InetSocketAddress("127.0.0.1", 9092)
    ))
    .evalMap(rcv => IO {
      println(rcv)
    })
    .compile.drain.unsafeRunSync()

  }

  def fetch = {
    val source =
      Stream[IO, RequestMessage](
        RequestMessage(
          version = ProtocolVersion.Kafka_0_8
          , correlationId = 2
          , clientId = "fetcher"
          , request = Request.FetchRequest(
            replica = tag[Broker](-1)
            , maxWaitTime = 10.seconds
            , minBytes = 0
            , maxBytes = None
            , topics = Vector((tag[TopicName]("test"), Vector(
              (tag[PartitionId](0), tag[Offset](0), 1024*1024)
            )))
          )
        )
      ) ++ Stream.sleep_[IO](10.seconds)

    source.through(BrokerConnection(
      address = new InetSocketAddress("127.0.0.1", 9092)
    ))
    .evalMap(rcv => IO {
      println(rcv)
    })
    .compile.drain.unsafeRunSync()
  }

  //metadata
  //publish
  fetch
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 90(1): 102 (2004)

#### Original name
Buellia sheardii Bungartz

### Remarks
null


text:
Fast graph renderer based on low level ShaderMaterial from three.js.

*NOTE: please check [graph-start](https://github.com/anvaka/graph-start) repository
with a fast way to bootstrap graph drawing application.*

# usage

This will render a simple graph in 3D:

``` js
// let's create a simple graph:
var graph = require('ngraph.graph')();
graph.addLink(1, 2);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);
```

By default use keyboard keys `WASD` to fly around, and click and drag with
mouse to point the camera. This is not the most convenient way to navigate
the scene, so your feedback is very welcome.

By default graph is laid out using [pixel.layout](https://github.com/anvaka/pixel.layout)
module, which can layout graphs in both 3D:
![3d graph is default](http://i.imgur.com/zMJCtyk.png)

and 2D spaces:
![2d graph](http://i.imgur.com/SCRFvnQ.png)

# demo

You can take a look at available demos:

* [Basic "Hello world"](https://anvaka.github.io/ngraph.pixel/demo/basic/index.html?graph=balancedBinTree)
* ["Hello world" with colors](https://anvaka.github.io/ngraph.pixel/demo/colors/index.html?graph=balancedBinTree)
* [Configuring pixel](https://anvaka.github.io/ngraph.pixel/demo/config/index.html?graph=balancedBinTree)
* [Editing graph](https://anvaka.github.io/ngraph.pixel/demo/edit/index.html)

## mouse events

How to detect when user clicks/hovers a node?

``` js
var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);
renderer.on('nodeclick', function(node) {
  console.log('Clicked on ' + JSON.stringify(node));
});

renderer.on('nodedblclick', function(node) {
  console.log('Double clicked on ' + JSON.stringify(node));
});

renderer.on('nodehover', function(node) {
  console.log('Hover node ' + JSON.stringify(node));
});

// If you want to unsubscribe from event, just use `off()` method:
renderer.on('nodehover', handler);
renderer.off('nodehover', handler);
```

## custom node UI

### How to set default node UI?

``` js
var graph = require('ngraph.graph')();
graph.addLink(1, 2);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph, {
  node: createNodeUI
});

function createNodeUI(node) {
  return {
    color: 0xFF00FF,
    size: 20
  };
}
```

### How to update node color/size?

``` js
var graph = require('ngraph.graph')();
var myNode = graph.addNode(1);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);

var nodeUI = renderer.getNode(myNode.id);
nodeUI.color = 0xFF0000; // update node color
nodeUI.size = 30; // update size

// that's it, nothing else is required.
```

### How to make transparent nodes?

Best way to do so, is tell the renderer that you are not interested
in rendering such nodes:

``` js
var graph = require('ngraph.graph')();
graph.addNode(1);
graph.addNode(2, 'hidden');

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph, {
  node: function createNodeUI(node) {
    if (node.data === 'hidden') return; // don't need to render!
    // otherwise return default UI:
    return {
      color: 0xFF00FF,
      size: 30
    };
  }
});
```

Note: Hiding nodes from UI does not remove them from a graph or layout algorithm.

### How to get node UI?

``` js
// There are several ways to do so.

var graph = require('ngraph.graph')();
var node = graph.add(2, 3);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);

// if you know link id you can pass it directly:
var ui = renderer.getNode(node.id);

// if you want to get all UI elements:
renderer.forEachNode(function (nodeUI) {
  // nodeUI - is your UI object
});

// of course you can also iterate over each link of the graph:
graph.forEachNode(function (nodeModel) {
  var ui = renderer.getLink(nodeModel.id);
  // but be careful! If your link UI creation function decided to skip this
  // node, you will get `ui === undefined` here.
});
```

## custom link UI

The API for links is symmetrical to nodes. Please take a look below:

### How to set default link color?

``` js
var graph = require('ngraph.graph')();
var myLink = graph.addLink(1, 2);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph, {
  link: createLinkUI
});

function createLinkUI(link) {
  return {
    fromColor: 0xFF00FF,
    toColor: 0x00FFFF
  };
}
```

### How to update link color?

``` js
var graph = require('ngraph.graph')();
var myLink = graph.addLink(1, 2);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);

var linkUI = renderer.getLink(myLink.id);
linkUI.fromColor = 0xFF0000; // update link head color
linkUI.toColor = 0x00FF00; // update link tail color

// that's it, nothing else is required.
```

### How to make transparent links?

Best way to do so, is tell the renderer that you are not interested
in rendering such links:

``` js
var graph = require('ngraph.graph')();
graph.addLink(1, 2);
graph.addLink(2, 3, 'hidden');

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph, {
  link: function createLinkUI(link) {
    if (link.data === 'hidden') return; // don't need to render!
    // otherwise return default link:
    return {
      fromColor: 0xFF00FF,
      toColor: 0x00FFFF
    };
  }
});
```

Note: Hiding links from UI does not remove them from a graph or layout algorithm.

### How to get link UI?

``` js
// There are several ways to do so.

var graph = require('ngraph.graph')();
var link = graph.addLink(2, 3);

var renderGraph = require('ngraph.pixel');
var renderer = renderGraph(graph);

// if you know link id you can pass it directly:
var ui = renderer.getLink(link.id);

// if you want to get all UI elements:
renderer.forEachLink(function (linkUI) {
  // linkUI - is your UI object
});

// of course you can also iterate over each link of the graph:
graph.forEachLink(function (linkModel) {
  var ui = renderer.getLink(linkModel.id);
  // but be careful! If your link UI creation function decided to skip this
  // link, you will get `ui === undefined` here.
});
```

## Layout

### How to make 2d layout?

``` js
var graph = require('ngraph.graph')();
var link = graph.addLink(2, 3);

var renderGraph = require('ngraph.pixel');

// By default the layout is 3D. To switch it to 2d mode:
var renderer = renderGraph(graph, {
  is3d: false
});
```

### How to change layout forces configuration

``` js
var graph = require('ngraph.graph')();
var link = graph.addLink(2, 3);

var renderGraph = require('ngraph.pixel');

// pass physics property to the options; See more information here:
// https://github.com/anvaka/ngraph.forcelayout#configuring-physics
var renderer = renderGraph(graph, {
  physics: {
    springLength : 80,
    springCoeff : 0.0002,
    gravity: -1.2,
    theta : 0.8,
    dragCoeff : 0.02
  }
});
```

# Feedback?
This is very early version of the library and your feedback is very much appreciated.
Feel free to ping me over [email](https://github.com/anvaka), [twitter](https://twitter.com/anvaka), or open [issue here](https://github.com/anvaka/ngraph.pixel/issues/new).
You can also join library discussion on [gitter](https://gitter.im/anvaka/VivaGraphJS).

# install

With [npm](https://npmjs.org) do:

```
npm install ngraph.pixel
```

# license

MIT


text:
<meta name="qrichtext" content="1" />

Axon.idGen.py

Version: Axon 1.0

idGen() - idsequence generator

Pydoc Style Documentation

FUNCTIONS

newId = strId(self, thing) method of idGen instance

'IG.strId(object)' - Allocates & returns the next available id combined with the object's class name, in string form

numId(self) method of idGen instance

'IG.numId()' - Allocates & returns the next available id

strId(self, thing) method of idGen instance

'IG.strId(object)' - Allocates & returns the next available id combined with the object's class name, in string form

tupleId(self, thing) method of idGen instance

'IG.tupleId(thing)' -> (IG.numId(), IG.strId(thing)), but with ids the same in num & str

class idGen(object)

Methods defined here:

idToString(self, thing, aNumId)

INTERNAL 'IG.idToString(thing,numId)' - Combines the 'str()' of the object's class with the id to form a string id

next = nextId(self)

nextId(self)

INTERNAL  'IG.nextId()' - returns the next id, incrementing the private class variable

numId(self)

'IG.numId()' - Allocates & returns the next available id

strId(self, thing)

'IG.strId(object)' - Allocates & returns the next available id combined with the object's class name, in string form

tupleId(self, thing)

'IG.tupleId(thing)' -> (IG.numId(), IG.strId(thing)), but with ids the same in num & str

...

Testdoc Documentation

TODO: Implement test suite for Axon.debug.py (We did mention that tests were added late in the project?)

Michael, December 2004


text:
package org.apache.storm.utils;

import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.storm.hooks.ITaskHookDelegate;

import com.twitter.heron.api.Config;

public final class ConfigUtils {

  private ConfigUtils() {
  }

  /**
   * Translate storm config to heron config
   * @param stormConfig the storm config
   * @return a heron config
   */
  public static Config translateConfig(Map<String, Object> stormConfig) {
    Config heronConfig = new Config(stormConfig);
    // Look at serialization stuff first
    doSerializationTranslation(heronConfig);

    // Now look at supported apis
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS)) {
      heronConfig.put(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS,
          heronConfig.get(org.apache.storm.Config.TOPOLOGY_ENABLE_MESSAGE_TIMEOUTS).toString());
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_WORKERS)) {
      Integer nWorkers = (Integer) heronConfig.get(org.apache.storm.Config.TOPOLOGY_WORKERS);
      com.twitter.heron.api.Config.setNumStmgrs(heronConfig, nWorkers);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_ACKER_EXECUTORS)) {
      Integer nAckers =
          (Integer) heronConfig.get(org.apache.storm.Config.TOPOLOGY_ACKER_EXECUTORS);
      com.twitter.heron.api.Config.setEnableAcking(heronConfig, nAckers > 0);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS)) {
      Integer nSecs =
          (Integer) heronConfig.get(org.apache.storm.Config.TOPOLOGY_MESSAGE_TIMEOUT_SECS);
      com.twitter.heron.api.Config.setMessageTimeoutSecs(heronConfig, nSecs);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_MAX_SPOUT_PENDING)) {
      Integer nPending =
          Integer.parseInt(
              heronConfig.get(org.apache.storm.Config.TOPOLOGY_MAX_SPOUT_PENDING).toString());
      com.twitter.heron.api.Config.setMaxSpoutPending(heronConfig, nPending);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS)) {
      Integer tSecs =
          Integer.parseInt(
              heronConfig.get(org.apache.storm.Config.TOPOLOGY_TICK_TUPLE_FREQ_SECS).toString());
      com.twitter.heron.api.Config.setTickTupleFrequency(heronConfig, tSecs);
    }
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_DEBUG)) {
      Boolean dBg =
          Boolean.parseBoolean(heronConfig.get(org.apache.storm.Config.TOPOLOGY_DEBUG).toString());
      com.twitter.heron.api.Config.setDebug(heronConfig, dBg);
    }

    doTaskHooksTranslation(heronConfig);

    return heronConfig;
  }

  private static void doSerializationTranslation(Config heronConfig) {
    if (heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION)
        && (heronConfig.get(org.apache.storm.Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION)
          instanceof Boolean)
        && ((Boolean)
          heronConfig.get(org.apache.storm.Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION))) {
      com.twitter.heron.api.Config.setSerializationClassName(heronConfig,
          "com.twitter.heron.api.serializer.JavaSerializer");
    } else {
      heronConfig.put(org.apache.storm.Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION, false);
      com.twitter.heron.api.Config.setSerializationClassName(heronConfig,
          "org.apache.storm.serialization.HeronPluggableSerializerDelegate");
      if (!heronConfig.containsKey(org.apache.storm.Config.TOPOLOGY_KRYO_FACTORY)) {
        heronConfig.put(org.apache.storm.Config.TOPOLOGY_KRYO_FACTORY,
            "org.apache.storm.serialization.DefaultKryoFactory");
      } else if (!(heronConfig.get(org.apache.storm.Config.TOPOLOGY_KRYO_FACTORY)
          instanceof String)) {
        throw new RuntimeException(
            org.apache.storm.Config.TOPOLOGY_KRYO_FACTORY + " has to be set to a class name");
      }
      if (!heronConfig.containsKey(
            org.apache.storm.Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS)) {
        heronConfig.put(org.apache.storm.Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS, false);
      } else if (!(heronConfig.get(org.apache.storm.Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS)
          instanceof Boolean)) {
        throw new RuntimeException(
            org.apache.storm.Config.TOPOLOGY_SKIP_MISSING_KRYO_REGISTRATIONS
                + " has to be boolean");
      }
    }
  }

  /* We need to play a little dance here.
   * task hooks are a list of class names that need to be invoked at various times during a topology run.
   * However because Heron operates in com.twitter world and Strom in org.apache.storm world, we
   * pass a ITaskHookDelegate to Heron and remember the actual task hooks in an internal
   * variable STORMCOMPAT_TOPOLOGY_AUTO_TASK_HOOKS
   */
  private static void doTaskHooksTranslation(Config heronConfig) {
    List<String> hooks = heronConfig.getAutoTaskHooks();
    if (hooks != null) {
      heronConfig.put(org.apache.storm.Config.STORMCOMPAT_TOPOLOGY_AUTO_TASK_HOOKS, hooks);
      List<String> translationHooks = new LinkedList<String>();
      translationHooks.add(ITaskHookDelegate.class.getName());
      heronConfig.setAutoTaskHooks(translationHooks);
    }
  }
}


text:
<?php
error_reporting(E_ALL);
session_start();

if (!empty($_SESSION["username"])) {
	$user = $_SESSION["username"];
} else {
	header("Location: https://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?logout=yes");
}

if(is_numeric($_GET['report']) || is_numeric($_GET['remove'])) {
$reportId = is_numeric($_GET['report']) ? $_GET['report'] : $_GET['remove'];
} else {
	exit;
}

// Connect to MYSQL server
$mysqli = new mysqli("localhost", "root", "Dapp3rDan1", "portal");
if ($mysqli->connect_errno) {
	//$firephp->log("Connection to portal db failed", 'ERROR');
	echo "Connection to portal db failed";
	exit();
}

if(is_numeric($_GET['remove'])) {
	$delete = "DELETE FROM reports_fav WHERE user_id = ".$_SESSION['userid']." AND report_id = ".$reportId.";";
	$mysqli->query($delete);
	exit;
} else {
	// Check if favorite is in their list
	$checkquery = "SELECT report_id FROM reports_fav WHERE user_id = '" . $_SESSION['userid'] . "' AND report_id = '".$reportId."';";
	$checkresult = $mysqli->query($checkquery);
	if($checkresult->num_rows > 0) {
		exit;
	} elseif($checkresult->num_rows == 12) {
		echo "You have reached your limit of 12 favorites";
		exit;
	} else {
		$insert = "INSERT INTO reports_fav (user_id,report_id) VALUES(".$_SESSION['userid'].",".$reportId.");";
		$mysqli->query($insert);
		exit;
	}
}

exit;


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="f3191ec5-127b-4888-897d-0c18fc1f5e72" name="Default" comment="" />
    <ignored path="$PROJECT_DIR$/out/" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="FileEditorManager">
    <leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
      <file leaf-file-name="BubbleSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/BubbleSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="672">
              <caret line="21" column="4" lean-forward="false" selection-start-line="21" selection-start-column="4" selection-end-line="31" selection-end-column="5" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="InsertSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/InsertSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="448">
              <caret line="14" column="46" lean-forward="false" selection-start-line="14" selection-start-column="8" selection-end-line="14" selection-end-column="46" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ShellSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/ShellSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="0">
              <caret line="0" column="13" lean-forward="false" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="ChooseSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/ChooseSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="416">
              <caret line="13" column="46" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="46" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="HeapSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/HeapSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="672">
              <caret line="21" column="3" lean-forward="false" selection-start-line="21" selection-start-column="3" selection-end-line="21" selection-end-column="3" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="MerginSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/MerginSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="416">
              <caret line="13" column="100" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="100" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="RadixSort.java" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/src/sort/RadixSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="480">
              <caret line="36" column="18" lean-forward="false" selection-start-line="36" selection-start-column="10" selection-end-line="36" selection-end-column="18" />
              <folding>
                <element signature="imports" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
      <file leaf-file-name="QuickSort.java" pinned="false" current-in-tab="false">
        <entry file="file://$PROJECT_DIR$/src/sort/QuickSort.java">
          <provider selected="true" editor-type-id="text-editor">
            <state relative-caret-position="1568">
              <caret line="49" column="12" lean-forward="false" selection-start-line="49" selection-start-column="12" selection-end-line="55" selection-end-column="13" />
              <folding />
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FileTemplateManagerImpl">
    <option name="RECENT_TEMPLATES">
      <list>
        <option value="FxmlFile" />
        <option value="Class" />
      </list>
    </option>
  </component>
  <component name="GradleLocalSettings">
    <option name="externalProjectsViewState">
      <projects_view />
    </option>
  </component>
  <component name="IdeDocumentHistory">
    <option name="CHANGED_PATHS">
      <list>
        <option value="$PROJECT_DIR$/src/Hello.java" />
        <option value="$PROJECT_DIR$/src/bean/Human.java" />
        <option value="$PROJECT_DIR$/src/SerializeDemo.java" />
        <option value="$PROJECT_DIR$/src/DeserializeDemo.java" />
        <option value="C:/Program Files/Java/jdk1.8.0_131/jre/lib/deploy.jar!/com/sun/deploy/util/StringUtils.class" />
        <option value="$PROJECT_DIR$/src/socket/GreetingServer.java" />
        <option value="$PROJECT_DIR$/src/socket/ServerThread.java" />
        <option value="$PROJECT_DIR$/src/socket/Server.java" />
        <option value="$PROJECT_DIR$/src/socket/Client.java" />
        <option value="$PROJECT_DIR$/src/socket/QuickSort.java" />
        <option value="$PROJECT_DIR$/src/serialize/SerializeDemo.java" />
        <option value="$PROJECT_DIR$/src/serialize/DeserializeDemo.java" />
        <option value="$PROJECT_DIR$/src/socket/GreetingClient.java" />
        <option value="$PROJECT_DIR$/src/sort/QuickSort.java" />
        <option value="$PROJECT_DIR$/src/sort/BubbleSort.java" />
        <option value="$PROJECT_DIR$/src/sort/Utils.java" />
        <option value="$PROJECT_DIR$/src/sort/InsertSort.java" />
        <option value="$PROJECT_DIR$/src/sort/ShellSort.java" />
        <option value="$PROJECT_DIR$/src/sort/ChooseSort.java" />
        <option value="$PROJECT_DIR$/src/sort/HeapSort.java" />
        <option value="$PROJECT_DIR$/src/sort/MerginSort.java" />
        <option value="$PROJECT_DIR$/src/sort/RadixSort.java" />
      </list>
    </option>
  </component>
  <component name="ProjectFrameBounds" extendedState="6">
    <option name="x" value="-8" />
    <option name="y" value="-8" />
    <option name="width" value="1400" />
    <option name="height" value="1000" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
      <manualOrder />
      <foldersAlwaysOnTop value="true" />
    </navigator>
    <panes>
      <pane id="Scratches" />
      <pane id="Scope" />
      <pane id="AndroidView" />
      <pane id="PackagesPane" />
      <pane id="ProjectPane">
        <subPane>
          <expand>
            <path>
              <item name="HelloWorld" type="b2602c69:ProjectViewProjectNode" />
              <item name="HelloWorld" type="47feb1d3:ProjectViewModuleNode" />
            </path>
          </expand>
          <select />
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="settings.editor.selected.configurable" value="preferences.keymap" />
    <property name="last_opened_file_path" value="E:/java" />
    <property name="project.structure.last.edited" value="Modules" />
    <property name="project.structure.proportion" value="0.15" />
    <property name="project.structure.side.proportion" value="0.2" />
  </component>
  <component name="RunDashboard">
    <option name="ruleStates">
      <list>
        <RuleState>
          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
        </RuleState>
        <RuleState>
          <option name="name" value="StatusDashboardGroupingRule" />
        </RuleState>
      </list>
    </option>
  </component>
  <component name="RunManager" selected="Application.RadixSort">
    <configuration name="ChooseSort" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="sort.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="sort.ChooseSort" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="HelloWorld" />
      <envs />
    </configuration>
    <configuration name="HeapSort" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="sort.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="sort.HeapSort" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="HelloWorld" />
      <envs />
    </configuration>
    <configuration name="InsertSort" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="sort.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="sort.InsertSort" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="HelloWorld" />
      <envs />
    </configuration>
    <configuration name="MerginSort" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="sort.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="sort.MerginSort" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="HelloWorld" />
      <envs />
    </configuration>
    <configuration name="RadixSort" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
        <pattern>
          <option name="PATTERN" value="sort.*" />
          <option name="ENABLED" value="true" />
        </pattern>
      </extension>
      <option name="MAIN_CLASS_NAME" value="sort.RadixSort" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="HelloWorld" />
      <envs />
    </configuration>
    <configuration default="true" type="Applet" factoryName="Applet">
      <option name="HTML_USED" value="false" />
      <option name="WIDTH" value="400" />
      <option name="HEIGHT" value="300" />
      <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
      <module />
    </configuration>
    <configuration default="true" type="Application" factoryName="Application">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <option name="MAIN_CLASS_NAME" />
      <option name="VM_PARAMETERS" />
      <option name="PROGRAM_PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="ENABLE_SWING_INSPECTOR" value="false" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <module name="" />
      <envs />
    </configuration>
    <configuration default="true" type="JUnit" factoryName="JUnit">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="TEST_OBJECT" value="class" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <envs />
      <patterns />
    </configuration>
    <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
      <module name="" />
      <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
      <option name="PROGRAM_PARAMETERS" />
      <predefined_log_file id="idea.log" enabled="true" />
    </configuration>
    <configuration default="true" type="Remote" factoryName="Remote">
      <option name="USE_SOCKET_TRANSPORT" value="true" />
      <option name="SERVER_MODE" value="false" />
      <option name="SHMEM_ADDRESS" value="javadebug" />
      <option name="HOST" value="localhost" />
      <option name="PORT" value="5005" />
    </configuration>
    <configuration default="true" type="TestNG" factoryName="TestNG">
      <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
      <module name="" />
      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
      <option name="ALTERNATIVE_JRE_PATH" />
      <option name="SUITE_NAME" />
      <option name="PACKAGE_NAME" />
      <option name="MAIN_CLASS_NAME" />
      <option name="METHOD_NAME" />
      <option name="GROUP_NAME" />
      <option name="TEST_OBJECT" value="CLASS" />
      <option name="VM_PARAMETERS" value="-ea" />
      <option name="PARAMETERS" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <option name="OUTPUT_DIRECTORY" />
      <option name="ANNOTATION_TYPE" />
      <option name="ENV_VARIABLES" />
      <option name="PASS_PARENT_ENVS" value="true" />
      <option name="TEST_SEARCH_SCOPE">
        <value defaultName="singleModule" />
      </option>
      <option name="USE_DEFAULT_REPORTERS" value="false" />
      <option name="PROPERTIES_FILE" />
      <envs />
      <properties />
      <listeners />
    </configuration>
    <list size="5">
      <item index="0" class="java.lang.String" itemvalue="Application.InsertSort" />
      <item index="1" class="java.lang.String" itemvalue="Application.ChooseSort" />
      <item index="2" class="java.lang.String" itemvalue="Application.HeapSort" />
      <item index="3" class="java.lang.String" itemvalue="Application.MerginSort" />
      <item index="4" class="java.lang.String" itemvalue="Application.RadixSort" />
    </list>
    <recent_temporary>
      <list size="5">
        <item index="0" class="java.lang.String" itemvalue="Application.RadixSort" />
        <item index="1" class="java.lang.String" itemvalue="Application.MerginSort" />
        <item index="2" class="java.lang.String" itemvalue="Application.HeapSort" />
        <item index="3" class="java.lang.String" itemvalue="Application.ChooseSort" />
        <item index="4" class="java.lang.String" itemvalue="Application.InsertSort" />
      </list>
    </recent_temporary>
  </component>
  <component name="ShelveChangesManager" show_recycled="false">
    <option name="remove_strategy" value="false" />
  </component>
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="f3191ec5-127b-4888-897d-0c18fc1f5e72" name="Default" comment="" />
      <created>1504581350788</created>
      <option name="number" value="Default" />
      <option name="presentableId" value="Default" />
      <updated>1504581350788</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
      <window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.19978285" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.18020834" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32899022" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
    </layout>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager>
      <option name="time" value="1" />
    </breakpoint-manager>
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/src/sort/BubbleSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="4" lean-forward="false" selection-start-line="21" selection-start-column="4" selection-end-line="31" selection-end-column="5" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/InsertSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="14" column="46" lean-forward="false" selection-start-line="14" selection-start-column="8" selection-end-line="14" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ShellSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="13" lean-forward="false" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ChooseSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="46" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/HeapSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="3" lean-forward="false" selection-start-line="21" selection-start-column="3" selection-end-line="21" selection-end-column="3" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/MerginSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="100" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="100" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/QuickSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1568">
          <caret line="49" column="12" lean-forward="false" selection-start-line="49" selection-start-column="12" selection-end-line="55" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/RadixSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="22" column="37" lean-forward="false" selection-start-line="22" selection-start-column="37" selection-end-line="22" selection-end-column="37" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/BubbleSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="4" lean-forward="false" selection-start-line="21" selection-start-column="4" selection-end-line="31" selection-end-column="5" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/InsertSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="14" column="46" lean-forward="true" selection-start-line="14" selection-start-column="8" selection-end-line="14" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ShellSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="13" lean-forward="true" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ChooseSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="46" lean-forward="true" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/HeapSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="3" lean-forward="true" selection-start-line="21" selection-start-column="3" selection-end-line="21" selection-end-column="3" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/MerginSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="100" lean-forward="true" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="100" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/QuickSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1568">
          <caret line="49" column="12" lean-forward="true" selection-start-line="49" selection-start-column="12" selection-end-line="55" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/RadixSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="22" column="37" lean-forward="false" selection-start-line="22" selection-start-column="37" selection-end-line="22" selection-end-column="37" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/Hello.java" />
    <entry file="file://$PROJECT_DIR$/src/serialize/SerializeDemo.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="928">
          <caret line="31" column="13" lean-forward="false" selection-start-line="31" selection-start-column="13" selection-end-line="31" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/bean/Human.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="14" column="23" lean-forward="false" selection-start-line="14" selection-start-column="23" selection-end-line="14" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/serialize/DeserializeDemo.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="896">
          <caret line="30" column="46" lean-forward="false" selection-start-line="30" selection-start-column="46" selection-end-line="30" selection-end-column="46" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/GreetingClient.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="640">
          <caret line="21" column="0" lean-forward="false" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="jar://C:/Program Files/Java/jdk1.8.0_131/jre/lib/deploy.jar!/com/sun/deploy/util/StringUtils.class">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="27" column="31" lean-forward="false" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/GreetingServer.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1120">
          <caret line="42" column="47" lean-forward="false" selection-start-line="42" selection-start-column="47" selection-end-line="42" selection-end-column="47" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/HelloWorld.iml">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/bean/Human.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="14" column="23" lean-forward="false" selection-start-line="14" selection-start-column="23" selection-end-line="14" selection-end-column="23" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/GreetingClient.class" />
    <entry file="jar://C:/Program Files/Java/jdk1.8.0_131/jre/lib/deploy.jar!/com/sun/deploy/util/StringUtils.class">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="27" column="31" lean-forward="false" selection-start-line="27" selection-start-column="31" selection-end-line="27" selection-end-column="31" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/GreetingServer.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="199">
          <caret line="42" column="47" lean-forward="false" selection-start-line="42" selection-start-column="47" selection-end-line="42" selection-end-column="47" />
        </state>
      </provider>
    </entry>
    <entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/net/Socket.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-3448">
          <caret line="82" column="11" lean-forward="false" selection-start-line="82" selection-start-column="11" selection-end-line="82" selection-end-column="11" />
        </state>
      </provider>
    </entry>
    <entry file="jar://C:/Program Files/Java/jdk1.8.0_131/src.zip!/java/io/BufferedReader.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="296">
          <caret line="114" column="32" lean-forward="false" selection-start-line="114" selection-start-column="26" selection-end-line="114" selection-end-column="32" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/ServerThread.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="125">
          <caret line="37" column="33" lean-forward="true" selection-start-line="37" selection-start-column="33" selection-end-line="37" selection-end-column="33" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/Client.class">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="-384">
          <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/Server.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="33">
          <caret line="10" column="13" lean-forward="false" selection-start-line="10" selection-start-column="13" selection-end-line="10" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/socket/Client.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="193">
          <caret line="16" column="25" lean-forward="false" selection-start-line="16" selection-start-column="25" selection-end-line="16" selection-end-column="25" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/serialize/SerializeDemo.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="225">
          <caret line="11" column="13" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/serialize/DeserializeDemo.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="213">
          <caret line="11" column="13" lean-forward="false" selection-start-line="11" selection-start-column="13" selection-end-line="11" selection-end-column="13" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/Hello.java" />
    <entry file="file://$PROJECT_DIR$/src/socket/GreetingClient.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="509">
          <caret line="28" column="9" lean-forward="true" selection-start-line="28" selection-start-column="9" selection-end-line="28" selection-end-column="9" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/QuickSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="1568">
          <caret line="49" column="12" lean-forward="false" selection-start-line="49" selection-start-column="12" selection-end-line="55" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/BubbleSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="4" lean-forward="false" selection-start-line="21" selection-start-column="4" selection-end-line="31" selection-end-column="5" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/Utils.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="288">
          <caret line="9" column="18" lean-forward="false" selection-start-line="9" selection-start-column="18" selection-end-line="9" selection-end-column="18" />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/InsertSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="448">
          <caret line="14" column="46" lean-forward="false" selection-start-line="14" selection-start-column="8" selection-end-line="14" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ShellSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="0">
          <caret line="0" column="13" lean-forward="false" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/ChooseSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="46" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/HeapSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="672">
          <caret line="21" column="3" lean-forward="false" selection-start-line="21" selection-start-column="3" selection-end-line="21" selection-end-column="3" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/MerginSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="416">
          <caret line="13" column="100" lean-forward="false" selection-start-line="13" selection-start-column="8" selection-end-line="13" selection-end-column="100" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/src/sort/RadixSort.java">
      <provider selected="true" editor-type-id="text-editor">
        <state relative-caret-position="480">
          <caret line="36" column="18" lean-forward="false" selection-start-line="36" selection-start-column="10" selection-end-line="36" selection-end-column="18" />
          <folding>
            <element signature="imports" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
  <component name="masterDetails">
    <states>
      <state key="ArtifactsStructureConfigurable.UI">
        <settings>
          <artifact-editor />
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="FacetStructureConfigurable.UI">
        <settings>
          <last-edited>No facets are configured</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="GlobalLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="JdkListConfigurable.UI">
        <settings>
          <last-edited>1.8</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ModuleStructureConfigurable.UI">
        <settings>
          <last-edited>HelloWorld</last-edited>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
      <state key="ProjectLibrariesConfigurable.UI">
        <settings>
          <splitter-proportions>
            <option name="proportions">
              <list>
                <option value="0.2" />
              </list>
            </option>
          </splitter-proportions>
        </settings>
      </state>
    </states>
  </component>
</project>


text:
package com.invariantproperties.projecteuler.prime;

import java.util.Iterator;

import org.junit.Test;
import static org.junit.Assert.*;

public class SieveOfAtkinTest {
    @Test
    public void testIterator() {
        Iterator<Integer> iter = SieveOfAtkin.SIEVE.iterator();
        for (int i = 0; i < 100; i++) {
            // System.out.println(iter.next());
        }

        iter = SieveOfAtkin.SIEVE.iterator();
        for (int i = 0; i < 20; i++) {
            assertTrue(SieveOfAtkin.SIEVE.isPrime(iter.next()));
        }
    }
}


text:
package com.google.javascript.clutz;

import static com.google.common.truth.Truth.assertThat;

import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.file.Path;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class ClosureEnvTest {

  private final Path inputFile =
      DeclarationGeneratorTest.getTestInputFile("env" + File.separatorChar + "browser.js");
  private PrintStream defaultOut;

  @Before
  public void setUp() {
    defaultOut = System.out;
    System.setOut(nullPrintStream);
  }

  @After
  public void tearDown() {
    System.setOut(defaultOut);
  }

  private final PrintStream nullPrintStream =
      new PrintStream(
          new OutputStream() {
            @Override
            public void write(int b) throws IOException {}
          });

  @Test
  public void shouldHaveErrorForNoExterns() throws Exception {
    Options opts = new Options(new String[] {inputFile.toString(), "--debug"});
    final DeclarationGenerator generator = new DeclarationGenerator(opts);
    generator.generateDeclarations();
    assertThat(generator.hasErrors()).isTrue();
  }

  @Test
  public void shouldHaveNoErrorsForBrowserExterns() throws Exception {
    Options opts =
        new Options(new String[] {inputFile.toString(), "--debug", "--closure_env", "BROWSER"});
    final DeclarationGenerator generator = new DeclarationGenerator(opts);
    generator.generateDeclarations();
    assertThat(generator.hasErrors()).isFalse();
  }
}


text:
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
Gard. Chron. ser. 3, 13:414. 1893

#### Original name
null

### Remarks
null


text:
#include "CFKnownLocations.h"

#include <CoreFoundation/CFString.h>
#include "CFPriv.h"
#include "CFInternal.h"

#include <assert.h>

CFURLRef _Nullable _CFKnownLocationCreatePreferencesURLForUser(CFKnownLocationUser user, CFStringRef _Nullable username) {
    CFURLRef location = NULL;

#if TARGET_OS_MAC

/*
 Building for a Darwin OS. (We use these paths on Swift builds as well, so that we can interoperate a little with Darwin's defaults(1) command and the other system facilities; but you want to use the system version of CF if possible on those platforms, which will talk to cfprefsd(8) and has stronger interprocess consistency guarantees.)

 User:
 - Any: /Library/Preferences
 - Current: $HOME/Library/Preferences
 */

    switch (user) {
        case _kCFKnownLocationUserAny:
            location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("/Library/Preferences"), kCFURLPOSIXPathStyle, true);
            break;

        case _kCFKnownLocationUserCurrent:
            username = NULL;
            // passthrough to:
        case _kCFKnownLocationUserByName: {
            CFURLRef home = CFCopyHomeDirectoryURLForUser(username);
            location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("/Library/Preferences"), kCFURLPOSIXPathStyle, true, home);
            CFRelease(home);

            break;
        }

    }
#elif !DEPLOYMENT_RUNTIME_OBJC && !TARGET_OS_WIN32 && !TARGET_OS_ANDROID

/*
 Building for an OS that uses the FHS, BSD's hier(7), and/or the XDG specification for paths:

 User:
 - Any: /usr/local/etc/
 - Current: $XDG_CONFIG_PATH (usually: $HOME/.config/).
 */

    switch (user) {
        case _kCFKnownLocationUserAny:
            location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("/usr/local/etc"), kCFURLPOSIXPathStyle, true);
            break;

        case _kCFKnownLocationUserByName:
            assert(username == NULL);
            // passthrough to:
        case _kCFKnownLocationUserCurrent: {
            CFStringRef path = _CFXDGCreateConfigHomePath();
            location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, path, kCFURLPOSIXPathStyle, true);
            CFRelease(path);

            break;
        }
    }

#elif TARGET_OS_WIN32

    switch (user) {
        case _kCFKnownLocationUserAny:
            location = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, CFSTR("\\Users\\All Users\\AppData\\Local"), kCFURLWindowsPathStyle, true);
            break;
        case _kCFKnownLocationUserCurrent:
            username = CFGetUserName();
            // fallthrough
        case _kCFKnownLocationUserByName:
            const char *user = CFStringGetCStringPtr(username, kCFStringEncodingUTF8);
            CFURLRef userdir = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (const unsigned char *)user, strlen(user), true);
            CFURLRef homedir = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("\\Users"), kCFURLWindowsPathStyle, true, userdir);
            location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("\\AppData\\Local"),  kCFURLWindowsPathStyle, true, homedir);
            CFRelease(homedir);
            CFRelease(userdir);
            break;
    }

#elif TARGET_OS_ANDROID

    switch (user) {
    case _kCFKnownLocationUserAny:
    case _kCFKnownLocationUserByName:
      abort();
    case _kCFKnownLocationUserCurrent: {
      const char *buffer = getenv("CFFIXED_USER_HOME");
      if (buffer == NULL || *buffer == '\0') {
        CFLog(__kCFLogAssertion, CFSTR("CFFIXED_USER_HOME is unset"));
        HALT;
      }

      CFURLRef userdir = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (const unsigned char *)buffer, strlen(buffer), true);
      location = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, CFSTR("/Apple/Library/Preferences"), kCFURLPOSIXPathStyle, true, userdir);
      CFRelease(userdir);
      break;
    }
    }

#else

    #error For this platform, you need to define a preferences path for both 'any user' (i.e. installation-wide preferences) or the current user.

#endif

    return location;
}


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Bar',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='Foo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
    ]


text:
import * as FindUsers from './FindUsers.gql'

export default {
  FindUsers
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

	<parent>
	    <groupId>org.springframework.boot</groupId>
	    <artifactId>spring-boot-starter-parent</artifactId>
	    <version>1.3.2.RELEASE</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>
	<groupId>com.tirthal.learning</groupId>
	<artifactId>gs-spring-data-rest</artifactId>
	<version>1.0.0.SNAPSHOT</version>
	<packaging>jar</packaging>
	<name>Getting Started Project of Spring Data REST</name>

	<properties>
		<java.version>1.8</java.version>
		<maven.test.failure.ignore>true</maven.test.failure.ignore>
	</properties>

	<dependencies>
	    <dependency>
	        <groupId>org.springframework.boot</groupId>
	        <artifactId>spring-boot-starter-web</artifactId>
	    </dependency>
		<dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>

		<!-- START: Added Spring Data REST dependency -->
		<dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-data-rest</artifactId>
		</dependency>
		<!-- END: Added Spring Data REST dependency -->

		<!-- START: Added OPTIONAL Spring Data REST HAL Browser Tool dependency -->
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-rest-hal-browser</artifactId>
		</dependency>
		<!-- END: Added OPTIONAL Spring Data REST HAL Browser Tool dependency -->

		<dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-test</artifactId>
		    <scope>test</scope>
		</dependency>
	</dependencies>

</project>


text:
require "spec_helper"

RSpec.describe Eslintrb::Linter do
  subject(:linter) { described_class.new }

  describe "#lint" do
    it "has an ESLINT object" do
      result = linter.lint("")
      expect(result).to_not be_nil
    end
  end
end


text:
package storm.interfaces;

public interface IShooter {

    public void preShoot();
    public void startShoot(boolean useTable, double distance);
    public void doShoot();
    public boolean isShooting();
    public double getRPM();
    public void endShoot();
    public void setContinuousShoot(boolean continuousShoot);
    public void warmUp();

}


text:
package com.ewyboy.bibliotheca.client.color;

import com.ewyboy.bibliotheca.client.interfaces.IBlockColorizer;
import com.ewyboy.bibliotheca.util.ModLogger;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.color.item.ItemColors;
import net.minecraft.world.item.BlockItem;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Objects;

@OnlyIn(Dist.CLIENT)
public class ColorLoader {

    public static final HashMap<String, ColoredBlock> COLORED_BLOCKS = new HashMap<>();
    public static final HashMap<String, ColoredItem> COLORED_ITEMS = new HashMap<>();

    @OnlyIn(Dist.CLIENT)
    public static void init(String modID, Class coloredBlockRegister, Class coloredItemsRegister) {
        if (coloredBlockRegister != null) registerColoredBlocks(modID, coloredBlockRegister);
        if (coloredItemsRegister != null) registerColoredItems(modID, coloredItemsRegister);
    }

    @OnlyIn(Dist.CLIENT)
    private static void registerColoredBlocks(String modID, Class coloredBlockRegister) {
        try {
            for (Field field : coloredBlockRegister.getDeclaredFields()) {
                Object obj = field.get(null);
                if (obj instanceof ColoredBlock) {
                    ColoredBlock block = (ColoredBlock) obj;
                    String name = Objects.requireNonNull(block.blockToColor().getRegistryName()).toString();
                    registerColoredBlock(modID, block, name);
                }
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    @OnlyIn(Dist.CLIENT)
    public static void registerColoredBlock(String modID, ColoredBlock coloredBlock, String name) {
        COLORED_BLOCKS.put(name, coloredBlock);
        BlockColors blockColors = Minecraft.getInstance().getBlockColors();
        blockColors.register(coloredBlock, ((IBlockColorizer) coloredBlock).blockToColor());
        ModLogger.info("[BLOCK-COLOR]: {} :: {} has been registered by Bibliotheca for {}", Integer.toHexString(coloredBlock.getColorIndex()), name, modID);
    }

    @OnlyIn(Dist.CLIENT)
    private static void registerColoredItems(String modID, Class coloredItemRegister) {
        try {
            for (Field field : coloredItemRegister.getDeclaredFields()) {
                Object obj = field.get(null);
                if (obj instanceof ColoredItem) {
                    ColoredItem item = (ColoredItem) obj;
                    String name = Objects.requireNonNull(item.itemToColor().getRegistryName()).toString();
                    registerColoredItem(modID, item, name);
                }
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    @OnlyIn(Dist.CLIENT)
    public static void registerColoredItem(String modID, ColoredItem coloredItem, String name) {
        COLORED_ITEMS.put(Objects.requireNonNull(coloredItem.itemToColor().getRegistryName()).toString(), coloredItem);

        BlockColors blockColors = Minecraft.getInstance().getBlockColors();
        ItemColors itemColors = Minecraft.getInstance().getItemColors();

        ItemColor getColorFromBlock = (stack, tintIndex) -> {
            BlockState state = ((BlockItem) stack.getItem()).getBlock().defaultBlockState();
            return blockColors.getColor(state, null, null, tintIndex);
        };

        itemColors.register(getColorFromBlock, coloredItem.itemToColor());
        ModLogger.info("[ITEM-COLOR]: {} :: {} has been registered by Bibliotheca for {}", Integer.toHexString(coloredItem.getColorIndex()), name, modID);
    }

}


text:
package org.ovirt.engine.api.restapi.types;

import org.ovirt.engine.api.model.Tag;
import org.ovirt.engine.api.restapi.utils.GuidUtils;
import org.ovirt.engine.core.common.businessentities.Tags;
import org.ovirt.engine.core.compat.Guid;

public class TagMapper {

    @Mapping(from = Tag.class, to = Tags.class)
    public static Tags map(Tag model, Tags template) {
        Tags entity = template != null ? template : new Tags();
        entity.setParentId(parent(model, entity.getParentId()));
        if (model.isSetId()) {
            entity.setTagId(GuidUtils.asGuid(model.getId()));
        }
        if (model.isSetName()) {
            entity.setTagName(model.getName());
        }
        if (model.isSetDescription()) {
            entity.setDescription(model.getDescription());
        }
        return entity;
    }

    @Mapping(from = Tags.class, to = Tag.class)
    public static Tag map(Tags entity, Tag template) {
        Tag model = template != null ? template : new Tag();
        model.setId(entity.getTagId().toString());
        model.setName(entity.getTagName());
        model.setDescription(entity.getDescription());
        model.setParent(parent(entity));
        return model;
    }

    private static Guid parent(Tag model, Guid current) {
        if (model.isSetParent() && model.getParent().isSetId()) {
            return GuidUtils.asGuid(model.getParent().getId());
        } else {
            return current == null ? Guid.Empty : current;
        }
    }

    private static Tag parent(Tags entity) {
        if (entity.getParentId() != null) {
            Tag parent = new Tag();
            parent.setId(entity.getParentId().toString());
            return parent;
        } else {
            return null;
        }
    }
}


text:
<?php

namespace Oro\Bundle\UserBundle\Form\EventListener;

use Oro\Bundle\UserBundle\Entity\AbstractRole;
use Oro\Bundle\UserBundle\Entity\AbstractUser;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;

/**
 * This class updates users (append/remove) according to submitted data
 */
class ChangeRoleSubscriber implements EventSubscriberInterface
{
    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents()
    {
        return [FormEvents::SUBMIT => ['onSubmit', 10]];
    }

    /**
     * @param FormEvent $event
     */
    public function onSubmit(FormEvent $event)
    {
        /** @var AbstractRole $role */
        $role = $event->getData();

        if (!$role) {
            return;
        }

        $form = $event->getForm();

        /** @var AbstractUser $user */
        foreach ($form->get('appendUsers')->getData() as $user) {
            $user->addRole($role);
        }

        /** @var AbstractUser $user */
        foreach ($form->get('removeUsers')->getData() as $user) {
            $user->removeRole($role);
        }
    }
}


text:
layout: post
microblog: true
date: 2010-08-21 03:00 +0300
guid: http://desparoz.micro.blog/2010/08/21/t21740958734.html
---
Amazing result. RT @seancarmody: Anthony Green predicting 73 for LAB and 72 for LIB, so hung parliament #ausvotes


text:
package com.yanglinkui.ab.dsl.condition;

import com.yanglinkui.ab.dsl.Expression;
import com.yanglinkui.ab.dsl.Context;

/**
 * Created by jonas on 2017/1/3.
 */
public class Star implements Expression {

    public boolean interpret(Context context) {
        return true;
    }

    public String toString() {
        return "*";
    }
}


text:
BarbaCourierUdpClient::BarbaCourierUdpClient(CreateStrcutUdp* cs)
	: BarbaCourierDatagram(cs)
{
	_SessionId = BarbaUtils::GetRandom(100000, UINT_MAX-1);
	LastKeepAliveTime = 0;
	LastKeepAliveSentChunkCount = 0;
	SentChunkCount = 0;
}

BarbaCourierUdpClient::~BarbaCourierUdpClient(void)
{
}

void BarbaCourierUdpClient::CheckKeepAlive()
{
	if (GetCreateStruct()->KeepAliveInterval==0)
		return; //ignore sending keep alive

	//check keep-alive time
	if ( BarbaUtils::GetTickDiff(LastKeepAliveTime) < GetCreateStruct()->KeepAliveInterval )
		return;
	LastKeepAliveTime = GetTickCount();

	//find number of ports that need to be alive
	int portsCount = (int)GetCreateStruct()->KeepAlivePortsCount - (int)(SentChunkCount-LastKeepAliveSentChunkCount);
	portsCount = min(portsCount, (int)GetCreateStruct()->PortRange->GetPortsCount()); //could not be more than total port count
	if (portsCount<=0)
		return;

	//ignore big keep alive
	if (portsCount>MaxKeepAlivePortsCount)
	{
		Log2(_T("Ignore sending 'keepAlive' for %d ports! You should decrease KeepAlivePortsCount."), portsCount);
		return;
	}

	//report
	Log2(_T("Sending 'keepAlive' for %d ports."), portsCount);

	//sending keepAlive
	for (int i=0; i<portsCount; i++)
	{
		std::string udpKeepAlive("@KeepAlive");
		BarbaBuffer data((BYTE*)udpKeepAlive.data(), udpKeepAlive.size());
		SendData(&data);
	}

	LastKeepAliveSentChunkCount = SentChunkCount;
}

// GUID (32) | Data
bool BarbaCourierUdpClient::ProcessInboundPacket(PacketHelper* packet)
{
	if (!packet->IsUdp())
		return false;

	std::string tag = _T("BarbaTunnelUdp;");

	//get udp data
	BarbaBuffer buffer(packet->GetUdpPayload(), packet->GetUdpPayloadLen());
	if (buffer.size()< (tag.size() + sizeof DWORD) )
	{
		Log3(_T("Invalid UDP size for a UDP chunk! Invalid key or overlapped port!"));
		return false;
	}

	//decrypt packet
	Decrypt(buffer.data(), buffer.size(), 0);

	//extract data
	int offset = 0;
	std::string tag2((char*)buffer.data() + offset, tag.size());
	offset += (int)tag.size();
	if (tag2.compare(tag)!=0)
	{
		Log3(_T("Could not find Barba Signature in chunk! Invalid key or overlapped port!"));
		return false; //not barba packet
	}

	BarbaBuffer chunk(buffer.data() + offset, buffer.size()-offset);
	Log3(_T("Receiving UDP Chunk. ServerPort:%d, ClientPort:%d, Size: %d Bytes."), packet->GetSrcPort(), packet->GetDesPort(), chunk.size());
	SendChunkToInbound(&chunk);
	return true;
}

// GUID (32) | Session (4) | Data
void BarbaCourierUdpClient::SendChunkToOutbound(BarbaBuffer* chunk)
{
	//append UDP Tunnel signature
	// BarbaSign | SessionID | Chunk
	std::string tag = GetBarbaTag();

	BarbaBuffer buffer;
	buffer.reserve( tag.size() +  sizeof DWORD + chunk->size());
	buffer.append( (char*)tag.data(), tag.size() );
	buffer.append( &_SessionId, sizeof DWORD);
	buffer.append( chunk );
	Encrypt(buffer.data(), buffer.size(), 0);

	u_short clientPort = GetCreateStruct()->PortRange->GetRandomPort();
	u_short serverPort = GetCreateStruct()->PortRange->GetRandomPort();
	Log3(_T("Sending UDP Chunk. ServerPort:%d, ClientPort:%d, Size: %d bytes."), serverPort, clientPort, chunk->size());
	SendUdpPacketToOutbound(GetCreateStruct()->RemoteIp, clientPort, serverPort, &buffer);
	SentChunkCount++;
}

bool BarbaCourierUdpClient::PreReceiveDataControl(BarbaBuffer* data)
{
	if (BarbaCourierDatagram::PreReceiveDataControl(data))
		return true;

	//check is DataContorl belong to me
	std::string tag = "BarbaCourierUdp;";
	bool isMine = data->size()>=tag.size() && memcmp(data->data(), tag.data(), tag.size())==0;
	if (!isMine)
		return false;

	//process
	std::string command((char*)data->data(), data->size());
	std::tstring cmdName = BarbaUtils::GetKeyValueFromString(command.data(), _T("Command"));
	Log3(_T("Receiving DataControl: %s"), command.data());

	//initialize server
	if (cmdName.compare(_T("UdpInit"))==0)
		SendInitCommand();
	return true;
}

void	 BarbaCourierUdpClient::SendInitCommand()
{
	std::tstring cmd = "BarbaCourierUdp;";
	BarbaUtils::SetKeyValue(&cmd, _T("Command"), _T("UdpInit"));
	BarbaUtils::SetKeyValue(&cmd, _T("KeepAlivePortsCount"), GetCreateStruct()->KeepAlivePortsCount);
	BarbaUtils::SetKeyValue(&cmd, _T("MaxChunkSize"), (int)GetCreateStruct()->MaxChunkSize);
	Log3(_T("Sending DataControl: %s"), cmd.data());

	BarbaBuffer data((BYTE*)cmd.data(), cmd.size());
	SendDataControl(&data);
}

void BarbaCourierUdpClient::Timer()
{
	BarbaCourierDatagram::Timer();
	CheckKeepAlive();
}


text:
package org.carrot2.workbench.editors;

import org.carrot2.core.IClusteringAlgorithm;
import org.carrot2.core.ProcessingComponentBase;
import org.carrot2.core.attribute.Processing;
import org.carrot2.util.attribute.*;
import org.carrot2.util.attribute.constraint.*;

public class EditorsTest
{
    public static class TestType
    {
    }

    public static class TestType2
    {
    }

    public static class SubTestType extends TestType implements TestInterface
    {
    }

    public static interface TestInterface
    {
    }

    @Bindable
    public static class TestComponent extends ProcessingComponentBase implements
        IClusteringAlgorithm
    {

        @Attribute(key = "my.specificAttribute")
        @Input
        @Processing
        TestType specificAttribute;

        @Attribute
        @Input
        @Processing
        @IntRange(min = 0, max = 10)
        TestType oneConstraintAttribute;

        @Attribute
        @Input
        @Processing
        @IntRange(min = 0, max = 10)
        @IntModulo(modulo = 2, offset = 10)
        TestType twoConstraintsAttribute;

        @Attribute
        @Input
        @Processing
        TestType simpleAttribute;

        @Attribute
        @Input
        @Processing
        SubTestType subAttribute;

        @Attribute
        @Input
        @Processing
        @IntRange(min = 0, max = 10)
        SubTestType subRangeAttribute;

        @Attribute
        @Input
        @Processing
        @IntModulo(modulo = 2, offset = 1)
        TestInterface interfaceRangeAttribute;

        @Attribute
        @Input
        @Processing
        TestInterface interfaceAttribute;

        @Attribute
        @Input
        @Processing
        @DoubleRange(min = 0, max = 10)
        TestType2 rangeDoubleAttribute;

        @Attribute
        @Input
        @Processing
        @IntModulo(modulo = 2, offset = 3)
        TestType2 comboAttribute;

        @Attribute
        @Input
        @Processing
        @IntModulo(modulo = 2, offset = 1)
        IAttributeEditor editor = new DedicatedEditor();

        @Attribute
        @Input
        @Processing
        IAttributeEditor editor2 = new DedicatedEditor();

    }

    public static class DedicatedEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class DedicatedEditor2 extends EmptyAttributeEditorAdapter
    {

    }

    public static class DedicatedEditor3 extends EmptyAttributeEditorAdapter
    {

    }

    public static class DedicatedEditor4 extends EmptyAttributeEditorAdapter
    {

    }

    public static class RangeEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class RangeModuloEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class IntEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class SubEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class InterfaceEditor extends EmptyAttributeEditorAdapter
    {

    }

    public static class RangeEditor2 extends EmptyAttributeEditorAdapter
    {

    }

    public static class ComboEditor extends EmptyAttributeEditorAdapter
    {

    }
}