text:
**NSQ** is a realtime message processing system designed to operate at bitly's scale, handling
billions of messages per day.

It promotes *distributed* and *decentralized* topologies [without single points of failure](#spof),
enabling fault tolerance and high availability coupled with a reliable [message delivery
guarantee](#delivery).

Operationally, **NSQ** is easy to configure and deploy (all parameters are specified on the command
line and compiled binaries have no runtime dependencies). For maximum flexibility, it is agnostic to
data format (messages can be JSON, [MsgPack][msgpack], [Protocol Buffers][go-protobuf], or anything else). Go and
Python libraries are available out of the box and, if you're interested in building your own client, there's a [protocol spec][protocol].

[![Build Status](https://secure.travis-ci.org/bitly/nsq.png)](http://travis-ci.org/bitly/nsq)

**NSQ** was built as a successor to [simplequeue][simplequeue] (part of [simplehttp][simplehttp]) and as
such was designed to (in no particular order):

 * provide easy topology solutions that enable high-availability and eliminate SPOFs
 * address the need for stronger message delivery guarantees
 * bound the memory footprint of a single process (by persisting some messages to disk)
 * greatly simplify configuration requirements for producers and consumers
 * provide a straightforward upgrade path
 * improve efficiency

If you're interested in more of the history and evolution please read our [blog post][nsq_post].

### Simplifying Configuration and Administration

A single `nsqd` instance is designed to handle multiple streams of data at once. Streams are called
"topics" and a topic has 1 or more "channels". Each channel receives a *copy* of all the
messages for a topic. In practice, a channel maps to a downstream service consuming a topic.

Topics and channels all buffer data independently of each other, preventing a slow consumer from
causing a backlog for other channels (the same applies at the topic level).

A channel can, and generally does, have multiple clients connected. Assuming all connected clients
are in a state where they are ready to receive messages, each message will be delivered to a random
client.  For example:

![nsqd clients](http://media.tumblr.com/tumblr_marmk2NL0k1qj3yp2.png)

**NSQ** also includes a helper application, `nsqlookupd`, which provides a directory service where
consumers can lookup the addresses of `nsqd` instances that provide the topics they are interested
in subscribing to. In terms of configuration, this decouples the consumers from the producers (they
both individually only need to know where to contact common instances of `nsqlookupd`, never each
other), reducing complexity and maintenance.

At a lower level each `nsqd` has a long-lived TCP connection to `nsqlookupd` over which it
periodically pushes its state. This data is used to inform which `nsqd` addresses `nsqlookupd` will
give to consumers. For consumers, an HTTP `/lookup` endpoint is exposed for polling.

To introduce a new distinct consumer of a topic, simply start up an **NSQ** client configured with
the addresses of your `nsqlookupd` instances. There are no configuration changes needed to add
either new consumers or new publishers, greatly reducing overhead and complexity.

NOTE: in future versions, the heuristic `nsqlookupd` uses to return addresses could be based on
depth, number of connected clients, or other "intelligent" strategies. The current implementation is
simply *all*. Ultimately, the goal is to ensure that all producers are being read from such that
depth stays near zero.

It is important to note that the `nsqd` and `nsqlookupd` daemons are designed to operate
independently, without communication or coordination between siblings.

We also think that it's really important to have a way to view, introspect, and manage the
cluster in aggregate. We built `nsqadmin` to do this. It provides a web UI to browse the hierarchy
of topics/channels/consumers and inspect depth and other key statistics for each layer. Additionally
it supports a few administrative commands such as removing and emptying a channel (which is a useful
tool when messages in a channel can be safely thrown away in order to bring depth back to 0).

![nsqadmin](http://media.tumblr.com/tumblr_mbmsd6YMfS1qj3yp2.png)

### Straightforward Upgrade Path

This was one of our **highest** priorities. Our production systems handle a large volume of traffic,
all built upon our existing messaging tools, so we needed a way to slowly and methodically upgrade
specific parts of our infrastructure with little to no impact.

First, on the message *producer* side we built `nsqd` to match [simplequeue][simplequeue]. Specifically, nsqd
exposes an HTTP `/put` endpoint, just like `simplequeue`, to POST binary data (with the one caveat
that the endpoint takes an additional query parameter specifying the "topic"). Services that wanted
to switch to start publishing to `nsqd` only have to make minor code changes.

Second, we built libraries in both Python and Go that matched the functionality and idioms we had
been accustomed to in our existing libraries. This eased the transition on the message *consumer*
side by limiting the code changes to bootstrapping.  All business logic remained the same.

Finally, we built utilities to glue old and new components together. These are all available in the
`examples` directory in the repository:

 * `nsq_pubsub` - expose a `pubsub` like HTTP interface to topics in an **NSQ** cluster
 * `nsq_to_file` - durably write all messages for a given topic to a file
 * `nsq_to_http` - perform HTTP requests for all messages in a topic to (multiple) endpoints

### Eliminating SPOFs

**NSQ** is designed to be used in a distributed fashion. `nsqd` clients are connected (over TCP) to
**all** instances providing the specified topic. There are no middle-men, no message brokers, and no
SPOFs:

![nsq clients](http://media.tumblr.com/tumblr_mat85kr5td1qj3yp2.png)

This topology eliminates the need to chain single, aggregated, feeds. Instead you consume directly
from **all** producers. *Technically*, it doesn't matter which client connects to which **NSQ**, as
long as there are enough clients connected to all producers to satisfy the volume of messages,
you're guaranteed that all will eventually be processed.

For `nsqlookupd`, high availability is achieved by running multiple instances. They don't
communicate directly to each other and data is considered eventually consistent. Consumers poll
*all* of their configured `nsqlookupd` instances and union the responses. Stale, inaccessible, or
otherwise faulty nodes don't grind the system to a halt.

### Message Delivery Guarantees

**NSQ** guarantees that a message will be delivered **at least once**, though duplicate messages are
possible. Consumers should expect this and de-dupe or perform [idempotent][idempotence] operations.

This guarantee is enforced as part of the protocol and works as follows (assume the client has
successfully connected and subscribed to a topic):

  1. client indicates they are ready to receive messages
  2. **NSQ** sends a message and temporarily stores the data locally (in the event of re-queue or
     timeout)
  3. client replies FIN (finish) or REQ (re-queue) indicating success or failure respectively. If
     client does not reply **NSQ** will timeout after a configurable duration and automatically
     re-queue the message)

This ensures that the only edge case that would result in message loss is an unclean shutdown of an
`nsqd` process. In that case, any messages that were in memory (or any buffered writes not flushed
to disk) would be lost.

If preventing message loss is of the utmost importance, even this edge case can be mitigated. One
solution is to stand up redundant `nsqd` pairs (on separate hosts) that receive copies of the same
portion of messages. Because you've written your consumers to be idempotent, doing double-time on
these messages has no downstream impact and allows the system to endure any single node failure
without losing messages.

The takeaway is that **NSQ** provides the building blocks to support a variety of production use
cases and configurable degrees of durability.

### Bounded Memory Footprint

`nsqd` provides a configuration option `--mem-queue-size` that will determine the number of messages
that are kept *in memory* for a given queue. If the depth of a queue exceeds this threshold messages
are transparently written to disk. This bounds the memory footprint of a given `nsqd` process to
`mem-queue-size * #_of_channels_and_topics`:

![message overflow](http://media.tumblr.com/tumblr_mavte17V3t1qj3yp2.png)

Also, an astute observer might have identified that this is a convenient way to gain an even higher
guarantee of delivery by setting this value to something low (like 1 or even 0). The disk-backed
queue is designed to survive unclean restarts (although messages might be delivered twice).

Also, related to message delivery guarantees, *clean* shutdowns (by sending a `nsqd` process the
TERM signal) safely persist the messages currently in memory, in-flight, deferred, and in various
internal buffers.

Note, a channel whose name ends in the string `#ephemeral` will not be buffered to disk and will
instead drop messages after passing the `mem-queue-size`. This enables consumers which do not need
message guarantees to subscribe to a channel. These ephemeral channels will also not persist after
its last client disconnects.

### Efficiency

**NSQ** was designed to communicate over a "memcached-like" command protocol with simple
size-prefixed responses. All message data is kept in the core including metadata like number of
attempts, timestamps, etc. This eliminates the copying of data back and forth from server to client,
an inherent property of the previous toolchain when re-queueing a message. This also simplifies
clients as they no longer need to be responsible for maintaining message state.

Also, by reducing configuration complexity, setup and development time is greatly reduced
(especially in cases where there are >1 consumers of a topic).

For the data protocol, we made a key design decision that maximizes performance and throughput by
pushing data to the client instead of waiting for it to pull. This concept, which we
call `RDY` state, is essentially a form of client-side flow control.

When a client connects to `nsqd` and subscribes to a channel it is placed in a `RDY` state of 0.
This means that no messages will be sent to the client. When a client is ready to receive messages
it sends a command that updates its `RDY` state to some # it is prepared to handle, say 100. Without
any additional commands, 100 messages will be pushed to the client as they are available (each time
decrementing the server-side RDY count for that client).

Client libraries are designed to send a command to update `RDY` count when it reaches ~25% of the
configurable `max-in-flight` setting (and properly account for connections to multiple `nsqd`
instances, dividing appropriately).

![nsq protocol](http://media.tumblr.com/tumblr_mataigNDn61qj3yp2.png)

This is a significant performance knob as some downstream systems are able to more-easily batch
process messages and benefit greatly from a higher `max-in-flight`.

Notably, because it is both buffered *and* push based with the ability to satisfy the need for
independent copies of streams (channels), we've produced a daemon that behaves like `simplequeue`
and `pubsub` *combined* . This is powerful in terms of simplifying the topology of our systems where
we would have traditionally maintained the older toolchain discussed above.

### Go

We made a strategic decision early on to build the **NSQ** core in [Go][golang]. We recently blogged
about our [use of Go at bitly][go_at_bitly] and alluded to this very project - it might be helpful to browse
through that post to get an understanding of our thinking with respect to the language.

Regarding **NSQ**, Go channels (not to be confused with **NSQ** channels) and the language's built
in concurrency features are a perfect fit for the internal workings of `nsqd`. We leverage buffered
channels to manage our in memory message queues and seamlessly write overflow to disk.

The standard library makes it easy to write the networking layer and client code. The built in
memory and cpu profiling hooks highlight opportunities for optimization and require very little
effort to integrate. We also found it really easy to test components in isolation, mock types using
interfaces, and iteratively build functionality.

## Additional Documentation

**NSQ** is composed of the following individual components:

 * [nsqd][nsqd] is the daemon that receives, buffers, and delivers messages to clients.
 * [nsqlookupd][nsqlookupd] is the daemon that manages topology information
 * [nsqadmin][nsqadmin] is the web UI to view message statistics and perform administrative tasks
 * [nsq][nsq] is a go package for writing `nsqd` clients
 * [pynsq][pynsq] is a python module for writing `nsqd` clients

There is also a [protocol spec][protocol].

### Getting Started

The following steps will run **NSQ** on your local machine and walk through publishing, consuming,
and archive messages to disk.

 1. follow the instructions in the [INSTALLING][installing] doc.
 2. in one shell, start `nsqlookupd`:

        $ nsqlookupd

 3. in another shell, start `nsqd`:

        $ nsqd --lookupd-tcp-address=127.0.0.1:4160

 4. in another shell, start `nsqadmin`:

        $ nsqadmin --lookupd-http-address=127.0.0.1:4161

 5. finally, in another shell, start `nsq_to_file`:

        $ nsq_to_file --topic=test --output-dir=/tmp --lookupd-http-address=127.0.0.1:4161

 6. publish some messages to `nsqd`:

        $ curl -d 'hello world 1' 'http://127.0.0.1:4151/put?topic=test'
        $ curl -d 'hello world 2' 'http://127.0.0.1:4151/put?topic=test'
        $ curl -d 'hello world 3' 'http://127.0.0.1:4151/put?topic=test'

 7. to verify things worked as expected, in a web browser open `http://127.0.0.1:4171/` to view
    the `nsqadmin` UI and check the log files (`test.*.log`) written to `/tmp`.

The important lesson here is that `nsq_to_file` (the client) is not explicitly told where the `test`
topic is produced, it retrieves this information from `nsqlookupd`.

[simplehttp]: https://github.com/bitly/simplehttp
[idempotence]: http://en.wikipedia.org/wiki/Idempotence
[golang]: http://golang.org
[go_at_bitly]: http://word.bitly.com/post/29550171827/go-go-gadget
[msgpack]: http://msgpack.org/
[go-protobuf]: http://code.google.com/p/protobuf/
[simplequeue]: https://github.com/bitly/simplehttp/tree/master/simplequeue
[protocol]: https://github.com/bitly/nsq/blob/master/docs/protocol.md
[installing]: https://github.com/bitly/nsq/blob/master/INSTALLING.md
[nsqd]: https://github.com/bitly/nsq/tree/master/nsqd
[nsqlookupd]: https://github.com/bitly/nsq/tree/master/nsqlookupd
[nsqadmin]: https://github.com/bitly/nsq/tree/master/nsqadmin
[nsq]: https://github.com/bitly/nsq/tree/master/nsq
[pynsq]: https://github.com/bitly/nsq/tree/master/pynsq
[nsq_post]: http://word.bitly.com/post/33232969144/nsq


text:
<?php

namespace Proyecto\ExtensionBundle\Controller;

/**
 * This code has been auto-generated by the JMSDiExtraBundle.
 *
 * Manual changes to it will be lost.
 */
class ExtensionController__JMSInjector
{
    public static function inject($container) {
        $instance = new \Proyecto\ExtensionBundle\Controller\ExtensionController();
        return $instance;
    }
}

redpajama_set_name: RedPajamaGithub


text:
using DragonSpark.Commands;
using DragonSpark.ComponentModel;
using DragonSpark.Sources.Parameterized;
using System.Windows.Input;

namespace DragonSpark.Testing.Framework.Application.Setup
{
	public abstract class CommandAttributeBase : HostingAttributeBase
	{
		protected CommandAttributeBase( ICommand command ) : this( command.Adapt<AutoData>() ) {}
		protected CommandAttributeBase( ICommand<AutoData> command ) : base( command.Wrap() ) {}
	}
}


text:
Rails.application.routes.draw do
  root 'home#index'

  resources :comments
  resources :furnitures
  resources :users

  get 'home/index'
  get 'home/contact'
  get 'home/careers'
  get 'home/wishlist'
  get 'home/settings'
  get 'home/lottery'
  get 'home/lottery_gamble'
  get 'home/error'
  get 'home/wishlist'
  get '/by_category' => 'furnitures#by_category'

  delete '/logout' => 'sessions#logout'
  post '/login' => 'sessions#login'
  post '/signup' => 'sessions#signup'
  post '/purchase' => 'furnitures#purchase'
  post '/trade' => 'furnitures#trade'
  post '/add_wishlist' => 'home#add_wishlist'
  delete '/remove_wishlist' => 'home#remove_wishlist'

  get 'furnitures/wishlist'
  get 'home/wish'

end


text:
<!--
 * Copyright (C) 2013 KO GmbH <copyright@kogmbh.com>
 *
 * @licstart
 * This file is part of WebODF.
 *
 * WebODF is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License (GNU AGPL)
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * WebODF is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with WebODF.  If not, see <http://www.gnu.org/licenses/>.
 * @licend
 *
 * @source: http://www.webodf.org/
 * @source: https://github.com/kogmbh/WebODF/
-->
<tests
    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/">

 <test name="ApplyDirectStylingApplyDirectStyling_{[__]}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[__]_}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
    <op optype="ApplyDirectStyling" memberid="Bob" position="4" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{[__]_}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[__]}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="3">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{__}_]_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
    <op optype="ApplyDirectStyling" memberid="Alice" position="4" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[{__}_]_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="3">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="4" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{__}]_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="3">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{_]_}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[_}_]_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{__}[__]_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[__]{__}_sameStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{[__]}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[__]_}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{[__]_}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[__]}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="3">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="3">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{__}_]_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="4">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
    <op optype="ApplyDirectStyling" memberid="Alice" position="4" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[{__}_]_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="3">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="4" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{__}]_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="3">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[_{_]_}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{_[_}_]_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="2" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="1">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_{__}[__]_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
 <test name="ApplyDirectStylingApplyDirectStyling_[__]{__}_oppositeStyling">
  <in>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </in>
  <out>
   <opsA>
    <op optype="ApplyDirectStyling" memberid="Alice" position="3" length="2">
     <setProperties><style:text-properties fo:font-weight="normal" /></setProperties>
    </op>
   </opsA>
   <opsB>
    <op optype="ApplyDirectStyling" memberid="Bob" position="1" length="2">
     <setProperties><style:text-properties fo:font-weight="bold" /></setProperties>
    </op>
   </opsB>
  </out>
 </test>
</tests>


text:
**Vue 2.0** or above

> For older Vue supports please refer to [VueTyped 2.0.1](https://github.com/vue-typed/vue-typed/tree/v2.0.1).

**Typescript 2.2.2** or above

## NPM
```bash
$ npm install vue-typed
```

## Bower
```bash
$ bower install vue-typed
```

## CLI
If you are start with a new project, then it's good to use [vue-typed-boilerplate](https://github.com/budiadiono/vue-typed-boilerplate) to scaffold your new project.
This boilerplate setup [typescript](typescriptlang.org) project using [webpack](http://webpack.github.io/) as the module bundler.

```bash
$ npm install -g vue-cli
$ vue init vue-typed/vue-typed-boilerplate my-project
$ cd my-project
$ npm install
$ npm start
```


text:
import sys
import os
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None

from fax_production_process import ProductionProcess

class SortTruth(ProductionProcess):
    '''Sort peak infomation in fax_truth from peak to event level'''

    process_oerder = 4
    __version__ = '0.0.1'

    def _check(self):
        return os.path.isfile('{truth_sorted_path}/{production_id}.csv'.format(truth_sorted_path=self.config['DIRECTORY']['truth_sorted'], production_id=self.production_id))

    def _process(self):
        # Read in the csv file
        self.truth_raw_path = self.config['DIRECTORY']['truth_raw']
        self.truth_sorted_path = self.config['DIRECTORY']['truth_sorted']

        self.truth_file = open(os.path.join(
            self.truth_raw_path, '{name}.csv'.format(name=self.production_id)))
        self.truth_peak = pd.read_csv(self.truth_file)
        self.truth_peak.drop(['fax_truth_peak_id', 'g4_id', 'instruction', 'repetition', 'n_electrons',
                              't_first_electron', 't_last_electron', 't_sigma_electrons', 't_mean_electrons', 't_interaction',
                              't_first_photon', 't_last_photon', 'z',
                              ], axis=1, inplace=True)

        # Separate out s1, s2, and other peaks
        tmp = []
        for i, peak_type in enumerate(['s1', 's2', 'other_s2']):
            if peak_type == 'other_s2':
                _df = self.truth_peak[~self.truth_peak.peak_type.isin([
                                                                      's1', 's2'])]
                tmp.append(_df.loc[_df.groupby('event').n_photons.idxmax()])
            else:
                tmp.append(
                    self.truth_peak[self.truth_peak.peak_type == peak_type])

            replace_dict = {
                'n_photons': '%s' % peak_type,
                't_mean_photons': '%s_hit_time_mean' % peak_type,
                't_sigma_photons': '%s_width' % peak_type,
                'top_fraction': '%s_area_fraction_top' % peak_type,
                'x': '%s_x' % peak_type,
                'y': '%s_y' % peak_type,
            }

            tmp[i].rename(columns=replace_dict, inplace=True)
            tmp[i].drop('peak_type', axis=1, inplace=True)

        # Create a new dataframe on event level,
        # Merge s1, s2 and other peaks accroding to 'event' columns
        self.truth_event = pd.DataFrame()
        self.truth_event['event_number'] = self.truth_peak.event.unique()

        for t in tmp:
            self.truth_event = self.truth_event.merge(t, left_on='event_number',
                                                      right_on='event', how='left').drop('event', axis=1)

        # Doing some refining jobs
        self.truth_event.drop(
            ['s1_x', 's1_y', 'other_s2_x', 'other_s2_y'], axis=1, inplace=True)
        self.truth_event.rename(
            columns={'s2_x': 'x', 's2_y': 'y'}, inplace=True)

        # Save the sorted dataframe to pickle
        self.truth_event.to_hdf(os.path.join(
            self.truth_sorted_path, '{name}.h5'.format(name=self.production_id)), 'table')
        self.truth_event.to_csv(os.path.join(
            self.truth_sorted_path, '{name}.csv'.format(name=self.production_id)), index=False)

class MergeTruth(ProductionProcess):
    '''Merge sorted fax truth with minitree pickle give every column in fax truth prefix: truth_{column_name}'''

    process_oerder = 6
    __version__ = '0.0.1'

    def _check(self):
        return os.path.isfile('{merged_path}/{production_id}.pkl'.format(merged_path=self.config['DIRECTORY']['merged'], production_id=self.production_id))

    def _process(self):
        self.truth_sorted_path = self.config['DIRECTORY']['truth_sorted']
        self.minitree_pickle_path = self.config['DIRECTORY']['minitree_pickle']
        self.merged_path = self.config['DIRECTORY']['merged']

        self.truth = pd.read_hdf(
            '{path}/{name}.h5'.format(path=self.truth_sorted_path, name=self.production_id), 'table')
        self.data = pd.read_hdf(
            '{path}/{name}.h5'.format(path=self.minitree_pickle_path, name=self.production_id), 'table')

        # Change column name for truth
        name_replace_dict = {col: 'truth_' + col for col in self.truth.columns}
        self.truth.rename(columns=name_replace_dict, inplace=True)

        self.merged = self.data.merge(
            self.truth, left_on='event_number', right_on='truth_event_number', how='outer')
        self.merged.drop('truth_event_number', axis=1, inplace=True)
        self.merged.to_hdf(
            '{path}/{name}.h5'.format(path=self.merged_path, name=self.production_id), 'table')


text:
using System;
using System.Linq;
using Marten.Schema;
using Marten.Testing.Harness;
using Shouldly;
using Weasel.Postgresql;
using Xunit;

namespace Marten.Testing.Bugs
{
    public class Bug_127_do_not_recreate_a_table_with_duplicated_string_field_Tests : BugIntegrationContext
    {
        [Fact]
        public void does_not_recreate_the_table()
        {
            var store1 = SeparateStore(_ =>
            {
                _.AutoCreateSchemaObjects = AutoCreate.All;
            });

            store1.Advanced.Clean.CompletelyRemoveAll();

            using (var session1 = store1.OpenSession())
            {
                session1.Store(new Team { Name = "Warriors" });
                session1.Store(new Team { Name = "Spurs" });
                session1.Store(new Team { Name = "Thunder" });

                session1.SaveChanges();

                session1.Query<Team>().Count().ShouldBe(3);
            }

            var store2 = SeparateStore(_ =>
            {
                _.AutoCreateSchemaObjects = AutoCreate.All;
            });

            using (var session2 = store2.QuerySession())
            {
                session2.Query<Team>().Count().ShouldBe(3);
            }
        }
    }

    public class Team
    {
        public Guid Id { get; set; }

        [DuplicateField]
        public string Name { get; set; }
    }
}


text:
import java.net.URL;
import features.*;

/**
 * This represents the heart of the browser: the collections that organize all
 * the URLs into useful structures.
 *
 * @author Edwin Ward
 * @author Robert C. Duvall
 */
public class BrowserModel {
    private Home myHome;
    private History myHistory;
    private Favorites myFavorites;

    /**
     * Creates an empty model.
     */
    public BrowserModel () {
        myHome = new Home();
        myHistory = new History();
        myFavorites = new Favorites();
    }

    /**
     * Returns the first page in next history, null if next history is empty.
     */
    public URL next () {
        return myHistory.next();
    }

    /**
     * Returns the first page in back history, null if back history is empty.
     */
    public URL back () {
        return myHistory.back();
    }

    /**
     * Returns true if there is a next URL available
     */
    public boolean hasNext () {
        return myHistory.hasNext();
    }

    /**
     * Returns true if there is a previous URL available
     */
    public boolean hasPrevious () {
        return myHistory.hasPrevious();
    }

    /**
     * Changes current page to given URL, removing next history.
     */
    public void go (URL url) {
        myHistory.handleURL(url);
        myHome.handleURL(url);
        myFavorites.handleURL(url);
        System.out.println("Current URL: " + url);
    }

    /**
     * Returns URL of the current home page or null if none is set.
     */
    public URL getHome () {
        return myHome.getURL();
    }

    /**
     * Sets current home page to the current URL being viewed.
     */
    public void setHome () {
        myHome.setHome();
    }

    /**
     * Adds current URL being viewed to favorites collection with given name.
     */
    public void addFavorite (String name) {
        myFavorites.add(name);
    }

    /**
     * Returns URL from favorites associated with given name, null if none set.
     */
    public URL getFavorite (String name) {
        return myFavorites.getFavoriteURL(name);
    }
}


text:
package io.github.m0pt0pmatt.survivalgames.command.executor.set;

import static io.github.m0pt0pmatt.survivalgames.Util.getOrThrow;
import static io.github.m0pt0pmatt.survivalgames.Util.sendSuccess;

import io.github.m0pt0pmatt.survivalgames.command.CommandKeys;
import io.github.m0pt0pmatt.survivalgames.command.element.SurvivalGameCommandElement;
import io.github.m0pt0pmatt.survivalgames.command.executor.LeafCommand;
import io.github.m0pt0pmatt.survivalgames.command.executor.SurvivalGamesCommand;
import io.github.m0pt0pmatt.survivalgames.game.SurvivalGame;
import java.lang.reflect.InvocationTargetException;
import javax.annotation.Nonnull;
import org.spongepowered.api.command.CommandException;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.args.GenericArguments;
import org.spongepowered.api.text.Text;

class SetWorldNameCommand extends LeafCommand {

    private static final SurvivalGamesCommand INSTANCE = new SetWorldNameCommand();

    private SetWorldNameCommand() {
        super(
                SetCommand.getInstance(),
                "world-name",
                GenericArguments.seq(
                        SurvivalGameCommandElement.getInstance(),
                        GenericArguments.world(CommandKeys.WORLD_NAME)));
    }

    @Nonnull
    @Override
    public CommandResult executeCommand(@Nonnull CommandSource src, @Nonnull CommandContext args)
            throws CommandException {
        SurvivalGame survivalGame = (SurvivalGame) getOrThrow(args, CommandKeys.SURVIVAL_GAME);
        Object worldInfo = getOrThrow(args, CommandKeys.WORLD_NAME);

        String worldName;
        try {
            worldName = (String) worldInfo.getClass().getMethod("getWorldName").invoke(worldInfo);
        } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) {
            throw new CommandException(Text.of("Error: " + e.getMessage()), e);
        }

        survivalGame.getConfig().setWorldName(worldName);

        sendSuccess(src, "Set world name", worldName);
        return CommandResult.success();
    }

    static SurvivalGamesCommand getInstance() {
        return INSTANCE;
    }
}


text:
 # Copyright (c) 2007 IIMURA Takuji. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditionscc
 # are met:
 # 1. Redistributions of source code must retain the above copyright
 #    notice, this list of conditions and the following disclaimer.
 # 2. Redistributions in binary form must reproduce the above copyright
 #    notice, this list of conditions and the following disclaimer in the
 #    documentation and/or other materials provided with the distribution.
 #
 # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 # $Id: Makefile 57 2007-07-04 05:58:41Z  $

CPP = g++
CC = gcc
AR = ar
RANLIB = ranlib

SRCS = StreamBuffer.cpp
SRCS += Kicker.cpp MainLoop.cpp ServiceDB.cpp
SRCS += ServiceManager.cpp FDWatcher.cpp PipeManager.cpp
SRCS += SysDataHolder.cpp
CSRCS = net.c tools.c upnp.c thread.c

TARGET = libNetPipe.a
CFLAGS = -g -O -Wall -DDEBUG -Wuninitialized -pg
LOPTIONS = -pg

CFLAGS += #-D__NetBSD__
CFLAGS += #-D__Linux__

OBJS = $(SRCS:.cpp=.o) $(CSRCS:.c=.o)

.c.o:
	$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
.cpp.o:
	$(CPP) -c $(CFLAGS) $(INCLUDES) $< -o $@

all:	$(TARGET)

libNetPipe.a:	$(OBJS)
	$(AR) rc $@ $(OBJS)
	$(RANLIB) $@

clean:
	rm -f $(TARGET) *.core $(OBJS)


text:
@import Foundation;

extern NSString *const VENErrorDomainHTTPResponse;

typedef NS_ENUM(NSInteger, VEErrorCodeHTTPResponse) {
    VENErrorCodeHTTPResponseUnauthorizedRequest,
    VENErrorCodeHTTPResponseBadResponse,
    VENErrorCodeHTTPResponseInvalidObjectType
};

@interface VENHTTPResponse : NSObject

@property (nonatomic, readonly, strong) id object;
@property (nonatomic, readonly, assign) NSInteger statusCode;

- (instancetype)initWithStatusCode:(NSInteger)statusCode responseObject:(id)object;

/**
 * Returns YES if the response represents an error state.
 */
- (BOOL)didError;

/**
 * Returns an NSError object or nil if the response does not represent an error state.
 */
- (NSError *)error;

@end


text:
<!--
  Copyright 2013 Marcel Walch, Florian Schaub

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

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

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".PassGoCreatePasswordActivity" >

    <LinearLayout
        style="?android:attr/buttonBarStyle"
       	android:id="@+id/buttonBar"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/passgo_clear"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:drawableLeft="@android:drawable/ic_menu_delete"
            android:onClick="clearAll"
            android:text="@string/btn_clearall" />

        <Button
            android:id="@+id/passgo_save"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:clickable="false"
            android:drawableLeft="@drawable/ic_menu_login"
            android:enabled="false"
            android:onClick="submit"
            android:text="@string/btn_done" />
    </LinearLayout>

    <de.uulm.graphicalpasswords.openpassgo.PatternView
        android:id="@+id/passgo_patternview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/buttonBar"
        android:padding="10dp" />

</RelativeLayout>


text:
class CreateBitPlayerContentProviders < ActiveRecord::Migration
  def change
    create_table :bit_player_content_providers do |t|
      t.string :type, null: false
      t.string :source_content_type
      t.integer :source_content_id
      t.references :bit_player_content_module, null: false
      t.integer :position, null: false, default: 1

      t.timestamps
    end

    add_index :bit_player_content_providers, :bit_player_content_module_id, name: "content_module_index"

    reversible do |dir|
      dir.up do
        execute <<-SQL
          ALTER TABLE bit_player_content_providers
            ADD CONSTRAINT fk_content_providers_modules
            FOREIGN KEY (bit_player_content_module_id)
            REFERENCES bit_player_content_modules(id)
        SQL
      end

      dir.down do
        execute <<-SQL
          ALTER TABLE bit_player_content_providers
            DROP CONSTRAINT fk_content_providers_modules
        SQL
      end
    end
  end
end


text:
package caaa

import (
	"encoding/xml"

	"github.com/fgrid/iso20022"
)

type Document00200104 struct {
	XMLName xml.Name                          `xml:"urn:iso:std:iso:20022:tech:xsd:caaa.002.001.04 Document"`
	Message *AcceptorAuthorisationResponseV04 `xml:"AccptrAuthstnRspn"`
}

func (d *Document00200104) AddMessage() *AcceptorAuthorisationResponseV04 {
	d.Message = new(AcceptorAuthorisationResponseV04)
	return d.Message
}

// The AcceptorAuthorisationResponse message is sent by the acquirer (or its agent) to an acceptor (or its agent), to return the result of the validation made by issuer about the payment transaction.
type AcceptorAuthorisationResponseV04 struct {

	// Authorisation response message management information.
	Header *iso20022.Header10 `xml:"Hdr"`

	// Information related to the response of the authorisation.
	AuthorisationResponse *iso20022.AcceptorAuthorisationResponse4 `xml:"AuthstnRspn"`

	// Trailer of the message containing a MAC.
	SecurityTrailer *iso20022.ContentInformationType11 `xml:"SctyTrlr"`
}

func (a *AcceptorAuthorisationResponseV04) AddHeader() *iso20022.Header10 {
	a.Header = new(iso20022.Header10)
	return a.Header
}

func (a *AcceptorAuthorisationResponseV04) AddAuthorisationResponse() *iso20022.AcceptorAuthorisationResponse4 {
	a.AuthorisationResponse = new(iso20022.AcceptorAuthorisationResponse4)
	return a.AuthorisationResponse
}

func (a *AcceptorAuthorisationResponseV04) AddSecurityTrailer() *iso20022.ContentInformationType11 {
	a.SecurityTrailer = new(iso20022.ContentInformationType11)
	return a.SecurityTrailer
}


text:
var classthewizardplusplus_1_1anna_1_1graphics_1_1exceptions_1_1_unable_to_register_raw_input_device_exception =
[
    [ "UnableToRegisterRawInputDeviceException", "classthewizardplusplus_1_1anna_1_1graphics_1_1exceptions_1_1_unable_to_register_raw_input_device_exception.html#a0bb18e5f9465c07a768df3dd657fce69", null ]
];


text:
package libkb

func getUsernameIfProvisioned(m MetaContext, uc UserConfig) (ret NormalizedUsername, err error) {
	m.CDebugf("getUsernameIfProvisioned(%+v)", uc)
	did := uc.GetDeviceID()
	if did.IsNil() {
		m.CDebugf("- no valid username since nil deviceID")
		return ret, nil
	}
	err = checkDeviceValidForUID(m.Ctx(), m.G().GetUPAKLoader(), uc.GetUID(), did)
	switch err.(type) {
	case nil:
		m.CDebugf("- checks out")
		return uc.GetUsername(), nil
	case DeviceNotFoundError:
		m.CDebugf("- user was likely reset (%s)", err)
		return ret, nil
	case KeyRevokedError:
		m.CDebugf("- device was revoked (s)", err)
		return ret, nil
	case UserDeletedError:
		m.CDebugf(" - user was deleted (%s)", err)
		return ret, nil
	case NotFoundError:
		// This can happen in development if the dev db is nuked or a mobile
		// device is connected to dev servers.
		m.CDebugf(" - user wasn't found (%s)", err)
		return ret, nil
	default:
		m.CDebugf("- unexpected error; propagating (%s)", err)
		return ret, err
	}
}

// GetAllProvisionedUsernames looks into the current config.json file, and finds all usernames
// that are currently provisioned on this device. That is, it filters out those that are on revoked
// devices or have reset their accounts. It uses UPAK loading for verifying the current user/device
// statuses, so should be fast if everything is cached recently.
func GetAllProvisionedUsernames(m MetaContext) (current NormalizedUsername, all []NormalizedUsername, err error) {

	m = m.WithLogTag("GAPU")
	defer m.CTrace("GetAllProvisionedUsernames", func() error { return err })()

	currentUC, allUCs, err := m.G().Env.GetConfig().GetAllUserConfigs()
	if err != nil {
		return current, nil, err
	}

	if currentUC != nil {
		current, err = getUsernameIfProvisioned(m, *currentUC)
		if err != nil {
			return current, nil, err
		}
	}

	for _, u := range allUCs {
		tmp, err := getUsernameIfProvisioned(m, u)
		if err != nil {
			return current, nil, err
		}
		if !tmp.IsNil() {
			all = append(all, tmp)
		}
	}

	return current, all, nil
}


text:
    module.exports = header: 'Ambari Ranger UserSync Install', handler: ({options}) ->

## SSL

      @call header: 'SSL', retry: 0, ->
        @java.keystore_add
          header: 'Truststore CA'
          keystore: options.config['ranger.usersync.truststore.file']
          storepass: options.config['ranger.usersync.truststore.password']
          caname: "hadoop_root_ca"
          cacert: options.ssl.cacert.source
          local: options.ssl.cacert.local
        # Server: import certificates, private and public keys to hosts with a server
        @java.keystore_add
          header: 'Keystore cert and key'
          keystore: options.config['ranger.usersync.keystore.file']
          storepass: options.config['ranger.usersync.keystore.password']
          key: "#{options.ssl.key.source}"
          cert: "#{options.ssl.cert.source}"
          keypass:options.config['ranger.usersync.keystore.password']
          name: "#{options.ssl.key.name}"
          local: options.ssl.key.local
          uid: options.user.name
          gid: options.group.name
        @java.keystore_add
          header: 'Keystore CA'
          keystore: options.config['ranger.usersync.keystore.file']
          storepass: options.config['ranger.usersync.keystore.password']
          caname: "hadoop_root_ca"
          cacert: "#{options.ssl.cacert.source}"
          local: options.ssl.cacert.local
          uid: options.user.name
          gid: options.group.name


text:
#ifndef KARPRABINHASH
#define KARPRABINHASH

#include "characterhash.h"
#include <tudocomp/Algorithm.hpp>

namespace tdc {

/**
* This is a randomized version of the Karp-Rabin hash function.
* Each instance is a rolling hash function meant to hash streams of characters.
* Each new instance of this class comes with new random keys.
*
* Recommended usage to get L-bit hash values over n-grams:
*        KarpRabinHash<> hf(n,L );
*        for(uint32 k = 0; k<n;++k) {
*                  unsigned char c = ... ; // grab some character
*                  hf.eat(c); // feed it to the hasher
*        }
*        while(...) { // go over your string
*           hf.hashvalue; // at all times, this contains the hash value
*           unsigned char c = ... ;// points to the next character
*           unsigned char out = ...; // character we want to forget
*           hf.update(out,c); // update hash value
*        }
*/
class KarpRabinHash  : public Algorithm {
public:
	typedef uint64_t hashvaluetype;
	typedef unsigned char chartype;
	typedef hashvaluetype key_type;
    inline static Meta meta() {
        Meta m("hash_roll", "rk", "Karp-Rabin Rolling Hash");
		return m;
	}
	void operator+=(char c) { eat(c); }
	hashvaluetype operator()() const { return hashvalue; }
	void clear() { hashvalue= 0;}

    // myn is the length of the sequences, e.g., 3 means that you want to hash sequences of 3 characters
    // mywordsize is the number of bits you which to receive as hash values, e.g., 19 means that the hash values are 19-bit integers
    KarpRabinHash(Env&& env) : Algorithm(std::move(env)), hashvalue(0),n(4),
        wordsize(64),
        hasher( maskfnc<hashvaluetype>(wordsize)),
        HASHMASK(maskfnc<hashvaluetype>(wordsize)),BtoN(1) {
        for (int i=0; i < n ; ++i) {
            BtoN *= B;
            BtoN &= HASHMASK;
        }
    }

    // this is a convenience function, use eat,update and .hashvalue to use as a rolling hash function
    template<class container>
    hashvaluetype  hash(container & c) {
        hashvaluetype answer(0);
        for(uint k = 0; k<c.size(); ++k) {
            hashvaluetype x(1);
            for(uint j = 0; j< c.size()-1-k; ++j) {
                x= (x * B) & HASHMASK;
            }
            x= (x * hasher.hashvalues[c[k]]) & HASHMASK;
            answer=(answer+x) & HASHMASK;
        }
        return answer;
    }

    // add inchar as an input, this is used typically only at the start
    // the hash value is updated to that of a longer string (one where inchar was appended)
    void eat(chartype inchar) {
        hashvalue = (B*hashvalue +  hasher.hashvalues[inchar] )& HASHMASK;
    }

    // add inchar as an input and remove outchar, the hashvalue is updated
    // this function can be used to update the hash value from the hash value of [outchar]ABC to the hash value of ABC[inchar]
    void update(chartype outchar, chartype inchar) {
        hashvalue = (B*hashvalue +  hasher.hashvalues[inchar] - BtoN *  hasher.hashvalues[outchar]) & HASHMASK;
    }

    hashvaluetype hashvalue;
    int n;
    const int wordsize;
    CharacterHash<hashvaluetype,chartype> hasher;
    const hashvaluetype HASHMASK;
    hashvaluetype BtoN;
    static const hashvaluetype B=37;

};

}//ns
#endif


text:
title: Life Sciences
slug: life-sciences
sort: life
# The following are constants: do not modify
layout: subject
type: subject
---


text:
import { isArray } from './isArray';
export function isNumeric(val) {
    return !isArray(val) && (val - parseFloat(val) + 1) >= 0;
}
//# sourceMappingURL=isNumeric.js.map


text:
package com.github.qingsong.core.servlets;

import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;

import javax.servlet.ServletException;
import java.io.IOException;

/**
 * Servlet that writes some sample content into the response. It is mounted for
 * all resources of a specific Sling resource type. The
 * {@link SlingSafeMethodsServlet} shall be used for HTTP methods that are
 * idempotent. For write operations use the {@link SlingAllMethodsServlet}.
 */
@SuppressWarnings("serial")
@SlingServlet(resourceTypes = "training/structure/page")
public class SimpleServlet extends SlingSafeMethodsServlet {

    @Override
    protected void doGet(final SlingHttpServletRequest req,
            final SlingHttpServletResponse resp) throws ServletException, IOException {
        final Resource resource = req.getResource();
        resp.getOutputStream().println(resource.toString());
        resp.getOutputStream().println(
                "This content is generated by the SimpleServlet");
    }
}


text:
package eu.uqasar.service.company;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Join;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;

import org.apache.commons.lang.StringUtils;

import eu.uqasar.model.company.Company;
import eu.uqasar.model.company.Company_;
import eu.uqasar.model.product.Product;
import eu.uqasar.model.product.Product_;
import eu.uqasar.model.user.User;
import eu.uqasar.model.user.User_;
import eu.uqasar.service.AbstractService;
import eu.uqasar.web.pages.admin.companies.panels.CompanyFilterStructure;
import eu.uqasar.web.pages.admin.users.panels.UserFilterStructure;

public class CompanyService extends AbstractService<Company> {

	protected CompanyService() {
		super(Company.class);
	}

	public List<Company> getAllCompanys() {
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Company> query = cb.createQuery(Company.class);
		query.from(Company.class);
		return em.createQuery(query).getResultList();
	}

	/**
	 *
	 * @param innovationObjective
	 * @return
	 */
	public List<Company> getAllByAscendingName() {
		logger.infof("loading all Company ordered by ascending name ...");
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Company> criteria = cb.createQuery(Company.class);
		Root<Company> root = criteria.from(Company.class);
		criteria.orderBy(cb.asc(root.get(Company_.name)));
		return em.createQuery(criteria).getResultList();
	}

	/**
	 *
	 * @param innovationObjective
	 * @return
	 */
	public List<Company> getAllByAscendingNameFiltered(CompanyFilterStructure filter, int first, int count) {
		logger.infof("loading all Companies ordered by ascending name matching the given filter %s...", filter);
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Company> criteria = cb.createQuery(Company.class);
		Root<Company> root = criteria.from(Company.class);

		criteria.where(
				cb.or(
					cb.equal(root.get(Company_.name), filter.getName()),
					cb.equal(root.get(Company_.shortName), filter.getShortName()),
					cb.equal(root.get(Company_.country), filter.getCountry()))

		);
		return em.createQuery(criteria).setFirstResult(first).setMaxResults(count).getResultList();
	}

	public long countAllFiltered(final CompanyFilterStructure filter) {
		logger.infof("counting all Companies matching the filter %s ...", filter);
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Long> criteria = cb.createQuery(Long.class);
		Root<Company> from = criteria.from(Company.class);
		criteria.where(
				cb.or(
					cb.equal(from.get(Company_.name), filter.getName()),
					cb.equal(from.get(Company_.shortName), filter.getShortName()),
					cb.equal(from.get(Company_.country), filter.getCountry())
					)
		);
		criteria.select(cb.countDistinct(from));
		return em.createQuery(criteria).getSingleResult();
	}

	/**
	 *
	 * @param companyId
	 * @return
	 */
	public boolean companyExists(Long companyId) {
		logger.info(String.format(
				"checking if Company with ID %d exists ...", companyId));
		CriteriaBuilder cb = em.getCriteriaBuilder();
		CriteriaQuery<Long> criteria = cb.createQuery(Long.class);
		Root<Company> from = criteria.from(Company.class);
		criteria.where(cb.equal(from.get(Company_.id), companyId));
		criteria.select(cb.countDistinct(from));
		return (em.createQuery(criteria).getSingleResult().longValue() == 1);
	}
}