text:
package org.dasein.cloud.compute;

import java.io.Serializable;

public class ScalingPolicy implements Serializable {
    private static final long serialVersionUID = 4090371193033312095L;

    private String                adjustmentType;
    private String                autoScalingGroupName;
    private int                   coolDown;
    private int                   minAdjustmentStep;
    private String                id;
    private String                name;
    private int                   scalingAdjustment;
    private Alarm[]               alarms;

    public ScalingPolicy() { }

    public void setAdjustmentType(String adjustmentType) {
        this.adjustmentType = adjustmentType;
    }

    public String getAdjustmentType() {
        return this.adjustmentType;
    }

    public void setAutoScalingGroupName(String autoScalingGroupName) {
      this.autoScalingGroupName = autoScalingGroupName;
    }

    public String getAutoScalingGroupName() {
      return this.autoScalingGroupName;
    }

    public void setCoolDown(int coolDown) {
      this.coolDown = coolDown;
    }

    public int getCoolDown() {
      return this.coolDown;
    }

    public void setMinAdjustmentStep(int minAdjustmentStep) {
      this.minAdjustmentStep = minAdjustmentStep;
    }

    public int getMinAdjustmentStep() {
      return this.minAdjustmentStep;
    }

    public void setId(String id) {
      this.id = id;
    }

    public String getId() {
      return this.id;
    }

    public void setName(String name) {
      this.name = name;
    }

    public String getName() {
      return this.name;
    }

    public void setScalingAdjustment(int scalingAdjustment) {
      this.scalingAdjustment = scalingAdjustment;
    }

    public int getScalingAdjustment() {
      return this.scalingAdjustment;
    }

    public void setAlarms(Alarm[] alarms) {
      this.alarms = alarms;
    }

    public Alarm[] getAlarms() {
      return this.alarms;
    }
}


text:
assertEquals(globalThis, this);
assertEquals(this.globalThis, this);
assertEquals(globalThis.globalThis, this);
assertEquals(globalThis.globalThis.globalThis, this);
assertEquals(globalThis.globalThis.globalThis.globalThis, this);

{
  const realm = Realm.create();
  assertEquals(Realm.global(realm), Realm.eval(realm, 'globalThis'));
  assertNotEquals(Realm.global(realm), globalThis);
}

{
  const descriptor = Object.getOwnPropertyDescriptor(
    this,
    'globalThis'
  );
  assertEquals(descriptor.value, this);
  assertEquals(descriptor.writable, true);
  assertEquals(descriptor.enumerable, false);
  assertEquals(descriptor.configurable, true);
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef THREADING_MUTEX_AUTO_LOCK_H
#define THREADING_MUTEX_AUTO_LOCK_H

#if __cplusplus >= 201103L
	#include <mutex>
	using MutexAutoLock = std::lock_guard<std::mutex>;
#else

#include "threading/mutex.h"

class MutexAutoLock
{
public:
	MutexAutoLock(Mutex &m) : mutex(m) { mutex.lock(); }
	~MutexAutoLock() { mutex.unlock(); }

private:
	Mutex &mutex;
};

#endif

#endif


text:
module Nyauth
  class ConfimationRequestService
    include ActiveModel::Model
    attr_reader :client

    def initialize(client)
      @client = client
    end

    def save
      client.request_confirmation
      client.save
    end
  end
end


text:
<TITLE>Review for Memoirs of an Invisible Man (1992)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Memoirs of an Invisible Man (1992)

reviewed by
Frank Maloney

                         MEMOIRS OF AN INVISIBLE MAN
                       A film review by Frank Maloney
                        Copyright 1992 Frank Maloney

     MEMOIRS OF AN INVISIBLE MAN is a film directed by John Carpenter.
The script was written by Robert Collector, Dana Olsen, and William
Goldman, based on a novel by H.F.  Saint.   It stars Chevy Chase, Darryl
Hannah, Sam Neil.  Rated PG-13, for mature humor, mild profanity.

     MEMOIRS OF AN INVISIBLE MAN is an agreeable, likeable, barely-there
piece of special-effects fluff.  It's entertaining but it leaves you
wanting to see a real movie, with some substance.

     Certainly, this is Chevy Chase's most engaging and energetic
performance in years, although it cannot compare with the screwball
comedy-mystery he made with Goldie Hawn in the Seventies, except that
both films are set in San Francisco.  And we get to see him briefly nude
twice, which is a pretty high ratio of occurrence for a film in which we
can't see him at all half the time.  Chevy's character could have been
quite interesting: he's a non-ambitious yuppie, a coaster who makes
money despite himself, a b.s. artist, whose comfortable apoliticalness
should be more challenged by his predicament.

     The thing about this Invisible Man movie that is supposed to make
it interesting is its depiction what it would really be like, what would
be the unexpected disadvantages.  Except as a vehicle for the Industrial
Light and Magic magic and for the extended chase that makes up most of
the movie, this psychological (and physical) dynamic is given a pretty
short shrift.

     The less said about Daryl Hannah the better.

     Sam Neil, as the heavy, gets to turn in a likeably vile
performance.  Ever since the Garden of Eden, the bad guy's been stealing
the show and MEMOIRS OF AN INVISIBLE MAN is no exception.  Of course,
his viciousness and duplicity and ruthlessness are completely
unexplained as character traits.  There are just givens, that is, he's a
spook and that's all we need to know to understand him.  Too bad.

     Carpenter, who was hired on the strength of his STARMAN, does some
wonderful intercutting of Chevy visible and invisible to the audience.
The effects are pretty good, but frankly they are not convincing, that
is, they never fail to look like effects.  Indeed some of them are
amateurishly clumsy, such as the gun held to Neil's head and a headless
Chevy running through a park.  The best is the bubble gum bit and that's
about two minutes into the movie.  Chevy's voice-over hints at a darker
vision, probably inherited from the novel, but Carpenter lets it slide
every time.  Goldman's (et al.)  dialog is consistently intelligent, but
the ending is abrupt and screams sequelitis.

     I might be moved to recommend MEMOIRS OF AN INVISIBLE MAN to you at
matinee prices, but really it all so pointless, isn't it?

--
Frank Richard Aloysius Jude Maloney
.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package com.linecorp.armeria.client;

import static com.linecorp.armeria.common.SessionProtocol.H1;
import static com.linecorp.armeria.common.SessionProtocol.H1C;
import static com.linecorp.armeria.common.SessionProtocol.H2;
import static com.linecorp.armeria.common.SessionProtocol.H2C;
import static com.linecorp.armeria.common.SessionProtocol.HTTP;
import static com.linecorp.armeria.common.SessionProtocol.HTTPS;
import static java.util.Objects.requireNonNull;

import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.EnumSet;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

import com.linecorp.armeria.client.ClientCodec.EncodeResult;
import com.linecorp.armeria.client.HttpSessionHandler.Invocation;
import com.linecorp.armeria.client.pool.KeyedChannelPool;
import com.linecorp.armeria.client.pool.KeyedChannelPoolHandler;
import com.linecorp.armeria.client.pool.KeyedChannelPoolHandlerAdapter;
import com.linecorp.armeria.client.pool.PoolKey;
import com.linecorp.armeria.client.pool.DefaultKeyedChannelPool;
import com.linecorp.armeria.common.Scheme;
import com.linecorp.armeria.common.ServiceInvocationContext;
import com.linecorp.armeria.common.SessionProtocol;

import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelPromise;
import io.netty.channel.EventLoop;
import io.netty.channel.EventLoopGroup;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.util.ReferenceCountUtil;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.FutureListener;
import io.netty.util.concurrent.Promise;
import io.netty.util.internal.OneTimeTask;
import io.netty.util.internal.PlatformDependent;

final class HttpRemoteInvoker implements RemoteInvoker {

    private static final KeyedChannelPoolHandlerAdapter<PoolKey> NOOP_POOL_HANDLER =
            new KeyedChannelPoolHandlerAdapter<>();

    static final Set<SessionProtocol> HTTP_PROTOCOLS = EnumSet.of(H1, H1C, H2, H2C, HTTPS, HTTP);

    final ConcurrentMap<EventLoop, KeyedChannelPool<PoolKey>> map = PlatformDependent.newConcurrentHashMap();

    private final EventLoopGroup eventLoopGroup;
    private final Bootstrap baseBootstrap;
    private final RemoteInvokerOptions options;

    HttpRemoteInvoker(EventLoopGroup eventLoopGroup, Bootstrap baseBootstrap, RemoteInvokerOptions options) {
        this.eventLoopGroup = requireNonNull(eventLoopGroup, "eventLoopGroup");
        this.baseBootstrap = requireNonNull(baseBootstrap, "baseBootstrap");
        this.options = requireNonNull(options, "options");

        assert baseBootstrap.group() == null;
    }

    private KeyedChannelPool<PoolKey> pool(EventLoop eventLoop) {
        KeyedChannelPool<PoolKey> pool = map.get(eventLoop);
        if (pool != null) {
            return pool;
        }

        return map.computeIfAbsent(eventLoop, e -> {
            final Bootstrap bootstrap = baseBootstrap.clone();
            bootstrap.group(eventLoop);

            Function<PoolKey, Future<Channel>> factory = new HttpSessionChannelFactory(bootstrap, options);

            final KeyedChannelPoolHandler<PoolKey> handler =
                    options.poolHandlerDecorator().apply(NOOP_POOL_HANDLER);

            eventLoop.terminationFuture().addListener((FutureListener<Object>) f -> map.remove(eventLoop));

            //TODO(inch772) handle options.maxConcurrency();
            return new DefaultKeyedChannelPool<>(eventLoop, factory,
                                                 HttpSessionChannelFactory.HEALTH_CHECKER, handler, true);
        });
    }

    static PoolKey poolKey(InetSocketAddress remoteAddress, SessionProtocol sessionProtocol) {
        return new PoolKey(remoteAddress, sessionProtocol);
    }

    @Override
    public <T> Future<T> invoke(URI uri, ClientOptions options, ClientCodec codec, Method method,
                                Object[] args) throws Exception {
        requireNonNull(uri, "uri");
        requireNonNull(options, "options");
        requireNonNull(codec, "codec");
        requireNonNull(method, "method");

        final EventLoop eventLoop = eventLoop();
        final Scheme scheme = Scheme.parse(uri.getScheme());
        final SessionProtocol sessionProtocol = validateSessionProtocol(scheme.sessionProtocol());
        final InetSocketAddress remoteAddress = convertToSocketAddress(uri, sessionProtocol.isTls());

        PoolKey poolKey = poolKey(remoteAddress, sessionProtocol);
        final Future<Channel> channelFuture = pool(eventLoop).acquire(poolKey);

        final Promise<T> resultPromise = eventLoop.newPromise();

        codec.prepareRequest(method, args, resultPromise);
        if (channelFuture.isSuccess()) {
            Channel ch = channelFuture.getNow();
            invoke0(sessionProtocol, codec, ch, method, args, options, resultPromise, poolKey);
        } else {
            channelFuture.addListener((Future<Channel> future) -> {
                if (future.isSuccess()) {
                    Channel ch = future.getNow();
                    invoke0(sessionProtocol, codec, ch, method, args, options, resultPromise, poolKey);
                } else {
                    resultPromise.setFailure(channelFuture.cause());
                }
            });
        }

        return resultPromise;
    }

    private EventLoop eventLoop() {
        final ServiceInvocationContext currentServerContext = ServiceInvocationContext.current().orElse(null);
        if (currentServerContext != null) {
            // Use the current server-side event loop if possible.
            return currentServerContext.eventLoop();
        } else {
            return eventLoopGroup.next();
        }
    }

    static <T> void invoke0(SessionProtocol sessionProtocol, ClientCodec codec, Channel channel,
                            Method method, Object[] args, ClientOptions options,
                            Promise<T> resultPromise, PoolKey poolKey) {

        EncodeResult encodeResult = codec.encodeRequest(channel, method, args);
        if (encodeResult.isSuccess()) {
            ServiceInvocationContext ctx = encodeResult.invocationContext();
            Promise<FullHttpResponse> responsePromise = channel.eventLoop().newPromise();

            final Invocation invocation = new Invocation(ctx, options, responsePromise, encodeResult.content());
            //write request
            final ChannelFuture writeFuture = writeRequest(channel, invocation, ctx, options);
            writeFuture.addListener(fut -> {
                if (!fut.isSuccess()) {
                    responsePromise.tryFailure(fut.cause());
                } else {
                    long responseTimeoutMillis = options.responseTimeoutPolicy().timeout(ctx);
                    scheduleTimeout(channel, responsePromise, responseTimeoutMillis);
                }
            });

            //handle response
            if (responsePromise.isSuccess()) {
                decodeResult(codec, resultPromise, ctx, responsePromise.getNow());
            } else {
                responsePromise.addListener((Future<FullHttpResponse> future) -> {
                    if (future.isSuccess()) {
                        decodeResult(codec, resultPromise, ctx, responsePromise.getNow());
                    } else {
                        resultPromise.tryFailure(future.cause());
                    }
                });
            }
        } else {
            resultPromise.setFailure(encodeResult.cause());
        }

        //release channel
        final KeyedChannelPool<PoolKey> pool = KeyedChannelPool.findPool(channel);
        if (sessionProtocol.isMultiplex()) {
            pool.release(poolKey, channel);
        } else {
            resultPromise.addListener(fut -> pool.release(poolKey, channel));
        }
    }

    private static <T> void decodeResult(ClientCodec codec, Promise<T> resultPromise,
                                         ServiceInvocationContext ctx, FullHttpResponse response) {
        try {
            resultPromise.setSuccess(codec.decodeResponse(ctx, response.content(), response));
        } catch (Throwable e) {
            resultPromise.tryFailure(e);
        } finally {
            ReferenceCountUtil.release(response);
        }
    }

    private static ChannelFuture writeRequest(Channel channel, Invocation invocation,
                                              ServiceInvocationContext ctx, ClientOptions options) {
        final long writeTimeoutMillis = options.writeTimeoutPolicy().timeout(ctx);
        final ChannelPromise writePromise = channel.newPromise();
        channel.writeAndFlush(invocation, writePromise);
        scheduleTimeout(channel, writePromise, writeTimeoutMillis);
        return writePromise;
    }

    private static <T> void scheduleTimeout(Channel channel, Promise<T> promise, long timeoutMillis) {
        final ScheduledFuture<?> timeoutFuture;
        if (timeoutMillis > 0) {
            timeoutFuture = channel.eventLoop().schedule(
                    new TimeoutTask(promise, timeoutMillis),
                    timeoutMillis, TimeUnit.MILLISECONDS);
        } else {
            timeoutFuture = null;
        }

        promise.addListener(future -> {
            if (timeoutFuture != null) {
                timeoutFuture.cancel(false);
            }
        });
    }

    private static class TimeoutTask extends OneTimeTask {

        private final Promise<?> promise;
        private final long timeoutMillis;

        private TimeoutTask(Promise<?> promise, long timeoutMillis) {
            this.promise = promise;
            this.timeoutMillis = timeoutMillis;
        }

        @Override
        public void run() {
            promise.tryFailure(new WriteTimeoutException(
                    "write timed out within " + timeoutMillis + "ms"));
        }
    }

    private static InetSocketAddress convertToSocketAddress(URI uri, boolean useTls) {
        int port = uri.getPort();
        if (port < 0) {
            port = useTls ? 443 : 80;
        }
        return InetSocketAddress.createUnresolved(uri.getHost(), port);
    }

    private static SessionProtocol validateSessionProtocol(SessionProtocol sessionProtocol) {
        requireNonNull(sessionProtocol);
        if (!HTTP_PROTOCOLS.contains(sessionProtocol)) {
            throw new IllegalArgumentException(
                    "unsupported session protocol: " + sessionProtocol);
        }
        return sessionProtocol;
    }

    @Override
    public void close() {
        for (KeyedChannelPool<PoolKey> p : map.values()) {
            p.close();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>com.frequentis.cis.adapter</groupId>
  <artifactId>CISCconnector</artifactId>
  <version>1.0</version>
  <versioning>
    <versions>
      <version>1.0</version>
    </versions>
    <lastUpdated>20150629100615</lastUpdated>
  </versioning>
</metadata>


text:
using System.Web;
using MeetMe.Web.Auth;
using MeetMe.Web.Auth.Contracts;
using Microsoft.AspNet.Identity.Owin;
using Ninject.Modules;
using Ninject.Web.Common;

namespace MeetMe.Web.App_Start.NinjectModules
{
    public class AuthModule : NinjectModule
    {
        public override void Load()
        {
            this.Bind<ISignInManager>().ToMethod(_ => HttpContext.Current.GetOwinContext().Get<ApplicationSignInManager>()).InRequestScope();
            this.Bind<IUserManager>().ToMethod(_ => HttpContext.Current.GetOwinContext().GetUserManager<ApplicationUserManager>()).InRequestScope();
        }
    }
}


text:
namespace supersonic {

// Contains basic page information.
struct PageHeader {
  uint64_t total_size;
  uint32_t byte_buffers_count;
};

// Contains basic byte buffer information.
// TODO(wzoltak): We may want to add something here in future (like compression
//                method), but it will kill compatibility with previous
//                versions. Consider usage of protobuf.
struct ByteBufferHeader {
  uint64_t length;
};

// Size of serialized PageHeader object in bytes.
const int kSerializedPageHeaderSize = 12;

// Size of serialized ByteBufferHeader object in bytes.
const int kSerializedByteBufferHeaderSize = 8;

// Size of serialized Page::Offset value in bytes.
const int kSerializedOffsetSize = 8;

// In-memory, raw data chunk in storage layer. Contains a set of byte buffers.
// Exposes APIs that allow reading.
class Page {
 public:
  typedef uint64_t offset_t;

  virtual ~Page() {}

  // Returns a page header.
  virtual const struct PageHeader& PageHeader() const = 0;

  // Returns a header for given byte buffer.
  virtual FailureOr<const struct ByteBufferHeader*>
      ByteBufferHeader(int byte_buffer_index) const = 0;

  // Returns a pointer to place in which data of given byte buffer is stored.
  virtual FailureOr<const void*> ByteBuffer(int byte_buffer_index) const = 0;

  // Returns a pointer to raw in-memory page representation.
  virtual const void* RawData() const = 0;

  // Returns true when page is empty (has 0 byte buffers).
  virtual bool IsEmpty() const = 0;
};

// Creates Page object from buffer containing raw data. Takes ownership over
// the buffer.
FailureOrOwned<Page> CreatePage(std::unique_ptr<const Buffer> buffer);

// Creates Page object as a temporary view on buffer containing raw data. Does
// not take ownership over the buffer.
FailureOrOwned<Page> CreatePageView(const Buffer& buffer);

}  // namespace supersonic

#endif  // SUPERSONIC_CONTRIB_STORAGE_BASE_PAGE_H_


text:
#include <string.h>
#include <pal.h>

static void swap(PTYPE *lhs, PTYPE *rhs)
{
    PTYPE tmp = *lhs;
    *lhs = *rhs;
    *rhs = tmp;
}

static unsigned int median_partition(PTYPE *a,
                                     unsigned int left,
                                     unsigned int right,
                                     unsigned int pivot_index)
{
    unsigned int store_index = left;
    unsigned int i = left;

    PTYPE pivot = a[pivot_index];
    swap(&a[pivot_index], &a[right]);

    for (; i < right; ++i) {
        if (a[i] < pivot)
            swap(&a[i], &a[store_index++]);
    }

    swap(&a[store_index], &a[right]);

    return store_index;
}

/**
 *
 * Calculates the median value of input vector 'a'.
 *
 * @param a     Pointer to input vector
 *
 * @param c     Pointer to output scalar
 *
 * @param n     Size of 'a' vector.
 *
 * @return      None
 *
 */

void PSYM(p_median)(const PTYPE *a, PTYPE *c, int n)
{
    unsigned int left = 0;
    unsigned int median_index = (n - 1) >> 1;
    PTYPE median_value = PCONST(0.0);
    PTYPE search_a[n];

    memcpy(search_a, a, sizeof(PTYPE) * n);

    for (; median_index <= (n >> 1); ++median_index) {
        unsigned int right = n - 1;
        unsigned int pivot_index = 0;

        do {
            pivot_index =
                median_partition(search_a, left, right, (left + right) >> 1);

            if (pivot_index > median_index) {
                right = pivot_index - 1;
            } else {
                left = pivot_index + 1;
            }
        } while (pivot_index != median_index);

        median_value += search_a[pivot_index];
    }

    *c = (n % 2 ? median_value : median_value * 0.5);
}


text:
from collections import defaultdict

from django.db import models
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType

from actstream.gfk import GFKManager
from actstream.decorators import stream

class ActionManager(GFKManager):
    """
    Default manager for Actions, accessed through Action.objects
    """

    def public(self, *args, **kwargs):
        """
        Only return public actions
        """
        kwargs['public'] = True
        return self.filter(*args, **kwargs)

    @stream
    def actor(self, object, **kwargs):
        """
        Stream of most recent actions where object is the actor.
        Keyword arguments will be passed to Action.objects.filter
        """
        return object.actor_actions.public(**kwargs)

    @stream
    def target(self, object, **kwargs):
        """
        Stream of most recent actions where object is the target.
        Keyword arguments will be passed to Action.objects.filter
        """
        return object.target_actions.public(**kwargs)

    @stream
    def action_object(self, object, **kwargs):
        """
        Stream of most recent actions where object is the action_object.
        Keyword arguments will be passed to Action.objects.filter
        """
        return object.action_object_actions.public(**kwargs)

    @stream
    def model_actions(self, model, **kwargs):
        """
        Stream of most recent actions by any particular model
        """
        ctype = ContentType.objects.get_for_model(model)
        return self.public(
            (Q(target_content_type=ctype) |
            Q(action_object_content_type=ctype) |
            Q(actor_content_type=ctype)),
            **kwargs
        )

    @stream
    def user(self, object, **kwargs):
        """
        Stream of most recent actions by actors that the passed User object is
        following.
        """
        from actstream.models import Follow
        q = Q()
        qs = self.filter(public=True)
        actors_by_content_type = defaultdict(lambda: [])

        follow_gfks = Follow.objects.filter(user=object).values_list(
            'content_type_id', 'object_id')

        if not follow_gfks:
            return qs.none()

        for content_type_id, object_id in follow_gfks.iterator():
            actors_by_content_type[content_type_id].append(object_id)

        for content_type_id, object_ids in actors_by_content_type.iteritems():
            q = q | Q(
                actor_content_type=content_type_id,
                actor_object_id__in=object_ids,
            )
        qs = qs.filter(q, **kwargs)
        return qs

class FollowManager(models.Manager):
    """
    Manager for Follow model.
    """

    def for_object(self, instance):
        """
        Filter to a specific instance.
        """
        content_type = ContentType.objects.get_for_model(instance).pk
        return self.filter(content_type=content_type, object_id=instance.pk)

    def is_following(self, user, instance):
        """
        Check if a user is following an instance.
        """
        if not user:
            return False
        queryset = self.for_object(instance)
        return queryset.filter(user=user).exists()


text:
package console;

import java.awt.event.MouseEvent;

/** an interface to accept a clicked on word and a mouse event... it's up to the implementor to decide
    what should happen with this magical information */
public interface ConsolePopup {
	public void showPopup(String word, MouseEvent ev);
}


text:
This application can be containerized using following command:

```
./build_docker.sh
```

If above command finishes successfully, following command would show a new image with the latest version of data
validation application.

```buildoutcfg
docker images
```

Once your confirm that image of the data validation is available. You can run following command to run data validation
tool as a docker container.

```buildoutcfg
 docker run -v ~/.config/:/root/.config --rm data_validation:1.1.2 -h
```
**Please note:** ~/.config/:/root/.config in above command mounts your VM's local .config directory with container's
.config directory. This allows users to store GCP service account as well as connection information needed by data
validation tool on a VM.


text:
/*Problem 4. Write a program that reads two positive integer numbers and prints how many numbers p exist between them such that the reminder of the division by 5 is 0 (inclusive). Example: p(17,25) = 2.
 */
using System;
using MyIO;

class NumbersInInterval
{
    static void Main()
    {
        int value1,value2,calc=0;
        MyIOClass.Input(out value1, "Please enter the first number: ");
        MyIOClass.Input(out value2, "Please enter the second number: ");
        calc = (Math.Max(value2, value1) / 5) - ((Math.Min(value2, value1)-1) / 5);
        Console.WriteLine("{0} numbers in the interval between {1} and {2} can be devided by 5 with remainder 0", calc, Math.Min(value1, value2), Math.Max(value1, value2));
    }
}


text:
package org.apache.ignite.internal.processors.query.h2.database.io;

import java.util.List;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.internal.pagemem.PageUtils;
import org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree;
import org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO;
import org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusLeafIO;
import org.apache.ignite.internal.processors.cache.persistence.tree.io.IOVersions;
import org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO;
import org.apache.ignite.internal.processors.query.h2.database.H2Tree;
import org.apache.ignite.internal.processors.query.h2.database.InlineIndexHelper;
import org.apache.ignite.internal.processors.query.h2.opt.GridH2Row;
import org.h2.result.SearchRow;

/**
 * Leaf page for H2 row references.
 */
public class H2ExtrasLeafIO extends BPlusLeafIO<SearchRow> implements H2RowLinkIO {
    /** Payload size. */
    private final int payloadSize;

    /** */
    public static void register() {
        for (short payload = 1; payload <= PageIO.MAX_PAYLOAD_SIZE; payload++)
            PageIO.registerH2ExtraLeaf(getVersions((short)(PageIO.T_H2_EX_REF_LEAF_START + payload - 1), payload));
    }

    /**
     * @param payload Payload size.
     * @return IOVersions for given payload.
     */
    @SuppressWarnings("unchecked")
    public static IOVersions<? extends BPlusLeafIO<SearchRow>> getVersions(int payload) {
        assert payload >= 0 && payload <= PageIO.MAX_PAYLOAD_SIZE;

        if (payload == 0)
            return H2LeafIO.VERSIONS;
        else
            return (IOVersions<BPlusLeafIO<SearchRow>>)PageIO.getLeafVersions((short)(payload - 1));
    }

    /**
     * @param type Type.
     * @param payload Payload size.
     * @return Versions.
     */
    private static IOVersions<H2ExtrasLeafIO> getVersions(short type, short payload) {
        return new IOVersions<>(new H2ExtrasLeafIO(type, 1, payload));
    }

    /**
     * @param type Page type.
     * @param ver Page format version.
     * @param payloadSize Payload size.
     */
    private H2ExtrasLeafIO(short type, int ver, int payloadSize) {
        super(type, ver, 8 + payloadSize);
        this.payloadSize = payloadSize;
    }

    /** {@inheritDoc} */
    @SuppressWarnings("ForLoopReplaceableByForEach")
    @Override public void storeByOffset(long pageAddr, int off, SearchRow row) {
        GridH2Row row0 = (GridH2Row)row;

        assert row0.link() != 0;

        List<InlineIndexHelper> inlineIdxs = InlineIndexHelper.getCurrentInlineIndexes();

        assert inlineIdxs != null : "no inline index helpers";

        int fieldOff = 0;

        for (int i = 0; i < inlineIdxs.size(); i++) {
            InlineIndexHelper idx = inlineIdxs.get(i);

            int size = idx.put(pageAddr, off + fieldOff, row.getValue(idx.columnIndex()), payloadSize - fieldOff);

            if (size == 0)
                break;

            fieldOff += size;
        }

        PageUtils.putLong(pageAddr, off + payloadSize, row0.link());
    }

    /** {@inheritDoc} */
    @Override public void store(long dstPageAddr, int dstIdx, BPlusIO<SearchRow> srcIo, long srcPageAddr, int srcIdx) {
        int srcOff = srcIo.offset(srcIdx);

        byte[] payload = PageUtils.getBytes(srcPageAddr, srcOff, payloadSize);
        long link = PageUtils.getLong(srcPageAddr, srcOff + payloadSize);

        assert link != 0;

        int dstOff = offset(dstIdx);

        PageUtils.putBytes(dstPageAddr, dstOff, payload);
        PageUtils.putLong(dstPageAddr, dstOff + payloadSize, link);
    }

    /** {@inheritDoc} */
    @Override public SearchRow getLookupRow(BPlusTree<SearchRow, ?> tree, long pageAddr, int idx)
        throws IgniteCheckedException {
        long link = getLink(pageAddr, idx);

        return ((H2Tree)tree).createRowFromLink(link);
    }

    /** {@inheritDoc} */
    @Override public long getLink(long pageAddr, int idx) {
        return PageUtils.getLong(pageAddr, offset(idx) + payloadSize);
    }
}


text:
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Metaseed.MetaStudioTest.Data;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Linq;
namespace Metaseed.MetaStudioTest
{
    [TestClass]
    public class ValidatableModelTest
    {
        [TestMethod]
        public async Task TestValidatableModel()
        {
            var test = new UserInput() { UserName = string.Empty, Email = "44555", RepeatEmail = "sda" };
            await test.ValidateAsync();

            {
                var errors = test.GetErrors("UserName");
                Assert.IsNotNull(errors);
                var e = errors.Cast<object>().ToList()[0];
                Debug.WriteLine(e);
                Assert.IsNotNull(e);
            }

            {
                var errors = test.GetErrors("Email");
                Assert.IsNotNull(errors);
                var e = errors.Cast<object>().ToList()[0];
                Debug.WriteLine(e);
                Assert.IsNotNull(e);
            }

            {
                var errors = test.GetErrors("RepeatEmail");
                Assert.IsNotNull(errors);
                var e = errors.Cast<object>().ToList()[0];
                Debug.WriteLine(e);
                Assert.IsNotNull(e);
            }

        }
    }
}


text:
package com.netflix.priam.backup;

import com.netflix.priam.scheduler.BlockingSubmitThreadPoolExecutor;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestCustomizedTPE {
    private static final Logger logger = LoggerFactory.getLogger(TestCustomizedTPE.class);
    private static final int MAX_THREADS = 10;
    // timeout 1 sec
    private static final int TIME_OUT = 10 * 1000;
    private final BlockingSubmitThreadPoolExecutor startTest =
            new BlockingSubmitThreadPoolExecutor(
                    MAX_THREADS, new LinkedBlockingDeque<>(MAX_THREADS), TIME_OUT);

    @Test
    public void testExecutor() throws InterruptedException {
        final AtomicInteger count = new AtomicInteger();
        for (int i = 0; i < 100; i++) {
            startTest.submit(
                    (Callable<Void>)
                            () -> {
                                Thread.sleep(100);
                                logger.info("Count:{}", count.incrementAndGet());
                                return null;
                            });
        }
        startTest.sleepTillEmpty();
        Assert.assertEquals(100, count.get());
    }

    @Test
    public void testException() {
        boolean success = false;
        try {
            for (int i = 0; i < 100; i++) {
                startTest.submit(
                        (Callable<Void>)
                                () -> {
                                    logger.info("Sleeping for 2 * timeout.");
                                    Thread.sleep(TIME_OUT * 2);
                                    return null;
                                });
            }
        } catch (RuntimeException ex) {
            success = true;
        }
        Assert.assertTrue("Failure to timeout...", success);
    }
}


text:
const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');

var userSchema = mongoose.Schema({
  email: String,
  password: String,
  facebook: {
    id: String,
    token: String
  }
});

userSchema.methods.generateHash = function(password) {
  return bcrypt.hashSync(password, bcrypt.genSaltSync(8), null);
};

userSchema.methods.validPassword = function(password) {
  return bcrypt.compareSync(password, this.password);
};

module.exports = mongoose.model('User', userSchema);


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true">
        <ripple android:color="?android:attr/colorControlHighlight">
            <item>
                <shape android:shape="oval">
                    <solid android:color="?attr/iconColorNormal"/>
                </shape>
            </item>
        </ripple>
    </item>
    <item android:state_selected="true">
        <ripple android:color="?android:attr/colorControlHighlight">
            <item>
                <shape android:shape="oval">
                    <solid android:color="?attr/iconColorNormal"/>
                </shape>
            </item>
        </ripple>
    </item>
    <item>
        <shape android:shape="oval">
            <solid android:color="@android:color/transparent"/>
        </shape>
    </item>
</selector>


text:
<!DOCTYPE html>

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

    <meta name="description" content="SearbBar Project for ITSI">
    <meta name="author" content="Ryno Myburgh">

    <title>SearbBar Project</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

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

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

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              Toggle navigation

            </button>
            SearchBar

                Go to Projects

                    <input id="searchText" placeholder="Search..." type="text" class="form-control" autofocus/>


text:
local drystal = require 'drystal'

local Animation = require 'danimate.Animation'
local SpritePart = require 'danimate.SpritePart'

local Sprite = {
	x=0,
	y=0,
	w=0,
	h=0,
	dir=1,
}
Sprite.__index = Sprite

function Sprite.new(x, y, w, h)
	local s = setmetatable({}, Sprite)
	s.x = x
	s.y = y
	s.w = w
	s.h = h
	s.parts = {}
	s.animations = {}
	s.indexes = {}
	return s
end

function Sprite:add_part(name, part, swapwith)
	part.name = name
	part.swapwith = swapwith
	self.parts[#self.parts + 1] = part
	self.parts[name] = part
	return self
end

function Sprite:add_parts(parts)
	for _, part in ipairs(parts) do
		self:add_part(part.name, SpritePart.new(part.sprite), part.swapwith)
	end
end

function Sprite:add_animation(animation)
	table.insert(self.animations, animation)
	self.indexes[animation.name] = #self.animations
	return self
end

function Sprite:add_animations(animations)
	for _, anim in ipairs(animations) do
		local a = Animation.new_from_table(anim)
		self:add_animation(a)
	end
end

function Sprite:set_animation(name, after)
	local index = self.indexes[name]

	if self.animation then
		self.animation:stop()
	else
		for _, p in ipairs(self.parts) do
			local key = self.animations[index][1].key[p.name]
			p.angle = key.angle
			p.x = key.x
			p.y = key.y
		end
	end

	self.animation = self.animations[index]
	self.animation:prepare(self.parts)

	self.animation.before_keyframe = function(key)
		local keyframe = key.key
		for _, p in ipairs(self.parts) do
			local angle_dest = keyframe[p.name].angle
			while p.angle < angle_dest - math.pi do
				p.angle = p.angle + math.pi * 2
			end
			while p.angle > angle_dest + math.pi do
				p.angle = p.angle - math.pi * 2
			end
		end
	end
	self.animation.after = function()
		if after then
			self:set_animation(after)
		end
	end

	self:start_animation()
end

function Sprite:stop_animation()
	self.animation:stop()
end
function Sprite:start_animation()
	self.animation:start()
end

function Sprite:update(dt)
	if self.animation then
		self.animation:update(dt)
	end
end

function Sprite:set_dir(dir)
	if self.dir ~= dir then
		self.dir = dir
		for _, p in ipairs(self.parts) do
			if p.swapwith and self.parts[p.swapwith] then
				p.futuresprite = self.parts[p.swapwith].sprite
			else
				p.futuresprite = p.sprite
			end
		end
		for _, p in ipairs(self.parts) do
			p.sprite = p.futuresprite
			p.futuresprite = nil
		end
	end
end

function Sprite:draw()
	for _, p in ipairs(self.parts) do
		if self.dir > 0 then
			p:draw(self.x, self.y)
		elseif self.dir < 0 then
			p:draw_flipped(self.x, self.y, self.w)
		end
	end
end

function Sprite:draw2()
	if not self.animation then
		return
	end

	local dx, dy = self.x, self.y
	for _, p in ipairs(self.parts) do
		local p1 = {x=p.x, y=p.y}
		local p2 = {
			x=p.x + math.cos(p.angle) * p.dist,
			y=p.y + math.sin(p.angle) * p.dist,
		}
		local k = self.animation.keyframe.key[p.name] or {x=0,y=0,angle=0}
		local p1b = {x=k.x, y=k.y}
		local p2b = {
			x=k.x + math.cos(k.angle) * p.dist,
			y=k.y + math.sin(k.angle) * p.dist,
		}
		local function isinside(point)
			return point_hovered(dx + point.x, dy + point.y, p.radius * 1.5)
		end
		local inside = isinside(p1) or isinside(p2) or isinside(p1b) or isinside(p2b)
		if inside then
			local function printpoint(pp, factor)
				--local mode = point_hovered(self.x + pp.x, self.y + pp.y, p.radius) and 'fill' or 'line'
				--love.graphics.circle(mode, pp.x, pp.y, p.radius * factor)
				if point_hovered(self.x + pp.x, self.y + pp.y, p.radius) then
					drystal.draw_circle(dx + pp.x, dy + pp.y, p.radius * factor)
				end
				drystal.draw_circle(dx + pp.x, dy + pp.y, p.radius * factor)
			end
			drystal.set_color '#3F3'
			drystal.set_color(50, 255, 50)
			printpoint(p1b, 1)
			printpoint(p2b, 1)

			drystal.set_color '#050'
			printpoint(p1, 0.5)
			printpoint(p2, 0.5)
		end
	end
	local mx, my = mousepos()
	if mx >= self.x and mx <= self.x + self.w
	and my >= self.y and my <= self.y + self.h then
		drystal.set_color '#777'
		drystal.draw_square(dx, dy, self.w, self.h)
	end
end

return Sprite


text:
Preview Transform

Transform To Preview: {{currentPolicy.id}}

Enter the URL of the image to apply the transform to

                <input id="previewUrlInpt" type="text" ng-model="previewUrl" class="form-control">
                <button id="previewPolicyBtn" class="btn-success btn pull-right" style="margin-top: 10px" ng-click="previewFullPolicy(previewUrl, currentPolicy.transformations)">Preview</button>

This image format cannot be loaded in this browser. Try another browser or update this policy if you would like the image to render.

                    Download Image

Unfortunately IE does not allow downloading of data URI's

                <button id="closePreviewBtn" type="button" class="btn btn-default" data-dismiss="modal">Close</button>


text:
<?php defined('BASEPATH') or exit('No direct script access allowed');

class Module_Calendar extends Module {

	public $version = '1.0';

	public function info() {
		return array(
			'name' => array(
				'en' => 'Calendar',
			),
			'description' => array(
				'en' => 'Calendar',
			),
			'frontend' => NULL,
			'backend'  => TRUE,
			'menu'	  => NULL,
			'roles'     => array('create', 'view', 'edit', 'change_status'),
		);
	}
}


text:
package com.bluecatcode.fuzzer.sender;

/**
 * Send payload to server.
 */
public interface PayloadSender {
    void send(byte[] payload);
}


text:
<?php

namespace Vinelab\NeoEloquent\Eloquent\Edges;

class EdgeOut extends Edge
{
    protected $direction = 'out';
}


text:
#btnFinish, #btnNotFinish{
    margin-top: 10%;
    color: royalblue;
    font-weight: bold;
    cursor: pointer;
}

#btnFinish:hover #btnNotFinish:hover {
    background: -webkit-radial-gradient(center, ellipse cover, #f7fbfc 10%, dodgerblue 100%);
    background: -moz-radial-gradient(center, ellipse cover, #f7fbfc 10%, dodgerblue 100%);
    background: -o-radial-gradient(center, ellipse cover, #f7fbfc 10%, dodgerblue 100%);
    background: -ms-radial-gradient(center, ellipse cover, #f7fbfc 10%, dodgerblue 100%);
    color: slategray;
}

.center{
    border: 2px solid #00008b;
    border-radius: 3px;
    text-align: center;
    padding: 10px;
}

.question{
    /*text-align: left;*/
    font-size: 15px;
}

textarea{
    width: 50%;
}

input, label {
    display:inline-block;
}
label {
    width: 250px;
    text-align: left;
    padding-left: 10px;
}


text:
import requests
from requests_oauthlib import OAuth1

class Client:
    def __init__(self, consumer_key, consumer_secret, access_key, access_secret):
        self.auth = OAuth1(
            client_key=consumer_key, client_secret=consumer_secret,
            resource_owner_key=access_key, resource_owner_secret=access_secret
        )

    def get_accounts(self):
        url = 'https://ads-api.twitter.com/0/accounts'
        response = requests.get(url, auth=self.auth)
        try:
            return response.json()['data']
        except KeyError:
            return response.json()['errors']


text:
.. _int: https://docs.python.org/2/library/stdtypes.html

.. _str: https://docs.python.org/2/library/stdtypes.html

.. _vim.host.ScsiDisk: ../../vim/host/ScsiDisk.rst

.. _vim.vm.DiskDeviceInfo: ../../vim/vm/DiskDeviceInfo.rst

vim.vm.ScsiDiskDeviceInfo
=========================
  The ScsiDiskDeviceInfo class contains detailed information about a specific scsi disk hardware device. These devices are for the vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo.
:extends: vim.vm.DiskDeviceInfo_

Attributes:
    disk (`vim.host.ScsiDisk`_, optional):

       Detailed information about the disk.
    transportHint (`str`_, optional):

       Transport identifier hint used to identify the device. To definitively correlate this device with a host physical disk, use the disk property. This identifier is intended as a hint to end users to identify the disk device.
    lunNumber (`int`_, optional):

       LUN number hint used to identify the SCSI device. To definitively correlate this device with a host physical disk, use the disk property. This identifier is intended as a hint to end users to identify the disk device.


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.geminnu.hexagon"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="18" />
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <service
            android:name=".WirelessManagerService"
            android:exported="false"/>
        <service
            android:name=".BioSensorManagerService"
            android:exported="false"/>
        <service
            android:name=".ArduinoService"
            android:exported="false"/>
        <service
            android:name=".ArduinoStatusManager"
            android:exported="false"/>

        <receiver android:name="com.geminnu.hexagon.MyReceiver" >
    		<intent-filter>
        		<action android:name="com.geminnu.hexagon.SEND_DATA" />
    		</intent-filter>
		</receiver>
    </application>

</manifest>


text:
package render

import (
	"fmt"
	"github.com/huangjunwen/JustSQL/context"
	"github.com/huangjunwen/JustSQL/utils"
	ts "github.com/pingcap/tidb/util/types"
	"reflect"
	"strings"
	"text/template"
)

// --- Interfaces ---

// Indexer represents a random accessable array.
type Indexer interface {
	Len() int
	// Panic if out of range
	Index(i int) interface{}
}

// Appendable represents a mutable list of items.
type Appendable interface {
	Append(items ...interface{}) error
}

// StringsContainer represents a list of strings.
type StringsContainer interface {
	Strings() []string
}

// --- General helpers ---

// Return false only when v is nil.
func notNil(v interface{}) (res bool) {
	defer func() {
		var err error
		if utils.RecoverErr(&err) {
			res = false
		}
	}()
	res = !reflect.ValueOf(v).IsNil()
	return
}

// Return the function of the name.
func buildFn(fnMap template.FuncMap) func(string) interface{} {
	return func(fnName string) interface{} {
		if fn, ok := fnMap[fnName]; ok {
			return fn
		}
		return nil
	}
}

func first(val interface{}) (ret interface{}, err error) {
	defer func() {
		if utils.RecoverErr(&err) {
			ret = ""
		}
	}()
	switch v := val.(type) {
	case Indexer:
		ret = v.Index(0)
	default:
		ret = reflect.ValueOf(val).Index(0).Interface()
	}
	return
}

func last(val interface{}) (ret interface{}, err error) {
	defer func() {
		if utils.RecoverErr(&err) {
			ret = ""
		}
	}()
	switch v := val.(type) {
	case Indexer:
		ret = v.Index(v.Len() - 1)
	default:
		reflectVal := reflect.ValueOf(val)
		ret = reflectVal.Index(reflectVal.Len() - 1).Interface()
	}
	return
}

func append_(val interface{}, items ...interface{}) (ret string, err error) {
	defer func() {
		utils.RecoverErr(&err)
	}()
	switch v := val.(type) {
	case Appendable:
		err = v.Append(items...)
	default:
		itemValues := make([]reflect.Value, 0, len(items))
		for _, item := range items {
			itemValues = append(itemValues, reflect.ValueOf(item))
		}
		reflect.Append(reflect.ValueOf(val), itemValues...)
	}
	return
}

// --- String helpers ---

// StringList is just a list of strings.
type StringList struct {
	ss []string
}

func NewStringList() *StringList {
	return &StringList{
		ss: []string{},
	}
}

func (sl *StringList) Append(items ...interface{}) error {
	for _, item := range items {
		switch it := item.(type) {
		case string:
			sl.ss = append(sl.ss, it)
		case fmt.Stringer:
			sl.ss = append(sl.ss, it.String())
		default:
			return fmt.Errorf("stringList.Append: expect string but got %T", item)
		}
	}
	return nil
}

func (sl *StringList) Strings() []string {
	return sl.ss
}

func (sl *StringList) Len() int {
	return len(sl.ss)
}

func (sl *StringList) Index(i int) interface{} {
	return sl.ss[i]
}

// UniqueStringList is a list of unique strings.
type UniqueStringList struct {
	ss        []string
	smap      map[string]int
	converter func(string) string
	default_  string
}

func NewUniqueStringList(converter func(string) string, default_ string) *UniqueStringList {
	if converter == nil {
		converter = func(s string) string {
			return s
		}
	}
	return &UniqueStringList{
		ss:        []string{},
		smap:      map[string]int{},
		converter: converter,
		default_:  default_,
	}
}

func (usl *UniqueStringList) Append(items ...interface{}) error {
	for _, item := range items {

		var s string
		switch it := item.(type) {
		case string:
			s = it
		case fmt.Stringer:
			s = it.String()
		default:
			return fmt.Errorf("uniqueStringList.Append: expect string but got %T", item)
		}

		s = usl.converter(s)
		if s == "" {
			s = usl.default_
		}
		r := s
		for i := 1; ; i++ {
			if _, ok := usl.smap[r]; !ok {
				usl.smap[r] = len(usl.ss)
				usl.ss = append(usl.ss, r)
				break
			}
			r = fmt.Sprintf("%s%d", s, i)
		}
	}

	return nil
}

func (usl *UniqueStringList) Strings() []string {
	return usl.ss
}

func (usl *UniqueStringList) Len() int {
	return len(usl.ss)
}

func (usl *UniqueStringList) Index(i int) interface{} {
	return usl.ss[i]
}

func dup(s string, n int) []string {
	r := make([]string, n)
	for i := 0; i < len(r); i++ {
		r[i] = s
	}
	return r
}

func join(val interface{}, sep string) (string, error) {
	switch v := val.(type) {
	case []string:
		return strings.Join(v, sep), nil
	case StringsContainer:
		return strings.Join(v.Strings(), sep), nil
	default:
		return "", fmt.Errorf("join: expect []string or StringsContainer but got %T", v)
	}
}

// --- Source code helpers ---

// Import pkg into the renderred source code.
func buildImp(r *Renderer) func(string) *PkgName {
	return func(pkgPath string) *PkgName {
		return r.Scopes.CreatePkgName(pkgPath)
	}
}

func buildTypeName(r *Renderer) func(interface{}) (*TypeName, error) {
	return func(val interface{}) (*TypeName, error) {
		switch v := val.(type) {
		case *ts.FieldType:
			return r.TypeAdapter.AdaptType(v), nil
		case *context.ColumnMeta:
			return r.TypeAdapter.AdaptType(v.Type), nil
		case *context.ResultFieldMeta:
			return r.TypeAdapter.AdaptType(v.Type), nil
		case string:
			return r.Scopes.CreateTypeNameFromSpec(v), nil
		default:
			return nil, fmt.Errorf("typeName: not support %T as argument", v)
		}
	}
}

func buildCast(r *Renderer) func(string, *TypeName, *TypeName) (string, error) {
	ta := r.TypeAdapter
	return func(srcExpr string, srcTypeName, dstTypeName *TypeName) (string, error) {
		return ta.CastType(srcExpr, srcTypeName, dstTypeName)
	}
}

// --- Database helpers ---

type ColumnList struct {
	cols []*context.ColumnMeta
}

func NewColumnList() *ColumnList {
	return &ColumnList{
		cols: []*context.ColumnMeta{},
	}
}

func (cl *ColumnList) Len() int {
	return len(cl.cols)
}

func (cl *ColumnList) Index(i int) interface{} {
	return cl.cols[i]
}

func (cl *ColumnList) Append(items ...interface{}) error {
	for _, item := range items {
		if col, ok := item.(*context.ColumnMeta); !ok {
			return fmt.Errorf("columnList.Append: expect *context.ColumnMeta but got %T", item)
		} else {
			cl.cols = append(cl.cols, col)
		}
	}
	return nil
}

func (cl *ColumnList) Cols() []*context.ColumnMeta {
	return cl.cols
}

// Return names of columns.
func columnNames(val interface{}) []string {
	var cols []*context.ColumnMeta
	switch v := val.(type) {
	case []*context.ColumnMeta:
		cols = v
	case *ColumnList:
		cols = v.cols
	}
	r := make([]string, 0, len(cols))
	for _, col := range cols {
		r = append(r, col.Name)
	}
	return r
}

func buildDBName(r *Renderer) func() string {
	dbName := r.Context.DBName
	return func() string {
		return dbName
	}
}

func BuildExtraFuncs(r *Renderer) template.FuncMap {

	fnMap := template.FuncMap{
		// General helpers.
		"notNil": notNil,
		"first":  first,
		"last":   last,
		"append": append_,
		// String helpers.
		"pascal":           utils.PascalCase,
		"camel":            utils.CamelCase,
		"stringList":       NewStringList,
		"uniqueStringList": NewUniqueStringList,
		"split":            strings.Split,
		"dup":              dup,
		"join":             join,
		// Source code helpers.
		"imp":      buildImp(r),
		"typeName": buildTypeName(r),
		"cast":     buildCast(r),
		// Database helpers.
		"columnList":  NewColumnList,
		"columnNames": columnNames,
		// Context helpers.
		"dbname": buildDBName(r),
	}

	// Can be used for getting a function as variable.
	fnMap["fn"] = buildFn(fnMap)
	return fnMap

}


text:
Instructions for using the <?php echo Yii::app()->name; ?> Service

    The <?php echo Yii::app()->name; ?> Service is designed to help clean, rotate, and properly align PDF scans. PDF scans that are very poor quality will not OCR properly. This is an automated system using a third-party OCR application called ABBYY. Use of this service is free for Arts & Science students and faculty.

Accessing and Using the <?php echo Yii::app()->name; ?> Service

Click the Login button.

Enter your CU IdentiKey Username.

Enter your CU IdentiKey Password.

You will be taken to the OCR Service page.

You can either drag one or multiple files into the "Drag files here" box area, or click on the Add Files button.

File sizes should not exceed 25MB.

Select the PDF file you would like to upload.

Uploading Multiple Files

    If you're using the latest version of Chrome or Firefox, you can drag a folder from your desktop into the OCR Service.
    The folder, all sub-folders, and files will begin uploading after you click "Start upload".

File Status

    There are several statuses an uploaded PDF can have:

queued

A PDF file is queued to be serviced The time to wait depends on how many PDFs are ahead in the queue.

processing

The PDF file is being processed.

completed

The PDF file is completed and is available for download.

expired

It has been more than 24 hours since the PDF has been processed and has been removed from the system.

failed

The PDF failed to process. Try re-uploading the file or contact our Technical Staff about a failed file.

Frequently Asked Questions

Can other people access the files that I have uploaded?

No. You will be the only person able to access your documents.

Does this service allow me to create PDFs?

No. The <?php echo Yii::app()->name; ?> Service will only do two things. First it will make the PDF(s) text searchable. Next it will clean, rotate and properly align the PDF file(s). No files are created.

What system settings should I have?

Your browser should have JavaScript enabled and have an HTML5 compatible browser. (JavaScript is usually enabled by default)

What about copyright and fair use?

                By using the <?php echo Yii::app()->name; ?> Service, you acknowledge that you have acquired permission from the copyright owner or that the material qualifies for fair use.

For more information about copyright and fair use in relation to course material, visit:
                http://ucblibraries.colorado.edu/reserves/copyright.htm

Are the PDFs I upload stored on the server?

The PDF's are temporarily stored on the server up to 24 hours. After which they expire and will be deleted from the server.

My file was deleted somehow. Is there a backup?

No. We do not keep backups of PDF's. If your file was deleted, you must re-upload the file.

I am not affiliated with the Arts & Sciences college. Can I still use the <?php echo Yii::app()->name; ?> Service?

Yes, you may still use the service but will be limited to only a few PDF scans a day. People affiliated with the Arts & Sciences college have no restrictions.

    For more information about the <?php echo Yii::app()->name; ?> Service, contact our Technical Director, Grant Matheny.


text:
.rfq.widget .cl {
	clear: both;
}

.rfq.widget .dn {
	display: none !important;
}

.rfq.widget .dead * {
	display: none !important;
}

.tag.dropdown.posFixed .dropdown_menu {
	position: fixed !important;
}

/*Calendar Css Start here*/
div.datepicker {
	position: relative;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	width: 196px;
	height: 147px;
	position: absolute;
	cursor: default;
	top: 0;
	left: 0;
	display: none;
}

.datepickerContainer {
	position: absolute;
	top: 10px;
	left: 10px;
}

.datepickerBorderT {
	position: absolute;
	left: 10px;
	top: 0;
	right: 10px;
	height: 10px;
}

.datepickerBorderB {
	position: absolute;
	left: 10px;
	bottom: 0;
	right: 10px;
	height: 10px;
}

.datepickerBorderL {
	position: absolute;
	left: 0;
	bottom: 10px;
	top: 10px;
	width: 10px;
}

.datepickerBorderR {
	position: absolute;
	right: 0;
	bottom: 10px;
	top: 10px;
	width: 10px;
}

.datepickerBorderTL {
	position: absolute;
	top: 0;
	left: 0;
	width: 10px;
	height: 10px;
}

.datepickerBorderTR {
	position: absolute;
	top: 0;
	right: 0;
	width: 10px;
	height: 10px;
}

.datepickerBorderBL {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 10px;
	height: 10px;
}

.datepickerBorderBR {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 10px;
	height: 10px;
}

.datepickerHidden {
	display: none;
}

div.datepicker table {
	border-collapse: collapse;
}

div.datepicker a {
	text-decoration: none;
	cursor: default;
	outline: none;
}

div.datepicker table td {
	text-align: right;
	padding: 0;
	margin: 0;
}

div.datepicker th {
	text-align: right;
	font-weight: normal;
}

div.datepicker tbody th {
	text-align: right;
}

div.datepicker tbody a {
	display: block;
}

.datepickerDays a {
	width: 20px;
	line-height: 16px;
	height: 16px;
	padding-right: 2px;
}

.datepickerYears a,.datepickerMonths a {
	width: 39px;
	line-height: 36px;
	height: 36px;
	text-align: center;
}

div.datepicker tbody th {
	text-align: right;
}

.datepickerSpace div {
	width: 20px;
}

.datepickerGoNext a,.datepickerGoPrev a,.datepickerMonth a {
	text-align: center;
	height: 20px;
	line-height: 20px;
}

.datepickerGoNext a {
	float: right;
	width: 20px;
}

.datepickerGoPrev a {
	float: left;
	width: 20px;
}

table.datepickerViewDays tbody.datepickerMonths,table.datepickerViewDays tbody.datepickerYears
	{
	display: none;
}

table.datepickerViewMonths tbody.datepickerDays,table.datepickerViewMonths tbody.datepickerYears,table.datepickerViewMonths tr.datepickerDoW
	{
	display: none;
}

table.datepickerViewYears tbody.datepickerDays,table.datepickerViewYears tbody.datepickerMonths,table.datepickerViewYears tr.datepickerDoW
	{
	display: none;
}

/*Calendar CSS end here*/
.rfq.widget .helpbox {
	position: relative;
}

.rfq.widget .helpbox span {
	position: absolute;
	height: 22px;
	line-height: 22px;
	text-indent: 5px;
	width: 100%;
}

.rfq.widget .helpbox span {
	cursor: default;
	font-family: Arial;
	font-size: 11px;
	overflow: hidden;
	position: absolute;
	z-index: 10004;
}

.rfq.widget .customGrid.headerFreeze.alignX .dataDiv {
	overflow-y: hidden;
	overflow-x: auto;
}

.rfq.widget .customGrid.headerFreeze.alignX .dataDiv .customGridTable {
	margin-left: -1px;
}

.rfq.widget .disabled {
	opacity: 0.3;
	filter: alpha(opacity = 30);
	cursor: default !important;
}

.rfq.widget .radiousBox {
	text-align: left;
	width: 166px;
	height: 50px;
	overflow: hidden;
	line-height: 30px;
	position: absolute;
	left: calc(50% -   83px);
	left: -moz-calc(50% -   83px);
	left: -webkit-calc(50% -   83px);
	top: 40%;
	padding: 10px 10px 10px 31px;
	border-radius: 5px;
}

.rfq.widget .done .icon {
	width: 17px;
	display: block;
	height: 22px;
	position: absolute;
	top: 10px;
	left: 8px;
}

.rfq.widget .loading .icon {
	width: 16px;
	display: block;
	height: 28px;
	line-height: 28px;
	position: absolute;
	top: 10px;
	left: 8px;
}

.dropdownCheckWedget {
	position: absolute;
	width: 114px;
}

.dropdownCheckWedget .checkBox {
	height: 20px;
	width: 100%;
	line-height: 20px;
	overflow: hidden;
	position: relative;
	line-height: 20px;
	cursor: pointer;
}

.dropdownCheckWedget .checkBox input {
	position: absolute;
	left: 6px;
	top: 3px;
}

.dropdownCheckWedget .checkBox span {
	padding-left: 23px;
}

.dropdownCheckWedget .okButton {
	padding: 0;
	width: 100%;
	height: 22px;
	margin: 5px auto;
}

.dropdownCheckWedget .okButton .button {
	margin: 0 auto;
	display: block !important;
}

.dropdownCheckWedget .prevent {
	position: absolute;
	left: -9px;
	top: -6px;
	width: 9px;
	height: 6px;
	display: block;
}

.dropdownCheckWedget .title {
	width: 100%;
	height: 20px;
	line-height: 20px;
	text-align: center;
	display: block;
}

.tag.dropdown ul.isScroll li,.tag.toggleinput ul.isScroll li {
	padding: 0 20px 0 5px !important;
}


text:
.class Lcom/android/internal/policy/impl/GlobalActions$11;
.super Landroid/content/BroadcastReceiver;
.source "GlobalActions.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/policy/impl/GlobalActions;

# direct methods
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;)V
    .locals 0
    .parameter

    .prologue
    .line 949
    iput-object p1, p0, Lcom/android/internal/policy/impl/GlobalActions$11;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method

# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 4
    .parameter "context"
    .parameter "intent"

    .prologue
    const/4 v3, 0x0

    .line 951
    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v0

    .line 952
    .local v0, action:Ljava/lang/String;
    const-string v2, "android.intent.action.CLOSE_SYSTEM_DIALOGS"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_0

    const-string v2, "android.intent.action.SCREEN_OFF"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    .line 954
    :cond_0
    const-string v2, "reason"

    invoke-virtual {p2, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 955
    .local v1, reason:Ljava/lang/String;
    const-string v2, "globalactions"

    invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 956
    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$11;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

    #getter for: Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
    invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$800(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/os/Handler;

    move-result-object v2

    invoke-virtual {v2, v3}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 967
    .end local v1           #reason:Ljava/lang/String;
    :cond_1
    :goto_0
    return-void

    .line 958
    :cond_2
    const-string v2, "android.intent.action.EMERGENCY_CALLBACK_MODE_CHANGED"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 961
    const-string v2, "PHONE_IN_ECM_STATE"

    invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v2

    if-nez v2, :cond_1

    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$11;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

    #getter for: Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
    invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$100(Lcom/android/internal/policy/impl/GlobalActions;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 963
    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$11;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

    #setter for: Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
    invoke-static {v2, v3}, Lcom/android/internal/policy/impl/GlobalActions;->access$102(Lcom/android/internal/policy/impl/GlobalActions;Z)Z

    .line 964
    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$11;->this$0:Lcom/android/internal/policy/impl/GlobalActions;

    const/4 v3, 0x1

    #calls: Lcom/android/internal/policy/impl/GlobalActions;->changeAirplaneModeSystemSetting(Z)V
    invoke-static {v2, v3}, Lcom/android/internal/policy/impl/GlobalActions;->access$300(Lcom/android/internal/policy/impl/GlobalActions;Z)V

    goto :goto_0
.end method


text:
package interdroid.vdb.sm.provider;

import interdroid.vdb.content.ContentChangeHandler;
import interdroid.vdb.content.avro.AvroContentProviderProxy;
import interdroid.vdb.avro.AvroSchema;

import android.content.ContentValues;
import android.content.res.Resources;

/**
 * This is the provider for Avro Schemas stored as records.
 * @author nick <palmer@cs.vu.nl>
 *
 */
public class AvroSchemaProvider extends AvroContentProviderProxy {

	/**
	 * Constructs an avro schema record provider.
	 */
	public AvroSchemaProvider() {
		super(AvroSchema.SCHEMA);
	}

	// Register our change handler so that all schema's get a title
	static {
		// TODO: These should come from the defaults in the schema
		ContentChangeHandler.register(AvroSchema.NAMESPACE,
				AvroSchema.RECORD_DEFINITION, new ContentChangeHandler() {
			public void preInsertHook(final ContentValues values) {
				Resources r = Resources.getSystem();
				values.put("name", r.getString(android.R.string.untitled));
			}
		});
	}

}


text:
function varargout = WaitTrigger(ignoreNum)
%
% Usage: [timeSecs = ] WaitTrigger([ignoreNum]);
%
% Wait for scanner trigger (key press 5) and return the trigger time. The
% optional input specifies how many triggers to ignore (default 0). Press
% ESC will abort code execution and clear screen.

% 2006/04   xl wrote it
% 2011/05   xl added GetChar, to solve the fOPR problem

if nargin<1, ignoreNum=0; end
for i=0:ignoreNum
    [~, secs]=WaitTill('5');
    KbReleaseWait;
end
if nargout, varargout={secs}; end


text:
<bill session="110" type="h" number="2834" updated="2009-01-08T22:45:07-05:00">
	<status><introduced date="1182484800" datetime="2007-06-22"/></status>

	<introduced date="1182484800" datetime="2007-06-22"/>
	<titles>
		<title type="official" as="introduced">To amend the Internal Revenue Code of 1986 to treat income received by partners for performing investment management services as ordinary income received for the performance of services.</title>
	</titles>
	<sponsor id="400238"/>
	<cosponsors>
		<cosponsor id="400290" joined="2007-09-18"/>
		<cosponsor id="400133" joined="2007-06-28"/>
		<cosponsor id="400227" joined="2007-09-04"/>
		<cosponsor id="400080" joined="2007-07-19"/>
		<cosponsor id="400333" joined="2007-06-22"/>
		<cosponsor id="400295" joined="2007-07-19"/>
		<cosponsor id="400323" joined="2007-06-22"/>
		<cosponsor id="400355" joined="2008-01-22"/>
		<cosponsor id="400262" joined="2007-06-22"/>
		<cosponsor id="400387" joined="2007-06-22"/>
		<cosponsor id="400001" joined="2007-08-03"/>
		<cosponsor id="400237" joined="2007-09-07"/>
		<cosponsor id="400140" joined="2007-06-22"/>
		<cosponsor id="400378" joined="2007-10-18"/>
		<cosponsor id="412239" joined="2007-06-28"/>
		<cosponsor id="400371" joined="2007-07-11"/>
		<cosponsor id="412212" joined="2007-08-03"/>
		<cosponsor id="400291" joined="2007-06-22"/>
		<cosponsor id="400033" joined="2007-06-22"/>
		<cosponsor id="400208" joined="2007-06-22"/>
		<cosponsor id="400218" joined="2007-06-22"/>
		<cosponsor id="400240" joined="2007-06-22"/>
		<cosponsor id="400163" joined="2007-08-03"/>
		<cosponsor id="400233" joined="2007-06-22"/>
		<cosponsor id="400100" joined="2007-07-19"/>
		<cosponsor id="400309" joined="2007-06-22"/>
	</cosponsors>
	<actions>
		<action date="1182484800" datetime="2007-06-22"><text>Referred to the House Committee on Ways and Means.</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	6/22/2007--Introduced.
Amends the Internal Revenue Code to treat as ordinary income (i.e., income taxed at regular income tax rates) income received by a partner from an investment services partnership interest. Defines "investment services partnership interest" as any interest in a partnership held by a person who provides services to a partnership by: (1) advising the partnership as to the value of specified assets (e.g., real estate, commodities, or options or derivative contracts); (2) advising the partnership about investing in, purchasing, or selling specified assets; (3) managing, acquiring, or disposing of specified assets; or (4) arranging financing with respect to acquiring specified assets.

</bill>


text:
'use strict';

const RelayRecord = require('RelayRecord');

import type {
  DataID,
  ClientMutationID,
} from 'RelayInternalTypes';

// Maintains a map from the client id to the server id of
// optimistically added nodes
var clientIDToServerIDMap = {};

// For node-create mutations, maintains an index of the mutation to the
// client ID of an optimistically created node (if it exists).
var mutationIDToClientNodeIDMap = {};

// For mutations that have errors, maintains a two-directional index of the
// mutation and node with an error.
var clientMutationIDToErrorNodeID = {};
var clientNodeIDToErrorMutationID = {};

/**
 * @internal
 *
 * Records the client ID and error status of mutations as well as maintaining
 * a mapping of optimistic client IDs to server IDs.
 */
var RelayMutationTracker = {

 /**
  * Checks if the given id represents an object only known on the client side
  * or not. In this case, it is both a client id and does not have a
  * corresponding mapping in the client server id map.
  */
  isClientOnlyID: function(dataID: DataID): boolean {
    return (
      RelayRecord.isClientID(dataID) &&
      !clientIDToServerIDMap[dataID]
    );
  },

  /**
   * Updates the map from the client id to the server id for optimistically
   * added nodes.
   */
  updateClientServerIDMap: function(
    clientID: DataID,
    serverID: DataID
  ): void {
    clientIDToServerIDMap[clientID] = serverID;
  },

  /**
   * Gets the serverID (if one exists) for a given clientID
   */
  getServerIDForClientID: function(
    clientID: DataID
  ): ?DataID {
    return clientIDToServerIDMap[clientID] || null;
  },

  /**
   * Record the root node ID associated with the mutation.
   */
  putClientIDForMutation: function(
    clientID: DataID,
    clientMutationID: ClientMutationID
  ): void {
    mutationIDToClientNodeIDMap[clientMutationID] = clientID;

    // if an error exists for this mutation ID, remove the error on the previous
    // client ID and 'move' the error on the new client ID
    var errorNodeID =
      RelayMutationTracker.getErrorNodeForMutation(clientMutationID);
    if (errorNodeID) {
      RelayMutationTracker.deleteMutationForErrorNode(errorNodeID);
      RelayMutationTracker.putErrorNodeForMutation(clientID, clientMutationID);
    }
  },

  /**
   * Get the root record ID associated with the muation.
   */
  getClientIDForMutation: function(
    clientMutationID: ClientMutationID
  ): ?string {
    return mutationIDToClientNodeIDMap[clientMutationID];
  },

  /**
   * Delete the root record ID associated with the mutation.
   */
  deleteClientIDForMutation: function(
    clientMutationID: ClientMutationID
  ): void {
    delete mutationIDToClientNodeIDMap[clientMutationID];
  },

  /**
   * Record that an error occurred while creating the given (client) record ID.
   */
  putErrorNodeForMutation: function(
    clientID: DataID,
    clientMutationID: ClientMutationID
  ): void {
    clientNodeIDToErrorMutationID[clientID] = clientMutationID;
    clientMutationIDToErrorNodeID[clientMutationID] = clientID;
  },

  /**
   * Find the failed mutation that created the given (client) record ID,
   * if any.
   */
  getMutationForErrorNode: function(
    clientID: DataID
  ): ?ClientMutationID {
    return clientNodeIDToErrorMutationID[clientID];
  },

  /**
   * Find the (client) ID of the record associated with the given mutation,
   * if any.
   */
  getErrorNodeForMutation: function(
    clientMutationID: ClientMutationID
  ): ?DataID {
    return clientMutationIDToErrorNodeID[clientMutationID];
  },

  deleteMutationForErrorNode: function(
    clientID: DataID
  ): void {
    delete clientNodeIDToErrorMutationID[clientID];
  },

  deleteErrorNodeForMutation: function(
    clientMutationID: ClientMutationID
  ): void {
    delete clientMutationIDToErrorNodeID[clientMutationID];
  },
};

module.exports = RelayMutationTracker;


text:
module YTables
using DataFrames

export latex, org

## utility
($)(f::Function, g::Function) = x->f(g(x))

## types
abstract YStyle

immutable LatexStyle <: YStyle
    na::String
    embed_in_table::Bool
    tabular::String
    align::Dict{Symbol, String}
    format::Dict{Symbol, Function}
end

immutable OrgStyle <: YStyle
    na::String
end

immutable YTable
    data
    style::YStyle
end

## constructors
type_align{T<:Number}(_::DataArrays.DataArray{T,1}) = "r"
type_align{T<:String}(_::DataArrays.DataArray{T,1}) = "l"

make_align(data) =
    Dict(n => type_align(data[:, n]) for n = names(data))

type_format{T<:Integer}(_::DataArrays.DataArray{T,1}) = v -> @sprintf("%d", v)
type_format{T<:Real}(_::DataArrays.DataArray{T,1})    = v -> @sprintf("%.2f", v)
type_format{T<:String}(_::DataArrays.DataArray{T,1})  = v -> @sprintf("%s", v)

make_format(data) =
    Dict(n => type_format(data[:, n]) for n in names(data))

formatter(f::String) =   @eval v -> @sprintf($f, v)
formatter(f::Function) = f

formatters(fs) =
    [formatter(v) for (k, v) = fs]

const latex_escape_characters = Dict{String,String}(
    "_" => "\\_",
    "&" => "\\&",
    "%" => "\\%",
    "\\" => "\\\$",
    "#" => "\\#",
    "{" => "\\{",
    "}" => "\\}",
    ">" => "\\textgreater",
    "<" => "\\textless",
    "~" => "\\textasciitilde",
    "^" => "\\textasciicircum",
    "\\" => "\\textasciibackslash")

latex_escape(str::String) = join(map(c->(try latex_escape_characters[c] catch string(c) end),split(str,"")))
latex_escape(sym::Symbol) = Symbol(latex_escape(string(sym)))

function latex(data; embed_in_table::Bool=true, tabular::String="tabular",na::String="-",escape::Bool=true,alignment=Dict(), format=Dict())

    if escape
	# Make copy of data frame so we can change names
	data=copy(data)
	for name in names(data)
		escname=latex_escape(name)
		if name != escname
			rename!(data,name,escname)
		end
	end
        deriv_format = Dict(key=>v->latex_escape(value(v)) for (key,value) in make_format(data))

    else
	deriv_format = make_format(data)
    end

    YTable(data, LatexStyle(na,
                            embed_in_table,
                            tabular,
                            merge(make_align(data), alignment),merge(deriv_format,format)))
end

org(data ; na::String="NA") = YTable(data, OrgStyle(na))

## printing
format_row(row, format::Dict{Symbol, Function}, na::String) =
    [string(isna(row[n]) ? na : format[n](row[n])) for n in names(row)]

function show_rows(io, data, format, na, pre, sep, post)
    for r = eachrow(data)
        println(io, pre, join(format_row(r, format, na), sep), post)
    end
end

function show_table(io::IO, data::DataFrame, style::LatexStyle)
    println(io, string("% latex table generated in Julia ",
                       VERSION, " by YTables"))
    println(io, string("% ", now()))

    if style.embed_in_table
        println(io, "\\begin{table}[ht]")
        println(io, "  \\centering")
    end
    as = [style.align[n] for n in names(data)]
    println(io, "  \\begin{", style.tabular, "}{", join(as), "}")
    println(io, "    \\hline")
    println(io, "    ", join(map(string, names(data)), " & "), " \\\\")
    println(io, "    \\hline")
    show_rows(io, data, style.format, style.na, "    ", " & ", " \\\\")
    println(io, "    \\hline")
    println(io, "  \\end{$(style.tabular)}")
    if style.embed_in_table
        print(io, "\\end{table}")
    end
end

function show_table(io::IO, data::DataFrame, style::OrgStyle)
    valwidths = map(c->mapreduce(length $ string, max, c), eachcol(data))
    widths = Dict(n => max(length(string(n)), vs[1]) for (n,vs) = eachcol(valwidths))
    format = Dict(n => formatter("%$v\s") for (n,v) = widths)
    ns = DataFrame(convert(Array{Any, 1}, [[n] for n in names(data)]), names(data))
    show_rows(io, ns, format, style.na, "| ", " | ", " |")
    println(io, "|-", join([repeat("-", widths[n]) for n = names(data)], "-+-"), "-|")
    show_rows(io, data, format, style.na, "| ", " | ", " |")
end

import Base.show
function show(io::IO, t::YTable)
    show_table(io, t.data, t.style)
end

import Base.writecsv
function writecsv(filename, a::YTable; opts...)
    io = open(filename, "w")
    show(io, a)
    close(io)
end

end # module


text:
package org.apache.lucene.util;

/** Floating point numbers smaller than 32 bits.
 *
 * @lucene.internal
 */
public class SmallFloat {

  /** Converts a 32 bit float to an 8 bit float.
   *
Values less than zero are all mapped to zero.
   *
Values are truncated (rounded down) to the nearest 8 bit value.
   *
Values between zero and the smallest representable value
   *  are rounded up.
   *
   * @param f the 32 bit float to be converted to an 8 bit float (byte)
   * @param numMantissaBits the number of mantissa bits to use in the byte, with the remainder to be used in the exponent
   * @param zeroExp the zero-point in the range of exponent values
   * @return the 8 bit float representation
   */
  public static byte floatToByte(float f, int numMantissaBits, int zeroExp) {
    // Adjustment from a float zero exponent to our zero exponent,
    // shifted over to our exponent position.
    int fzero = (63-zeroExp)<<numMantissaBits;
    int bits = Float.floatToRawIntBits(f);
    int smallfloat = bits >> (24-numMantissaBits);
    if (smallfloat < fzero) {
      return (bits<=0) ?
        (byte)0   // negative numbers and zero both map to 0 byte
       :(byte)1;  // underflow is mapped to smallest non-zero number.
    } else if (smallfloat >= fzero + 0x100) {
      return -1;  // overflow maps to largest number
    } else {
      return (byte)(smallfloat - fzero);
    }
  }

  /** Converts an 8 bit float to a 32 bit float. */
  public static float byteToFloat(byte b, int numMantissaBits, int zeroExp) {
    // on Java1.5 & 1.6 JVMs, prebuilding a decoding array and doing a lookup
    // is only a little bit faster (anywhere from 0% to 7%)
    if (b == 0) return 0.0f;
    int bits = (b&0xff) << (24-numMantissaBits);
    bits += (63-zeroExp) << 24;
    return Float.intBitsToFloat(bits);
  }

  //
  // Some specializations of the generic functions follow.
  // The generic functions are just as fast with current (1.5)
  // -server JVMs, but still slower with client JVMs.
  //

  /** floatToByte(b, mantissaBits=3, zeroExponent=15)
   *
smallest non-zero value = 5.820766E-10
   *
largest value = 7.5161928E9
   *
epsilon = 0.125
   */
  public static byte floatToByte315(float f) {
    int bits = Float.floatToRawIntBits(f);
    int smallfloat = bits >> (24-3);
    if (smallfloat < (63-15)<<3) {
      return (bits<=0) ? (byte)0 : (byte)1;
    }
    if (smallfloat >= ((63-15)<<3) + 0x100) {
      return -1;
    }
    return (byte)(smallfloat - ((63-15)<<3));
 }

  /** byteToFloat(b, mantissaBits=3, zeroExponent=15) */
  public static float byte315ToFloat(byte b) {
    // on Java1.5 & 1.6 JVMs, prebuilding a decoding array and doing a lookup
    // is only a little bit faster (anywhere from 0% to 7%)
    if (b == 0) return 0.0f;
    int bits = (b&0xff) << (24-3);
    bits += (63-15) << 24;
    return Float.intBitsToFloat(bits);
  }

  /** floatToByte(b, mantissaBits=5, zeroExponent=2)
   *
smallest nonzero value = 0.033203125
   *
largest value = 1984.0
   *
epsilon = 0.03125
   */
  public static byte floatToByte52(float f) {
    int bits = Float.floatToRawIntBits(f);
    int smallfloat = bits >> (24-5);
    if (smallfloat < (63-2)<<5) {
      return (bits<=0) ? (byte)0 : (byte)1;
    }
    if (smallfloat >= ((63-2)<<5) + 0x100) {
      return -1;
    }
    return (byte)(smallfloat - ((63-2)<<5));
  }

  /** byteToFloat(b, mantissaBits=5, zeroExponent=2) */
  public static float byte52ToFloat(byte b) {
    // on Java1.5 & 1.6 JVMs, prebuilding a decoding array and doing a lookup
    // is only a little bit faster (anywhere from 0% to 7%)
    if (b == 0) return 0.0f;
    int bits = (b&0xff) << (24-5);
    bits += (63-2) << 24;
    return Float.intBitsToFloat(bits);
  }
}


text:
title: Write Arrow Functions with Parameters
localeTitle: Функции записи стрелки с параметрами
---
## Функции записи стрелки с параметрами

Вот [отличный ресурс об анонимных функциях в JavaScript](http://helephant.com/2008/08/23/javascript-anonymous-functions/) , если вам все еще интересно, что это такое, и их роль.

Теперь вам поручено установить параметры внутри функций стрелок.

## Подсказка 1:

Избавьтесь от ключевого слова `function` . Поместите оператор стрелки.

## Подсказка 2:

Убедитесь, что вы изменили `var` на `const` .

## Предупреждение о спойлере - решение впереди!

## Решение:

```javascript
const myConcat = (arr1, arr2) => {
  "use strict";
  return arr1.concat(arr2);
 };
 // test your code
 console.log(myConcat([1, 2], [3, 4, 5]));

```


text:
![WARNING](http://kubernetes.io/img/warning.png)
![WARNING](http://kubernetes.io/img/warning.png)
![WARNING](http://kubernetes.io/img/warning.png)

PLEASE NOTE: This document applies to the HEAD of the source
tree only. If you are using a released version of Kubernetes, you almost
certainly want the docs that go with that version.

Documentation for specific releases can be found at
[releases.k8s.io](http://releases.k8s.io).

![WARNING](http://kubernetes.io/img/warning.png)
![WARNING](http://kubernetes.io/img/warning.png)
![WARNING](http://kubernetes.io/img/warning.png)

# Kubernetes 101 - Walkthrough

## Pods
The first atom of Kubernetes is a _pod_.  A pod is a collection of containers that are symbiotically grouped.

See [pods](../../../docs/user-guide/pods.md) for more details.

### Intro

Trivially, a single container might be a pod.  For example, you can express a simple web server as a pod:

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: www
spec:
  containers:
    - name: nginx
      image: nginx
```

A pod definition is a declaration of a _desired state_.  Desired state is a very important concept in the Kubernetes model.  Many things present a desired state to the system, and it is Kubernetes' responsibility to make sure that the current state matches the desired state.  For example, when you create a Pod, you declare that you want the containers in it to be running.  If the containers happen to not be running (e.g. program failure, ...), Kubernetes will continue to (re-)create them for you in order to drive them to the desired state. This process continues until you delete the Pod.

See the [design document](../../../DESIGN.md) for more details.

### Volumes

Now that's great for a static web server, but what about persistent storage?  We know that the container file system only lives as long as the container does, so we need more persistent storage.  To do this, you also declare a ```volume``` as part of your pod, and mount it into a container:
```yaml
apiVersion: v1
kind: Pod
metadata:
  name: storage
spec:
  containers:
    - name: redis
      image: redis
      volumeMounts:
          # name must match the volume name below
        - name: redis-persistent-storage
          # mount path within the container
          mountPath: /data/redis
  volumes:
    - name: redis-persistent-storage
      emptyDir: {}
```

Ok, so what did we do? We added a volume to our pod:
```
  volumes:
    - name: redis-persistent-storage
      emptyDir: {}
```

And we added a reference to that volume to our container:
```
      volumeMounts:
          # name must match the volume name below
        - name: redis-persistent-storage
          # mount path within the container
          mountPath: /data/redis
```

In Kubernetes, ```emptyDir``` Volumes live for the lifespan of the Pod, which is longer than the lifespan of any one container, so if the container fails and is restarted, our persistent storage will live on.

If you want to mount a directory that already exists in the file system (e.g. ```/var/logs```) you can use the ```hostPath``` directive.

See [volumes](../../../docs/user-guide/volumes.md) for more details.

### Multiple Containers

_Note:
The examples below are syntactically correct, but some of the images (e.g. kubernetes/git-monitor) don't exist yet.  We're working on turning these into working examples._

However, often you want to have two different containers that work together.  An example of this would be a web server, and a helper job that polls a git repository for new updates:

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: www
spec:
  containers:
  - name: nginx
    image: nginx
    volumeMounts:
    - mountPath: /srv/www
      name: www-data
      readOnly: true
  - name: git-monitor
    image: kubernetes/git-monitor
    env:
    - name: GIT_REPO
      value: http://github.com/some/repo.git
    volumeMounts:
    - mountPath: /data
      name: www-data
  volumes:
  - name: www-data
    emptyDir: {}
```

Note that we have also added a volume here.  In this case, the volume is mounted into both containers.  It is marked ```readOnly``` in the web server's case, since it doesn't need to write to the directory.

Finally, we have also introduced an environment variable to the ```git-monitor``` container, which allows us to parameterize that container with the particular git repository that we want to track.

### What's next?
Continue on to [Kubernetes 201](k8s201.md) or
for a complete application see the [guestbook example](../../../examples/guestbook/README.md)

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/walkthrough/README.md?pixel)]()


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>guiOptions</title>
<meta name="date" content="2014-09-24">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

guiOptions

Classes

OptionsComp

OptionsIntervals

OptionsMCTS

OptionsMinimax

OptionsMultiTrain

OptionsTD

OptionsValueFunc

ParamFilter


text:
package net.kbrz.pokedroid.models.evolution;

import com.google.gson.annotations.SerializedName;

import net.kbrz.pokedroid.models.PokeDroidModel;
import net.kbrz.pokedroid.models.commons.Name;
import net.kbrz.pokedroid.models.commons.NamedApiResource;

import java.util.List;

/**
 * @author Konrad Brzykcy.
 */

@SuppressWarnings("unused")
public class EvolutionTrigger extends PokeDroidModel {

    @SerializedName("id")
    private Integer id;
    @SerializedName("name")
    private String name;
    @SerializedName("names")
    private List<Name> names;
    @SerializedName("pokemon_species")
    private List<NamedApiResource> pokemonSpecies;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Name> getNames() {
        return names;
    }

    public void setNames(List<Name> names) {
        this.names = names;
    }

    public List<NamedApiResource> getPokemonSpecies() {
        return pokemonSpecies;
    }

    public void setPokemonSpecies(List<NamedApiResource> pokemonSpecies) {
        this.pokemonSpecies = pokemonSpecies;
    }
}


text:
class CTabHost : public Framework::Win32::CWindow
{
public:
	enum
	{
		NOTIFICATION_SELCHANGED = 0xA000,
	};

	struct SELCHANGED_INFO : public NMHDR
	{
		uint32 selectedIndex;
		Framework::Win32::CWindow* selectedWindow;
	};

												CTabHost(HWND, const RECT&);
	virtual										~CTabHost();

	Framework::Win32::CWindow*					GetTab(unsigned int);
	void										InsertTab(const TCHAR*, Framework::Win32::CWindow*);

	int											GetSelection();
	void										SetSelection(unsigned int);

protected:
	long										OnSize(unsigned int, unsigned int, unsigned int) override;
	long										OnNotify(WPARAM, NMHDR*) override;

private:
	typedef std::vector<Framework::Win32::CWindow*> TabItemArray;

	void										OnTabSelChanged();

	std::unique_ptr<Framework::Win32::CTab>		m_tab;

	int											m_currentSelection;
	TabItemArray								m_tabItems;
};